@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined');

:root {
  --bg-deep: #02030c;
  --bg-mid: #090f2b;
  --bg-bright: #101742;
  --ink: #f2f8ff;
  --muted: #91a3c3;
  --neon-cyan: #05e6ff;
  --neon-pink: #ff2da8;
  --neon-lime: #8cff59;
  --danger: #ff5b6b;
  --panel: rgba(6, 14, 41, 0.84);
  --panel-line: rgba(5, 230, 255, 0.35);
  --ring: rgba(255, 45, 168, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% -5%, rgba(255, 45, 168, 0.2), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(5, 230, 255, 0.18), transparent 40%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid) 52%, var(--bg-bright));
  color: var(--ink);
  font-family: 'VT323', monospace;
  letter-spacing: 0.2px;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.28;
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 1.1rem auto 2rem;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: clamp(60px, 9vw, 92px);
  aspect-ratio: 1;
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(5, 230, 255, 0.35);
  object-fit: cover;
}

.title-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.title-stack h1 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.88rem, 1.9vw, 1.32rem);
  line-height: 1.35;
  background: linear-gradient(90deg, var(--neon-cyan), #d7ffff, var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.1;
}

.room-pill {
  font-family: 'Press Start 2P', monospace;
  background: rgba(5, 230, 255, 0.12);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 0.85rem;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 24px rgba(5, 230, 255, 0.08), 0 0 24px rgba(5, 230, 255, 0.08);
}

.panel h2,
.panel h3 {
  margin: 0 0 0.65rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #ecf5ff;
}

.panel p {
  margin: 0.2rem 0 0.6rem;
  color: var(--muted);
  font-size: 1.25rem;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(5, 230, 255, 0.22);
  border-radius: 12px;
  padding: 0.5rem 0.55rem;
  background: rgba(7, 18, 52, 0.65);
}

.step-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--neon-cyan);
  border: 1px solid rgba(5, 230, 255, 0.45);
  border-radius: 999px;
  width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.step-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 1rem;
  line-height: 1.05;
}

.step-copy strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.step-copy span {
  color: var(--muted);
}

label {
  display: block;
  font-size: 1.15rem;
  color: var(--ink);
}

input[type='text'],
input[type='email'],
textarea,
select {
  width: 100%;
  background: rgba(5, 13, 40, 0.95);
  border: 1px solid rgba(5, 230, 255, 0.35);
  border-radius: 10px;
  color: var(--ink);
  padding: 0.7rem;
  font: inherit;
  font-size: 1.2rem;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--neon-cyan);
}

textarea {
  resize: vertical;
  min-height: 84px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.56rem 0.8rem;
  background: linear-gradient(125deg, rgba(5, 230, 255, 0.26), rgba(255, 45, 168, 0.22));
  color: #f7fcff;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.64rem;
  line-height: 1.3;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(5, 230, 255, 0.35);
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}

.btn-main {
  border-color: rgba(5, 230, 255, 0.45);
}

.btn-danger {
  background: linear-gradient(125deg, rgba(255, 91, 107, 0.4), rgba(255, 45, 168, 0.3));
  border-color: rgba(255, 91, 107, 0.7);
}

.btn-muted {
  background: rgba(27, 43, 80, 0.7);
  border-color: rgba(123, 149, 205, 0.45);
}

.info-text {
  color: var(--muted);
  font-size: 1.08rem;
}

.status-line {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  line-height: 1.45;
  color: var(--neon-lime);
  min-height: 1rem;
}

.status-line.error {
  color: var(--danger);
}

.meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(5, 230, 255, 0.16);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  transition: width 180ms linear;
}

.question-card {
  border: 1px solid rgba(255, 45, 168, 0.35);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(8, 13, 34, 0.82);
}

.question-card-emphasis {
  border-color: rgba(5, 230, 255, 0.5);
  box-shadow: 0 0 20px rgba(5, 230, 255, 0.15);
}

.question-text {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
  line-height: 1.18;
  margin: 0;
  color: #ffffff;
  text-wrap: pretty;
}

.join-shell .question-text,
.screen-mode .question-text {
  font-size: clamp(2.45rem, 6vw, 4.7rem);
  line-height: 1.06;
}

.choice-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.choice-btn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(5, 230, 255, 0.4);
  border-radius: 10px;
  padding: 0.76rem 0.8rem;
  font: inherit;
  color: var(--ink);
  font-size: clamp(1.24rem, 2.2vw, 1.58rem);
  background: rgba(7, 20, 48, 0.95);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.join-shell .choice-btn,
.screen-mode .choice-btn {
  font-size: clamp(0.96rem, 2.35vw, 1.88rem);
  line-height: 1.14;
}

.choice-btn .opt {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--neon-cyan);
  margin-right: 0.5rem;
}

.choice-btn:hover {
  border-color: rgba(255, 45, 168, 0.8);
  box-shadow: 0 0 18px rgba(255, 45, 168, 0.18);
  transform: translateY(-1px);
}

.choice-btn.correct {
  border-color: var(--neon-lime);
  box-shadow: 0 0 16px rgba(140, 255, 89, 0.32);
}

.choice-btn.wrong {
  border-color: var(--danger);
}

.choice-btn.locked {
  opacity: 0.72;
  cursor: not-allowed;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.avatar-tile {
  border: 1px solid rgba(5, 230, 255, 0.42);
  border-radius: 11px;
  background: rgba(6, 15, 44, 0.8);
  padding: 0.32rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.avatar-tile:hover {
  border-color: rgba(5, 230, 255, 0.8);
  transform: translateY(-1px);
}

.avatar-media {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.avatar-icon {
  display: grid;
  place-items: center;
  background: rgba(5, 230, 255, 0.14);
  color: var(--neon-cyan);
  font-size: 1.9rem;
}

.avatar-tile.selected {
  border-color: var(--neon-lime);
  box-shadow: 0 0 0 2px rgba(140, 255, 89, 0.34), 0 0 16px rgba(140, 255, 89, 0.28);
  color: #f5ffe8;
  transform: translateY(-1px);
}

.leaderboard {
  display: grid;
  gap: 0.5rem;
}

.leader-row {
  display: grid;
  grid-template-columns: auto 40px 1fr auto;
  gap: 0.58rem;
  align-items: center;
  background: rgba(9, 18, 46, 0.86);
  border: 1px solid rgba(5, 230, 255, 0.28);
  border-radius: 11px;
  padding: 0.4rem 0.5rem;
}

.leader-self {
  border-color: rgba(140, 255, 89, 0.65);
  box-shadow: 0 0 14px rgba(140, 255, 89, 0.2);
}

.leader-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--neon-cyan);
}

.leader-avatar {
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  border-radius: 9px;
  object-fit: cover;
}

.leader-avatar-icon {
  display: grid;
  place-items: center;
  background: rgba(5, 230, 255, 0.14);
  color: var(--neon-cyan);
  font-size: 1.3rem;
}

.leader-main {
  min-width: 0;
}

.leader-name {
  font-size: 1.22rem;
  color: #f6fbff;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-meta {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1;
}

.leader-score-wrap {
  text-align: right;
}

.leader-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--neon-lime);
}

.podium-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 45, 168, 0.5);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(35, 10, 45, 0.82), rgba(10, 22, 48, 0.84));
  padding: 0.72rem;
}

.podium-headline {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: #ffe08b;
  margin-bottom: 0.52rem;
  letter-spacing: 0.04em;
}

.podium-stage {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: end;
  min-height: 11.4rem;
}

.podium-slot {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  border: 1px solid rgba(5, 230, 255, 0.45);
  border-radius: 12px;
  background: rgba(7, 20, 48, 0.9);
  padding: 0.48rem 0.4rem 0.54rem;
  min-height: 8.4rem;
}

.podium-slot.rank-1 {
  min-height: 10.8rem;
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.32);
}

.podium-slot.rank-2 {
  min-height: 9.5rem;
  border-color: rgba(206, 230, 255, 0.82);
}

.podium-slot.rank-3 {
  min-height: 8.9rem;
  border-color: rgba(255, 170, 118, 0.8);
}

.podium-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  color: #ffffff;
}

.podium-slot .leader-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.podium-name {
  font-size: 1.02rem;
  line-height: 1;
  color: #ffffff;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.56rem;
  color: #d4ff92;
  line-height: 1;
}

.podium-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.podium-particle {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: podiumFall 2.25s cubic-bezier(0.22, 0.74, 0.2, 0.99) forwards;
}

@keyframes podiumFall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--podium-drift, 0px), 315px, 0) rotate(var(--podium-spin, 540deg));
    opacity: 0;
  }
}

.timer {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.2rem, 4.4vw, 2.4rem);
  line-height: 1;
  color: #f9ff9a;
  text-shadow: 0 0 8px rgba(249, 255, 154, 0.72), 0 0 24px rgba(140, 255, 89, 0.5);
  animation: timerPulse 1.7s ease-in-out infinite;
}

@keyframes timerPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.88;
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 45, 168, 0.5);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #ffd7ef;
}

.tag.final {
  border-color: rgba(140, 255, 89, 0.8);
  color: var(--neon-lime);
}

.qr-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.qr-wrap img {
  width: 180px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(5, 230, 255, 0.4);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.35rem;
}

.hidden {
  display: none !important;
}

.small {
  font-size: 0.95rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.95rem;
}

.screen-mode .screen-hidden {
  display: none !important;
}

.screen-mode .page-shell {
  width: min(1380px, calc(100% - 1.5rem));
  padding: 0.35rem 0.2rem 0.7rem;
}

.screen-mode #host-main-panel {
  grid-column: span 8;
}

.screen-mode #host-scoreboard-panel {
  grid-column: span 4;
}

.screen-mode #host-display-qr-panel {
  display: flex !important;
}

.screen-mode #host-display-qr-panel .qr-wrap img {
  width: min(240px, 34vw);
}

@media (max-width: 990px) {
  .span-7,
  .span-8,
  .span-6,
  .span-5,
  .span-4,
  .span-3 {
    grid-column: span 12;
  }

  .step-grid {
    grid-template-columns: 1fr;
  }

  .timer {
    font-size: clamp(1.15rem, 7vw, 2rem);
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: calc(100% - 0.8rem);
    margin-top: 0.6rem;
  }

  .panel {
    padding: 0.68rem;
    border-radius: 12px;
  }

  .btn {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .leader-row {
    grid-template-columns: auto 40px 1fr;
  }

  .leader-score-wrap {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 1.9rem;
  }

  .podium-stage {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.cast-receiver-body {
  min-height: 100vh;
  padding: 0.8rem 1rem 1rem;
}

.cast-stage {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: min(1880px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cast-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cast-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cast-logo {
  width: clamp(88px, 8vw, 140px);
  border-radius: 14px;
  border: 1px solid rgba(5, 230, 255, 0.45);
  box-shadow: 0 0 22px rgba(5, 230, 255, 0.32);
}

.cast-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cast-room {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.62rem, 1.4vw, 0.92rem);
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

.cast-theme {
  font-size: clamp(1.35rem, 2.2vw, 2.4rem);
  line-height: 1;
  color: #f4faff;
}

.cast-hud-grid {
  display: grid;
  grid-template-columns: minmax(230px, 360px) 1fr;
  gap: 0.8rem;
}

.cast-clock-card {
  border: 1px solid rgba(5, 230, 255, 0.45);
  border-radius: 14px;
  background: rgba(7, 20, 48, 0.88);
  padding: 0.75rem 0.82rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.42rem;
}

.cast-leader-panel {
  border: 1px solid rgba(5, 230, 255, 0.42);
  border-radius: 14px;
  background: rgba(6, 16, 44, 0.86);
  padding: 0.65rem;
}

.cast-leader-panel h3 {
  margin: 0 0 0.45rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: var(--neon-cyan);
}

.cast-phase {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 1.3vw, 0.86rem);
  color: #ffd7ef;
}

.cast-timer {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.5rem, 4.2vw, 3rem);
  color: #f9ff9a;
  text-shadow: 0 0 10px rgba(249, 255, 154, 0.75), 0 0 26px rgba(140, 255, 89, 0.45);
}

.cast-join-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid rgba(5, 230, 255, 0.4);
  border-radius: 16px;
  background: rgba(6, 16, 44, 0.82);
}

.cast-qr {
  width: min(100%, 260px);
  border-radius: 12px;
  border: 1px solid rgba(5, 230, 255, 0.38);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.35rem;
}

.cast-join-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  color: var(--neon-cyan);
}

.cast-join-url {
  text-align: center;
  word-break: break-all;
  color: var(--muted);
  font-size: 1.15rem;
}

.cast-main {
  padding: 0.95rem;
  border: 1px solid rgba(5, 230, 255, 0.42);
  border-radius: 16px;
  background: rgba(5, 14, 38, 0.82);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cast-question {
  margin: 0;
  font-size: clamp(3rem, 7.4vw, 5.9rem);
  line-height: 1.08;
  color: #ffffff;
  text-wrap: pretty;
}

.cast-choices {
  display: grid;
  gap: 0.58rem;
}

.cast-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.62rem;
  padding: 0.62rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(5, 230, 255, 0.34);
  background: rgba(7, 20, 48, 0.94);
}

.cast-choice-opt {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.63rem, 1vw, 0.92rem);
  color: var(--neon-cyan);
}

.cast-choice-text {
  font-size: clamp(1.2rem, 2.95vw, 2.36rem);
  line-height: 1.05;
}

.cast-choice.correct {
  border-color: rgba(140, 255, 89, 0.86);
  box-shadow: 0 0 18px rgba(140, 255, 89, 0.26);
}

.cast-choice.wrong {
  border-color: rgba(255, 91, 107, 0.66);
  opacity: 0.84;
}

.cast-reveal {
  border: 1px solid rgba(140, 255, 89, 0.56);
  border-radius: 12px;
  padding: 0.68rem 0.74rem;
  background: rgba(15, 42, 26, 0.55);
  display: grid;
  gap: 0.35rem;
}

.cast-reveal-row {
  font-size: clamp(1.2rem, 2.1vw, 2rem);
  color: #eaffda;
}

.cast-reveal-row strong {
  color: #ffffff;
}

.cast-correct-list {
  color: #c6ffd2;
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  line-height: 1.1;
}

.cast-complete {
  border: 1px solid rgba(255, 45, 168, 0.5);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  background: rgba(38, 13, 46, 0.58);
  color: #ffeaf8;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.58rem;
}

.cast-complete-text {
  position: relative;
  z-index: 3;
  font-size: clamp(1.16rem, 1.9vw, 1.8rem);
}

.cast-complete .podium-stage {
  min-height: 9.8rem;
  z-index: 3;
}

.cast-complete .podium-slot {
  min-height: 7.35rem;
  background: rgba(7, 20, 48, 0.88);
}

.cast-complete .podium-slot.rank-1 {
  min-height: 9.2rem;
}

.cast-complete .podium-slot.rank-2 {
  min-height: 8.2rem;
}

.cast-complete .podium-slot.rank-3 {
  min-height: 7.8rem;
}

.cast-complete .podium-name {
  font-size: clamp(1rem, 1.6vw, 1.34rem);
}

.cast-complete .podium-score {
  font-size: clamp(0.52rem, 0.88vw, 0.7rem);
}

.cast-status-note {
  min-height: 1.2rem;
  color: var(--neon-lime);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
}

.cast-status-note.error {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .cast-hud-grid {
    grid-template-columns: 1fr;
  }

  .cast-join-panel {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .cast-qr {
    width: 180px;
  }
}

@media (max-width: 640px) {
  .cast-receiver-body {
    padding: 0.55rem;
  }

  .cast-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.home-minimal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem 1rem 4.4rem;
}

.home-flow-shell {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95rem;
}

.home-hero {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.72rem;
  text-align: center;
}

.home-hero-logo {
  width: clamp(120px, 25vw, 220px);
}

.home-hero-title {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 3vw, 1.6rem);
  line-height: 1.35;
  background: linear-gradient(90deg, var(--neon-cyan), #d7ffff, var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero-subtitle {
  margin: 0;
  color: #f4faff;
  text-transform: lowercase;
  font-size: clamp(1.15rem, 3.2vw, 2rem);
  line-height: 1;
}

.home-create-btn {
  min-width: 176px;
}

#wizard-step-settings .row .btn {
  flex: 1 1 11rem;
}

.home-wizard {
  width: min(640px, 100%);
  padding: 0.95rem;
}

.home-stats-footer {
  position: fixed;
  left: 50%;
  bottom: 0.72rem;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 1rem));
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.home-stats-line {
  pointer-events: auto;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.46rem, 1.2vw, 0.62rem);
  line-height: 1.45;
  color: #d6fbff;
  border: 1px solid rgba(5, 230, 255, 0.4);
  border-radius: 999px;
  background: rgba(6, 16, 44, 0.82);
  box-shadow: 0 0 16px rgba(5, 230, 255, 0.15);
  padding: 0.42rem 0.72rem;
  text-align: center;
}

.join-topbar {
  margin-bottom: 0.7rem;
}

.join-top-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 6.4rem;
}

.join-top-timer {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.8rem, 2.2vw, 1rem);
  line-height: 1;
  color: #f2fcff;
}

.join-top-timer.danger {
  color: #ff5f6d;
  text-shadow: 0 0 10px rgba(255, 95, 109, 0.45);
}

.join-top-players {
  font-size: 0.82rem;
  line-height: 1;
  color: #cce7ff;
}

.join-hud-grid {
  display: grid;
  grid-template-columns: minmax(230px, 320px) 1fr;
  gap: 0.7rem;
  align-items: stretch;
}

.join-clock-card {
  border: 1px solid rgba(5, 230, 255, 0.45);
  border-radius: 13px;
  padding: 0.68rem 0.75rem;
  background: rgba(7, 20, 48, 0.88);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}

.join-mini-board {
  display: grid;
  gap: 0.45rem;
  padding: 0.48rem;
}

.join-mini-row {
  display: grid;
  grid-template-columns: auto 40px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid rgba(5, 230, 255, 0.35);
  border-radius: 11px;
  padding: 0.4rem 0.52rem;
}

.join-mini-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  color: #ffffff;
  min-width: 1.35rem;
  text-align: center;
}

.join-mini-main {
  min-width: 0;
}

.join-mini-name {
  font-size: 1.22rem;
  color: #f7fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.join-mini-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.64rem;
  color: #ffffff;
  min-width: 2.6rem;
  text-align: right;
}

.join-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.join-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 11px;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.join-color-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.7);
}

.join-color-swatch.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 0 18px rgba(255, 255, 255, 0.22);
}

#solo-summary-panel {
  border-color: rgba(140, 255, 89, 0.45);
  background: rgba(7, 21, 47, 0.9);
}

#solo-summary-panel h2 {
  margin: 0;
  font-size: 0.92rem;
}

#solo-share-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.95rem;
}

@media (max-width: 940px) {
  .join-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .join-top-meta {
    align-items: flex-start;
  }

  .join-hud-grid {
    grid-template-columns: 1fr;
  }
}

body.auth-locked .page-shell {
  filter: blur(10px) saturate(0.45);
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 8, 24, 0.7);
  backdrop-filter: blur(5px);
}

.auth-card {
  width: min(460px, calc(100% - 1rem));
  border: 1px solid rgba(5, 230, 255, 0.45);
  border-radius: 15px;
  background: rgba(6, 15, 42, 0.92);
  box-shadow: 0 0 22px rgba(5, 230, 255, 0.2);
  padding: 0.9rem;
  display: grid;
  gap: 0.62rem;
}

.auth-card h2 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.76rem;
  line-height: 1.4;
}

#auth-form {
  align-items: stretch;
}

#auth-form input {
  min-width: 0;
  flex: 1;
}

#auth-message.error {
  color: var(--danger);
}
