/* =========================================================
   Pokémon 30 – sběratelská PWA
   ========================================================= */

@font-face { font-family: "BSC"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(fonts/bsc-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BSC"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(fonts/bsc-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "BSC"; font-weight: 800; font-style: italic; font-display: swap;
  src: url(fonts/bsc-latin-800-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BSC"; font-weight: 800; font-style: italic; font-display: swap;
  src: url(fonts/bsc-latin-ext-800-italic.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #23180a;
  --ink-2: #5d4a2c;
  --cream: #fff8e4;
  --cream-2: #ffe7a1;
  --gold-1: #fde39a;
  --gold-2: #e6b04a;
  --gold-3: #b9832a;
  --gold-grad: linear-gradient(100deg, #c99236 0%, #fbe08f 38%, #fff1bf 50%, #f2c766 64%, #c48a2c 100%);
  --gold-border: linear-gradient(135deg, #f9d77d, #c58e2f 30%, #fff0b8 50%, #c9922f 72%, #f8d57a);
  --holo-grad: linear-gradient(100deg, #a45ad6 0%, #7fc7f7 35%, #8ef0ff 55%, #77b8f5 75%, #b25cd8 100%);
  --night: #170f05;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius-card: 4.4%;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
/* Neprůhledné pozadí celé stránky: zakryje i spodní okraj na iOS a vypne systémové rozmazání horní hrany (iOS 26) */
html { background: linear-gradient(110deg, #ffe9a9, #fff6dd 60%, #fff9e9) #fff6dd; }
html.dark-bg { background: #0e0902; }
body {
  font-family: "BSC", "Barlow Semi Condensed", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
}
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
#app { position: fixed; inset: 0; background-color: #fff6dd; }
/* iOS 26 (aplikace na ploše) hlásí výšku okna kratší o horní okraj → aplikace by končila nad spodní hranou.
   JS spočítá skutečnou výšku obrazovky do --app-h a #app se roztáhne až dolů. */
html.vh-fix #app { position: absolute; top: 0; left: 0; right: 0; bottom: auto; height: var(--app-h); }
html.dark-bg #app { background-color: #0e0902; }
.hidden { display: none !important; }

/* ---------- Buttons in the style of the reference ---------- */
.btn {
  --fill: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 48px; padding: .5em 1.25em;
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .01em;
  font-size: 1.05rem; line-height: 1; white-space: nowrap;
  color: var(--ink);
  border: 3px solid transparent; border-radius: 16px;
  background: linear-gradient(var(--fill), var(--fill)) padding-box, var(--gold-border) border-box;
  box-shadow: 0 2px 0 rgba(150, 100, 20, .25), 0 6px 18px rgba(170, 120, 30, .18);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s;
}
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 0 0 rgba(0,0,0,0); }
.btn-gold { background: var(--gold-grad) padding-box, var(--gold-border) border-box; }
.btn-black { color: #fff; background: linear-gradient(#000, #000) padding-box, var(--gold-border) border-box; }
.btn-holo { background: var(--holo-grad) padding-box, linear-gradient(135deg, #6a8ee8, #b7a3ff, #6a8ee8) border-box; }
.btn-big { min-height: 60px; font-size: 1.35rem; padding: .55em 1.6em; border-radius: 20px; }
.btn-small { min-height: 38px; font-size: .9rem; padding: .35em .9em; border-radius: 12px; border-width: 2px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Intro ---------- */
.intro {
  position: absolute; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 246, 214, .0) 0%, rgba(255, 246, 214, .55) 55%, rgba(255, 240, 200, .92) 100%),
    url(img/vizual.webp) center 30% / cover no-repeat,
    linear-gradient(180deg, #fff3cf, #ffd978);
  transition: opacity .6s ease, transform .6s ease;
}
.intro.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.intro-inner { display: flex; flex-direction: column; align-items: center; gap: clamp(18px, 4vh, 36px); padding: 24px; text-align: center; }
.intro-logo { width: min(78vw, 520px); filter: drop-shadow(0 12px 30px rgba(80, 50, 0, .45)); animation: logoIn 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes logoIn { from { transform: scale(.5) rotate(-6deg); opacity: 0; } }
.intro .btn { animation: pop .5s .6s both; }
.intro-sub { font-size: 1.1rem; color: var(--ink-2); background: rgba(255, 249, 230, .85); padding: 6px 14px; border-radius: 999px; animation: pop .5s .8s both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.gift { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.gift h2 { margin: 0; font-weight: 800; font-style: italic; font-size: clamp(1.8rem, 6vw, 2.6rem); text-transform: uppercase;
  background: rgba(255, 250, 235, .9); padding: 6px 22px; border-radius: 16px; box-shadow: 0 6px 20px rgba(120, 80, 0, .2); }
.gift-packs { position: relative; height: min(38vh, 300px); width: min(90vw, 520px); }
.gift-packs img { position: absolute; left: 50%; bottom: 0; height: 100%; transform-origin: 50% 110%;
  filter: drop-shadow(0 10px 18px rgba(60, 30, 0, .45)); animation: fanIn .7s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes fanIn { from { transform: translateX(-50%) translateY(40%) rotate(0deg) scale(.6); opacity: 0; } }

/* ---------- Shell ---------- */
.shell { position: absolute; inset: 0; display: flex; flex-direction: column;
  background:
    /* pod stavovým řádkem iOS jednolitá barva – systémové rozmazání horní hrany pak není vidět */
    linear-gradient(180deg, var(--cream) 0, var(--cream) calc(var(--safe-t) * 1.7), rgba(255, 248, 228, 0) calc(var(--safe-t) * 2.8)),
    linear-gradient(180deg, rgba(255, 248, 228, .0) 0, var(--cream) clamp(260px, 22vw, 560px)),
    url(img/vizual.webp) center top / max(1400px, 100%) auto no-repeat,
    var(--cream);
}
.shell::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 220, 120, .55), rgba(255, 245, 215, .55) 60%, rgba(255, 250, 235, .7)); }
.topbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 10px) 16px 8px; }
.topbar .mini-logo { height: 44px; filter: drop-shadow(0 3px 6px rgba(80, 50, 0, .3)); }
.topbar .spacer { flex: 1; }
.progress-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); box-shadow: 0 2px 10px rgba(150, 100, 20, .18); font-weight: 800; font-style: italic; font-size: 1.05rem; }
.progress-pill .bar { width: 64px; height: 8px; border-radius: 99px; background: #f1e3bd; overflow: hidden; }
.progress-pill .bar i { display: block; height: 100%; background: var(--gold-grad); border-radius: inherit; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .8);
  box-shadow: 0 2px 10px rgba(150, 100, 20, .15); }
.icon-btn svg { width: 24px; height: 24px; }

.views { position: relative; z-index: 1; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(var(--safe-b) + 110px); overscroll-behavior: contain; }
.view.enter { animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.wrap { max-width: 1100px; margin: 0 auto; }
.h1 { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 6px 0 2px; }
.sub { color: var(--ink-2); margin: 0 0 14px; font-size: 1.02rem; }

/* ---------- Tab bar ---------- */
.tabbar { position: absolute; z-index: 5; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px; border-radius: 24px;
  background: rgba(35, 24, 10, .92); box-shadow: 0 10px 30px rgba(60, 35, 0, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 86px; height: 58px; padding: 0 12px; border-radius: 18px; color: #f6e4b5;
  font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .82rem; letter-spacing: .02em; transition: background .2s, color .2s; }
.tab svg { width: 26px; height: 26px; }
.tab.active { color: var(--ink); background: var(--gold-grad); }
.badge { position: absolute; top: 2px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-style: normal; font-size: .8rem; font-weight: 800; color: #fff; background: #e5392f;
  box-shadow: 0 0 0 2px rgba(35, 24, 10, .92); }
.badge.bump { animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 50% { transform: scale(1.6); } }

/* ---------- Packs view ---------- */
.packs-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 2vh; }
.pack-pile { position: relative; height: min(54vh, 520px); aspect-ratio: 420 / 768; margin: 0 auto; cursor: pointer; touch-action: manipulation; }
.pack-pile img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 14px 22px rgba(70, 40, 0, .35)); }
.pack-pile .p1 { transform: rotate(-7deg) translate(-9%, 2%); filter: brightness(.82) drop-shadow(0 10px 16px rgba(70, 40, 0, .3)); }
.pack-pile .p2 { transform: rotate(6deg) translate(8%, 1%); filter: brightness(.9) drop-shadow(0 10px 16px rgba(70, 40, 0, .3)); }
.pack-pile .top { animation: floaty 3.2s ease-in-out infinite; }
.pack-pile:active .top { transform: scale(.97); }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(-1deg); } }
.pack-pile .count { position: absolute; right: -14px; top: 8%; z-index: 3; min-width: 58px; height: 58px; padding: 0 10px; border-radius: 99px;
  display: grid; place-items: center; font-weight: 800; font-style: italic; font-size: 1.6rem; color: var(--ink);
  background: var(--gold-grad) padding-box, var(--gold-border) border-box; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(90, 55, 0, .35); }
.pack-pile.god::before, .pack3d.god::before, .aura-ultra::before {
  content: ""; position: absolute; inset: -8%; z-index: -1; border-radius: 40%;
  background: conic-gradient(from 0deg, #ff6b6b, #ffd36b, #8dff7a, #6be7ff, #9a7bff, #ff6bd8, #ff6b6b);
  filter: blur(26px); opacity: .85; animation: hueAura 2.4s linear infinite;
}
@keyframes hueAura { from { filter: blur(26px) hue-rotate(0deg); } to { filter: blur(26px) hue-rotate(360deg); } }
@keyframes spinAura { to { transform: rotate(360deg); } }
.pack-pile.empty { cursor: default; }
.pack-pile.empty img { filter: grayscale(1) opacity(.35); animation: none; }
.tap-hint { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.15rem;
  padding: 8px 18px; border-radius: 99px; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 14px rgba(150, 100, 20, .2); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.next-free { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.next-free .clock { font-weight: 800; font-style: italic; font-size: 1.35rem; background: rgba(255, 255, 255, .9); padding: 10px 18px; border-radius: 16px; box-shadow: 0 4px 14px rgba(150, 100, 20, .18); }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 10px; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.15rem; }
.section-title small { font-weight: 600; font-style: normal; text-transform: none; color: var(--ink-2); font-size: .95rem; }
.history { display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 14px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.hist { flex: 0 0 auto; scroll-snap-align: start; width: 132px; padding: 10px 8px 8px; border-radius: 16px; background: rgba(255, 255, 255, .85);
  box-shadow: 0 3px 12px rgba(150, 100, 20, .16); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hist.god { background: linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)) padding-box, var(--holo-grad) border-box; border: 3px solid transparent; }
.hist .fan { position: relative; height: 92px; width: 100%; }
.hist .fan img { position: absolute; bottom: 0; left: 50%; width: 52px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transform-origin: 50% 120%; }
.hist .when { font-size: .85rem; color: var(--ink-2); }

/* ---------- Library ---------- */
.lib-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 10px; }
.lib-progress { flex: 1 1 260px; display: flex; align-items: center; gap: 12px; }
.lib-progress .num { font-weight: 800; font-style: italic; font-size: 1.6rem; white-space: nowrap; }
.lib-progress .bar { flex: 1; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .8); box-shadow: inset 0 1px 3px rgba(120, 80, 0, .2); overflow: hidden; }
.lib-progress .bar i { display: block; height: 100%; background: var(--gold-grad); border-radius: inherit; transition: width .6s ease; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .btn { flex: 0 0 auto; min-height: 42px; font-size: .95rem; padding: .35em 1em; opacity: .62; transform: scale(.96); }
.chips .btn.on { opacity: 1; transform: scale(1); box-shadow: 0 0 0 3px rgba(35, 24, 10, .85), 0 6px 18px rgba(170, 120, 30, .3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(150, 100, 20, .15); }
.seg button { padding: 8px 12px; border-radius: 10px; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .85rem; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fde9b3; }
.toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .85);
  box-shadow: 0 2px 8px rgba(150, 100, 20, .15); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .85rem; }
.toggle .sw { width: 36px; height: 22px; border-radius: 99px; background: #d9c99f; position: relative; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on .sw { background: var(--gold-3); }
.toggle.on .sw::after { transform: translateX(14px); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px; } }
.tile { position: relative; aspect-ratio: 660 / 920; border-radius: 6px; transition: transform .15s ease; }
.tile:active { transform: scale(.95); }
.tile img { width: 100%; height: 100%; display: block; border-radius: 6px; box-shadow: 0 3px 10px rgba(90, 60, 10, .25); }
.tile.r-rare img { box-shadow: 0 0 0 2px #f4c95b, 0 0 14px rgba(255, 200, 70, .7); }
.tile.r-ultra img { box-shadow: 0 0 0 2px #b88cff, 0 0 16px rgba(130, 170, 255, .85); }
.tile.missing img { filter: grayscale(1) brightness(.75) contrast(.8); opacity: .45; box-shadow: none; }
.tile .q { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-style: italic; font-size: 1.3rem; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.tile .cnt { position: absolute; right: -6px; bottom: -6px; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
  font-weight: 800; font-style: italic; font-size: .95rem; background: var(--ink); color: #fde9b3; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.tile .cnt.multi { background: var(--gold-grad); color: var(--ink); }
.tile .newb { position: absolute; left: -6px; top: -6px; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-style: italic; font-size: .75rem;
  background: #e5392f; color: #fff; border: 2px solid #fff; transform: rotate(-8deg); }
.tile.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.empty-lib { text-align: center; padding: 40px 10px; color: var(--ink-2); font-size: 1.1rem; }

/* ---------- Tasks ---------- */
.free-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; margin-bottom: 18px;
  background: linear-gradient(rgba(255,255,255,.92), rgba(255,255,255,.92)) padding-box, var(--gold-border) border-box; border: 3px solid transparent;
  box-shadow: 0 6px 18px rgba(150, 100, 20, .16); }
.free-card img { height: 72px; filter: drop-shadow(0 4px 6px rgba(70, 40, 0, .3)); }
.free-card b { display: block; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.15rem; }
.free-card span { color: var(--ink-2); }
.tasks { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .tasks { grid-template-columns: 1fr 1fr; gap: 16px; } }
.view-tasks .wrap { max-width: 900px; }
.task { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 20px; text-align: left; min-height: 84px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(150, 100, 20, .16); transition: transform .15s, opacity .3s; }
.task:active { transform: scale(.98); }
.task .emo { font-size: 2.2rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #fff3d1; }
.task .txt { flex: 1; }
.task .txt b { display: block; font-weight: 800; font-style: italic; font-size: 1.2rem; text-transform: uppercase; }
.task .txt span { color: var(--ink-2); font-size: .95rem; }
.task .reward { flex: 0 0 auto; margin-left: auto; font-weight: 800; font-style: italic; font-size: 1.2rem; text-transform: uppercase; white-space: nowrap; }
.task .check { width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--gold-2); display: grid; place-items: center; background: #fff; flex: 0 0 auto; }
.task .check svg { width: 26px; height: 26px; opacity: 0; transform: scale(.4); transition: all .25s cubic-bezier(.3, 1.6, .5, 1); }
.task.done { opacity: .7; }
.task.done .check { background: var(--gold-grad); border-color: var(--gold-3); }
.task.done .check svg { opacity: 1; transform: scale(1); }

/* ---------- Sheet (confirm) ---------- */
.sheet-bg { position: absolute; inset: 0; z-index: 60; background: rgba(25, 15, 3, .55); display: grid; place-items: end center; animation: fade .2s both; }
@media (min-width: 640px) { .sheet-bg { place-items: center; } }
.sheet { width: min(100%, 460px); margin: 0 auto; padding: 22px 20px calc(var(--safe-b) + 22px); border-radius: 26px 26px 0 0; background: var(--cream);
  text-align: center; animation: up .3s cubic-bezier(.2, 1.2, .4, 1) both; }
@media (min-width: 640px) { .sheet { border-radius: 26px; padding-bottom: 22px; } }
.sheet .emo { font-size: 3rem; }
.sheet .emo-ico { width: 68px; height: 68px; margin: 0 auto 4px; display: grid; place-items: center; border-radius: 20px; background: #fff;
  box-shadow: 0 3px 14px rgba(150, 100, 20, .2); }
.sheet .emo-ico svg { width: 38px; height: 38px; }
.sheet h3 { margin: 6px 0; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.5rem; }
.sheet p { margin: 0 0 18px; color: var(--ink-2); font-size: 1.08rem; }
.sheet .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* Úzké telefony: v horní liště jen počet karet bez ukazatele */
.progress-pill { white-space: nowrap; }
@media (max-width: 430px) { .progress-pill .bar { display: none; } .topbar { gap: 8px; } }

/* Rodičovská sekce */
.sheet .inp { width: 100%; max-width: 220px; min-height: 52px; padding: 8px 14px; margin: 0 auto 16px; display: block; border-radius: 14px; border: 3px solid var(--gold-2);
  background: #fff; font: 800 italic 1.5rem "BSC", system-ui, sans-serif; text-align: center; text-transform: uppercase; color: var(--ink); -webkit-user-select: text; user-select: text; }
.sheet .row .inp { margin: 0; flex: 1 1 150px; max-width: 200px; }
.sheet .inp:focus { outline: none; border-color: var(--gold-3); box-shadow: 0 0 0 4px rgba(230, 176, 74, .3); }
.sheet .inp.shake { animation: shake .4s; }
.sheet.parent { text-align: center; }
.sheet.parent .row { margin-bottom: 14px; }
.codebox { display: inline-block; margin: 0 0 12px; padding: 10px 26px; border-radius: 18px; font-weight: 800; font-style: italic; font-size: 2.6rem; letter-spacing: .04em;
  background: var(--gold-grad) padding-box, var(--gold-border) border-box; border: 3px solid transparent; -webkit-user-select: all; user-select: all; }
.sheet .note { font-size: .95rem; opacity: .85; }
.sheet .note.err { color: #c0392b; opacity: 1; font-weight: 800; }
.sheet .or { margin: 4px 0 12px; font-weight: 800; font-style: italic; text-transform: uppercase; opacity: .55; }

/* ---------- Toast ---------- */
.toast { position: absolute; z-index: 90; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); padding: 12px 20px; border-radius: 16px;
  font-weight: 800; font-style: italic; font-size: 1.1rem; background: var(--ink); color: #fde9b3; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: toastIn .35s cubic-bezier(.2, 1.4, .4, 1) both; white-space: nowrap; pointer-events: none; }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } }
@keyframes toastOut { to { transform: translate(-50%, -30px); opacity: 0; } }
.flyer { position: absolute; z-index: 95; height: 90px; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }

/* =========================================================
   Stage – opening packs (dark, dramatic)
   ========================================================= */
.stage { position: absolute; inset: 0; z-index: 40; overflow: hidden; touch-action: none;
  background: radial-gradient(ellipse at 50% 42%, #4a3412 0%, #241706 45%, #0e0902 100%); color: #fde9b3;
  animation: fade .3s both; }
.stage::before { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: .18;
  background: url(img/vizual.webp) center / cover; filter: blur(2px) saturate(.7); }
.stage::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--safe-t) * 2.8); pointer-events: none;
  background: linear-gradient(180deg, #0e0902 0, #0e0902 60%, rgba(14, 9, 2, 0)); }
.stage .rays { position: absolute; left: 50%; top: 45%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 220, 140, .16) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 0, #000 18%, transparent 42%); mask: radial-gradient(circle at 50% 50%, #000 0, #000 18%, transparent 42%);
  transition: opacity .6s; }
.stage.rays-on .rays { opacity: 1; animation: raysPulse 2.2s ease-in-out infinite; }
@keyframes raysPulse { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.06); filter: brightness(1.5); } }
.stage-top { position: absolute; z-index: 10; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.stage-top > * { pointer-events: auto; }
.close-btn { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 240, 200, .12); color: #fde9b3; }
.close-btn svg { width: 26px; height: 26px; }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 240, 200, .25); transition: all .3s; }
.dots i.c { background: #fde9b3; }
.dots i.r { background: #ffcd4f; box-shadow: 0 0 10px #ffcd4f; }
.dots i.u { background: conic-gradient(#ff6b6b, #ffd36b, #8dff7a, #6be7ff, #9a7bff, #ff6b6b); box-shadow: 0 0 10px #9adfff; }
.dots i.cur { transform: scale(1.4); }
.stage-center { position: absolute; inset: 0; display: grid; place-items: center; }
.stage-hint { position: absolute; z-index: 10; left: 0; right: 0; bottom: calc(var(--safe-b) + 26px); text-align: center; pointer-events: none;
  font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.2rem; letter-spacing: .03em; color: #fde9b3; text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  transition: opacity .3s; }
.stage-hint.pulse { animation: breathe 1.6s ease-in-out infinite; }
.banner { position: absolute; z-index: 12; left: 50%; top: 16%; transform: translate(-50%, -50%); pointer-events: none;
  font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(2.4rem, 10vw, 5rem); white-space: nowrap;
  background: linear-gradient(100deg, #ff6b6b, #ffd36b, #8dff7a, #6be7ff, #9a7bff, #ff6bd8); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #2a1704) drop-shadow(0 0 22px rgba(255, 255, 255, .6)); animation: bannerIn 2.6s ease both; }
@keyframes bannerIn { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15) rotate(-4deg); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1) rotate(-4deg); } }
.flash { position: absolute; inset: 0; z-index: 11; pointer-events: none; background: radial-gradient(circle at 50% 45%, #fff, rgba(255, 255, 255, .6) 30%, transparent 70%);
  animation: flash .7s ease-out both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Pack (booster) ---------- */
.pack3d { --h: min(64vh, 600px); position: relative; height: var(--h); aspect-ratio: 420 / 768; will-change: transform; }
.pack3d .half { position: absolute; inset: 0; background: url(img/cover.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
.pack3d .pack-top { transition: transform .75s cubic-bezier(.3, .1, .3, 1), opacity .75s ease; }
.pack3d .pack-body { transition: transform .7s cubic-bezier(.5, 0, .7, .4), opacity .6s ease; }
.pack3d .foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: calc(.35 + var(--o, 0) * .5);
  background: radial-gradient(farthest-corner circle at var(--px, 50%) var(--py, 30%), rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .15) 35%, rgba(0, 0, 0, .25) 90%);
  -webkit-mask: url(img/cover.webp) center / 100% 100% no-repeat; mask: url(img/cover.webp) center / 100% 100% no-repeat; }
.pack3d .tear-guide { position: absolute; left: 4%; right: 4%; top: 10.5%; height: 0; border-top: 3px dashed rgba(255, 255, 255, .9); filter: drop-shadow(0 0 4px rgba(0, 0, 0, .6));
  animation: guide 1.2s ease-in-out infinite; transition: opacity .3s; }
@keyframes guide { 50% { opacity: .35; } }
.pack3d .tear-line { position: absolute; top: calc(10.5% - 3px); height: 6px; border-radius: 6px; left: 0; width: 0;
  background: linear-gradient(90deg, #fff7c8, #fff, #fff7c8); box-shadow: 0 0 12px #ffe58a, 0 0 26px #ffcf4a; opacity: 0; }
.pack3d .finger { position: absolute; top: calc(10.5% - 18px); left: 6%; width: 46px; height: 46px; pointer-events: none;
  animation: swipeHint 2s cubic-bezier(.5, 0, .3, 1) infinite; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
@keyframes swipeHint { 0% { transform: translateX(0) scale(1); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateX(calc(var(--pw, 200px) * .75)); opacity: 1; } 85%, 100% { transform: translateX(calc(var(--pw, 200px) * .75)); opacity: 0; } }
.pack3d.touched .finger, .pack3d.torn .finger, .pack3d.torn .tear-guide { opacity: 0; animation: none; }

/* ---------- Cards (shared) ---------- */
.card { --rx: 0deg; --ry: 0deg; --px: 50%; --py: 50%; --o: 0; --hyp: 0;
  position: relative; aspect-ratio: 660 / 920; border-radius: var(--radius-card) / calc(var(--radius-card) * 660 / 920);
  will-change: transform; touch-action: none; cursor: grab; }
.card .face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; isolation: isolate;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .3); }
.card .face img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.card .face.back img { object-fit: cover; }
.card .back { display: none; }
.card.show-back .front { display: none; }
.card.show-back .back { display: block; }
.card .glare { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: calc(var(--o) * .9);
  background: radial-gradient(farthest-corner circle at var(--px) var(--py), rgba(255, 255, 255, .85) 8%, rgba(255, 255, 255, .3) 28%, rgba(0, 0, 0, .35) 95%); }
.card .holo, .card .sparkle { position: absolute; inset: 0; pointer-events: none; display: none; }
.card.r-rare .holo, .card.r-ultra .holo, .card.r-ultra .sparkle { display: block; }
.card .holo {
  mix-blend-mode: color-dodge; opacity: calc(.1 + var(--o) * .4);
  background-image:
    repeating-linear-gradient(110deg, #ff7773 0%, #ffed5f 5%, #a8ff5f 10%, #83fff7 15%, #7894ff 20%, #d875ff 25%, #ff7773 30%),
    repeating-linear-gradient(-45deg, rgba(14, 21, 46, .5) 0%, rgba(143, 163, 163, .3) 3.8%, rgba(143, 193, 193, .4) 4.5%, rgba(143, 163, 163, .3) 5.2%, rgba(14, 21, 46, .5) 10%, rgba(14, 21, 46, .5) 12%);
  background-size: 400% 400%, 300% 300%;
  background-position: calc(var(--px) * 1.5) calc(var(--py) * 1.5), var(--px) var(--py);
  background-blend-mode: overlay;
  filter: brightness(.75) contrast(1.6) saturate(1.3);
}
/* Rare (Pikachu) – holo only in the artwork window, like a real holo card */
.card.r-rare .holo { clip-path: inset(9.6% 8.6% 51.2% 8.6% round 2px); opacity: calc(.25 + var(--o) * .45); }
/* Ultra (full art) – whole card shines, plus glitter */
.card.r-ultra .holo { opacity: calc(.06 + var(--o) * .26); filter: brightness(.7) contrast(1.4) saturate(1.2); }
.card.r-ultra .sparkle { mix-blend-mode: color-dodge; opacity: calc(.08 + var(--o) * .4);
  background-image: radial-gradient(farthest-corner circle at var(--px) var(--py), rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .25) 35%, rgba(0, 0, 0, 1) 75%), url(img/glitter.webp);
  background-size: 100% 100%, 160px 160px; background-position: center, calc(var(--px) * .7) calc(var(--py) * .7);
  background-blend-mode: multiply; }
.card .newtag { position: absolute; z-index: 3; left: -8px; top: -10px; padding: 4px 10px; border-radius: 9px; font-weight: 800; font-style: italic; font-size: .9rem;
  background: #e5392f; color: #fff; border: 2px solid #fff; transform: rotate(-8deg); box-shadow: 0 3px 8px rgba(0, 0, 0, .35); pointer-events: none; }
.card .xcount { position: absolute; z-index: 3; right: -8px; bottom: -10px; padding: 4px 10px; border-radius: 99px; font-weight: 800; font-style: italic; font-size: .9rem;
  background: var(--ink); color: #fde9b3; border: 2px solid #fde9b3; pointer-events: none; }

/* Revealed ultra: rainbow aura behind */
.card.glow-ultra::before { content: ""; position: absolute; inset: -3%; z-index: -1; border-radius: 10%;
  background: conic-gradient(from 0deg, #ff6b6b, #ffd36b, #8dff7a, #6be7ff, #9a7bff, #ff6bd8, #ff6b6b); filter: blur(22px); opacity: .85; animation: hueAura2 2.4s linear infinite; }
@keyframes hueAura2 { from { filter: blur(22px) hue-rotate(0deg); } to { filter: blur(22px) hue-rotate(360deg); } }
.card.glow-rare::before { content: ""; position: absolute; inset: -4%; z-index: -1; border-radius: 12%; background: radial-gradient(#ffe27a, #ffb42e 60%, transparent 72%);
  filter: blur(18px); opacity: .85; animation: pulseGlow 1.4s ease-in-out infinite; }

/* Face-down hints (the rare card "is felt" before reveal) */
.aura { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.aura-rare::before { content: ""; position: absolute; inset: -10%; border-radius: 16%; background: radial-gradient(#fff2a8 0%, #ffc43a 45%, transparent 70%);
  filter: blur(20px); animation: pulseGlow 1.1s ease-in-out infinite; }
@keyframes pulseGlow { 50% { opacity: .45; transform: scale(.94); } }
.aura-ultra::before { inset: -10%; border-radius: 30%; animation-duration: 1.2s; }
.card.trembling { animation: tremble .5s linear infinite; }
@keyframes tremble { 0%, 100% { translate: 0 0; } 20% { translate: -2px 1px; } 40% { translate: 2px -1px; } 60% { translate: -1px -2px; } 80% { translate: 1px 2px; } }
.particles { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.particles i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff6c4; box-shadow: 0 0 10px #ffd35a; animation: rise 1.6s ease-out infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0) scale(.4); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-120px) scale(1); opacity: 0; } }

/* Card pile in the stage */
.pile { position: relative; width: var(--cw); aspect-ratio: 660 / 920; }
.stage { --cw: min(76vw, calc(60vh * 660 / 920), 400px); }
.pile .card { position: absolute; inset: 0; }

/* Summary */
.summary { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 30px);
  padding: calc(var(--safe-t) + 70px) 16px calc(var(--safe-b) + 20px); overflow-y: auto; }
.summary-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 2.4vw, 26px); width: 100%; max-width: 1360px; }
.cardwrap { position: relative; }
.cardwrap > .card { width: 100%; }
.summary-cards .cardwrap { width: min(calc((100vw - 32px - 4 * 26px) / 5), 240px, calc((100vh - 220px) * 660 / 920)); animation: dealIn .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@media (max-width: 700px), (orientation: portrait) {
  .summary-cards { gap: 14px; }
  .summary-cards .cardwrap { width: min(calc((100vw - 32px - 2 * 14px - 2px) / 3), calc((100vh - 350px) / 2 * 660 / 920)); }
}
@keyframes dealIn { from { transform: translateY(60px) scale(.6); opacity: 0; } }
.summary-title { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(1.4rem, 5vw, 2.2rem); text-align: center; }
.summary-title small { display: block; font-weight: 600; font-style: normal; text-transform: none; font-size: 1rem; opacity: .8; margin-top: 4px; }
.summary .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Detail ---------- */
.detail { position: absolute; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 64px);
  padding: calc(var(--safe-t) + 70px) 20px calc(var(--safe-b) + 24px); overflow-y: auto; touch-action: pan-y;
  background: radial-gradient(ellipse at 40% 40%, #4a3412 0%, #1c1205 60%, #0b0702 100%); color: #fde9b3; animation: fade .25s both; }
.detail .cardwrap { width: min(80vw, calc((100vh - 130px) * 660 / 920), 440px); flex: 0 0 auto; }
.detail > .stage-top { position: fixed; }
.detail .info { width: min(100%, 380px); display: flex; flex-direction: column; gap: 12px; }
.detail .info .no { opacity: .75; font-size: 1.05rem; }
.detail .info h2 { margin: 0; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1; color: #fff3cf; }
.detail .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail .tag { padding: 6px 12px; border-radius: 99px; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .85rem; background: rgba(255, 240, 200, .14); }
.detail .tag.rare { background: var(--gold-grad); color: var(--ink); }
.detail .tag.ultra { background: var(--holo-grad); color: var(--ink); }
.detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 240, 200, .08); font-size: 1.05rem; }
.detail dt { opacity: .7; }
.detail dd { margin: 0; font-weight: 800; font-style: italic; }
.detail .navs { display: flex; gap: 10px; }
.detail .navs .btn { flex: 1; }
.detail .hint { opacity: .65; font-size: .95rem; }
.type-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: 6px; vertical-align: -.05em; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
@media (max-width: 760px), (orientation: portrait) {
  .detail { flex-direction: column; justify-content: flex-start; }
  .detail .cardwrap { width: min(78vw, calc((100vh - 330px) * 660 / 920), 420px); min-width: 180px; }
}

/* Nízké obrazovky (telefon na šířku) */
/* iOS aplikace na ploše: horní lišta je pevná a má plnou barvu. iOS 26 pak místo rozmazání
   horní hrany použije tuto barvu (ostrá hrana) a obsah pod lištou zůstane ostrý. */
html.ios-pwa { --topbar-h: calc(var(--safe-t) + 62px); }
html.ios-pwa .shell { padding-top: var(--topbar-h); }
html.ios-pwa .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; background: #fff6dd; }
html.ios-pwa .topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 22px; pointer-events: none;
  background: linear-gradient(180deg, #fff6dd, rgba(255, 246, 221, 0)); }
html.ios-pwa.dark-bg .topbar { visibility: hidden; }

/* Počítač (myš, široká obrazovka): menu nahoře uprostřed lišty, ne u spodního okraje */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .tabbar { top: 8px; bottom: auto; }
  .views { margin-top: 14px; }
  .view { padding-bottom: 40px; }
}

@media (max-height: 520px) {
  .topbar { padding-top: calc(var(--safe-t) + 6px); padding-bottom: 4px; }
  .topbar .mini-logo { height: 34px; }
  .tab { height: 46px; min-width: 74px; font-size: .72rem; }
  .tab svg { width: 20px; height: 20px; }
  .pack-pile { height: 52vh; }
  .packs-hero { flex-direction: row; justify-content: center; gap: 28px; padding-top: 0; }
  .summary { padding-top: calc(var(--safe-t) + 54px); gap: 10px; }
  .summary .hint, .summary-title small { display: none; }
  .summary .btn-big { min-height: 46px; font-size: 1.05rem; }
}

/* ---------- God Pack: duhová fólie na balíčku + konfety ---------- */
.godfoil { position: absolute; inset: 0; pointer-events: none; z-index: 2; mix-blend-mode: color-dodge; opacity: .6;
  background: linear-gradient(115deg, #ff6b6b, #ffd36b, #8dff7a, #6be7ff, #9a7bff, #ff6bd8, #ff6b6b) 0 0 / 300% 300%;
  -webkit-mask: url(img/cover.webp) center / 100% 100% no-repeat; mask: url(img/cover.webp) center / 100% 100% no-repeat;
  animation: godFoil 2.4s linear infinite; }
.pack-pile .godfoil { animation: godFoil 2.4s linear infinite, floaty 3.2s ease-in-out infinite; }
.pack3d.torn .godfoil { opacity: 0; transition: opacity .3s; }
@keyframes godFoil { to { background-position: 300% 300%; } }
.pack-pile.god .count { background: var(--holo-grad) padding-box, var(--gold-border) border-box; }
.confetti { position: absolute; left: 50%; top: 42%; z-index: 13; pointer-events: none; }
.confetti i { position: absolute; width: 12px; height: 8px; opacity: 0; animation: confetto 2.2s cubic-bezier(.1, .7, .3, 1) both; }
@keyframes confetto { 0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; }
  80% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 25vh)) rotate(var(--r)) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
