﻿:root {
  color-scheme: dark;
  --panel: rgba(12, 16, 24, 0.78);
  --panel-strong: rgba(9, 13, 20, 0.9);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: rgba(244, 247, 255, 0.72);
  --accent: #ffb300;
  --accent-2: #8cf0ff;
  --accent-3: #ff5e66;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
}
body {
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 184, 54, 0.13), transparent 20%),
    linear-gradient(180deg, #18243a 0%, #0b111c 56%, #06080d 100%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

#menu-start:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.35); }
#online-status { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 54px; padding: 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; background: rgba(19,35,58,.55); }
#online-status.is-ready { border-color: rgba(125,255,150,.72); background: rgba(47,122,79,.34); }

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.scene__backdrop,
#game,
.hud {
  position: absolute;
  inset: 0;
}

.scene__backdrop {
  background:
    radial-gradient(circle at 50% 18%, rgba(140, 240, 255, 0.12), transparent 34%),
    radial-gradient(circle at 30% 12%, rgba(255, 179, 0, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(9, 15, 24, 0.2), rgba(9, 15, 24, 0.58) 42%, rgba(5, 8, 12, 0.94));
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  gap: 8px;
}

.hud__top {
  display: grid;
  grid-template-columns: minmax(170px, 0.82fr) minmax(240px, 1fr) minmax(170px, 0.82fr);
  gap: 8px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hud-card,
.screen-card,
.countdown-card,
.menu-chip,
.result-pill,
.primary-btn,
.secondary-btn {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hud-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0 4px;
  min-width: 0;
}

.hud-card--right { text-align: right; }
.hud-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.hud-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.hud-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #08111d;
  background: linear-gradient(90deg, #ffd36f, #ff9a3d);
}
.hud-message {
  font-size: 12px;
  color: var(--text);
}
.hud-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1px;
}
.hud-sub {
  color: var(--muted);
  font-size: 11px;
}

.overlay {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
}

.screen {
  display: none;
  width: min(1060px, calc(100vw - 24px));
}
.screen--active { display: block; }

.screen-card,
.countdown-card {
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  background: var(--panel-strong);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.screen-card h1 {
  margin: 0;
  line-height: 1;
  font-size: clamp(34px, 4vw, 58px);
}

.screen-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.menu-chip {
  border-radius: 20px;
  padding: 16px;
  text-align: left;
}

.menu-chip__title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.menu-chip__text,
.menu-note,
.results-footer {
  color: var(--muted);
  line-height: 1.5;
}

.menu-chip__text {
  font-size: 15px;
}

.menu-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.option-btn,
.primary-btn,
.secondary-btn,
.game-bar__btn {
  appearance: none;
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  pointer-events: auto;
}

.primary-btn,
.secondary-btn {
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.32), rgba(140, 240, 255, 0.18));
}

.secondary-btn {
  background: rgba(10, 16, 31, 0.72);
}

.primary-btn:hover,
.secondary-btn:hover,
.game-bar__btn:hover {
  transform: translateY(-1px);
}

.menu-note {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.countdown-card {
  min-width: min(360px, 100%);
}

.countdown-number {
  font-size: clamp(72px, 12vw, 126px);
  font-weight: 900;
  color: #ffe7a4;
  text-shadow: 0 0 24px rgba(255, 211, 111, 0.4);
}

.countdown-text {
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.results-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 94, 102, 0.26), rgba(255, 179, 0, 0.24));
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}

.results-subtitle {
  margin-top: 10px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.result-pill {
  border-radius: 20px;
  padding: 16px;
}

.result-pill span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.result-pill strong {
  font-size: 24px;
}

.game-bar {
  pointer-events: auto;
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 10px;
  z-index: 7;
}

.game-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  text-decoration: none;
}

.game-bar__btn--primary {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.3), rgba(255, 94, 102, 0.2));
}

.game-bar__btn--secondary {
  background: rgba(10, 16, 31, 0.72);
}

body.child-view .hud {
  padding: 6px;
  gap: 4px;
}

body.child-view .hud__top {
  padding: 4px 6px;
  gap: 4px;
  border-radius: 18px;
}

body.child-view .hud-card {
  padding: 0 2px;
}

body.child-view .hud-label {
  font-size: 8px;
  margin-bottom: 1px;
}

body.child-view .hud-title {
  font-size: 10px;
  margin-bottom: 1px;
}

body.child-view .hud-message,
body.child-view .hud-sub {
  display: none;
}

body.child-view .hud-value {
  font-size: 14px;
}

body.child-view .game-bar,
body.child-view .menu-actions,
body.child-view [data-role-picker] {
  display: none !important;
}

body.child-view .overlay {
  padding: 8px;
}

body.child-view .screen-card,
body.child-view .countdown-card {
  padding: 14px 12px;
  border-radius: 20px;
}

body.child-view .screen-card h1 {
  font-size: clamp(28px, 5vw, 40px);
}

body.child-view .screen-card p {
  font-size: 14px;
}

body.child-view .menu-grid,
body.child-view .results-grid {
  gap: 8px;
}

body.child-view .menu-chip,
body.child-view .result-pill {
  padding: 10px;
}

body.child-view .menu-chip__title {
  font-size: 10px;
  margin-bottom: 6px;
}

body.child-view .menu-chip__text {
  font-size: 12px;
}

body.child-view .menu-actions {
  margin-top: 12px;
  gap: 8px;
}

body.child-view .game-bar {
  right: 8px;
  bottom: 8px;
  gap: 8px;
}

body.child-view .game-bar__btn {
  min-width: 100px;
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .hud__top { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr) minmax(0, 0.82fr); }
  .hud-card--right,
  .hud-card--stats { text-align: inherit; }
  .menu-grid,
  .results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hud { padding: 6px; }
  .overlay { padding: 10px; }
  .screen-card,
  .countdown-card { padding: 18px; }
  .menu-chip { padding: 14px; }
  .hud__top { padding: 4px 6px; gap: 4px; }
  .hud-card { padding: 0 2px; }
  .hud-sub,
  .hud-message { display: none; }
  .hud-title { font-size: 10px; margin: 0; }
  .hud-value { font-size: 16px; }
  .hud-label,
  .hud-sub,
  .hud-message { font-size: 9px; }
  .hud-title { font-size: 11px; }
  .hud-value { font-size: 16px; }
  .game-bar {
    right: 10px;
    bottom: 62px;
    flex-direction: column;
  }
  .game-bar__btn {
    min-width: 104px;
    padding: 10px 14px;
  }
}
@media (max-width: 900px) and (orientation: landscape) {
  .hud { padding: 6px; gap: 6px; }
  .hud__top { padding: 4px 6px; gap: 4px; }
  .hud-sub, .hud-message { display: none; }
  .hud-label { font-size: 9px; margin-bottom: 2px; }
  .hud-title { font-size: 10px; margin-bottom: 2px; }
  .hud-value { font-size: 15px; }
  .overlay { padding: 8px; }
  .screen-card, .countdown-card { padding: 16px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
  .menu-chip { padding: 12px; }
  .menu-actions { margin-top: 14px; gap: 8px; }
  .game-bar { right: 8px; bottom: 8px; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .game-bar__btn { min-width: 100px; padding: 10px 12px; }
}

