:root {
  --bg: #05060a;
  --bg-2: #0a0d16;
  --panel: rgba(12, 16, 28, 0.82);
  --panel-2: rgba(18, 24, 40, 0.9);
  --line: rgba(0, 240, 255, 0.18);
  --cyan: #00f0ff;
  --gold: #f5c542;
  --lime: #b6ff00;
  --orange: #ff8a00;
  --red: #ff3b5c;
  --text: #eaf6ff;
  --muted: #8aa0b8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --display: "Arial Black", "Helvetica Neue", Impact, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  background:
    radial-gradient(circle at 15% -10%, rgba(245, 197, 66, 0.18), transparent 42%),
    radial-gradient(circle at 85% 110%, rgba(0, 240, 255, 0.16), transparent 45%),
    var(--bg);
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.bg-grid {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: perspective(600px) rotateX(58deg) scale(1.8);
  transform-origin: center 65%;
  animation: gridMove 14s linear infinite;
  opacity: 0.55;
}

@keyframes gridMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 52px;
  }
}

.hidden {
  display: none !important;
}

a {
  color: var(--cyan);
}

button,
input {
  font-family: inherit;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 56px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  color: var(--cyan);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.35), inset 0 0 18px rgba(0, 240, 255, 0.12);
}

.brand-name {
  font-family: var(--display);
  font-size: clamp(18px, 2.4vw, 26px);
  letter-spacing: 0.14em;
  line-height: 1;
}

.brand-name span {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(245, 197, 66, 0.6);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.06);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

button.chip {
  cursor: pointer;
}

button.chip[aria-pressed="true"] {
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: 0 0 16px rgba(182, 255, 0, 0.25);
}

.chip.conn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.chip.conn.on::before {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.chip.conn.off::before {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.chip.cat {
  border-color: rgba(245, 197, 66, 0.35);
  background: rgba(245, 197, 66, 0.08);
  color: #ffb8f1;
}

.chip.pts {
  border-color: rgba(255, 138, 0, 0.35);
  background: rgba(255, 138, 0, 0.08);
  color: #ffcf8a;
}

/* ---------- screens / join ---------- */

.screen {
  padding: clamp(12px, 3vw, 36px) clamp(14px, 4vw, 48px) 48px;
}

.join-card {
  width: min(680px, 100%);
  margin: clamp(20px, 7vh, 90px) auto 0;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(18, 24, 42, 0.92), rgba(8, 10, 18, 0.94));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.join-logo {
  display: block;
  height: clamp(170px, 24vw, 240px);
  width: auto;
  margin: 0 auto 22px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.admin-logo {
  height: 130px;
  margin-bottom: 18px;
}

.join-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(0, 240, 255, 0.08) 45%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  0%,
  55% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.kicker {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.glitch {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 64px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.4);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.75;
  pointer-events: none;
}

.glitch::before {
  color: var(--gold);
  transform: translate(2px, -1px);
  clip-path: inset(12% 0 58% 0);
  animation: glitchA 3.6s infinite steps(1);
}

.glitch::after {
  color: var(--cyan);
  transform: translate(-2px, 1px);
  clip-path: inset(62% 0 8% 0);
  animation: glitchB 4.2s infinite steps(1);
}

@keyframes glitchA {
  0%,
  92%,
  100% {
    clip-path: inset(12% 0 58% 0);
    transform: translate(2px, -1px);
  }
  93% {
    clip-path: inset(34% 0 22% 0);
    transform: translate(-6px, 2px);
  }
  95% {
    clip-path: inset(8% 0 74% 0);
    transform: translate(5px, -2px);
  }
}

@keyframes glitchB {
  0%,
  88%,
  100% {
    clip-path: inset(62% 0 8% 0);
    transform: translate(-2px, 1px);
  }
  89% {
    clip-path: inset(18% 0 54% 0);
    transform: translate(6px, -1px);
  }
  91% {
    clip-path: inset(70% 0 4% 0);
    transform: translate(-5px, 2px);
  }
}

.sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

form {
  margin: 0;
}

.join-card form {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input:not([type]) {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 18px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.22);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

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

.btn-primary {
  border-color: var(--cyan);
  background: linear-gradient(120deg, rgba(0, 240, 255, 0.22), rgba(245, 197, 66, 0.2));
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.18);
}

.btn-xl {
  padding: 18px 22px;
  font-size: 14px;
  border-radius: 14px;
}

.btn-danger {
  border-color: rgba(255, 59, 92, 0.5);
  background: rgba(255, 59, 92, 0.12);
  color: #ffb3c0;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.btn-lime {
  border-color: var(--lime);
  background: rgba(182, 255, 0, 0.12);
  color: #e8ffb0;
}

.btn-magenta {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.12);
  color: #ffb8f1;
}

.error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- game layout ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(14px, 2.4vw, 26px);
  width: min(1280px, 100%);
  margin: 0 auto;
  align-items: start;
}

.stage {
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.lobby {
  padding: clamp(22px, 4vw, 44px);
  text-align: center;
}

.lobby h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lobby-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 10px currentColor;
}

.question {
  padding: clamp(18px, 3.2vw, 36px);
}

.q-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.q-prompt {
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: clamp(24px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.media-wrap {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.media-wrap video {
  display: block;
  width: 100%;
  max-height: 52vh;
  background: #000;
}

.media-wrap audio {
  display: block;
  width: 100%;
  padding: 18px;
  background: #0b0e17;
}

.media-wrap img {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: #000;
}

.media-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.media-overlay span {
  padding: 14px 22px;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.audio-visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 84px;
  padding: 0 18px 18px;
  background: linear-gradient(180deg, #0b0e17, #05060a);
}

.audio-visual i {
  display: block;
  width: 7px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--gold));
  animation: eq 0.9s ease-in-out infinite alternate;
  opacity: 0.8;
}

.audio-visual i:nth-child(2n) {
  animation-duration: 0.65s;
}
.audio-visual i:nth-child(3n) {
  animation-duration: 1.15s;
}
.audio-visual i:nth-child(4n) {
  animation-duration: 0.8s;
}

@keyframes eq {
  from {
    height: 8px;
  }
  to {
    height: 58px;
  }
}

.buzz-zone {
  display: grid;
  place-items: center;
  gap: 12px;
  margin-top: 28px;
}

.buzzer {
  position: relative;
  width: clamp(170px, 26vw, 230px);
  height: clamp(170px, 26vw, 230px);
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.55);
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 240, 255, 0.28), rgba(0, 240, 255, 0.04) 55%, rgba(0, 0, 0, 0.2) 70%),
    #0a0e18;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  box-shadow:
    0 0 0 10px rgba(0, 240, 255, 0.05),
    0 0 60px rgba(0, 240, 255, 0.25),
    inset 0 0 40px rgba(0, 240, 255, 0.12);
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.2s;
}

.buzzer::before,
.buzzer::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(245, 197, 66, 0.35);
  animation: ring 2.2s ease-out infinite;
}

.buzzer::after {
  inset: -24px;
  border-color: rgba(0, 240, 255, 0.22);
  animation-delay: 0.7s;
}

@keyframes ring {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.14);
    opacity: 0;
  }
}

.buzzer:hover:not(:disabled) {
  box-shadow:
    0 0 0 12px rgba(0, 240, 255, 0.08),
    0 0 90px rgba(0, 240, 255, 0.45),
    inset 0 0 50px rgba(0, 240, 255, 0.2);
}

.buzzer:active:not(:disabled) {
  transform: scale(0.96);
}

.buzzer:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.buzzer.locked {
  border-color: var(--gold);
  box-shadow: 0 0 70px rgba(245, 197, 66, 0.35);
}

.answer-zone {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid rgba(182, 255, 0, 0.35);
  border-radius: 16px;
  background: rgba(182, 255, 0, 0.06);
  animation: popIn 0.25s ease-out;
}

.answer-zone form {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.answer-zone input {
  flex: 1;
}

@keyframes popIn {
  from {
    transform: scale(0.98);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.timer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--orange), var(--red));
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.35);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

.timer span {
  min-width: 44px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.reveal {
  margin-top: 22px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  animation: popIn 0.25s ease-out;
}

.reveal.correct {
  border-color: rgba(182, 255, 0, 0.5);
  background: rgba(182, 255, 0, 0.08);
  box-shadow: 0 0 40px rgba(182, 255, 0, 0.12);
}

.reveal.wrong {
  border-color: rgba(255, 59, 92, 0.5);
  background: rgba(255, 59, 92, 0.08);
}

.reveal h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(18px, 3vw, 26px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reveal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.reveal strong {
  color: var(--text);
}

/* ---------- scoreboard ---------- */

.scoreboard {
  padding: 20px;
  position: sticky;
  top: 18px;
}

.score-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.score-item {
  display: grid;
  grid-template-columns: 28px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.2s, transform 0.2s;
}

.score-item.me {
  border-color: rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.06);
}

.score-item.offline {
  opacity: 0.45;
}

.score-rank {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.score-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid currentColor;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 0 16px currentColor;
}

.score-meta {
  min-width: 0;
}

.score-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.score-streak {
  color: var(--orange);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-points {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  color: var(--cyan);
}

.my-badge {
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- toast / confetti / fx ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

.flash {
  animation: flash 0.35s ease-out;
}

@keyframes flash {
  from {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.5);
  }
  to {
    box-shadow: 0 0 0 26px rgba(0, 240, 255, 0);
  }
}

/* ---------- admin ---------- */

.admin-login {
  width: min(460px, 100%);
  margin: clamp(40px, 10vh, 120px) auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}

.admin-login h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-login form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.admin-layout {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-layout-stream {
  grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
}

.shared-card {
  padding: 20px;
}

.shared-question {
  margin-top: 12px;
  min-height: 340px;
}

.admin-card .shared-question .q-prompt {
  margin: 18px 0 0;
  font-size: clamp(22px, 3.2vw, 38px);
  letter-spacing: 0.01em;
  color: var(--text);
}

.shared-question .media-wrap {
  margin-top: 16px;
}

.shared-question .media-wrap video,
.shared-question .media-wrap img {
  max-height: 46vh;
}

.shared-status {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed rgba(0, 240, 255, 0.3);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shared-question .timer {
  margin-top: 14px;
}

.shared-question .reveal {
  margin-top: 16px;
}

.prep-panel {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.84);
  backdrop-filter: blur(10px);
}

.prep-inner {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}

.prep-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.prep-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prep-panel .question-list {
  max-height: 50vh;
}

.prep-panel .current-q {
  margin-top: 16px;
}

.admin-col {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}

.admin-card h2 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.admin-card .muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.control-grid .btn {
  padding: 12px 8px;
  font-size: 11px;
}

.control-grid .span-2 {
  grid-column: span 2;
}

.current-q {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.5;
}

.current-q .answer {
  color: var(--lime);
  font-weight: 700;
}

.current-q .notes {
  color: var(--muted);
}

.admin-answer {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(182, 255, 0, 0.35);
  border-radius: 12px;
  background: rgba(182, 255, 0, 0.06);
}

.admin-answer .who {
  color: var(--lime);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-answer .text {
  margin-top: 6px;
  font-size: 18px;
  word-break: break-word;
}

.buzz-feed {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.buzz-entry {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
}

.buzz-entry strong {
  color: var(--cyan);
}

.question-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.q-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.q-item:hover {
  border-color: rgba(0, 240, 255, 0.35);
}

.q-item.active {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
}

.q-item.disabled {
  opacity: 0.42;
}

.q-num {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.q-body {
  min-width: 0;
}

.q-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.q-sub {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.q-toggle {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.q-toggle.on {
  border-color: var(--lime);
  color: var(--lime);
}

.players-admin {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.player-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.player-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-row .score {
  font-family: var(--display);
  font-size: 18px;
  color: var(--cyan);
}

.mini-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.mini-btn:hover {
  border-color: var(--cyan);
}

.admin-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.settings-row input {
  width: 80px;
  padding: 8px 10px;
  font-size: 14px;
}

.podium {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.podium-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.podium-row.first {
  border-color: var(--lime);
  background: rgba(182, 255, 0, 0.08);
  box-shadow: 0 0 40px rgba(182, 255, 0, 0.12);
}

.podium-row .place {
  font-family: var(--display);
  font-size: 26px;
  color: var(--muted);
}

.podium-row.first .place {
  color: var(--lime);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .scoreboard {
    position: static;
    order: 2;
  }
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .question-list {
    max-height: 40vh;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 14px;
  }
  .brand-logo {
    height: 46px;
  }
  .brand-name {
    font-size: 16px;
  }
  .join-logo {
    height: 150px;
    margin-bottom: 18px;
  }
  .admin-logo {
    height: 110px;
  }
  .screen {
    padding: 8px 10px 30px;
  }
  .join-card {
    padding: 24px 18px;
    border-radius: 18px;
  }
  .glitch {
    font-size: clamp(28px, 12vw, 46px);
  }
  .answer-zone form {
    flex-direction: column;
  }
  .score-item {
    grid-template-columns: 22px 32px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }
  .score-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .score-points {
    font-size: 20px;
  }
  .control-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .control-grid .span-2 {
    grid-column: span 1;
  }
}

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