:root {
  color-scheme: dark;
  --bg-0: #070917;
  --bg-1: #111633;
  --bg-2: #151a3f;
  --panel: rgba(255, 255, 255, 0.085);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --text: #f7f8ff;
  --muted: #aeb7df;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.34);
  --primary: #7c5cff;
  --primary-2: #00d9ff;
  --accent: #ff3df2;
  --success: #22c55e;
  --danger: #ff3b5f;
  --warning: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --glow-primary: 0 0 36px rgba(124, 92, 255, 0.36);
  --glow-cyan: 0 0 42px rgba(0, 217, 255, 0.32);
  --radius: 24px;
  --radius-sm: 16px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 92, 255, .45), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(0, 217, 255, .28), transparent 28rem),
    radial-gradient(circle at 50% 105%, rgba(255, 61, 242, .20), transparent 32rem),
    linear-gradient(135deg, var(--bg-0), var(--bg-1) 48%, #090b1f);
  background-attachment: fixed;
  color: var(--text);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
}

button, input, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.065));
  color: var(--text);
  border-radius: 999px;
  padding: 0.78rem 1.08rem;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: .01em;
  box-shadow: 0 12px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, border-color .16s ease, filter .16s ease;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 18px 44px rgba(0,0,0,.32), 0 0 24px rgba(124,92,255,.22), inset 0 1px 0 rgba(255,255,255,.24);
}
button:active:not(:disabled) { transform: translateY(0) scale(.98); }
button:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.3); }
.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 16px 46px rgba(0, 217, 255, .18), 0 14px 34px rgba(124, 92, 255, .24);
}
.correct {
  background: linear-gradient(135deg, #16a34a, #39f19a);
  color: #04130a;
  border-color: rgba(255,255,255,.22);
}
.wrong, .danger {
  background: linear-gradient(135deg, #e11d48, #ff7a9a);
  color: white;
  border-color: rgba(255,255,255,.22);
}
.secondary-link {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .7rem 1rem;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.secondary-link:hover { border-color: rgba(0,217,255,.45); box-shadow: var(--glow-cyan); }
.hint { color: var(--muted); font-size: .92rem; margin: .45rem 0 0; line-height: 1.45; }
code {
  background: rgba(124,92,255,.18);
  border: 1px solid rgba(124,92,255,.24);
  padding: .1rem .38rem;
  border-radius: 8px;
  color: #d9d2ff;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .82rem .95rem;
  background: rgba(4, 7, 22, .50);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: rgba(174, 183, 223, .62); }
input:focus, textarea:focus {
  border-color: rgba(0,217,255,.68);
  box-shadow: 0 0 0 4px rgba(0,217,255,.12), inset 0 1px 0 rgba(255,255,255,.10);
}
label { display: grid; gap: .48rem; font-weight: 850; color: #d9def9; }

.player-logout {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  padding: .58rem .82rem;
  font-size: .92rem;
  background: rgba(4, 7, 22, .58);
  backdrop-filter: blur(14px);
}
.game-shell {
  width: min(1640px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.4rem 0 1.6rem;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 1.05rem;
}
.stage {
  position: relative;
  min-height: 820px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.045)),
    radial-gradient(circle at 50% 0%, rgba(0,217,255,.18), transparent 34rem),
    radial-gradient(circle at 50% 100%, rgba(124,92,255,.28), transparent 28rem);
  display: grid;
  place-items: center;
  padding: 2.3rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(255,255,255,.07);
  overflow: hidden;
}
.stage::after {
  content: "";
  position: absolute;
  inset: -40% -10%;
  background: conic-gradient(from 160deg, transparent, rgba(0,217,255,.10), transparent, rgba(255,61,242,.10), transparent);
  animation: slowSweep 12s linear infinite;
  opacity: .85;
}
@keyframes slowSweep { to { transform: rotate(360deg); } }
.stage > * { position: relative; z-index: 1; }

.stage-layout {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 1.4rem;
}
.box-area {
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.boxes-grid {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 520px);
  grid-auto-flow: row;
  justify-content: center;
  align-content: center;
  gap: .62rem;
}
.boxes-grid.two-column {
  grid-template-columns: repeat(2, minmax(240px, 500px));
  grid-template-rows: repeat(10, auto);
  grid-auto-flow: column;
}
.clue-box, .answer-box {
  --fit-max: 1.9rem;
  --fit-min: .82rem;
  position: relative;
  width: 100%;
  height: 118px;
  padding: 1rem 1.15rem;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
  color: #f6f8ff;
  font-size: var(--fit-current, var(--fit-max));
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(0,217,255,.20);
  perspective: 1400px;
  transform-style: preserve-3d;
}
.clue-box {
  height: 62px;
}
.answer-box {
  --fit-max: 2.15rem;
  --fit-min: .95rem;
  width: min(620px, 88%);
  height: 96px;
  border-radius: 28px;
  color: #fff8e6;
  text-shadow: 0 0 28px rgba(251,191,36,.20);
}
.answer-box .reveal-face {
  border-color: rgba(251,191,36,.38);
  background:
    linear-gradient(135deg, rgba(51,39,12,.90), rgba(43,31,55,.80)),
    radial-gradient(circle at 50% 0%, rgba(251,191,36,.30), transparent 21rem);
  box-shadow: 0 22px 70px rgba(0,0,0,.34), 0 0 42px rgba(251,191,36,.16), inset 0 1px 0 rgba(255,255,255,.18);
}
.answer-box .reveal-face.hidden-card {
  color: transparent;
  border-color: rgba(251,191,36,.26);
  background:
    linear-gradient(135deg, rgba(54,45,22,.62), rgba(38,31,55,.54)),
    repeating-linear-gradient(135deg, rgba(251,191,36,.065) 0 10px, transparent 10px 20px);
}
.reveal-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
}
.reveal-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.24;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: inherit;
  padding: inherit;
  background:
    linear-gradient(135deg, rgba(15,23,42,.86), rgba(29,34,76,.78)),
    radial-gradient(circle at 0% 0%, rgba(0,217,255,.22), transparent 22rem);
  box-shadow: 0 22px 70px rgba(0,0,0,.32), 0 0 38px rgba(0,217,255,.12), inset 0 1px 0 rgba(255,255,255,.16);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}
.reveal-front {
  transform: rotateX(0deg) translateZ(.5px);
}
.reveal-back {
  transform: rotateX(180deg) translateZ(.5px);
}
.reveal-face.hidden-card {
  color: transparent;
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(15,23,42,.58), rgba(29,34,76,.50)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 10px, transparent 10px 20px);
  box-shadow: 0 14px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.10);
}
.clue-box.is-flipping .reveal-card-inner,
.answer-box.is-flipping .reveal-card-inner {
  animation: revealPanelFlip .82s cubic-bezier(.45, 0, .18, 1);
}
@keyframes revealPanelFlip {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(180deg); }
}

.buzzer {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  border: 0;
  background:
    radial-gradient(circle at 32% 24%, #fff 0 5%, #ffb1c1 6% 15%, transparent 16%),
    radial-gradient(circle at 35% 30%, #ff4c75, #dc123e 58%, #79001b 100%);
  color: white;
  letter-spacing: .11em;
  font-size: .95rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  box-shadow:
    inset -14px -18px 28px rgba(0,0,0,.28),
    inset 8px 10px 18px rgba(255,255,255,.14),
    0 12px 0 #620018,
    0 22px 44px rgba(255,59,95,.28),
    0 0 44px rgba(255,59,95,.22);
}
.buzzer-panel {
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.buzzer span { display: inline-block; transform: translateY(-2px); }
.buzzer:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  border: 0;
  box-shadow:
    inset -14px -18px 28px rgba(0,0,0,.28),
    inset 8px 10px 18px rgba(255,255,255,.14),
    0 15px 0 #620018,
    0 27px 54px rgba(255,59,95,.32),
    0 0 54px rgba(255,59,95,.28);
}
.buzzer:active:not(:disabled) {
  transform: translateY(10px) scale(.98);
  box-shadow:
    inset -10px -14px 23px rgba(0,0,0,.30),
    inset 7px 8px 14px rgba(255,255,255,.12),
    0 3px 0 #620018,
    0 8px 22px rgba(255,59,95,.25);
}
.buzzer.is-locked {
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.75) 0 5%, rgba(255,255,255,.18) 6% 15%, transparent 16%),
    radial-gradient(circle at 35% 30%, #6b7280, #374151 64%, #111827 100%);
  box-shadow: inset -14px -18px 28px rgba(0,0,0,.25), 0 8px 0 #111827, 0 16px 28px rgba(0,0,0,.24);
}
.buzzer.is-active { animation: buzzerPulse 1s infinite; }
@keyframes buzzerPulse {
  0%, 100% { outline: 0 solid rgba(255,59,95,.50); box-shadow: inset -14px -18px 28px rgba(0,0,0,.28), 0 12px 0 #620018, 0 22px 44px rgba(255,59,95,.32), 0 0 44px rgba(255,59,95,.30); }
  50% { outline: 18px solid rgba(255,59,95,0); box-shadow: inset -14px -18px 28px rgba(0,0,0,.28), 0 12px 0 #620018, 0 28px 62px rgba(255,59,95,.40), 0 0 64px rgba(255,59,95,.38); }
}
.buzzer-status {
  min-height: 1.7rem;
  font-size: 1.02rem;
  font-weight: 850;
  color: var(--muted);
  text-align: center;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(4,7,22,.36);
  border-radius: 999px;
  padding: .48rem .9rem;
  backdrop-filter: blur(10px);
}
.buzzer-status.active { color: #ffd4dc; border-color: rgba(255,59,95,.36); box-shadow: 0 0 26px rgba(255,59,95,.18); }
.buzzer-status.open { color: #bbf7d0; border-color: rgba(34,197,94,.35); box-shadow: 0 0 26px rgba(34,197,94,.14); }
.buzzer-status.is-empty {
  opacity: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding-block: 0;
}

.own-input-card {
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.055));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(18px);
}
.own-input-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  font-size: 1.15rem;
  align-items: center;
}
.own-input-header strong { font-size: 1.22rem; }
.own-input-header span {
  font-weight: 950;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: .34rem .62rem;
  background: rgba(255,255,255,.08);
}
.own-input-card textarea { min-height: 86px; }
body.spectator-page .player-logout,
body.spectator-page .own-input-card {
  display: none;
}
.players-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}
.player-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.055));
  border-radius: 22px;
  padding: 1rem;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: .85rem 1rem;
  min-height: 132px;
  box-shadow: 0 18px 48px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(16px);
}
.player-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0,217,255,.10), transparent 36%, rgba(255,61,242,.10));
  opacity: .65;
  pointer-events: none;
}
.player-panel > * { position: relative; z-index: 1; }
.player-panel .indicator {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.24), rgba(255,255,255,.07));
  box-shadow: inset 0 1px 8px rgba(255,255,255,.10), 0 0 18px rgba(255,255,255,.05);
}
.player-panel.active {
  border-color: rgba(255,59,95,.62);
  box-shadow: 0 22px 58px rgba(255,59,95,.18), 0 0 42px rgba(255,59,95,.16), inset 0 1px 0 rgba(255,255,255,.18);
}
.player-panel.active .indicator {
  background: radial-gradient(circle at 35% 30%, #fff, #ff7390 18%, #ff153f 65%, #9b001d);
  box-shadow: 0 0 0 8px rgba(255,59,95,.14), 0 0 32px rgba(255,59,95,.44);
}
.player-panel.disconnected { opacity: .55; filter: saturate(.65); }
.player-score {
  min-width: 3.2rem;
  font-size: 2.05rem;
  font-weight: 950;
  text-align: center;
  color: #f8fafc;
  text-shadow: 0 0 22px rgba(0,217,255,.28);
}
.player-name {
  font-size: 1.1rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.public-text {
  grid-column: 1 / -1;
  min-height: 52px;
  border-radius: 16px;
  padding: .74rem .82rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(4,7,22,.34);
  border: 1px solid rgba(255,255,255,.10);
  color: #e8ecff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.public-text.is-empty { color: transparent; }
.public-text.has-text { border-color: rgba(0,217,255,.22); background: rgba(0,217,255,.08); }

.join-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(24,29,64,.95), rgba(11,14,35,.96)),
    radial-gradient(circle at 0% 0%, rgba(0,217,255,.24), transparent 20rem);
  color: var(--text);
  box-shadow: var(--shadow), 0 0 60px rgba(124,92,255,.18);
  padding: 1.25rem;
}
.join-dialog::backdrop { background: rgba(1, 4, 15, .70); backdrop-filter: blur(8px); }
.join-dialog form { display: grid; gap: 1rem; }
.join-dialog h1, .join-dialog h2 { margin: 0; letter-spacing: -.03em; }

.admin-shell { width: min(1460px, calc(100vw - 32px)); margin: 0 auto; padding: 1.6rem 0 2rem; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.055));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
}
.admin-header h1 { margin: 0; font-size: clamp(1.6rem, 2.2vw, 2.5rem); letter-spacing: -.045em; }
.admin-header p { margin: .2rem 0 0; color: var(--muted); font-weight: 800; }
.admin-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .9fr); gap: 1rem; align-items: start; }
.admin-card {
  background: linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.052));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
}
.admin-card h2 { margin: 0 0 1rem; letter-spacing: -.03em; }
.question-set-panel {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  padding: .9rem;
  display: flex;
  justify-content: space-between;
  gap: .9rem;
  align-items: center;
  background: rgba(4,7,22,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.question-set-panel h3 { margin: 0 0 .18rem; letter-spacing: -.02em; }
.question-set-panel p { margin: 0; color: var(--muted); font-weight: 800; }
.question-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; align-items: center; }
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.065));
  color: var(--text);
  border-radius: 999px;
  padding: .78rem 1.08rem;
  cursor: pointer;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
.file-button:hover { border-color: rgba(255,255,255,.34); box-shadow: 0 18px 44px rgba(0,0,0,.32), 0 0 24px rgba(124,92,255,.22), inset 0 1px 0 rgba(255,255,255,.24); }
.file-button input { display: none; }
.board-card { display: grid; gap: 1rem; }
.admin-boxes {
  display: grid;
  gap: .72rem;
}
.admin-box-row {
  display: grid;
  grid-template-columns: 82px minmax(220px, 1fr) auto;
  gap: .72rem;
  align-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  padding: .75rem;
  background: rgba(4,7,22,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.admin-box-number {
  font-weight: 950;
  color: #f8fafc;
}
.admin-box-row textarea {
  min-height: 64px;
  resize: vertical;
}
.answer-editor {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: .72rem;
  align-items: end;
  border: 1px solid rgba(251,191,36,.18);
  border-radius: 20px;
  padding: .85rem;
  background: rgba(251,191,36,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.answer-reveal-toggle {
  justify-content: center;
  white-space: nowrap;
}
.box-reveal-toggle {
  justify-content: center;
  white-space: nowrap;
}
.settings-card { grid-column: 1 / -1; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .72rem; align-items: center; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 850;
  color: #e8ecff;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: .55rem .76rem;
}
.toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary-2); }
.active-player {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  min-height: 92px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  font-size: 1.35rem;
  font-weight: 950;
  margin-bottom: 1rem;
  background: rgba(4,7,22,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.active-player.has-active {
  border-color: rgba(255,59,95,.52);
  color: #ffd4dc;
  background: rgba(255,59,95,.11);
  box-shadow: 0 0 34px rgba(255,59,95,.13), inset 0 1px 0 rgba(255,255,255,.12);
}
.score-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .9rem; }
.score-actions button { min-height: 66px; font-size: 1.15rem; border-radius: 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.players-admin-card { margin-top: 1rem; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-title-row h2 { margin: 0; }
.admin-players { display: grid; gap: .82rem; }
.admin-player {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(170px, .7fr) minmax(240px, 1.2fr) auto;
  gap: .82rem;
  align-items: center;
  background: rgba(4,7,22,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.admin-player.disconnected { opacity: .62; }
.admin-player-main { display: grid; gap: .45rem; }
.admin-player-main input { font-weight: 950; padding: .62rem .72rem; }
.admin-player-main span { color: var(--muted); font-weight: 800; }
.score-editor { display: flex; align-items: center; gap: .45rem; }
.score-editor input { max-width: 112px; text-align: center; font-weight: 950; }
.score-editor button { padding: .55rem .8rem; min-width: 42px; }
.player-text-admin {
  min-height: 74px;
  max-height: 160px;
  overflow: auto;
  background: rgba(4,7,22,.34);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: .75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.player-admin-actions { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: end; }
.player-admin-actions button { padding: .55rem .75rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .settings-card { grid-column: auto; }
  .admin-player { grid-template-columns: 1fr; }
  .admin-box-row { grid-template-columns: 1fr; align-items: stretch; }
  .answer-editor { grid-template-columns: 1fr; align-items: stretch; }
  .question-set-panel { align-items: stretch; flex-direction: column; }
  .question-nav { justify-content: start; }
  .player-admin-actions { justify-content: start; }
  .stage { min-height: 760px; padding: 1.4rem; }
  .stage-layout { grid-template-columns: 1fr; gap: 1rem; }
  .boxes-grid { grid-template-columns: minmax(180px, 480px); }
  .boxes-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(10, auto);
    grid-auto-flow: column;
  }
  .clue-box { height: 58px; }
  .answer-box { height: 86px; }
  .buzzer { width: 118px; height: 118px; }
}

@media (max-width: 620px) {
  .game-shell { width: min(100vw - 20px, 1640px); padding: .8rem 0; }
  .stage { min-height: 700px; padding: 1rem; border-radius: 24px; }
  .boxes-grid { width: 100%; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .boxes-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(10, auto);
    grid-auto-flow: column;
  }
  .clue-box { --fit-max: 1.18rem; height: 52px; padding: .58rem; border-radius: 16px; }
  .answer-box { --fit-max: 1.45rem; width: 100%; height: 76px; padding: .75rem; border-radius: 18px; }
  .player-panel { grid-template-columns: auto 1fr; }
  .player-name { grid-column: 2; }
  .player-score { font-size: 1.55rem; text-align: left; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-header-actions { justify-content: flex-start; }
  .section-title-row { align-items: flex-start; flex-direction: column; }
}
