/* FOOTDECK — shared page chrome, card mechanics, card back, pack opening.
   Card fronts (look + tier colours) live in each design's page. */

@property --ang { syntax: '<angle>'; inherits: true; initial-value: 0deg; }

:root {
  color-scheme: dark;
  --night: #07080b;
  --chalk: #eef0f4;
  --muted: #8d93a1;
  --line: rgba(238, 240, 244, .09);
  --ref: #ffd23f;
  --label: Oswald, 'Arial Narrow', sans-serif;
  --display: var(--label);
}
[hidden] { display: none !important; }
html { background: var(--night); }
body {
  background:
    radial-gradient(ellipse 60% 38% at 18% -8%, rgba(255, 244, 214, .10), transparent 70%),
    radial-gradient(ellipse 60% 38% at 82% -8%, rgba(255, 244, 214, .10), transparent 70%),
    var(--night);
  color: var(--chalk);
  font: 500 15px/1.55 Manrope, system-ui, sans-serif;
  padding: 0 16px;
  min-height: 100vh;
}
.wrap { max-width: 1180px; margin: 0 auto; padding-block: 48px 80px; display: grid; gap: 64px; }
header { display: grid; gap: 12px; max-width: 680px; }
.eyebrow { font: 700 12px/1 Manrope, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--ref); }
h1 { font: 800 clamp(28px, 5vw, 46px)/1.05 Unbounded, 'Arial Black', sans-serif; margin: 0; text-wrap: balance; }
h2 { font: 600 clamp(18px, 2.6vw, 22px)/1.2 Unbounded, 'Arial Black', sans-serif; margin: 0; text-wrap: balance; }
p { margin: 0; color: var(--muted); max-width: 62ch; }
.sec { display: grid; gap: 28px; }
.switch { display: flex; gap: 8px; flex-wrap: wrap; }
.switch a, .switch span { font: 700 12px/1 Manrope, sans-serif; letter-spacing: .1em; text-transform: uppercase; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); text-decoration: none; }
.switch span { color: #1a1300; background: var(--ref); border-color: var(--ref); }
.switch a:hover { color: var(--chalk); }

/* ---------- feature ---------- */
.feature { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 48px; align-items: center; }
.feature .copy { display: grid; gap: 16px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 28px; }
.facts li { display: grid; gap: 4px; }
.facts b { font: 800 28px/1.1 var(--display); color: var(--chalk); font-variant-numeric: tabular-nums; }
.facts span { font: 600 11px/1 var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.note { font-size: 13px; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: end; }
.pair .col { display: grid; gap: 14px; justify-items: center; }
.arrow { font: 800 28px/1 var(--display); color: var(--ref); align-self: center; }

/* ---------- showcase ---------- */
.showcase { display: flex; flex-wrap: wrap; justify-content: center; gap: 36px 22px; }
.cell { flex: 1 1 170px; max-width: 232px; display: grid; gap: 14px; justify-items: center; }
.tag { display: flex; gap: 10px; align-items: baseline; font: 700 12px/1 Manrope, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.tag span { color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { text-align: center; font-size: 13px; color: var(--muted); max-width: none; }

/* ---------- card mechanics (both designs) ---------- */
.slot { container-type: inline-size; width: 100%; perspective: 1100px; position: relative; }
.slot.popslot { padding-top: 14%; }
.card {
  --mx: 50%; --my: 50%; --px: 0; --py: 0;
  position: relative;
  transform-style: preserve-3d; will-change: transform;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.card:focus-visible { outline: 2px solid var(--ref); outline-offset: 6px; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.pop {
  position: absolute; left: -4%; right: -4%; top: -16%; bottom: 0;
  transform: translateZ(22px);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(to bottom, #000 var(--popfade1, 63%), transparent var(--popfade2, 73%));
          mask: linear-gradient(to bottom, #000 var(--popfade1, 63%), transparent var(--popfade2, 73%));
}
.pop img { position: absolute; top: 0; left: 6%; width: 92%; max-width: none; filter: drop-shadow(0 2.5cqw 3cqw rgba(0,0,0,.45)); }
.hud {
  position: absolute; inset: 0; pointer-events: none;
  transform: translateZ(32px);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: var(--ink);
}
.hud > * { position: absolute; }
.hud.shadowed { text-shadow: 0 .4cqw 2cqw var(--hudshadow, rgba(0,0,0,.4)); }
.flag { display: grid; box-shadow: 0 0 0 .4cqw rgba(0,0,0,.28); }
.crest { display: block; height: auto; }
[data-fit] { white-space: nowrap; overflow: hidden; }

/* ---------- card back (both designs) ---------- */
.bk { position: absolute; inset: 0; padding: 8cqw 8cqw 8.5cqw; display: flex; flex-direction: column; align-items: center; gap: 2cqw; text-align: center; color: var(--ink); }
.bk-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.bk-idx { font: 600 11cqw/1 var(--label); display: flex; gap: 1cqw; }
.bk-idx i { font-style: normal; }
.bk-idx.red i { color: var(--red); }
.bk-top .crest { width: 13cqw; }
.bk-name { font: 800 10cqw/1.05 var(--display); text-transform: uppercase; margin-top: 1cqw; max-width: 100%; }
.bk-name span { display: block; }
.bk-sub { font: 700 3.3cqw/1.3 Manrope, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); max-width: 100%; }
.radar { width: 88%; height: auto; margin-top: 1cqw; }
.bk-durak { font: 600 4.2cqw/1.3 var(--label); letter-spacing: .06em; padding: 1.4cqw 3cqw; border: .35cqw solid var(--line); border-radius: 10cqw; }
.bk-serial { margin-top: auto; display: grid; gap: .8cqw; }
.bk-serial b { font: 800 7.5cqw/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.bk-serial span { font: 600 3.2cqw/1 var(--label); letter-spacing: .24em; color: var(--muted); }
@keyframes spin { to { --ang: 360deg; } }

/* ---------- pack section ---------- */
.packsec { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(20, 50, 34, .35), rgba(7, 8, 11, 0) 60%); }
.packsec .copy { display: grid; gap: 18px; }
.odds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 340px; }
.odds li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.odds li::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--dot); }
.odds span { color: var(--muted); }
.cta {
  justify-self: start; font: 800 15px/1 Unbounded, 'Arial Black', sans-serif; letter-spacing: .02em;
  padding: 17px 28px; border: 0; border-radius: 4px; cursor: pointer; color: #1a1300;
  background: var(--ref); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 10px 30px rgba(255, 210, 63, .25);
  transition: transform .15s, box-shadow .15s;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, 0 14px 36px rgba(255, 210, 63, .35); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible, .ghost:focus-visible, .pack:focus-visible { outline: 2px solid var(--ref); outline-offset: 4px; }

.coll { display: grid; gap: 14px; align-content: start; }
.coll-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.coll-head b { font: 600 14px/1 Unbounded, sans-serif; }
.coll-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; align-items: end; }
.coll-grid .slot { perspective: none; }
.coll-empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); font-size: 13px; }

/* ---------- overlay ---------- */
.ov {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 50% 46%, var(--flare, rgba(255,255,255,.05)), transparent 62%),
    rgba(4, 5, 8, .95);
  transition: background .6s;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ov canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.ov-top { display: flex; justify-content: flex-end; gap: 8px; padding: 16px; position: relative; z-index: 4; min-height: 68px; }
.ghost { font: 700 13px/1 Manrope, sans-serif; letter-spacing: .06em; color: var(--chalk); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 4px; padding: 11px 16px; cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.1); }
.ov-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.ov-stage > * { grid-area: 1 / 1; }
.ov-bar { display: grid; justify-items: center; gap: 14px; padding: 16px 16px 32px; position: relative; z-index: 4; min-height: 110px; align-content: start; }
.ov-hint { color: var(--muted); font-size: 14px; min-height: 1.5em; text-align: center; }

.pack {
  container-type: inline-size; position: relative;
  width: min(230px, 58vw); aspect-ratio: 63 / 98; cursor: pointer;
  animation: float 3s ease-in-out infinite;
  transition: opacity .5s, transform .5s;
  border: 0; padding: 0; background: none;
}
.pack-body, .pack-top {
  position: absolute; left: 0; right: 0; overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, transparent 19cqw, rgba(247,221,146,.35) 19cqw 20cqw, transparent 20cqw),
    linear-gradient(160deg, #1d4430, #0c2016 55%, #17392a);
  box-shadow: inset 0 0 0 .9cqw rgba(247,221,146,.55);
}
.pack-body { top: 13%; bottom: 0; border-radius: 0 0 3cqw 3cqw; display: grid; place-content: center; justify-items: center; gap: 3cqw; }
.pack-top { top: 0; height: 13.5%; border-radius: 3cqw 3cqw 0 0; transition: transform .7s cubic-bezier(.3,.7,.3,1), opacity .7s; z-index: 2; }
.pack-top::before, .pack-body::after {
  content: ""; position: absolute; left: 0; right: 0; height: 5cqw;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 1.2cqw, rgba(247,221,146,.25) 1.2cqw 2.4cqw);
}
.pack-top::before { top: 0; }
.pack-body::after { bottom: 0; }
.pack-body::before {
  content: ""; position: absolute; inset: 0; background-image: var(--sparkle); background-size: 50cqw;
  mix-blend-mode: color-dodge; opacity: .35;
}
.pack-mark { position: relative; font: 800 11cqw/1 Unbounded, 'Arial Black', sans-serif; color: #f7dd92; letter-spacing: .02em; }
.pack-sub { position: relative; font: 700 4.2cqw/1.3 Manrope, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(247,221,146,.7); }
.leak {
  position: absolute; left: -35%; right: -35%; top: -28%; height: 56%; z-index: 1;
  background: radial-gradient(50% 50% at 50% 55%, var(--leak), transparent 70%);
  mix-blend-mode: screen; opacity: 0; transition: opacity .6s, transform .6s;
}
.pack.lit .leak { opacity: .85; animation: pulse 1.1s ease-in-out infinite; }
.pack.torn .leak { opacity: 1; transform: scale(1.4, 2); animation: none; }
.pack.torn .pack-top { transform: translate(45%, -160%) rotate(28deg); opacity: 0; }
.pack.shake { animation: shake .65s ease-in-out; }
.pack.gone { opacity: 0; transform: translateY(24%) scale(.9); pointer-events: none; animation: none; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-5deg) scale(1.04); } 40% { transform: rotate(5deg) scale(1.06); }
  60% { transform: rotate(-4deg) scale(1.08); } 80% { transform: rotate(3deg) scale(1.1); }
}

.walk { pointer-events: none; display: grid; place-items: center; z-index: 2; }
.wstep { grid-area: 1 / 1; display: grid; justify-items: center; gap: 16px; animation: wIn 1s cubic-bezier(.2,.8,.2,1) both; }
.w-flag { width: min(280px, 64vw); aspect-ratio: 3 / 2; display: grid; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.w-flag i { transform-origin: left; animation: stripe .5s cubic-bezier(.2,.8,.2,1) both; }
.w-flag i:nth-child(2) { animation-delay: .08s; } .w-flag i:nth-child(3) { animation-delay: .16s; }
.w-big { font: 800 clamp(96px, 26vw, 180px)/1 var(--display); color: var(--wc, #fff); text-shadow: 0 0 60px var(--wc, #fff); }
.w-crest { width: min(150px, 36vw); height: auto; filter: drop-shadow(0 16px 40px rgba(0,0,0,.6)); }
.w-cap { font: 700 13px/1 Manrope, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.72); }
@keyframes wIn {
  0% { opacity: 0; transform: scale(1.5); filter: blur(10px); }
  22% { opacity: 1; transform: scale(1); filter: blur(0); }
  82% { opacity: 1; transform: scale(.98); }
  100% { opacity: 0; transform: scale(.9); }
}
@keyframes stripe { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.reveal { z-index: 2; }
.reveal .slot { width: min(270px, 66vw, 40vh); animation: cardIn .9s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes cardIn { 0% { opacity: 0; transform: translateY(30%) scale(.5); } 100% { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 32px; }
  .packsec { grid-template-columns: 1fr; padding: 24px 18px; }
  .wrap { padding-block: 32px 56px; gap: 52px; }
}
@media (max-width: 480px) {
  .pair { gap: 10px; }
  .arrow { font-size: 20px; }
  .facts b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pack, .leak { animation: none !important; }
  .reveal .slot, .wstep { animation-duration: .01s !important; }
}
