/* Tinwell website — shared styles. Visual language follows
   docs/ART_STYLE_GUIDE_TR.md: thick dark outlines, rounded rugged shapes,
   cyan / green / orange accents over dirty metal and earth. */

@font-face {
  font-family: 'Tinwell Display';
  src: url('../fonts/Baloo2-ExtraBold.woff') format('woff');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('../fonts/Baloo2-Variable.woff') format('woff');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #15110d;
  --ink-soft: #2a221b;
  --cream: #f8edd0;
  --cream-dim: #d9cba8;
  --paper: #f3e6c4;
  --sky: #0a83cf;
  --teal: #112b33;
  --teal-2: #183b44;
  --slate: #232d2c;
  --slate-2: #2e3a38;
  --steel: #59625e;
  --olive: #5b7c2c;
  --green: #7cc243;
  --green-dark: #3f6b1f;
  --yellow: #f8b72d;
  --yellow-dark: #b5650f;
  --orange: #f2892a;
  --red: #d9402f;
  --cyan: #41d3ea;
  --gold: #ffd34d;
  --purple: #8b5bd6;
  --blue: #3b86e0;
  --earth: #4a3424;
  --hud-h: 64px;
  --r: 18px;
  --outline: 4px solid var(--ink);
  --font-display: 'Tinwell Display', 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hud-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--earth) url('../assets/scene/earth.webp') repeat;
  background-size: 320px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: .5px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 8px 14px;
  border: var(--outline); border-radius: 12px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* Display text with the game's chunky outlined title look. */
.stroke {
  color: var(--cream);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
}

/* ----------------------------------------------------------------- HUD */

.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--hud-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(#26302e, #1b2321);
  border-bottom: var(--outline);
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.hud::after {
  /* Hazard tape lip under the bar. */
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
  border-bottom: 2px solid var(--ink);
  opacity: .9;
}
.hud-logo { flex: none; display: block; height: 46px; }
.hud-logo img { height: 46px; width: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.4)); }

.hud-nav { display: flex; gap: 6px; margin-left: 8px; }
.hud-nav a {
  font-family: var(--font-display); font-size: 16px; letter-spacing: .5px;
  color: var(--cream); text-decoration: none; padding: 6px 12px;
  border-radius: 12px; border: 3px solid transparent;
  white-space: nowrap;
}
.hud-nav a:hover { background: rgba(255,255,255,.06); }
.hud-nav a.is-active {
  background: var(--slate-2); border-color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.35);
  color: var(--gold);
}

.hud-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.res-chip {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  height: 38px; padding: 0 12px 0 34px; min-width: 76px;
  background: #121816; border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
  font-family: var(--font-display); font-size: 18px; color: var(--cream);
}
.res-chip img {
  position: absolute; left: -6px; top: 50%; width: 38px; height: 38px;
  transform: translateY(-50%); filter: drop-shadow(0 2px 0 var(--ink));
}
.res-chip.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

.lang-btn, .menu-btn {
  height: 40px; min-width: 48px; padding: 0 10px;
  font-family: var(--font-display); font-size: 16px;
  background: var(--steel); color: var(--cream);
  border: 3px solid var(--ink); border-radius: 12px; cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.3);
}
.lang-btn:active, .menu-btn:active { transform: translateY(2px); }
.menu-btn { display: none; }
.menu-btn span { display: block; width: 20px; height: 3px; margin: 4px auto; background: var(--cream); border-radius: 2px; }

@media (max-width: 1080px) {
  .hud-nav {
    display: none; position: fixed; top: calc(var(--hud-h) + 10px); right: 12px;
    flex-direction: column; gap: 4px; padding: 10px;
    background: var(--slate); border: var(--outline); border-radius: var(--r);
    box-shadow: 0 10px 0 rgba(0,0,0,.35); min-width: 220px;
  }
  .hud-nav.is-open { display: flex; }
  .hud-nav a { font-size: 19px; padding: 10px 14px; }
  .menu-btn { display: block; }
}
@media (max-width: 520px) {
  :root { --hud-h: 58px; }
  .hud { gap: 8px; padding: 0 10px; }
  .hud-logo, .hud-logo img { height: 36px; }
  .res-chip { min-width: 58px; height: 34px; font-size: 16px; padding-left: 28px; padding-right: 8px; }
  .res-chip img { width: 32px; height: 32px; left: -4px; }
  .res-chip.core { display: none; }
}

/* ------------------------------------------------------------- buttons */

.btn {
  --bg: var(--yellow); --lip: var(--yellow-dark); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 6px 24px 10px;
  font-family: var(--font-display); font-size: 21px; letter-spacing: .5px;
  color: var(--fg); text-decoration: none; cursor: pointer;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,0) 45%), var(--bg);
  border: var(--outline); border-radius: 16px;
  box-shadow: inset 0 -7px 0 var(--lip), 0 5px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  user-select: none; -webkit-user-select: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 -4px 0 var(--lip), 0 1px 0 var(--ink); }
.btn--green { --bg: var(--green); --lip: var(--green-dark); }
.btn--steel { --bg: #7d8781; --lip: #4a524e; --fg: var(--cream); }
.btn--steel .stroke-sm, .btn--green .stroke-sm { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; color: var(--cream); }
.btn--small { min-height: 44px; font-size: 17px; padding: 4px 16px 8px; border-radius: 13px; }
.btn small { display: block; font-family: var(--font-body); font-size: 12px; font-weight: 700; line-height: 1; opacity: .8; letter-spacing: 0; }
.btn .btn-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.btn svg { flex: none; }
.btn[disabled] { filter: grayscale(.6) brightness(.85); cursor: default; }

/* ------------------------------------------------------------- surface */

.surface {
  position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1100px;
  overflow: hidden; background: #0a83cf url(/assets/scene/sky.webp) 0 0 / 100% 100% no-repeat;
  border-bottom: 0;
}
.surface canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: crosshair; touch-action: manipulation;
}
.surface-ui {
  position: absolute; left: 50%; top: calc(var(--hud-h) + 3vh);
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none; z-index: 2;
}
.surface-ui > * { pointer-events: auto; }
.surface-ui h1 { width: min(560px, 86vw); }
.surface-ui h1 img { width: 100%; height: auto; filter: drop-shadow(0 8px 0 rgba(0,0,0,.28)); animation: logoDrop .8s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes logoDrop { from { transform: translateY(-40px) scale(.9); opacity: 0; } }
.tagline {
  margin: 6px 0 18px; font-family: var(--font-display); font-size: clamp(22px, 3.2vw, 34px);
  pointer-events: none; text-wrap: balance;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.store-btn svg { width: 26px; height: 26px; }

.game-hud {
  position: absolute; z-index: 3; left: 16px; top: calc(var(--hud-h) + 22px);
  display: flex; align-items: center; gap: 10px;
}
.hearts { display: flex; gap: 2px; }
.hearts svg { width: 30px; height: 28px; filter: drop-shadow(0 2px 0 var(--ink)); transition: transform .2s, opacity .2s; }
.hearts svg.lost { opacity: .35; transform: scale(.8); filter: grayscale(1) drop-shadow(0 2px 0 var(--ink)); }
.wave-pill, .game-btn {
  font-family: var(--font-display); font-size: 16px; color: var(--cream);
  background: rgba(18,22,21,.82); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 12px;
}
.game-btn { cursor: pointer; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }

.tap-hint {
  position: absolute; z-index: 3; right: 9%; bottom: 36%;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 18px;
  background: var(--cream); color: var(--ink); padding: 6px 14px 6px 8px;
  border: var(--outline); border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
  pointer-events: none; animation: hintBob 1.4s ease-in-out infinite;
  transition: opacity .4s;
}
.tap-hint.gone { opacity: 0; }
.tap-hint svg { width: 30px; height: 30px; }
@keyframes hintBob { 50% { transform: translateY(-6px); } }

.wave-banner {
  position: absolute; z-index: 3; left: 50%; top: 52%;
  transform: translate(-50%, -50%) scale(.6); opacity: 0;
  font-family: var(--font-display); font-size: clamp(34px, 6vw, 64px);
  pointer-events: none; white-space: nowrap;
}
.wave-banner.show { animation: banner 1.6s ease forwards; }
@keyframes banner {
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  25%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}

.game-over {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  background: rgba(10, 8, 6, .55); backdrop-filter: blur(2px);
}
.game-over[hidden] { display: none; }
.game-over .panel { text-align: center; max-width: 420px; width: calc(100% - 32px); }
.game-over h2 { font-size: 44px; margin-bottom: 4px; }
.game-over p { margin: 0 0 16px; }
.game-over .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.descend {
  position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%);
}

/* fly-to-HUD loot */
.loot-fly {
  position: fixed; z-index: 60; width: 34px; height: 34px; pointer-events: none;
  filter: drop-shadow(0 2px 0 var(--ink));
  transition: transform .75s cubic-bezier(.5,-0.4,.7,1), opacity .2s .65s;
}

/* -------------------------------------------------------------- gate */

.gate {
  position: relative; display: grid; place-items: center; padding: 22px 16px 8px;
  background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,0)), url('../assets/scene/earth.webp') repeat;
  background-size: auto, 320px;
  border-top: var(--outline);
}
.gate-sign {
  display: inline-block; max-width: 100%; text-align: center;
  font-family: var(--font-display); font-size: clamp(14px, 2.2vw, 19px); letter-spacing: 1px;
  color: var(--ink); background: var(--yellow); padding: 6px 18px 8px;
  border: var(--outline); border-radius: 10px;
  box-shadow: inset 0 -5px 0 var(--yellow-dark), 0 5px 0 rgba(0,0,0,.45);
  background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,.0) 0 14px, rgba(0,0,0,.07) 14px 28px);
}

/* ------------------------------------------------------------ shelter */

.shelter {
  position: relative;
  padding: 40px 16px 80px;
  display: grid; grid-template-columns: 120px minmax(0, 1100px) 120px;
  justify-content: center; gap: 28px;
}
.shaft {
  position: relative; grid-column: 1;
  background: url('../assets/scene/rails.webp') repeat-y center top / 96px auto, #120f0c;
  border: var(--outline); border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.8);
}
.cabin {
  position: absolute; left: 50%; top: 0; width: 104px;
  transform: translate(-50%, 0); will-change: transform;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
}
.cabin img.cabin-frame { width: 100%; }
.cabin img.cabin-rider {
  position: absolute; left: 50%; bottom: 7%; width: 74%; transform: translateX(-50%);
}
.cabin-led {
  position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 14px; color: #ff9b3d;
  background: #1b0d06; border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px;
  text-shadow: 0 0 6px #ff6a00;
}
.floors { grid-column: 2; display: flex; flex-direction: column; gap: 56px; min-width: 0; }

.callpanel {
  grid-column: 3; position: sticky; top: calc(var(--hud-h) + 40px); align-self: start;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  padding: 14px 10px; background: var(--slate); border: var(--outline); border-radius: var(--r);
  box-shadow: 0 6px 0 rgba(0,0,0,.35);
}
.callpanel .cp-title { font-family: var(--font-display); font-size: 14px; color: var(--cream-dim); }
.callpanel a {
  width: 64px; height: 50px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px; color: var(--cream-dim); text-decoration: none;
  background: radial-gradient(circle at 50% 35%, #46504c, #2a312f);
  border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35);
}
.callpanel a.is-active {
  color: var(--ink); background: radial-gradient(circle at 50% 35%, #ffe28a, var(--yellow));
  box-shadow: 0 0 16px rgba(255,190,60,.8), inset 0 -4px 0 var(--yellow-dark);
}

@media (max-width: 1240px) {
  .shelter { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; }
  .callpanel { display: none; }
  .cabin { width: 84px; }
}
@media (max-width: 760px) {
  .shelter { grid-template-columns: minmax(0, 1fr); padding: 28px 12px 60px; }
  .shaft { display: none; }
  .floors { grid-column: 1; gap: 40px; }
}

/* A floor: room banner + console panel */
.floor { position: relative; }
.floor-head {
  position: relative; border: var(--outline); border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0; overflow: hidden;
  height: clamp(200px, 30vw, 320px); background: #0d0c0a;
}
.floor-head img.room {
  width: 100%; height: 100%; object-fit: cover; object-position: center 60%;
  filter: brightness(.25) saturate(.6);
  transition: filter 1.1s ease;
}
.floor.is-lit .floor-head img.room { filter: brightness(1) saturate(1); animation: flicker 1.1s steps(1) 1; }
@keyframes flicker {
  0% { filter: brightness(.25); } 12% { filter: brightness(.9); } 18% { filter: brightness(.3); }
  30% { filter: brightness(1); } 36% { filter: brightness(.55); } 46%, 100% { filter: brightness(1); }
}
.floor-head::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,0) 55%, rgba(0,0,0,.55));
  pointer-events: none;
}
.floor-tag {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  display: flex; align-items: center; gap: 12px;
}
.marker {
  width: 58px; height: 58px; display: grid; place-items: center;
  background: url('../assets/scene/marker.webp') center / contain no-repeat;
  font-family: var(--font-display); font-size: 22px; color: var(--cream);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.nameplate {
  display: inline-block; padding: 8px 22px 10px;
  background: var(--yellow); color: var(--ink);
  border: var(--outline); border-radius: 12px;
  box-shadow: inset 0 -5px 0 var(--yellow-dark), 0 4px 0 var(--ink);
  font-size: clamp(22px, 3vw, 32px);
}

.panel {
  position: relative;
  background:
    radial-gradient(circle at 14px 14px, #6c766f 3px, #1a1f1d 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) 14px, #6c766f 3px, #1a1f1d 4px, transparent 5px),
    radial-gradient(circle at 14px calc(100% - 14px), #6c766f 3px, #1a1f1d 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #6c766f 3px, #1a1f1d 4px, transparent 5px),
    linear-gradient(#2c3735, #222a29);
  border: var(--outline); border-radius: var(--r);
  box-shadow: inset 0 0 0 4px #3d4a47, inset 0 0 0 6px #1a201f, 0 8px 0 rgba(0,0,0,.35);
  padding: 28px clamp(18px, 3.4vw, 40px) 32px;
}
.floor .panel { border-radius: 0 0 var(--r) var(--r); }
.panel h3 { font-size: 26px; margin: 0 0 8px; color: var(--gold); }
.panel p { margin: 0 0 14px; }
.lead { font-size: 20px; color: var(--cream); max-width: 760px; }
.muted { color: var(--cream-dim); }

/* B1 loop steps */
.loop {
  list-style: none; padding: 0; margin: 22px 0 6px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  counter-reset: step;
}
.loop li {
  position: relative; background: #1a201f; border: 3px solid var(--ink); border-radius: 16px;
  padding: 0 0 14px; overflow: hidden;
}
.loop li img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-bottom: 3px solid var(--ink); }
.loop li h3 { font-size: 21px; margin: 12px 14px 4px; color: var(--cream); }
.loop li p { font-size: 15.5px; line-height: 1.4; margin: 0 14px; color: var(--cream-dim); }
.loop li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 10px; top: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 50%;
  font-family: var(--font-display); font-size: 19px; z-index: 1;
}
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.stat {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: #151a19; border: 3px solid var(--ink); border-radius: 12px; padding: 4px 14px;
}
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--cyan); }
.stat span { font-size: 15px; color: var(--cream-dim); }
@media (max-width: 900px) { .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .loop li p { font-size: 14.5px; } .loop li h3 { font-size: 19px; } }

/* B2 radio */
.radio {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: end;
}
.radio-portrait {
  position: relative; align-self: stretch; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 50% 60%, rgba(65,211,234,.35), rgba(65,211,234,0) 65%);
}
.radio-portrait img { width: 100%; max-width: 220px; }
.radio-portrait .waves {
  position: absolute; right: 6px; top: 18%; width: 60px; height: 60px; pointer-events: none;
}
.radio-portrait .waves span {
  position: absolute; inset: 0; border: 4px solid var(--cyan); border-left-color: transparent; border-bottom-color: transparent;
  border-radius: 50%; transform: rotate(45deg); opacity: 0; animation: wave 1.8s ease-out infinite;
}
.radio-portrait .waves span:nth-child(2) { animation-delay: .6s; }
.radio-portrait .waves span:nth-child(3) { animation-delay: 1.2s; }
.radio.is-talking .radio-portrait .waves span { animation-play-state: running; }
@keyframes wave { from { transform: rotate(45deg) scale(.3); opacity: 1; } to { transform: rotate(45deg) scale(1.2); opacity: 0; } }

.radio-box {
  position: relative; background: var(--paper); color: var(--ink);
  border: var(--outline); border-radius: 20px; padding: 18px 22px 16px;
  box-shadow: 0 6px 0 var(--ink); min-height: 190px;
  display: flex; flex-direction: column;
}
.radio-box::before {
  content: ''; position: absolute; left: -16px; bottom: 34px; width: 24px; height: 24px;
  background: var(--paper); border-left: var(--outline); border-bottom: var(--outline);
  transform: rotate(45deg);
}
.radio-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-size: 15px; }
.radio-name { background: var(--ink); color: var(--cyan); border-radius: 8px; padding: 2px 10px; }
.radio-freq { color: #6a5b44; }
.radio-live { margin-left: auto; color: var(--red); display: inline-flex; align-items: center; gap: 6px; }
.radio-live::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.radio-text { flex: 1; font-size: 21px; font-weight: 600; line-height: 1.4; margin: 10px 0 12px; min-height: 3.6em; }
.radio-text .caret { display: inline-block; width: 10px; height: 1em; background: var(--ink); vertical-align: -2px; animation: blink .8s steps(1) infinite; }
.radio-actions { display: flex; align-items: center; gap: 12px; }
.radio-dots { display: flex; gap: 6px; margin-right: auto; }
.radio-dots i { width: 10px; height: 10px; border-radius: 50%; background: #c8b991; border: 2px solid var(--ink); }
.radio-dots i.on { background: var(--orange); }
@media (max-width: 680px) {
  .radio { grid-template-columns: 1fr; }
  .radio-portrait { max-width: 180px; margin: 0 auto -8px; }
  .radio-box::before { left: 50%; top: -16px; bottom: auto; transform: translateX(-50%) rotate(135deg); }
  .radio-text { font-size: 18.5px; }
}

/* B3 backpack */
.bag-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 28px; align-items: start; max-width: 900px; }
.bag {
  position: relative; padding: 18px;
  background:
    linear-gradient(rgba(0,0,0,.08), rgba(0,0,0,.08)),
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 2px, transparent 2px 6px),
    #6b7a3a;
  border: var(--outline); border-radius: 26px;
  box-shadow: inset 0 0 0 6px #556230, inset 0 0 0 8px var(--ink), 0 8px 0 rgba(0,0,0,.35);
}
.bag::before {
  /* Zipper along the top. */
  content: ''; position: absolute; left: 30px; right: 30px; top: 6px; height: 8px;
  background: repeating-linear-gradient(90deg, #c7c9c2 0 4px, #4d4f4a 4px 8px);
  border: 2px solid var(--ink); border-radius: 4px;
}
.bag-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: #e6d6a8; border: 3px solid var(--ink); border-radius: 16px; padding: 10px;
  margin-top: 10px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.12);
}
.cell {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed rgba(70,55,30,.35);
  background: rgba(120,95,50,.12); position: relative;
}
.cell.drop-ok { background: rgba(124,194,67,.4); border-color: var(--green-dark); border-style: solid; }
.card {
  --c: var(--blue); --c2: #1f5aa6;
  position: absolute; inset: -2px; display: grid; place-items: center;
  background: linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,0) 50%), var(--c);
  border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: inset 0 -5px 0 var(--c2), 0 3px 0 rgba(0,0,0,.4);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.card img { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.card.r-green { --c: #5aae3a; --c2: #2f7020; }
.card.r-purple { --c: var(--purple); --c2: #5a35a0; }
.card.r-orange { --c: var(--orange); --c2: #b0571a; }
.card.r-gold { --c: #ffc53a; --c2: #c98a0e; }
.card.dragging { cursor: grabbing; z-index: 20; box-shadow: 0 14px 20px rgba(0,0,0,.4); }
.card.pop { animation: cardPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes cardPop { from { transform: scale(.3) rotate(-12deg); } }
.card.synergy { box-shadow: inset 0 -5px 0 var(--c2), 0 0 0 3px var(--green), 0 0 14px rgba(124,194,67,.9); }

.fuse-badge {
  position: absolute; z-index: 15; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #fff2a8, var(--gold) 60%, #d89412);
  border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,211,77,.35), 0 0 22px rgba(255,200,40,.95);
  animation: badge 1s ease-in-out infinite;
  padding: 0;
}
.fuse-badge svg { width: 26px; height: 26px; }
@keyframes badge { 50% { transform: scale(1.12); } }

.shelf {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: #3a2b1f; border: var(--outline); border-radius: 18px; padding: 12px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.35);
}
.shelf .cell { border-color: rgba(255,230,180,.18); background: rgba(0,0,0,.25); }
.shelf-title { font-family: var(--font-display); font-size: 18px; margin: 0 0 8px; color: var(--cream-dim); }
.bag-info { margin-top: 14px; font-size: 16px; color: var(--cream-dim); min-height: 3em; }
.bag-info b { color: var(--cream); }
.recipes { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.recipes li {
  display: flex; align-items: center; gap: 6px; font-size: 14px;
  background: #151a19; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 8px;
}
.recipes li img { width: 30px; height: 30px; object-fit: contain; }
.recipes li .eq { font-family: var(--font-display); color: var(--cream-dim); }
.recipes li.done { border-color: var(--gold); background: #2f2810; }
.recipes li .q { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--font-display); color: var(--cream-dim); background: #222; border-radius: 8px; }
.bag-reset { margin-top: 12px; }
@media (max-width: 860px) { .bag-wrap { grid-template-columns: 1fr; } .shelf { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 480px) { .shelf { grid-template-columns: repeat(3, 1fr); } .bag { padding: 12px; } .bag-grid { gap: 6px; padding: 8px; } }

.burst { position: absolute; z-index: 16; pointer-events: none; width: 0; height: 0; }
.burst i {
  position: absolute; width: 10px; height: 10px; border-radius: 2px; background: var(--gold);
  border: 2px solid var(--ink); animation: shard .7s ease-out forwards;
}
@keyframes shard { to { transform: translate(var(--x), var(--y)) rotate(220deg); opacity: 0; } }

/* B4 bestiary */
.bestiary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.progress {
  position: relative; width: 220px; height: 26px; background: #121615; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden;
}
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(var(--green), #4f8f2a); transition: width .4s; }
.progress span { position: relative; display: block; text-align: center; font-family: var(--font-display); font-size: 15px; line-height: 20px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.bestiary { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 980px) { .bestiary { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 560px) { .bestiary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; } }
.zcard {
  position: relative; aspect-ratio: 1; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #46524d, #1e2524);
  border: 3px solid var(--ink); border-radius: 14px; overflow: hidden;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.4);
  transition: transform .12s;
}
.zcard:hover { transform: translateY(-3px); }
.zcard img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0) opacity(.75); transition: filter .5s; }
.zcard .q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; color: var(--cream-dim); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.zcard.seen img { filter: none; }
@media (max-width: 560px) { .zcard .q { font-size: 24px; -webkit-text-stroke-width: 3px; } }
.zcard.seen .q { display: none; }
.zcard.is-selected { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255,211,77,.6); }
.zdetail {
  margin-top: 16px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center;
  background: var(--paper); color: var(--ink); border: var(--outline); border-radius: 18px; padding: 12px 18px;
  box-shadow: 0 6px 0 var(--ink); min-height: 140px;
}
.zdetail img { width: 120px; height: 120px; border-radius: 12px; border: 3px solid var(--ink); background: #2a3230; }
.zdetail h3 { color: var(--ink); font-size: 28px; margin: 0 0 4px; }
.zdetail p { margin: 0; font-size: 17px; font-weight: 600; }
.zdetail .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.zdetail .tags span { font-family: var(--font-display); font-size: 13px; background: var(--ink); color: var(--cream); border-radius: 8px; padding: 1px 8px; }
@media (max-width: 480px) { .zdetail { grid-template-columns: 84px 1fr; } .zdetail img { width: 84px; height: 84px; } .zdetail h3 { font-size: 23px; } .zdetail p { font-size: 15.5px; } }

/* B5 bosses */
.chapter-tabs { display: flex; gap: 10px; margin: 6px 0 16px; flex-wrap: wrap; }
.chapter-tabs button[aria-selected='true'] { --bg: var(--yellow); --lip: var(--yellow-dark); --fg: var(--ink); }
.chapter-tabs button[aria-selected='false'] { --bg: #59625e; --lip: #3a403d; --fg: var(--cream); }
/* Six chapters: one swipeable row on phones instead of six stacked rows. */
@media (max-width: 560px) {
  .chapter-tabs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: -4px; padding: 0 4px 8px; scrollbar-width: none; }
  .chapter-tabs::-webkit-scrollbar { display: none; }
  .chapter-tabs button { flex: none; scroll-snap-align: start; white-space: nowrap; }
}
.bosses {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px;
  scrollbar-color: var(--steel) transparent;
}
.boss {
  scroll-snap-align: start; position: relative;
  background: linear-gradient(#3a1d18, #1d1211);
  border: var(--outline); border-radius: 18px; overflow: hidden;
  box-shadow: inset 0 0 0 3px #5b2a21;
  display: flex; flex-direction: column;
}
.boss .art { height: 230px; display: grid; place-items: end center; padding: 10px; background: radial-gradient(circle at 50% 70%, rgba(255,120,60,.35), transparent 65%); }
.boss .art img { max-height: 210px; width: auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.45)); transition: transform .2s; }
.boss:hover .art img { transform: scale(1.04) rotate(-1deg); }
.boss .info { padding: 10px 14px 14px; border-top: 3px solid var(--ink); background: #241413; }
.boss .stage { display: block; font-family: var(--font-display); font-size: 13px; color: var(--orange); letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.boss h3 { font-size: 25px; color: var(--cream); margin: 2px 0; }
.boss p { margin: 0; font-size: 15px; color: var(--cream-dim); }
.boss .hpbar { margin-top: 10px; height: 14px; border: 3px solid var(--ink); border-radius: 999px; background: #130b0a; overflow: hidden; }
.boss .hpbar i { display: block; height: 100%; background: linear-gradient(#ff6a4d, #b4261a); }
.chapter2 .boss { background: linear-gradient(#183444, #0f1d26); box-shadow: inset 0 0 0 3px #24506a; }
.chapter2 .boss .art { background: radial-gradient(circle at 50% 70%, rgba(120,210,255,.35), transparent 65%); }
.chapter2 .boss .info { background: #0f202a; }
.chapter2 .boss .stage { color: var(--cyan); }
.chapter2 .boss .hpbar i { background: linear-gradient(#7fe3ff, #2a8fc4); }
.chapter3 .boss { background: linear-gradient(#16352e, #0d1f1b); box-shadow: inset 0 0 0 3px #2a6455; }
.chapter3 .boss .art { background: radial-gradient(circle at 50% 70%, rgba(90,220,170,.32), transparent 65%); }
.chapter3 .boss .info { background: #0e221d; }
.chapter3 .boss .stage { color: #6fe0b8; }
.chapter3 .boss .hpbar i { background: linear-gradient(#7ff0c4, #21926c); }
.chapter4 .boss { background: linear-gradient(#2a1d40, #140f22); box-shadow: inset 0 0 0 3px #4a3570; }
.chapter4 .boss .art { background: radial-gradient(circle at 50% 70%, rgba(255,214,120,.30), transparent 65%); }
.chapter4 .boss .info { background: #191229; }
.chapter4 .boss .stage { color: #ffd27a; }
.chapter4 .boss .hpbar i { background: linear-gradient(#ffe08a, #c98a1e); }
.chapter5 .boss { background: linear-gradient(#3a2c1c, #1f170f); box-shadow: inset 0 0 0 3px #6a5232; }
.chapter5 .boss .art { background: radial-gradient(circle at 50% 70%, rgba(230,180,110,.32), transparent 65%); }
.chapter5 .boss .info { background: #251b11; }
.chapter5 .boss .stage { color: #e8b46c; }
.chapter5 .boss .hpbar i { background: linear-gradient(#f0c27a, #a8702c); }
.chapter6 .boss { background: linear-gradient(#2c3320, #171c11); box-shadow: inset 0 0 0 3px #4f5c34; }
.chapter6 .boss .art { background: radial-gradient(circle at 50% 70%, rgba(255,150,70,.30), transparent 65%); }
.chapter6 .boss .info { background: #1b2014; }
.chapter6 .boss .stage { color: #ff9a4d; }
.chapter6 .boss .hpbar i { background: linear-gradient(#ffb066, #c4581c); }

/* B6 garage */
.download { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 28px; align-items: center; }
.download .btns { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 10px; }
.trailer-card {
  position: relative; display: block; width: 100%; padding: 0; cursor: pointer;
  border: var(--outline); border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 8px 0 rgba(0,0,0,.4); aspect-ratio: 9 / 13;
}
.trailer-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.trailer-card:hover img { transform: scale(1.04); }
.trailer-card .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); border: var(--outline); box-shadow: inset 0 -6px 0 var(--yellow-dark), 0 5px 0 var(--ink);
}
.trailer-card .play svg { width: 36px; height: 36px; margin-left: 6px; }
.trailer-card .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; font-family: var(--font-display); font-size: 20px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
/* B2 story intro card */
.story-card {
  position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 18px; align-items: center;
  width: 100%; margin-top: 22px; padding: 12px; cursor: pointer; text-align: left; color: var(--cream);
  border: var(--outline); border-radius: 18px; background: linear-gradient(#2a2015, #17110b); box-shadow: 0 6px 0 rgba(0,0,0,.35);
}
.story-card img { width: 160px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 3px solid var(--ink); display: block; }
.story-card .play {
  position: absolute; left: 92px; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); border: var(--outline); box-shadow: inset 0 -5px 0 var(--yellow-dark), 0 4px 0 var(--ink);
}
.story-card .play svg { width: 24px; height: 24px; margin-left: 4px; }
.story-text { display: grid; gap: 4px; min-width: 0; }
.story-kicker { font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--yellow); }
.story-title { font-family: var(--font-display); font-size: 28px; line-height: 1.05; }
.story-desc { color: var(--cream-dim); font-size: 15px; }
.story-card:hover img { filter: brightness(1.08); }
@media (max-width: 520px) { .story-card { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; } .story-card img { width: 110px; } .story-card .play { left: 67px; width: 46px; height: 46px; } .story-title { font-size: 22px; } }

.trailer-col { display: grid; gap: 12px; justify-items: center; }
.trailer-card img { object-position: center 30%; }
.intro-btn { gap: 8px; }
@media (max-width: 760px) { .download { grid-template-columns: 1fr; } .trailer-card { max-width: 360px; margin: 0 auto; aspect-ratio: 4/5; } }

.gallery {
  margin-top: 28px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 220px); gap: 14px;
  overflow-x: auto; padding: 4px 4px 14px; scroll-snap-type: x mandatory;
}
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 1320 / 1893; object-fit: cover; border: var(--outline); border-radius: 16px; box-shadow: 0 6px 0 rgba(0,0,0,.35); }
.gallery figcaption { margin-top: 8px; font-family: var(--font-display); font-size: 17px; text-align: center; }

dialog.trailer {
  padding: 0; border: var(--outline); border-radius: 18px; background: #000; overflow: hidden;
  width: min(440px, 92vw); max-height: 92vh;
}
dialog.trailer::backdrop { background: rgba(0,0,0,.75); }
dialog.trailer video { display: block; width: 100%; max-height: calc(92vh - 8px); background: #000; }
dialog.trailer .close {
  position: absolute; right: 8px; top: 8px; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: var(--cream); border: 3px solid var(--ink); cursor: pointer; font-family: var(--font-display); font-size: 20px;
}

/* ------------------------------------------------------------- footer */

.bedrock {
  position: relative; padding: 40px 16px 28px;
  background: linear-gradient(rgba(10,8,6,.55), rgba(10,8,6,.92)), url('../assets/scene/earth.webp') repeat;
  background-size: auto, 320px;
  border-top: var(--outline);
}
.bedrock-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 28px; }
.bedrock img.logo { width: 200px; margin-bottom: 10px; }
.bedrock h3 { font-size: 19px; color: var(--gold); margin-bottom: 8px; }
.bedrock ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.bedrock a { color: var(--cream); text-decoration: none; }
.bedrock a:hover { color: var(--gold); text-decoration: underline; }
.bedrock .fine { max-width: 1100px; margin: 26px auto 0; padding-top: 14px; border-top: 2px dashed rgba(255,255,255,.15); font-size: 14px; color: var(--cream-dim); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
@media (max-width: 700px) { .bedrock-inner { grid-template-columns: 1fr 1fr; } .bedrock-inner > :first-child { grid-column: 1 / -1; } }

/* ------------------------------------------------------------- toasts */

.toasts { position: fixed; z-index: 70; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: 340px;
  background: var(--slate); border: var(--outline); border-radius: 16px; padding: 10px 16px 10px 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,.4);
  animation: toastIn .45s cubic-bezier(.2,1.4,.4,1), toastOut .4s ease 3.6s forwards;
}
.toast .medal { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff2a8, var(--gold) 60%, #d89412); border: 3px solid var(--ink); }
.toast .medal svg { width: 26px; height: 26px; }
.toast > div > b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--gold); }
.toast > div > span { display: block; font-size: 14.5px; line-height: 1.3; color: var(--cream-dim); }
@keyframes toastIn { from { transform: translateX(120%); } }
@keyframes toastOut { to { transform: translateX(130%); opacity: 0; } }
@media (max-width: 520px) { .toasts { left: 12px; right: 12px; align-items: stretch; } .toast { max-width: none; } }

/* ------------------------------------------------------------- legal */

.legal-page { padding: calc(var(--hud-h) + 34px) 16px 60px; }
.doc {
  max-width: 860px; margin: 0 auto;
  background: var(--paper); color: var(--ink);
  border: var(--outline); border-radius: 22px;
  box-shadow: 0 10px 0 rgba(0,0,0,.4);
  padding: clamp(22px, 4vw, 48px);
  position: relative;
}
.doc::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: -14px; height: 14px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
  border: 3px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.doc h1 { font-size: clamp(32px, 5vw, 46px); color: var(--ink); margin-bottom: 6px; }
.doc h2 { font-size: 25px; color: var(--ink); margin: 30px 0 8px; padding-top: 10px; border-top: 3px dashed rgba(21,17,13,.18); }
.doc h3 { font-size: 20px; color: var(--ink); margin: 18px 0 6px; }
.doc p, .doc li { font-size: 17.5px; }
.doc a { color: #8a4b05; font-weight: 700; }
.doc .meta { font-weight: 700; color: #6a5b44; margin-bottom: 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 15.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border: 2px solid rgba(21,17,13,.25); }
.doc th { background: rgba(21,17,13,.08); font-family: var(--font-display); font-weight: 400; font-size: 16px; }
.doc td ul { margin: 6px 0; padding-left: 20px; }
.doc td li { font-size: inherit; margin: 4px 0; }
.doc .table-wrap { overflow-x: auto; }
.doc .callout { background: #fff6dc; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; margin: 14px 0; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; padding: 0; list-style: none; }
.doc .toc a { display: inline-block; text-decoration: none; background: var(--ink); color: var(--cream); border-radius: 10px; padding: 2px 10px; font-size: 14px; font-weight: 600; }
.doc-nav { max-width: 860px; margin: 0 auto 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.doc-nav a.is-active { --bg: var(--yellow); --lip: var(--yellow-dark); --fg: var(--ink); }
.doc-nav a { --bg: #59625e; --lip: #3a403d; --fg: var(--cream); }
.doc .steps { counter-reset: s; list-style: none; padding: 0; }
.doc .steps li { counter-increment: s; position: relative; padding-left: 46px; margin-bottom: 12px; }
.doc .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); border: 3px solid var(--ink); font-family: var(--font-display); }
.cfg-missing { background: #ffd0c4; outline: 2px dashed var(--red); padding: 0 4px; }

/* language blocks: only the active language shows */
html[lang='tr'] [data-lang='en'], html[lang='en'] [data-lang='tr'] { display: none !important; }

/* 404 */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 100px 16px 40px; }
.lost h1 { font-size: clamp(64px, 14vw, 140px); }
.lost img { width: 180px; margin: 0 auto 10px; }

/* /play: the social bio landing (play.js picks the status sentence) */
.play-page { min-height: 100svh; padding: calc(var(--hud-h) + 34px) 16px 24px; display: grid; align-content: center; justify-items: center; gap: 18px; }
.play-card {
  width: min(940px, 100%); display: grid; column-gap: 36px; justify-items: center; text-align: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  grid-template-rows: 1fr repeat(5, auto) 1fr;
  grid-template-areas: '. trailer' 'logo trailer' 'tag trailer' 'status trailer' 'btns trailer' 'explore trailer' '. trailer';
}
.play-card h1 { grid-area: logo; width: min(400px, 100%); }
.play-card h1 img { width: 100%; height: auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.28)); }
.play-card .tagline { grid-area: tag; margin: 4px 0 10px; line-height: 1.3; }
.play-status { grid-area: status; margin: 0 0 16px; font-family: var(--font-display); font-size: 23px; line-height: 1.15; color: var(--gold); text-wrap: balance; }
.play-status > span { display: none; }
.play-soon .st-soon, .play-live .st-live, .play-live-ios .st-live-ios, .play-live-android .st-live-android,
.play-to-ios .st-ios, .play-to-android .st-android { display: inline; }
.play-btns { grid-area: btns; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.play-explore { grid-area: explore; margin-top: 18px; }
.play-card .play-trailer { grid-area: trailer; align-self: center; max-width: 300px; margin: 0; aspect-ratio: 4 / 5; }
.play-fine { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; padding: 6px 16px; border-radius: 12px; background: rgba(21,17,13,.72); font-size: 14px; color: var(--cream-dim); }
.play-fine a { color: var(--cream); }
@media (max-width: 760px) {
  .play-page { align-content: start; padding-top: calc(var(--hud-h) + 26px); }
  .play-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: 'logo' 'tag' 'status' 'trailer' 'btns' 'explore'; }
  .panel.play-card { padding: 22px 12px 26px; }
  .play-card h1 { width: min(300px, 82%); }
  .play-card .tagline { font-size: 21px; line-height: 1.3; -webkit-text-stroke-width: 5px; margin-bottom: 10px; }
  .play-status { font-size: 19px; margin-bottom: 14px; }
  .play-card .play-trailer { max-width: 240px; margin-bottom: 20px; }
  .play-card .play-trailer .label { padding-bottom: 10px; font-size: 16px; line-height: 1.2; }
  .play-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 360px; }
  .play-btns .btn { min-height: 50px; padding: 4px 8px 8px; font-size: 16px; gap: 6px; border-radius: 14px; }
  .play-btns .btn-stack > span { white-space: nowrap; }
  .play-btns .btn svg { width: 20px; height: 20px; }
  .play-btns .btn small { font-size: 10.5px; }
}

/* ------------------------------------------------------- phone hero */
@media (max-width: 600px) {
  .surface-ui { top: calc(var(--hud-h) + 14px); }
  .surface-ui h1 { width: min(330px, 80vw); }
  .tagline { font-size: 21px; margin: 2px 0 12px; -webkit-text-stroke-width: 5px; }
  .hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 360px; }
  .hero-cta .btn { min-height: 50px; padding: 4px 10px 8px; font-size: 17px; gap: 6px; border-radius: 14px; }
  .hero-cta .btn svg { width: 20px; height: 20px; }
  .hero-cta .btn small { font-size: 10.5px; }
  .hero-cta [data-trailer] { grid-column: 1 / -1; }
  .game-hud { top: auto; bottom: 20px; left: 12px; }
  .descend { left: auto; right: 12px; transform: none; bottom: 16px; }
  .descend span { font-size: 15px; }
  .hearts svg { width: 26px; height: 24px; }
  .tap-hint { right: 12px; bottom: 37%; font-size: 15px; }
  .tap-hint svg { width: 24px; height: 24px; }
}
@media (max-height: 640px) and (min-width: 601px) {
  .surface-ui h1 { width: min(420px, 60vw); }
}

/* Former inline styles (the CSP allows no style attributes). */
.loop li img.focus-30 { object-position: center 30%; }
.loop li img.focus-42 { object-position: center 42%; }
.loop li img.focus-55 { object-position: center 55%; }
.loop li img.focus-62 { object-position: center 62%; }
.flush { margin: 0; }
.zdetail img.unknown { filter: brightness(0) opacity(.5); }
.lost-portrait { border: 4px solid var(--ink); border-radius: 24px; }

/* ------------------------------------------------- player survey (/survey) */
.survey-page { min-height: 100vh; padding: calc(var(--hud-h) + 40px) 16px 60px; display: grid; place-items: start center; }
.sv-lang { display: block; }
.sv-lang select { appearance: none; -webkit-appearance: none; max-width: 150px; text-align: center; }
.sv-card {
  position: relative; width: min(620px, 100%);
  background: var(--paper); color: var(--ink);
  border: var(--outline); border-radius: 22px;
  box-shadow: 0 10px 0 rgba(0,0,0,.4);
  padding: clamp(22px, 5vw, 40px);
  padding-top: clamp(30px, 6vw, 44px);
}
.sv-card::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: -14px; height: 14px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
  border: 3px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.sv-mira { position: absolute; right: -18px; top: -86px; width: 120px; pointer-events: none; filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)); }
[dir="rtl"] .sv-mira { right: auto; left: -18px; transform: scaleX(-1); }
.sv-step h1, .sv-step > h2.stroke { font-size: clamp(30px, 6vw, 42px); margin: 0 96px 10px 0; }
[dir="rtl"] .sv-step h1, [dir="rtl"] .sv-step > h2.stroke { margin: 0 0 10px 96px; }
.sv-lead { font-size: 19px; font-weight: 600; margin: 0 0 18px; }
.sv-small { font-size: 14.5px; color: #6a5b44; margin: 18px 0 0; }
.sv-small a { color: #8a4b05; font-weight: 700; }
.sv-start { min-width: 200px; }
.sv-progress { display: flex; align-items: center; gap: 12px; margin: 0 110px 14px 0; font-family: var(--font-display); font-size: 17px; color: #6a5b44; }
[dir="rtl"] .sv-progress { margin: 0 0 14px 110px; }
.sv-bar { flex: 1; height: 14px; border: 3px solid var(--ink); border-radius: 9px; background: rgba(21,17,13,.08); overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--green) 0 10px, #6cb037 10px 20px); transition: width .25s ease; }
.sv-q { font-size: clamp(25px, 5vw, 32px); color: var(--ink); margin: 0 0 4px; }
.sv-rule { margin: 0 0 14px; font-weight: 700; color: var(--yellow-dark); }
.sv-options { display: grid; gap: 10px; }
.sv-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px;
  padding: 8px 14px; text-align: start; cursor: pointer;
  font-family: var(--font-body); font-size: 18px; font-weight: 700; color: var(--ink);
  background: #fbf3dc; border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 0 4px 0 rgba(21,17,13,.35);
  transition: transform .08s ease, background .12s ease;
}
.sv-opt:nth-child(odd) { transform: rotate(-.4deg); }
.sv-opt:nth-child(even) { transform: rotate(.35deg); }
.sv-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(21,17,13,.35); }
.sv-opt .tick { flex: none; width: 26px; height: 26px; border: 3px solid var(--ink); border-radius: 7px; background: rgba(21,17,13,.06); display: grid; place-items: center; }
.sv-opt.single .tick { border-radius: 50%; }
.sv-opt[aria-pressed="true"] { background: #fff1c9; border-color: #8a5a07; box-shadow: 0 4px 0 #8a5a07; }
.sv-opt[aria-pressed="true"] .tick { background: var(--green); }
.sv-opt[aria-pressed="true"] .tick::after { content: ''; width: 7px; height: 13px; border: solid #fff; border-width: 0 3.5px 3.5px 0; transform: translateY(-2px) rotate(45deg); }
.sv-text { display: block; position: relative; }
.sv-text textarea {
  width: 100%; resize: vertical; min-height: 140px; padding: 12px 14px;
  font: 600 18px/1.4 var(--font-body); color: var(--ink);
  background: #fbf3dc; border: 3px solid var(--ink); border-radius: 12px;
}
.sv-counter { display: block; text-align: end; font-size: 13px; color: #6a5b44; margin-top: 4px; }
.sv-nav { display: grid; grid-template-columns: 2fr 3fr; gap: 12px; margin-top: 22px; }
.sv-nav .btn { width: 100%; }
.sv-error { margin: 14px 0 0; padding: 10px 14px; background: #ffd9cf; border: 3px solid var(--ink); border-radius: 12px; font-weight: 700; }
.sv-game { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; padding: 12px 14px; background: var(--slate); color: var(--cream); border: 3px solid var(--ink); border-radius: 14px; }
.sv-game img { flex: none; width: 48px; height: auto; }
.sv-game p { margin: 0; font-weight: 700; font-size: 16.5px; line-height: 1.35; }
.sv-stores { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sv-stores[hidden], .sv-step[hidden], .sv-text[hidden], .sv-error[hidden] { display: none; }
@media (max-width: 520px) {
  .survey-page { padding-top: calc(var(--hud-h) + 70px); }
  .sv-mira { width: 96px; top: -76px; right: -6px; }
  .sv-step h1, .sv-step > h2.stroke { margin-right: 70px; -webkit-text-stroke-width: 5px; }
  .sv-progress { margin-right: 76px; }
  .sv-opt { font-size: 17px; min-height: 50px; }
  .sv-lang select { max-width: 110px; font-size: 14px; }
}
