* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #05060c; overflow: hidden; }
body { display: flex; align-items: center; justify-content: center; font-family: "Press Start 2P", monospace; color: #fff; }

#stage { position: relative; overflow: hidden; background: #000; box-shadow: 0 0 80px rgba(80,110,200,.15); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#fx { position: absolute; left: 0; top: 0; width: 384px; height: 216px; transform-origin: 0 0; pointer-events: none; }
#vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }
#scan { position: absolute; inset: 0; pointer-events: none; opacity: .10;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.9) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); }
#progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#7fb3ff,#ffd1a6); }

/* ---------- start / end ---------- */
.ui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at center, rgba(8,10,24,.55), rgba(3,4,10,.92)); transition: opacity 1.2s; z-index: 5; }
.ui.hidden { opacity: 0; pointer-events: none; }
.start-inner { display: flex; flex-direction: column; align-items: center; gap: 1.1em; padding: 16px; }
.kicker { font-family: "VT323", monospace; font-size: clamp(16px, 2.4vw, 26px); letter-spacing: .3em; color: #9fb4e8; text-transform: uppercase; }
h1 { font-size: clamp(28px, 7vw, 76px); letter-spacing: .08em; color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 18px #7fa8ff, 4px 4px 0 #2a3a7a; animation: breathe 4s ease-in-out infinite; }
h1.small { font-size: clamp(22px, 5vw, 54px); }
.sub { font-family: "VT323", monospace; font-size: clamp(18px, 2.6vw, 30px); color: #ffd9b8; letter-spacing: .12em; }
.sub.dim { color: #8b93b5; font-size: clamp(14px, 2vw, 22px); }
.hint { font-family: "VT323", monospace; font-size: clamp(14px, 2vw, 22px); color: #7c86a8; }
button { font-family: "Press Start 2P", monospace; font-size: clamp(12px, 1.8vw, 18px); color: #1b1630; cursor: pointer;
  background: #ffd166; border: 0; padding: 1em 1.6em; display: inline-flex; align-items: center; gap: .9em;
  box-shadow: 0 4px 0 #b8862a, 0 0 0 4px #1b1630, 0 4px 0 4px #1b1630, 0 0 40px rgba(255,209,102,.35);
  transition: transform .1s; margin-top: .8em; }
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8862a, 0 0 0 4px #1b1630; }
button:disabled { opacity: .5; cursor: wait; }
.tri { width: 0; height: 0; border-left: .8em solid currentColor; border-top: .5em solid transparent; border-bottom: .5em solid transparent; }
@keyframes breathe { 50% { text-shadow: 0 0 2px #fff, 0 0 30px #a8c4ff, 4px 4px 0 #2a3a7a; } }

/* ---------- lyrics (all units = low-res pixels, scaled by #fx) ---------- */
.lyr { position: absolute; white-space: nowrap; transition: opacity .8s, filter .8s; }
.lyr.out { opacity: 0 !important; filter: blur(2px); }

/* title card */
.title-card { left: 107px; top: 40px; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 1.5s; }
.title-card.on { opacity: 1; }
.title-card b { display: block; font-size: 14px; letter-spacing: 2px; color: #fff; text-shadow: 0 0 6px #8fb0ff, 1px 1px 0 #2a3a7a; }
.title-card span { display: block; font-family: "VT323"; font-size: 9px; color: #ffd9b8; letter-spacing: 1px; margin-top: 4px; }

/* office: retro notes window */
.lyr-screen { left: 196px; top: 66px; width: 180px; white-space: normal; background: #e9e4d6; color: #1e1a2e;
  border: 1px solid #1e1a2e; box-shadow: 2px 2px 0 rgba(0,0,0,.45); font-family: "VT323", monospace; animation: popin .35s steps(4); }
.lyr-screen .bar { background: #3d5a9e; color: #fff; font-size: 7px; padding: 1px 3px; display: flex; justify-content: space-between; }
.lyr-screen .body { font-size: 10px; line-height: 9px; padding: 4px 5px 5px; min-height: 24px; }
.lyr-screen .cur { display: inline-block; width: 4px; height: 8px; background: #1e1a2e; vertical-align: -1px; animation: blink .8s steps(1) infinite; }
@keyframes popin { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

/* street: neon signs */
.lyr-neon { top: 40px; padding: 4px 6px; font-size: 7px; line-height: 10px; white-space: normal; width: 170px; text-align: center;
  background: rgba(10,8,22,.82); border: 1px solid #2a2440; box-shadow: 0 0 0 1px #000, 2px 2px 0 rgba(0,0,0,.5); }
.lyr-neon .w { color: #3a3550; transition: color .15s, text-shadow .15s; }
.lyr-neon .w.on { color: var(--c); text-shadow: 0 0 2px #fff, 0 0 5px var(--c), 0 0 10px var(--c); animation: flick .5s steps(2) 1; }
@keyframes flick { 0% { opacity: .2 } 30% { opacity: 1 } 45% { opacity: .4 } 60%,100% { opacity: 1 } }

/* train: reflection on window */
.lyr-reflect { top: 70px; left: 192px; font-family: "VT323", monospace; font-size: 15px; color: rgba(205,230,255,.85);
  text-shadow: 0 0 4px rgba(150,200,255,.8); letter-spacing: .5px; }
.lyr-reflect .w { opacity: 0; filter: blur(2px); transition: opacity .5s, filter .5s; }
.lyr-reflect .w.on { opacity: 1; filter: blur(0); }

/* rooftop: word platforms */
.plat { position: absolute; color: #9aa3d6; background: #2b3160; border-bottom: 2px solid #171a38; border-top: 1px solid #4b5394;
  padding: 2px 2px 1px; text-align: center; line-height: 1; transition: background .2s, color .2s, transform .2s, opacity .6s;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.plat.on { background: #ffd166; color: #2a1d3b; border-top-color: #fff1c4; border-bottom-color: #b8862a;
  box-shadow: 0 0 10px rgba(255,209,102,.7), 0 3px 0 rgba(0,0,0,.35); animation: bump .25s; }
.plat.gone { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
@keyframes bump { 40% { transform: translateY(2px); } }

/* park: falling snow letters */
.lyr-snow { left: 192px; top: 34px; transform: translateX(-50%); font-size: 8px; color: #fff; text-shadow: 0 0 4px #bcd6ff, 1px 1px 0 #2a3155; }
.lyr-snow .l { display: inline-block; transition: transform 1.6s cubic-bezier(.2,.7,.3,1), opacity 1.2s; }
.lyr-snow.out { opacity: 1 !important; filter: none; }
.lyr-snow.out .l { transform: translateY(120px) rotate(40deg) !important; opacity: 0 !important; transition: transform 2s ease-in, opacity 1.8s; }

/* bridge: warm glow */
.lyr-glow { left: 192px; top: 40px; transform: translateX(-50%); font-family: "VT323", monospace; font-size: 16px; color: #fff4e2;
  text-shadow: 0 0 6px rgba(255,190,120,.9), 1px 1px 0 rgba(120,60,40,.6); }
.lyr-glow .l { display: inline-block; opacity: 0; transform: translateY(3px); filter: blur(3px); transition: opacity .7s, transform .7s, filter .7s; }
.lyr-glow .l.on { opacity: 1; transform: none; filter: none; }

/* sync tool */
#syncPanel { position: fixed; right: 10px; top: 10px; width: 340px; max-height: 90vh; overflow: auto; z-index: 20; background: rgba(10,12,24,.92);
  border: 1px solid #334; padding: 10px; font-family: "VT323", monospace; font-size: 16px; color: #cfd6ff; }
#syncPanel.hidden { display: none; }
#syncPanel .cur { color: #ffd166; }
#syncPanel textarea { width: 100%; height: 240px; background: #000; color: #9f9; font-family: monospace; font-size: 11px; margin-top: 8px; }

/* long-line wrapping */
.lyr-reflect, .lyr-snow, .lyr-glow { white-space: normal; width: 340px; text-align: center; }
.lyr-reflect { transform: translateX(-50%); line-height: 14px; top: 64px; }
.lyr-snow { line-height: 12px; }
.lyr-glow { line-height: 15px; }
.wd { display: inline-block; white-space: nowrap; }

/* jet: HUD lyrics */
.lyr-hud { left: 192px; top: 18px; transform: translateX(-50%); width: 300px; white-space: normal; text-align: center;
  font-family: "VT323", monospace; font-size: 15px; line-height: 14px; color: #7dff9a; text-shadow: 0 0 4px rgba(125,255,154,.8);
  padding: 3px 8px; border-left: 1px solid #7dff9a; border-right: 1px solid #7dff9a; }
.lyr-hud .w { opacity: .15; transition: opacity .15s; }
.lyr-hud .w.on { opacity: 1; }
/* mountain: blizzard letters */
.lyr-blizzard { left: 192px; top: 22px; transform: translateX(-50%); font-size: 8px; line-height: 12px; color: #fff;
  text-shadow: 1px 1px 0 #3a4560, 0 0 6px rgba(255,255,255,.6); }
.lyr-blizzard .l { display: inline-block; opacity: 0; transform: translateX(12px); transition: opacity .3s, transform .3s; }
.lyr-blizzard .l.on { opacity: 1; transform: none; animation: shiver .18s steps(2) infinite; }
@keyframes shiver { 50% { transform: translate(.5px, -.5px); } }
/* rocket: space glow */
.lyr-space { left: 192px; top: 150px; transform: translateX(-50%); font-family: "VT323", monospace; font-size: 16px; line-height: 15px; color: #d8f7ff;
  text-shadow: 0 0 6px rgba(120,220,255,.9); }
.lyr-space .l { display: inline-block; opacity: 0; transform: scale(2); filter: blur(3px); transition: opacity .5s, transform .5s, filter .5s; }
.lyr-space .l.on { opacity: 1; transform: none; filter: none; }
.lyr-blizzard, .lyr-space { white-space: normal; width: 340px; text-align: center; }
.lyr-glow { top: 30px; }

#stage.playing { cursor: none; }
#stage.playing .ui button { cursor: pointer; }
/* minimart: lyrics made of cigarette smoke */
.lyr-smoke { left: 74px; top: 34px; transform: translateX(-50%); width: 140px; white-space: normal; text-align: center;
  font-family: "VT323", monospace; font-size: 15px; line-height: 14px; color: #e6e9f2; text-shadow: 0 0 6px rgba(200,210,230,.7); }
.lyr-smoke .l { display: inline-block; opacity: 0; transform: translateY(8px) scale(.8); filter: blur(4px); transition: opacity .7s, transform 1.2s, filter .8s; }
.lyr-smoke .l.on { opacity: .92; transform: none; filter: blur(0); }
.lyr-smoke.out { opacity: 1 !important; filter: none; }
.lyr-smoke.out .l { opacity: 0 !important; transform: translateY(-18px) scale(1.3); filter: blur(5px); transition: opacity 1.4s, transform 1.6s, filter 1.4s; }

/* submarine: letters rise like bubbles */
.lyr-bubble { left: 192px; top: 24px; transform: translateX(-50%); width: 330px; white-space: normal; text-align: center;
  font-family: "VT323", monospace; font-size: 16px; line-height: 15px; color: #e4f8ff; text-shadow: 0 0 5px rgba(110,210,255,.9); }
.lyr-bubble .l { display: inline-block; transition: transform 1.3s cubic-bezier(.2,.8,.3,1.2), opacity .9s; }
.lyr-bubble.out { opacity: 1 !important; filter: none; }
/* cannon: circus marquee words */
.lyr-circus { left: 192px; top: 52px; transform: translateX(-50%); width: 330px; white-space: normal; text-align: center; line-height: 15px; font-size: 7px; }
.lyr-circus .w { display: inline-block; padding: 2px 3px; margin: 1px 0; color: #fff3c4; background: #b8263a; border: 1px dotted #ffd166;
  box-shadow: 0 0 6px rgba(255,209,102,.5); opacity: 0; transform: scale(.3) rotate(-8deg); transition: opacity .15s, transform .25s cubic-bezier(.3,1.8,.5,1); }
.lyr-circus .w.on { opacity: 1; transform: none; }
