/* ============================================================
   NANDAN GROVER — RETRO WORLD
   Warm cream + coral editorial palette (convx-inspired)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --paper:    #f2ecdd;
  --paper2:   #e7dcc7;
  --paper3:   #d9cbb1;
  --ink:      #20180f;
  --ink2:     #6f6450;
  --coral:    #fb5230;
  --coral2:   #d83c1c;
  --amber:    #f3a52a;
  --blue:     #2f6fd6;
  --green:    #1aa067;
  --green2:   #0f7048;
  --screen:   #181410;   /* CRT dark */
  --phosphor: #f4ead5;   /* CRT light text */

  --pixel: 'Press Start 2P', monospace;
  --term:  'VT323', monospace;
  --serif: 'DM Serif Display', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #cdc2ab;
  overflow: hidden;
  font-family: var(--term);
  color: var(--ink);
  -webkit-font-smoothing: none;
}

#root { width: 100vw; height: 100vh; position: relative; }

img, .pix { image-rendering: pixelated; image-rendering: crisp-edges; }

/* subtle paper-grain + soft vignette over the whole experience */
.crt-overlay {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9000;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.035) 3px 4px);
  mix-blend-mode: multiply;
}
.crt-overlay::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(125% 120% at 50% 45%, transparent 60%, rgba(60,40,20,0.16) 100%);
}

/* ============================================================
   STAGE / LAPTOP BOOT
   ============================================================ */
.stage-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background:
    radial-gradient(120% 95% at 50% 12%, #efe6d3 0%, #ddcfb4 48%, #c9b794 100%);
}
.boot-hint-below {
  margin-top: 26px; font-family: var(--pixel); font-size: 9px; color: var(--ink2);
  letter-spacing: 2px; animation: blink 1s steps(1) infinite;
}

/* --- lived-in 1992 desk room backdrop --- */
.stage-wrap {
  background:
    radial-gradient(120% 95% at 50% 12%, #f0e1c0 0%, #d8c39a 55%, #bba27a 100%);
  overflow: hidden;
}
.room-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  /* faint wallpaper grid */
  background-image:
    linear-gradient(rgba(120,90,60,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,90,60,0.07) 1px, transparent 1px);
  background-size: 36px 36px;
}
.desk-surface {
  position: absolute; left: -2%; right: -2%; bottom: 0; height: 32%;
  background:
    repeating-linear-gradient(90deg,
      rgba(80,45,15,0.10) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg,
      rgba(80,45,15,0.06) 0 1px, transparent 1px 60px),
    linear-gradient(180deg, #a47c4c 0%, #855e34 60%, #6a4825 100%);
  border-top: 4px solid #4a2f17;
  box-shadow: inset 0 6px 0 rgba(255,220,170,0.18),
              inset 0 -20px 30px rgba(0,0,0,0.25);
}

/* shelf in upper left */
.wall-shelf {
  position: absolute; top: 8%; left: 5%; width: 220px; height: 80px;
  display: flex; align-items: flex-end; gap: 5px;
  padding: 0 8px 6px; border-bottom: 7px solid #6a4825;
  box-shadow: 0 7px 0 rgba(0,0,0,0.18);
}
.shelf-book { width: 14px; border: 2px solid rgba(0,0,0,0.35); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08); border-radius: 1px; }
.shelf-floppy {
  width: 28px; height: 30px; margin-left: 6px; background: #20180f;
  border: 2px solid #000; position: relative;
}
.shelf-floppy::before {
  content:''; position:absolute; top:4px; left:4px; right:4px; height:8px;
  background: #b6a684; border: 1px solid #000;
}
.shelf-floppy::after {
  content:''; position:absolute; bottom:4px; left:6px; right:6px; height:8px;
  background: #d9cbb1;
}

/* sticky notes */
.sticky-note {
  position: absolute; width: 84px; height: 84px; padding: 10px;
  transform: rotate(-6deg);
  box-shadow: 2px 4px 0 rgba(0,0,0,0.18), inset 0 -10px 14px rgba(0,0,0,0.05);
}
.sticky-note.note-yellow { top: 12%; right: 6%; background: #f3d967; transform: rotate(4deg); }
.sticky-note.note-pink   { top: 27%; right: 10%; background: #f49ab0; transform: rotate(-7deg); width: 70px; height: 70px; }
.sticky-line { height: 2px; background: rgba(0,0,0,0.35); margin-top: 8px; }
.sticky-line.short { width: 60%; }
.sticky-note::before {
  content:''; position:absolute; top:-3px; left:50%; transform:translateX(-50%);
  width: 28px; height: 8px; background: rgba(120,90,40,0.5);
}

/* desk plant */
.desk-plant {
  position: absolute; right: 5%; bottom: 26%; width: 110px; height: 130px;
  z-index: 1;
}
.plant-pot {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 64px; height: 38px;
  background: linear-gradient(180deg, #c0533a 0%, #8a3a26 100%);
  border: 2px solid #4a2f17;
  clip-path: polygon(8% 0, 92% 0, 84% 100%, 16% 100%);
}
.plant-leaf {
  position: absolute; bottom: 30px; left: 50%;
  width: 38px; height: 56px; background: #1aa067;
  border: 2px solid #0f6038;
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
}
.plant-leaf.l1 { transform: translateX(-50%) rotate(-22deg); }
.plant-leaf.l2 { transform: translateX(-50%) rotate(8deg); background: #25b277; bottom: 38px; }
.plant-leaf.l3 { transform: translateX(-50%) rotate(28deg); background: #1aa067; bottom: 30px; }

/* coffee mug */
.coffee-mug {
  position: absolute; bottom: 12%; left: 6%; width: 80px; height: 86px;
  z-index: 1;
}
.mug-body {
  position: absolute; bottom: 0; width: 56px; height: 50px;
  background: linear-gradient(180deg, #f2ecdd 0%, #d9cbb1 100%);
  border: 3px solid #20180f;
  border-radius: 3px 3px 6px 6px;
  box-shadow: inset 6px 0 0 rgba(0,0,0,0.06);
}
.mug-body::before {
  content:'<3'; position:absolute; top: 14px; left: 12px;
  font-family: var(--pixel); font-size: 10px; color: var(--coral);
}
.mug-handle {
  position: absolute; bottom: 10px; left: 52px;
  width: 18px; height: 26px; border: 3px solid #20180f;
  border-left: none; border-radius: 0 16px 16px 0;
}
.mug-steam {
  position: absolute; bottom: 52px; width: 5px; height: 18px;
  background: rgba(255,255,255,0.55); border-radius: 50%;
  animation: steam 2.2s ease-in-out infinite;
}
.mug-steam.s1 { left: 18px; }
.mug-steam.s2 { left: 32px; animation-delay: .7s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(0) scale(.9); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-22px) scale(1.4); }
}

/* --- chunky beige PC (CRT on tower) --- */
.laptop { position: relative; width: min(78vw, 720px); user-select: none; z-index: 2; }
.laptop-perspective { perspective: 1500px; position: relative; z-index: 2; }

/* MONITOR BEZEL */
.laptop-screen-frame {
  position: relative;
  background:
    radial-gradient(140% 90% at 50% 0%, #f5ecd6 0%, #e7d8b3 50%, #c8b283 100%);
  border: 4px solid #a8946a;
  border-radius: 22px 22px 10px 10px;
  padding: 30px 38px 16px;
  box-shadow:
    0 0 0 3px #8a7548,
    inset 0 3px 0 rgba(255,255,255,0.55),
    inset 0 -4px 0 rgba(80,55,25,0.25),
    inset 0 0 60px rgba(120,80,30,0.18),
    14px 18px 0 rgba(80,55,25,0.25),
    0 30px 60px rgba(40,25,10,0.45);
  transform-origin: bottom center;
  transition: transform 1.05s cubic-bezier(.22,1,.36,1);
}
.laptop.lid-shut .laptop-screen-frame { transform: rotateX(-86deg); }
.laptop.lid-open .laptop-screen-frame { transform: rotateX(0deg); }

/* top vent grille on bezel */
.bezel-vents {
  position: absolute; left: 38px; right: 38px;
  display: flex; gap: 4px; justify-content: space-between;
}
.bezel-vents-top { top: 10px; }
.bezel-vents span {
  flex: 1; height: 4px;
  background: linear-gradient(180deg, rgba(80,55,25,0.55), rgba(80,55,25,0.25));
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.4);
}

/* CRT SCREEN — recessed inner frame */
.laptop-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 120% at 50% 38%, #221c15 0%, var(--screen) 72%);
  border-radius: 38px / 28px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 4px #0e0b08,
    inset 0 0 0 10px #2a221a,
    inset 0 0 0 14px #6e5d3c,
    inset 0 0 60px rgba(0,0,0,0.85),
    0 4px 0 rgba(255,255,255,0.35),
    0 -4px 0 rgba(0,0,0,0.4);
}
.crt-curve {
  pointer-events: none; position: absolute; inset: 12px; z-index: 4;
  border-radius: 30px / 22px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.55);
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(255,255,255,0.06), transparent 60%);
}
.crt-vignette {
  pointer-events: none; position: absolute; inset: 0; z-index: 6;
  background: radial-gradient(130% 110% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
  border-radius: 30px / 22px;
}
.crt-bloom {
  pointer-events: none; position: absolute; inset: 0; z-index: 7;
  background: radial-gradient(60% 40% at 50% 45%, rgba(244,234,213,0.06), transparent 70%);
  mix-blend-mode: screen; opacity: 0;
  transition: opacity .8s ease;
}
.laptop.is-on .crt-bloom { opacity: 1; }

.screen-glow {
  pointer-events: none; position: absolute; inset: 0; z-index: 5;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.18) 3px 4px);
  mix-blend-mode: multiply;
  animation: scanbeat 6s linear infinite;
}
@keyframes scanbeat {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: 0.85; }
  52% { opacity: 1; }
}
.screen-flicker { animation: flick .7s steps(2) 1; }
@keyframes flick {
  0%{opacity:.15;} 12%{opacity:1;} 18%{opacity:.4;}
  28%{opacity:1;} 38%{opacity:.7;} 50%{opacity:1;}
  100%{opacity:1;}
}

/* LOWER BEZEL: badge + LED + chunky power */
.bezel-lower {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.brand-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px;
  background: linear-gradient(180deg, #efe2c0, #d3bf90);
  border: 2px solid #6f5a2e;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 1px 1px 0 rgba(80,55,25,0.35);
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  background: var(--coral); color: var(--paper);
  font-family: var(--pixel); font-size: 9px;
  border: 1.5px solid #20180f;
  box-shadow: 1px 1px 0 #20180f;
}
.brand-name {
  font-family: var(--pixel); font-size: 9px; color: #3a2a14; letter-spacing: 1.5px;
}
.brand-name b { color: var(--coral2); }

.bezel-controls {
  display: flex; align-items: center; gap: 10px;
}
.knob {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #efe2c0, #8a7548 80%);
  border: 1.5px solid #5a4828;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), 1px 1px 0 rgba(0,0,0,0.2);
  position: relative;
}
.knob::after {
  content:''; position:absolute; top: 1px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 5px; background: #20180f;
}
.power-led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #5a2a18;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.7);
  transition: background .25s ease;
}
.power-led.on {
  background: #28e07a;
  box-shadow: 0 0 8px #28e07a, 0 0 14px rgba(40,224,122,0.55);
  animation: ledpulse 1.6s ease-in-out infinite;
}
@keyframes ledpulse {
  0%,100% { box-shadow: 0 0 6px #28e07a, 0 0 12px rgba(40,224,122,0.45); }
  50%     { box-shadow: 0 0 10px #28e07a, 0 0 18px rgba(40,224,122,0.7); }
}
.chunky-power {
  cursor: pointer;
  width: 38px; height: 22px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #f0e2bd 0%, #b89c66 100%);
  border: 2px solid #6f5a2e;
  border-radius: 3px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.55),
    inset 0 -3px 0 rgba(80,55,25,0.5),
    2px 2px 0 rgba(40,25,10,0.4);
  font-family: var(--pixel); font-size: 8px; color: #3a2a14; letter-spacing: 1px;
  user-select: none;
}
.chunky-power:active {
  transform: translate(1px,1px);
  box-shadow: inset 0 2px 0 rgba(80,55,25,0.3), 0 0 0 rgba(0,0,0,0);
}

/* HINGE: short neck connecting monitor to case */
.laptop-hinge {
  height: 14px; width: 28%; margin: -3px auto 0;
  background: linear-gradient(180deg, #b6a684 0%, #8a7548 100%);
  border-left: 3px solid rgba(80,55,25,0.4);
  border-right: 3px solid rgba(80,55,25,0.4);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

/* CASE/TOWER BASE */
.laptop-base {
  height: 58px; width: 108%; margin: 0 auto; margin-left: -4%;
  background:
    linear-gradient(180deg, #efe2c0 0%, #d3bf90 45%, #a8946a 100%);
  border-radius: 6px 6px 14px 14px;
  border: 3px solid #8a7548;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.5),
    inset 0 -4px 0 rgba(80,55,25,0.35),
    14px 18px 0 rgba(80,55,25,0.25),
    0 22px 36px rgba(40,25,10,0.4);
  position: relative;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 18px;
}
.laptop-base::before {
  /* badge area: a tiny brand strip */
  content:''; position:absolute; left: 50%; top: -3px; transform: translateX(-50%);
  width: 80px; height: 6px;
  background: #6f5a2e; border-radius: 0 0 6px 6px;
}
.case-vents {
  display: flex; flex-direction: column; gap: 3px;
  width: 80px;
}
.case-vents span {
  height: 3px; width: 100%;
  background: linear-gradient(180deg, rgba(80,55,25,0.55), rgba(80,55,25,0.25));
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.45);
}
.floppy-drive {
  position: relative;
  flex: 0 0 auto;
  width: 180px; height: 26px;
  background: linear-gradient(180deg, #2a2218 0%, #1a140d 100%);
  border: 2px solid #5a4828;
  border-radius: 2px;
  display: flex; align-items: center;
  padding: 0 8px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.floppy-slot {
  flex: 1; height: 4px;
  background: #0a0805;
  border-radius: 1px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9);
}
.floppy-eject {
  width: 18px; height: 8px; margin-left: 10px;
  background: linear-gradient(180deg, #d3bf90, #8a7548);
  border: 1px solid #3a2a14;
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.floppy-led {
  width: 6px; height: 6px; margin-left: 6px; border-radius: 50%;
  background: #5a2a18;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.7);
}
.laptop.is-on .floppy-led {
  background: #f3a52a;
  box-shadow: 0 0 6px #f3a52a;
  animation: flicker-led 2.8s steps(2) infinite;
}
@keyframes flicker-led {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.2; }
  96% { opacity: 1; }
}
.case-label {
  font-family: var(--pixel); font-size: 7px; color: #3a2a14;
  letter-spacing: 1px; opacity: 0.7;
}

/* power button on the (off) screen */
.power-hint {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; cursor: pointer;
}
.power-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid var(--coral);
  display: grid; place-items: center; color: var(--coral);
  box-shadow: 0 0 18px rgba(251,82,48,0.45), inset 0 0 14px rgba(251,82,48,0.15);
  animation: pulse 1.6s ease-in-out infinite;
  background: rgba(24,20,16,0.5);
}
.power-btn svg { width: 30px; height: 30px; }
.power-label { font-family: var(--pixel); font-size: 11px; color: var(--phosphor); letter-spacing: 1px; }
@keyframes pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 18px rgba(251,82,48,0.4), inset 0 0 14px rgba(251,82,48,0.15); }
  50%     { transform: scale(1.06); box-shadow: 0 0 30px rgba(251,82,48,0.75), inset 0 0 18px rgba(251,82,48,0.25); }
}

/* --- BIOS boot text --- */
.bios {
  position: absolute; inset: 0; padding: 6% 7%; z-index: 8;
  font-family: var(--term); font-size: clamp(14px, 2.1vw, 22px); line-height: 1.25;
  color: var(--phosphor); text-shadow: 0 0 6px rgba(244,234,213,0.45); overflow: hidden;
}
.bios .dim { color: #b7a888; }
.bios .cream { color: var(--coral); text-shadow: 0 0 8px rgba(251,82,48,0.55); }
.bios .cursor {
  display: inline-block; width: 0.6em; height: 1em; background: var(--coral);
  margin-left: 2px; transform: translateY(2px); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.boot-bar-wrap { margin-top: 14px; }
.boot-bar { height: 18px; border: 2px solid #b7a888; padding: 2px; width: 80%; }
.boot-bar > i { display: block; height: 100%; background: var(--coral); box-shadow: 0 0 10px rgba(251,82,48,0.6); }

/* PRESS START */
.press-start {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px; cursor: pointer;
  background: radial-gradient(120% 120% at 50% 38%, #221c15 0%, var(--screen) 72%);
}
.title-pixel { text-align: center; line-height: 1.4; }
.title-pixel .big {
  font-family: var(--serif); font-style: italic; font-size: clamp(28px, 6.4vw, 58px);
  color: var(--phosphor); display:block; letter-spacing: 1px;
  text-shadow: 0 0 14px rgba(244,234,213,0.35);
}
.title-pixel .sub {
  font-family: var(--pixel); font-size: clamp(8px, 1.5vw, 12px);
  color: var(--coral); display:block; margin-top: 16px; letter-spacing: 2px;
}
.start-flash {
  font-family: var(--pixel); font-size: clamp(11px, 2vw, 17px);
  color: var(--amber); animation: blink 1.1s steps(1) infinite; text-shadow: 3px 3px 0 #000;
}

/* ============================================================
   GAME WORLD
   ============================================================ */
.game { position: absolute; inset: 0; overflow: hidden; }
.layer { position: absolute; top: 0; bottom: 0; left: 0; will-change: transform; }
.sky { position: absolute; inset: 0; }

/* clouds (replace stars) */
.cloud { position: absolute; }
.cloud .cb { position: absolute; background: var(--paper); border-radius: 2px; box-shadow: 0 3px 0 rgba(120,90,50,0.10); }

.hill { position: absolute; bottom: 120px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }

.ground { position: absolute; bottom: 0; left: 0; height: 130px; border-top: 5px solid rgba(80,55,25,0.18); }
.ground-top { position: absolute; top: 0; left: 0; height: 16px; width: 100%; }

/* character avatar */
.avatar-token { position: absolute; inset: 0; z-index: 50; }
.avatar-token img { width: 100%; height: 100%; display: block; }
.avatar-token.flip img { transform: scaleX(-1); }
.avatar-shadow {
  position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%);
  width: 58px; height: 13px; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(60,40,20,0.30), transparent 72%);
}
.avatar-bob { position: absolute; inset: 0; }
.avatar-token.walking .avatar-bob { animation: bob-walk .26s steps(2) infinite; }
@keyframes bob-walk { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }

/* station structures */
.station { position: absolute; bottom: 130px; display: flex; flex-direction: column; align-items: center; }
.station-sign {
  font-family: var(--pixel); font-size: 10px; color: var(--paper);
  background: var(--coral); padding: 7px 10px; border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); white-space: nowrap;
}
.station-post { width: 8px; background: var(--ink); }
.year-tag { font-family: var(--pixel); font-size: 9px; color: var(--ink2); margin-bottom: 6px; letter-spacing: 1px; }

/* interaction prompt */
.prompt {
  position: absolute; z-index: 60; font-family: var(--pixel); font-size: 10px; color: var(--ink);
  background: var(--amber); padding: 6px 9px; border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap; animation: bob2 .9s ease-in-out infinite;
}
@keyframes bob2 { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
.prompt::after {
  content:''; position:absolute; left:50%; bottom:-9px; transform:translateX(-50%);
  border:6px solid transparent; border-top-color: var(--amber);
}

/* ============================================================
   HUD
   ============================================================ */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 200; }
.hud-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hud-name { font-family: var(--pixel); font-size: 12px; color: var(--ink); line-height: 1.5; }
.hud-name small { display:block; font-size: 8px; color: var(--coral2); margin-top: 6px; }

.chapter-track { display: flex; align-items: center; gap: 6px; background: rgba(242,236,221,0.82); border: 2px solid var(--paper3); padding: 8px 10px; }
.chip { width: 12px; height: 12px; background: var(--paper3); border: 2px solid var(--ink); }
.chip.done   { background: var(--coral); }
.chip.active { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.hud-btns { display: flex; gap: 8px; pointer-events: auto; }
.icon-btn {
  font-family: var(--pixel); font-size: 9px; color: var(--ink);
  background: rgba(242,236,221,0.9); border: 2px solid var(--paper3); padding: 9px 10px; cursor: pointer; line-height: 1;
}
.icon-btn:hover { border-color: var(--coral); color: var(--coral); }

.controls-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-family: var(--pixel); font-size: 9px; color: var(--ink2); text-align: center;
  background: rgba(242,236,221,0.7); padding: 7px 12px; border: 2px solid var(--paper3);
}

/* mobile dpad */
.dpad { position: absolute; bottom: 18px; z-index: 210; pointer-events: auto; display: none; gap: 10px; }
.dpad.left { left: 18px; }
.dpad.right { right: 18px; }
.dbtn {
  width: 62px; height: 62px; border: 3px solid var(--ink); background: rgba(242,236,221,0.9); color: var(--ink);
  font-family: var(--pixel); font-size: 16px; display: grid; place-items: center; user-select: none; touch-action: none;
}
.dbtn:active { background: var(--coral); border-color: var(--coral2); color: var(--paper); }
.dbtn.action { width: 78px; border-radius: 50%; font-size: 9px; }
body.touch .dpad { display: flex; }
body.touch .controls-hint { display: none; }

/* ============================================================
   DIALOGUE BOX
   ============================================================ */
.dialogue-wrap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 300; display: flex; justify-content: center; padding: 0 16px 18px; pointer-events: none; }
.dialogue {
  pointer-events: auto; width: min(900px, 94vw);
  background: var(--paper); border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px var(--paper), 6px 6px 0 var(--ink), 0 -10px 40px rgba(80,55,25,0.18);
  padding: 18px 22px 16px; position: relative;
}
.dlg-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; border-bottom: 2px solid var(--paper3); padding-bottom: 10px; margin-bottom: 12px; }
.dlg-role { font-family: var(--pixel); font-size: 12px; color: var(--coral2); }
.dlg-org  { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--ink); line-height: 1; }
.dlg-period { font-family: var(--pixel); font-size: 9px; color: var(--ink2); margin-left: auto; }
.dlg-body { font-family: var(--term); font-size: clamp(21px, 2.4vw, 28px); line-height: 1.18; color: var(--ink); min-height: 96px; }
.dlg-body .hl   { color: var(--coral2); }
.dlg-body .gold { color: var(--green2); font-weight: 400; }
.dlg-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.page-dots { display: flex; gap: 6px; }
.pdot { width: 9px; height: 9px; background: var(--paper3); border: 2px solid var(--ink); }
.pdot.on { background: var(--coral); }
.adv { font-family: var(--pixel); font-size: 9px; color: var(--coral2); animation: blink 1s steps(1) infinite; cursor: pointer; }

/* achievement banner */
.achv {
  position: absolute; top: 84px; left: 50%; transform: translateX(-50%); z-index: 320; text-align: center;
  background: var(--paper); border: 4px solid var(--amber);
  box-shadow: 0 0 0 4px var(--paper), 6px 6px 0 var(--coral2); padding: 16px 28px;
}
.achv .label { font-family: var(--pixel); font-size: 10px; color: var(--coral2); letter-spacing: 2px; }
.achv .txt   { font-family: var(--pixel); font-size: 13px; color: var(--ink); margin-top: 12px; line-height: 1.5; }
.achv .star  { font-size: 28px; }

/* ============================================================
   END / CONTACT BOARD
   ============================================================ */
.endboard { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 0; z-index: 45; }
.endboard .arcade {
  background: var(--paper); border: 4px solid var(--coral);
  box-shadow: 0 0 0 4px var(--paper), 6px 6px 0 var(--ink); padding: 20px 26px; text-align: center; position: relative; z-index: 2;
}
.endboard .arcade h3 { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--coral2); margin-bottom: 16px; }
.endboard .links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: stretch; }
.endboard a {
  font-family: var(--pixel); font-size: 10px; color: var(--ink); text-decoration: none;
  border: 2px solid var(--paper3); padding: 10px 14px; display: flex; justify-content: space-between; gap: 18px; min-width: 250px; pointer-events: auto;
}
.endboard a:hover { border-color: var(--coral); color: var(--coral2); background: rgba(251,82,48,0.06); }
.endboard a .k { color: var(--ink2); }
.endboard a:hover .k { color: var(--coral2); }
.board-post { position: absolute; top: 100%; width: 11px; height: 96px; background: var(--ink); z-index: 1; }

/* Mario-style flagpole (finish line) */
.flagpole { position: absolute; width: 8px; height: 230px; background: var(--ink); z-index: 41; }
.flagpole .flag-ball { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(243,165,42,0.5); }
.flagpole .flag-tri {
  position: absolute; top: 8px; left: 8px; width: 0; height: 0;
  border-top: 22px solid var(--coral); border-bottom: 22px solid var(--coral); border-right: 40px solid transparent;
  transform: scaleX(-1); transform-origin: left;
}

/* company logo billboard at a station */
.logo-card {
  border: 3px solid var(--ink); border-radius: 4px; padding: 8px 12px;
  box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: center; min-height: 30px;
}
.logo-word { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1; white-space: nowrap; }

.fade-enter { opacity: 1; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }
