/* The title screen and stream use the arcade framing. Controllers keep a flatter surface. */
:root {
  --screen: #110e2b;
  --case: #241637;
  --case-edge: #3e2754;
  --neon-cyan: #82f4ed;
  --nectar: #ffbc82;
}
body { background-color: #0e0b24; }
.arcade-shell { max-width: 1600px; padding: 20px clamp(18px, 4vw, 70px) 0; }
.arcade-top {
  border-color: #60416f;
  padding: 4px 0 15px;
  box-shadow: none;
}
.arcade-top .brand { color: #ffc0e6; font-size: .96rem; letter-spacing: .09em; }
.arcade-top .toplinks, .play-actions { display: flex; align-items: center; gap: 14px; }
.demo-pill {
  color: #edd4ff;
  border: 1px solid #6d5188;
  padding: 3px 7px;
  font-size: .75rem;
  line-height: 1.35;
}
.crt-toggle {
  min-height: 40px;
  border: 1px solid #675184;
  box-shadow: inset 0 2px #ffffff12, 2px 2px #09071b;
  background: #211936;
  color: #ded0ef;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 750;
}
.crt-toggle:hover { border-color: var(--neon-cyan); }
.crt-toggle[aria-pressed=true] { color: var(--neon-cyan); border-color: #68b8b5; }
.crt-led { display: inline-block; margin-right: 7px; width: 7px; height: 7px; background: #867094; }
.crt-toggle[aria-pressed=true] .crt-led { background: var(--neon-cyan); box-shadow: 0 0 7px #82f4edaa; }
.crt-on::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: url('art/crt-grain.svg') 0 0 / 144px 144px repeat,
    url('art/crt-glass.svg') center / 100% 100% no-repeat;
}
.crt-on .title-world, .crt-on .lobby-scene { border-radius: 4.5% / 8%; }
.crt-on .title-brand img { filter: drop-shadow(1px 0 #82f4ed77) drop-shadow(-1px 0 #ff86cf66) drop-shadow(4px 7px #140b2daa); }
.title-audio { margin: 0; }
.audio-switch { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.audio-switch span { color: var(--neon-cyan); font-weight: 800; }
.audio-switch[aria-pressed=false] span { color: #ae9cbf; }
.dice-stage { position: fixed; inset: 0; z-index: 75; pointer-events: none; background: #100b284f; overflow: hidden; }
.dice-stage[hidden] { display: none; }
.dice-stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.dice-caption {
  position: absolute; top: 66%; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 8px 16px; color: var(--neon-cyan); background: #1a1131; border: 2px solid #7197ad;
  box-shadow: 4px 4px #0a071d; font-weight: 800; font-size: clamp(1rem,3vw,1.45rem);
}
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.arcade-title {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(325px, .8fr);
  align-items: center;
  gap: clamp(25px, 4vw, 68px);
  margin-top: 18px;
  min-height: min(670px, 82vh);
  padding: clamp(26px, 4.5vw, 80px);
  border: 2px solid #765080;
  box-shadow: inset 0 0 0 4px #140d2f, 5px 5px #09071b;
  background: #110c2c;
}
.title-world {
  z-index: -1;
  position: absolute;
  inset: 4px;
  background: linear-gradient(90deg, #10062630, transparent 53%, #0a05273d),
    url('art/night-city.svg') 50% 66% / cover no-repeat;
  image-rendering: pixelated;
}
.title-brand { position: relative; align-self: center; }
.title-brand img {
  display: block;
  width: min(100%, 560px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(4px 7px 0 #140b2dda) drop-shadow(0 0 18px #310c3599);
}
.title-brand h1 { margin-left: -3%; }
.title-description {
  width: fit-content;
  margin-top: 12px;
  padding: 7px 10px;
  background: #17112eea;
  border-left: 3px solid var(--neon-cyan);
  color: #fff0de;
  font-size: clamp(.95rem, 1.75vw, 1.15rem);
}
.title-pixel-party { display: flex; align-items: flex-end; gap: clamp(9px, 2vw, 28px); margin: 22px 0 0; }
.title-pixel-party .sprite {
  width: clamp(28px, 4.7vw, 67px);
  height: clamp(28px, 4.7vw, 67px);
  filter: drop-shadow(3px 4px #110b2b) drop-shadow(0 0 9px #e671cb70);
  transform: translateY(var(--pixel-hop, 0));
}
.title-pixel-party .sprite:nth-child(2) { --pixel-hop: -8px; }
.title-pixel-party .sprite:nth-child(3) { --pixel-hop: 3px; }
.arcade-menu {
  background: #1a1231f5;
  border: 2px solid #a3679e;
  border-top-color: #f087cd;
  box-shadow: inset 0 0 0 4px #291b40, 6px 7px #0b0823dd;
  padding: clamp(18px, 2.3vw, 33px);
  min-width: 0;
}
.mode-buttons { display: grid; gap: 10px; }
.btn { text-shadow: none; }
.arcade-menu .btn, .invite-join .btn, .stream-main .btn, .controller-main .btn {
  border: 2px solid #1a122d;
  box-shadow: inset 0 3px #ffffff55, inset 0 -4px #00000030, 3px 4px #09071b;
}
.arcade-menu .btn.secondary, .stream-main .btn.secondary, .controller-main .btn.secondary {
  color: #ffddf3;
  border-color: #694a85;
  box-shadow: inset 0 2px #ffffff20, inset 0 -3px #0d082b77, 3px 4px #09071b;
  background: #30214d;
}
.arcade-menu .cabinet-primary { color: #17122b; background: #e4ff72; font-size: 1.15rem; }
.arcade-menu .arcade-join { margin-top: 23px; border-top: 1px solid #654c7c; }
.arcade-join.join-card {
  box-shadow: none;
  padding: 19px 0 0;
  border: 0;
  background: none;
  color: #fbebf9;
}
.arcade-join.join-card::before { display: none; }
.arcade-join.join-card h2 { font-size: 1rem; letter-spacing: .025em; }
.join-fields { display: grid; grid-template-columns: minmax(112px, .67fr) minmax(0, 1fr); gap: 10px; }
.arcade-join.join-card label { color: #eddef6; margin-top: 10px; }
.arcade-join.join-card input { background: #120b25; color: #fff1f8; border-color: #684a7d; min-width: 0; }
.arcade-join.join-card input::placeholder { color: #b19ebd; }
.arcade-join.join-card .code-input { font-size: 1rem; letter-spacing: .14em; color: var(--neon-cyan); }
.arcade-join.join-card .btn { background: #452c64; color: #fbebf9; margin-top: 10px; }
.arcade-footer { margin-top: 18px; border-color: #4c365b; padding: 13px 0; }
.invite-join.arcade-panel { background: #211735; border-color: #795583; box-shadow: 5px 5px #09071b; }
.invite-join .arcade-join { padding-top: 0; }
.invite-join .arcade-join h2 { font-size: 1.7rem; }

/* Host display */
.play-actions { margin-left: auto; }
.stream-screen .play-header {
  background: #211534;
  padding: 8px clamp(10px, 1.8vw, 24px);
  border: 1px solid #6d487e;
  box-shadow: inset 0 2px #ffffff15, 3px 3px #0a081e;
}
.stream-screen .play-header>strong { color: #ffc4ea; }
.stream-screen .play-header>span:not(.demo-pill) { color: var(--neon-cyan); }
.stream-screen .stream-main {
  max-width: none;
  margin: 12px 0 0;
  padding-inline: clamp(16px, 3.2vw, 60px);
  border: 1px solid #684975;
  background: linear-gradient(155deg, #211537, #120e2b 58%, #1b1232);
  box-shadow: inset 0 0 0 4px #2f2041, 4px 4px #09071b;
  isolation: isolate;
}
.stream-main:not(:has(.stream-lobby)) { background-image: radial-gradient(#9c68aa23 1px, transparent 1px), linear-gradient(155deg, #211537, #120e2b 58%, #1b1232); background-size: 16px 16px, auto; }
.stream-main:has(.stream-lobby) { position: relative; }
.stream-lobby { padding-block: 32px 12px; }
.lobby-scene {
  position: absolute;
  inset: 5px;
  z-index: -1;
  background: linear-gradient(90deg, #150e34a8, #120b27d1, #150e34a8), url('art/night-city.svg') center 68% / cover no-repeat;
  image-rendering: pixelated;
}
.stream-lobby h1 { color: var(--neon-cyan); text-shadow: 4px 4px #3b4270, 0 0 30px #42d5d454; }
.stream-lobby .join-address { font-size: clamp(1rem,2vw,1.45rem); color: #fff0dc; }
.stream-main .eyebrow { color: var(--nectar); }
.stream-main .host-controls { padding-bottom: 14px; }
.score-strip { border-top: 0; padding-top: 12px; }
.score-chip { background: #211635; border: 1px solid #4b3766; box-shadow: inset 0 2px #ffffff0d, 2px 2px #0b0822; }
.score-chip b { color: var(--nectar); }
.score-chip .sprite { filter: drop-shadow(2px 2px #0d0a23); }
.stream-main .answer-grid .entry { background: #261c3c; border-color: #684984; }
.answer-grid .letter { font-weight: 800; color: var(--neon-cyan); background: #16112d; border-color: #71588d; }
.stream-main .timer-bar #countdown, .controller-main .timer-bar #countdown {
  background: #140e27;
  border: 1px solid #74538b;
  padding: 2px 12px;
  color: var(--neon-cyan);
  box-shadow: inset 0 2px #0006;
}
.stream-main .timer-bar #countdown.urgent, .controller-main .timer-bar #countdown.urgent { color: #ff8abe; }
.story-bubble { border-radius: 2px 10px 10px; box-shadow: 3px 4px #0d0825a8; }
.story-bubble.bubble-player { border-radius: 10px 2px 10px 10px; }
.bubble-speaker { color: #ffd0ee; }
.stream-main .voice-choice {
  --portrait-accent: #c69cff;
  background: linear-gradient(180deg, #2b204b, #221733);
  border: 1px solid #675087;
  border-top: 3px solid var(--portrait-accent);
  box-shadow: inset 0 0 0 3px #382854, 3px 4px #0b0823;
}
.voice-choice[data-personality=barry] { --portrait-accent: #e4ff72; }
.voice-choice[data-personality=iris] { --portrait-accent: #82f4ed; }
.voice-choice[data-personality=rex] { --portrait-accent: #ff86cf; }
.stream-main .gm-portrait {
  width: clamp(62px, 7vw, 92px);
  height: clamp(62px, 7vw, 92px);
  background: repeating-linear-gradient(0deg, #32214d 0 4px, #241b3c 4px 8px);
  box-shadow: 2px 2px #110c29;
  border: 1px solid #75568d;
}
.stream-roll .pixel-die {
  width: 38px;
  height: 38px;
  background-color: #231e3e;
  border: 3px solid #92ecdf;
  box-shadow: 3px 3px #0b081e, inset 0 0 0 2px #58a1a1;
  transform: rotate(-7deg);
  background-image: linear-gradient(#e0fff2,#e0fff2),linear-gradient(#e0fff2,#e0fff2),linear-gradient(#e0fff2,#e0fff2);
  background-size: 4px 4px;
  background-position: 6px 6px, center, 22px 22px;
  background-repeat: no-repeat;
}

/* Phone controllers stay single column. */
.controller-screen .play-header { border-bottom-color: #694a85; }
.controller-main .entry, .controller-main .voice-choice {
  border: 1px solid #684984;
  background: #271c3d;
  box-shadow: 2px 3px #0a071d;
}
.controller-main .voice-choice .gm-portrait { width: 42px; height: 42px; background: #302044; }
.controller-main .controller-wait .sprite { filter: drop-shadow(3px 3px #0c0826); }
@media(max-width: 800px) {
  .arcade-title { grid-template-columns: 1fr; min-height: 0; }
  .title-world { background-position: center top; background-size: cover; }
  .title-brand img { width: min(80%, 380px); }
  .title-pixel-party { margin-top: 13px; }
}
@media(max-width: 520px) {
  .arcade-shell { padding: 12px 10px 0; }
  .arcade-top { gap: 5px; padding-bottom: 8px; }
  .arcade-top .brand { font-size: .8rem; letter-spacing: .03em; gap: 5px; }
  .arcade-top .brand img { width: 24px; height: 24px; }
  .arcade-top .toplinks, .play-actions { gap: 8px; }
  .arcade-top .arcade-rules { font-size: .73rem; }
  .arcade-top .demo-pill { display: none; }
  .crt-toggle { min-height: 44px; padding-inline: 7px; font-size: .73rem; }
  .crt-led { margin-right: 5px; }
  .arcade-title { margin-top: 10px; padding: 19px 13px; gap: 20px; }
  .title-brand img { width: clamp(210px,72vw,320px); max-width: 100%; }
  .title-description { margin-top: 0; }
  .arcade-footer { gap: 8px; font-size: .72rem; }
  .controller-screen .play-header { flex-wrap: wrap; }
  .controller-screen .play-header>strong { max-width: 30%; }
  .controller-screen .play-header>span { font-size: .8rem; }
  .play-header .game-menu summary { padding: 7px 0; }
}
.scene-marquee { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.scene-marquee .scene-title { margin: 0; }
.stream-main .scene-marquee .gm-portrait { width: 48px; height: 48px; }
.select-hud { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; }
.select-hud .stream-instruction { margin-bottom: 0; }
@media(min-width:901px) and (max-height:900px) {
  .stream-main:has(.select-hud) .voice-description { display: none; }
  .stream-main:has(.select-hud) .cast-options { gap: 12px; }
  .stream-main:has(.select-hud) .gm-portrait { width: 70px; height: 70px; }
  .stream-main:has(.select-hud) .voice-choice { padding: 16px; }
  .stream-main:has(.select-hud) .voice-actions { margin-top: auto; }
}
@media(min-width:901px) and (max-height:800px) {
  .stream-main:has(.select-hud) { padding-top: 16px; padding-bottom: 10px; }
  .select-hud h1 { font-size: clamp(2rem,3.2vw,2.55rem); }
  .stream-main:has(.select-hud) .cast-options { margin-block: 12px; }
  .stream-main:has(.select-hud) .gm-portrait { width: 58px; height: 58px; }
  .stream-main:has(.select-hud) .voice-choice { padding: 14px; gap: 10px; }
  .stream-main:has(.select-hud) .voice-choice h2 { font-size: 1.2rem; }
  .stream-main:has(.select-hud) .progress-track { margin-block: 10px 6px; }
  .stream-main:has(.select-hud) .host-controls { margin-top: 9px; padding-block: 0 6px; }
}

@media(max-width:520px) {
  .arcade-top .brand span { max-width: 7ch; }
  .arcade-top .toplinks { gap: 6px; }
  .title-audio summary { padding-inline: 5px; font-size: .75rem; }
}
