/* Cardfarer website. One theme (the game's night palette, Sweetie 16), one typeface (Fusion Pixel 12, the font the
   game itself uses), one accent (gold). UI corners are pixel notches; the only round shapes are the console's
   physical parts, which imitate plastic hardware. */

@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-12.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink-0: #0c0d18;
  --ink-1: #141626;
  --ink-2: #1b1e32;
  --ink-3: #262a42;
  --line: #333c57;
  --dim: #566c86;
  --muted: #94b0c2;
  --text: #f1efe8;
  --gold: #ffcd75;
  --gold-hi: #fff0c9;
  --gold-lo: #d39a4c;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --font: "Fusion Pixel", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --notch: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  --notch-8: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
  --ease: cubic-bezier(.2, .75, .15, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.is-theater { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font: 24px/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
/* a fixed field of pixel stars behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../img/stars.png") 0 0 / 512px 512px;
  image-rendering: pixelated;
  opacity: .55;
  pointer-events: none;
}
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.px { image-rendering: pixelated; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3, b { font-weight: 400; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--ink-1); }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }
.sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

/* ---------------------------------------------------------------- type */

.h-display { font-size: 60px; line-height: 1.2; text-wrap: balance; }
.h2 { font-size: 48px; line-height: 1.25; text-wrap: balance; }
.lead { color: var(--muted); max-width: 32em; margin-top: 16px; text-wrap: pretty; }
.lang-zh .lead, .lang-zh .hero-sub { max-width: 22em; }

/* ---------------------------------------------------------------- buttons (pixel notched, bevelled) */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  clip-path: var(--notch);
  transition: background-color .2s, transform .1s;
}
.btn:focus-visible { outline: none; }
.btn-gold { background: var(--gold); color: var(--ink-1); box-shadow: inset -4px -4px 0 var(--gold-lo), inset 4px 4px 0 var(--gold-hi); }
.btn-gold:hover { background: #ffd98f; }
.btn-gold:active { transform: translateY(2px); box-shadow: inset 4px 4px 0 var(--gold-lo); }
.btn-gold:focus-visible { box-shadow: inset 0 0 0 4px var(--ink-1), inset 0 0 0 8px var(--gold-hi); }
.btn-ghost { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 4px var(--gold); }
.btn-ghost:hover { background: rgba(255, 205, 117, .12); }
.btn-ghost:active { transform: translateY(2px); }
.btn-ghost:focus-visible { background: rgba(255, 205, 117, .2); }
.btn-ink { background: var(--line); color: var(--muted); }

/* ---------------------------------------------------------------- nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 var(--pad);
  transition: background-color .35s, box-shadow .35s;
}
.nav.is-solid { background: rgba(12, 13, 24, .9); box-shadow: 0 4px 0 rgba(51, 60, 87, .6); backdrop-filter: blur(8px); }
.nav-brand { display: flex; align-items: center; gap: 12px; color: var(--gold); text-decoration: none; }
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--gold); }
.lang { display: flex; background: var(--ink-2); clip-path: var(--notch); padding: 4px; }
.lang button { background: none; border: 0; padding: 4px 12px; color: var(--dim); cursor: pointer; line-height: 1.5; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--ink-3); color: var(--gold); }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: 100dvh;
  max-width: 1480px;
  margin: 0 auto;
  padding: 104px var(--pad) 72px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}
.hero::before {
  content: "";
  position: absolute;
  right: -6%;
  top: 6%;
  width: 72%;
  height: 86%;
  background: radial-gradient(closest-side, rgba(255, 170, 90, .15), rgba(93, 39, 93, .1) 55%, transparent 80%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; display: grid; gap: 32px; justify-items: start; }
.hero-logo { display: grid; gap: 16px; justify-items: start; }
.hero-logo img { width: 528px; height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45)); }
.lang-zh .hero-logo .logo-main { width: 216px; }
.lang-zh .hero-logo .logo-sub { width: 264px; }
.hero-sub { max-width: 19em; color: var(--muted); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }

.embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.embers i {
  position: absolute;
  left: var(--x);
  bottom: -12px;
  width: 4px;
  height: 4px;
  background: var(--gold);
  opacity: 0;
  animation: ember var(--d) linear var(--t) infinite;
}
.embers i:nth-child(3n) { background: #ef7d57; width: 6px; height: 6px; }
.embers i:nth-child(4n) { background: var(--gold-hi); }
@keyframes ember {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: .9; }
  60% { transform: translate(24px, -60vh); opacity: .55; }
  100% { transform: translate(-8px, -105vh); opacity: 0; }
}

/* ---------------------------------------------------------------- the console
   Every part is placed in container units (cqi = 1% of the console's width), so the console keeps its proportions
   at any size, from the hero to theater mode. --scr-* tell site.js where the screen sits. */

.console-slot { position: relative; width: 100%; max-width: 860px; justify-self: end; aspect-ratio: 205 / 100; perspective: 1800px; }
.console {
  --scr-x: 25;
  --scr-y: 8.7;
  --scr-w: 50;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 205 / 100;
  container-type: inline-size;
  transform: rotateX(7deg) rotateY(-13deg) rotateZ(1.2deg);
  transition: transform .9s var(--ease);
}
.console-slot:hover .console[data-state="off"] { transform: rotateX(3deg) rotateY(-5deg) rotateZ(.4deg); }
.console:not([data-state="off"]) { transform: none; }
.console.is-theater { position: fixed; z-index: 60; transform-origin: 0 0; }
/* perspective would make the slot the containing block of the fixed console, so it goes while the console is out */
.console-slot.is-empty { perspective: none; z-index: 60; }
.console-floor {
  position: absolute;
  left: 10%;
  right: 4%;
  bottom: -9%;
  height: 16%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  filter: blur(6px);
  pointer-events: none;
}

.shell {
  position: absolute;
  inset: 0;
  border-radius: 4.5cqi 4.5cqi 10cqi 10cqi;
  background:
    radial-gradient(120% 90% at 25% 0%, rgba(255, 255, 255, .55), transparent 55%),
    linear-gradient(180deg, #dfe2e9 0%, #c9cdd8 55%, #b4b9c7 100%);
  box-shadow:
    inset 0 .35cqi 0 rgba(255, 255, 255, .95),
    inset 0 -.9cqi 0 #a2a8b8,
    inset .5cqi 0 0 rgba(255, 255, 255, .35),
    0 1.1cqi 0 #8b91a3,
    0 4cqi 7cqi -1cqi rgba(4, 5, 14, .75);
}
.engrave { position: absolute; color: #7a8094; text-shadow: 0 .12cqi 0 rgba(255, 255, 255, .65); font-size: 1.25cqi; line-height: 1; letter-spacing: .15cqi; white-space: nowrap; pointer-events: none; }

.power {
  position: absolute;
  left: 6cqi;
  top: 1.6cqi;
  width: 7cqi;
  height: 2.2cqi;
  padding: 0;
  border: 0;
  border-radius: 1.1cqi;
  background: #9ea4b4;
  box-shadow: inset 0 .25cqi .4cqi rgba(0, 0, 0, .4);
  cursor: pointer;
}
.power-knob {
  position: absolute;
  left: .35cqi;
  top: .35cqi;
  width: 3cqi;
  height: 1.5cqi;
  border-radius: .75cqi;
  background: linear-gradient(#eef0f4, #c1c6d2);
  box-shadow: 0 .18cqi 0 #868c9e;
  transition: transform .3s var(--ease);
}
.console:not([data-state="off"]) .power-knob { transform: translateX(3.3cqi); }
.power-label { left: 14.2cqi; top: 2.05cqi; }

.dpad { position: absolute; left: 4.75cqi; top: 13cqi; width: 12cqi; height: 12cqi; }
.dpad::before {
  content: "";
  position: absolute;
  inset: -1.4cqi;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, .1) 0 58%, transparent 72%);
}
.dpad button, .d-center { position: absolute; padding: 0; border: 0; background: #2b3046; cursor: pointer; }
.dpad button { box-shadow: inset 0 .3cqi 0 rgba(255, 255, 255, .14), 0 .45cqi 0 #161927; transition: transform .06s; }
.d-up { left: 33.33%; top: 0; width: 33.34%; height: 36%; border-radius: .6cqi .6cqi 0 0; }
.d-down { left: 33.33%; bottom: 0; width: 33.34%; height: 36%; border-radius: 0 0 .6cqi .6cqi; }
.d-left { left: 0; top: 33.33%; width: 36%; height: 33.34%; border-radius: .6cqi 0 0 .6cqi; }
.d-right { right: 0; top: 33.33%; width: 36%; height: 33.34%; border-radius: 0 .6cqi .6cqi 0; }
.d-center { left: 33.33%; top: 33.33%; width: 33.34%; height: 33.34%; background: radial-gradient(circle, #23273a 0 32%, #2b3046 34%); pointer-events: none; }
.dpad button:active, .dpad button.is-pressed { transform: translateY(.3cqi); box-shadow: inset 0 .3cqi 0 rgba(0, 0, 0, .3); }

.ss { position: absolute; left: 3.6cqi; top: 33.8cqi; display: flex; gap: 2.4cqi; }
.ss-item { display: flex; flex-direction: column; align-items: center; gap: .9cqi; transform: rotate(-24deg); }
.ss-item button {
  width: 5.4cqi;
  height: 1.6cqi;
  padding: 0;
  border: 0;
  border-radius: .8cqi;
  background: #7d8396;
  box-shadow: inset 0 .25cqi 0 rgba(255, 255, 255, .25), 0 .3cqi 0 #5e6476;
  cursor: pointer;
}
.ss-item button:active, .ss-item button.is-pressed { transform: translateY(.25cqi); box-shadow: inset 0 .25cqi 0 rgba(0, 0, 0, .25); }
.ss-item .engrave { position: static; }

.bezel {
  position: absolute;
  left: 21.5cqi;
  top: 4.5cqi;
  width: 57cqi;
  height: 35.5cqi;
  border-radius: 1.6cqi 1.6cqi 6.5cqi 1.6cqi;
  background: linear-gradient(180deg, #2a2e43, #1d2031);
  box-shadow: inset 0 .25cqi 0 rgba(255, 255, 255, .08), 0 .3cqi 0 rgba(255, 255, 255, .7), inset 0 -.4cqi .6cqi rgba(0, 0, 0, .35);
}
.bezel-head { position: absolute; left: 3.5cqi; right: 3.5cqi; top: 1.35cqi; display: flex; align-items: center; gap: 1.2cqi; }
.bezel-head i { flex: 1; height: .5cqi; background: linear-gradient(180deg, #5d275d 0 50%, #b13e53 50%); }
.bezel-head span { font-size: 1.3cqi; line-height: 1; color: var(--muted); letter-spacing: .25cqi; white-space: nowrap; }
.led { position: absolute; left: 1.2cqi; top: 21cqi; width: 1.1cqi; height: 1.1cqi; border-radius: 50%; background: #3d2232; box-shadow: inset 0 .15cqi .2cqi rgba(0, 0, 0, .5); transition: background-color .3s, box-shadow .3s; }
.console:not([data-state="off"]) .led { background: #ff6b6b; box-shadow: 0 0 1cqi .2cqi rgba(255, 90, 100, .75), inset 0 -.1cqi .15cqi rgba(0, 0, 0, .3); }

.screen {
  position: absolute;
  left: 3.5cqi;
  top: 4.2cqi;
  width: 50cqi;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: .3cqi;
  background: #07080f;
  box-shadow: inset 0 0 0 .2cqi rgba(0, 0, 0, .65);
}
.screen::before {   /* glass */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(125deg, rgba(255, 255, 255, .08) 0 24%, transparent 24.3%);
  pointer-events: none;
  transition: opacity .5s;
}
.console[data-state="on"] .screen::before { opacity: 0; }
.screen::after {    /* the tube warming up */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #f4f4f4;
  opacity: 0;
  pointer-events: none;
}
.console[data-state="booting"] .screen::after { animation: crt .5s ease-out; }
@keyframes crt {
  0% { opacity: 1; transform: scale(1, .006); }
  45% { opacity: 1; transform: scale(1, .006); }
  75% { opacity: .65; transform: scale(1, 1); }
  100% { opacity: 0; transform: scale(1, 1); }
}
.attract { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.attract-ui {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3.2cqi;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px);
  transition: opacity .3s;
}
.press-start {
  font-size: 2.6cqi;
  line-height: 1;
  color: var(--gold-hi);
  text-shadow: 0 .25cqi 0 var(--ink-1), .25cqi 0 0 var(--ink-1), -.25cqi 0 0 var(--ink-1), 0 -.25cqi 0 var(--ink-1);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.console:not([data-state="off"]) .attract, .console:not([data-state="off"]) .attract-ui { opacity: 0; }
.boot {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.4cqi;
  background: #0b0c14;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s, visibility .45s;
}
.console[data-state="booting"] .boot { opacity: 1; visibility: visible; transition: none; }
.boot-logo { font-size: 5cqi; line-height: 1; color: var(--gold); letter-spacing: .4cqi; transform: translateY(-16cqi); }
.boot-sub { font-size: 1.6cqi; line-height: 1; color: var(--muted); letter-spacing: 1cqi; opacity: 0; }
.console[data-state="booting"] .boot-logo { animation: drop 1.1s steps(12) .45s forwards; }
.console[data-state="booting"] .boot-sub { animation: appear .01s 1.7s forwards; }
@keyframes drop { to { transform: none; } }
@keyframes appear { to { opacity: 1; } }
.screen iframe { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: #0b0c14; }

.brand { position: absolute; left: 0; right: 0; top: 41.2cqi; display: flex; justify-content: center; align-items: baseline; gap: 1.6cqi; pointer-events: none; }
.brand span { font-size: 1.5cqi; color: #7a8094; letter-spacing: .3cqi; text-shadow: 0 .12cqi 0 rgba(255, 255, 255, .65); }
.brand b { font-size: 2.6cqi; color: #5d275d; letter-spacing: .15cqi; text-shadow: 0 .14cqi 0 rgba(255, 255, 255, .6); }

.ab-well { position: absolute; left: 79.6cqi; top: 15.2cqi; width: 17cqi; height: 8.6cqi; border-radius: 4.3cqi; transform: rotate(-28deg); background: rgba(0, 0, 0, .06); box-shadow: inset 0 .3cqi .5cqi rgba(0, 0, 0, .14); }
.btn-a, .btn-b {
  position: absolute;
  width: 6.4cqi;
  height: 6.4cqi;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #93508b, #5d275d 62%, #44193f);
  box-shadow: inset 0 -.35cqi 0 rgba(0, 0, 0, .3), 0 .5cqi 0 #3a1636, 0 1cqi 1.2cqi rgba(20, 10, 30, .3);
  cursor: pointer;
  transition: transform .06s;
}
.btn-a { left: 88.8cqi; top: 13.6cqi; }
.btn-b { left: 81.3cqi; top: 17.6cqi; }
.btn-a:active, .btn-b:active, .btn-a.is-pressed, .btn-b.is-pressed { transform: translateY(.4cqi); box-shadow: inset 0 .3cqi .3cqi rgba(0, 0, 0, .3), 0 .1cqi 0 #3a1636; }
.ab-label { font-size: 1.7cqi; }
.lbl-a { left: 91.4cqi; top: 21.2cqi; }
.lbl-b { left: 83.9cqi; top: 25.2cqi; }

.speaker { position: absolute; left: 82.4cqi; top: 33cqi; display: flex; gap: 1.1cqi; transform: rotate(-28deg); }
.speaker i { display: block; width: .75cqi; height: 6.4cqi; border-radius: .4cqi; background: #9aa0b1; box-shadow: inset 0 .25cqi .3cqi rgba(0, 0, 0, .4); }

/* theater mode: the console comes to the middle of the screen and its screen fills the view */
.theater-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: radial-gradient(ellipse at 50% 45%, rgba(27, 30, 50, .95), rgba(6, 7, 14, .985) 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s;
}
html.is-theater .theater-backdrop { opacity: 1; pointer-events: auto; }
.theater-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}
.theater-bar[hidden] { display: none; }
.touch-note { flex-basis: 100%; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- story */

.story { max-width: var(--max); margin: 0 auto; padding: clamp(96px, 12vw, 168px) var(--pad); text-align: center; }
.story .h-display { max-width: 16em; margin: 0 auto; }
.spread {
  list-style: none;
  margin: 72px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 40px);
}
.tarot { display: grid; justify-items: center; gap: 28px; transform: rotate(var(--r)) translateY(var(--y)); }
.tarot p { color: var(--muted); max-width: 11em; text-wrap: balance; }
.tarot-card { position: relative; width: 100%; max-width: 264px; aspect-ratio: 88 / 124; perspective: 1400px; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .55)); transition: transform .5s var(--ease); }
.tarot-card:hover { transform: translateY(-12px); }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s var(--ease) calc(var(--i) * 220ms); }
.js .spread:not(.is-revealed) .flip { transform: rotateY(180deg); }
.face, .back { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back { transform: rotateY(180deg); }

/* ---------------------------------------------------------------- duel */

.duel { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 9vw, 128px) var(--pad); }
.duel-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.duel-screen { padding: 8px; background: var(--ink-2); clip-path: var(--notch-8); box-shadow: inset 0 0 0 4px var(--line); }
.duel-screen video { width: 100%; aspect-ratio: 16 / 9; background: #07080f; }
.rules { display: grid; gap: 28px; margin-top: 40px; }
.rules dt { color: var(--gold); font-size: 36px; line-height: 1.2; }
.rules dd { color: var(--muted); margin-top: 6px; }
.hand { display: flex; justify-content: center; margin-top: 88px; padding-left: 40px; }
.hand img {
  width: clamp(88px, 11vw, 156px);
  height: auto;
  margin-left: clamp(-56px, -3.6vw, -24px);
  transform-origin: 50% 160%;
  transform: rotate(calc((var(--i) - 3) * 7deg)) translateY(var(--y));
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55));
  transition: transform .35s var(--ease);
}
.hand img:hover { transform: rotate(calc((var(--i) - 3) * 7deg)) translateY(calc(var(--y) - 40px)) scale(1.06); }

/* ---------------------------------------------------------------- bosses */

.bosses { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(96px, 12vw, 168px) var(--pad); }
.bosses::before {   /* a darker band, full bleed */
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(8, 9, 18, .75) 18%, rgba(8, 9, 18, .75) 82%, transparent);
}
.boss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: clamp(16px, 2.6vw, 40px); align-items: end; margin-top: 64px; }
.boss { display: grid; gap: 4px; justify-items: start; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.boss-card { position: relative; isolation: isolate; width: 100%; margin-bottom: 16px; aspect-ratio: 88 / 124; transition: transform .45s var(--ease); }
.boss-card img { width: 100%; height: 100%; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .55)); }
.boss-card::before {
  content: "";
  position: absolute;
  inset: 6% -12% -4%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(26px);
  opacity: 0;
  transition: opacity .4s;
}
.boss:hover .boss-card { transform: translateY(-10px); }
.boss:hover .boss-card::before, .boss.is-speaking .boss-card::before { opacity: .5; }
.boss.is-speaking img { animation: talk .16s steps(1) infinite; }
@keyframes talk { 50% { transform: translateY(-3px); } }
.boss-play {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--gold);
  clip-path: var(--notch);
  box-shadow: inset -4px -4px 0 var(--gold-lo), inset 4px 4px 0 var(--gold-hi);
}
.boss-play::before { content: ""; width: 16px; height: 20px; margin-left: 4px; background: var(--ink-1); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.boss.is-speaking .boss-play::before { margin-left: 0; width: 16px; background: linear-gradient(90deg, var(--ink-1) 0 36%, transparent 36% 64%, var(--ink-1) 64%); clip-path: none; }
.boss-name { color: var(--gold); }
.boss-land { color: var(--muted); }
.subtitle { min-height: 72px; margin-top: 48px; text-align: center; text-wrap: balance; }
.subtitle-who { color: var(--gold); margin-right: 16px; }

/* ---------------------------------------------------------------- inside the cartridge (bento) */

.inside { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 9vw, 128px) var(--pad); }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(300px, auto); gap: 16px; margin-top: 48px; }
.cell { position: relative; overflow: hidden; background: var(--ink-2); clip-path: var(--notch-8); }
.cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.02); transition: transform 1.2s var(--ease); }
.cell:hover img { transform: scale(1.07); }
.cell::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 13, 24, .05) 0%, rgba(12, 13, 24, .55) 34%, rgba(12, 13, 24, .97) 66%); }
.cell-text { position: absolute; left: 28px; right: 28px; bottom: 24px; z-index: 1; }
.cell h3 { font-size: 36px; line-height: 1.2; }
.cell p { color: var(--muted); margin-top: 6px; max-width: 30em; }
.num { display: block; font-size: 72px; line-height: 1; color: var(--gold); }
.cell--map { grid-column: 1 / 8; grid-row: 1 / 3; }
.cell--camp { grid-column: 8 / 13; grid-row: 1; }
.cell--heroes { grid-column: 8 / 13; grid-row: 2; }
.cell--ach { grid-column: 1 / 6; grid-row: 3; }
.cell--cards { grid-column: 6 / 13; grid-row: 3; }

/* ---------------------------------------------------------------- trailer */

.trailer { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 9vw, 128px) var(--pad); }
.cinema { position: relative; margin-top: 40px; aspect-ratio: 16 / 9; background: #05060c; box-shadow: 0 0 0 4px var(--line), 0 48px 90px -30px rgba(0, 0, 0, .9); }
.cinema video { width: 100%; height: 100%; }
.cinema-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 0;
  background: var(--gold);
  clip-path: var(--notch-8);
  box-shadow: inset -8px -8px 0 var(--gold-lo), inset 8px 8px 0 var(--gold-hi);
  cursor: pointer;
  transition: transform .25s var(--ease);
}
.cinema-play:hover { transform: scale(1.06); }
.cinema-play span { width: 32px; height: 40px; margin-left: 8px; background: var(--ink-1); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.cinema.is-playing .cinema-play { display: none; }

/* ---------------------------------------------------------------- get it: cartridges */

.get { max-width: var(--max); margin: 0 auto; padding: clamp(96px, 12vw, 168px) var(--pad); text-align: center; }
.carts { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(28px, 5vw, 72px); margin-top: 64px; }
.cart {
  position: relative;
  width: 320px;
  padding: 52px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--ink-1);
  text-decoration: none;
  background: linear-gradient(180deg, #dcdfe6, #c3c8d4);
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
  box-shadow: inset 0 4px 0 #f3f4f7, inset 0 -8px 0 #a2a8b8, inset 4px 0 0 rgba(255, 255, 255, .45), inset -4px 0 0 rgba(0, 0, 0, .06);
  transition: transform .4s var(--ease);
}
.cart::before {   /* grip ridges */
  content: "";
  position: absolute;
  left: 24px;
  right: 56px;
  top: 16px;
  height: 18px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 4px, transparent 4px 10px);
}
a.cart:hover { transform: translateY(-14px); }
.cart-label { display: block; width: 100%; padding: 8px; background: var(--ink-1); box-shadow: inset 0 0 0 2px #0a0b14; }
.cart-label img { width: 100%; height: auto; aspect-ratio: 630 / 500; object-fit: cover; }
.cart-title { font-size: 36px; line-height: 1.2; margin-top: 6px; }
.cart-desc { color: #333c57; min-height: 3em; text-wrap: balance; }
.cart .btn { margin-top: 6px; }
.cart--soon { filter: saturate(.55) brightness(.92); }

/* ---------------------------------------------------------------- footer */

.foot { max-width: var(--max); margin: 0 auto; padding: 48px var(--pad) 64px; border-top: 4px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.foot-studio { display: flex; align-items: center; gap: 16px; }
.foot-studio img { width: 56px; height: 56px; image-rendering: pixelated; clip-path: var(--notch); }
.foot-studio div { display: grid; }
.foot-studio b { color: var(--gold); }
.foot-studio span { color: var(--muted); font-size: 12px; line-height: 2; }
.foot-links { display: flex; gap: 32px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--gold); }
.foot-small { font-size: 12px; line-height: 2; color: var(--dim); }

/* ---------------------------------------------------------------- simple pages (privacy, 404) */

.page { max-width: 880px; margin: 0 auto; padding: 136px var(--pad) 96px; }
.page h1 { font-size: 48px; line-height: 1.25; color: var(--gold); }
.page h2 { font-size: 36px; line-height: 1.3; margin-top: 48px; }
.page p { color: var(--muted); margin-top: 16px; }
.page .meta { font-size: 12px; color: var(--dim); }
.lost { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 32px; padding: 96px var(--pad); text-align: center; }
.lost img { width: 176px; filter: drop-shadow(0 20px 24px rgba(0, 0, 0, .55)); transform: rotate(-6deg); }

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 1100px) {
  .h-display { font-size: 48px; }
  .hero-logo img { width: 396px; }
  .lang-zh .hero-logo .logo-main { width: 162px; }
  .lang-zh .hero-logo .logo-sub { width: 198px; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 112px; gap: 56px; }
  .console-slot { justify-self: center; max-width: 720px; }
  .console { transform: rotateX(5deg) rotateY(-6deg); }
  .duel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .lang { margin-left: auto; }
}
@media (max-width: 760px) {
  .h-display, .h2 { font-size: 36px; }
  .hero-logo img { width: 264px; }
  .lang-zh .hero-logo .logo-main { width: 162px; }
  .lang-zh .hero-logo .logo-sub { width: 132px; }
  .nav-brand span { display: none; }
  .spread { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 24px; margin-inline: calc(var(--pad) * -1); padding: 16px var(--pad) 40px; }
  .tarot { flex: 0 0 64%; scroll-snap-align: center; transform: none; }
  .rules dt { font-size: 24px; }
  .hand { padding-left: 24px; }
  .boss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .boss--final { grid-column: 1 / -1; width: 68%; justify-self: center; }
  .bento { grid-auto-rows: minmax(300px, auto); }
  .cell--map, .cell--camp, .cell--heroes, .cell--ach, .cell--cards { grid-column: 1 / -1; grid-row: auto; }
  .cell h3 { font-size: 24px; }
  .num { font-size: 48px; }
  .cinema-play { width: 80px; height: 80px; }
  .cart { width: min(320px, 100%); }
  .theater-bar .btn { padding: 0 16px; }
  .foot-links { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .embers, .press-start { animation: none; }
  .embers { display: none; }
  .console, .flip, .tarot-card, .hand img, .boss-card, .cell img, .cart, .power-knob { transition: none; }
  .boss.is-speaking img { animation: none; }
  .console[data-state="booting"] .boot-logo { animation-duration: .01s; animation-delay: 0s; }
  .console[data-state="booting"] .screen::after { animation: none; }
}
