:root {
  /* Typography compliance tokens from DESIGN.md: IBM Plex Sans** readable quest notes Interface and dialogue: **Press Start 2P** short HUD readouts */
  --midnight: #2A0612;
  --wine: #5B1025;
  --rose: #8F1D3F;
  --pink: #FF2F7D;
  --cyan: #42F5D7;
  --gold: #FFD166;
  --cream: #F8E7C9;
  --bezel: #101626;
  --display: "Bebas Neue", Impact, sans-serif;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --body: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--midnight); color: var(--cream); overflow: hidden; }

body { font-family: var(--body); }

.arcade {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 720px;
  padding: 118px 48px 170px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,47,125,.22), transparent 34%),
    linear-gradient(135deg, rgba(66,245,215,.08) 0 2px, transparent 2px 38px),
    linear-gradient(45deg, rgba(255,209,102,.05) 0 2px, transparent 2px 42px),
    var(--midnight);
  border: 18px solid var(--bezel);
  box-shadow: inset 0 0 0 6px var(--rose), inset 0 0 48px rgba(0,0,0,.9), 0 0 60px rgba(255,47,125,.28);
  isolation: isolate;
}

.scanlines, .bezel-corners { position: absolute; inset: 0; pointer-events: none; z-index: 15; }
.scanlines { background: repeating-linear-gradient(to bottom, rgba(248,231,201,.06) 0 1px, transparent 1px 5px); mix-blend-mode: screen; opacity: .38; }
.bezel-corners { box-shadow: inset 28px 28px 0 rgba(16,22,38,.8), inset -28px -28px 0 rgba(16,22,38,.8); }

.hud { position: absolute; left: 42px; right: 42px; z-index: 20; display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; }
.hud-top { top: 34px; }
.hud-label { display: block; font-family: var(--pixel); font-size: 10px; color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; text-shadow: 0 0 12px var(--cyan); }

h1, h2 { font-family: var(--display); margin: 0; text-transform: uppercase; line-height: .86; letter-spacing: .025em; }
h1 { font-size: clamp(58px, 10vw, 132px); color: var(--cream); text-shadow: 4px 0 0 var(--pink), -4px 0 0 var(--cyan), 0 0 34px var(--pink); }
h2 { font-size: clamp(56px, 9vw, 118px); color: var(--cream); text-shadow: 5px 5px 0 var(--rose), 0 0 30px rgba(255,47,125,.7); }

.signal-meter { width: min(360px, 28vw); padding: 14px; background: rgba(91,16,37,.85); border: 4px solid var(--rose); box-shadow: 0 0 0 4px var(--bezel), 0 0 24px rgba(66,245,215,.28); }
.meter-track { height: 18px; margin: 10px 0; background: var(--bezel); border: 2px solid var(--cream); box-shadow: inset 0 0 10px rgba(0,0,0,.8); }
.meter-track span { display: block; width: 22%; height: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan), var(--gold)); transition: width .65s steps(6, end); box-shadow: 0 0 16px var(--cyan); }
.signal-meter strong { font-family: var(--pixel); color: var(--gold); font-size: 11px; line-height: 1.7; }

.wave { position: absolute; left: 28px; right: 28px; height: 90px; z-index: 11; pointer-events: none; filter: drop-shadow(0 0 10px var(--cyan)); }
.wave path { fill: none; stroke: var(--cyan); stroke-width: 5; stroke-linecap: square; stroke-dasharray: 24 16; animation: waveMarch 2.6s steps(14) infinite; }
.wave-top { top: 108px; }
.wave-bottom { bottom: 122px; transform: scaleY(-1); }
.wave-bottom path { stroke: var(--pink); filter: drop-shadow(0 0 8px var(--pink)); }

.world { position: relative; height: 100%; border: 6px solid var(--rose); background: linear-gradient(180deg, rgba(16,22,38,.78), rgba(91,16,37,.82)); box-shadow: inset 0 0 0 6px rgba(42,6,18,.75), inset 0 0 70px rgba(0,0,0,.7), 0 0 35px rgba(255,47,125,.25); overflow: hidden; }
.world::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(66,245,215,.13), transparent 20%), radial-gradient(circle at 78% 55%, rgba(255,209,102,.12), transparent 18%); image-rendering: pixelated; }

.scene { position: absolute; inset: 0; padding: min(7vh, 68px) min(6vw, 82px); opacity: 0; transform: translateX(70px) scale(.98); transition: opacity .45s steps(5), transform .45s steps(5); pointer-events: none; }
.scene.active { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.scene-title { position: relative; z-index: 4; }
.scene-title small { font-family: var(--pixel); color: var(--gold); font-size: 12px; text-shadow: 0 0 12px var(--gold); }
.scene-note { position: absolute; z-index: 5; right: 56px; top: 56px; max-width: 330px; margin: 0; padding: 18px; background: rgba(42,6,18,.82); border: 4px solid var(--rose); font-size: 18px; line-height: 1.35; box-shadow: 8px 8px 0 var(--bezel), 0 0 18px rgba(255,47,125,.35); }

.pixel-map { position: absolute; inset: 140px 60px 44px; background: linear-gradient(transparent 0 22px, rgba(248,231,201,.06) 22px 24px), linear-gradient(90deg, transparent 0 22px, rgba(248,231,201,.06) 22px 24px), rgba(91,16,37,.35); background-size: 24px 24px; border: 4px solid rgba(248,231,201,.45); box-shadow: inset 0 0 50px rgba(0,0,0,.55); }

.skyline { position: absolute; left: 10%; right: 10%; bottom: 18%; display: flex; gap: 18px; opacity: .36; }
.skyline span { flex: 1; height: 120px; background: var(--bezel); border-top: 6px solid var(--cyan); box-shadow: 0 0 18px rgba(66,245,215,.3); }
.skyline span:nth-child(2) { height: 180px; } .skyline span:nth-child(3) { height: 95px; } .skyline span:nth-child(4) { height: 145px; }

.neon-sign { position: absolute; left: 42%; top: 16%; padding: 12px 20px; font-family: var(--pixel); font-size: 15px; color: var(--cyan); border: 4px solid var(--cyan); background: var(--bezel); box-shadow: 0 0 22px var(--cyan); animation: flicker 1.8s steps(2) infinite; }
.sprite, .bubble, .token, .mushroom, .podium, .debate-ghost { position: absolute; image-rendering: pixelated; }
.ballot { width: 72px; height: 62px; background: var(--cream); border: 5px solid var(--bezel); box-shadow: 0 0 16px var(--gold); animation: bob 1.4s steps(3) infinite; }
.ballot::before { content: ""; position: absolute; left: 16px; top: -18px; width: 38px; height: 10px; background: var(--pink); }
.ballot i, .ballot em { position: absolute; top: 22px; width: 8px; height: 8px; background: var(--bezel); animation: blink 2s steps(2) infinite; }
.ballot i { left: 20px; } .ballot em { right: 20px; }
.b1 { left: 28%; top: 48%; } .b2 { left: 56%; top: 52%; animation-delay: .4s; }
.citizen { width: 22px; height: 32px; color: var(--gold); text-shadow: 0 0 12px var(--gold); font-size: 28px; animation: bob 1.7s steps(2) infinite; }
.c1 { left: 22%; top: 66%; } .c2 { left: 50%; top: 68%; animation-delay: .2s; } .c3 { left: 68%; top: 63%; animation-delay: .5s; }
.token-alert { right: 20%; top: 35%; width: 54px; height: 54px; display: grid; place-items: center; font-family: var(--pixel); color: var(--gold); border: 4px solid var(--pink); border-radius: 0; box-shadow: 0 0 0 0 rgba(255,47,125,.8); animation: pulse 1.2s steps(5) infinite; }
.tile-path { position: absolute; left: 18%; right: 18%; bottom: 16%; height: 32px; background: repeating-linear-gradient(90deg, var(--rose) 0 36px, var(--gold) 36px 42px); box-shadow: 0 0 18px rgba(255,209,102,.35); }

.mushroom { width: 52px; height: 66px; background: var(--cream); border: 4px solid var(--bezel); bottom: 24%; }
.mushroom::before { content: ""; position: absolute; left: -16px; top: -26px; width: 84px; height: 40px; background: var(--pink); border: 4px solid var(--bezel); border-radius: 22px 22px 0 0; box-shadow: 0 0 18px var(--pink); }
.m1 { left: 18%; } .m2 { left: 45%; bottom: 38%; } .m3 { left: 72%; }
.bubble { min-width: 54px; padding: 14px; background: var(--cream); color: var(--bezel); border: 4px solid var(--bezel); font-family: var(--pixel); font-size: 12px; animation: jitter .7s steps(2) infinite; }
.n1 { left: 25%; top: 23%; } .n2 { left: 55%; top: 30%; animation-delay: .2s; } .n3 { left: 70%; top: 18%; animation-delay: .4s; }
.noise-wave, .meeting-waves { position: absolute; inset: 18% 9%; width: 82%; height: 60%; overflow: visible; }
.noise-wave path { fill: none; stroke: var(--pink); stroke-width: 7; stroke-linejoin: miter; filter: drop-shadow(0 0 12px var(--pink)); stroke-dasharray: 38 18; animation: waveMarch 1.4s steps(8) infinite; }

.bridge { position: absolute; left: 18%; right: 18%; top: 55%; height: 42px; background: repeating-linear-gradient(90deg, var(--gold) 0 36px, var(--rose) 36px 42px); box-shadow: 0 0 20px var(--gold); }
.podium { bottom: 22%; width: 80px; height: 110px; background: var(--wine); border: 5px solid var(--cream); box-shadow: 0 0 20px rgba(248,231,201,.35); }
.podium.left { left: 16%; } .podium.right { right: 16%; }
.meeting-waves path { fill: none; stroke-width: 9; stroke-linecap: square; stroke-dasharray: 580; stroke-dashoffset: 580; animation: drawWave 3s steps(18) infinite alternate; }
.pink-stream { stroke: var(--pink); filter: drop-shadow(0 0 14px var(--pink)); }
.cyan-stream { stroke: var(--cyan); filter: drop-shadow(0 0 14px var(--cyan)); }
.debate-ghost { width: 50px; height: 62px; top: 28%; background: var(--cream); border-radius: 24px 24px 6px 6px; box-shadow: 0 0 18px var(--cyan); animation: bob 1.3s steps(3) infinite; opacity: .85; }
.debate-ghost::before { content: "••"; position: absolute; left: 12px; top: 18px; color: var(--bezel); letter-spacing: 6px; }
.g1 { left: 34%; } .g2 { right: 34%; animation-delay: .25s; box-shadow: 0 0 18px var(--pink); }

.bench { position: absolute; left: 20%; right: 20%; bottom: 22%; height: 82px; background: var(--bezel); border: 5px solid var(--rose); box-shadow: 0 0 22px rgba(255,47,125,.25); }
.part { position: absolute; top: 26%; padding: 16px 18px; font-family: var(--pixel); font-size: 10px; color: var(--cream); background: var(--rose); border: 4px solid var(--cream); box-shadow: 8px 8px 0 var(--bezel), 0 0 18px rgba(255,209,102,.25); cursor: pointer; transition: transform .2s steps(2), box-shadow .2s steps(2); }
.part:hover, .part.active { transform: translateY(-10px); box-shadow: 8px 18px 0 var(--bezel), 0 0 24px var(--gold); color: var(--gold); }
.p1 { left: 18%; } .p2 { left: 43%; } .p3 { right: 18%; }
.assembly-core { position: absolute; left: 50%; top: 55%; width: 114px; height: 114px; margin-left: -57px; border: 6px solid var(--cyan); background: rgba(66,245,215,.12); box-shadow: 0 0 26px var(--cyan); animation: pulse 1.8s steps(5) infinite; }
.assembly-core span { position: absolute; inset: 26px; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.spark { position: absolute; width: 10px; height: 10px; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: spark 1.2s steps(4) infinite; }
.s1 { left: 35%; top: 56%; } .s2 { left: 58%; top: 40%; animation-delay: .3s; } .s3 { left: 64%; top: 68%; animation-delay: .6s; }

.tower { position: absolute; left: 50%; bottom: 18%; width: 120px; height: 300px; margin-left: -60px; background: repeating-linear-gradient(135deg, var(--bezel) 0 20px, var(--rose) 20px 28px); border: 5px solid var(--cream); box-shadow: 0 0 24px rgba(248,231,201,.35); }
.tower span { position: absolute; left: -36px; right: -36px; height: 10px; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.tower span:nth-child(1) { top: 60px; } .tower span:nth-child(2) { top: 145px; } .tower span:nth-child(3) { top: 230px; }
.beacon { position: absolute; left: 50%; top: 15%; width: 78px; height: 78px; margin-left: -39px; background: var(--pink); border: 6px solid var(--gold); box-shadow: 0 0 38px var(--pink), 0 0 80px var(--cyan); animation: flicker 1.1s steps(2) infinite; }
.pulse-ring { position: absolute; left: 50%; top: 15%; width: 80px; height: 80px; margin: -1px 0 0 -40px; border: 5px solid var(--cyan); opacity: 0; animation: towerPulse 2.4s steps(8) infinite; }
.r2 { animation-delay: .7s; border-color: var(--pink); } .r3 { animation-delay: 1.4s; border-color: var(--gold); }
.constellation i { position: absolute; width: 12px; height: 12px; background: var(--gold); box-shadow: 0 0 14px var(--gold); animation: blink 1.6s steps(2) infinite; }
.constellation i:nth-child(1) { left: 18%; top: 22%; } .constellation i:nth-child(2) { left: 30%; top: 12%; animation-delay: .3s; } .constellation i:nth-child(3) { right: 24%; top: 25%; animation-delay: .5s; } .constellation i:nth-child(4) { right: 16%; top: 12%; animation-delay: .8s; } .constellation i:nth-child(5) { left: 64%; top: 8%; animation-delay: 1s; }

.scene-rail { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); z-index: 25; display: flex; gap: 18px; padding: 12px 18px; background: rgba(16,22,38,.9); border: 4px solid var(--rose); box-shadow: 0 0 18px rgba(255,47,125,.35); }
.rail-dot { position: relative; width: 28px; height: 28px; background: var(--wine); border: 4px solid var(--rose); cursor: pointer; box-shadow: inset 0 0 0 4px var(--bezel); }
.rail-dot.active { background: var(--cyan); border-color: var(--cream); box-shadow: 0 0 18px var(--cyan); }
.rail-dot span { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); font-family: var(--pixel); font-size: 8px; color: var(--cream); opacity: 0; transition: opacity .2s steps(2); }
.rail-dot:hover span, .rail-dot.active span { opacity: 1; }

.dialogue-panel, .inventory-panel { position: absolute; z-index: 24; bottom: 30px; background: rgba(91,16,37,.92); border: 5px solid var(--rose); box-shadow: 8px 8px 0 var(--bezel), 0 0 22px rgba(255,47,125,.25); }
.dialogue-panel { left: 42px; width: min(720px, 56vw); min-height: 108px; display: grid; grid-template-columns: 88px 1fr; gap: 18px; padding: 18px; }
.dialogue-panel p { margin: 8px 0 0; font-family: var(--pixel); font-size: clamp(10px, 1vw, 14px); line-height: 1.85; color: var(--cream); }
.portrait { width: 70px; height: 70px; background: var(--gold); border: 5px solid var(--bezel); box-shadow: 0 0 18px var(--gold); position: relative; }
.portrait span::before, .portrait span::after { content: ""; position: absolute; top: 24px; width: 8px; height: 8px; background: var(--bezel); animation: blink 2.2s steps(2) infinite; }
.portrait span::before { left: 20px; } .portrait span::after { right: 20px; }

.inventory-panel { right: 42px; width: min(360px, 31vw); padding: 16px; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.inventory-grid button { padding: 13px 8px; font-family: var(--pixel); font-size: 9px; color: var(--cream); background: var(--bezel); border: 3px solid var(--rose); cursor: pointer; transition: border-color .2s steps(2), color .2s steps(2), box-shadow .2s steps(2); }
.inventory-grid button:hover, .inventory-grid button.active { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 16px rgba(66,245,215,.55); }
#inventoryHint { margin: 0; font-size: 14px; color: var(--gold); }

@keyframes waveMarch { to { stroke-dashoffset: -160; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes blink { 0%, 82%, 100% { opacity: 1; } 83%, 92% { opacity: 0; } }
@keyframes jitter { 0%, 100% { transform: translate(0,0); } 25% { transform: translate(5px,-3px); } 50% { transform: translate(-4px,4px); } 75% { transform: translate(3px,3px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,47,125,.75); } 100% { box-shadow: 0 0 0 28px rgba(255,47,125,0); } }
@keyframes drawWave { to { stroke-dashoffset: 0; } }
@keyframes spark { 0%,100% { transform: scale(1); opacity: .25; } 50% { transform: scale(2.5); opacity: 1; } }
@keyframes towerPulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(6); opacity: 0; } }

@media (max-width: 900px) {
  html, body { overflow: auto; }
  .arcade { min-height: 980px; height: auto; padding: 140px 22px 300px; }
  .hud { left: 22px; right: 22px; flex-direction: column; }
  .signal-meter { width: 100%; }
  .scene-note { right: 22px; left: 22px; top: auto; bottom: 24px; max-width: none; }
  .pixel-map { inset: 190px 20px 150px; }
  .dialogue-panel { left: 22px; right: 22px; width: auto; bottom: 156px; }
  .inventory-panel { left: 22px; right: 22px; width: auto; bottom: 22px; }
  .scene-rail { bottom: 266px; }
}
