:root {
  color-scheme: dark;
  --ink: #f6f5f7;
  --muted: #aaa7b1;
  --void: #08070d;
  --panel: #111018;
  --panel-2: #181620;
  --line: rgba(255, 255, 255, 0.11);
  --red: #ee243c;
  --red-dark: #6e1725;
  --blue: #3982ff;
  --blue-dark: #183766;
  --violet: #8a5cff;
  --green: #41d790;
  --yellow: #ffc54a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(238, 36, 60, 0.12), transparent 34rem),
    radial-gradient(circle at 88% 20%, rgba(57, 130, 255, 0.12), transparent 38rem),
    var(--void);
}

button, input, select { font: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

a { color: inherit; }

.online-page { min-height: 100vh; }

.online-header {
  min-height: 78px;
  padding: 14px clamp(18px, 3vw, 46px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 7, 13, 0.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.online-header > div { text-align: center; }
.online-header small { display: block; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.18em; }
.online-header strong { display: block; margin-top: 2px; }

.online-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  text-decoration: none;
  letter-spacing: 0.12em;
}

.online-brand span,
.broadcast-logo span,
.stage-error > span {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--red);
  font-weight: 950;
  font-style: italic;
  transform: skew(-7deg);
  box-shadow: 8px 8px 0 rgba(238, 36, 60, 0.2);
}

.connection-state {
  justify-self: end;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
}

.connection-state.is-online { color: var(--green); border-color: rgba(65, 215, 144, 0.4); }

.auth-shell,
.join-shell {
  width: min(1120px, calc(100% - 36px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: clamp(36px, 7vw, 100px);
}

.auth-copy h1,
.join-card h1 {
  margin: 0;
  font-size: clamp(3.3rem, 7vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

.auth-copy p:not(.eyebrow) { max-width: 540px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

.eyebrow { color: var(--red); font-weight: 800; letter-spacing: 0.2em; font-size: 0.76rem; }

.auth-card,
.online-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(29, 27, 39, 0.96), rgba(14, 13, 20, 0.96));
  box-shadow: var(--shadow);
  border-radius: 20px;
}

.auth-card { padding: clamp(24px, 4vw, 42px); }
.auth-card h2 { margin: 0 0 20px; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; }

label { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
label + label { margin-top: 14px; }
.password-group { margin-top: 14px; }
.auth-card h2 + .password-group { margin-top: 0; }
.password-group + label, .password-group + .form-grid { margin-top: 14px; }
.password-field { position: relative; margin-top: 7px; }
.password-field input { margin-top: 0; padding-right: 54px; }
.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--ink); background: #2b2833; }
.password-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-slash { display: none; }
.password-toggle.is-visible .eye-slash { display: block; }

input,
select {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d0c12;
  outline: 0;
}

input:focus,
select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(238, 36, 60, 0.13); }

.online-primary,
.online-secondary,
.online-danger,
.verdict-button,
.team-turn-button,
.buzz-button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  color: white;
  font-weight: 850;
}

.online-primary { width: 100%; margin-top: 20px; background: var(--red); box-shadow: 0 10px 28px rgba(238, 36, 60, 0.25); }
.online-primary:hover { background: #ff3850; }
.online-secondary { width: 100%; margin-top: 18px; border: 1px solid var(--line); background: #272430; }
.online-danger { background: #4c1620; }

.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; color: var(--muted); margin: 26px 0; font-size: 0.75rem; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); }

.notice { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,0.03); font-size: 0.85rem; }
.notice[data-type="error"] { color: #ff8c9a; border-color: rgba(238,36,60,0.45); }
.notice[data-type="success"] { color: var(--green); border-color: rgba(65,215,144,0.4); }

.moderator-shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.moderator-sidebar { display: grid; gap: 18px; align-content: start; position: sticky; top: 100px; }
.online-panel { padding: 18px; }

.panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-heading span { color: var(--red); font-weight: 900; font-size: 0.76rem; }
.panel-heading h2 { margin: 0; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.share-panel p { color: var(--muted); font-size: 0.82rem; }
.share-panel p strong { color: var(--ink); letter-spacing: 0.18em; }

.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 6px; }
.copy-row input { min-width: 0; margin: 0; min-height: 42px; font-size: 0.72rem; }
.copy-row button { border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #2b2833; font-size: 0.76rem; }

.moderator-game { min-width: 0; display: grid; gap: 14px; align-content: start; }
.team-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.team-turn-button { min-height: 68px; display: flex; align-items: center; justify-content: space-between; opacity: 0.55; }
.team-turn-button strong { font-size: 1.3rem; }
.team-turn-button.team-red { background: linear-gradient(100deg, var(--red-dark), #39151c); }
.team-turn-button.team-blue { background: linear-gradient(100deg, var(--blue-dark), #13223e); }
.team-turn-button.team-green { background: linear-gradient(100deg, #19603f, #102d22); }
.team-turn-button.is-active { opacity: 1; box-shadow: 0 0 0 2px currentColor inset, 0 14px 34px rgba(0,0,0,0.24); }

.moderator-stage { min-height: 520px; overflow: hidden; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.stage-heading h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 3.2rem); line-height: 1.05; }
.phase-badge, .value-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border-radius: 999px; background: rgba(255,255,255,0.07); color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.value-badge { color: var(--yellow); border: 1px solid rgba(255,197,74,0.3); }

.online-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.board-column { display: grid; grid-template-rows: 62px repeat(4, 1fr); gap: 8px; min-width: 0; }
.board-column h3 { margin: 0; padding: 8px; display: grid; place-items: center; text-align: center; border-radius: 11px; background: linear-gradient(120deg, #7d1827, #3f141b); font-size: clamp(0.74rem, 1.2vw, 0.94rem); text-transform: uppercase; letter-spacing: 0.04em; }
.board-tile { min-height: 72px; border: 1px solid rgba(80,143,255,0.65); border-radius: 11px; color: white; background: linear-gradient(135deg, #294d89, #14213d); font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 950; font-style: italic; box-shadow: inset 0 0 24px rgba(66,135,255,0.1); }
.board-tile:hover:not(:disabled) { transform: translateY(-2px); border-color: #81b0ff; filter: brightness(1.12); }
.board-tile.is-played { opacity: 0.22; color: #697080; background: #101116; border-color: #282a31; }
.online-board.is-disabled .board-tile:not(.is-played) { opacity: 0.62; }

.question-surface { min-height: 450px; display: grid; place-items: center; text-align: center; padding: clamp(20px, 4vw, 56px); border-radius: 14px; background: radial-gradient(circle at 50% 0%, rgba(57,130,255,0.15), transparent 62%), #0d0d14; }
.question-inner { width: min(850px, 100%); }
.question-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.question-inner h1 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.04; letter-spacing: -0.045em; }
.question-status { margin: 28px auto 0; width: max-content; max-width: 100%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,0.04); }
.answer-comparison { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.answer-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #171620; }
.answer-card small { display: block; color: var(--muted); margin-bottom: 7px; }
.answer-card strong { font-size: 1.1rem; }
.answer-card.solution { border-color: rgba(65,215,144,0.42); }
.answer-card.solution strong { color: var(--green); }
.result-banner { margin-top: 20px; padding: 14px; border-radius: 11px; font-weight: 900; }
.result-banner.is-correct { background: rgba(65,215,144,0.15); color: var(--green); }
.result-banner.is-wrong { background: rgba(238,36,60,0.15); color: #ff8290; }

.moderator-controls { min-height: 110px; display: grid; align-items: center; }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.control-row > p { color: var(--muted); margin: 0 auto 0 0; }
.verdict-button.correct { background: #17754d; }
.verdict-button.wrong { background: #9f1f31; }
.score-tools { display: flex; gap: 6px; margin-left: auto; }
.score-tools button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #24222c; color: var(--ink); }

.moderator-roster { display: grid; gap: 9px; }
.empty-roster { padding: 18px 0; color: var(--muted); text-align: center; font-size: 0.85rem; }
.moderator-player { display: grid; grid-template-columns: auto minmax(0,1fr) 95px; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); }
.player-copy { min-width: 0; }
.player-copy strong, .player-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-copy small { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }
.moderator-player select { margin: 0; min-height: 34px; padding: 0 7px; font-size: 0.72rem; }
.slot-actions { grid-column: 2 / -1; display: flex; gap: 6px; }
.slot-actions button { border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #22202a; }

.online-avatar { position: relative; width: 42px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: #25232d; border: 2px solid var(--line); font-weight: 900; }
.online-avatar.team-red { border-color: var(--red); background: #4a1620; }
.online-avatar.team-blue { border-color: var(--blue); background: #172f57; }
.online-avatar.team-green { border-color: var(--green); background: #173b2d; }
.online-avatar.is-large { width: 70px; font-size: 1.25rem; }
.twitch-dot { position: absolute; right: -4px; bottom: -4px; width: 20px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; color: white; background: #9146ff; border: 2px solid #111018; font-size: 0.56rem; font-style: normal; }
.twitch-handle { display: none; }

.join-shell { grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 0.65fr); }
.join-visual { align-self: stretch; min-height: 580px; position: relative; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, #571622, #12101a 65%); }
.giant-k { position: absolute; font-size: min(45vw, 36rem); font-weight: 950; font-style: italic; line-height: 1; color: rgba(255,255,255,0.035); transform: skew(-8deg); }
.join-visual p { z-index: 1; margin: 0; font-size: clamp(2.8rem, 6vw, 6rem); line-height: 0.9; font-weight: 950; letter-spacing: -0.06em; }
.join-card h1 { font-size: clamp(2.4rem, 4vw, 4.6rem); margin-bottom: 28px; }
.field-note { color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

.player-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 40px; display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 14px; }
.player-identity { align-self: start; text-align: center; }
.player-identity .online-avatar { margin: 0 auto 12px; }
.player-identity h2 { margin: 0; }
.player-identity p { margin: 6px 0 0; color: var(--muted); }
.identity-score { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.identity-score strong { display: block; font-size: 2rem; }
.player-game { min-height: 430px; }
.player-action { grid-column: 2; min-height: 120px; display: grid; align-items: center; }
.player-roster { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
.mini-player { min-width: 0; padding: 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.mini-player > div { min-width: 0; }
.mini-player strong, .mini-player small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player small { color: var(--muted); font-size: 0.66rem; }
.answer-form { width: min(660px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.answer-form input { margin: 0; }
.answer-form button { margin: 0; width: auto; }
.waiting-copy { margin: 0; text-align: center; color: var(--muted); }
.buzz-button { width: min(280px, 100%); height: 94px; margin: 0 auto; border-radius: 999px; background: var(--red); font-size: 1.45rem; box-shadow: 0 0 44px rgba(238,36,60,0.44); }
.buzz-button:hover { transform: scale(1.03); }

.stage-page { overflow: hidden; background: #05060b; }
.broadcast-frame { width: 100vw; height: 100vh; min-height: 620px; overflow: hidden; background: radial-gradient(circle at 50% -20%, rgba(57,130,255,0.13), transparent 55%), #080a10; }
.broadcast { height: 100%; display: grid; grid-template-rows: 132px minmax(0,1fr) 190px; }
.broadcast-header { padding: 18px 28px; display: grid; grid-template-columns: 300px 1fr 300px; align-items: center; gap: 22px; }
.host-placeholder { height: 96px; padding: 14px 18px; display: flex; flex-direction: column; justify-content: end; border: 2px solid var(--violet); border-radius: 16px; background: linear-gradient(145deg, rgba(138,92,255,0.25), rgba(21,18,30,0.7)); box-shadow: 0 0 28px rgba(138,92,255,0.2); }
.host-placeholder span { color: #c9b6ff; font-size: 0.65rem; letter-spacing: 0.18em; }
.host-placeholder strong { margin-top: 4px; }
.broadcast-logo { display: flex; align-items: center; justify-content: center; gap: 13px; font-size: 1.4rem; letter-spacing: 0.18em; }
.stage-turn { justify-self: end; width: 100%; }
.turn-pill { padding: 16px 18px; border: 1px solid currentColor; border-radius: 999px; text-align: center; font-weight: 900; letter-spacing: 0.04em; }
.turn-pill.team-red { color: #ff7082; background: linear-gradient(100deg, rgba(238,36,60,0.34), rgba(57,130,255,0.15)); }
.turn-pill.team-blue { color: #76aaff; background: linear-gradient(100deg, rgba(238,36,60,0.15), rgba(57,130,255,0.34)); }
.turn-pill.team-green { color: #72e8ad; background: linear-gradient(100deg, rgba(65,215,144,0.3), rgba(57,130,255,0.12)); }

.stage-game { min-height: 0; padding: 4px 34px 18px; overflow: hidden; }
.stage-game .online-board { height: 100%; }
.stage-game .board-column { grid-template-rows: 58px repeat(4, minmax(0,1fr)); }
.stage-game .board-tile { min-height: 0; }
.broadcast-question { height: 100%; display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 18px; }
.broadcast-question-main { display: grid; place-items: center; padding: 30px; border: 1px solid rgba(80,143,255,0.55); border-radius: 18px; text-align: center; background: radial-gradient(circle at 50% 0%, rgba(57,130,255,0.22), transparent 60%), #11182a; }
.broadcast-question-main h1 { margin: 18px 0; font-size: clamp(2.2rem, 4vw, 4.5rem); line-height: 1.03; }
.broadcast-side { display: grid; align-content: center; gap: 12px; }
.broadcast-side .value-badge { justify-content: center; min-height: 54px; font-size: 1rem; }
.buzz-or-answer { padding: 22px 14px; border: 1px solid var(--line); border-radius: 14px; text-align: center; background: rgba(255,255,255,0.04); }
.buzz-or-answer strong { display: block; margin-top: 7px; font-size: 1.2rem; }
.solution-reveal { padding: 22px; border: 1px solid rgba(65,215,144,0.4); border-radius: 14px; color: var(--green); background: rgba(65,215,144,0.1); }
.solution-reveal small { display: block; color: var(--muted); margin-bottom: 6px; }
.solution-reveal strong { font-size: 1.3rem; }

.stage-roster { padding: 8px 8px 10px; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
.stage-player { min-width: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: end; padding: 12px; border: 2px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #292631, #111118); }
.stage-player.team-red { border-color: var(--red); background: linear-gradient(145deg, #481620, #161017); }
.stage-player.team-blue { border-color: var(--blue); background: linear-gradient(145deg, #172f55, #0f1520); }
.stage-player.team-green { border-color: var(--green); background: linear-gradient(145deg, #164431, #0e1d18); }
.stage-player.is-answering { box-shadow: inset 0 0 0 3px white, 0 0 30px currentColor; }
.stage-player .online-avatar { margin-bottom: 10px; }
.stage-player > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-player > small { margin-top: 2px; color: var(--muted); }
.stage-score { position: absolute; right: 9px; top: 9px; min-width: 42px; padding: 6px 8px; border-radius: 999px; background: rgba(0,0,0,0.42); text-align: center; font-weight: 900; }
.stage-empty { border-style: dashed; opacity: 0.35; align-items: center; justify-content: center; color: var(--muted); }
.online-dot { display: inline-block; width: 8px; aspect-ratio: 1; border-radius: 50%; background: #5e5b66; }
.online-dot.is-online { background: var(--green); box-shadow: 0 0 10px rgba(65,215,144,0.7); }

.stage-error { height: 100%; display: grid; place-items: center; align-content: center; gap: 20px; text-align: center; }
.stage-error h1 { max-width: 600px; margin: 0; }

.mode-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.mode-switcher button { min-height: 42px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 850; }
.mode-switcher button.is-active { color: white; background: linear-gradient(120deg, var(--red-dark), #3b183f); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.compact { width: auto; margin: 0; }
.audio-toggle { position: fixed; right: 14px; bottom: 14px; z-index: 80; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(10,9,15,.88); backdrop-filter: blur(12px); font-size: .72rem; }
.team-turn-button { position: relative; }
.team-turn-button small { margin-left: 8px; color: #ff8090; letter-spacing: .1em; }

.mode-intro { min-height: 410px; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; border-radius: 16px; background: radial-gradient(circle at center, rgba(238,36,60,.2), transparent 50%), #0b0b12; }
.mode-intro b { color: var(--red); letter-spacing: .2em; }
.mode-intro h2 { margin: 0; max-width: 900px; font-size: clamp(2.2rem, 5vw, 5.4rem); line-height: .95; text-transform: uppercase; }
.mode-intro p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.lms-info { margin-bottom: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); }
.lms-board { display: grid; grid-template-columns: repeat(10, minmax(50px, 1fr)); gap: 6px; }
.lms-card { min-height: 88px; position: relative; overflow: hidden; display: grid; place-items: center; align-content: center; border: 1px solid rgba(238,36,60,.55); border-radius: 8px; text-align: center; background: #f1f0ed; color: #d85245; }
.lms-card > small { position: absolute; top: 3px; left: 0; right: 0; color: #78a7d6; font-weight: 900; font-size: .62rem; }
.lms-card > strong { font-size: 2rem; }
.lms-card.is-revealed { padding: 6px; color: white; background: #111a28; border-color: #6ec7ff; }
.lms-card.is-revealed > strong { font-size: 1.45rem; }
.lms-card.is-revealed > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .58rem; font-weight: 900; text-transform: uppercase; }
.lms-card.is-revealed.team-red { border-color: var(--red); box-shadow: inset 0 0 18px rgba(238,36,60,.25); }
.lms-card.is-revealed.team-blue { border-color: var(--blue); box-shadow: inset 0 0 18px rgba(57,130,255,.25); }
.lms-card.is-revealed.team-green { border-color: var(--green); box-shadow: inset 0 0 18px rgba(65,215,144,.25); }
.lms-card.is-neutral { border-color: var(--yellow); color: #fff3bd; background: linear-gradient(145deg, #67520d, #19160b); }
.lms-actions { position: absolute; inset: auto 3px 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; opacity: 0; transition: opacity .15s; }
.lms-card:hover .lms-actions { opacity: 1; }
.lms-actions button { min-height: 22px; padding: 0 4px; border: 0; border-radius: 4px; color: white; background: #315a93; font-size: .5rem; font-weight: 900; }
.lms-actions button:last-child { background: #8c6e0e; }
.standings { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.standings span { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); }
.standings strong { color: var(--yellow); }
.stage-lms { height: 100%; overflow: hidden; }
.stage-lms header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 10px; }
.stage-lms h2 { margin: 3px 0 0; font-size: clamp(1.4rem, 3vw, 3rem); }
.stage-lms header > strong { font-size: 2.2rem; color: #7ad3ff; }
.stage-lms .lms-board { grid-template-columns: repeat(10, minmax(0,1fr)); }
.stage-lms .lms-card { min-height: 0; aspect-ratio: 1 / 1.08; }
.stage-intro { height: 100%; min-height: 0; }

.morph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 18px; }
.morph-visual { max-width: 660px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.morph-face { grid-column: 1 / -1; min-height: 300px; display: grid; place-items: center; align-content: center; gap: 12px; border: 5px solid #ed4328; border-radius: 18px; background: linear-gradient(135deg, var(--morph-a), var(--morph-b)); box-shadow: 0 0 42px rgba(238,67,40,.25); }
.morph-face span { width: 150px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50% 46% 54% 48%; color: white; background: rgba(5,5,10,.45); font-size: 7rem; font-weight: 950; }
.morph-face small { padding: 7px 11px; border-radius: 999px; background: rgba(0,0,0,.35); font-weight: 900; letter-spacing: .12em; }
.morph-original { min-height: 84px; display: grid; place-items: center; border: 3px solid #ed4328; border-radius: 12px; color: #a4a0aa; background: #34323a; }
.morph-original.is-solved { color: white; border-color: var(--green); background: rgba(65,215,144,.12); }
.buzz-queue { overflow: hidden; align-self: center; border: 1px solid var(--line); border-radius: 13px; background: #0d0c14; }
.buzz-queue h3 { margin: 0; padding: 12px 14px; background: linear-gradient(100deg, #8a3cf0, #d43d59); font-size: .9rem; }
.buzz-queue > p { padding: 18px; color: var(--muted); text-align: center; font-size: .75rem; }
.buzz-entry { padding: 9px 12px; display: grid; grid-template-columns: 32px 1fr auto; gap: 7px; align-items: center; border-top: 1px solid var(--line); }
.buzz-entry b { color: #ff7280; }.buzz-entry small { color: var(--muted); font-size: .65rem; }.buzz-entry.active { background: rgba(255,255,255,.08); }
.morph-submission { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.morph-submission small:last-child { grid-column: 1 / -1; color: var(--green); }
.stage-morph { height: 100%; position: relative; display: grid; place-items: center; }
.stage-morph .morph-layout { width: min(1120px,100%); }
.stage-morph .morph-face { min-height: 280px; }
.morph-overlay { position: absolute; inset: 20% 25%; display: grid; place-items: center; align-content: center; border: 1px solid rgba(138,92,255,.55); border-radius: 18px; background: rgba(12,9,28,.88); backdrop-filter: blur(16px); }
.morph-overlay b { font-size: 4rem; font-style: italic; }.morph-overlay span { color: var(--muted); }
.is-eliminated { filter: grayscale(1); opacity: .38; }
.question-image-button { width: min(460px, 100%); margin: 18px auto 0; padding: 0; position: relative; overflow: hidden; display: block; border: 1px solid rgba(80,143,255,.55); border-radius: 13px; color: white; background: #111522; }
.question-image-button img { width: 100%; max-height: 210px; display: block; object-fit: contain; }
.question-image-button span { position: absolute; right: 8px; bottom: 8px; padding: 6px 9px; border-radius: 999px; background: rgba(0,0,0,.72); font-size: .68rem; font-weight: 800; }
.question-image-button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.image-lightbox { position: fixed; inset: 0; z-index: 120; padding: 5vh 5vw; display: grid; place-items: center; background: rgba(3,3,8,.92); backdrop-filter: blur(16px); }
.image-lightbox img { max-width: 90vw; max-height: 90vh; border: 2px solid rgba(255,255,255,.2); border-radius: 16px; box-shadow: 0 30px 100px #000; }
.image-lightbox-close { position: fixed; top: 22px; right: 26px; z-index: 1; width: 52px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; color: white; background: #221f2a; font-size: 2rem; }

@media (max-width: 1050px) {
  .moderator-shell { grid-template-columns: 1fr; }
  .moderator-sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .player-roster { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .broadcast-header { grid-template-columns: 220px 1fr 220px; }
}

@media (max-width: 760px) {
  .online-header { grid-template-columns: 1fr auto; }
  .online-header > div { display: none; }
  .auth-shell, .join-shell { grid-template-columns: 1fr; padding: 28px 0; }
  .auth-copy h1 { font-size: 3.2rem; }
  .join-visual { display: none; }
  .moderator-sidebar { grid-template-columns: 1fr; }
  .team-controls { grid-template-columns: 1fr; }
  .mode-switcher { grid-template-columns: 1fr; }
  .online-board { grid-template-columns: 1fr; }
  .board-column { grid-template-columns: repeat(4, 1fr); grid-template-rows: 48px 58px; }
  .board-column h3 { grid-column: 1 / -1; }
  .moderator-stage { min-height: 440px; }
  .question-surface { min-height: 380px; padding: 18px; }
  .answer-comparison { grid-template-columns: 1fr; }
  .player-shell { grid-template-columns: 1fr; }
  .player-action { grid-column: 1; }
  .player-roster { grid-column: 1; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .answer-form { grid-template-columns: 1fr; }
  .broadcast-frame { min-height: 0; overflow: auto; }
  .broadcast { grid-template-rows: auto auto auto; min-height: 100vh; }
  .broadcast-header { grid-template-columns: 1fr; padding: 12px; }
  .host-placeholder { display: none; }
  .stage-turn { justify-self: stretch; }
  .stage-game { padding: 6px 12px; overflow: visible; }
  .broadcast-question { grid-template-columns: 1fr; }
  .stage-roster { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stage-player { min-height: 120px; }
  .lms-board, .stage-lms .lms-board { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .morph-layout { grid-template-columns: 1fr; }
}

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

/* Version 0.5: Showplanung, dynamische Teilnehmer und getrennter Adminbereich */
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-link { display: block; text-align: center; text-decoration: none; }
.plan-game { min-height: 72px !important; padding: 9px 12px !important; display: grid; align-content: center; gap: 2px; text-align: left; }
.plan-game strong { color: white; }
.plan-game small, .plan-game span { color: var(--muted); font-size: .65rem; }
.plan-game.is-complete { opacity: .48; }
.team-turn-button { border-left: 4px solid var(--competitor-color, var(--line)); background: linear-gradient(100deg, color-mix(in srgb, var(--competitor-color, #777) 22%, #121019), #121019); }
.moderator-player { border-left: 3px solid var(--competitor-color, var(--line)); }
.online-avatar[style*="--player-color"] { border-color: var(--player-color, var(--line)); }
.solo-label { color: var(--muted); font-size: .72rem; font-weight: 800; text-align: center; }
.main-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.show-planner { display: grid; gap: 16px; }
.show-planner h3 { margin: 0 0 4px; }
.show-planner p { margin: 0; color: var(--muted); }
.planner-games { margin: 12px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.planner-game { margin: 0; padding: 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) 62px; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.planner-game > input[type="number"] { margin: 0; min-width: 0; padding: 8px; }
.planner-game span { display: grid; gap: 2px; }
.planner-game small { color: var(--muted); }
.buzz-queue > small { display: block; padding: 8px 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .62rem; }
.stage-roster { grid-template-columns: repeat(var(--roster-columns, 1), minmax(0, 1fr)); justify-content: center; }
.stage-player { position: relative; border-color: var(--competitor-color, var(--line)); }
.camera-placeholder { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; align-content: center; color: rgba(255,255,255,.1); background: radial-gradient(circle, color-mix(in srgb, var(--competitor-color, #777) 14%, transparent), transparent 70%); }
.camera-placeholder span { font-size: 2.2rem; font-weight: 950; }
.camera-placeholder small { color: inherit; }
.turn-pill { border-left: 4px solid var(--competitor-color, var(--red)); }

.admin-shell { width: min(1550px, calc(100% - 32px)); margin: 28px auto 60px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.admin-sidebar { display: grid; align-content: start; gap: 16px; position: sticky; top: 88px; }
.admin-content { display: grid; gap: 16px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.admin-toolbar h1 { margin: 0; }
.catalog-summary { display: grid; gap: 4px; }
.catalog-summary > strong { color: var(--red); font-size: 2.6rem; }
.catalog-summary span { font-weight: 900; }
.catalog-summary small { color: var(--muted); }
.question-list { max-height: 620px; overflow: auto; display: grid; gap: 5px; }
.question-row { width: 100%; padding: 10px 12px; display: grid; grid-template-columns: minmax(170px, .75fr) minmax(280px, 2fr) minmax(120px, .65fr); gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 9px; color: white; background: rgba(255,255,255,.025); text-align: left; }
.question-row:hover { border-color: rgba(238,36,60,.7); background: rgba(238,36,60,.06); }
.question-row span { display: grid; }
.question-row small, .question-row em { color: var(--muted); font-size: .68rem; font-style: normal; }
.question-row.is-archived { opacity: .45; }
.pagination { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.admin-editor textarea { width: 100%; resize: vertical; }
.admin-form-actions { display: flex; gap: 8px; margin-top: 12px; }

@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .planner-games { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .question-row { grid-template-columns: 1fr; }
  .stage-roster { display: flex; flex-wrap: wrap; justify-content: center; }
  .stage-player { flex: 1 1 min(44%, 300px); max-width: 100%; }
}
