/* GAME STATIONS - one stylesheet for the whole project.
 * Sections: tokens, base, shared UI, menu, game screen, overlays, stations, unlock/victory, responsive. */

/* ---------- tokens ---------- */
:root {
  --bg: #0b0a1f;
  --bg2: #15123a;
  --panel: #1b1650;
  --panel2: #251e66;
  --ink: #e8f6ff;
  --muted: #9aa3d6;
  --cyan: #19f9ff;
  --pink: #ff2e97;
  --yellow: #ffd23f;
  --green: #3dff8a;
  --red: #ff3b6b;
  --orange: #ff9f1c;
  --purple: #8a5cff;
  --pixel: "Press Start 2P", "Courier New", ui-monospace, monospace;
  --body: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px dashed var(--yellow); outline-offset: 3px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

/* animated retro horizon behind everything */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 46, 151, .28), transparent 60%),
    linear-gradient(#0b0a1f, #120d33 55%, #1d0f45);
}
.bg-grid::after {
  content: ""; position: absolute; left: -50%; right: -50%; bottom: 0; height: 55%;
  background-image:
    linear-gradient(rgba(25, 249, 255, .35) 2px, transparent 2px),
    linear-gradient(90deg, rgba(25, 249, 255, .35) 2px, transparent 2px);
  background-size: 60px 60px;
  transform: perspective(380px) rotateX(62deg);
  transform-origin: bottom;
  animation: gridmove 2.4s linear infinite;
  mask-image: linear-gradient(transparent, #000 70%);
  -webkit-mask-image: linear-gradient(transparent, #000 70%);
}
@keyframes gridmove { to { background-position: 0 60px, 0 0; } }
.scanlines {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background: repeating-linear-gradient(rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

#app { position: relative; z-index: 1; }
.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; animation: screenIn .35s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.noscript { position: fixed; inset: 0; z-index: 999; background: #000; color: #fff; display: grid; place-items: center; padding: 24px; text-align: center; }

/* ---------- shared UI ---------- */
.btn {
  font-family: var(--pixel); font-size: 11px; letter-spacing: .5px;
  background: var(--panel); color: var(--ink);
  border: 3px solid var(--cyan); border-radius: 0;
  padding: 12px 16px; min-height: 44px;
  box-shadow: 0 4px 0 #000, 0 0 14px rgba(25, 249, 255, .25);
  transition: transform .08s, box-shadow .08s, background .15s, color .15s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:hover { background: var(--panel2); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn.primary { background: var(--cyan); color: #04122a; border-color: #fff; box-shadow: 0 4px 0 #0a6f78, 0 0 22px rgba(25, 249, 255, .55); }
.btn.primary:hover { background: #7dfcff; }
.btn.danger { border-color: var(--red); color: #ffd0da; box-shadow: 0 4px 0 #000, 0 0 14px rgba(255, 59, 107, .3); }
.btn.danger:hover { background: #4a1230; }
.btn.big { font-size: 14px; padding: 16px 24px; min-height: 56px; }
.btn.small { font-size: 9px; padding: 9px 12px; min-height: 40px; }
.btn.icon { padding: 9px 11px; font-size: 14px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; filter: grayscale(.7); }

.section-title { font-family: var(--pixel); font-size: 14px; color: var(--yellow); text-shadow: 3px 3px 0 #000; margin-bottom: 14px; letter-spacing: 1px; }

.bar { height: 22px; background: #000; border: 3px solid var(--ink); position: relative; overflow: hidden; }
.bar.small-bar { height: 16px; margin-top: 6px; }
.bar-fill {
  height: 100%; width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1);
  background: repeating-linear-gradient(90deg, var(--green) 0 14px, #1fbf63 14px 16px);
  box-shadow: 0 0 12px var(--green);
}
.progress-text { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 9px; margin-top: 8px; color: var(--muted); }
.progress-text.center { justify-content: center; }
.tag { font-family: var(--pixel); font-size: 8px; background: var(--pink); color: #fff; padding: 3px 6px; margin-left: 8px; }

.toasts { position: fixed; top: 12px; left: 0; right: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast {
  font-family: var(--pixel); font-size: 10px; line-height: 1.6; text-align: center;
  background: #000; color: var(--ink); border: 3px solid var(--cyan); padding: 12px 16px; max-width: 460px;
  box-shadow: 0 0 20px rgba(25, 249, 255, .5); animation: toastIn .3s ease-out, toastOut .4s ease-in 3.2s forwards;
}
.toast.unlock { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 0 26px rgba(255, 210, 63, .7); font-size: 11px; }
.toast.warn { border-color: var(--red); color: #ffd0da; box-shadow: 0 0 20px rgba(255, 59, 107, .5); }
@keyframes toastIn { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

/* curtain wipe between screens */
.wipe { position: fixed; inset: 0; z-index: 800; pointer-events: none; transform: translateY(-101%); background: linear-gradient(#0b0a1f, #1d0f45); border-bottom: 8px solid var(--pink); box-shadow: 0 8px 0 var(--cyan); }
.wipe.cover { pointer-events: auto; animation: wipeCover .38s steps(8) forwards; }
.wipe.reveal { pointer-events: auto; transform: none; animation: wipeReveal .38s steps(8) forwards; }
@keyframes wipeCover { from { transform: translateY(-101%); } to { transform: none; } }
@keyframes wipeReveal { from { transform: none; } to { transform: translateY(101%); } }

/* ---------- overlays / panels (used by every game via GS.ui) ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(5, 4, 20, .84); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .2s ease-out;
}
.overlay.global { position: fixed; z-index: 700; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.panel {
  width: 100%; max-width: 470px; max-height: 100%; overflow: auto;
  background: var(--panel); border: 4px solid var(--cyan); padding: 20px 18px; text-align: center;
  box-shadow: 0 0 0 4px #000, 0 0 30px rgba(25, 249, 255, .4); animation: pop .25s ease-out;
}
.overlay.bad .panel { border-color: var(--red); box-shadow: 0 0 0 4px #000, 0 0 30px rgba(255, 59, 107, .4); }
.overlay.good .panel { border-color: var(--green); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-title { font-family: var(--pixel); font-size: 15px; line-height: 1.5; color: var(--yellow); text-shadow: 3px 3px 0 #000; margin-bottom: 12px; }
.overlay.bad .panel-title { color: var(--red); }
.panel-text { margin-bottom: 14px; color: var(--ink); }
.controls { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; display: grid; gap: 6px; }
.controls li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: rgba(0, 0, 0, .35); padding: 7px 9px; }
.controls .keys { font-family: var(--pixel); font-size: 9px; color: var(--cyan); flex: 0 1 auto; }
.controls .desc { color: var(--muted); font-size: 13px; }
.panel-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- main menu ---------- */
.menu-inner { width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.logo { text-align: center; }
.logo-top, .logo-bottom { font-family: var(--pixel); line-height: 1.15; letter-spacing: 4px; text-transform: uppercase; }
.logo-top {
  font-size: clamp(34px, 9vw, 72px); color: var(--cyan);
  text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 #000, 0 0 30px rgba(25, 249, 255, .7);
  animation: flicker 5s infinite;
}
.logo-bottom {
  font-size: clamp(26px, 7vw, 56px); color: var(--yellow); margin-top: 6px;
  text-shadow: 4px 4px 0 #ff6a3d, 8px 8px 0 #000, 0 0 30px rgba(255, 210, 63, .6);
}
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .65; } 95% { opacity: 1; } 97% { opacity: .8; } }
#banner { display: block; margin: 20px auto 8px; width: min(100%, 540px); image-rendering: pixelated; border-top: 4px solid var(--purple); border-bottom: 4px solid var(--purple); background: rgba(0, 0, 0, .35); }
.tagline { color: var(--muted); font-size: 14px; margin-top: 8px; }

.menu-buttons { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 380px; }
.menu-buttons .btn.big { width: 100%; }
.menu-buttons .sub { display: block; font-size: 8px; margin-top: 6px; opacity: .8; }
.menu-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.progress-section { width: 100%; background: rgba(11, 10, 31, .78); border: 4px solid var(--purple); box-shadow: 0 0 0 4px #000; padding: 20px 16px; }
.next-up { margin-top: 12px; font-size: 13px; color: var(--ink); text-align: center; min-height: 20px; }
.next-up b { color: var(--yellow); }
.stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stage-card {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 3px solid #4b4f9e; padding: 12px 10px 12px; min-height: 150px;
  box-shadow: 0 4px 0 #000; transition: transform .1s, border-color .2s, background .2s;
}
.stage-card .sc-num { position: absolute; top: 6px; right: 8px; font-family: var(--pixel); font-size: 9px; color: var(--muted); }
.stage-card .sc-icon { font-size: 28px; line-height: 1; }
.stage-card .sc-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.stage-card .sc-sub { font-family: var(--pixel); font-size: 8px; color: var(--cyan); }
.stage-card .sc-name { font-family: var(--pixel); font-size: 10px; line-height: 1.4; }
.stage-card .sc-blurb { font-size: 11px; color: var(--muted); line-height: 1.35; }
.stage-card .sc-badge { font-family: var(--pixel); font-size: 8px; padding: 5px 6px; text-align: center; background: #000; color: var(--muted); }
.stage-card.station { border-style: dashed; }
.stage-card.done { border-color: var(--green); }
.stage-card.done .sc-badge { color: var(--green); }
.stage-card.current { border-color: var(--yellow); background: var(--panel2); animation: glow 1.4s ease-in-out infinite alternate; }
.stage-card.current .sc-badge { background: var(--yellow); color: #1a1200; }
.stage-card.locked { opacity: .55; filter: grayscale(.6); border-color: #3a3d78; }
.stage-card.locked .sc-icon { opacity: .7; }
.stage-card:not(.locked):hover { transform: translateY(-3px); }
.stage-card.deny { animation: shake .35s; }
@keyframes glow { from { box-shadow: 0 4px 0 #000, 0 0 6px rgba(255, 210, 63, .3); } to { box-shadow: 0 4px 0 #000, 0 0 22px rgba(255, 210, 63, .85); } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.restart-row { display: flex; justify-content: center; margin-top: 20px; }
.menu-foot { color: var(--muted); font-size: 12px; text-align: center; max-width: 520px; }

.howto { display: grid; gap: 10px; text-align: left; margin-bottom: 14px; }
.howto h3 { margin: 0 0 4px; font-family: var(--pixel); font-size: 10px; color: var(--cyan); }
.howto .row { background: rgba(0, 0, 0, .35); padding: 8px 10px; font-size: 12px; color: var(--muted); }
.howto .row b { color: var(--ink); font-weight: 600; }

/* ---------- game screen ---------- */
#screen-game { align-items: stretch; }
.game-top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: rgba(5, 4, 20, .88); border-bottom: 4px solid var(--purple);
  position: sticky; top: 0; z-index: 30;
}
.game-title { text-align: center; min-width: 0; }
.gt-line { font-family: var(--pixel); font-size: 10px; color: var(--yellow); }
.gt-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.seg-bar { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.seg { height: 8px; background: #000; border: 2px solid #3a3d78; }
.seg.done { background: var(--green); border-color: var(--green); }
.seg.current { background: var(--yellow); border-color: var(--yellow); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

#game-root { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 12px; }
.game-wrap { position: relative; width: 100%; max-width: 900px; margin: 0 auto; }
.game-wrap.station { max-width: 560px; min-height: 480px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0 20px; }
.station-title { font-family: var(--pixel); font-size: clamp(16px, 4.6vw, 24px); color: var(--cyan); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #000; text-align: center; margin-top: 4px; }

.gs-hud { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, .55); border: 3px solid #3a3d78; padding: 8px 10px; margin-bottom: 10px; width: 100%; }
.hud-item { font-family: var(--pixel); font-size: 9px; color: var(--muted); }
.hud-item b { color: var(--yellow); font-weight: normal; margin-left: 4px; }
.hearts { color: var(--red) !important; letter-spacing: 2px; min-width: 40px; display: inline-block; }
.x-col { color: var(--cyan) !important; }
.o-col { color: var(--pink) !important; }
.station .gs-hud { margin-bottom: 0; }

.canvas-box {
  position: relative; margin: 0 auto; aspect-ratio: var(--ratio);
  width: min(100%, calc((100dvh - 230px) * var(--ratio)));
  min-width: min(100%, 300px);
  background: #000; border: 4px solid var(--cyan); box-shadow: 0 0 0 4px #000, 0 0 30px rgba(25, 249, 255, .35);
}
.canvas-box canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }

/* touch pad (only on touch devices, only for the two action games) */
.touchpad { display: none; padding: 6px 14px calc(14px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; }
body.touch #screen-game[data-pad="maze"] .touchpad,
body.touch #screen-game[data-pad="platformer"] .touchpad { display: block; }
.pad { display: none; }
#screen-game[data-pad="maze"] .pad-maze { display: grid; }
#screen-game[data-pad="platformer"] .pad-plat { display: flex; }
.touchpad button {
  font-family: var(--pixel); font-size: 18px; background: rgba(27, 22, 80, .92); color: var(--ink);
  border: 3px solid var(--cyan); box-shadow: 0 4px 0 #000; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.touchpad button.on { background: var(--cyan); color: #04122a; transform: translateY(3px); box-shadow: none; }
.pad-maze { grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 56px); gap: 6px; width: max-content; margin: 0 auto;
  grid-template-areas: ". up ." "left . right" ". down ."; }
.pad-maze [data-act="up"] { grid-area: up; } .pad-maze [data-act="down"] { grid-area: down; }
.pad-maze [data-act="left"] { grid-area: left; } .pad-maze [data-act="right"] { grid-area: right; }
.pad-plat { justify-content: space-between; align-items: center; gap: 14px; max-width: 520px; margin: 0 auto; }
.pad-lr { display: flex; gap: 10px; }
.pad-lr button { width: 74px; height: 68px; }
.pad-jump { width: 120px; height: 76px; border-color: var(--pink) !important; font-size: 12px !important; }

/* ---------- Tic Tac Toe ---------- */
.ttt-status { font-family: var(--pixel); font-size: 11px; line-height: 1.6; text-align: center; min-height: 36px; color: var(--ink); }
.ttt-status.good { color: var(--green); text-shadow: 0 0 12px var(--green); }
.ttt-status.bad { color: var(--red); }
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 360px); }
.ttt-cell {
  aspect-ratio: 1; font-family: var(--pixel); font-size: clamp(32px, 11vw, 56px); background: var(--panel);
  border: 3px solid #4b4f9e; box-shadow: 0 4px 0 #000; padding: 0; display: grid; place-items: center; transition: background .15s, transform .1s;
}
.ttt-cell:not(:disabled):hover { background: var(--panel2); border-color: var(--cyan); }
.ttt-cell.x { color: var(--cyan); text-shadow: 0 0 14px var(--cyan); }
.ttt-cell.o { color: var(--pink); text-shadow: 0 0 14px var(--pink); }
.ttt-cell:disabled { cursor: default; }
.ttt-cell.win { background: #12522e; border-color: var(--green); animation: blink .5s steps(2) 4; }

/* ---------- Guess the Number ---------- */
.guess-range { color: var(--muted); font-size: 14px; text-align: center; }
.guess-range b { color: var(--yellow); }
.attempts { display: flex; gap: 6px; }
.pip { width: 16px; height: 16px; background: var(--green); border: 2px solid #000; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .3); }
.pip.used { background: #2a2c5c; }
.meter { width: min(100%, 420px); height: 22px; background: #000; border: 3px solid var(--ink); overflow: hidden; }
.meter-fill { height: 100%; width: 0; transition: width .4s ease-out, background .3s; background: var(--cyan); }
.meter-fill.hot3 { background: linear-gradient(90deg, var(--orange), var(--red)); box-shadow: 0 0 14px var(--red); }
.meter-fill.hot2 { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.meter-fill.hot1 { background: var(--yellow); }
.meter-fill.warm { background: #9be37b; }
.meter-fill.cold { background: #4aa3ff; }
.meter-fill.frozen { background: #7ad0ff; }
.guess-msg { font-family: var(--pixel); font-size: 11px; line-height: 1.7; text-align: center; min-height: 40px; padding: 0 6px; }
.guess-msg.good { color: var(--green); } .guess-msg.bad { color: var(--red); } .guess-msg.warn { color: var(--orange); }
.guess-msg.hot3 { color: var(--red); } .guess-msg.hot2 { color: var(--orange); } .guess-msg.hot1 { color: var(--yellow); }
.guess-msg.warm { color: #9be37b; } .guess-msg.cold { color: #4aa3ff; } .guess-msg.frozen { color: #7ad0ff; }
.guess-form { display: flex; gap: 10px; }
.guess-input {
  width: 150px; min-height: 52px; font-family: var(--pixel); font-size: 20px; text-align: center; color: var(--ink);
  background: #000; border: 3px solid var(--cyan); padding: 8px; border-radius: 0; -moz-appearance: textfield; appearance: textfield;
}
.guess-input::-webkit-outer-spin-button, .guess-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.guess-input::placeholder { color: #4b4f9e; font-size: 12px; }
.guess-input.shake { animation: shake .35s; border-color: var(--red); }
.range-hint { font-family: var(--pixel); font-size: 10px; color: var(--cyan); }
.history { list-style: none; margin: 0; padding: 0; width: min(100%, 420px); display: grid; gap: 6px; }
.history li { background: rgba(0, 0, 0, .45); border-left: 6px solid #4b4f9e; padding: 7px 10px; font-size: 13px; animation: slideIn .25s ease-out; }
.history li b { font-family: var(--pixel); font-size: 12px; margin-right: 6px; }
.history li.ok { border-color: var(--green); color: var(--green); }
.history li.hot3 { border-color: var(--red); } .history li.hot2 { border-color: var(--orange); } .history li.hot1 { border-color: var(--yellow); }
.history li.warm { border-color: #9be37b; } .history li.cold { border-color: #4aa3ff; } .history li.frozen { border-color: #7ad0ff; }
@keyframes slideIn { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Memory Cards ---------- */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 440px); }
.mem-card { aspect-ratio: 1; background: none; border: 0; padding: 0; perspective: 700px; box-shadow: none; }
.mem-card:focus-visible { outline-offset: 2px; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .4s; }
.mem-card.flipped .mem-inner, .mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid; box-shadow: 0 4px 0 #000; }
.mem-back { background: repeating-linear-gradient(45deg, var(--panel) 0 8px, var(--panel2) 8px 16px); border-color: var(--cyan); font-family: var(--pixel); font-size: clamp(18px, 6vw, 28px); color: var(--cyan); }
.mem-card:hover .mem-back { border-color: var(--yellow); }
.mem-front { transform: rotateY(180deg); background: #fff7d6; border-color: var(--yellow); font-size: clamp(26px, 8vw, 42px); }
.mem-card.matched .mem-front { background: #bdf7cf; border-color: var(--green); animation: matchPop .4s; }
@keyframes matchPop { 50% { filter: brightness(1.4); } }

/* ---------- unlock card ---------- */
#screen-unlock { align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 16px; }
.rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 210, 63, .16) 0 8deg, transparent 8deg 16deg); animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unlock-card, .victory-card {
  position: relative; width: 100%; max-width: 520px; text-align: center; background: rgba(27, 22, 80, .96);
  border: 4px solid var(--yellow); box-shadow: 0 0 0 4px #000, 0 0 50px rgba(255, 210, 63, .5); padding: 26px 20px;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.ul-kicker { font-family: var(--pixel); font-size: 11px; color: var(--green); letter-spacing: 1px; }
.ul-title { font-family: var(--pixel); font-size: clamp(14px, 4.4vw, 20px); line-height: 1.5; color: var(--yellow); text-shadow: 3px 3px 0 #000; margin: 12px 0 18px; animation: pulseText 1s ease-in-out infinite alternate; }
@keyframes pulseText { to { transform: scale(1.05); text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 210, 63, .8); } }
.ul-icon { font-size: 72px; line-height: 1; animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.ul-sub { font-family: var(--pixel); font-size: 10px; color: var(--cyan); margin-top: 12px; }
.ul-name { font-family: var(--pixel); font-size: 16px; margin-top: 8px; }
.ul-blurb { color: var(--muted); font-size: 13px; margin: 12px 0 18px; }
.unlock-card .panel-buttons { margin-top: 18px; }

/* ---------- victory ---------- */
#screen-victory { position: relative; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
#fireworks { position: absolute; inset: 0; width: 100%; height: 100%; }
.victory-card { max-width: 620px; border-color: var(--pink); box-shadow: 0 0 0 4px #000, 0 0 60px rgba(255, 46, 151, .6); }
.trophy { font-size: 84px; line-height: 1; animation: bob 1.2s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 210, 63, .9)); }
.v-kicker { font-family: var(--pixel); font-size: 11px; color: var(--green); margin-top: 8px; }
.v-title { font-family: var(--pixel); font-size: clamp(18px, 5.4vw, 30px); line-height: 1.5; margin: 12px 0 14px; background: linear-gradient(90deg, #ff2e97, #ffd23f, #3dff8a, #19f9ff, #ff2e97); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rainbow 4s linear infinite; }
@keyframes rainbow { to { background-position: 300% 0; } }
.v-text { color: var(--ink); font-size: 14px; }
.v-list { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; text-align: left; }
.v-list li { background: rgba(0, 0, 0, .4); font-size: 12px; padding: 6px 8px; color: var(--muted); }
.v-list li::before { content: "★ "; color: var(--yellow); }

/* ---------- responsive ---------- */
@media (max-width: 860px) { .stage-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  body { font-size: 14px; }
  .menu-inner { padding: 18px 12px 32px; gap: 22px; }
  .stage-grid { grid-template-columns: 1fr; }
  .stage-card { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .stage-card .sc-body { flex: 1 1 140px; }
  .stage-card .sc-badge { flex: 0 0 auto; }
  .v-list { grid-template-columns: 1fr; }
  .game-top { grid-template-columns: auto 1fr auto; padding: 8px; }
  .gt-line { font-size: 9px; }
  .canvas-box { width: min(100%, calc((100dvh - 330px) * var(--ratio))); }
  .guess-input { width: 120px; }
  .gs-hud { gap: 6px 10px; padding: 6px 8px; }
  .hud-item { font-size: 8px; }
  .gs-hud .btn.small { padding: 6px 8px; min-height: 36px; font-size: 8px; margin-left: auto; }
}
@media (hover: none) and (pointer: coarse) { .canvas-box { width: min(100%, calc((100dvh - 360px) * var(--ratio))); } }
@media (max-height: 520px) and (orientation: landscape) {
  .canvas-box { width: min(100%, calc((100dvh - 130px) * var(--ratio))); }
  .logo-top { font-size: 30px; } .logo-bottom { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bg-grid::after { animation: none; }
}
