/* ==========================================================================
   BAD LITTLE BOY GAMES — leaned-in cabinet
   The viewport IS the cabinet: marquee strip on top, CRT filling the middle,
   control panel peeking in at the bottom, cabinet sides at the edges.
   ========================================================================== */
:root {
  --accent: #ff2e4d;
  --accent2: #ffd23f;
  --bg: #05060c;
  --edge: clamp(8px, 1.5vw, 26px);
  --mq-h: clamp(70px, 16.5vh, 196px);
  --pn-h: clamp(50px, 10.5vh, 118px);
  --ctl: calc(var(--pn-h) * .62);
}
@media (max-aspect-ratio: 4/5) {
  :root { --mq-h: min(34vw, 19svh); --pn-h: min(35svh, 290px); --ctl: min(15vw, calc(var(--pn-h) * .34)); }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color-scheme: dark; overflow: hidden; }
body {
  color: #fff;
  font-family: "Press Start 2P", ui-monospace, monospace;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: none;
}
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.arcade {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: var(--mq-h) 1fr var(--pn-h);
  padding: 0 var(--edge);
  background: #07080f;
  overflow: hidden;
}
.cab-side {
  position: absolute; top: 0; bottom: 0; width: var(--edge); z-index: 4; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 2px, transparent 2px 5px),
    linear-gradient(90deg, #000, #141726);
  transition: box-shadow .5s;
}
.cab-side.l { left: 0; box-shadow: inset -3px 0 0 var(--accent), 6px 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.cab-side.r { right: 0; transform: scaleX(-1); box-shadow: inset -3px 0 0 var(--accent), 6px 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.arcade:not(.on) .cab-side { box-shadow: inset -3px 0 0 #2a2d3c; }
.arcade.shake { animation: shake .11s linear infinite; }
@keyframes shake {
  0% { transform: translate(4px, -2px) rotate(.3deg); } 25% { transform: translate(-4px, 2px) rotate(-.3deg); }
  50% { transform: translate(2px, 4px); } 75% { transform: translate(-2px, -3px) rotate(.2deg); } 100% { transform: none; }
}
/* the launch dive (main.js camera): .arcade is transformed so the screen fills the window */
.arcade { transform-origin: 0 0; }
.arcade .glass, .arcade .vignette { transition: opacity .8s; }
.arcade.diving .glass, .arcade.diving .vignette { opacity: 0; }
/* the hand-off colour that covers everything before navigating; game pages open on the same overlay (WEB-PORTS.md 4.14) */
.handoff { position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0; background: #000; }
/* a return from a game: black until main.js has the zoomed, covered state (js/return.js) */
.returning, .returning body { background: #000; }
.returning .arcade { visibility: hidden; }
.handoff::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.35) 2px 3px); }
.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse 75% 80% at 50% 50%, transparent 60%, rgba(0,0,0,.55) 100%);
}

/* ------------------------------------------------------------- marquee */
.marquee {
  position: relative; overflow: hidden; container-type: size;
  background: #07070f;
  border-bottom: max(4px, calc(var(--mq-h) * .04)) solid #000;
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.8);
  user-select: none;
}
.marquee-light {
  position: absolute; inset: 0;
  background:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.6px) 0 0 / 7px 7px,
    repeating-conic-gradient(from 0deg at 50% 62%, rgba(255,210,63,.09) 0 5deg, transparent 5deg 11deg),
    radial-gradient(ellipse 55% 130% at 50% 55%, #4a1020 0%, #1d0b1e 45%, #090812 80%);
  opacity: .18;
}
.marquee.lit .marquee-light { opacity: 1; }
.marquee.flicker .marquee-light { animation: neonLight 1.3s steps(1) forwards; }
.marquee::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(100deg, transparent 20%, rgba(255,255,255,.06) 30%, transparent 40%),
    linear-gradient(rgba(255,255,255,.04), transparent 30%, rgba(0,0,0,.35));
}
.logo {
  position: absolute; left: 50%; top: 50%; height: 92%; width: auto; max-width: 66%;
  aspect-ratio: 800 / 236; transform: translate(-50%, -48%); overflow: visible;
  filter: brightness(.14) saturate(.2);
}
@container (max-aspect-ratio: 3/1) { .logo { max-width: 94%; } }
.marquee.lit .logo { filter: drop-shadow(0 0 calc(var(--mq-h) * .05) rgba(255,46,77,.45)); }
.marquee.flicker .logo { animation: neonOn 1.3s steps(1) forwards; }
.marquee.bad.lit .logo { animation: badHue 2.5s linear infinite; }
@keyframes neonOn {
  0% { filter: brightness(.14); } 8% { filter: brightness(1); } 12% { filter: brightness(.2); } 22% { filter: brightness(.9); }
  26% { filter: brightness(.14); } 45% { filter: brightness(1.1); } 50% { filter: brightness(.4); } 62%, 100% { filter: brightness(1); }
}
@keyframes neonLight { 0% { opacity: .18; } 8% { opacity: 1; } 12% { opacity: .25; } 22% { opacity: .9; } 26% { opacity: .18; } 45% { opacity: 1; } 50% { opacity: .45; } 62%, 100% { opacity: 1; } }
@keyframes badHue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

.bulb {
  position: absolute; width: max(6px, calc(var(--mq-h) * .055)); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%); background: #3a2a10; box-shadow: inset 0 0 2px #000;
}
.marquee.lit .bulb { animation: chase 1.05s steps(1) infinite; animation-delay: calc(var(--i) * -.35s); }
@keyframes chase {
  0% { background: #fff3b0; box-shadow: 0 0 4px 1px #ffd23f, 0 0 12px #ff8a1a; }
  33.33%, 100% { background: #5a3a14; box-shadow: none; }
}

/* marquee props: a lit bomb and a spray can tagging the logo */
.mq-prop { position: absolute; top: 50%; height: 62%; aspect-ratio: 1; transform: translateY(-50%); filter: brightness(.2) saturate(.3); }
.mq-prop svg { width: 100%; height: 100%; display: block; overflow: visible; }
.marquee.lit .mq-prop { filter: drop-shadow(0 0 6px rgba(0,0,0,.8)); }
.mq-prop.bomb { left: 6%; animation: bombWobble 1.4s ease-in-out infinite; }
.mq-prop.spray { right: 6%; transform: translateY(-50%) rotate(-28deg); }
@keyframes bombWobble { 50% { transform: translateY(-50%) rotate(-6deg); } }
@container (max-aspect-ratio: 3/1) { .mq-prop { display: none; } }
.spark { animation: spark .18s steps(1) infinite; transform-box: fill-box; transform-origin: center; }
.spark.b { animation-delay: -.09s; }
@keyframes spark { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.5); } }
.mist { animation: mist 1.1s linear infinite; opacity: 0; }
@keyframes mist { 0% { opacity: .9; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(-9px, -2px); } }
.marquee:not(.lit) .spark, .marquee:not(.lit) .mist { animation: none; opacity: 0; }

/* logo misbehaviour */
#bad { transform-box: fill-box; transform-origin: 50% 85%; animation: tantrum 5s infinite; }
@keyframes tantrum {
  0%, 84%, 100% { transform: none; } 86% { transform: rotate(-4deg) translate(-3px, 0); } 88% { transform: rotate(4deg) translate(3px, -3px); }
  90% { transform: rotate(-3deg); } 92% { transform: rotate(3deg) translateY(-3px); } 94% { transform: rotate(-2deg); } 96% { transform: none; }
}
#boy { transform-box: fill-box; transform-origin: 40% 100%; animation: wobble 2.8s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(2.5deg); } }
#tLittle { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.drip { transform-box: fill-box; transform-origin: 50% 0; animation: drip var(--dur, 4s) ease-in infinite; animation-delay: var(--del, 0s); }
@keyframes drip { 0% { transform: scaleY(.25); } 70%, 100% { transform: scaleY(1); } }
.drop { animation: dropFall var(--dur, 4s) ease-in infinite; animation-delay: var(--del, 0s); opacity: 0; }
@keyframes dropFall { 0%, 68% { transform: translateY(0); opacity: 0; } 70% { opacity: 1; transform: translateY(0); } 100% { transform: translateY(70px); opacity: 0; } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.twinkle.d1 { animation-delay: -.3s; } .twinkle.d2 { animation-delay: -1.1s; } .twinkle.d3 { animation-delay: -.7s; }
@keyframes twinkle { 0%, 100% { transform: scale(.2) rotate(0); opacity: .2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
#shine { animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0% { transform: translateX(-120px); } 55%, 100% { transform: translateX(900px); } }
.neon-line { animation: neonLine 3s ease-in-out infinite; }
@keyframes neonLine { 50% { opacity: .45; } }

/* --------------------------------------------------------------- bezel */
.bezel {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse 70% 70% at 50% 45%, #151a30, #090a13 75%);
}
.screen-wrap {
  position: absolute; left: 50%; top: var(--st, 3%); width: var(--sw, 80%); height: var(--sh, 80%);
  transform: translateX(-50%);
  border-radius: 2.6% / 3.4%;
  overflow: hidden; background: #030405;
  box-shadow:
    0 0 0 max(4px, calc(var(--sh) * .012)) #000,
    0 0 0 max(7px, calc(var(--sh) * .022)) #1b1f30,
    0 0 calc(var(--sh) * .14) color-mix(in srgb, var(--accent) 26%, transparent);
  cursor: pointer; touch-action: pan-y; user-select: none;
  transition: box-shadow .5s;
}
.arcade:not(.on) .screen-wrap { box-shadow: 0 0 0 max(4px, calc(var(--sh) * .012)) #000, 0 0 0 max(7px, calc(var(--sh) * .022)) #1b1f30; }
.screen-wrap canvas { display: block; width: 100%; height: 100%; }
.screen-wrap canvas.raw { image-rendering: pixelated; transform-origin: center; }
.glass {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 120% 90% at 28% 12%, rgba(255,255,255,.08), transparent 45%),
    radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.5) 100%);
  box-shadow: inset 0 0 calc(var(--sh) * .08) rgba(0,0,0,.9);
}
.no-gl .glass::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.3) 2px 3px); }
.power-prompt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--sh) * .05);
  background: none; border: 0; cursor: pointer;
  color: #ff5a6e; font-size: clamp(9px, calc(var(--sh) * .032), 22px); line-height: 2; text-align: center;
  text-shadow: 0 0 10px #ff2e4d;
  animation: pulse 1.6s ease-in-out infinite;
}
/* --sh is set by main.js layout(); before that (first paint) fall back to a small icon, not the svg's 300px default */
.power-prompt svg { width: clamp(24px, calc(var(--sh, 0px) * .12), 80px); height: auto; filter: drop-shadow(0 0 10px #ff2e4d); }
.power-prompt.gone { opacity: 0; pointer-events: none; animation: none; transition: opacity .15s; }
.power-prompt[hidden] { display: none; }   /* display:flex above would otherwise override the hidden attribute */
@keyframes pulse { 50% { opacity: .4; } }

/* bezel artwork — only when the screen leaves room at the sides */
.bezel-art {
  position: absolute; top: var(--st); height: var(--sh); width: var(--aw, 0);
  display: none; flex-direction: column; justify-content: center; gap: 8cqw;
  container-type: inline-size; pointer-events: none;
}
.bezel.has-art .bezel-art { display: flex; }
.bezel-art.left { left: var(--ag); }
.bezel-art.right { right: var(--ag); align-items: center; }
.arcade:not(.on) .bezel-art { filter: brightness(.45); }
.card.how {
  background: linear-gradient(#11152a, #0b0e1d); color: #dfe6ff;
  border: 1cqw solid #2c3350; border-radius: 3cqw; padding: 7cqw 6cqw;
  box-shadow: 0 2cqw 5cqw #000, inset 0 0 0 .6cqw #000; transform: rotate(-1.2deg);
}
.card.how h2 { margin: 0 0 6cqw; font-size: 7.2cqw; font-weight: normal; color: var(--accent2); letter-spacing: .05em; transition: color .4s; }
.card.how ol { list-style: none; margin: 0; padding: 0; }
.card.how li { display: flex; align-items: center; gap: 5cqw; margin: 0 0 6cqw; font-size: 4.6cqw; line-height: 1.6; }
.card.how li:last-child { margin: 0; }
.ico { flex: none; width: 13cqw; aspect-ratio: 1; border-radius: 50%; }
.ico.btn.red { background: radial-gradient(circle at 38% 32%, #fff8 0 8%, #ff2e4d 26%, #8a0f20); box-shadow: 0 1cqw 0 #4a0710; }
.ico.btn.blue { background: radial-gradient(circle at 38% 32%, #fff8 0 8%, #2e8bff 26%, #0f3a8a); box-shadow: 0 1cqw 0 #071d4a; }
.ico.coin { background: radial-gradient(circle at 35% 35%, #fff6c0, #ffd23f 40%, #b8860b); box-shadow: inset 0 0 0 1cqw #8a6400; }
.ico.stick { background: radial-gradient(circle at 50% 38%, #ffd0d8 0 6%, #ff3b4f 20%, #9a0e24 44%, transparent 46%), radial-gradient(circle at 50% 62%, #444 0 30%, #111 32% 48%, transparent 50%); }
.scrawl {
  font-family: "Permanent Marker", cursive; font-size: 13cqw; line-height: 1; color: #f2f2f2;
  transform: rotate(-9deg); opacity: .7; text-align: center; text-shadow: 0 0 1px #fff;
}
.sticker {
  position: relative; text-align: center; color: #111; font-size: 5cqw; line-height: 1.7;
  padding: 5cqw 6cqw; border-radius: 2cqw; box-shadow: 0 1.5cqw 3cqw rgba(0,0,0,.7);
}
.sticker b { display: block; font-weight: normal; }
.sticker::after { content: ''; position: absolute; right: 0; bottom: 0; width: 9cqw; height: 9cqw; border-radius: 0 0 2cqw 0; background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.35) 50%, rgba(255,255,255,.4)); }
.sticker.warn {
  background: #ffd23f; transform: rotate(3deg); width: 86%;
  border: 2.4cqw solid transparent;
  background-image: linear-gradient(#ffd23f, #ffd23f), repeating-linear-gradient(45deg, #111 0 4cqw, #ffd23f 4cqw 8cqw);
  background-origin: border-box; background-clip: padding-box, border-box;
}
.sticker.warn b { font-size: 7cqw; margin-bottom: 2cqw; color: #c40f24; }
.sticker.price { background: #ff2e4d; color: #fff; transform: rotate(-4deg); width: 62%; }
.sticker.price b { font-size: 12cqw; line-height: 1.3; }
.sticker.mom {
  background: #f4f1e8; color: #d0142b; font-family: "Permanent Marker", cursive; font-size: 9cqw; line-height: 1.1;
  transform: rotate(5deg); width: 78%; padding: 4cqw;
}
.sticker.refund { background: #38e8ff; transform: rotate(-2deg); width: 74%; }
.arcade.on .sticker.warn { animation: none; }

.bezel-print {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px; font-size: 8px; letter-spacing: .1em; color: #59618a; white-space: nowrap;
}
.bezel-print .hint { color: var(--accent2); opacity: .75; text-shadow: 0 0 6px currentColor; overflow: hidden; text-overflow: ellipsis; transition: color .4s; }
.arcade:not(.on) .bezel-print .hint { color: #3a3f58; text-shadow: none; }
.bezel-print .links { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bezel-print button { font-size: 8px; color: #b8c2e8; background: #0e1120; border: 2px solid #262b44; border-radius: 4px; padding: 4px 6px; cursor: pointer; }
.bezel-print button:hover { border-color: var(--accent); color: #fff; }
.vol { display: flex; align-items: center; gap: 6px; color: #b8c2e8; cursor: pointer; }
.vol output { width: 3ch; text-align: right; color: var(--accent2); }
.vol input {
  -webkit-appearance: none; appearance: none; width: 90px; height: 10px; margin: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--accent2) 0 var(--p, 80%), #0e1120 var(--p, 80%));
  border: 2px solid #262b44; border-radius: 3px;
}
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 16px; background: #dfe6ff; border: 2px solid #05060c; border-radius: 2px; }
.vol input::-moz-range-thumb { width: 8px; height: 14px; background: #dfe6ff; border: 2px solid #05060c; border-radius: 2px; }
.vol input:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.bezel-print a { color: #38e8ff; text-decoration: none; border-bottom: 2px dotted; }
.bezel-print a:hover { color: #fff; }
@media (max-width: 760px) { .bezel-print .hint { display: none; } .bezel-print { justify-content: center; } .bezel-print .links { margin: 0; } }
/* phones: NAME + SOUND + FULLSCREEN must fit; the volume slider goes (hardware volume keys, SOUND still mutes) */
@media (max-width: 520px) { .bezel-print .vol { display: none; } .bezel-print .links { gap: 6px; } .bezel-print button { padding: 4px 5px; } }

/* ------------------------------------------------- control panel peek */
.panel { position: relative; overflow: hidden; perspective: 900px; background: #04050a; }
.panel-top {
  position: absolute; left: -3%; right: -3%; top: 0; height: 175%;
  display: flex; justify-content: center; align-items: flex-start; gap: 7%;
  padding-top: calc(var(--pn-h) * .14);
  background:
    radial-gradient(ellipse 50% 60% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(255,255,255,.02) 60px 62px),
    linear-gradient(#1b1f33, #0d0f1a 55%);
  border-top: max(4px, calc(var(--pn-h) * .05)) solid var(--accent);
  box-shadow: 0 -6px 26px color-mix(in srgb, var(--accent) 35%, transparent);
  transform-origin: 50% 0; transform: rotateX(40deg);
  transition: border-color .5s, box-shadow .5s;
}
.arcade:not(.on) .panel-top { border-top-color: #2a2d3c; box-shadow: none; }
.ctl { position: relative; flex: none; }
.joy { width: calc(var(--ctl) * 1.5); height: calc(var(--ctl) * 1.15); }
.joy-base {
  position: absolute; left: 50%; top: 58%; width: calc(var(--ctl) * 1.1); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #000 0 20%, #2a2a33 21% 50%, #111 51% 64%, #3a3a46 65% 68%, #08080c 69%);
}
.joy-ball {
  position: absolute; left: 50%; top: 40%; width: calc(var(--ctl) * .82); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #ffd0d8 0 7%, #ff3b4f 24%, #b0102a 66%, #5a0616 100%);
  box-shadow: 0 calc(var(--ctl) * .14) calc(var(--ctl) * .14) rgba(0,0,0,.7);
  transition: transform .07s; pointer-events: none;
}
.joy.l .joy-ball { transform: translate(-85%, -50%); }
.joy.r .joy-ball { transform: translate(-15%, -50%); }
.joy-zone { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; cursor: pointer; z-index: 2; }
.joy-zone.l { left: 0; } .joy-zone.r { right: 0; }

.starts { display: flex; gap: calc(var(--ctl) * .2); padding-top: calc(var(--ctl) * .2); }
.sbtn {
  display: flex; align-items: center; gap: calc(var(--ctl) * .12);
  padding: calc(var(--ctl) * .12) calc(var(--ctl) * .2);
  background: #0a0c16; border: 2px solid #2c3350; border-radius: 6px;
  color: #dfe6ff; font-size: clamp(7px, calc(var(--ctl) * .17), 12px); cursor: pointer;
  box-shadow: 0 4px 0 #000;
}
.sbtn i { width: calc(var(--ctl) * .26); aspect-ratio: 1; border-radius: 3px; background: #ffd23f; box-shadow: 0 0 10px #ffd23f; animation: led 1s steps(1) infinite; }
.sbtn.p2 i { background: #38e8ff; box-shadow: 0 0 10px #38e8ff; animation-delay: .5s; }
.sbtn.pressed, .sbtn:active { transform: translateY(3px); box-shadow: none; }
.arcade:not(.on) .sbtn i { animation: none; opacity: .2; box-shadow: none; }
@keyframes led { 50% { opacity: .25; } }

.abtns { display: flex; gap: calc(var(--ctl) * .4); }
.abtn {
  --c: #ff2e4d;
  position: relative; width: var(--ctl); aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle, #000 0 64%, #23263a 65% 70%, transparent 71%);
}
.abtn::before {
  content: ''; position: absolute; inset: 12%; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255,255,255,.85) 0 7%, transparent 22%),
    radial-gradient(circle at 50% 60%, var(--c), color-mix(in srgb, var(--c) 55%, #000) 100%);
  box-shadow: 0 calc(var(--ctl) * .1) 0 color-mix(in srgb, var(--c) 40%, #000), 0 calc(var(--ctl) * .14) calc(var(--ctl) * .12) rgba(0,0,0,.7);
  transform: translateY(calc(var(--ctl) * -.1)); transition: transform .05s, box-shadow .05s;
}
.abtn.pressed::before, .abtn:active::before {
  transform: translateY(0);
  box-shadow: 0 calc(var(--ctl) * .02) 0 color-mix(in srgb, var(--c) 40%, #000), 0 0 calc(var(--ctl) * .4) var(--c);
}
.abtn span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -62%); font-size: clamp(7px, calc(var(--ctl) * .2), 14px); color: rgba(255,255,255,.75); pointer-events: none; }
.abtn.blue { --c: #2e8bff; }
.abtn.yellow { --c: #ffc21a; }
.abtn.yellow span { color: rgba(60,30,0,.75); }
.ico.btn.yellow { background: radial-gradient(circle at 38% 32%, #fff8 0 8%, #ffc21a 26%, #8a5a00); box-shadow: 0 1cqw 0 #4a3000; }

.coin-btn {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--ctl) * .1);
  padding: calc(var(--ctl) * .1) calc(var(--ctl) * .18);
  background: linear-gradient(#34343e, #18181e); border: 2px solid #4a4a56; border-radius: 6px; cursor: pointer; perspective: 200px;
}
.coin-light {
  font-size: clamp(7px, calc(var(--ctl) * .17), 12px); color: #ff3b3b; background: #2a0505;
  padding: calc(var(--ctl) * .06) calc(var(--ctl) * .1); border-radius: 3px;
}
.arcade.on .coin-light { background: #ff2a2a; color: #fff; box-shadow: 0 0 calc(var(--ctl) * .25) #ff2a2a; animation: coinPulse 1.2s ease-in-out infinite; }
.coin-btn.pressed .coin-light { background: #fff; color: #ff2a2a; }
@keyframes coinPulse { 50% { box-shadow: 0 0 2px #ff2a2a; filter: brightness(.8); } }
.slot { width: calc(var(--ctl) * .1); height: calc(var(--ctl) * .38); background: #000; border-radius: 2px; box-shadow: 0 0 0 2px #777; }
.coin-fly {
  position: absolute; left: 50%; top: 62%; width: calc(var(--ctl) * .34); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6c0, #ffd23f 40%, #b8860b); box-shadow: 0 0 0 2px #8a6400;
  opacity: 0; pointer-events: none; transform: translate(-50%, -260%);
}
.coin-fly.drop { animation: coinDrop .55s ease-in forwards; }
@keyframes coinDrop {
  0% { opacity: 1; transform: translate(-50%, -320%) rotateY(0) scaleX(1); }
  70% { opacity: 1; transform: translate(-50%, -40%) rotateY(540deg) scaleX(.25); }
  100% { opacity: 0; transform: translate(-50%, 0) rotateY(720deg) scaleX(.05); }
}

/* portrait phones: the panel becomes a full, flatter touch controller */
@media (max-aspect-ratio: 4/5) {
  .panel-top { height: 100%; transform: rotateX(14deg); align-items: center; flex-wrap: wrap; align-content: center; gap: 5vw 9vw; padding: 3vw 6vw 5vw; }
  .joy { width: calc(var(--ctl) * 2); height: calc(var(--ctl) * 1.6); }
  .joy-base { width: calc(var(--ctl) * 1.45); }
  .joy-ball { width: calc(var(--ctl) * 1.05); }
  .starts { flex-direction: column; padding: 0; }
}

.noscript { position: fixed; inset: auto 0 0 0; padding: 16px; background: #0b0f2a; font-size: 11px; line-height: 2; text-align: center; z-index: 20; }
.noscript a { color: #38e8ff; }

@media (prefers-reduced-motion: reduce) {
  .marquee.lit .bulb, #bad, #boy, #tLittle, .drip, .drop, .twinkle, #shine, .neon-line, .sbtn i, .arcade.on .coin-light, .power-prompt, .mq-prop, .spark, .mist { animation: none !important; }
  .arcade.shake { animation: none; }
}

/* ---------------- name dialog (one name for every BLB game and leaderboard) ---------------- */
.name-dlg {
  width: min(92vw, 520px); padding: 0; border: 3px solid var(--accent2); border-radius: 6px;
  background: #090b18; color: #dfe6ff; box-shadow: 0 0 0 4px #0b0f2a, 0 0 40px rgba(0,0,0,.8), 0 0 24px var(--accent);
}
.name-dlg::backdrop { background: rgba(2,3,8,.78); }
.name-dlg form { padding: 22px 22px 18px; }
.name-dlg h2 { margin: 0 0 16px; font-size: 16px; color: var(--accent2); text-align: center; text-shadow: 2px 2px 0 #c40f24; }
.name-dlg input {
  display: block; width: 100%; padding: 12px 10px; font: 16px "Press Start 2P", monospace; letter-spacing: .12em;
  text-transform: uppercase; text-align: center; color: #fff; background: #000; border: 2px solid #38e8ff; border-radius: 3px;
}
.name-dlg input::placeholder { color: #3a3f58; }
.name-dlg input:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.name-dlg .err { min-height: 12px; margin: 8px 0 0; font-size: 8px; color: #ff6b80; text-align: center; }
.name-dlg ul { margin: 10px 0 18px; padding: 0 0 0 14px; font-size: 8px; line-height: 1.9; color: #9aa4cc; }
.name-dlg .btns { display: flex; gap: 10px; justify-content: center; }
.name-dlg button { font-size: 10px; padding: 9px 12px; color: #fff; background: #141a38; border: 2px solid #dfe6ff; border-radius: 4px; cursor: pointer; }
.name-dlg button:hover { border-color: var(--accent2); color: var(--accent2); }
#nameSave { background: #c40f24; border-color: #ffd23f; }
