/* ═══════════════════════════════════════════════════════════════════════════
   Avishake Adhikary — 3D career sandbox
   All UI is hand-rolled CSS. No webfonts, no images, no external requests.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #05070a;
  --ink:       #e9eef5;
  --muted:     #8c9bb0;

  /* Accent: red primary with an orange secondary, on black.
     Two reds, not one, because contrast pulls in opposite directions — a red
     light enough to read as text on black is too light to carry white text on
     top of it. `--accent` is for ink on dark; `--accent-solid` is for fills,
     which take `--on-accent` as their text colour. The old gold was light
     enough to do both jobs with dark text, so every filled control had to flip
     its foreground when the palette changed. */
  --accent:       #ff4b3e;   /* 5.9:1 on --bg  */
  --accent-2:     #ff8c2b;   /* orange, for gradients and progress */
  --accent-solid: #c81e2a;   /* 5.4:1 against #fff */
  --accent-dim:   #7a1218;
  --accent-soft:  rgba(255, 75, 62, .14);
  --accent-glow:  rgba(255, 75, 62, .55);
  --on-accent:    #fff6f4;

  --cyan:      #46d4ff;
  --pink:      #ff4fa3;      /* pushed toward magenta so it stays distinct from the red */
  --green:     #5ef2a0;
  --panel:     rgba(8, 10, 14, .84);
  --panel-sol: #0b0e14;
  --line:      rgba(255, 255, 255, .12);
  --hud-pad:   clamp(12px, 2.2vmin, 26px);

  --f-display: "Haettenschweiler", "Arial Narrow Bold", "Franklin Gothic Heavy",
               "Impact", "Anton", "Oswald", system-ui, sans-serif;
  --f-ui:      ui-sans-serif, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono:    ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

/* Class-level `display` beats the UA sheet's [hidden] rule, and a full-screen
   .screen that is meant to be hidden would silently swallow every click. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--f-ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body.playing { cursor: none; }
/* Any time an overlay owns the screen the pointer must be visible, whether or
   not the pointer-lock change event has landed yet. */
body.playing.cursor-free,
body.ui-open { cursor: default !important; }

#viewport { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* Cheap cinematic vignette + scanline grain, pure CSS, zero draw cost in WebGL */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 42%, rgba(0,0,0,.42) 100%),
    linear-gradient(to bottom, rgba(10,16,24,.28), transparent 22%, transparent 78%, rgba(6,9,14,.44));
  mix-blend-mode: multiply;
  opacity: 0; transition: opacity .8s ease;
}
body.playing #vignette { opacity: 1; }

kbd {
  font-family: var(--f-mono); font-size: .72em; line-height: 1;
  padding: .28em .45em; border-radius: 4px;
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.2);
  border-bottom-width: 2px; color: #fff; white-space: nowrap;
}

.btn {
  font-family: var(--f-ui); font-size: 13px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink); background: rgba(255,255,255,.07);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 11px 18px; cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.btn:hover { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); transform: translateY(-1px); }
.btn.wide { width: 100%; text-align: left; }
.btn.sm { padding: 7px 12px; font-size: 11.5px; }
.btn.accent { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
.btn.accent:hover { background: var(--accent); border-color: var(--accent); }

/* ═══════════════════════════════ LOADING POSTER ═══════════════════════════════ */

.screen {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: #05070a;
}

#loader { transition: opacity .7s ease, visibility .7s; }
#loader.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.poster {
  position: relative; width: 100%; height: 100%;
  display: grid; grid-template-rows: 1fr auto auto;
  padding: clamp(18px, 4vmin, 60px);
  overflow: hidden;
}

/* Four angled panels of procedurally-drawn skyline, GTA cover-art style */
.poster-grid {
  position: absolute; inset: -6%;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 10px; transform: rotate(-3deg) scale(1.08);
  opacity: .5;
}
.tile {
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  background-size: cover; background-position: center;
  animation: tileIn 1.6s cubic-bezier(.16,1,.3,1) backwards;
}
.tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,7,10,.9), transparent 60%);
}
.tile-tag {
  position: absolute; left: 14px; bottom: 10px; z-index: 2;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .3em;
  color: rgba(255,255,255,.4);
}
.t1 { animation-delay: 0s;   background:
  linear-gradient(170deg, #ff9a3c 0%, #f2643a 38%, #71264f 74%, #1b1030 100%); }
.t2 { animation-delay: .09s; background:
  linear-gradient(190deg, #123047 0%, #0e5f76 45%, #0b1720 100%); }
.t3 { animation-delay: .18s; background:
  linear-gradient(150deg, #2b1a44 0%, #6c2a6a 50%, #0d0a18 100%); }
.t4 { animation-delay: .27s; background:
  linear-gradient(200deg, #ff8c2b 0%, #c81e2a 46%, #14060a 100%); }

/* Skyline silhouettes: two bands of towers at different heights and pitches,
   drawn entirely with repeating gradients. No image files anywhere. */
.tile::before {
  content: ""; position: absolute; left: -12%; right: -12%; bottom: 0; height: 44%;
  background:
    repeating-linear-gradient(90deg,
      rgba(3,5,8,.96) 0 26px, transparent 26px 38px,
      rgba(3,5,8,.96) 38px 54px, transparent 54px 71px,
      rgba(3,5,8,.96) 71px 116px, transparent 116px 132px) bottom / 100% 62% no-repeat,
    repeating-linear-gradient(90deg,
      rgba(6,9,14,.88) 0 44px, transparent 44px 61px,
      rgba(6,9,14,.88) 61px 96px, transparent 96px 108px) bottom / 100% 100% no-repeat;
}
.t2::before { height: 56%; }
.t3::before { height: 33%; }
.t4::before { height: 48%; }

@keyframes tileIn { from { opacity: 0; transform: translateY(26px) scale(1.06); } }

.poster-copy { position: relative; z-index: 2; align-self: end; max-width: 1100px; }

.kicker {
  margin: 0 0 10px; font-family: var(--f-mono);
  font-size: clamp(10px, 1.25vmin, 13px); letter-spacing: .46em;
  text-transform: uppercase; color: var(--accent);
}
.wordmark {
  margin: 0; display: flex; flex-wrap: wrap; gap: 0 .28em;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(48px, 12.5vmin, 190px); line-height: .84;
  letter-spacing: .005em; text-transform: uppercase;
  transform: skewX(-7deg); transform-origin: left bottom;
}
.wordmark span {
  background: linear-gradient(178deg, #fff 8%, #ffc9a8 42%, var(--accent) 70%, var(--accent-dim) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.55)) drop-shadow(0 22px 44px rgba(0,0,0,.7));
  animation: wordIn .9s cubic-bezier(.16,1,.3,1) backwards;
}
.wordmark span:nth-child(2) { animation-delay: .1s; }
@keyframes wordIn { from { opacity: 0; transform: translateY(.14em) skewX(6deg); } }

.subtitle {
  margin: clamp(10px, 1.6vmin, 20px) 0 0; padding-left: .18em;
  font-size: clamp(12px, 1.7vmin, 19px); font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: #cdd8e6;
}

.poster-load { position: relative; z-index: 2; margin-top: clamp(18px, 3.4vmin, 44px); max-width: 900px; }
.load-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--f-mono); font-size: clamp(10px, 1.25vmin, 13px);
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
#load-pct { color: var(--accent); font-weight: 700; }
.load-track {
  margin-top: 8px; height: 5px; border-radius: 99px; overflow: hidden;
  background: rgba(255,255,255,.1);
}
#load-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent) 55%, var(--accent-2));
  box-shadow: 0 0 18px rgba(255,75,62,.6);
  transition: width .25s cubic-bezier(.4,0,.2,1);
}
.tip {
  margin: 14px 0 0; min-height: 2.4em;
  font-size: clamp(11px, 1.45vmin, 15px); line-height: 1.6; color: #9fb0c6;
}
.tip b {
  display: inline-block; margin-right: 10px; padding: 2px 8px;
  font-family: var(--f-mono); font-size: .72em; letter-spacing: .2em;
  background: rgba(255,75,62,.14); color: var(--accent); border-radius: 3px;
  vertical-align: middle;
}
#load-tip { transition: opacity .35s; }

.start-btn {
  position: relative; z-index: 3; justify-self: start;
  margin-top: clamp(14px, 2.4vmin, 26px);
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--f-display); font-size: clamp(22px, 3.4vmin, 42px);
  letter-spacing: .06em; text-transform: uppercase;
  padding: .38em .9em; cursor: pointer;
  color: var(--on-accent); background: var(--accent-solid);
  border: 0; border-radius: 3px; transform: skewX(-7deg);
  box-shadow: 0 10px 40px rgba(255,75,62,.32);
  animation: pulse 2.1s ease-in-out infinite;
}
.start-btn:hover { background: var(--accent); box-shadow: 0 12px 54px rgba(255,75,62,.5); }
.start-key { font-size: .7em; }
@keyframes pulse { 50% { box-shadow: 0 10px 60px rgba(255,75,62,.62); } }
.start-hint {
  position: relative; z-index: 3; margin: 12px 0 0;
  font-size: 12px; letter-spacing: .06em; color: var(--muted);
}
.start-disclaimer {
  position: relative; z-index: 3; margin: 14px 0 0; max-width: 46ch;
  padding: 10px 14px; font-size: 11.5px; line-height: 1.55; color: var(--muted);
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-left: 2px solid var(--accent);
}

.noscript, .fatal { z-index: 90; padding: 8vmin; text-align: center; }

.rotate-gate { z-index: 100; padding: 8vmin; text-align: center; }
.rotate-card { max-width: 420px; }
.rotate-icon { font-size: 64px; line-height: 1; animation: rotateHint 1.8s ease-in-out infinite; }
.rotate-gate h1 { margin: 18px 0 10px; font-family: var(--f-display); font-size: clamp(24px, 6vmin, 34px); text-transform: uppercase; }
.rotate-gate p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}
.fatal h1, .noscript h1 { font-family: var(--f-display); font-size: clamp(32px, 7vmin, 76px); margin: 0 0 .3em; color: var(--accent); }
.fatal p, .noscript p { color: var(--muted); max-width: 44ch; margin: .4em auto; line-height: 1.7; }
.fatal a, .noscript a { color: var(--cyan); }
.fatal-alt { margin-top: 2em !important; }

/* ═══════════════════════════════ HUD ═══════════════════════════════ */

.hud {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none; user-select: none;
  padding: var(--hud-pad);
  padding-top: max(var(--hud-pad), env(safe-area-inset-top));
  padding-bottom: max(var(--hud-pad), env(safe-area-inset-bottom));
  font-size: 14px;
  animation: hudIn .8s .15s cubic-bezier(.16,1,.3,1) backwards;
}
@keyframes hudIn { from { opacity: 0; } }
.hud[hidden] { display: none; }

.hud-tl { position: absolute; top: var(--hud-pad); left: var(--hud-pad); max-width: min(38vw, 420px); }
.hud-tr { position: absolute; top: var(--hud-pad); right: var(--hud-pad); text-align: right; }
.hud-bl { position: absolute; bottom: var(--hud-pad); left: var(--hud-pad); display: flex; align-items: flex-end; gap: 14px; }
.hud-br { position: absolute; bottom: var(--hud-pad); right: var(--hud-pad); text-align: right; }
.hud-bc { position: absolute; bottom: calc(var(--hud-pad) + 4vmin); left: 50%; transform: translateX(-50%); }

.objective {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 14px; border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--panel), rgba(9,13,19,0));
  backdrop-filter: blur(6px);
}
.obj-label {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .34em;
  text-transform: uppercase; color: var(--accent);
}
#obj-text { font-size: 15px; font-weight: 600; letter-spacing: .01em; text-shadow: 0 2px 8px #000; }
.obj-progress { height: 3px; margin-left: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.obj-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-solid), var(--accent-2)); transition: width .5s cubic-bezier(.4,0,.2,1); }

.waypoint-chip {
  margin-top: 8px; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-left: 3px solid var(--cyan);
  background: linear-gradient(90deg, var(--panel), rgba(9,13,19,0));
  backdrop-filter: blur(6px); font-size: 13px;
}
.wp-arrow { color: var(--cyan); display: inline-block; transition: transform .15s linear; }
#wp-label { font-weight: 600; }
#wp-dist { color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; }
#wp-clear {
  margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 2px 4px;
}
#wp-clear:hover { color: var(--pink); }

.stat-xp {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 8px;
  text-shadow: 0 2px 10px #000;
}
.stat-k { font-family: var(--f-mono); font-size: 10px; letter-spacing: .3em; color: var(--muted); }
.stat-v { font-family: var(--f-display); font-size: clamp(26px, 4.4vmin, 46px); line-height: 1; color: var(--accent); transform: skewX(-6deg); }
.stat-v.bump { animation: bump .45s cubic-bezier(.16,1,.3,1); }
@keyframes bump { 40% { transform: skewX(-6deg) scale(1.24); color: #fff; } }

.stat-row { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.stat.sm {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px; font-family: var(--f-mono); font-size: 11px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 2px;
  backdrop-filter: blur(6px);
}
.stat.sm .ic { color: var(--accent); }
.stat.sm.done { border-color: rgba(94,242,160,.55); color: var(--green); }
.stat.sm.done .ic { color: var(--green); }

.clock {
  display: inline-block; margin-top: 7px; padding: 3px 8px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em;
  color: #b9c6d6; background: var(--panel); border: 1px solid var(--line);
  border-radius: 2px; backdrop-filter: blur(6px);
}

/* radar */
.radar-wrap { position: relative; width: clamp(120px, 17vmin, 190px); aspect-ratio: 1; }
#radar {
  width: 100%; height: 100%; display: block;
  border-radius: 50%;
  box-shadow: 0 8px 34px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.06);
}
.radar-ring {
  position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255,255,255,.22);
  box-shadow: inset 0 0 24px rgba(0,0,0,.6);
}
.radar-n {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .2em; color: var(--accent);
  background: #0b1016; padding: 1px 5px; border-radius: 2px;
}

.speedo {
  padding: 8px 14px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(6px); text-align: center; min-width: 104px;
}
.speedo[hidden] { display: none; }
#speedo-v { font-family: var(--f-display); font-size: 34px; line-height: 1; color: var(--accent); transform: skewX(-6deg); display: inline-block; }
.speedo-u { font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); margin-left: 4px; }
.gear { margin-top: 3px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .2em; color: var(--muted); }
.gear b { color: var(--ink); }

/* prompt */
.prompt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 3px; backdrop-filter: blur(8px);
  font-size: 14px; letter-spacing: .02em; white-space: nowrap;
  animation: promptIn .22s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
.prompt[hidden] { display: none; }
.prompt kbd { background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
@keyframes promptIn { from { opacity: 0; transform: translateY(8px); } }

.cheats {
  font-family: var(--f-mono); font-size: 10.5px; line-height: 2;
  color: var(--muted); opacity: .82; text-shadow: 0 1px 6px #000;
  transition: opacity .5s;
}
.cheats.faded { opacity: .22; }
.cheats kbd { font-size: 9.5px; margin-right: 2px; }

/* toasts */
.toasts {
  position: absolute; left: 50%; top: 12vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(90vw, 560px);
}
.toast {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 16px; border-left: 3px solid var(--cyan);
  background: var(--panel); backdrop-filter: blur(8px);
  box-shadow: 0 14px 44px rgba(0,0,0,.6);
  animation: toastIn .38s cubic-bezier(.16,1,.3,1);
}
.toast.out { animation: toastOut .4s forwards; }
.toast .t-ic { font-size: 17px; color: var(--cyan); }
.toast b { display: block; font-size: 13.5px; }
.toast small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.toast.accent { border-left-color: var(--accent); } .toast.accent .t-ic { color: var(--accent); }
.toast.green { border-left-color: var(--green); } .toast.green .t-ic { color: var(--green); }
.toast.pink { border-left-color: var(--pink); } .toast.pink .t-ic { color: var(--pink); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-10px); height: 0; padding-block: 0; margin-top: -8px; } }

/* big banner */
.banner {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  text-align: center; text-shadow: 0 6px 26px rgba(0,0,0,.85);
  animation: bannerIn 3.4s cubic-bezier(.16,1,.3,1) forwards;
}
.banner[hidden] { display: none; }
#banner-sub {
  display: block; font-family: var(--f-mono); font-size: clamp(10px, 1.4vmin, 13px);
  letter-spacing: .46em; text-transform: uppercase; color: var(--accent);
}
#banner-main {
  display: block; margin-top: 6px; font-family: var(--f-display);
  font-size: clamp(34px, 7.4vmin, 92px); line-height: .95; text-transform: uppercase;
  transform: skewX(-7deg); color: #fff;
}
@keyframes bannerIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.96); letter-spacing: .2em; }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  76%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ═══════════════════════════════ OVERLAYS ═══════════════════════════════ */

.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 4vmin;
  background: rgba(4, 6, 10, .74);
  backdrop-filter: blur(14px) saturate(.7);
  animation: fadeIn .24s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.dossier-card, .pause-card, .map-card, .keys-card, .pack-card {
  width: min(920px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #121924, var(--panel-sol) 55%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  animation: cardIn .34s cubic-bezier(.16,1,.3,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.985); } }

.dossier-card header { padding: 26px 30px 18px; border-bottom: 1px solid var(--line); position: relative; }
.dossier-card header::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent);
}
.dossier-eyebrow {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
}
#dsr-kind { color: var(--accent); }
#dsr-date { color: var(--muted); }
#dsr-title {
  margin: 10px 0 4px; font-family: var(--f-display);
  font-size: clamp(28px, 4.6vmin, 52px); line-height: .98;
  text-transform: uppercase; transform: skewX(-6deg); transform-origin: left;
}
#dsr-sub { margin: 0; color: var(--cyan); font-size: 14px; font-weight: 600; letter-spacing: .04em; }

.dossier-body { padding: 22px 30px; overflow-y: auto; line-height: 1.72; font-size: 14.5px; color: #ccd6e3; }
.dossier-body h3 {
  margin: 22px 0 10px; font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--accent);
}
.dossier-body h3:first-child { margin-top: 0; }
.dossier-body ul { margin: 0; padding: 0; list-style: none; }
.dossier-body li { position: relative; padding-left: 22px; margin-bottom: 10px; }
.dossier-body li::before {
  content: "▸"; position: absolute; left: 2px; top: 0; color: var(--accent); font-size: 12px;
}
.dossier-body li b, .dossier-body p b { color: #fff; }
.dossier-body p { margin: 0 0 12px; }
.dossier-body a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(70,212,255,.35); }
.dossier-body a:hover { color: #fff; border-bottom-color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 4px 0 6px; }
.stat-cell { padding: 12px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.stat-cell b { display: block; font-family: var(--f-display); font-size: 28px; line-height: 1; color: var(--accent); transform: skewX(-6deg); }
.stat-cell span { display: block; margin-top: 5px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.dossier-card footer, .map-card footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 30px; border-top: 1px solid var(--line); background: rgba(0,0,0,.25);
}
.dossier-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em;
  background: rgba(70,212,255,.1); border: 1px solid rgba(70,212,255,.28); color: #a9e6ff; border-radius: 2px;
}

/* map */
.map-card { width: min(min(92vw, 92vh), 1000px); }
.map-card header { padding: 22px 28px 14px; }
.map-card h2 { margin: 0; font-family: var(--f-display); font-size: clamp(24px, 4vmin, 40px); text-transform: uppercase; transform: skewX(-6deg); transform-origin: left; }
.map-card header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.map-stage { padding: 0 28px; flex: 1; min-height: 0; display: grid; place-items: center; }
#map-canvas { width: 100%; height: auto; max-height: 58vh; aspect-ratio: 1; cursor: crosshair; border: 1px solid var(--line); }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 11.5px; color: var(--muted); }
.map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.map-selection {
  display: flex; align-items: center; gap: 10px; margin: 0 28px 14px;
  padding: 10px 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
#map-sel-name { font-weight: 700; margin-right: auto; font-size: 13.5px; }

/* ═══════════════════════════════ KEYBINDS ═══════════════════════════════ */

.keys-card { width: min(660px, 100%); }
.keys-card header { padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.keys-card h2 {
  margin: 0; font-family: var(--f-display); font-size: clamp(26px, 4.2vmin, 42px);
  text-transform: uppercase; transform: skewX(-6deg); transform-origin: left; color: var(--accent);
}
.keys-card header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.keys-body { padding: 8px 28px 18px; overflow-y: auto; }
.keys-group {
  margin-top: 18px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--accent);
}
.keys-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.keys-row span { font-size: 13.5px; color: #cdd7e3; }
.key-btn {
  min-width: 92px; padding: 6px 12px; cursor: pointer;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  transition: background .14s, border-color .14s, color .14s;
}
.key-btn:hover { background: rgba(255,75,62,.18); border-color: var(--accent); }
.key-btn.listening {
  background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}
.key-btn.custom { border-color: rgba(70,212,255,.55); color: #a9e6ff; }
.keys-card footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 15px 28px; border-top: 1px solid var(--line); background: rgba(0,0,0,.25);
}
.keys-actions { display: flex; gap: 8px; }
.keys-status { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.keys-status.warn { color: var(--pink); }
.keys-status.ok { color: var(--green); }

/* ═══════════════════════════════ BACKPACK ═══════════════════════════════ */

.pack-card { width: min(680px, 100%); }
.pack-card header { padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.pack-card h2 {
  margin: 0; font-family: var(--f-display); font-size: clamp(26px, 4.2vmin, 42px);
  text-transform: uppercase; transform: skewX(-6deg); transform-origin: left; color: var(--accent);
}
.pack-card header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.pack-body { padding: 8px 28px 20px; overflow-y: auto; }
.pack-body h3 {
  margin: 18px 0 10px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--accent);
}
.pack-total { color: var(--muted); font-size: 12px; letter-spacing: normal; text-transform: none; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 34vh; overflow-y: auto; }
.pack-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.pack-ic { font-size: 18px; color: var(--accent); width: 22px; text-align: center; flex-shrink: 0; }
.pack-item b { display: block; font-size: 13px; color: #fff; }
.pack-item small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.pack-empty { color: var(--muted); font-size: 13px; padding: 14px 0; }

.pack-skins { display: flex; flex-wrap: wrap; gap: 10px; }
.skin-swatch {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; cursor: pointer;
  font-family: var(--f-mono); font-size: 12px; color: #cdd7e3;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  transition: background .14s, border-color .14s, color .14s;
}
.skin-swatch:hover { background: rgba(255,75,62,.12); border-color: var(--accent); }
.skin-swatch.sel { border-color: var(--accent); color: #fff; background: rgba(255,75,62,.14); }
.skin-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--sw); border: 1px solid rgba(255,255,255,.35); flex-shrink: 0; }
.pack-card footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 15px 28px; border-top: 1px solid var(--line); background: rgba(0,0,0,.25);
}

/* pause */
.pause-card { width: min(460px, 100%); padding: 30px; gap: 20px; }
.pause-title { margin: 0; font-family: var(--f-display); font-size: clamp(36px, 6vmin, 62px); text-transform: uppercase; transform: skewX(-6deg); transform-origin: left; color: var(--accent); }
.pause-nav { display: grid; gap: 8px; }
.pause-settings { display: grid; gap: 11px; padding-top: 18px; border-top: 1px solid var(--line); }
.pause-settings label {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.pause-settings select, .pause-settings input[type=range] { accent-color: var(--accent); }
.pause-settings select {
  background: #0b1119; color: var(--ink); border: 1px solid var(--line); padding: 5px 8px; font-family: var(--f-mono); font-size: 11px;
}
.pause-settings input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.pause-credit { margin: 0; font-size: 11px; line-height: 1.7; color: #5d6b80; }

/* ═══════════════════════════════ PHONE ═══════════════════════════════ */

.phone {
  position: fixed; right: clamp(14px, 4vw, 60px); bottom: 0; z-index: 45;
  animation: phoneIn .38s cubic-bezier(.16,1,.3,1);
}
.phone[hidden] { display: none; }
@keyframes phoneIn { from { transform: translateY(70%) rotate(6deg); opacity: 0; } }

.phone-shell {
  position: relative; width: clamp(240px, 25vmin, 306px);
  padding: 11px 11px 0; border-radius: 34px 34px 0 0;
  background: linear-gradient(160deg, #2b3340, #10151c);
  box-shadow: 0 -18px 70px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.12); border-bottom: 0;
}
.phone-notch { width: 82px; height: 5px; margin: 0 auto 9px; border-radius: 99px; background: #05070a; }
.phone-screen {
  border-radius: 24px 24px 0 0; padding: 14px 15px 18px;
  background: radial-gradient(120% 90% at 50% 0%, #16324a, #080c12 70%);
  min-height: 380px;
}
.phone-status {
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 10px; color: #8ea3bb; letter-spacing: .1em;
}
.phone-head { display: flex; align-items: center; gap: 11px; margin: 16px 0 18px; }
.phone-avatar {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 14px; font-family: var(--f-display); font-size: 19px; letter-spacing: .04em;
  background: linear-gradient(150deg, var(--accent), var(--accent-solid)); color: var(--on-accent);
}
.phone-head b { display: block; font-size: 14px; }
.phone-head small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.phone-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 4px; border-radius: 15px; text-decoration: none; color: var(--ink);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09);
  transition: transform .16s, background .16s;
  cursor: pointer; font-family: inherit; font-size: inherit;
}
.app:hover { transform: translateY(-3px); background: rgba(255,255,255,.13); }
.app:focus-visible, .app.sel {
  outline: none;
  background: rgba(255,75,62,.16);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,75,62,.35), 0 6px 20px rgba(0,0,0,.5);
  transform: translateY(-3px);
}
.app.sel span { color: #ffc9a8; }
.app .app-ic { font-size: 21px; line-height: 1; }
.app span { font-size: 9.5px; letter-spacing: .06em; text-align: center; color: #c3cfdd; }
.app.copied { background: rgba(94,242,160,.18); border-color: rgba(94,242,160,.5); }
.phone-foot { margin: 16px 0 0; text-align: center; font-size: 10px; color: var(--muted); }

/* ═══════════════════════════════ SKILL WHEEL ═══════════════════════════════ */

.wheel {
  position: fixed; inset: 0; z-index: 42; display: grid; place-items: center;
  background: rgba(4,6,10,.55); backdrop-filter: blur(9px);
  animation: fadeIn .14s ease; pointer-events: none;
}
.wheel[hidden] { display: none; }
#wheel-svg { width: min(58vmin, 460px); height: min(58vmin, 460px); overflow: visible; }
.wheel-seg { cursor: pointer; transition: opacity .12s; }
.wheel-seg path { fill: rgba(12,18,26,.82); stroke: rgba(255,255,255,.14); stroke-width: 1; transition: fill .12s; }
.wheel-seg.on path { fill: rgba(255,75,62,.9); }
.wheel-seg text { fill: #cfdae8; font-family: var(--f-mono); font-size: 9px; letter-spacing: .12em; text-anchor: middle; pointer-events: none; text-transform: uppercase; }
.wheel-seg.on text { fill: #1a1305; font-weight: 700; }
/* Constrained to the hub so a long category can't spill over the segments. */
.wheel-center {
  position: absolute; text-align: center; pointer-events: none;
  display: grid; gap: 4px; width: min(21vmin, 158px);
}
#wheel-cat {
  font-family: var(--f-display); font-size: clamp(13px, 1.95vmin, 21px);
  line-height: 1.04; text-transform: uppercase; transform: skewX(-6deg); color: var(--accent);
  overflow-wrap: break-word;
}
#wheel-hint { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .2em; color: var(--muted); }
.wheel-list {
  position: absolute; bottom: 9vh; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
  width: min(84vw, 900px);
}
.wheel-list .tag { background: rgba(255,75,62,.1); border-color: rgba(255,75,62,.3); color: #ffc9a8; }

/* ═══════════════════════════════ TOUCH ═══════════════════════════════ */

.touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.touch[hidden] { display: none; }
.stick {
  position: absolute; left: 6vw; bottom: 12vh; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  pointer-events: auto; touch-action: none;
}
#stick-knob {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%; background: rgba(255,75,62,.55); border: 1px solid rgba(255,255,255,.4);
}
.touch-btns { position: absolute; right: 5vw; bottom: 11vh; display: grid; grid-template-columns: repeat(2, 62px); gap: 12px; }
.tbtn {
  width: 62px; height: 62px; border-radius: 50%; pointer-events: auto;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  color: var(--ink); font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em;
}
.tbtn:active { background: var(--accent-solid); color: var(--on-accent); }
.tbtn.big { background: rgba(255,75,62,.22); }
.tbtn.menu {
  position: absolute; left: 3vw; top: max(3vh, env(safe-area-inset-top, 0px) + 10px);
  width: 42px; height: 42px; border-radius: 8px; font-size: 18px; line-height: 1;
  display: grid; place-items: center;
}

/* ═══════════════════════════════ RESPONSIVE ═══════════════════════════════ */

@media (max-width: 900px), (max-height: 620px) {
  .hud-br { display: none; }
  .hud { font-size: 13px; }
  .dossier-card header, .dossier-body, .dossier-card footer { padding-inline: 20px; }
  .poster-grid { grid-template-columns: 1fr; grid-template-rows: repeat(4, 1fr); }
  .stat-row { flex-wrap: wrap; }
}

/* Phones: the thumbstick owns the bottom-left, so the radar moves to the top
   right, the stats tuck under it, and the context prompt lifts clear of both. */
@media (pointer: coarse), (max-width: 620px) {
  .hud-tl { max-width: calc(100% - 26vmin - var(--hud-pad) * 2); }
  #obj-text { font-size: 13.5px; }

  .hud-bl {
    top: var(--hud-pad); right: var(--hud-pad);
    bottom: auto; left: auto;
    flex-direction: column; align-items: flex-end; gap: 8px;
  }
  .radar-wrap { width: clamp(84px, 22vmin, 130px); }

  .hud-tr { top: calc(var(--hud-pad) + 22vmin + 14px); right: var(--hud-pad); }
  .stat-v { font-size: 24px; }
  .stat-row { max-width: 62vw; justify-content: flex-end; }
  .stat.sm { padding: 3px 6px; font-size: 10px; }
  .clock { display: none; }

  .hud-bc { bottom: calc(var(--hud-pad) + 28vh); }
  .prompt { font-size: 12.5px; padding: 7px 13px; }

  .speedo { min-width: 82px; padding: 6px 10px; }
  #speedo-v { font-size: 26px; }

  .toasts { top: auto; bottom: calc(var(--hud-pad) + 36vh); width: 92vw; }
  .cheats { display: none; }
  .wheel-list { bottom: 4vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Aircraft / boat instrument rows, sharing the speedo panel. */
.instr {
  display: flex; gap: 10px; margin-top: 4px;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--muted);
}
.instr[hidden] { display: none; }
.instr b { color: var(--ink); }
.instr-warn {
  margin-top: 4px; padding: 2px 6px; border-radius: 2px;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .22em;
  color: var(--on-accent); background: var(--accent-solid);
  animation: stallBlink .55s steps(2, end) infinite;
}
.instr-warn[hidden] { display: none; }
@keyframes stallBlink { 50% { opacity: .25; } }
