/* ==========================================================
   TCGmetr maketa – puffy / comfy / pillowy
   ========================================================== */
:root {
  --teal: #8FD9C9;
  --teal-d: #3E9C8C;
  --teal-dd: #2A7468;
  --teal-l: #DDF5EF;
  --yellow: #FFD166;
  --yellow-d: #E9A93A;
  --yellow-l: #FFF1C9;
  --cream: #F8F4EE;
  --paper: #FFFFFF;
  --ink: #2D4A47;
  --ink-soft: #5F7A76;
  --lilac: #CDB8FF;
  --pink: #FFB8D6;
  --mint: #B5F0D8;
  --good: #23915F;
  --bad: #D2505B;
  --line: rgba(62, 156, 140, .22);
  --r: 24px;
  --r-s: 16px;
  --hdr: 68px;
  --gutter: 16px;
  --shadow-1: 0 2px 4px rgba(45, 74, 71, .06), 0 8px 18px rgba(62, 156, 140, .12);
  --shadow-2: 0 4px 8px rgba(45, 74, 71, .08), 0 16px 32px rgba(62, 156, 140, .2);
  --font: "Fredoka", "Nunito", "Quicksand", "Segoe UI Rounded", ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tile-min: 160px;   /* v3: 172 -> 160 so the grid keeps the same column count next to the wider sidebar */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(143, 217, 201, .28), transparent 38%),
    radial-gradient(circle at 92% 4%, rgba(255, 209, 102, .26), transparent 34%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--teal-dd); }
ul { margin: 0; padding: 0; list-style: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--yellow);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; color: var(--ink);
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 3px; border-radius: 12px; }
.btn:focus-visible, .pill:focus-visible, .lens:focus-visible { outline-offset: 3px; border-radius: 999px; }
input:focus-visible, select:focus-visible { outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 600; text-decoration: none; color: var(--ink);
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink), 0 8px 14px rgba(45, 74, 71, .12);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: scale(1.05) translateY(-1px); }
.btn:active { transform: scale(.94) translateY(3px); box-shadow: 0 1px 0 var(--ink), 0 2px 6px rgba(45, 74, 71, .12); }
.btn-yellow { background: var(--yellow); }
.btn-teal { background: var(--teal); }
.btn-soft { background: var(--teal-l); }
.btn-wide { width: 100%; margin-top: 14px; }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: .9rem; box-shadow: 0 3px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; transform: none !important;
  box-shadow: 0 3px 0 rgba(45, 74, 71, .5); background: #ece7df; border-color: rgba(45, 74, 71, .5);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  height: var(--hdr); padding: 0 var(--gutter);
  background: rgba(248, 244, 238, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 6px 18px rgba(62, 156, 140, .12);
}
.hdr-left { display: flex; align-items: center; gap: 10px; justify-self: start; min-width: 0; }
.game-wrap { position: relative; }
.hdr-right { justify-self: end; }
.hdr-btn { padding: 8px 18px; }
.hdr-btn .ico { font-size: 1.15rem; line-height: 1; }

.popover {
  position: absolute; top: calc(100% + 12px); left: var(--gutter); z-index: 70; width: min(280px, calc(100vw - 32px));
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--shadow-2);
}
.popover[hidden] { display: none; }

.wordmark {
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.wordmark:hover { transform: scale(1.05) rotate(-1deg); }
.wordmark:active { transform: scale(.95); }
.tape { width: 42px; height: 34px; flex: none; filter: drop-shadow(0 3px 0 rgba(45, 74, 71, .18)); }
/* ticket 83: on page load the tape slides out of the case (the hook settles with a tiny bounce), then a small trading card drops onto it.
   The static markup is the finished picture, so no animation (prefers-reduced-motion, no CSS animation support) simply shows the extended tape.
   --pull / --over / --drop are in SVG user units (viewBox cells); the arcade pixel version (arcade.js) sets its own. The animation lives on the SVG parts only,
   the svg box never changes size, so the header layout is the same before, during and after. app.js replays a short version on hover. */
.tape { --pull: 17; --over: 1.2; --drop: 8; }
.tape .tp-pull { animation: tp-out 2s both; }          /* ticket 85: slower pull-out (was 1.15 s), the card drops when the tape is nearly out */
.tape .tp-card { animation: tp-drop .6s 1.5s both; }
@keyframes tp-out {
  0%   { transform: translateX(calc(var(--pull) * -1px)); animation-timing-function: cubic-bezier(.12, .7, .25, 1); }
  72%  { transform: translateX(calc(var(--over) * 1px)); animation-timing-function: ease-in-out; }
  86%  { transform: translateX(calc(var(--over) * -.45px)); animation-timing-function: ease-in-out; }
  100% { transform: none; }
}
@keyframes tp-hov {   /* hover: the tape pulls back a little and extends again */
  0%   { transform: none; animation-timing-function: ease-out; }
  34%  { transform: translateX(calc(var(--pull) * -.5px)); animation-timing-function: cubic-bezier(.12, .7, .25, 1); }
  76%  { transform: translateX(calc(var(--over) * .8px)); animation-timing-function: ease-in-out; }
  100% { transform: none; }
}
@keyframes tp-drop {
  0%   { opacity: 0; transform: translateY(calc(var(--drop) * -1px)); animation-timing-function: ease-in; }
  50%  { opacity: 1; transform: translateY(calc(var(--drop) * .1px)); animation-timing-function: ease-out; }
  72%  { transform: translateY(calc(var(--drop) * -.07px)); animation-timing-function: ease-in-out; }
  100% { opacity: 1; transform: none; }
}
@keyframes tp-hop { 0%, 100% { transform: none; } 45% { transform: translateY(calc(var(--drop) * -.22px)); } }
@media (prefers-reduced-motion: reduce) { .tape .tp-pull, .tape .tp-card { animation: none !important; } }
.wm-text { font-size: 2rem; font-weight: 700; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.wm-tcg, .wm-metr {
  paint-order: stroke fill; -webkit-text-stroke: 5px #fff;
}
.wm-tcg { color: var(--teal); text-shadow: 0 3px 0 var(--teal-d), 0 6px 10px rgba(62, 156, 140, .3); }
.wm-metr { color: var(--yellow); margin-left: 3px; text-shadow: 0 3px 0 var(--yellow-d), 0 6px 10px rgba(233, 169, 58, .3); }

/* ---------- Category bar ---------- */
.catbar { padding: 16px var(--gutter) 4px; position: relative; z-index: 40; }
.catbar-inner { position: relative; max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 22px;
  border-radius: 999px; border: 2px solid var(--line); background: var(--paper);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.02rem;
  box-shadow: 0 3px 0 var(--line), var(--shadow-1);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.pill:hover { transform: scale(1.06); border-color: var(--teal-d); }
.pill:active { transform: scale(.95); }
.pill[aria-current="page"] { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink), var(--shadow-1); }
.caret { font-size: .8rem; opacity: .7; }
.has-menu { position: relative; }
.menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 50; min-width: 270px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 10px;
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top left;
  transition: opacity .18s, transform .18s, visibility .18s;
}
.has-menu.open .menu { opacity: 1; visibility: visible; transform: none; }
.menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 8px 14px; border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 500;
}
.menu a:hover, .menu a:focus-visible { background: var(--teal-l); }
.menu a[aria-current="true"] { background: var(--yellow-l); font-weight: 700; }
.menu .count { font-size: .8rem; color: var(--ink-soft); background: var(--cream); padding: 2px 9px; border-radius: 999px; }

/* ---------- Layout shell ---------- */
.shell {
  flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 14px var(--gutter) 40px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start;
}
.sidebar {
  position: sticky; top: calc(var(--hdr) + 12px);
  max-height: calc(100vh - var(--hdr) - 28px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 10px 10px;
  box-shadow: var(--shadow-1);
  scrollbar-width: thin; scrollbar-color: var(--teal) transparent;
}
.side-title { font-size: 1.15rem; padding: 2px 10px 10px; }
.set-list { display: flex; flex-direction: column; gap: 4px; }
.set-item {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px;
  border-radius: 18px; text-decoration: none; color: var(--ink); border: 2px solid transparent;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background .2s;
}
.set-item:hover { background: var(--teal-l); transform: scale(1.03); }
.set-item[aria-current="page"] { background: var(--yellow-l); border-color: var(--yellow); }
.set-item.is-parent { background: var(--teal-l); }
.set-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.set-name { font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.set-date { font-size: .75rem; color: var(--ink-soft); }
.badge-new {
  margin-left: auto; flex: none; font-size: .65rem; font-weight: 700; letter-spacing: .05em;
  background: var(--yellow); color: var(--ink); padding: 3px 8px; border-radius: 999px; border: 1.5px solid var(--ink);
}

.main { min-width: 0; outline: none; }
.view { min-height: 40vh; }

/* ---------- Image box + fallback ---------- */
.imgbox { position: relative; display: block; width: 100%; height: 100%; }
.imgbox img { display: block; width: 100%; height: 100%; object-fit: contain; }
.imgbox .img-fb {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  background: linear-gradient(135deg, var(--teal-l), var(--yellow-l)); color: var(--teal-dd);
  font-weight: 700; font-size: 1.6rem; text-align: center; padding: 8px; border-radius: inherit; overflow: hidden;
}
.imgbox .img-fb small { font-size: .78rem; font-weight: 500; color: var(--ink-soft); line-height: 1.2; }
.imgbox.failed img { display: none; }
.imgbox.failed .img-fb { display: flex; }

body[data-view="card"] .catbar, body[data-view="card"] .searchrow { display: none; }

/* ---------- Search row ---------- */
.searchrow { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; justify-content: center; margin: 12px 0 22px; }
.searchbox { position: relative; flex: 1 1 340px; max-width: 640px; }
/* region + language stay together: they share a row (right of the search box when it all fits, else on their own row) */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; justify-content: center; min-width: 0; max-width: 100%; }
#q {
  width: 100%; min-height: 60px; padding: 14px 76px 14px 28px;
  border: 2px solid var(--teal-d); border-radius: 999px; background: var(--paper);
  font-size: 1.15rem; font-weight: 500;
  box-shadow: inset 0 3px 6px rgba(62, 156, 140, .1), 0 4px 0 var(--teal-d), 0 10px 20px rgba(62, 156, 140, .16);
  transition: box-shadow .2s, transform .15s;
  -webkit-appearance: none; appearance: none;
}
/* ticket 95: the hint was #8aa5a1 on white (2.6:1); now 5.6:1 and semi-bold. opacity 1: Firefox dims placeholders on its own */
#q::placeholder { color: #4a6e69; font-weight: 600; opacity: 1; }
#q::-webkit-search-cancel-button { display: none; }
#q:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 209, 102, .7), 0 4px 0 var(--teal-d), 0 10px 20px rgba(62, 156, 140, .16); }
.lens {
  position: absolute; right: 8px; top: 50%; width: 52px; height: 52px; margin-top: -26px;
  border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.lens:hover { transform: scale(1.12); }
.lens-ico { display: block; width: 1.7rem; height: 1.7rem; color: var(--teal-dd); animation: bob 3.2s ease-in-out infinite; }
.lens-ico .dicon { width: 100%; height: 100%; stroke-width: 2; }
.orbit { position: absolute; inset: 0; animation: spin 6s linear infinite; pointer-events: none; }
.orbit i {
  position: absolute; left: 50%; top: 50%; font-style: normal; font-size: .7rem; line-height: 1;
  color: var(--yellow-d); width: 12px; height: 12px; margin: -6px 0 0 -6px; text-align: center;
  transform: rotate(var(--a)) translateX(21px);
  filter: drop-shadow(0 0 3px rgba(255, 209, 102, .9));
}
.orbit i .dicon { display: block; width: 100%; height: 100%; fill: currentColor; stroke-width: 1.6; }
.orbit i:nth-child(2) { color: var(--teal-d); width: 10px; height: 10px; margin: -5px 0 0 -5px; filter: drop-shadow(0 0 3px rgba(143, 217, 201, .9)); }
.orbit i:nth-child(3) { color: #c28be8; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; filter: drop-shadow(0 0 3px rgba(205, 184, 255, .9)); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(2.5px); } }

.country-field {
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 20px; min-height: 60px;
  background: var(--paper); border: 2px solid var(--line); border-radius: 999px; box-shadow: 0 4px 0 var(--line), var(--shadow-1);
}
.country-label { font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
.country-select, .cur-select, .pill-select, .lang-btn {
  min-height: 44px; padding: 8px 40px 8px 18px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%232D4A47' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  font-weight: 600; -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
  max-width: 100%; text-overflow: ellipsis;
}
.country-select:hover, .cur-select:hover, .pill-select:hover { transform: scale(1.04); }

/* ---------- View heads ---------- */
.view-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.view-head h1, .view-head h2 { font-size: 1.5rem; }
.view-head p { color: var(--ink-soft); flex-basis: 100%; margin-top: -8px; }
.view-head p.view-note { font-size: .85rem; margin-top: -10px; }
.clear-btn { min-height: 44px; padding: 6px 18px; }
.set-hero {
  position: relative; overflow: hidden; border-radius: var(--r); border: 2px solid var(--line);
  background: linear-gradient(135deg, var(--teal-l), var(--yellow-l)); box-shadow: var(--shadow-1);
  padding: 22px 24px; margin-bottom: 22px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; min-height: 120px;
}
.set-hero .hero-bg { position: absolute; inset: 0; opacity: .32; }
.set-hero .hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.set-hero .hero-logo { position: relative; width: 120px; height: 72px; flex: none; }
.set-hero .hero-txt { position: relative; flex: 1 1 220px; min-width: 0; }
.set-hero h1, .set-hero h2 { font-size: 1.7rem; }
.set-hero p { color: var(--ink-soft); }
.set-hero .btn { position: relative; }
.note-box {
  background: var(--yellow-l); border: 2px dashed var(--yellow-d); border-radius: var(--r-s);
  padding: 12px 16px; margin-bottom: 18px; font-size: .95rem;
}
.empty {
  text-align: center; padding: 48px 20px; background: var(--paper); border: 2px dashed var(--line); border-radius: var(--r);
  color: var(--ink-soft);
}
.empty .big { font-size: 2.4rem; line-height: 1; display: block; margin-bottom: 8px; color: var(--teal-d); }
.empty strong, .empty .empty-title { color: var(--ink); font-size: 1.15rem; font-weight: 700; display: block; margin-bottom: 4px; }

/* ---------- Grid + tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: 18px; }
.grid-sm { --tile-min: 150px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; text-align: left;
  transform: perspective(800px) translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s, border-color .2s;
  -webkit-tap-highlight-color: transparent; min-width: 0;
}
.tile:hover, .tile:focus-visible {
  transform: perspective(800px) translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.015);
  box-shadow: var(--shadow-2); border-color: var(--teal-d);
}
.tile:active { transform: translateY(-1px) scale(.97); }
.tile.tilting { transition: transform .08s linear, box-shadow .25s; }
.tile-img {
  display: block; aspect-ratio: 5 / 7; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #fff, var(--teal-l) 70%);
  padding: 6px;
}
.tile-img .imgbox { border-radius: 14px; }
.tile.product-tile .tile-img { aspect-ratio: 1 / 1; padding: 6px; }
/* product photos come on white/grey studio backdrops: multiply makes the backdrop melt into the tile colour; a slight zoom trims the empty margins */
.tile.product-tile .imgbox img { mix-blend-mode: multiply; transform: scale(var(--pz, 1)); }
.tile-name { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; overflow-wrap: anywhere; }
.tile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-soft); }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: var(--teal-l); color: var(--teal-dd); border: 1.5px solid var(--line); white-space: nowrap;
}
.chip-holo { background: linear-gradient(90deg, #ece3ff, #ffe3f0, #d9f8ec); color: #6d4fb0; border-color: #d7c8f6; }
.chip-psa { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.chip-out { background: #fde2e4; color: #a63a44; border-color: #f3b9bf; }
.chip-soon { background: var(--yellow-l); color: #8a6414; border-color: var(--yellow); }
.price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-top: auto; }
.price-from { font-size: .8rem; color: var(--ink-soft); }
.price { font-size: 1.28rem; font-weight: 700; line-height: 1.1; }
.price-usd { font-size: .78rem; color: var(--ink-soft); }
.price-none { font-size: .85rem; color: var(--bad); font-weight: 500; line-height: 1.3; }
.price-psa-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: auto; }
.psa-badge { background: var(--yellow); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-weight: 700; font-size: .8rem; }
.price-psa { font-size: 1.3rem; font-weight: 700; }
.price-raw { font-size: .8rem; color: var(--ink-soft); }
.tile.dim { opacity: .55; filter: saturate(.6); }
.tile.dim:hover { opacity: .85; }
.tile .btn { margin-top: 4px; }
.product-tile[data-product] { cursor: pointer; }

.sentinel { text-align: center; padding: 26px 10px 8px; color: var(--ink-soft); min-height: 24px; }
.loading-row { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--teal-d); animation: hop .9s ease-in-out infinite; }
.dots i:nth-child(2) { background: var(--yellow-d); animation-delay: .15s; }
.dots i:nth-child(3) { background: #c28be8; animation-delay: .3s; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
.end-note { font-weight: 600; color: var(--teal-dd); background: var(--teal-l); display: inline-block; padding: 10px 22px; border-radius: 999px; }

/* ---------- Card detail ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; margin: 4px 0 16px; color: var(--ink-soft); }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; font-weight: 500; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; }
.detail { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 36px; align-items: start; }
.detail-left { position: sticky; top: calc(var(--hdr) + 16px); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cardbtn { display: block; perspective: 1000px; width: 100%; padding: 0; margin: 0; border: 0; background: transparent; border-radius: 6%/4.3%; -webkit-tap-highlight-color: transparent; }
.cardbtn:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 5px; }
.tilt-zone { width: 100%; touch-action: pan-y; }
.float-wrap { animation: floaty 5.5s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  filter: drop-shadow(0 18px 26px rgba(45, 74, 71, .28));
}
.tilt-zone.active .tilt { transition: transform .08s linear; }
.flipper { display: block; position: relative; aspect-ratio: 5 / 7; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.2, .4, 1); }
.flipped .flipper { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 6%/4.3%; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--paper); border: 0;
}
.face.back-face { transform: rotateY(180deg); }
.face .imgbox { border-radius: inherit; }
.face .imgbox .img-fb { font-size: 2.4rem; }
.backsvg { display: block; width: 100%; height: 100%; max-width: none; }
.glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--o, 0); transition: opacity .35s; }
.glare::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 18%, rgba(205, 184, 255, .75) 34%, rgba(181, 240, 216, .75) 48%, rgba(255, 184, 214, .75) 62%, rgba(255, 233, 160, .6) 74%, transparent 88%);
  background-size: 260% 260%;
  background-position: var(--mx, 50%) var(--my, 50%);
  mix-blend-mode: color-dodge; opacity: .55;
}
.glare::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, .18) 28%, transparent 55%);
  mix-blend-mode: soft-light;
}
.small-flip { width: 60%; }
.small-flip .flipper { transition-duration: .7s; }
.small-flip .cardbtn { filter: drop-shadow(0 10px 16px rgba(45, 74, 71, .22)); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.small-flip .cardbtn:hover { transform: scale(1.04); }
.small-flip .cardbtn:active { transform: scale(.96); }
.cap { text-align: center; font-size: .8rem; color: var(--ink-soft); margin-top: 8px; }
.flip-hint { font-size: .8rem; color: var(--ink-soft); text-align: center; }

.detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.detail-title h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); margin: 8px 0 18px; font-size: .95rem; }
.meta a { color: var(--teal-dd); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.panel {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--shadow-1); margin-bottom: 20px;
}
.panel h2 { font-size: 1.2rem; margin-bottom: 12px; }
.best-box {
  background: linear-gradient(135deg, var(--yellow-l), #fff 70%); border-color: var(--yellow);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
}
.best-box .label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.best-box .big { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.1; }
.best-box .where { color: var(--ink-soft); margin-top: 2px; }
.best-box .grow { flex: 1 1 200px; min-width: 0; }
.best-box .sample-note { flex-basis: 100%; font-size: .8rem; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-1); }
.stat .k { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.stat .v { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.stat .u { font-size: .78rem; color: var(--ink-soft); }
.stat.psa { background: var(--yellow-l); border-color: var(--yellow); }

.chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.chart-head h2 { margin: 0; margin-right: auto; }
.seg { display: inline-flex; background: var(--cream); border-radius: 999px; padding: 4px; gap: 2px; border: 2px solid var(--line); }
.seg button {
  min-height: 44px; min-width: 56px; padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 600;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background .2s;
}
.seg button:hover { transform: scale(1.06); }
.seg button[aria-pressed="true"] { background: var(--yellow); box-shadow: 0 2px 0 var(--ink); }
.delta { font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: .95rem; white-space: nowrap; }
.delta.up { background: #d9f5e6; color: var(--good); }
.delta.down { background: #fde2e4; color: var(--bad); }
.delta.flat { background: var(--cream); color: var(--ink-soft); }
.chart-wrap { position: relative; margin: 0 -4px; }
.chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; overflow: visible; }
.chart-svg text { font-family: var(--font); fill: var(--ink-soft); font-size: 11px; }
.chart-svg .grid-l { stroke: rgba(62, 156, 140, .2); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-svg .axis-l { stroke: rgba(62, 156, 140, .4); stroke-width: 1.5; }
.chart-svg .line { fill: none; stroke: var(--teal-d); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .mk-max { fill: var(--good); stroke: #fff; stroke-width: 2; }
.chart-svg .mk-min { fill: var(--bad); stroke: #fff; stroke-width: 2; }
.chart-svg .mk-txt { font-weight: 600; font-size: 11px; fill: var(--ink); }
.chart-svg .ch-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-svg .ch-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.5; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -125%);
  background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 14px; font-size: .85rem; white-space: nowrap;
  box-shadow: 0 6px 14px rgba(45, 74, 71, .3); line-height: 1.3; text-align: center;
}
.chart-tip[hidden] { display: none; }
.chart-tip small { display: block; opacity: .75; font-size: .75rem; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: .85rem; color: var(--ink-soft); margin-top: 8px; }
.muted { color: var(--ink-soft); }
/* multi-source chart: legend toggles, availability bars, multi-line tooltip */
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; }
.leg-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 4px 12px 4px 8px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--paper); font-weight: 600; font-size: .82rem; color: var(--ink);
  transition: background .2s, opacity .2s;
}
.leg-btn[aria-pressed="true"] { background: var(--cream); border-color: var(--ink-soft); }
.leg-btn[aria-pressed="false"] { opacity: .5; text-decoration: line-through; }
.leg-btn.is-empty[aria-pressed="true"] { opacity: .65; }
.leg-sw { flex: none; display: block; }
.leg-item { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.leg-bar { width: 18px; height: 14px; border-radius: 3px; background: rgba(95, 122, 118, .28); flex: none; }
.chart-svg .ch-bar { fill: rgba(95, 122, 118, .22); }
.chart-svg .ax2 { fill: var(--ink-soft); opacity: .85; }
.chart-tip.multi { transform: translate(-50%, 0); text-align: left; padding: 8px 12px; max-width: 100%; }
.chart-tip.multi strong { display: block; margin-bottom: 4px; font-size: .85rem; }
.chart-tip .tt-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; line-height: 1.5; }
.chart-tip .tt-row b { margin-left: auto; padding-left: 12px; font-weight: 700; }
.chart-tip .tt-sw { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1.5px solid #fff; }
.chart-tip .tt-n { opacity: .8; margin-top: 2px; }
.chart-note { margin: 6px 0 0; font-size: .85rem; color: var(--ink-soft); }

.offers-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.offers-head h2 { margin: 0; margin-right: auto; }
.offers-head .country-field { min-height: 52px; padding-left: 16px; box-shadow: 0 3px 0 var(--line); }
#offers-panel, #shops-panel { container: offers / inline-size; }
.table-scroll { width: 100%; overflow-x: auto; }   /* safety net only; the stacked layout below kicks in before this is needed */
table.offers { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.offers th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); font-weight: 600; padding: 0 8px 2px; }
/* break-word, NOT anywhere: `anywhere` lowers min-content to one letter, which let the shop name and
   its tags shrink to a letter per line inside the (flex) stacked row at ~900-1024px */
.offers td { background: var(--cream); padding: 8px 8px; vertical-align: middle; overflow-wrap: break-word; }
.offers td:first-child, .offers th:first-child { padding-left: 12px; }
.offers td:last-child, .offers th:last-child { padding-right: 10px; }
.offers .btn-small { padding: 8px 12px; white-space: nowrap; }
.offers td:first-child { border-radius: 18px 0 0 18px; }
.offers td:last-child { border-radius: 0 18px 18px 0; text-align: right; }
.offers tr.best td { background: var(--yellow-l); }
.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600;
  background: #ece6f8; color: #6d4fb0; vertical-align: middle;
}
.tag-best { background: var(--yellow); color: var(--ink); }
.total { font-weight: 700; }
.no-offers { text-align: center; padding: 22px 12px; color: var(--bad); font-weight: 500; }
.no-offers .btn { margin-top: 12px; }
/* CardTrader offers: card price and shipping shown separately + total, visitor-chosen sorting */
.offers-sub { margin: -4px 0 12px; font-size: .85rem; color: var(--ink-soft); line-height: 1.35; }
.offer-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.offer-sort-label { font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
.offers-foot { margin: 6px 0 0; font-size: .85rem; color: var(--ink-soft); }
.offers-stale { color: var(--bad); font-weight: 600; }
.offers-ct th, .offers-ct td { padding-left: 4px; padding-right: 4px; }
.offers-ct td:first-child, .offers-ct th:first-child { padding-left: 10px; }
.offers-ct td:last-child, .offers-ct th:last-child { padding-right: 6px; }
.offers-ct .seller { display: block; min-width: 0; }
.offers-ct .sname { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.offers-ct .sname strong { overflow-wrap: break-word; line-height: 1.15; min-width: 0; }   /* long shop names wrap at spaces, compactly */
.offers-ct .tag { white-space: nowrap; margin-left: 0; }
.offers-ct .sub { display: block; margin-top: 2px; font-size: .75rem; line-height: 1.4; color: var(--ink-soft); font-weight: 500; }
.offers-ct td[data-label="Cena karty"], .offers-ct td[data-label="Cena"], .offers-ct td.total { white-space: nowrap; }
.offers-ct .ship, .offers-ct .ship-p { display: block; }
.offers-ct .ship-p { white-space: nowrap; }
.offers-ct .ship-unk, .offers-ct td.total [role="img"] { font-weight: 700; color: var(--ink-soft); cursor: help; }
.offers-ct .ship-m { display: block; margin-top: 2px; font-size: .72rem; line-height: 1.4; color: var(--ink-soft); font-weight: 500; }
.offers-ct .chip { margin-left: 2px; }
.offers-ct .btn-small { padding: 6px 8px; font-size: .8rem; }
/* ticket 49: block Obchody (shop offers): the CardTrader table look, plus sold-out rows and the collapsed lists */
.offers-shops .sub { white-space: normal; }
.offers-shops tr.sold-out td { opacity: .62; }
.offers-shops td[data-label="Cena"] .sub { white-space: nowrap; }
.so-more { margin: 8px 0 0; background: var(--cream); border-radius: var(--r-s); padding: 6px 12px; font-size: .9rem; }
.so-more > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.so-more ul { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 4px; }
.so-more li { overflow-wrap: break-word; }
.so-more li .sub { font-size: .75rem; color: var(--ink-soft); }
.chip-trk { background: #dff5e8; color: #1d6f49; border-color: #a9dcc0; }
.chip-rev { background: #ece3ff; color: #6d4fb0; border-color: #d7c8f6; }
/* ticket 73: shipping estimate (a tariff scaled from the seller's CZ price), rough fallback, CardTrader Zero hub fee; each has a tooltip and the text says what it is */
.chip-est { background: #fff3d1; color: #6b4a07; border-color: #e9c46a; cursor: help; }
.chip-est.chip-fb { background: #ffe4dc; color: #8a2f12; border-color: #f0b5a3; }
.chip-zero { background: #dff0ff; color: #1b5a8c; border-color: #a9cdea; cursor: help; }
.chip-fb { border-style: dashed; }   /* a rough estimate also differs by its border, not only by colour (the arcade theme paints every chip alike) */
/* ticket 73 (fix wave): the estimate chip, the "~" and the longer tags must not widen the table past a ~490px panel (1280px, arcade theme): the row
   button (arcade gives it min-width 124px) and the tag may shrink / wrap, the chips sit under the price */
.offers-ct .tag { white-space: normal; text-align: center; line-height: 1.2; }
.offers-ct .ship-m .chip { display: inline-block; margin: 2px 0 0 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: center; line-height: 1.2; }
html[data-theme="arcade"] .offers-ct td:last-child .btn-small { min-width: 0; padding-left: 6px; padding-right: 6px; font-size: .95rem !important; }
.offers-ct th { overflow-wrap: anywhere; hyphens: auto; }   /* long column names ("Kartenpreis", "Összesen") shrink instead of widening the table */
.offers-ct td.total .cv { white-space: nowrap; }
.offers-ct td:last-child .btn-small { overflow-wrap: break-word; hyphens: auto; }
:lang(fi) .offers-ct td:last-child .btn-small, :lang(et) .offers-ct td:last-child .btn-small, :lang(lt) .offers-ct td:last-child .btn-small { overflow-wrap: anywhere; }   /* fi "CardTraderissa": the one word wider than the column */   /* "CardTraderissa" (fi) and similar long words break instead of widening the row */
.offers-ct tr[data-ship-src="tariff_estimate"] .ship-p, .offers-ct tr[data-ship-src="fallback"] .ship-p { font-style: italic; }
.tag-best[data-ship-unclear] { background: var(--cream); color: var(--ink); border: 1px dashed var(--ink-soft); }
.offers-dest { max-width: 62ch; }
/* ticket 33: a price that rests on one uncorroborated listing - neutral grey, not a warning colour */
.chip-lone { background: var(--cream); color: var(--ink-soft); border-color: var(--line); font-weight: 600; cursor: help; }
.price-line .chip-lone { align-self: center; font-size: .66rem; padding: 1px 8px; }
.best-box .big .chip-lone { margin-left: 10px; vertical-align: middle; font-size: .72rem; }
.offers-ct td .chip-lone { display: inline-block; margin: 3px 0 0 6px; font-size: .66rem; padding: 1px 8px; vertical-align: middle; }
.similar { margin-top: 12px; }
.similar h2 { font-size: 1.3rem; margin-bottom: 14px; }
.empty-chart { text-align: center; padding: 34px 16px; background: var(--cream); border-radius: var(--r-s); color: var(--ink-soft); }
.empty-chart .big { font-size: 2rem; line-height: 1; display: block; margin-bottom: 6px; color: var(--teal-d); }

/* Offers table: stacked rows whenever its own panel is narrow (container query, not viewport) */
@container offers (max-width: 700px) {
  table.offers:not(.offers-ct), .offers:not(.offers-ct) tbody, .offers:not(.offers-ct) tr, .offers:not(.offers-ct) td { display: block; width: 100%; }
  .offers:not(.offers-ct) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .offers:not(.offers-ct) tr { background: var(--cream); border-radius: 20px; padding: 8px 14px; margin-bottom: 10px; border: 2px solid transparent; }
  .offers:not(.offers-ct) tr.best { background: var(--yellow-l); border-color: var(--yellow); }
  .offers:not(.offers-ct) td, .offers:not(.offers-ct) tr.best td { background: transparent; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; border-radius: 0 !important; }
  .offers:not(.offers-ct) td::before { content: attr(data-label); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 600; text-align: left; flex: none; }
  .offers:not(.offers-ct) td:first-child, .offers:not(.offers-ct) td:last-child { padding-left: 0; padding-right: 0; }
  /* Shop cell: name + tags are whole units that wrap onto the next line instead of being squeezed */
  .offers:not(.offers-ct) td[data-label="Shop"] { flex-wrap: wrap; justify-content: flex-end; align-items: center; row-gap: 4px; }
  .offers:not(.offers-ct) td[data-label="Shop"]::before { margin-right: auto; }
  .offers:not(.offers-ct) td[data-label="Shop"] > * { flex: 0 0 auto; white-space: nowrap; }
  .offers:not(.offers-ct) td:last-child { padding-top: 8px; }
  .offers:not(.offers-ct) td:last-child::before { content: none; }
  .offers:not(.offers-ct) td:last-child .btn { width: 100%; }
}
/* roomy stacked rows (tablet / small laptop): button keeps its natural size, right-aligned, instead of a full-width bar */
@container offers (min-width: 480px) and (max-width: 700px) {
  /* `.offers:not(.offers-ct) tr.best td` above has higher specificity, so name the best row too or its button stays left */
  .offers:not(.offers-ct) td:last-child, .offers:not(.offers-ct) tr.best td:last-child { justify-content: flex-end; }
  .offers:not(.offers-ct) td:last-child .btn { width: auto; }
}

/* CardTrader table: a real table down to a ~450px panel (5 columns); stacked cards with data-labels only below that (phones) */
@container offers (max-width: 451px) {
  table.offers-ct, .offers-ct tbody, .offers-ct tr, .offers-ct td { display: block; width: 100%; }
  .offers-ct thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .offers-ct tr { background: var(--cream); border-radius: 20px; padding: 8px 14px; margin-bottom: 10px; border: 2px solid transparent; }
  .offers-ct tr.best { background: var(--yellow-l); border-color: var(--yellow); }
  .offers-ct td, .offers-ct tr.best td { background: transparent; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; border-radius: 0 !important; }
  .offers-ct td::before { content: attr(data-label); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 600; text-align: left; flex: none; }
  .offers-ct td:first-child, .offers-ct td:last-child { padding-left: 0; padding-right: 0; }
  .offers-ct td > .cv { min-width: 0; text-align: right; }
  /* the shop name is the card's header: full width, left-aligned, no label (long names wrap at spaces) */
  .offers-ct td[data-label="Prodejce"], .offers-ct td[data-label="Obchod"] { text-align: left; }
  .offers-ct td[data-label="Prodejce"]::before, .offers-ct td[data-label="Obchod"]::before { content: none; }
  .offers-ct td[data-label="Prodejce"] > .cv, .offers-ct td[data-label="Obchod"] > .cv { text-align: left; }
  .offers-ct .seller .sname { justify-content: flex-start; }
  .offers-ct td:last-child { padding-top: 8px; }
  .offers-ct td:last-child::before { content: none; }
  .offers-ct td:last-child .btn { width: 100%; }
}

/* ---------- Footer / toast / modal ---------- */
.site-footer { text-align: center; padding: 22px var(--gutter) 28px; color: var(--ink-soft); font-size: .9rem; border-top: 2px solid var(--line); background: rgba(255, 255, 255, .5); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 500;
  box-shadow: var(--shadow-2); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), opacity .25s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.modal { border: 2px solid var(--ink); border-radius: 28px; padding: 26px 26px 24px; width: min(400px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 8px 0 var(--ink), 0 24px 50px rgba(45, 74, 71, .35); }
.modal::backdrop { background: rgba(45, 74, 71, .45); backdrop-filter: blur(3px); }
.modal h2 { font-size: 1.5rem; margin-bottom: 4px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--cream); font-size: 1.5rem; line-height: 1; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.modal-x:hover { transform: scale(1.1) rotate(8deg); }
.field-label { display: block; font-weight: 600; margin: 16px 0 6px; }
.field { width: 100%; min-height: 48px; padding: 10px 18px; border: 2px solid var(--teal-d); border-radius: 999px; background: #fff; box-shadow: inset 0 2px 4px rgba(62, 156, 140, .12); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail { gap: 26px; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
}
@media (max-width: 899px) {
  :root { --hdr: 64px; }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
  .sidebar {
    position: static; max-height: none; overflow-y: visible; padding: 8px; border-radius: 22px; order: -1;
  }
  .side-title { display: none; }
  .set-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .set-item { flex: none; scroll-snap-align: start; border: 2px solid var(--line); background: var(--cream); min-height: 48px; padding: 6px 14px 6px 8px; border-radius: 999px; }
  .set-item .set-date { display: none; }
  .set-name { white-space: nowrap; overflow-wrap: normal; }
  .badge-new { margin-left: 4px; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-left { position: static; }
  .tilt-zone { max-width: 340px; }
  .small-flip { width: 50%; max-width: 200px; }
  .catbar-inner { justify-content: center; }
}
@media (max-width: 620px) {
  .has-menu { position: static; }
  .menu { left: 0; right: 0; min-width: 0; }
  .grid { gap: 12px; --tile-min: 146px; }
  .grid-sm { --tile-min: 140px; }
  .tile { padding: 8px 8px 12px; border-radius: 20px; }
  .price { font-size: 1.1rem; }
  .pill { padding: 8px 16px; font-size: .95rem; }
  .catbar-inner { gap: 8px; }
  .searchrow { margin-top: 6px; }
  .filters { flex: 1 1 100%; }
  .country-field { flex: 1 1 100%; justify-content: space-between; }
  .country-select, .lang-btn { flex: 1; min-width: 0; max-width: 240px; }
  .cur-select { flex: 1; min-width: 0; max-width: 240px; }
  .panel { padding: 14px; }
  .wm-text { font-size: 1.6rem; }
  .tape { width: 34px; height: 28px; }
  .set-hero { padding: 16px; }
  .set-hero .hero-logo { width: 90px; height: 56px; }


}
@media (max-width: 479px) {
  :root { --gutter: 12px; }
  .site-header { gap: 6px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .orbit { display: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
  .tilt { transform: none !important; }
}


/* ==========================================================
   v2 – game selector, language menu, region select, picker, set toolbar
   ========================================================== */
.chip-lang { background: #ece6f8; color: #6d4fb0; border-color: #d7c8f6; }
.soon {
  flex: none; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--yellow-l); color: #8a6414; border: 1.5px solid var(--yellow); padding: 1px 8px; border-radius: 999px;
}

/* header: game selector */
.game-btn .caret { font-size: .8rem; }
.game-menu { width: min(300px, calc(100vw - 32px)); left: 0; padding: 8px; max-height: min(72vh, 560px); overflow-y: auto; }
.gm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 14px;
  border: 0; border-radius: 14px; background: transparent; text-align: left; font-weight: 600;
}
.gm-item:hover:not([disabled]), .gm-item:focus-visible { background: var(--teal-l); }
.gm-item[aria-checked="true"] { background: var(--yellow-l); }
.gm-item[disabled] { cursor: not-allowed; color: var(--ink-soft); font-weight: 500; }
.gm-check { color: var(--good); font-weight: 700; }

/* sidebar header + "all editions" entry points */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 8px; }
.side-head .side-title { padding: 2px 8px; }
.side-pick { min-height: 44px; padding: 6px 14px; font-size: .85rem; box-shadow: 0 3px 0 var(--ink); }
.side-all {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 6px; padding: 6px 10px;
  border: 0; background: transparent; color: var(--teal-dd); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 14px;
}
.side-all:hover { background: var(--teal-l); }
.side-empty { padding: 10px 12px; font-size: .85rem; color: var(--ink-soft); }
.set-item .chip-lang, .pk-row .chip-lang { margin-left: auto; flex: none; }
.chip-lang + .badge-new { margin-left: 6px; }

/* region + language fields in the search row */
.lang-field { position: relative; }
.lang-btn {
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%232D4A47' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  padding: 8px 40px 8px 18px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; text-align: left; white-space: nowrap;
}
.lang-btn:hover { transform: scale(1.04); }
.lang-btn .caret { display: none; }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 55; width: max(100%, 290px); max-width: calc(100vw - 32px);
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 8px; box-shadow: var(--shadow-2);
}
.lang-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 14px; cursor: pointer; font-weight: 500; }
.lang-opt:hover:not(.is-off) { background: var(--teal-l); }
.lang-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lang-opt.is-off { color: var(--ink-soft); cursor: not-allowed; }
.lang-opt.is-off input { cursor: not-allowed; }
.lo-box { flex: none; width: 22px; height: 22px; border-radius: 8px; border: 2px solid var(--ink); background: var(--paper); position: relative; }
.lang-opt input:checked + .lo-box { background: var(--teal); }
.lang-opt input:checked + .lo-box::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.lang-opt input:focus-visible + .lo-box { outline: 3px solid var(--teal-d); outline-offset: 2px; }
.lang-opt.is-off .lo-box { opacity: .45; border-style: dashed; }
.lo-name { flex: 1; min-width: 0; }
.lo-hint { display: block; font-size: .72rem; font-weight: 500; line-height: 1.2; color: var(--ink-soft); }

/* set-view toolbar */
.set-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 18px; padding: 12px 14px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1);
}
.tb-field { display: flex; align-items: center; gap: 10px; }
.tb-search { flex: 1 1 200px; min-width: 0; }
.tb-search .field { min-height: 48px; }
.toggle-chip {
  min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--cream); font-weight: 600;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background .2s;
}
.toggle-chip:hover { transform: scale(1.05); border-color: var(--teal-d); }
.toggle-chip[aria-pressed="true"] { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tb-count { margin-left: auto; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

/* all-editions picker (native <dialog>) */
html.scroll-lock { overflow: hidden; }
.picker {
  padding: 0; margin: 0; color: var(--ink); background: var(--paper); overflow: hidden;
  border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 0 8px 0 var(--ink), 0 24px 50px rgba(45, 74, 71, .35);
}
.picker[open] { display: flex; flex-direction: column; }
.picker-pop { position: fixed; inset: 0; margin: auto; max-width: none; max-height: none; width: min(1400px, 94vw); height: 90vh; }   /* ticket 81: was min(1100px, 94vw) x min(88vh, 960px) */
.picker-pop::backdrop { background: rgba(45, 74, 71, .45); }
.picker-sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.picker-sheet::backdrop { background: rgba(45, 74, 71, .45); }
.picker-in { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 14px 14px 8px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.picker-head h2 { font-size: 1.3rem; }
.picker-x { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--cream); font-size: 1.5rem; line-height: 1; flex: none; }
.picker-count { font-size: .85rem; margin: 8px 4px 4px; }
.picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--teal) transparent; padding-right: 2px; }
.pk-group h3 {
  position: sticky; top: 0; z-index: 1; background: var(--paper); padding: 10px 8px 4px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft);
}
.pk-group h3 .count { font-weight: 500; background: var(--cream); padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.pk-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 18px; text-decoration: none; color: var(--ink);
  border: 2px solid transparent;
}
.pk-row:hover, .pk-row:focus-visible { background: var(--teal-l); }
.pk-row .set-name { overflow-wrap: anywhere; }
.pk-nocards { font-style: italic; }
.pk-empty { padding: 28px 12px; text-align: center; color: var(--ink-soft); }

@media (max-width: 899px) {
  .side-head { padding: 0 2px 4px; }
  .side-head .side-title { display: none; }
  .side-pick { margin-left: auto; }
  .side-all { margin-top: 0; }
  .picker-in { padding: 14px 14px max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 860px) {   /* v3: was 760px - three buttons on the right need the room */
  #pokedex-btn .lbl { display: none; }
  #pokedex-btn { width: 44px; padding: 8px; }
}
@media (max-width: 620px) {
  .tb-field { flex: 1 1 100%; justify-content: space-between; }
  .tb-field .pill-select { flex: 1; min-width: 0; max-width: 240px; }
  .tb-search { flex: 1 1 100%; }
  .tb-count { margin-left: auto; }
  .set-toolbar { padding: 10px 12px; }
}
@media (max-width: 600px) {
  #login-btn .lbl { display: none; }
  #login-btn { width: 44px; padding: 8px; }
  .game-btn { padding: 8px 12px; }
  .game-btn .caret { display: none; }
  #game-label { white-space: nowrap; }
  /* centred wordmark while both sides have room; otherwise the left cluster (Pokédex + game name) keeps its width and the wordmark slides right */
  .site-header { grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
  .hdr-left { gap: 6px; }
  .game-wrap { position: static; }
  .game-menu, .popover { left: var(--gutter); right: var(--gutter); width: auto; top: calc(100% + 8px); }
}
/* v3: the game button is icon + "HRA" caption (name hidden) up to 479px - there are now three buttons on the right (see the v3 block at the end) */
@media (max-width: 380px) {
  .wm-text { font-size: 1.35rem; }
  .tape { width: 30px; height: 24px; }
  .wordmark { gap: 6px; }
}

/* region / language fields must be able to shrink inside narrow containers (phones, narrow offers panel) */
.country-field { min-width: 0; max-width: 100%; }
.country-label { white-space: nowrap; flex: none; }
.country-select, .cur-select, .pill-select, .lang-btn { min-width: 0; }
.offers-head .country-field { flex: 1 1 220px; flex-wrap: wrap; row-gap: 2px; padding: 4px 8px 4px 16px; }
.offers-head .country-select, .offers-head .shipto-select, .offers-head .shoplang-select { flex: 1 1 150px; }
.pk-row .badge-new { margin-left: auto; }
.pk-row .chip-lang + .badge-new { margin-left: 6px; }


/* ==========================================================
   v2 B – binder / collection / portfolio
   ========================================================== */
/* header: Binder button next to "Přihlásit" */
.hdr-right { display: flex; align-items: center; gap: 10px; }
#binder-btn[aria-current="page"] { background: var(--yellow); }
@media (max-width: 760px) {
  #binder-btn .lbl { display: none; }
  #binder-btn { width: 44px; padding: 8px; }
}

/* card tile: round "+" button (sibling of the tile link, so it never triggers the link) */
.tile-host { position: relative; display: flex; min-width: 0; }
.tile-host > .tile { flex: 1 1 auto; }
.tile-host:hover > .tile, .tile-host:focus-within > .tile {
  transform: perspective(800px) translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.015);
  box-shadow: var(--shadow-2); border-color: var(--teal-d);
}
.tile-add {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink);
  font-size: 1.7rem; font-weight: 700; line-height: 1; box-shadow: 0 3px 0 var(--ink), 0 6px 12px rgba(45, 74, 71, .2);
  opacity: 0; transition: opacity .15s, transform .15s cubic-bezier(.3, 1.6, .5, 1);
  -webkit-tap-highlight-color: transparent;
}
.tile-host:hover .tile-add, .tile-host:focus-within .tile-add, .tile-add:focus-visible { opacity: 1; }
.tile-add:hover { transform: scale(1.1); }
.tile-add:active { transform: scale(.92) translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tile-add:focus-visible { outline-offset: 2px; border-radius: 50%; }
@media (hover: none) { .tile-add { opacity: 1; } }
@media (max-width: 620px) { .tile-add { top: 10px; right: 10px; } }

/* card page: "Přidat do binderu" next to the best-price box */
.best-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.best-row #best-box { flex: 1 1 320px; min-width: 0; }
.best-add { flex: 0 0 auto; margin-bottom: 20px; }

/* card page: "Hlídat cenu" (price watch, ticket 38) */
.watch-box { margin-bottom: 20px; }
.watch-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 10px; }
.watch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.watch-label { flex: 1 1 220px; min-width: 0; font-weight: 600; }
.watch-field { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 200px; }
.watch-field .field { width: 100%; min-width: 0; text-align: right; }
.watch-unit { font-weight: 600; }
.watch-row .btn { flex: 0 0 auto; }
.watch-row .btn[aria-disabled="true"], .watch-row .btn:disabled { opacity: .55; pointer-events: none; box-shadow: none; }
.watch-note { margin-top: 10px; font-size: .85rem; color: var(--ink-soft); }
.watch-dev { display: block; margin-top: 4px; }
@media (max-width: 420px) { .watch-field { flex: 1 1 100%; } .watch-row .btn { flex: 1 1 100%; } }

/* toast with a link */
.toast.has-link { border-radius: 22px; }
.toast.has-link.show { pointer-events: auto; }
.toast-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--yellow); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.toast:not(.show) .toast-link { visibility: hidden; }

/* add / edit dialogs */
.bd-modal { padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.bd-modal.bd-small { width: min(400px, calc(100vw - 24px)); }
.bd-in { padding: 22px 22px 20px; min-width: 0; }
.bd-modal h2 { padding-right: 52px; }
.bd-card { display: flex; align-items: center; gap: 12px; margin: 12px 0 2px; padding: 10px 12px; background: var(--cream); border-radius: var(--r-s); min-width: 0; }
.bd-thumb { width: 46px; aspect-ratio: 5 / 7; flex: none; display: block; border-radius: 8px; overflow: hidden; background: var(--teal-l); }
.bd-cardtxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.bd-cardtxt strong { overflow-wrap: anywhere; }
.bd-cardtxt span { font-size: .85rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.bd-f { margin: 0; padding: 0; border: 0; min-width: 0; }
.bd-f .field-label { margin: 12px 0 5px; padding: 0; }
.bd-f .field { min-width: 0; }
.bd-select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 42px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%232D4A47' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.bd-newname { margin-top: 8px; }
.bd-radios { display: flex; gap: 8px; }
.bd-radio { position: relative; flex: 1 1 0; min-width: 0; }
.bd-radio input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bd-radio span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--cream); font-weight: 600; transition: background .2s, transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.bd-radio input:checked + span { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.bd-radio input:focus-visible + span { outline: 3px solid var(--teal-d); outline-offset: 2px; }
.bd-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 4px; font-weight: 500; cursor: pointer; }
.bd-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--teal-d); flex: none; }
.bd-check input:disabled + span { color: var(--ink-soft); }
.bd-hint { font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }
.bd-err { color: var(--bad); font-size: .85rem; font-weight: 500; min-height: 1.3em; margin-top: 10px; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.bd-actions .btn { flex: 1 1 130px; }
.bd-modal input[type="date"].field { width: 100%; }

/* binder page */
.bd-bar { margin-bottom: 18px; }
.bd-bar .tb-field { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.bd-bar .pill-select { flex: 1 1 0; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.bd-warn { margin-bottom: 14px; }
.bd-note { margin-top: 26px; font-size: .85rem; color: var(--ink-soft); text-align: center; }
.bd-empty { padding: 40px 20px; }
.bd-empty .big { font-size: 3rem; }
.bd-empty .big .dicon + .dicon { margin-left: .18em; }
.bd-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.bd-tiles .stat { min-width: 0; }
.bd-tiles .stat .v { overflow-wrap: anywhere; font-size: clamp(1.05rem, 4.4vw, 1.25rem); }
.bd-gain-stat.up .v, .bd-gain-stat.up .u { color: var(--good); }
.bd-gain-stat.down .v, .bd-gain-stat.down .u { color: var(--bad); }
.bd-chart { padding-bottom: 14px; }
.bd-bigrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 8px; }
.bd-big { font-size: clamp(1.7rem, 6vw, 2.5rem); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.bd-bigrow .delta { white-space: normal; }
.bd-caption { margin-top: 6px; font-size: .8rem; color: var(--ink-soft); }
.bd-hint-line { margin-top: 6px; font-size: .9rem; font-weight: 600; color: var(--teal-dd); }
.bd-cards { margin-top: 6px; }
.bd-toolbar .tb-search { flex: 1 1 200px; }
.bd-views button span { margin-left: 2px; }
.bd-grid { align-items: stretch; }
.bd-tile a { color: inherit; text-decoration: none; }
.bd-tile:active { transform: none; }
.bd-imglink { position: relative; display: block; border-radius: 18px; }
.bd-imglink:focus-visible { outline-offset: 2px; }
.bd-badge {
  position: absolute; z-index: 1; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.3;
  border: 1.5px solid var(--ink); white-space: nowrap; max-width: calc(100% - 16px);
}
.bd-qty { top: 8px; left: 8px; background: var(--yellow); color: var(--ink); }
.bd-grade { left: 8px; bottom: 8px; background: var(--ink); color: #fff; }
.bd-tile .tile-name { min-height: 2.6em; }
.bd-tile a.tile-name.bd-name { min-height: 44px; }
.bd-tile a.tile-name:hover { text-decoration: underline; }
.bd-gainrow { display: flex; }
.gain { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.gain.up { background: #d9f5e6; color: var(--good); }
.gain.down { background: #fde2e4; color: var(--bad); }
.gain.flat { background: var(--cream); color: var(--ink-soft); }
.bd-est { margin-left: 2px; background: var(--yellow-l); color: #8a6414; border-color: var(--yellow); font-size: .66rem; padding: 1px 7px; vertical-align: middle; cursor: help; }
.bd-acts { display: flex; gap: 8px; margin-top: 6px; }
.bd-acts .btn { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: .82rem; white-space: nowrap; }
.bd-missing { opacity: .8; }
.bd-missing .tile-name { color: var(--ink-soft); }

/* list view: table that stacks into cards whenever its own container is narrow */
.bd-table-wrap { container: bdt / inline-size; width: 100%; }
table.bd-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.bd-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); font-weight: 600; padding: 0 8px 2px; }
.bd-table td { background: var(--cream); padding: 8px; vertical-align: middle; overflow-wrap: break-word; }
.bd-table td:first-child, .bd-table th:first-child { padding-left: 10px; }
.bd-table td:first-child { border-radius: 18px 0 0 18px; }
.bd-table td:last-child { border-radius: 0 18px 18px 0; padding-right: 10px; }
.bd-table .bd-acts { margin-top: 0; }
.bd-table .bd-acts .btn { flex: 0 0 auto; padding: 8px 12px; font-size: .85rem; }
.bd-rowlink { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.bd-rowlink:hover .bd-rname { text-decoration: underline; }
.bd-rname { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.bd-rname small { font-weight: 500; color: var(--ink-soft); }
.bd-mini { width: 34px; aspect-ratio: 5 / 7; flex: none; display: block; border-radius: 6px; overflow: hidden; background: var(--teal-l); }
.bd-mini .imgbox .img-fb { font-size: 1rem; }
@container bdt (max-width: 820px) {
  table.bd-table, .bd-table tbody, .bd-table tr, .bd-table td { display: block; width: 100%; }
  .bd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bd-table tr { background: var(--cream); border-radius: 20px; padding: 8px 14px 12px; margin-bottom: 10px; }
  .bd-table td { background: transparent; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; border-radius: 0 !important; }
  .bd-table td::before { content: attr(data-label); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 600; text-align: left; flex: none; }
  .bd-table td.c-card { justify-content: flex-start; text-align: left; }
  .bd-table td.c-card::before, .bd-table td.c-act::before, .bd-table tr.bd-missing td::before { content: none; }
  .bd-table td:first-child, .bd-table td:last-child { padding-left: 0; padding-right: 0; }
  .bd-table td.c-act { padding-top: 8px; }
  .bd-table td.c-act .bd-acts { width: 100%; }
  .bd-table td.c-act .bd-acts .btn { flex: 1 1 0; }
}
@media (max-width: 620px) {
  .bd-bar .tb-field { flex: 1 1 100%; }
  .bd-bar .btn-small { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .bd-in { padding: 18px 16px 16px; }
}
@media (max-width: 400px) {
  .bd-views button span { display: none; }
  .bd-views button { min-width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-host:hover > .tile, .tile-host:focus-within > .tile { transform: none; }
  .tile-add:hover, .tile-add:active { transform: none; }
}
.gain .nw { white-space: nowrap; }
/* the header holds two icon buttons on each side from here down: shrink the wordmark so 320px fits */
@media (max-width: 340px) {
  .site-header { gap: 4px; }
  .hdr-left, .hdr-right { gap: 4px; }
  .wm-text { font-size: 1.1rem; }
  .tape { width: 26px; height: 22px; }
  .wordmark { gap: 4px; }
}

/* ==========================================================
   v3 - UI wave: compact search row, "HRA" caption, wider sidebar with edition artwork,
   wide picker grid, readable set hero, aligned card meta, Mapa TCG
   ========================================================== */

/* ---- P1: search stretches, region + language are compact (caption above a small pill) ---- */
.searchrow { gap: 10px 12px; justify-content: stretch; }
.searchbox { flex: 1 1 100%; max-width: none; min-width: 0; }
.filters { flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-start; gap: 10px; }
.filters .country-field {
  flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 2px;
  padding: 0; min-height: 60px; background: none; border: 0; border-radius: 0; box-shadow: none;
}
.filters .country-label { padding-left: 14px; font-size: .68rem; line-height: 1.1; color: var(--ink-soft); }
.filters .country-select, .filters .cur-select, .filters .lang-btn {
  flex: 0 0 auto; width: 100%; max-width: 100%; min-height: 44px; padding: 6px 30px 6px 14px; font-size: .92rem;
  background-position: right 11px center; box-shadow: 0 3px 0 var(--ink); text-overflow: ellipsis;
}
#region-field { flex: 1 1 0; max-width: 240px; }
#lang-wrap { flex: 0 0 auto; }
/* ticket 95: the photo of a sealed product on its market page is square, it does not flip */
.prod-flip { aspect-ratio: 1 / 1; }
.prod-flip .face { backface-visibility: visible; }
/* ticket 95: the display-currency pill (3 capital letters + the arrow) sits between the region and the language; it never shrinks below its text */
#cur-field { flex: 0 0 auto; }
#cur-field .cur-select { min-width: 5.6em; }
.price-usd:empty { display: none; }
@media (min-width: 900px) {
  .searchrow { flex-wrap: nowrap; }
  .searchbox { flex: 1 1 0; }
  .filters { flex: 0 0 auto; }
  #region-field { flex: 0 1 176px; width: 176px; max-width: none; }
}

/* ---- P2: the game button reads as "switch the whole game" ---- */
.game-btn { gap: 8px; padding: 4px 16px 4px 14px; }
.game-txt { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.05; }
.game-cap { font-size: .58rem; font-weight: 700; letter-spacing: .14em; color: var(--teal-dd); line-height: 1.1; }

/* ---- P8: header with Pokédex, game | wordmark | Mapa TCG, Binder, Přihlásit ---- */
#map-btn[aria-current="page"] { background: var(--yellow); }
/* never let the side clusters collide with the wordmark: columns are at least as wide as their content */
.site-header { grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
@media (max-width: 1023px) {
  #map-btn .lbl, #binder-btn .lbl { display: none; }
  #map-btn, #binder-btn { width: 44px; padding: 8px; }
}
@media (max-width: 700px) {
  #login-btn .lbl { display: none; }
  #login-btn { width: 44px; padding: 8px; }
}
@media (max-width: 600px) {
  .game-btn { padding: 4px 12px; }
}
/* with the Pokédex button next to it the game button is icon-only a bit earlier */
@media (max-width: 560px) {
  #pokedex-btn:not([hidden]) ~ .game-wrap .game-btn { width: 44px; padding: 2px; flex-direction: column; justify-content: center; gap: 1px; }
  #pokedex-btn:not([hidden]) ~ .game-wrap .game-btn .lbl { display: none; }
  #pokedex-btn:not([hidden]) ~ .game-wrap .game-btn .ico { font-size: 1.05rem; }
  #pokedex-btn:not([hidden]) ~ .game-wrap .game-cap { letter-spacing: .1em; }
}
@media (max-width: 479px) {
  .site-header { gap: 4px; }
  .hdr-left, .hdr-right { gap: 4px; }
  /* icon on top, "HRA" caption below; the game name is in aria-label / title */
  .game-btn { width: 44px; padding: 2px; flex-direction: column; justify-content: center; gap: 1px; }
  .game-btn .lbl { display: none; }
  .game-btn .ico { font-size: 1.05rem; }
  .game-cap { letter-spacing: .1em; }
  .wm-text { font-size: 1.15rem; }
  .tape { width: 28px; height: 23px; }
  .wordmark { gap: 5px; }
}
@media (max-width: 369px) {
  .wm-text { display: none; }
  .wordmark { min-width: 44px; justify-content: center; }
  .tape { width: 34px; height: 28px; }
}

/* ---- P5: wider sidebar, closer to the edge; edition items = artwork cards ---- */
@media (min-width: 900px) {
  .shell { max-width: 1920px; padding: 14px 12px 40px; gap: 20px; grid-template-columns: clamp(250px, 24vw, 320px) minmax(0, 1fr); }
}
.sidebar { padding: 14px 10px 10px; }
.set-list { gap: 8px; }
.set-item {
  position: relative; isolation: isolate; overflow: hidden; min-height: 68px; padding: 6px 10px 6px 6px; gap: 10px;
  border-radius: 20px; background: var(--cream); border: 2px solid var(--line);
}
.set-item:hover { background: var(--cream); border-color: var(--teal-d); transform: scale(1.02); }
.set-item[aria-current="page"] { background: var(--cream); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.set-item:focus-visible, .pk-row:focus-visible { outline-offset: -4px; }
.set-bg { display: block; position: absolute; inset: 0; z-index: -1; }
.set-bg .imgbox, .set-bg .imgbox img { width: 100%; height: 100%; }
.set-bg .imgbox img { object-fit: cover; }
.set-bg .imgbox.failed .img-fb { display: none; }
.set-bg::after {   /* light scrim: dark text stays readable on any artwork */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .93) 0%, rgba(255, 255, 255, .82) 48%, rgba(255, 255, 255, .5) 100%);
}
.set-item[aria-current="page"] .set-bg::after { background: linear-gradient(90deg, rgba(255, 241, 201, .96) 0%, rgba(255, 241, 201, .86) 50%, rgba(255, 241, 201, .55) 100%); }
.set-item.is-parent .set-bg::after { background: linear-gradient(90deg, rgba(221, 245, 239, .96) 0%, rgba(221, 245, 239, .86) 50%, rgba(221, 245, 239, .55) 100%); }
.set-logo { flex: none; width: 96px; height: 56px; display: flex; align-items: center; justify-content: center; }
.set-logo .imgbox { width: 100%; height: 100%; }
.set-logo .imgbox img { object-fit: contain; filter: drop-shadow(0 1px 2px rgba(45, 74, 71, .3)); }
.set-logo .imgbox .img-fb { border-radius: 14px; font-size: 1.7rem; }
/* fallback: no logo but a tile -> hide the logo box (text over the artwork); neither -> the letter in the logo box stays */
[data-logo="bad"][data-tile="ok"] > .set-logo { display: none; }
.set-meta { flex: 1 1 0; min-width: 0; }
.set-name { color: var(--ink); }
.set-item .set-date, .pk-row .set-date { color: #46605c; font-size: .76rem; font-weight: 500; }
.set-item .chip-lang { background: #ece6f8; }

@media (max-width: 899px) {
  .set-item { min-height: 52px; padding: 4px 14px 4px 5px; border-radius: 999px; background: var(--cream); }
  .set-item:hover { transform: none; }
  .set-logo { width: 56px; height: 40px; }
  .set-logo .imgbox .img-fb { font-size: 1.2rem; border-radius: 12px; }
  .set-meta { flex: none; }
}

/* ---- P6: all-editions picker = wide panel with a grid of edition cards ---- */
.picker-in { padding: 18px 20px 10px; }
.picker-head h2 { font-size: 1.5rem; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; padding: 4px 4px 14px; }
.pk-row {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px;
  min-height: 136px; padding: 10px 12px; border-radius: 20px; border: 2px solid var(--line); background: var(--cream);
  content-visibility: auto; contain-intrinsic-size: auto 136px;
  transition: border-color .15s, transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.pk-row:hover, .pk-row:focus-visible { background: var(--cream); border-color: var(--teal-d); transform: translateY(-2px); }
.pk-row .set-logo { width: 100%; height: 56px; justify-content: flex-start; }
.pk-row .set-logo .imgbox { width: 100%; }
.pk-row .set-logo .imgbox img { object-position: left center; }
.pk-row .set-meta { flex: none; }
.pk-row .set-name { font-size: 1rem; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
.pk-nocards { display: block; margin-top: 2px; font-size: .72rem; font-style: italic; color: #46605c; }
.pk-flags { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 6px; }
.pk-flags .chip-lang, .pk-flags .badge-new { margin: 0; }
.pk-group + .pk-group { margin-top: 4px; }
.pk-group h3 { font-size: .85rem; }
@media (max-width: 620px) {
  .pk-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
  .pk-row { min-height: 128px; padding: 8px 10px; contain-intrinsic-size: auto 128px; }
  .picker-in { padding: 14px 12px max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .pk-row:hover, .pk-row:focus-visible { transform: none; } }

/* ---- P7: set hero - artwork background + dark scrim, big logo plate, white title on a dark panel ---- */
.set-hero {
  min-height: 190px; padding: 20px 24px; gap: 14px 22px; border-color: var(--ink);
  background: linear-gradient(135deg, #2c4a52, #3b3a5c);
}
.set-hero .hero-bg { opacity: 1; }
.set-hero .hero-bg .imgbox, .set-hero .hero-bg .imgbox img { width: 100%; height: 100%; }
.set-hero .hero-bg .imgbox img { object-fit: cover; }
.set-hero .hero-bg .imgbox.failed .img-fb { display: none; }
.set-hero .hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 28, 34, .5) 0%, rgba(14, 28, 34, .38) 60%, rgba(14, 28, 34, .3) 100%);
}
.set-hero .hero-logo {
  width: 240px; height: 160px; padding: 10px; border-radius: 22px; background: rgba(255, 255, 255, .9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.set-hero .hero-logo .imgbox { width: 100%; height: 100%; }
.set-hero .hero-logo .imgbox img { object-fit: contain; }
.set-hero .hero-logo .imgbox .img-fb { border-radius: 14px; font-size: 3rem; }
.set-hero .hero-txt {
  flex: 0 1 auto; max-width: 100%; padding: 12px 18px; border-radius: 20px; background: rgba(12, 24, 30, .55); color: #fff;
}
.set-hero h1, .set-hero h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.set-hero p { color: rgba(255, 255, 255, .95); text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.set-hero .btn { margin-left: auto; }
@media (max-width: 620px) {
  .set-hero { padding: 14px; min-height: 0; }
  .set-hero .hero-logo { width: 100%; height: 116px; }
  .set-hero .hero-txt { flex: 1 1 100%; }
  .set-hero .btn { margin-left: 0; }
}

/* ---- P3: card meta line - every item has the same structure, row and baseline ---- */
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-items: center; gap: 0 16px; margin: 2px 0 14px; font-size: .95rem; color: var(--ink-soft); }
.meta-i { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 .3em; min-width: 0; min-height: 44px; line-height: 1.3; }
.meta .meta-set { grid-column: span 2; }
.meta-k { color: var(--ink-soft); }
.meta-v { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.meta .meta-v a { display: inline; min-height: 0; padding: 0; color: var(--teal-dd); text-decoration: underline; text-underline-offset: 3px; }

/* ---- P8: Mapa TCG (sample data) ---- */
.map-report { margin: 6px 0 0; }
.map-report a { color: var(--teal-dd); font-weight: 600; text-underline-offset: 3px; }
.map-bar { align-items: center; }
.map-bar .tb-search { flex: 1 1 240px; }
.map-note { margin: 0 0 14px; padding: 12px 16px; border: 2px dashed var(--line); border-radius: var(--r-s); background: var(--paper); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.map-layout.map-listonly { grid-template-columns: minmax(0, 1fr); }
.map-box { min-width: 0; }
.map-canvas {
  position: relative; z-index: 0; isolation: isolate; height: 420px; width: 100%;
  border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--teal-l); box-shadow: var(--shadow-1);
  font-family: var(--font);
}
.map-hint { margin-top: 8px; font-size: .85rem; text-align: center; }
.map-side { min-width: 0; }
.map-count { font-weight: 600; color: var(--ink-soft); margin: 0 4px 8px; }
.map-list { position: relative; display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 4px 2px; scrollbar-width: thin; scrollbar-color: var(--teal) transparent; }
/* ticket 82: a place = a card (li) holding the select button and, outside the button, the web link */
.map-entry { display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); transition: border-color .15s, background .15s; }
.map-entry:hover { border-color: var(--teal-d); }
.map-entry.is-active { background: var(--yellow-l); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.map-item {
  display: flex; flex-direction: column; gap: 3px; width: 100%; min-height: 64px; padding: 10px 14px; text-align: left;
  border: 0; border-radius: 16px; background: transparent; color: var(--ink);
}
.mi-name { font-size: .98rem; line-height: 1.25; overflow-wrap: anywhere; }
.mi-line { font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.mi-note { font-style: italic; }
.mi-web, .mp-web { color: var(--teal-dd); font-weight: 600; text-underline-offset: 3px; }
.mi-web { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px 4px; }
/* Leaflet pins (CSS teardrops, no image files) and popups */
.tm-pin-wrap { background: none; border: 0; }
.tm-pin {
  --pc: var(--teal-d); display: block; width: 30px; height: 30px; margin: 2px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pc); border: 3px solid var(--ink); box-shadow: 0 3px 6px rgba(45, 74, 71, .35); transition: transform .15s;
}
.tm-pin i { display: block; width: 10px; height: 10px; margin: 6px; border-radius: 50%; background: #fff; }
.tm-pin.is-active { background: var(--yellow); transform: rotate(-45deg) scale(1.22); }
#map-canvas .leaflet-popup-content-wrapper { border-radius: 16px; color: var(--ink); }
#map-canvas .leaflet-popup-content { margin: 12px 14px; font-family: var(--font); font-size: .9rem; line-height: 1.35; }
.mp-pop { display: flex; flex-direction: column; gap: 2px; }
.mp-name { font-size: 1rem; }
.mp-line { color: var(--ink-soft); }
.mp-note { font-style: italic; }
.mp-web { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 899px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-canvas { height: 320px; }
  .map-list { max-height: none; overflow: visible; padding: 2px; }
}
@media (max-width: 620px) {
  .map-bar .tb-search { flex: 1 1 100%; }
  #map-canvas .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
}
.pk-row .set-logo .imgbox.failed { width: 56px; }

/* ==========================================================
   v3 fix wave 1
   ========================================================== */
/* sidebar item: logo | name column (always >= 110px), the language chip + NOVÁ badge sit on a second line under the name */
.set-logo { width: 80px; height: 52px; }
.set-logo.wide { width: 40%; min-width: 80px; }   /* wordmark logos (aspect > 2.8, detected on load) may take up to 40% of the item */
@media (min-width: 1250px) {   /* sidebar is >= 300px wide here */
  .set-logo { width: 96px; height: 56px; }
  .set-logo.wide { width: 42%; min-width: 96px; }
}
.set-meta { flex: 1 1 110px; min-width: 110px; }
.set-item .set-name { overflow-wrap: normal; word-break: normal; hyphens: manual; }   /* wrap at spaces only */
.set-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 1px; }
.set-sub .chip-lang, .set-sub .badge-new { margin: 0; }
.pk-row .set-logo.wide { width: 100%; }
@media (max-width: 899px) {
  .set-meta { display: flex; flex: none; flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
  .set-sub .set-date { display: none; }
  .set-logo.wide { width: 56px; min-width: 0; }
}

/* region select: a bit wider (labels are short now, details in the option tooltips) */
@media (min-width: 900px) { #region-field { flex: 0 1 190px; width: 190px; } }

/* header captions / tooltips */
.game-cap { font-size: .65rem; }

/* map: 44px hit areas for zoom buttons, pins, popup close button; attribution as a normal text line */
.tm-pin-wrap { display: flex; align-items: center; justify-content: center; }
#map-canvas .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
#map-canvas .leaflet-popup-close-button { top: 0; right: 0; width: 44px; height: 44px; padding: 0; font: 26px/44px var(--font); }
#map-canvas .mp-name { padding-right: 30px; }
.map-attrib { margin-top: 4px; font-size: .85rem; text-align: center; }
.map-attrib a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.mi-go { display: none; }
@media (max-width: 700px) {
  .mi-go { display: block; margin-top: 2px; font-size: .82rem; font-weight: 600; color: var(--teal-dd); }
}
.set-item .set-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* very long names: 2 lines (full text in the tooltip) */
.set-sub .set-date { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================
   v3 wave 2
   ========================================================== */

/* ---- W1: card page specification panel (Edice, Číslo, Řada, Provedení, Hra, Jazyk) ---- */
.meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; align-items: stretch;
  margin: 10px 0 18px; padding: 0; font-size: .95rem; color: var(--ink-soft);
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1);
}
.meta-i {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 52px; padding: 8px 18px; line-height: 1.3; min-width: 0;
  box-shadow: 1px 1px 0 0 var(--line);   /* hairlines right + below every cell; the panel clips the outer ones */
}
.meta .meta-set { grid-column: 1 / -1; }
.meta-k { flex: none; font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.meta-v { min-width: 0; text-align: right; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.meta .meta-v a { display: inline; min-height: 0; padding: 0; color: var(--teal-dd); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.meta .meta-v a:hover { color: var(--ink); }
@media (max-width: 620px) {
  .meta { grid-template-columns: minmax(0, 1fr); }
  .meta-i { padding: 6px 16px; }
}

/* ---- W2: "Produkty" dropdown = list + preview card ---- */
.menu { display: flex; align-items: flex-start; gap: 12px; }
.menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }   /* hover bridge between pill and list */
.menu-list { flex: 1 1 auto; min-width: 250px; max-height: min(72vh, 600px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.menu a { flex-wrap: wrap; row-gap: 0; }
.menu .pm-name { flex: 1 1 auto; min-width: 0; }
.menu .pm-desc { display: none; flex: 1 1 100%; margin-top: -2px; padding-bottom: 4px; font-size: .78rem; font-weight: 400; line-height: 1.3; color: var(--ink-soft); }
.menu-preview {
  display: none; flex: none; width: 280px; height: 366px; flex-direction: column; gap: 6px; padding: 10px;   /* fixed box: no layout jump between types */
  background: var(--cream); border: 2px solid var(--line); border-radius: 18px;
}
.mp-img { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 12px; background: #fff; }
.mp-ico { font-size: 3.4rem; line-height: 1; color: var(--teal-d); opacity: .85; }
.mp-ico .dicon { display: block; }
.mp-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.mp-title { font-size: 1.05rem; }
.mp-sub { height: 2.5em; font-size: .72rem; line-height: 1.25; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.menu-preview .mp-text { font-size: .86rem; line-height: 1.35; overflow: hidden; }
@media (hover: hover) and (min-width: 1000px) {
  .menu-preview { display: flex; }
}
@media (hover: none), (max-width: 999px) {
  .menu .pm-desc { display: block; }
}
@media (max-width: 620px) {
  .menu-list { min-width: 0; max-height: min(66vh, 520px); }
}

/* ---- W3: product list toolbar ---- */
.prod-toolbar { margin-top: 4px; }
.prod-toolbar .tb-search { flex: 1 1 160px; }
.tile-ed { overflow-wrap: anywhere; }

/* ---- W4: picker cards - one uniform layout (fixed logo area, calm blurred art) ---- */
.pk-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "logo logo" "meta flags"; align-items: end; gap: 6px 8px;
  min-height: 150px; padding: 10px 12px 10px; contain-intrinsic-size: auto 150px;
}
.pk-row .set-logo { grid-area: logo; width: 100%; height: 84px; justify-content: center; align-self: stretch; }
.pk-row .set-logo .imgbox { width: 100%; height: 100%; }
.pk-row .set-logo .imgbox img { object-fit: contain; object-position: center; max-width: 100%; max-height: 100%; }
.pk-row .set-logo .imgbox.failed { width: 84px; margin: 0 auto; }
.pk-row[data-logo="bad"][data-tile="ok"] > .set-logo { display: flex; }   /* keep the logo area so every card has the same height */
.pk-row .set-meta { grid-area: meta; min-width: 0; align-self: end; }
.pk-row .set-name { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.pk-row .set-date { font-size: .72rem; color: #5a716d; }
.pk-nocards { font-size: .68rem; color: #5a716d; }
.pk-flags { grid-area: flags; position: static; align-self: end; margin: 0; }
.pk-row .set-bg .imgbox img { filter: blur(5px) saturate(.45); transform: scale(1.12); opacity: .7; }
.pk-row .set-bg::after { background: linear-gradient(180deg, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, .84) 100%); }
.pk-row:hover .set-bg .imgbox img, .pk-row:focus-visible .set-bg .imgbox img { filter: blur(3px) saturate(.7); }
@media (max-width: 620px) {
  .pk-row { min-height: 136px; padding: 8px 10px; contain-intrinsic-size: auto 136px; }
  .pk-row .set-logo { height: 68px; }
  .pk-row .set-logo .imgbox.failed { width: 68px; }
}

/* ---- W5: set hero - logo backlit directly on the banner (no plate) ---- */
.set-hero .hero-logo { padding: 0; border-radius: 0; background: none; box-shadow: none; width: 250px; height: 165px; isolation: isolate; }
.set-hero .hero-logo::before {   /* soft backlight: no edge, fades to transparent */
  content: ""; position: absolute; inset: -22% -18%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .55) 48%, rgba(255, 255, 255, .16) 80%, rgba(255, 255, 255, 0) 100%);
  filter: blur(10px);
}
.set-hero .hero-logo .imgbox img {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8)) drop-shadow(0 0 14px rgba(255, 255, 255, .45)) drop-shadow(0 3px 8px rgba(0, 0, 0, .55));
}
.set-hero .hero-logo .imgbox .img-fb { border-radius: 22px; background: rgba(255, 255, 255, .18); color: #fff; }
@media (max-width: 620px) {
  .set-hero .hero-logo { width: 100%; height: 124px; }
}

/* ---- W6 (ticket 82: only the search is left in the bar) ---- */
.map-bar { display: block; padding: 14px 16px; }
.map-bar .tb-search { flex: none; }
/* W4: identical card height everywhere (name clamps to 2 lines, the "bez karet" note fits the same box) */
.pk-row { height: 172px; min-height: 0; contain-intrinsic-size: auto 172px; }
.pk-row .set-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 620px) {
  .pk-row { height: 156px; contain-intrinsic-size: auto 156px; }
}
.prod-toolbar .tb-field { min-width: 0; max-width: 100%; }
.prod-toolbar .pill-select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 620px) {
  .prod-toolbar .tb-field .pill-select { flex: 1 1 0; max-width: none; }
}
.pk-row .set-meta { display: block; }   /* the strip layout of the sidebar chips (<900px) must not apply to picker cards */

/* ==========================================================
   v3 wave 2 - fix batch
   ========================================================== */
/* preview photo: always loaded eagerly, shown only after a real load (is-on); never a lazy / display:none image */
.mp-photo { opacity: 0; transition: opacity .18s; }
.mp-photo.is-on { opacity: 1; }
.menu.menu-empty { display: block; }
.menu-none { margin: 0; padding: 12px 14px; max-width: 280px; font-size: .92rem; line-height: 1.4; color: var(--ink-soft); }
/* spec panel: an odd last item spans the whole row (no empty bordered cell) */
.meta .meta-last { grid-column: 1 / -1; }
/* product list: tiles outside the viewport are skipped by the renderer */
#prod-grid .product-tile { content-visibility: auto; contain-intrinsic-size: auto 340px; }
/* hero logo fallback: no plate, just a big glowing letter + the set name */
.set-hero .hero-logo .imgbox .img-fb { background: none; border-radius: 0; color: #fff; font-size: 4.6rem; text-shadow: 0 0 18px rgba(255, 255, 255, .8), 0 3px 10px rgba(0, 0, 0, .65); }
.set-hero .hero-logo .imgbox .img-fb small { color: #fff; font-size: 1rem; font-weight: 600; text-shadow: 0 0 10px rgba(0, 0, 0, .8), 0 1px 4px rgba(0, 0, 0, .8); }

/* ==========================================================
   Pokédex (2D): list of all Pokémon + one Pokémon with its cards (artwork is hotlinked, mockup only)
   ========================================================== */
#pokedex-btn[aria-current="page"] { background: var(--yellow); }
.dex-toolbar { margin-bottom: 16px; }
.dex-toolbar .tb-search { flex: 1 1 240px; }
.dex-n {
  display: inline-block; min-width: 1.9em; margin-left: 4px; padding: 0 7px; border-radius: 999px; text-align: center;
  background: var(--paper); border: 1.5px solid var(--line); font-size: .8rem; line-height: 1.5;
}
.toggle-chip[aria-pressed="true"] .dex-n { border-color: var(--ink); }
.dex-gens { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.dex-gens .toggle-chip small { font-size: .78rem; font-weight: 500; color: var(--ink-soft); }
.dex-gens .toggle-chip[aria-pressed="true"] small { color: var(--ink); }
@media (max-width: 620px) {
  /* phones: one swipeable strip instead of five wrapped rows */
  .dex-gens { flex-wrap: nowrap; overflow-x: auto; margin: 0 -2px; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--teal) transparent; }
  .dex-gens .toggle-chip { flex: none; scroll-snap-align: start; white-space: nowrap; }
  #dex-has { flex: 1 1 auto; }
}

/* list tiles: artwork on a soft round backlight (the PNG is transparent, so no white rectangle behind it) */
.dex-grid { --tile-min: 150px; }
.dex-tile { content-visibility: auto; contain-intrinsic-size: auto 318px; }   /* ~ the real height (type chips add a row), so Back restores the same scroll position */
.dex-art { position: relative; display: block; aspect-ratio: 1 / 1; isolation: isolate; }
.dex-art::before {
  content: ""; position: absolute; inset: 1%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0%, rgba(221, 245, 239, .96) 42%, rgba(255, 241, 201, .62) 74%, rgba(255, 241, 201, 0) 100%);
}
.dex-art .imgbox { position: absolute; inset: 6%; width: auto; height: auto; }
.dex-art .imgbox img { filter: drop-shadow(0 5px 6px rgba(45, 74, 71, .28)); }
.dex-art .imgbox .img-fb { border-radius: 50%; font-size: 2.6rem; }
.dex-glare {   /* the same sheen idea as the card page, here only while the tile tilts (pointer position from initTileTilt) */
  position: absolute; inset: 4%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .25s;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, .2) 28%, transparent 56%),
    linear-gradient(115deg, transparent 18%, rgba(205, 184, 255, .42) 36%, rgba(181, 240, 216, .42) 50%, rgba(255, 184, 214, .42) 64%, transparent 82%) var(--mx, 50%) var(--my, 50%) / 260% 260%;
}
.dex-tile.tilting .dex-glare { opacity: 1; }
.dex-no { font-size: .78rem; font-weight: 600; letter-spacing: .05em; color: var(--ink-soft); }
.dex-tile .tile-name { min-height: 1.25em; }
.dex-none { font-size: .85rem; color: var(--ink-soft); line-height: 1.3; }

/* type pills: colours + a readable text colour per type come from pokedex.js */
.tchip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.55; white-space: nowrap;
  background: var(--tc, var(--teal)); color: var(--tf, var(--ink));
}
.dex-types { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.dex-off { opacity: .42; filter: saturate(.45); }
.dex-off:hover { opacity: .8; }
.dex-hint { flex: 1 1 100%; margin: 0; font-size: .82rem; color: var(--ink-soft); }
#dex-group[aria-pressed="true"] { background: var(--teal); }

/* grouped list: every evolution family sits in one frame tinted with the primary type of its first stage */
.dex-flow { --tw: 160px; --g: 12px; --p: 14px; display: flex; flex-wrap: wrap; gap: 20px 18px; align-items: flex-start; }
.dex-flow > .dex-tile { flex: 0 0 var(--tw); width: var(--tw); }
.dex-fam {
  position: relative; max-width: 100%; padding: 24px var(--p) var(--p);
  width: calc(var(--n) * var(--tw) + (var(--n) - 1) * var(--g) + 2 * var(--p) + 4px);
  border: 2px solid rgba(var(--fcr), .62); border-radius: calc(var(--r) + 6px);
  background: linear-gradient(180deg, rgba(var(--fcr), .2), rgba(var(--fcr), .08)); box-shadow: var(--shadow-1);
}
.dex-fam-t {
  position: absolute; top: -13px; left: 18px; max-width: calc(100% - 36px); padding: 1px 12px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--paper); border: 2px solid rgba(var(--fcr), .8); font-size: .75rem; font-weight: 700; line-height: 1.6; color: var(--ink);
}
.dex-fam-in { display: flex; flex-wrap: wrap; gap: var(--g); }
.dex-st { position: relative; display: flex; flex: 0 0 var(--tw); width: var(--tw); min-width: 0; }
.dex-st > .tile { flex: 1 1 auto; content-visibility: visible; }   /* tiles in a frame are laid out for real (their height decides the frame height, so Back restores the exact scroll) */
.dex-chev {
  position: absolute; z-index: 3; left: calc(var(--g) / -2 - 11px); top: 30%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--paper); border: 2px solid rgba(var(--fcr), .85); font-size: 1rem; font-weight: 700; line-height: 1; color: var(--ink); pointer-events: none;
}
@media (max-width: 620px) {
  .dex-flow { gap: 18px 12px; --g: 10px; --p: 10px; }
  .dex-flow > .dex-tile { flex-basis: calc((100% - 12px) / 2); width: calc((100% - 12px) / 2); }
  .dex-fam { width: 100%; }
  .dex-st { flex-basis: calc((100% - var(--g)) / 2); width: calc((100% - var(--g)) / 2); }
}

/* one Pokémon: container wrapper (the layout follows the width of the content column, not the screen) */
.dex-wrap { container: dexw / inline-size; }
.dex-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px 40px; align-items: center;
  margin: 0 0 18px; padding: 26px 28px; overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--tcr), .24), var(--yellow-l) 85%); border: 2px solid rgba(var(--tcr), .45); border-radius: var(--r); box-shadow: var(--shadow-1);
}
.dex-hero-art { position: relative; width: min(420px, 80vw); justify-self: center; isolation: isolate; }
.dex-hero-art::before {   /* soft backlight: fades to nothing, no edge */
  content: ""; position: absolute; inset: -4%; z-index: -1; border-radius: 50%; filter: blur(6px);
  background: radial-gradient(closest-side, #fff 0%, rgba(255, 255, 255, .78) 40%, rgba(255, 255, 255, .26) 72%, rgba(255, 255, 255, 0) 100%);
}
.dex-hero .tilt-zone { max-width: none; }
.dex-pic { position: relative; display: block; aspect-ratio: 1 / 1; }
.dex-pic .imgbox { position: absolute; inset: 0; }
.dex-pic .imgbox .img-fb { border-radius: 50%; font-size: 6rem; }
.dex-hero-glare {   /* the sheen is clipped to the Pokémon's silhouette (the artwork itself is the mask) */
  -webkit-mask: var(--art) center / contain no-repeat; mask: var(--art) center / contain no-repeat; border-radius: 0;
}
/* inside the mask there is nothing to dodge against, so the sheen is a plain, gentle overlay (color-dodge would wash the artwork out) */
.dex-hero-glare::before { mix-blend-mode: normal; opacity: .26; }
.dex-hero-glare::after { mix-blend-mode: normal; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .12) 30%, transparent 55%); }

/* info panel (like pokemon.com): name, category, types, facts, weaknesses, base stats */
.dex-info {
  min-width: 0; padding: 20px 22px 22px; background: rgba(255, 255, 255, .86); border: 2px solid rgba(var(--tcr), .55); border-radius: var(--r);
  box-shadow: 0 0 0 6px rgba(var(--tcr), .12), var(--shadow-1);
}
.dex-info .dex-no { font-size: 1.05rem; }
.dex-info h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); overflow-wrap: anywhere; }
.dex-genus { margin: 2px 0 10px; color: var(--ink-soft); font-weight: 500; }
.dex-tbadges { display: flex; flex-wrap: wrap; gap: 6px; }
.dex-tbadges .tchip { font-size: .85rem; padding: 3px 14px; }
.dex-x4 { margin-left: 4px; font-size: .72rem; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .22); color: inherit; }
.dex-spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 16px 0 4px; padding: 14px 0 6px; border-top: 2px solid var(--line); }
.dex-spec > div { min-width: 0; }
.dex-spec dt { font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.dex-spec dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.dex-spec-abil { grid-column: 1 / -1; }
.dex-spec ul { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dex-hid { display: inline-block; padding: 0 8px; border-radius: 999px; background: #ece6f8; color: #6d4fb0; font-size: .7rem; font-weight: 600; vertical-align: middle; }
.dex-sub { margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--line); }
.dex-sub h2 { font-size: 1.05rem; margin-bottom: 8px; }
.dex-stats { display: flex; flex-direction: column; gap: 6px; }
.dex-stat { display: grid; grid-template-columns: 92px 38px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 22px; font-size: .9rem; }
.dex-stat-k { color: var(--ink-soft); font-weight: 600; }
.dex-stat-v { font-weight: 700; text-align: right; }
.dex-bar { display: block; height: 10px; border-radius: 999px; background: rgba(62, 156, 140, .16); overflow: hidden; }
.dex-bar i { display: block; height: 100%; border-radius: inherit; }
.dex-stat-sum { margin-top: 2px; padding-top: 6px; border-top: 1.5px dashed var(--line); }
.dex-stat-sum .dex-stat-k, .dex-stat-sum .dex-stat-v { color: var(--ink); }

/* evolution chain: stages as small tiles, arrows labelled with the requirement; wraps vertically when the column is narrow */
.dex-evo { margin: 0 0 20px; padding: 16px 20px 20px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.dex-evo h2 { font-size: 1.3rem; margin-bottom: 12px; }
.evo-tree, .evo-kids, .evo-sub { list-style: none; margin: 0; padding: 0; }
.evo-node { display: flex; align-items: center; }
.evo-kids { display: flex; flex-direction: column; gap: 14px; }
.evo-kid { display: flex; align-items: center; }
.evo-arrow { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 108px; padding: 0 6px; text-align: center; }
.evo-how { font-size: .76rem; font-weight: 600; line-height: 1.2; color: var(--ink-soft); overflow-wrap: anywhere; }
.evo-glyph { font-size: 1.5rem; line-height: 1; color: var(--teal-dd); }
.evo-card {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 156px; padding: 8px 8px 10px; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--cream); border: 2px solid var(--line); border-radius: 20px; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), border-color .15s;
}
.evo-card:hover, .evo-card:focus-visible { border-color: var(--teal-d); transform: translateY(-2px); }
.evo-card.is-cur { background: #fff; border-color: var(--tc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 30%, transparent); }
.evo-card .dex-art { width: 96px; }
.evo-name { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.evo-card .dex-types { justify-content: center; }
.evo-branchy { flex-direction: column; align-items: flex-start; gap: 6px; }
.evo-branchy > .evo-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px 12px; width: 100%; }
.evo-branchy .evo-kid { flex-direction: column; align-items: center; }
.evo-branchy .evo-arrow { width: auto; padding: 0; }
.evo-branchy .evo-glyph { transform: rotate(90deg); }
@container dexw (max-width: 760px) {
  .dex-hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 20px; gap: 18px; }
}
/* the evolution chain stays horizontal down to ~580px of content width (the Mega group then wraps below it); narrower = vertical */
@container dexw (max-width: 580px) {
  .dex-evo .evo-node, .dex-evo .evo-kid { flex-direction: column; }
  .dex-evo .evo-kids { align-items: center; }
  .dex-evo .evo-arrow { width: auto; flex-direction: row; gap: 8px; padding: 6px 0; }
  .dex-evo .evo-glyph { transform: rotate(90deg); }
  .dex-evo .evo-branchy { align-items: center; }
  .dex-evo .evo-branchy > .evo-kids { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; gap: 8px 10px; }
  .dex-evo .evo-branchy .evo-card { width: min(156px, 100%); }
}
.dex-pn { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 22px; }
.dex-pn .btn { flex: 1 1 200px; justify-content: flex-start; text-align: left; }
.dex-pn .dex-next { justify-content: flex-end; text-align: right; margin-left: auto; }
.dex-cards .view-head { margin-top: 6px; }
.dex-cards .view-head .tb-count { margin-left: auto; }
.dex-empty .btn { margin-top: 4px; }
@media (max-width: 620px) {
  .dex-info { padding: 16px 14px 18px; }
  .dex-stat { grid-template-columns: 84px 34px minmax(0, 1fr); }
  .dex-evo { padding: 14px 12px 16px; }
}

/* ==========================================================
   Wave 3 A: bigger, trimmed set logos (object-view-box from set_logo_crops.js) + backlight for white wordmarks
   ========================================================== */
/* sidebar: the trimmed wordmark fills a taller box; the name column stays >= 110px */
.set-logo { position: relative; isolation: isolate; width: 84px; height: 58px; }
.set-logo.wide { min-width: 84px; }
@media (min-width: 1250px) {
  .set-logo { width: 104px; height: 64px; }
  .set-logo.wide { width: 42%; min-width: 104px; }
}
/* picker: at most 3 columns in the 1100px panel (>= 300px for wide wordmarks), a tall logo area, uniform rows */
.pk-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pk-row { height: 200px; contain-intrinsic-size: auto 200px; }
.pk-row .set-logo { height: 110px; width: 100%; }
.pk-row .set-logo .imgbox.failed { width: 110px; }
@media (max-width: 620px) {
  .pk-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .pk-row { height: 176px; contain-intrinsic-size: auto 176px; }
  .pk-row .set-logo { height: 80px; }
  .pk-row .set-logo .imgbox.failed { width: 80px; }
}
@media (max-width: 899px) {
  .set-logo { width: 62px; height: 42px; }
  .set-logo.wide { width: 62px; min-width: 0; }
}
/* white wordmarks (data-light, from set_logo_crops.py): a soft dark blob behind the lettering, no visible rectangle */
[data-light] > .set-logo::before {
  content: ""; position: absolute; inset: -14% -6%; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(9px);
  background: radial-gradient(closest-side, rgba(24, 48, 56, .74) 0%, rgba(24, 48, 56, .5) 55%, rgba(24, 48, 56, 0) 100%);
}
[data-light] > .set-logo .imgbox img { filter: drop-shadow(0 0 2px rgba(10, 28, 34, .9)) drop-shadow(0 1px 3px rgba(10, 28, 34, .6)); }
.hero-logo[data-light]::before {
  background: radial-gradient(closest-side, rgba(8, 20, 26, .84) 0%, rgba(8, 20, 26, .6) 52%, rgba(8, 20, 26, .18) 80%, rgba(8, 20, 26, 0) 100%);
}
.hero-logo[data-light] .imgbox img { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .85)) drop-shadow(0 3px 8px rgba(0, 0, 0, .6)); }

/* ==========================================================
   Wave 4: Pokédex icon, search placeholder, Legendary glow, Mega forms, item icons
   ========================================================== */
.dexicon { display: block; width: 28px; height: 28px; }
#pokedex-btn .ico { display: inline-flex; align-items: center; justify-content: center; }
/* long placeholder: one line, ellipsis instead of a hard clip; a bit smaller on phones */
#q, #q::placeholder { text-overflow: ellipsis; }
@media (max-width: 479px) { #q { font-size: 1rem; padding-left: 20px; padding-right: 62px; } }
@media (max-width: 359px) { #q { font-size: .92rem; padding-left: 16px; padding-right: 58px; } }

/* Legendary / Mythical: ribbon + glow (golden, mythical = violet) */
.dex-ribbon {
  position: absolute; top: 8px; right: 8px; z-index: 2; padding: 1px 10px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: linear-gradient(90deg, #FFD166, #FFE9A0); color: var(--ink); font-size: .62rem; font-weight: 700; letter-spacing: .08em; line-height: 1.5; text-transform: uppercase; white-space: nowrap;
}
.dex-leg-2 .dex-ribbon, .dex-ribbon.is-myth { background: linear-gradient(90deg, #CDB8FF, #F6CDE6); }
.dex-leg { --glow: 255, 209, 102; border-color: #E9A93A; background: linear-gradient(180deg, #fffbe9, #fff 45%);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, .9), 0 0 30px rgba(var(--glow), .85), var(--shadow-1); }
.dex-leg-2 { --glow: 205, 184, 255; border-color: #b79cf2; background: linear-gradient(180deg, #f9f4ff, #fff 45%);
  box-shadow: 0 0 0 2px rgba(205, 184, 255, .95), 0 0 30px rgba(var(--glow), .9), var(--shadow-1); }
.dex-leg:hover, .dex-leg:focus-visible { border-color: #E9A93A; box-shadow: 0 0 0 3px rgba(255, 209, 102, 1), 0 0 30px rgba(var(--glow), .85), var(--shadow-2); }
.dex-leg-2:hover, .dex-leg-2:focus-visible { border-color: #b79cf2; box-shadow: 0 0 0 3px rgba(205, 184, 255, 1), 0 0 30px rgba(var(--glow), .9), var(--shadow-2); }
.dex-leg::after, .dex-fam-leg::after {   /* a soft shimmer sweeping over the tile every few seconds */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .8) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  opacity: .55; animation: dexshimmer 5s ease-in-out infinite;
}
@keyframes dexshimmer { 0%, 100% { background-position: 160% 0; } 55% { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { .dex-leg::after, .dex-fam-leg::after { animation: none; opacity: 0; } }
/* featured tile in the grouped list: two columns wide, bigger artwork (a full row on phones) */
.dex-flow > .dex-feat { flex: 0 0 calc(2 * var(--tw) + 18px); width: calc(2 * var(--tw) + 18px); }
.dex-feat .dex-art { width: min(100%, 250px); margin: 0 auto; }
.dex-feat .tile-name { font-size: 1.15rem; }
@media (max-width: 620px) {
  .dex-flow > .dex-feat { flex-basis: 100%; width: 100%; }
  .dex-feat .dex-art { width: min(100%, 230px); }
}
.dex-fam-leg { border-color: #E9A93A; box-shadow: 0 0 0 2px rgba(255, 209, 102, .8), 0 0 32px rgba(255, 209, 102, .8), var(--shadow-1);
  background: linear-gradient(180deg, rgba(255, 241, 201, .7), rgba(var(--fcr), .1)); }
.dex-fam-r { top: -13px; right: 18px; }
.dex-ribbon-inline { position: static; display: inline-block; margin-left: 8px; vertical-align: middle; }
#dex-leg[aria-pressed="true"] { background: #FFD166; }

/* item icons (evolution stones and held items) */
.dex-ico { width: 32px; height: 32px; object-fit: contain; flex: none; }
.dex-icos { display: flex; justify-content: center; gap: 2px; }
.evo-how { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.evo-how-k { font-weight: 700; color: var(--ink); }
.evo-stone { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 3px; }
.evo-stone .dex-ico { width: 30px; height: 30px; }
.dex-formnote { margin: 4px 0 8px; color: var(--ink-soft); font-weight: 500; }
.dex-formnote .evo-stone { color: var(--ink); font-weight: 600; }

/* Mega Evolution / Primal Reversion: a separate, distinct row under the chain */
.evo-megas { margin-top: 18px; padding: 12px 14px 14px; border-radius: 20px; border: 2px dashed #E9A93A; background: linear-gradient(135deg, #fff6d9, #ffeef5); }
.evo-megas-t { font-size: 1rem; margin-bottom: 8px; }
.evo-mega-list { display: flex; flex-wrap: wrap; gap: 12px 10px; list-style: none; margin: 0; padding: 0; }
.evo-mega-item { display: flex; align-items: center; }
.evo-mega-card { background: #fff; border-color: #E9A93A; }
.evo-mega-card .dex-no { color: #b9791d; font-weight: 700; letter-spacing: .08em; }
@container dexw (max-width: 580px) {
  .evo-mega-list { flex-direction: column; align-items: center; }
  .evo-mega-item { flex-direction: column; }
  .dex-evo .evo-mega-item .evo-arrow { width: auto; flex-direction: row; gap: 8px; padding: 6px 0; }
}

/* ==========================================================
   Wave 5: Mega group to the right of the evolution chain (same row when it fits)
   ========================================================== */
.dex-evo { --ec: 140px; --ea: 88px; }
.evo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 6px; }
.evo-row > .evo-none { flex: 1 1 100%; margin: 0 0 4px; }
.evo-card { width: var(--ec, 156px); }
.evo-arrow { width: var(--ea, 108px); }
.evo-branchy > .evo-kids { grid-template-columns: repeat(auto-fill, minmax(var(--ec, 156px), 1fr)); }
.evo-megaset { display: flex; align-items: center; flex: none; }
.evo-megas { padding: 10px 12px; border-radius: 20px; border: 2px dashed #E9A93A; background: linear-gradient(135deg, #fff6d9, #ffeef5); margin: 0; }
.evo-mega-list { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.evo-mega-item { display: block; }
.evo-mega-card .evo-stone { margin-top: 2px; font-size: .74rem; font-weight: 600; color: var(--ink-soft); line-height: 1.2; text-align: center; }
.evo-mega-card .evo-stone .dex-ico { width: 28px; height: 28px; }
@container dexw (max-width: 899px) { .dex-evo { --ec: 124px; --ea: 70px; } }
@container dexw (max-width: 580px) {
  .dex-evo { --ec: 156px; --ea: auto; }
  .evo-row { flex-direction: column; align-items: stretch; }
  .evo-row > .evo-tree { align-self: center; }
  .evo-megaset { flex-direction: column; align-self: center; }
  .dex-evo .evo-megaset .evo-arrow { width: auto; flex-direction: row; gap: 8px; padding: 6px 0; }
  .dex-evo .evo-mega-list { align-items: center; }
}

/* ==========================================================
   Wave 5: header icons (binder = violet, map, game cards, trainer avatar)
   ========================================================== */
/* hand-drawn UI icons (icon() in app.js): outline, currentColor, round caps; the size follows the font size unless a rule below sets it */
.dicon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.big .dicon { width: 1em; height: 1em; vertical-align: top; stroke-width: 1.6; }
.hicon { display: block; width: 28px; height: 28px; }
:is(#binder-btn, #map-btn, #game-btn) .ico { display: inline-flex; align-items: center; justify-content: center; }
#binder-btn { background: #D9CCFF; }
#binder-btn[aria-current="page"] { background: #B9A3F5; }
@media (max-width: 479px) { .game-btn .hicon { width: 20px; height: 20px; } }
@media (max-width: 560px) { #pokedex-btn:not([hidden]) ~ .game-wrap .game-btn .hicon { width: 20px; height: 20px; } }
.avs { position: relative; display: block; width: 32px; height: 32px; flex: none; }
.avs .av { position: absolute; inset: 0; width: 32px; height: 32px; max-width: none; transition: opacity .2s ease, transform .2s ease; }
.av-girl { opacity: 0; transform: scale(.8) rotate(-6deg); }
#login-btn[data-avatar="girl"] .av-boy { opacity: 0; transform: scale(.8) rotate(6deg); }
#login-btn[data-avatar="girl"] .av-girl { opacity: 1; transform: none; }
@media (hover: hover) {
  #login-btn[data-avatar="boy"]:hover .av-boy { opacity: 0; transform: scale(.8) rotate(6deg); }
  #login-btn[data-avatar="boy"]:hover .av-girl { opacity: 1; transform: none; }
  #login-btn[data-avatar="girl"]:hover .av-girl { opacity: 0; transform: scale(.8) rotate(-6deg); }
  #login-btn[data-avatar="girl"]:hover .av-boy { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .avs .av { transition: none; } }
.av-pick { margin: 6px 0 0; padding: 0; border: 0; min-width: 0; }
.av-pick .field-label { padding: 0; }
.av-opts { display: flex; gap: 10px; }
.av-opt { flex: 1 1 0; min-height: 44px; border: 2px solid var(--line); border-radius: 999px; background: var(--cream); font-weight: 600; }
.av-opt[aria-checked="true"] { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.av-opt:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 2px; }

/* ==========================================================
   Wave 5: card spec panel = two compact rows (3 columns, Edice the widest); long names wrap inside their cell
   ========================================================== */
.detail-right { container: dright / inline-size; }
/* six tracks: three-cell rows span 2+2+2 (36% / 28% / 36%), a two-cell last row spans 3+3, a lone last cell the whole row */
.detail-right .meta { grid-template-columns: 18fr 18fr 14fr 14fr 18fr 18fr; margin: 8px 0 16px; }
/* wave 6: label and value share one line ("EDICE: Ancient Origins"); a value that does not fit beside its label drops to a 2nd line (label stays top-left) */
.detail-right .meta-i { grid-column: span 2; display: block; min-height: 0; padding: 6px 12px 7px 14px; line-height: 1.3; }   /* label and value flow as one line of text; a long value wraps under the label */
.detail-right .meta-k { display: inline; white-space: nowrap; margin-right: .45em; }
.detail-right .meta-v { display: inline; max-width: 100%; }
.detail-right .meta-i:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.detail-right .meta-i:nth-last-child(2):nth-child(3n+1), .detail-right .meta-i:last-child:nth-child(3n+2) { grid-column: span 3; }
.detail-right .meta-v { text-align: left; line-height: 1.25; overflow-wrap: anywhere; }
/* very long edition name: the first cell takes the whole row, the other cells start on the next one (rows of 3 are then counted from the 2nd item) */
@media (min-width: 421px) {   /* (the narrow layouts below have 2 columns / 1 column and need no special case) */
  @container dright (min-width: 360px) {
    .detail-right .meta.has-wide .meta-i:first-child { grid-column: 1 / -1; }
    .detail-right .meta.has-wide .meta-i:last-child:nth-child(3n+1), .detail-right .meta.has-wide .meta-i:nth-last-child(2):nth-child(3n+1) { grid-column: span 2; }
    .detail-right .meta.has-wide .meta-i:last-child:nth-child(3n+2) { grid-column: 1 / -1; }
    .detail-right .meta.has-wide .meta-i:nth-last-child(2):nth-child(3n+2), .detail-right .meta.has-wide .meta-i:last-child:nth-child(3n) { grid-column: span 3; }
  }
}
@container dright (max-width: 439px) {
  .detail-right .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-right .meta-i, .detail-right .meta-i:nth-child(3n+1), .detail-right .meta-i:nth-last-child(2):nth-child(3n+1), .detail-right .meta-i:last-child:nth-child(3n+2) { grid-column: span 1; }
  .detail-right .meta-i:first-child { grid-column: 1 / -1; }
  .detail-right .meta-i:last-child:nth-child(even) { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .detail-right .meta { grid-template-columns: minmax(0, 1fr); }
  .detail-right .meta-i, .detail-right .meta-i:first-child, .detail-right .meta-i:last-child:nth-child(even) { grid-column: 1 / -1; }
}
#login-btn { padding-top: 4px; padding-bottom: 4px; }   /* the 32px trainer fits the usual 44px button height */
.evo-row > .evo-tree-wide { flex: 1 1 100%; }

/* ==========================================================
   Wave 6: Sealed pill + "Produkty" = our e-shop stock
   ========================================================== */
.menu .pm-out {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 14px;
  border-radius: 14px; color: var(--ink-soft); font-weight: 500; cursor: default;
}
.menu .pm-out .pm-name { opacity: .7; }
.menu .count-out { font-size: .74rem; font-weight: 600; color: #a63a44; background: #fde2e4; padding: 2px 9px; border-radius: 999px; }
.xlink { margin: -6px 0 14px; color: var(--ink-soft); font-size: .93rem; }
.xlink a { color: var(--teal-dd); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.shop-banner { margin-top: 0; }
.chip-stock { display: inline-flex; align-items: center; gap: 6px; background: #dff5e8; color: #1d6f49; border-color: #a9dcc0; }
.chip-stock .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.chip-stock.is-last { background: var(--yellow-l); color: #7a560f; border-color: var(--yellow-d); }
.chip-stock.is-last .dot { background: var(--yellow-d); }
.shop-cart { width: 100%; justify-content: center; margin-top: 6px; }
.shop-toolbar .tb-search { flex: 1 1 200px; }
.shop-toolbar .tb-field { min-width: 0; max-width: 100%; }
@media (max-width: 479px) {
  .catbar-inner { gap: 8px 6px; }
  .pill { padding: 8px 14px; font-size: .92rem; gap: 6px; }
}

/* ==========================================================
   Wave 6: Pokédex alternate forms ("Forms" section) + Shiny
   ========================================================== */
.dex-nf { font-weight: 500; letter-spacing: 0; color: var(--ink-soft); white-space: nowrap; }
.dex-forms { margin: 0 0 20px; padding: 16px 20px 20px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.dex-forms h2 { font-size: 1.3rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.dex-forms-n { font-size: .8rem; font-weight: 600; color: var(--ink-soft); background: var(--cream); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 9px; }
.form-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.form-list > li { display: flex; min-width: 0; }
.form-card { flex: 1 1 auto; width: 100%; }
.form-card .dex-art { width: 96px; }
.form-card .dex-no { font-weight: 700; letter-spacing: .08em; }
.form-card.form-regional .dex-no { color: #2A7468; }
.form-card.form-gmax .dex-no { color: #b9791d; }
.form-card.form-form .dex-no { color: #6d4fb0; }
@media (max-width: 479px) {
  .dex-forms { padding: 14px 12px 16px; }
  .form-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
/* Shiny: toggle pill under the hero artwork, the h1 tag and a short sparkle burst when it is switched on */
.dex-shiny-row { display: flex; justify-content: center; margin-top: 10px; }
.shiny-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper);
  font-weight: 600; box-shadow: 0 3px 0 var(--line);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background .2s, border-color .2s;
}
.shiny-btn:hover { transform: scale(1.05); border-color: var(--teal-d); }
.shiny-btn[aria-pressed="true"] { background: linear-gradient(135deg, #FFE9A8, #ffd1ea 55%, #cfeaff); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.shiny-btn:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 3px; }
.dex-shiny-tag { display: inline-block; vertical-align: middle; margin-left: 8px; line-height: 0; }
.dex-shiny-tag svg { width: 1.7em; height: auto; display: block; overflow: visible; }
.dex-shiny-tag path { fill: #FFC81E; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; paint-order: stroke; }
.dex-sparks { position: absolute; inset: 0; pointer-events: none; }
.dex-sparks i { position: absolute; width: 22px; height: 22px; opacity: 0; background: radial-gradient(circle, #fff 0 18%, rgba(255, 224, 130, .9) 20% 38%, transparent 70%); border-radius: 50%; }
.dex-sparks i:nth-child(1) { left: 12%; top: 18%; }
.dex-sparks i:nth-child(2) { right: 10%; top: 24%; }
.dex-sparks i:nth-child(3) { left: 24%; bottom: 14%; }
.dex-sparks i:nth-child(4) { right: 22%; bottom: 20%; }
.dex-sparks i:nth-child(5) { left: 46%; top: 6%; }
.dex-pic.is-sparkling .dex-sparks i { animation: dex-spark .9s ease-out both; }
.dex-pic.is-sparkling .dex-sparks i:nth-child(2) { animation-delay: .12s; }
.dex-pic.is-sparkling .dex-sparks i:nth-child(3) { animation-delay: .22s; }
.dex-pic.is-sparkling .dex-sparks i:nth-child(4) { animation-delay: .3s; }
.dex-pic.is-sparkling .dex-sparks i:nth-child(5) { animation-delay: .4s; }
@keyframes dex-spark { 0% { opacity: 0; transform: scale(.2) rotate(0); } 35% { opacity: 1; transform: scale(1.5) rotate(45deg); } 100% { opacity: 0; transform: scale(.6) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .dex-pic.is-sparkling .dex-sparks i { animation: none; opacity: 0; } .shiny-btn { transition: none; } }
@media (min-width: 621px) {   /* the Sealed pill sits right of centre: its dropdown opens towards the left so the list + preview card never leave the window */
  #sealed-wrap .menu { left: auto; right: 0; transform-origin: top right; }
}
.gm-item .gm-ico { display: inline-flex; margin-right: 8px; vertical-align: middle; }
.gm-item .gm-ico .hicon { width: 20px; height: 20px; }
.best-box .where-warn { display: inline-block; margin-top: 4px; font-size: .85rem; opacity: .85; }

/* "Nové edice": a small hand-drawn sparkle that twinkles, plus a soft yellow glow (no emoji) */
.pill-new { border-color: #E9C46A; background: linear-gradient(180deg, #FFFDF4, var(--paper)); box-shadow: 0 3px 0 #E9C46A, var(--shadow-1); }
.pill-new:hover { border-color: var(--ink); }
.pill-new .spark { flex: none; transform-origin: 50% 50%; animation: spark-twinkle 2.6s ease-in-out infinite; }
.pill-new:hover .spark { animation-duration: .9s; }
@keyframes spark-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 45% { transform: scale(1.18) rotate(14deg); } 70% { transform: scale(.92) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .pill-new .spark { animation: none; } }

/* back of the card: which back it really has (illustration only) */
.back-note { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; font-size: .86rem; color: var(--ink-soft); line-height: 1.35; }
.back-note b { color: var(--ink); }
.back-ill { font-size: .78rem; opacity: .8; }
.chip-other { background: #FFE9A8; border-color: #E9C46A; color: var(--ink); }
.backimg { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ---------- Ticket 21: honest data / privacy additions ---------- */
/* the page <h1> receives focus after a navigation (tabindex -1): no ring for a heading, it is not interactive */
h1[tabindex="-1"]:focus { outline: none; }
/* neutral two-letter country badge (no emoji flags); the country name is in the tooltip */
.cc-badge {
  display: inline-block; min-width: 1.9em; padding: 0 6px; border-radius: 6px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: .72rem; font-weight: 700; letter-spacing: .04em; line-height: 1.5; text-align: center; vertical-align: baseline;
}
.chip-noneu { background: #FFE9A8; border-color: #E9C46A; color: #6b4a07; margin-left: 4px; }
.best-box .where-stamp { font-size: .85rem; margin-top: 6px; }
.offers-skew { margin-top: -6px; }
.offers-note { margin: 8px 0 0; font-size: .85rem; color: var(--ink); background: var(--yellow-l); border-radius: var(--r-s); padding: 8px 12px; }
.offers-foot a, .no-offers .region-note a { font-weight: 600; }
.no-offers .region-note { display: block; margin-top: 8px; color: var(--ink-soft); font-weight: 500; font-size: .9rem; }
.no-offers-neutral { color: var(--ink-soft); }
.no-offers-neutral strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
/* the row button says "Karta na CardTraderu": it may wrap onto two lines instead of widening the table */
.offers-ct td:last-child .btn-small { white-space: normal; line-height: 1.15; text-align: center; max-width: 7.6em; }
.foot-links { margin-top: 6px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; }
@container offers (max-width: 451px) { .offers-ct td:last-child .btn-small { max-width: none; } }

/* ---------- Static pages (ochrana-udaju.html) ---------- */
.doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 28px var(--gutter) 48px; flex: 1 0 auto; outline: none; }
.doc h1 { font-size: 2rem; margin-bottom: 10px; }
.doc-lead { color: var(--ink-soft); margin-bottom: 22px; }
.doc-sec { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.doc-sec h2 { font-size: 1.2rem; margin-bottom: 8px; }
.doc-sec p + p, .doc-sec ul + p { margin-top: 10px; }
.doc-list { list-style: disc; padding-left: 1.2em; display: grid; gap: 8px; }
.doc-status { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--yellow-l); border: 1.5px solid var(--yellow-d); font-size: .85rem; font-weight: 600; }
.doc a { overflow-wrap: anywhere; }
.doc-updated { color: var(--ink-soft); font-size: .9rem; margin-top: 8px; }
/* ticket 96: terms of use / terms and conditions of sale / complaints procedure (numbered clauses, a) b) items, contents, printable forms) */
.doc-version { color: var(--ink-soft); font-size: .9rem; margin: -4px 0 10px; }
.doc-sub { margin-left: 1.3em; }
.doc-toc .doc-list { list-style: none; padding-left: 0; gap: 4px; }
.doc-sec[id], .doc-sec h2[id] { scroll-margin-top: 16px; }
.offers-3p { margin-top: 8px; font-size: .85rem; }
.offers-3p a { color: var(--ink-soft); text-underline-offset: 3px; }
.doc-form { border-style: dashed; }
.doc-form .doc-list { list-style: none; padding-left: 0; }
@media print {
  .skip-link, .site-header, .site-footer, .doc-machine-note, .hero, .hero-layer, .foot-langs, #hero { display: none !important; }
  body, .doc, .doc-sec { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .doc { max-width: none; padding: 0; }
  .doc-sec { border: 0; padding: 0 0 8px; break-inside: avoid-page; }
  .doc-form { border: 1px solid #000; padding: 12px 16px; break-before: page; break-inside: avoid; }
  .doc a { color: #000; text-decoration: none; }
}
.cal-wrap { overflow-x: auto; }
.cal { width: 100%; border-collapse: collapse; }
.cal th, .cal td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1.5px solid var(--line); }
.cal-date { white-space: nowrap; font-weight: 600; }
.cal-done { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink-soft); font-size: .8rem; }

/* ---- catalogue schema 3: "bez ceny", credits line, note about binder entries of the old catalogue ---- */
.price-none.price-nil { color: var(--ink-soft); }
.credit-line { margin: 14px 0 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.5; overflow-wrap: anywhere; }
.credit-line a { color: inherit; text-decoration: underline; }
.credit-lic { white-space: nowrap; }
.bd-legacy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.bd-legacy .btn { margin-left: auto; }
.site-footer #foot-note a { color: inherit; text-decoration: underline; }
/* ---------- binder import (ticket 42): paste / CSV / photo, review table ---------- */
.imp-modal { width: min(860px, calc(100vw - 24px)); }
.imp-lead { margin: 4px 0 6px; }
.imp-text { display: block; width: 100%; min-height: 150px; padding: 12px 16px; border: 2px solid var(--teal-d); border-radius: 20px; background: #fff; box-shadow: inset 0 2px 4px rgba(62, 156, 140, .12); font: inherit; line-height: 1.4; color: inherit; resize: vertical; }
.imp-go { margin-top: 10px; }
.imp-go .btn { flex: 0 1 auto; }
.imp-pick { position: relative; display: inline-block; min-width: 44px; margin: 2px 0 4px; }
.imp-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 0; }
.imp-pick .btn { pointer-events: none; }
.imp-pick input:focus-visible + .btn { outline: 3px solid var(--teal-d); outline-offset: 3px; }
.imp-photo { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.imp-photo legend { padding: 0; }
.imp-sub { margin: 8px 0 6px; }
.imp-drop { border: 2px dashed var(--teal-d); border-radius: var(--r-s); padding: 4px 14px 14px; background: var(--cream); }
.imp-drop.over { background: var(--teal-l); border-style: solid; }
#imp-ocr-box { margin-top: 10px; }
#imp-prog { display: block; width: 100%; height: 14px; accent-color: var(--teal-d); }
#imp-ocr-status { margin: 8px 0; font-weight: 500; }
.imp-note { margin: 8px 0; font-size: .9rem; }
.imp-h { font-size: 1.2rem; margin: 6px 0 4px; }
.imp-h:focus { outline: none; }
.imp-sum { margin: 4px 0 10px; }
.imp-list { margin: 0 0 6px; padding-left: 20px; font-size: .92rem; }
.imp-selall { margin: 0 0 6px; }
.imp-wrap { container: impt / inline-size; width: 100%; }
.imp-table, .imp-table tbody { display: block; width: 100%; }
.imp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.imp-table tr { display: grid; grid-template-columns: 44px minmax(0, 1.25fr) minmax(0, 1fr) 100px 120px; grid-template-areas: "sel card conf qty cond" ". raw alt alt alt"; gap: 6px 12px; align-items: center; margin-bottom: 8px; padding: 10px 14px; background: var(--cream); border-radius: 20px; }
.imp-table td { display: block; min-width: 0; padding: 0; overflow-wrap: anywhere; }
.imp-table .c-sel { grid-area: sel; }
.imp-table .c-card { grid-area: card; }
.imp-table .imp-confc { grid-area: conf; }
.imp-table .imp-qtyc { grid-area: qty; }
.imp-table .imp-condc { grid-area: cond; }
.imp-table .imp-rawc { grid-area: raw; }
.imp-table .imp-altc { grid-area: alt; }
.imp-table input.imp-on, .imp-selall input { width: 24px; height: 24px; margin: 0; accent-color: var(--teal-d); }
.imp-selall { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.imp-mini { display: block; }
.imp-mini > span { display: block; margin: 0 0 2px 6px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.imp-mini .field { min-width: 0; width: 100%; }
.imp-qty { text-align: right; }
.imp-raw { font-size: .82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.imp-why { display: block; margin-top: 3px; font-size: .8rem; color: var(--ink-soft); }
.imp-chip { font-weight: 600; }
.imp-chip.imp-sure { background: #dff5e8; color: #1d6f49; border-color: #a9dcc0; }
.imp-chip.imp-unsure { background: var(--yellow-l); color: #8a6414; border-color: var(--yellow); }
.imp-chip.imp-none { background: #fde2e4; color: #a63a44; border-color: #f3b9bf; }
.imp-chip.imp-ocr { background: #ece3ff; color: #6d4fb0; border-color: #d7c8f6; }
.imp-table tr.imp-none { opacity: .85; grid-template-areas: "sel card conf conf conf" ". raw raw raw raw"; }
.imp-table input[aria-invalid="true"] { border-color: var(--bad); }
.imp-bar { position: sticky; bottom: -1px; z-index: 2; margin: 10px 0 0; padding: 12px 0 2px; background: var(--paper); border-top: 2px solid var(--line); flex-wrap: nowrap; }
.imp-bar .btn:first-child { flex: 3 1 0; min-width: 0; }
.imp-bar .btn + .btn { flex: 1 1 0; min-width: 84px; }
@container impt (max-width: 620px) {
  .imp-table tr { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "sel card card" ". conf conf" ". raw raw" ". alt alt" ". qty cond"; }
  .imp-table tr.imp-none { grid-template-areas: "sel card card" ". conf conf" ". raw raw"; }
}

/* ---------- Hero (ticket 53, docs/hero.md): picture behind the header bar, the category bar and the space above the search ----------
   A static layer (no animation, no parallax) that sits BEHIND the page (z-index -1 above the canvas background, below every box), pointer-events none and
   out of the layout flow, so the page below does not move. It fades into the page background at the bottom edge (mask) and a light scrim keeps the
   logo, buttons, tabs and the search readable. Own picture (.hero-file, bg/hero.*) or the card-art collage (.hero-cards). Not on the card page. */
.hero {
  --hero-h: clamp(300px, 25vw, 340px);
  position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: var(--hero-h); overflow: hidden; pointer-events: none;
  background: linear-gradient(135deg, var(--teal-l), var(--yellow-l));
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 50%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 50%, transparent 100%);
}
.hero::after {   /* scrim in px (not %): clear over the header and the category bar, page-coloured before the first text of the page (search labels, headings) */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(248, 244, 238, .10) 0, rgba(248, 244, 238, .16) 100px, rgba(248, 244, 238, .50) 126px, rgba(248, 244, 238, .96) 148px, rgba(248, 244, 238, .995) 162px, #F8F4EE 230px);
}
.hero-cards { display: flex; width: 100%; height: 100%; }
.hero-card { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; margin-left: -3.5%; clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%); }
.hero-card:first-child { margin-left: 0; clip-path: polygon(0 0, 100% 0, 93% 100%, 0 100%); }
.hero-card:last-child { clip-path: polygon(7% 0, 100% 0, 100% 100%, 0 100%); }
.hero-card:only-child { clip-path: none; }
.hero-card img, .hero-file {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%;   /* card 63x88: the upper half is the artwork */
  filter: blur(1px) saturate(.9);
}
.hero-file { object-position: 50% 35%; }
.hero-card:first-child img { object-position: 50% 28%; }   /* Arceus: the picture sits a little lower */
.hero-card:last-child img { object-position: 50% 56%; }    /* Rayquaza: the picture sits a little higher */
.hero-card.failed img, .hero-file.failed { display: none; }
.hero-card.failed { background: linear-gradient(135deg, var(--teal-l), var(--yellow-l)); }
.has-hero .site-header { background: rgba(248, 244, 238, .34); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: background-color .2s; }
.has-hero.hero-scrolled .site-header { background: rgba(248, 244, 238, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
/* card page: the category bar is hidden there, so the picture is shorter and fades out right under the header bar (the breadcrumb below stays on the plain page) */
body[data-view="card"] .hero, body[data-view="doc"] .hero { --hero-h: 150px; }
body[data-view="card"] .hero::after, body[data-view="doc"] .hero::after { background: linear-gradient(180deg, rgba(248, 244, 238, .10) 0, rgba(248, 244, 238, .16) 50px, rgba(248, 244, 238, .50) 70px, rgba(248, 244, 238, .96) 92px, rgba(248, 244, 238, .995) 106px, #F8F4EE 130px); }
/* legal pages (ticket 56; the build injects the static layer, body[data-view="doc"], no JS): the same short variant as the card page. Without JS there is no
   hero-scrolled class: where the browser has scroll-driven animations the header turns opaque after 24 px of scrolling, elsewhere it scrolls away with the page
   (a translucent sticky header would show the text under it). */
body[data-view="doc"].has-hero .site-header { animation: doc-hdr-solid linear both; animation-timeline: scroll(root); animation-range: 0px 24px; }
/* no JS here to mark a picture as failed: a broken <img> still paints the browser's broken-image icon in its box, so its ::after (only rendered while the picture is broken,
   never over a loaded one) covers the box with the layer's own gradient */
body[data-view="doc"] .hero img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--teal-l), var(--yellow-l)); }
body[data-view="doc"].has-hero .doc-lead { color: var(--ink); }   /* ink-soft is 4.2:1 on the page colour; the lead sits right under the banner and must reach 4.5:1 */
@keyframes doc-hdr-solid { to { background-color: rgba(248, 244, 238, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
@supports not (animation-timeline: scroll()) { body[data-view="doc"].has-hero .site-header { position: relative; } }
@media (max-width: 899px) { .hero { --hero-h: 260px; } }
@media (max-width: 560px) {
  .hero { --hero-h: 210px; }
  .hero-card:nth-child(n+2):not(:last-child) { display: none; }   /* phone: the first and the last card face each other, the middle one stays out */
  .hero-card:last-child { margin-left: -3.5%; }
}

/* ==========================================================
   i18n - language switcher in the header (button with the code + menu of native names), doc-page machine note, footer language links
   ========================================================== */
.site-lang-wrap { position: relative; }
.site-lang-btn { gap: 6px; padding: 8px 14px; }
.site-lang-btn .lbl { font-weight: 700; letter-spacing: .04em; }
.site-lang-menu { left: auto; right: 0; width: min(250px, calc(100vw - 32px)); padding: 8px; max-height: min(72vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.site-lang-item {
  display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 14px;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.site-lang-item:hover, .site-lang-item:focus-visible { background: var(--teal-l); }
.site-lang-item[aria-current="true"] { background: var(--yellow-l); }
@media (max-width: 700px) {
  .site-lang-btn .caret { display: none; }
  .site-lang-btn { min-width: 44px; padding: 8px 10px; }
}
@media (max-width: 600px) {   /* like the game menu: the popover spans the header width */
  .site-lang-wrap { position: static; }
  .site-lang-menu { left: var(--gutter); right: var(--gutter); width: auto; top: calc(100% + 8px); max-height: calc(100vh - var(--hdr) - 24px); max-height: calc(100dvh - var(--hdr) - 24px); }
}
@media (max-width: 369px) {   /* 320 px: Pokedex + game | tape | language code + three icon buttons must fit without a horizontal scroll */
  .site-header { padding: 0 8px; gap: 2px; }
  .hdr-left, .hdr-right { gap: 2px; }
  .site-lang-btn { min-width: 44px; width: 44px; padding: 8px 2px; font-size: .8rem; }
  .wordmark { min-width: 30px; }
  .tape { width: 28px; height: 23px; }
  /* the full dev header (Mapa TCG + Přihlásit as well) has seven 44px buttons: the wordmark gives way, the breadcrumbs lead home */
  .site-header:has(#map-btn):has(#login-btn) .wordmark { display: none; }
}
/* the language button is one more button on the right: Mapa TCG / Binder labels go a bit earlier, and on phones the full dev header drops the wordmark text */
@media (max-width: 1099px) {
  #map-btn .lbl, #binder-btn .lbl { display: none; }
  #map-btn, #binder-btn { width: 44px; padding: 8px; }
}
@media (max-width: 820px) {
  #login-btn .lbl { display: none; }
  #login-btn { width: 44px; padding: 8px; }
}
@media (max-width: 479px) {
  .site-header:has(#map-btn):has(#login-btn) .wm-text { display: none; }
}
.doc-machine-note {
  margin: 0 0 18px; padding: 10px 16px; border: 2px solid var(--line); border-radius: var(--r-s);
  background: var(--yellow-l); color: var(--ink); font-size: .92rem;
}
.doc-machine-note a { color: var(--teal-dd); font-weight: 600; text-underline-offset: 3px; }
.foot-langs { margin: 10px 0 0; font-size: .85rem; text-align: center; }
.foot-langs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; white-space: nowrap; }
.foot-langs a[aria-current="true"] { font-weight: 700; text-decoration: none; }
/* ticket 71: attribution of the Cardmarket lines and the note of the e-shop line under the chart */
.chart-note a { overflow-wrap: anywhere; }
.chart-attr { color: var(--ink); }
html[data-theme="arcade"] .chart-tip { background: var(--a-black, #05040d); color: var(--a-text, #ecebff); border: 2px solid var(--line); border-radius: 0; }   /* --ink is the LIGHT text colour there: the default tooltip was light on light */
/* ==========================================================
   ticket 77: the "i" info button + popover (one component), our-price legend group + today's line, the "other language / worse condition" row
   ========================================================== */
.info-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: -11px -9px; padding: 0;
  border: 0; background: transparent; color: var(--ink); vertical-align: middle; text-transform: none; letter-spacing: 0; cursor: help;
}
.info-i {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-soft);
  background: var(--paper); color: var(--ink); font-size: .8rem; font-weight: 700; font-style: italic; line-height: 1; transition: background .15s;
}
.info-btn:hover .info-i, .info-btn[aria-expanded="true"] .info-i { background: var(--yellow); border-color: var(--ink); color: #2D4A47; }
.info-btn:focus-visible { outline: none; }
.info-btn:focus-visible .info-i { outline: 3px solid var(--teal-dd); outline-offset: 2px; }
.leg-grp { display: inline-flex; align-items: center; }
.leg-grp .info-btn { margin: 0 -4px 0 -2px; }
.meta-v .info-btn { margin: -13px -6px -13px -2px; }
.offers th .info-btn { margin: -16px -4px -16px -2px; }
.info-narrow { display: none; }
@container offers (max-width: 451px) {   /* the stacked CardTrader / shop rows hide their header: the same tip moves to the panel head */
  .info-narrow { display: inline-flex; }
  .offers-ct thead .info-btn { display: none; }
}
@container offers (max-width: 700px) { .offers:not(.offers-ct) thead .info-btn { display: none; } }
.info-pop {
  position: absolute; z-index: 90; box-sizing: border-box; max-width: calc(100vw - 16px); padding: 10px 14px; background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink-soft); border-radius: 16px; box-shadow: var(--shadow-2); font-size: .88rem; font-weight: 500; line-height: 1.4; text-align: left; overflow-wrap: break-word;
}
.info-pop[hidden] { display: none; }
.info-pop p { margin: 0 0 6px; }
.info-pop p:last-child { margin-bottom: 0; }
.info-pop a { color: var(--teal-dd); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
.info-pop::before {   /* the little arrow towards the button */
  content: ""; position: absolute; top: -8px; left: calc(var(--tip-x, 24px) - 7px); width: 12px; height: 12px; background: var(--paper);
  border-left: 2px solid var(--ink-soft); border-top: 2px solid var(--ink-soft); transform: rotate(45deg);
}
.info-pop.is-above::before { top: auto; bottom: -8px; border: 0; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); }
.chart-ours { margin: 8px 0 0; font-size: .92rem; font-weight: 600; color: var(--ink); }
.offers-low {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 8px 0 0; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 18px;
  background: var(--cream); color: var(--ink); font-size: .9rem; line-height: 1.4;
}
.offers-low .low-t { font-weight: 700; }
.offers-low a { font-weight: 600; overflow-wrap: anywhere; }
html[data-theme="arcade"] .info-i { border-radius: 0; border-color: var(--a-cyan); background: var(--a-black); color: var(--a-cyan); font-style: normal; font-family: var(--a-pixel); font-size: .55rem; }
html[data-theme="arcade"] .info-btn:hover .info-i, html[data-theme="arcade"] .info-btn[aria-expanded="true"] .info-i { background: var(--a-yellow); border-color: var(--a-yellow); color: var(--a-black); }
html[data-theme="arcade"] .info-btn:focus-visible .info-i { outline-color: var(--a-yellow); }
html[data-theme="arcade"] .info-pop { border: 2px solid var(--a-cyan); border-radius: 0; box-shadow: 4px 4px 0 var(--a-black); font-size: 1.1rem; }
html[data-theme="arcade"] .info-pop::before { border-radius: 0; border-color: var(--a-cyan); }
html[data-theme="arcade"] .info-pop a { color: var(--a-cyan); }
html[data-theme="arcade"] .offers-low { border-radius: 0; border-color: var(--a-violet); }

/* ---- enlarged card, edition wordmark ---- */
.cardbtn[data-zoom] { cursor: zoom-in; }
.flipped .cardbtn[data-zoom] { cursor: pointer; }
dialog.card-zoom { border: 0; padding: 0; margin: auto; background: none; max-width: none; max-height: none; overflow: visible; }
dialog.card-zoom::backdrop { background: rgba(8, 6, 20, .82); }
.card-zoom-btn { display: block; border: 0; padding: 0; background: none; cursor: zoom-out; }
.card-zoom img { display: block; height: min(94vh, 131vw); width: auto; max-width: 94vw; object-fit: contain; border-radius: 4.5% / 3.2%; box-shadow: 0 18px 60px rgba(0, 0, 0, .6); }
dialog.card-zoom[open] { animation: card-zoom .18s ease-out; }
@keyframes card-zoom { from { opacity: 0; scale: .85; } }
@media (prefers-reduced-motion: reduce) { dialog.card-zoom[open] { animation: none; } }
.set-word { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; width: 100%; text-align: center; font-weight: 700; font-size: .72rem; line-height: 1.15; overflow-wrap: anywhere; }
.pk-row .set-logo:has(.set-word) { align-items: center; }
.pk-row .set-word { font-size: 1.05rem; }
.hero-logo .set-word { font-size: 1.5rem; color: #fff; }
.hero-logo:has(.set-word) { display: flex; align-items: center; }

/* ==========================================================
   ticket 81: variants under the parent edition, bigger picker with an era column, set tabs, set stats bar
   ========================================================== */
.pk-variants { display: block; margin-top: 2px; font-size: .72rem; font-weight: 600; color: var(--teal-dd); }
.set-var { font-size: .7rem; font-weight: 600; color: var(--teal-dd); white-space: nowrap; }
@media (max-width: 899px) { .set-item .set-var { display: none; } }

/* picker: era column (wide) / chip row above the list (sheet); the large dialog fits 4 columns of edition cards (it was 3) */
.picker-pop .pk-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.picker-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 16px; }
.picker-body .picker-list { flex: 1 1 0; min-width: 0; }
.pk-eras {
  position: relative; flex: 0 0 210px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--teal) transparent; padding: 4px 10px 8px 2px; border-right: 2px solid var(--line);
}
.pk-eras[hidden] { display: none; }
.pk-era {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 6px 12px; text-align: left;
  border: 2px solid transparent; border-radius: var(--r-s); background: transparent; color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.2;
}
.pk-era:hover, .pk-era:focus-visible { background: var(--teal-l); border-color: var(--teal-d); }
.pk-era.is-on { background: var(--yellow); border-color: var(--ink); }
.pk-era .count { flex: none; font-weight: 500; font-size: .75rem; background: var(--cream); color: var(--ink); padding: 1px 8px; border-radius: 999px; }
.pk-era-n { min-width: 0; overflow-wrap: anywhere; }
.picker-sheet .picker-body { flex-direction: column; gap: 8px; }
.picker-sheet .pk-eras {
  flex: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 2px 0 8px; border-right: 0; scroll-snap-type: x proximity;
}
.picker-sheet .pk-era { width: auto; flex: none; white-space: nowrap; scroll-snap-align: start; border-radius: 999px; padding: 6px 14px; gap: 6px; }
.picker-sheet .pk-era-n { overflow-wrap: normal; }

/* the variants of an edition: "Základní" + one chip per variant, the open one is marked */
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.set-chips .toggle-chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.set-chips .toggle-chip[aria-current="page"] { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* tabs: Karty (N) / Sealed produkty (M) */
.set-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.set-tab { cursor: pointer; font-family: inherit; }
.set-tab[aria-selected="true"] { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink), var(--shadow-1); }
.set-tab:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.set-tab:disabled:hover { transform: none; border-color: var(--line); }

/* the stats bar under the set hero */
.set-stats {
  display: flex; align-items: stretch; margin: -6px 0 18px; padding: 14px 8px; border-radius: var(--r); background: var(--ink); color: var(--cream);
  border: 2px solid var(--ink); box-shadow: var(--shadow-1);
}
.ss-cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 2px 18px; }
.ss-cell + .ss-cell { border-left: 1px solid rgba(248, 244, 238, .18); }
.ss-lab { display: flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.ss-val { font-size: 1.15rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.ss-usd { font-size: .8rem; color: var(--teal); }
.ss-symrow { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.ss-symimg { display: block; width: 28px; height: 28px; flex: none; }
.ss-symimg .imgbox { width: 100%; height: 100%; }
.ss-symimg .imgbox img { width: 100%; height: 100%; object-fit: contain; }
.ss-symimg .imgbox.failed { display: none; }
.ss-code { font-size: 1.15rem; letter-spacing: .06em; }
.ss-ringcell { flex: 0 0 auto; align-items: center; }
.ss-ring { position: relative; display: block; width: 62px; height: 62px; }
.ss-ring svg { display: block; width: 100%; height: 100%; }
.ss-ring-bg, .ss-ring-fg { fill: none; stroke-width: 3.6; }
.ss-ring-bg { stroke: rgba(248, 244, 238, .2); }
.ss-ring-fg { stroke: var(--yellow); }
.ss-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.ss-coll { font-size: 1.3rem; }
.set-stats .info-btn { margin: -13px -9px -13px -4px; }
.set-stats .info-i { background: var(--paper); border-color: var(--teal); color: var(--ink); }
html[data-theme="arcade"] .set-stats { background: var(--a-panel2); color: var(--a-text); border-color: var(--a-cyan); box-shadow: 4px 4px 0 var(--a-black); }
html[data-theme="arcade"] .ss-cell + .ss-cell { border-left-color: var(--line); }
html[data-theme="arcade"] .ss-ring-bg { stroke: var(--line); }
@media (max-width: 760px) {
  .set-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 0; padding: 12px 4px; margin-top: -4px; }
  .set-stats .ss-cell { padding: 2px 12px; border-left: 0; }
  .set-stats .ss-cell:nth-child(1), .set-stats .ss-cell:nth-child(2), .set-stats .ss-cell:nth-child(3) { grid-column: span 2; }   /* row 1: series, symbol, value */
  .set-stats .ss-cell:nth-child(4), .set-stats .ss-cell:nth-child(5) { grid-column: span 3; }                                   /* row 2: ring, collection */
  .set-stats .ss-cell:nth-child(2), .set-stats .ss-cell:nth-child(3), .set-stats .ss-cell:nth-child(5) { border-left: 1px solid rgba(248, 244, 238, .18); }
  html[data-theme="arcade"] .set-stats .ss-cell:nth-child(2), html[data-theme="arcade"] .set-stats .ss-cell:nth-child(3), html[data-theme="arcade"] .set-stats .ss-cell:nth-child(5) { border-left-color: var(--line); }
  .ss-ringcell { align-items: flex-start; flex-direction: row; gap: 12px; }
  .ss-val { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .set-tab, .pk-era { transition: none; } }

/* ==========================================================
   ticket 82: login + profile PREVIEW (dialog, account menu, #/profil). Base tokens only, so the arcade theme follows.
   ========================================================== */
.login-modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.login-modal h2 { padding-right: 48px; }
.login-preview { margin: 10px 0 4px; font-weight: 500; }
.login-google { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; }
.g-mark {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font-weight: 700; font-size: .95rem; line-height: 1;
}
.login-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: var(--ink-soft); font-size: .9rem; }
.login-or::before, .login-or::after { content: ""; flex: 1 1 0; height: 2px; background: var(--line); }
.login-switch-row { margin: 12px 0 0; text-align: center; color: var(--ink-soft); font-size: .95rem; }
.login-switch {
  min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--teal-dd); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.login-switch:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 2px; }

.account-wrap { position: relative; }
.account-menu { left: auto; right: 0; width: min(260px, calc(100vw - 32px)); padding: 8px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; padding: 6px 10px 10px; border-bottom: 2px solid var(--line); }
.acct-nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip { flex: none; }
.acct-item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 14px; background: none;
  color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.acct-item:hover, .acct-item:focus-visible { background: var(--teal-l); }
#login-btn.is-in .lbl { display: inline-block; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
@media (max-width: 600px) {   /* like the language menu: the popover spans the header width */
  .account-wrap { position: static; }
  .account-menu { left: var(--gutter); right: var(--gutter); width: auto; top: calc(100% + 8px); }
}

.pf-preview { font-weight: 500; }
.pf-id-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 24px; }
.pf-avatar { display: block; flex: none; width: 92px; height: 92px; border: 2px solid var(--line); border-radius: 50%; background: var(--teal-l); overflow: hidden; }
.pf-avatar .av { display: block; width: 100%; height: 100%; opacity: 1; transform: none; }   /* beats the header's .av-girl { opacity: 0 } */
.pf-avatar[data-avatar="boy"] .av-girl, .pf-avatar[data-avatar="girl"] .av-boy { display: none; }
.pf-id-fields { flex: 1 1 260px; min-width: 0; }
.pf-id-fields .field-label { margin-top: 0; }
.pf-nick-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-nick-row .field { flex: 1 1 180px; min-width: 0; width: auto; }
.pf-id-fields .av-pick { margin-top: 14px; }
.pf-selects { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 10px; }
.pf-selects .country-field { flex: 1 1 220px; min-width: 0; }
.pf-selects .pill-select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
.pf-tiles { margin: 10px 0 12px; }
.pf-binders { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-binders li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); }
.pf-b-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.pf-b-val { flex: none; color: var(--ink-soft); }
.pf-hint { margin: 8px 0 0; font-size: .9rem; }
.pf-coll > p { margin: 12px 0 0; }
html[data-theme="arcade"] .av-opt[aria-checked="true"] { color: var(--a-black); }
.pf-watch .empty { padding: 24px 16px; margin-bottom: 14px; }
.pf-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.pf-check input { flex: none; width: 22px; height: 22px; accent-color: var(--teal-d); }
.pf-out-actions { margin: 4px 0 24px; }
@media (max-width: 479px) {
  .pf-avatar { width: 72px; height: 72px; }
}

/* ==========================================================
   ticket 85: promo badge, set-chip counts, Showcase preview, shop product page, a bit more readable small text (classic theme; the arcade theme is in arcade.css)
   ========================================================== */
.badge-promo {
  display: inline-block; flex: none; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 6px; background: var(--pink); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.pk-flags .badge-promo { margin: 0; }
.set-sub .badge-promo { margin: 0; }
.set-hero h1 .badge-promo { margin-left: 8px; font-size: .75rem; }
.set-chips .toggle-chip small { margin-left: 6px; font-size: .8rem; font-weight: 600; opacity: .8; }
button.toggle-chip { cursor: pointer; font-family: inherit; }

/* a bit bigger small text */
.ss-lab { font-size: .8rem; }
.pk-variants { font-size: .8rem; }
.set-var { font-size: .78rem; }
.pk-row .set-date { font-size: .8rem; }
.filters .country-label { font-size: .76rem; }
.pk-era .count { font-size: .82rem; }

/* Showcase (preview) */
.sc-banner { margin: 0 0 18px; font-weight: 500; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.sc-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sc-card.is-mine { border-color: var(--yellow-d); }
.sc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sc-av { width: 52px; height: 52px; flex: none; }
.sc-who { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.sc-nick { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.1rem; }
.sc-title { margin: 0; color: var(--ink-soft); min-height: 1.3em; }
.sc-stats, .sc-cmp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.sc-stats div, .sc-row { min-width: 0; }
.sc-stats dt, .sc-row dt { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.sc-stats dd, .sc-row dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.sc-h { margin: 4px 0 0; font-size: .9rem; }
.sc-top, .sc-common-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sc-common-list { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 12px; }
.sc-top-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
.sc-img { display: block; aspect-ratio: 5 / 7; background: var(--teal-l); border-radius: 6px; overflow: hidden; }
.sc-img .imgbox { display: block; width: 100%; height: 100%; }
.sc-img .imgbox img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-cn { font-size: .85rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-cv { font-size: .8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.sc-compare, .sc-card > .btn { align-self: flex-start; margin-top: 4px; }
.sc-hint { margin: 14px 0 0; }
.sc-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 18px; }
.sc-cmp-stats { grid-template-columns: 1fr; }
.sc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 2px solid var(--line); }
.sc-row dd { margin: 0; }
.sc-row.is-lead dd { color: var(--teal-dd); }
.sc-row.is-lead dd::before { content: "▲ "; font-size: .8em; }
.sc-common h2 .count { font-weight: 600; background: var(--cream); padding: 1px 10px; border-radius: 999px; margin-left: 6px; }
@media (max-width: 600px) {
  .sc-grid { grid-template-columns: minmax(0, 1fr); }
  .sc-cmp { grid-template-columns: minmax(0, 1fr); }
}

/* shop product page (preview) */
.pd-back { margin: 0 0 14px; }
.pd { display: grid; grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); gap: 28px; align-items: start; }
.pd-photo { background: var(--teal-l); border-radius: var(--r); padding: 12px; }
.pd-photo .imgbox { display: block; width: 100%; aspect-ratio: 1 / 1; }
.pd-photo .imgbox img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-info h1 { margin: 0 0 6px; }
.pd-sub { margin: 0 0 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pd-price-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 6px; }
.pd-price { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.pd-market { margin: 0 0 16px; color: var(--ink-soft); }
.pd-diff.is-up { color: var(--bad); }
.pd-diff.is-down { color: var(--good); }
.pd-buy-row { margin: 0 0 6px; }
.pd-buy { min-height: 48px; padding-inline: 28px; }
.pd-preview { min-height: 1.4em; margin: 0 0 14px; font-weight: 600; }
.pd-h2 { margin: 14px 0 8px; font-size: 1.05rem; }
.pd-delivery { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pd-hint { margin: 0; font-size: .9rem; }
@media (max-width: 720px) { .pd { grid-template-columns: minmax(0, 1fr); gap: 16px; } .pd-photo .imgbox { max-height: 320px; } }
.pk-row .badge-promo.is-ribbon { position: absolute; top: 8px; left: 8px; z-index: 2; margin: 0; }
.pk-row { position: relative; }
/* owner 2026-11-27: the variant chips (Základní / Classic Collection) and the tabs Karty / Sealed share one row; they wrap only when the row is too narrow */
.set-navrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.set-navrow .set-chips, .set-navrow .set-tabs { margin: 0; }
