/* OpenClaw-inspired: тёмный космический фон, коралловый акцент, pill-кнопки */

:root {
  --bg: #0a0a0a;
  --bg-soft: rgba(255, 255, 255, 0.04);
  --bg-elev: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f5;
  --text-muted: #8a8a8a;
  --text-soft: #555555;
  --accent: #ff5e57;
  --accent-2: #ff8a8a;
  --accent-hover: #ff726b;
  --accent-soft: rgba(255, 94, 87, 0.15);
  --accent-grad: linear-gradient(135deg, #ff5e57 0%, #ff8a8a 100%);
  --success: #4ade80;
  --success-grad: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  --danger: #f87171;
  --danger-grad: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  --gold: #fbbf24;
  --silver: #cbd5e1;
  --bronze: #d97757;
  --radius: 14px;
  --radius-pill: 999px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 32px rgba(255, 94, 87, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(255, 94, 87, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(138, 80, 255, 0.05) 0%, transparent 50%),
    radial-gradient(1px 1px at 25% 18%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 70% 35%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 10% 85%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 15% 50%, rgba(255,255,255,0.2), transparent);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.6em 1.3em;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
  backdrop-filter: blur(8px);
}
button:hover { background: var(--bg-elev); border-color: var(--border-strong); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.35; cursor: not-allowed; }

button.primary {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-grad); filter: brightness(1.1); }
button.success {
  background: var(--success-grad);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
button.success:hover { filter: brightness(1.1); }
button.danger {
  background: var(--danger-grad);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
button.danger:hover { filter: brightness(1.1); }
button.ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
button.ghost:hover { background: var(--bg-soft); color: var(--text); }

input[type="text"], input[type="number"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65em 1em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }

/* === SETUP === */
.setup-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  height: 100%;
  overflow-y: auto;
}
.setup-page h1 {
  font-size: 2.5rem; margin-bottom: 1.8rem; letter-spacing: -0.03em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.setup-page h2 {
  font-size: 0.8rem; margin: 1.8rem 0 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
}
.team-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.8rem; }
.team-row { display: flex; gap: 0.5rem; align-items: center; }
.team-row input { flex: 1; }
.rubric-grid { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
.rubric-check {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.rubric-check:hover { background: var(--bg-soft); border-color: var(--accent); }
.rubric-check input { width: 1.1em; height: 1.1em; cursor: pointer; }
.toggles { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.toggle {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.toggle:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.actions { display: flex; gap: 0.6rem; margin-top: 1.8rem; }
.actions button { padding: 0.85em 1.8em; font-size: 1rem; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1rem; }
.qr-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border);
}
.qr-card img { width: 100%; max-width: 160px; }
.qr-card h3 { font-size: 1rem; margin-bottom: 0.5rem; color: #1a1a1a; }
.qr-card a { display: block; font-size: 0.72rem; color: #555; word-break: break-all; margin-top: 0.4rem; text-decoration: none; }
.hint { color: var(--text-muted); font-size: 0.85rem; margin: 0.4rem 0; }
.hint code { background: var(--bg-soft); padding: 0.1em 0.4em; border-radius: 4px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; color: var(--accent-2); }
.error { color: var(--danger); padding: 0.4rem 0; font-size: 0.9rem; }

/* === HOST === */
.host-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  padding: 0.8rem 1rem 0.6rem;
  gap: 0.7rem;
}
.host-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}
.header-info { display: flex; align-items: baseline; gap: 0.7rem; }
.current-team-banner {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.current-team-banner::before { content: "→ "; color: var(--text-soft); font-weight: 400; -webkit-text-fill-color: var(--text-soft); }
.tools { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tools button { padding: 0.4em 0.95em; font-size: 0.78rem; }

/* Main grid: board left, scoreboard right */
.host-main {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0.9rem;
  min-height: 0;
}

.board-grid {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
}
.rubric-col { display: grid; grid-template-rows: 4.8rem repeat(5, minmax(0, 1fr)); gap: 0.45rem; min-height: 0; }
.rubric-title {
  background: var(--bg-card);
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  line-height: 1.15;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.cell {
  background: var(--accent-grad);
  color: #fff;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(0.9rem, 1.8vw, 1.8rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
  user-select: none;
  min-height: 0;
  border: 1px solid transparent;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(255, 94, 87, 0.2);
}
.cell:hover:not(.closed):not(.disabled) {
  transform: scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(255, 94, 87, 0.4);
}
.cell.closed {
  background: var(--bg-card);
  color: transparent;
  cursor: default;
  border-color: var(--border);
  position: relative;
  box-shadow: none;
  overflow: hidden;
}
.cell.closed::before,
.cell.closed::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 3px;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 2px;
  transform-origin: center;
}
.cell.closed::before {
  transform: translateY(-50%) rotate(var(--cross-angle, 22deg));
}
.cell.closed::after {
  transform: translateY(-50%) rotate(calc(var(--cross-angle, 22deg) * -1));
}
.cell.disabled { cursor: default; opacity: 0.7; }

/* Scoreboard sidebar */
.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  overflow-y: auto;
}
.team-card {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  position: relative;
}
.team-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.team-card .name {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.team-card.active .name { color: var(--accent-2); }
.team-card .score {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.team-card.active .score { color: var(--accent-2); }
.team-card .adjust {
  display: flex; gap: 0.25rem; justify-content: flex-end;
  margin-top: 0.5rem;
}
.team-card .adjust button {
  padding: 0.18em 0.7em;
  font-size: 0.72rem;
  background: var(--bg-soft);
}

.audio-bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.audio-bar audio { flex: 1; height: 36px; filter: invert(0.9) hue-rotate(180deg); }
.audio-bar .label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-2);
  min-width: 90px;
  letter-spacing: 0.04em;
}

/* === OVERLAYS === */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem;
  z-index: 100;
  animation: overlayIn 0.18s ease-out;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.overlay.hidden { display: none; }
.overlay.translucent { background: rgba(10, 10, 10, 0.55); backdrop-filter: blur(4px); }
.playing-note {
  font-size: 7rem;
  margin-bottom: 0.5rem;
  animation: pulse 1.1s ease-in-out infinite;
  /* объёмный emoji: тень снизу + коралловое свечение вокруг */
  filter:
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 28px rgba(255, 94, 87, 0.75))
    drop-shadow(0 0 50px rgba(255, 94, 87, 0.35))
    saturate(1.3) brightness(1.05);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}
.playing-progress {
  width: min(560px, 80vw);
  height: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 0.6rem 0 0.4rem;
  border: 1px solid var(--border);
  cursor: pointer;
}
.playing-progress:hover { border-color: var(--accent); }
.playing-controls {
  display: flex; align-items: stretch; justify-content: center; gap: 0.7rem;
  margin-bottom: 1rem;
  height: 2.7rem;
}
.playing-controls > * {
  display: inline-flex;
  align-items: center;
  height: 100%;
  line-height: 1;
}
.playing-controls .playing-btn {
  padding: 0 1.2em;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}
.playing-controls .playing-time {
  color: var(--text);
  padding: 0 0.5em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
}
.playing-hint {
  font-size: 0.95rem;
  color: var(--text);
  text-align: center;
  margin: 0.8rem 0 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}
.playing-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-grad);
  border-radius: var(--radius-pill);
  transition: width 0.2s linear;
}
.playing-time {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}
.buzzer.flash { animation: flash 0.35s ease-out; }
@keyframes flash {
  0% { filter: brightness(1.6) saturate(1.4); transform: scale(0.92); }
  100% { filter: brightness(1) saturate(1); transform: scale(1); }
}
.overlay h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.overlay .big-name {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 800;
  margin: 0.5rem 0 1.5rem;
  text-align: center;
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.overlay .points {
  font-size: 2rem;
  color: var(--text);
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.overlay .song-info { font-size: 2rem; color: var(--text); font-weight: 600; margin: 0.5rem 0 1.5rem; text-align: center; line-height: 1.2; letter-spacing: -0.02em; }
.overlay .song-info.muted { font-size: 1.15rem; color: var(--text-muted); font-weight: 400; }

/* «Никто не угадал» — белым (а не серым muted, как стандартный h2 overlay) */
#overlay-revealing .rev-title { color: var(--text); font-size: 2.4rem; letter-spacing: -0.02em; text-transform: none; font-weight: 700; }
.overlay .actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; margin-top: 0; }
.overlay button { padding: 0.95em 2.2em; font-size: 1.05rem; }
.overlay.success-flash .big-name {
  background: var(--success-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.overlay.danger-flash .big-name {
  background: var(--danger-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === TEAM (phone) === */
.team-page {
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;  /* dynamic viewport: учитывает адресную строку Safari */
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(0.5rem, env(safe-area-inset-bottom));
}
.team-page header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.3rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.team-page .team-name { font-size: 1.3rem; font-weight: 700; }
.team-page .team-score {
  font-size: 1.4rem; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.buzzer-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem 0.5rem;
  min-height: 0;
}
.buzzer {
  width: 100%; aspect-ratio: 1; max-width: 380px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 4rem; font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 15px 40px rgba(255, 94, 87, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: transform 0.08s, filter 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.04em;
}
.buzzer:active { transform: scale(0.92); filter: brightness(1.15); }
.buzzer.off {
  background: var(--bg-card);
  color: var(--text-soft);
  border: 2px solid var(--border);
  box-shadow: none;
  font-size: 3rem;
}
.team-status {
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  min-height: 2.5rem;
  flex-shrink: 0;
}
.team-footer { padding-top: 0; padding-bottom: 0.3rem; }

/* === GAME OVER PODIUM === */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 0.7rem; margin: 1.5rem 0; flex-wrap: wrap; }
.podium-slot {
  text-align: center;
  padding: 0.9rem 0.7rem;
  border-radius: var(--radius) var(--radius) 0 0;
  min-width: 130px;
  border: 1px solid var(--border);
  border-bottom: none;
}
.podium-slot.gold { background: linear-gradient(180deg, #fbbf24, #f59e0b); height: 200px; }
.podium-slot.silver { background: linear-gradient(180deg, #cbd5e1, #94a3b8); height: 160px; }
.podium-slot.bronze { background: linear-gradient(180deg, #d97757, #b45309); height: 130px; }
.podium-slot .name { color: #1a1a1a; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.3rem; }
.podium-slot .score { color: #1a1a1a; font-size: 1.8rem; font-weight: 800; }

/* === WELCOME === */
.welcome-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  position: relative;
}
.welcome-content { text-align: center; max-width: 640px; }
.welcome-emoji {
  font-size: 6rem;
  margin-bottom: 1rem;
  animation: pulse 1.6s ease-in-out infinite;
}
.welcome-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.8rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}
.welcome-start {
  padding: 1.1em 2.6em !important;
  font-size: 1.3rem !important;
  font-weight: 700;
}

/* === CONFIG (setup page) refinements === */
.config-header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.config-header h1 { line-height: 1; }
.config-header button { align-self: baseline; }
.penalty-toggle { margin: 1rem 0 0; }
.penalty-toggle:hover { background: var(--bg-soft); }

.rubric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.7rem;
}
.rubric-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  display: block;
}
.rubric-card:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
  transform: translateY(-2px);
}
.rubric-card input[type="checkbox"] {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 1.2em; height: 1.2em;
  cursor: pointer;
  z-index: 2;
}
.rubric-card:has(input[type="checkbox"]:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.rubric-card-content { padding: 1.3rem 1rem 1.1rem; text-align: center; }
.rubric-card-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 0.55rem; }
.rubric-card-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 0.3rem; }
.rubric-card-count { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

button.big { padding: 1em 2em !important; font-size: 1.05rem !important; font-weight: 700; }

/* === BONUS BADGE === */
.bonus-badge {
  display: inline-block;
  padding: 0.5em 1.2em;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1a1a1a;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  animation: bonusPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.5);
}
@keyframes bonusPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === PAGE FOOTER === */
.page-footer {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8rem 0 calc(0.6rem + env(safe-area-inset-bottom));
  margin-top: auto;
}

/* === ROULETTE === */
.roulette {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 800;
  min-height: 5rem;
  text-align: center;
  letter-spacing: -0.04em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* HTML `hidden` атрибут vs class-rule с display:flex — без !important class побеждает. */
[hidden] { display: none !important; }

/* === LOBBY === */
.lobby-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 760px) {
  .lobby-grid { grid-template-columns: 1fr; }
}
.lobby-qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.lobby-qr {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  background: white;
  border-radius: 12px;
  padding: 0.6rem;
}
.lobby-url {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  color: var(--accent-2);
  word-break: break-all;
  text-align: center;
}
.lobby-roster {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}
.lobby-roster h2 { margin-top: 0; }
.roster-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.8rem 0; }
.roster-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 1.05rem;
}
.roster-row.claimed { background: var(--accent-soft); border: 1px solid var(--accent); }
.roster-name { font-weight: 600; }

/* === PLAY (pick-your-team) === */
.play-page {
  max-width: 540px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem calc(1rem + env(safe-area-inset-bottom));
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.play-header { text-align: center; }
.play-header h1 {
  font-size: 1.6rem;
  margin: 0.4rem 0 0.3rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.play-emoji { font-size: 3rem; line-height: 1; }
.team-picker { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.5rem 0; }
.team-pick-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1em 1.3em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.team-pick-btn:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--accent);
}
.team-pick-btn.mine {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.team-pick-btn.taken {
  opacity: 0.4;
  cursor: not-allowed;
}
.team-pick-name { flex: 1; }
.team-pick-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.team-pick-btn.mine .team-pick-tag { color: var(--accent-2); }
