:root {
  --bg-0: #020305;
  --bg-1: #0a0f16;
  --bg-2: #131a24;
  --panel: #0f1520;
  --panel-strong: #182334;
  --panel-glass: rgba(10, 15, 25, 0.88);
  --text-main: #f6f7fb;
  --text-soft: #b1bbca;
  --text-faint: #8790a1;
  --white: #ffffff;
  --red: #dc1736;
  --red-bright: #ff3255;
  --blue: #2f9aff;
  --blue-bright: #71beff;
  --gold: #ffd46b;
  --gold-soft: #f4b942;
  --danger: #ff456c;
  --ok: #58e8b0;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.26);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.52);
  --radius-xl: 1.05rem;
  --radius-lg: 0.9rem;
  --radius-md: 0.72rem;
  --touch-target: clamp(46px, 2.8vw, 64px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

html {
  color-scheme: dark;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

body {
  position: relative;
  padding: 0.9rem;
  color: var(--text-main);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 16%, rgba(220, 23, 54, 0.36), transparent 34%),
    radial-gradient(circle at 84% 9%, rgba(47, 154, 255, 0.28), transparent 32%),
    radial-gradient(circle at 52% 108%, rgba(220, 23, 54, 0.16), transparent 42%),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 35%, var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -36deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.02) 18px 19px
    );
  opacity: 0.24;
  animation: mesh-drift 28s linear infinite;
}

body.round-loss {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 61, 94, 0.34), transparent 35%),
    linear-gradient(140deg, #21050b, #4f0817 52%, #2d030d);
}

body.round-win {
  background:
    radial-gradient(circle at 50% 18%, rgba(88, 232, 176, 0.32), transparent 35%),
    linear-gradient(140deg, #082014, #0b4d2a 52%, #072213);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
  animation: app-in 420ms ease-out;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 22% 6%, rgba(255, 212, 107, 0.14), transparent 36%),
    linear-gradient(115deg, rgba(151, 15, 39, 0.72), rgba(9, 16, 26, 0.94) 38%, rgba(23, 57, 99, 0.75));
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  min-height: clamp(60px, 7vw, 124px);
}

.brand-tag {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.brand-logo {
  display: block;
  width: auto;
  height: clamp(60px, 7vw, 124px);
  max-width: min(100%, 420px);
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.45));
}

h1 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 0.04em;
  color: var(--white);
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 0%, #ffd46b 40%, #ff6b8a 60%, #fff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 12px rgba(255, 50, 85, 0.4)) drop-shadow(0 0 24px rgba(255, 212, 107, 0.2));
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.control {
  display: grid;
  gap: 0.22rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

.control.compact {
  justify-items: end;
}

.control.compact select {
  min-width: 158px;
}

#modeControl {
  max-width: 260px;
  opacity: 1;
  transform: translateX(0);
  overflow: hidden;
  transition:
    max-width 260ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    margin 220ms ease;
}

body.round-live #modeControl {
  max-width: 0;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  margin: 0;
}

select,
input[type="search"] {
  min-height: var(--touch-target);
  min-width: 185px;
  max-width: min(100%, 360px);
  border-radius: 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.07), rgba(4, 8, 14, 0.58)),
    rgba(0, 0, 0, 0.22);
  color: var(--text-main);
  padding: 0.42rem 0.7rem;
  font-size: clamp(0.96rem, 1.1vw, 1.06rem);
  font-weight: 600;
  transition: border-color 160ms ease, box-shadow 220ms ease, transform 220ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(140deg, rgba(255, 255, 255, 0.07), rgba(4, 8, 14, 0.58)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath fill='%23ffd46b' d='M7 9L0.5 0.8h13z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 0.75rem center;
  background-size: auto, 0.8rem;
  padding-right: 2rem;
}

select option {
  background: #0a121d;
  color: var(--text-main);
}

select:hover,
input[type="search"]:hover,
select:focus-visible,
input[type="search"]:focus-visible {
  outline: none;
  border-color: rgba(113, 190, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(47, 154, 255, 0.22);
}

.layout {
  min-height: calc(100vh - 7.6rem);
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(390px, 1fr);
  gap: 0.9rem;
}

.board-panel,
.host-panel {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--panel-glass);
  box-shadow: var(--shadow);
}

.board-panel {
  position: relative;
  padding: 1.05rem;
  display: grid;
  gap: 0.95rem;
  align-content: start;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 212, 107, 0.16), transparent 38%),
    radial-gradient(circle at 96% 4%, rgba(47, 154, 255, 0.18), transparent 28%),
    radial-gradient(circle at 6% 3%, rgba(220, 23, 54, 0.26), transparent 32%),
    rgba(9, 14, 23, 0.9);
}

.board-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 212, 107, 0.26) 0 2px, transparent 2px 20px) 0 0 / 18px 18px,
    radial-gradient(circle, rgba(255, 212, 107, 0.2) 0 2px, transparent 2px 20px) 9px 9px / 18px 18px;
  mask-image: linear-gradient(transparent 8%, black 24%, black 76%, transparent 92%);
  opacity: 0.18;
}

.board-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 212, 107, 0.32);
  background:
    linear-gradient(120deg, rgba(104, 8, 24, 0.68), rgba(25, 41, 66, 0.68)),
    rgba(255, 255, 255, 0.03);
  padding: 0.42rem 0.6rem;
}

.mode-badge,
.score-ribbon,
.round-strikes {
  margin: 0;
}

.mode-badge {
  border-radius: 0.64rem;
  border: 1px solid rgba(255, 212, 107, 0.42);
  padding: 0.32rem 0.62rem;
  font-size: clamp(0.95rem, 1vw, 1.08rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f6fbff;
  background: linear-gradient(130deg, rgba(108, 10, 29, 0.46), rgba(10, 20, 33, 0.64));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-ribbon {
  text-align: left;
  border-radius: 0.64rem;
  border: 1px solid rgba(113, 190, 255, 0.42);
  padding: 0.32rem 0.62rem;
  font-weight: 700;
  font-size: clamp(0.95rem, 1vw, 1.08rem);
  color: #f7fbff;
  text-shadow: 0 0 14px rgba(113, 190, 255, 0.35);
  background: linear-gradient(130deg, rgba(17, 50, 84, 0.5), rgba(9, 20, 33, 0.68));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-pulse {
  animation: hud-score-pulse 400ms ease;
}

@keyframes hud-score-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.06); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); }
}

.round-strikes {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.strike-meter {
  display: inline-flex;
  gap: 0.2rem;
}

.strike-box {
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.28);
  color: transparent;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.strike-box.filled {
  color: #fff;
  border-color: rgba(255, 114, 142, 0.8);
  background: linear-gradient(145deg, rgba(220, 23, 54, 0.88), rgba(255, 78, 112, 0.78));
  box-shadow: 0 0 12px rgba(255, 78, 112, 0.36);
}

.strike-tally {
  min-width: 2.2rem;
  text-align: right;
  color: #ffb2c1;
  font-size: 0.9rem;
  font-weight: 700;
}

.topic-chooser {
  display: grid;
  gap: 0.45rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 212, 107, 0.24);
  background:
    radial-gradient(circle at 88% 10%, rgba(47, 154, 255, 0.22), transparent 36%),
    linear-gradient(130deg, rgba(120, 11, 30, 0.36), rgba(12, 23, 38, 0.82) 58%);
  padding: 0.62rem;
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  transition:
    max-height 320ms ease,
    opacity 260ms ease,
    transform 260ms ease,
    padding 260ms ease,
    border-color 260ms ease;
}

.topic-title,
.topic-winner-note {
  margin: 0;
}

.topic-title {
  font-weight: 700;
  color: var(--gold);
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  animation: topic-title-glow 2.5s ease-in-out infinite;
}

@keyframes topic-title-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 212, 107, 0.2); }
  50% { text-shadow: 0 0 18px rgba(255, 212, 107, 0.5); }
}

.topic-winner-note {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.topic-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.46rem;
}

.host-topic-choices {
  grid-template-columns: 1fr;
}

.host-topics {
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  transition:
    max-height 320ms ease,
    opacity 260ms ease,
    transform 260ms ease,
    padding 260ms ease,
    border-color 260ms ease;
}

.topic-chooser.is-hidden,
.host-topics.is-hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
  overflow: hidden;
}

.topic-choice {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 0.15rem;
  border-radius: 0.78rem;
  border: 1px solid rgba(255, 212, 107, 0.4);
  background:
    radial-gradient(circle at 86% 10%, rgba(113, 190, 255, 0.36), transparent 38%),
    radial-gradient(circle at 14% 12%, rgba(255, 212, 107, 0.26), transparent 36%),
    linear-gradient(120deg, rgba(163, 13, 39, 0.72), rgba(18, 45, 77, 0.9));
  padding: 0.56rem 0.68rem;
  color: var(--white);
  text-align: left;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.3);
  transition:
    transform 180ms ease,
    box-shadow 220ms ease,
    border-color 180ms ease;
}

.topic-choice .topic-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.topic-choice .topic-meta {
  font-size: 0.86rem;
  color: rgba(244, 247, 255, 0.86);
}

.topic-choice:hover,
.topic-choice:focus-visible {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(255, 212, 107, 0.74);
  box-shadow:
    0 0 0 2px rgba(255, 212, 107, 0.2),
    0 14px 26px rgba(0, 0, 0, 0.42);
}

.result-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 50;
  padding: 1rem;
  pointer-events: none;
  animation: overlay-fade-in 400ms ease;
}

.result-overlay.show {
  display: grid;
  pointer-events: auto;
}

.result-overlay.loss {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 50, 85, 0.25), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(255, 100, 50, 0.15), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(200, 0, 50, 0.2), transparent 45%),
    rgba(10, 0, 0, 0.82);
}

.result-overlay.win {
  background:
    radial-gradient(circle at 50% 40%, rgba(88, 232, 176, 0.28), transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(47, 154, 255, 0.18), transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(255, 212, 107, 0.15), transparent 45%),
    rgba(0, 10, 2, 0.8);
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-overlay-card {
  max-width: min(92vw, 980px);
  text-align: center;
  border-radius: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.58);
  padding: clamp(1.2rem, 3vw, 2.6rem);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.5);
  animation: result-card-in 500ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.result-overlay-card h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-shadow: 0 0 32px currentColor;
}

.result-overlay-card p {
  margin: 0.6rem 0 0;
  font-size: clamp(1rem, 2.1vw, 2rem);
  color: #f5f8ff;
}

.result-score-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  margin-top: clamp(0.8rem, 2vw, 1.4rem);
  flex-wrap: wrap;
}

.result-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.result-team strong {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 800;
  line-height: 1;
}

.result-team-a strong {
  color: var(--blue-bright);
  text-shadow: 0 0 18px rgba(47, 154, 255, 0.5);
}

.result-team-b strong {
  color: var(--red-bright);
  text-shadow: 0 0 18px rgba(255, 50, 85, 0.5);
}

.result-vs {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.result-player strong {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 800;
  color: var(--gold);
}

@keyframes result-card-in {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(18px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-panel {
  border-color: rgba(113, 190, 255, 0.32) !important;
  background:
    radial-gradient(circle at 8% 6%, rgba(113, 190, 255, 0.18), transparent 35%),
    rgba(255, 255, 255, 0.04) !important;
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.42rem;
}

.auth-row input {
  min-height: clamp(44px, 2.6vw, 54px);
}

.board-panel.round-change .question-card {
  animation: focus-flare 420ms ease-out;
}

.question-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 212, 107, 0.42);
  background:
    radial-gradient(circle at 84% 9%, rgba(47, 154, 255, 0.28), transparent 36%),
    radial-gradient(circle at 8% 12%, rgba(220, 23, 54, 0.24), transparent 38%),
    linear-gradient(140deg, rgba(89, 8, 24, 0.78), rgba(14, 24, 39, 0.96) 62%);
  padding: 1rem 1.1rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 12px 24px rgba(0, 0, 0, 0.34);
}

.question-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 5.2s ease-in-out infinite;
}

.round-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: clamp(1.05rem, 1.2vw, 1.3rem);
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#multiplierLabel {
  color: var(--white);
  background: linear-gradient(110deg, rgba(220, 23, 54, 0.84), rgba(255, 92, 55, 0.8));
  border: 1px solid rgba(255, 212, 107, 0.56);
  border-radius: 999px;
  padding: 0.14rem 0.7rem;
  box-shadow: 0 0 16px rgba(255, 92, 55, 0.45);
}

#promptText {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 3.2vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.strike-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.strike-overlay.flash {
  animation: strike-fade 880ms ease-out forwards;
}

.strike-overlay .strike-glyph {
  color: var(--danger);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: clamp(7rem, 22vw, 22rem);
  text-shadow:
    0 0 24px rgba(255, 69, 108, 0.62),
    0 0 68px rgba(255, 69, 108, 0.45);
  transform: scale(0.85);
  animation: strike-pop 420ms ease-out;
}

.answer-card {
  position: relative;
  overflow: hidden;
  min-height: clamp(94px, 11vh, 132px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 0.82rem;
  border: 1px solid rgba(255, 212, 107, 0.34);
  background:
    radial-gradient(circle at 90% 8%, rgba(113, 190, 255, 0.26), transparent 34%),
    linear-gradient(132deg, rgba(23, 36, 56, 0.95), rgba(10, 18, 31, 0.96));
  font-size: clamp(1.18rem, 2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f5f9ff;
  transform: translateY(14px);
  opacity: 0;
  animation: answer-enter 420ms ease forwards;
  animation-delay: calc(var(--stagger, 0) * 60ms);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.34);
}

.answer-card.revealed {
  border-color: rgba(255, 212, 107, 0.65);
  background:
    radial-gradient(circle at 88% 8%, rgba(113, 190, 255, 0.4), transparent 38%),
    radial-gradient(circle at 18% 16%, rgba(255, 212, 107, 0.26), transparent 42%),
    linear-gradient(130deg, rgba(161, 16, 44, 0.74), rgba(19, 40, 69, 0.95) 66%);
  animation:
    answer-enter 360ms ease forwards,
    reveal-burst 350ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 212, 107, 0.18),
    0 0 20px rgba(255, 212, 107, 0.15),
    0 10px 24px rgba(0, 0, 0, 0.4);
}

.answer-card.revealed::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.28) 50%, transparent 72%);
  transform: translateX(-140%);
  animation: reveal-sweep 520ms ease-out;
}

.answer-slot {
  color: rgba(255, 212, 107, 0.92);
  letter-spacing: 0.04em;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 3rem);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(255, 212, 107, 0.35);
}

.answer-reveal-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.answer-rank {
  color: rgba(255, 212, 107, 0.92);
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.answer-label {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
}

.answer-char {
  display: inline-block;
  transform: none;
  opacity: 1;
  will-change: transform, opacity, filter;
}

.answer-char.reveal {
  opacity: 0;
  transform: translateY(12px) rotateX(-70deg) scale(0.9);
  filter: blur(1px);
  animation: answer-letter-reveal 360ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
  animation-delay: var(--char-delay, 0ms);
}

.points-pill {
  min-width: 56px;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.25vw, 1.22rem);
  color: var(--white);
  border: 1px solid rgba(255, 212, 107, 0.58);
  background: linear-gradient(120deg, rgba(220, 23, 54, 0.92), rgba(255, 92, 55, 0.82));
  box-shadow: 0 0 14px rgba(255, 92, 55, 0.36);
}

.host-panel {
  padding: 0.9rem;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  background:
    radial-gradient(circle at 96% -4%, rgba(47, 154, 255, 0.16), transparent 34%),
    radial-gradient(circle at 8% -4%, rgba(220, 23, 54, 0.2), transparent 36%),
    rgba(8, 14, 24, 0.94);
}

.host-panel section {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 92% -5%, rgba(47, 154, 255, 0.15), transparent 38%),
    linear-gradient(145deg, rgba(141, 13, 36, 0.14), rgba(12, 20, 32, 0.86));
  padding: 0.72rem;
}

h3 {
  margin: 0 0 0.5rem;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.06rem, 1.15vw, 1.26rem);
  letter-spacing: 0.01em;
}

.scoreboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.team-card,
.strike-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.55rem;
}

.team-a {
  background: linear-gradient(130deg, rgba(47, 154, 255, 0.32), rgba(47, 154, 255, 0.08));
}

.team-b {
  background: linear-gradient(130deg, rgba(220, 23, 54, 0.44), rgba(220, 23, 54, 0.1));
}

.team-card h4,
.team-card p,
.strike-card p {
  margin: 0;
}

.team-name-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.48rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.28rem 0.45rem;
  text-align: center;
}

.team-name-input:focus {
  outline: none;
  border-color: rgba(255, 212, 107, 0.6);
  background: rgba(0, 0, 0, 0.36);
}

.score-value,
.strike-count {
  font-feature-settings: "tnum";
}

.score-value {
  margin: 0.24rem 0 0.42rem;
  font-size: clamp(2rem, 2.2vw, 2.8rem);
  line-height: 1;
}

.strike-count {
  margin: 0.18rem 0 0.38rem;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  color: var(--danger);
  line-height: 1;
}

.score-value.value-updated {
  animation: metric-pop 260ms ease;
}

.strike-count.value-updated {
  animation: metric-danger 300ms ease;
}

.score-buttons,
.strike-buttons,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.live-topic-tools {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.live-topic-control {
  width: 100%;
}

#liveCategoryInput {
  width: 100%;
  min-height: clamp(40px, 2.6vw, 52px);
}

.live-category-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.live-category-chip {
  min-height: clamp(34px, 2.2vw, 42px);
  padding: 0.28rem 0.58rem;
  font-size: 0.86rem;
  border-radius: 999px;
}

.btn-strike {
  border-color: rgba(255, 99, 133, 0.82);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 212, 107, 0.24), transparent 40%),
    linear-gradient(130deg, rgba(220, 23, 54, 0.86), rgba(255, 50, 85, 0.72));
}

.btn {
  min-height: var(--touch-target);
  border-radius: 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 212, 107, 0.12), transparent 36%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28)),
    rgba(0, 0, 0, 0.14);
  color: var(--text-main);
  padding: 0.45rem 0.86rem;
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.btn:hover,
.btn:focus-visible {
  outline: none;
  transform: translateY(-1px) scale(1.01);
  border-color: rgba(255, 212, 107, 0.68);
  box-shadow:
    0 0 0 2px rgba(255, 212, 107, 0.2),
    0 9px 18px rgba(0, 0, 0, 0.34);
}

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

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

.btn.tiny {
  min-height: clamp(38px, 2.3vw, 46px);
  padding: 0.22rem 0.5rem;
}

.btn-highlight {
  border-color: rgba(255, 212, 107, 0.72);
  background:
    radial-gradient(circle at 20% 16%, rgba(113, 190, 255, 0.36), transparent 44%),
    radial-gradient(circle at 85% 10%, rgba(255, 212, 107, 0.3), transparent 40%),
    linear-gradient(135deg, rgba(220, 23, 54, 0.76), rgba(255, 50, 85, 0.62));
  color: var(--white);
}

.status {
  margin: 0.56rem 0 0;
  color: var(--text-soft);
}

.status.mini {
  margin: 0;
  font-size: 0.85rem;
}

#sourceStatus.good {
  color: var(--ok);
}

#sourceStatus.warn {
  color: #ffd16f;
}

#sourceStatus.bad {
  color: var(--danger);
}

#syncStatus.good {
  color: var(--ok);
}

#syncStatus.warn {
  color: #ffd16f;
}

#syncStatus.bad {
  color: var(--danger);
}

#authStatus.good {
  color: var(--ok);
}

#authStatus.warn {
  color: #ffd16f;
}

#authStatus.bad {
  color: var(--danger);
}

#answerControls,
#roundBank {
  display: grid;
  gap: 0.48rem;
}

.answer-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 0.34rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.58rem;
  padding: 0.34rem;
  background: linear-gradient(140deg, rgba(135, 12, 34, 0.16), rgba(9, 17, 28, 0.72));
}

.answer-text {
  margin: 0;
  font-size: 0.98rem;
}

.answer-text.hidden {
  filter: blur(6px);
  opacity: 0.52;
}

.answer-points {
  min-width: 2.1rem;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
}

.individual-scoreboard {
  display: grid;
  gap: 0.55rem;
  max-height: 680px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 300ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    margin 220ms ease;
}

.individual-scoreboard.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 0;
  pointer-events: none;
}

.player-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.player-create input {
  min-height: clamp(40px, 2.6vw, 52px);
}

.player-list {
  display: grid;
  gap: 0.42rem;
}

.player-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 0.35rem;
  align-items: center;
  border-radius: 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(17, 30, 49, 0.76), rgba(126, 11, 31, 0.18));
  padding: 0.36rem;
}

.player-row .score-buttons {
  grid-column: span 5;
}

.player-delete-btn {
  border-color: rgba(255, 69, 108, 0.6);
  background: linear-gradient(130deg, rgba(220, 23, 54, 0.6), rgba(180, 10, 40, 0.4));
  color: var(--danger);
  font-weight: 800;
}

.player-row .player-name-input,
.player-row .player-score {
  margin: 0;
}

.player-row .player-name-input {
  min-height: clamp(38px, 2.2vw, 46px);
  border-radius: 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
}

.player-row .player-score {
  font-weight: 700;
  color: var(--gold);
}

.player-row.active {
  border-color: rgba(255, 212, 107, 0.64);
  background: linear-gradient(135deg, rgba(47, 154, 255, 0.34), rgba(255, 72, 98, 0.2));
}

.round-bank-item {
  display: grid;
  gap: 0.25rem;
  border-radius: 0.64rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(138deg, rgba(11, 19, 31, 0.9), rgba(77, 8, 25, 0.22));
  padding: 0.52rem;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.round-bank-item p {
  margin: 0;
  line-height: 1.08;
}

.round-bank-item .meta {
  color: var(--text-faint);
  font-size: 0.86rem;
}

.round-bank-item.active {
  border-color: rgba(255, 212, 107, 0.62);
  background:
    linear-gradient(140deg, rgba(47, 154, 255, 0.28), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.07);
}

.round-bank-item button {
  width: 100%;
}

body.host-hidden .layout {
  grid-template-columns: 1fr;
}

body.host-hidden .host-panel {
  display: none;
}

body.host-hidden #toggleHostBtn {
  border-color: rgba(113, 190, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(47, 154, 255, 0.2);
}

body.mode-teams #individualScoreboard {
  display: none;
}

body.mode-individuals #teamScoreboard,
body.mode-individuals #teamStrikes {
  display: none;
}

body.view-board .layout {
  grid-template-columns: 1fr;
}

body.view-board .host-panel,
body.view-board #toggleHostBtn,
body.view-board #randomRoundBtn,
body.view-board #resetRoundBtn,
body.view-board #newGameBtn {
  display: none;
}

body.view-board .top-controls .control {
  display: none;
}

body.view-board .top-controls {
  gap: 0.45rem;
}

body.view-board .topbar {
  background:
    radial-gradient(circle at 22% 6%, rgba(255, 212, 107, 0.18), transparent 36%),
    linear-gradient(115deg, rgba(151, 15, 39, 0.82), rgba(9, 16, 26, 0.96) 38%, rgba(23, 57, 99, 0.85));
}

body.view-board .board-hud {
  font-size: clamp(1.1rem, 1.4vw, 1.5rem);
}

body.view-board .mode-badge,
body.view-board .score-ribbon {
  font-size: clamp(1.1rem, 1.5vw, 1.6rem);
  padding: 0.42rem 0.82rem;
}

body.view-board .strike-box {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.4rem;
}

body.view-board #promptText {
  font-size: clamp(2.2rem, 3.8vw, 4.2rem);
}

body.view-board .answer-card {
  min-height: clamp(100px, 12vh, 148px);
  font-size: clamp(1.3rem, 2.4vw, 2.6rem);
}

body.view-board .answer-slot {
  font-size: clamp(2rem, 3.5vw, 3.8rem);
}

body.view-board .points-pill {
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  padding: 0.32rem 0.72rem;
}

body.view-board .topic-choice {
  min-height: 110px;
}

body.view-board .topic-choice .topic-name {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

body.view-board .topic-choice .topic-meta {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
}

body.view-host .layout {
  grid-template-columns: 1fr;
  min-height: auto;
}

body.view-host .board-panel {
  display: none;
}

body.view-host #toggleHostBtn {
  display: none;
}

body.controls-locked .host-panel section:not(.auth-panel),
body.controls-locked .top-controls > *:not(#fullscreenBtn) {
  opacity: 0.74;
  filter: saturate(0.85);
}

@keyframes app-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mesh-drift {
  from {
    transform: translate3d(-2.5%, -1.2%, 0);
  }
  to {
    transform: translate3d(2.5%, 1.2%, 0);
  }
}

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

@keyframes answer-enter {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes reveal-burst {
  0% {
    transform: scale(0.985);
  }
  45% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes reveal-sweep {
  from {
    transform: translateX(-140%);
  }
  to {
    transform: translateX(145%);
  }
}

@keyframes answer-letter-reveal {
  0% {
    opacity: 0;
    transform: translateY(12px) rotateX(-70deg) scale(0.9);
    filter: blur(1.5px);
  }
  60% {
    opacity: 1;
    transform: translateY(-1px) rotateX(0deg) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes metric-pop {
  0% {
    transform: scale(1);
    color: var(--text-main);
  }
  40% {
    transform: scale(1.08);
    color: var(--blue-bright);
  }
  100% {
    transform: scale(1);
    color: var(--text-main);
  }
}

@keyframes metric-danger {
  0% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-3px);
  }
  70% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes focus-flare {
  0% {
    border-color: rgba(255, 255, 255, 0.22);
  }
  35% {
    border-color: rgba(113, 190, 255, 0.72);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.22);
  }
}

@keyframes strike-pop {
  0% {
    transform: scale(0.45);
    opacity: 0.1;
  }
  48% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.94;
  }
}

@keyframes strike-fade {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (min-width: 1650px) and (min-aspect-ratio: 16/10) {
  body {
    padding: 0.8rem;
  }

  .layout {
    grid-template-columns: 2.15fr 0.92fr;
    min-height: calc(100vh - 7.2rem);
  }

  .answers-grid {
    gap: 0.82rem;
  }

  .host-panel {
    max-height: calc(100vh - 2.2rem);
  }
}

@media (max-width: 1380px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .host-panel {
    max-height: none;
  }
}

@media (max-width: 820px) {
  body {
    padding: 0.5rem;
  }

  .topbar {
    padding: 0.7rem;
  }

  .brand-logo {
    height: clamp(52px, 14vw, 86px);
    max-width: min(100%, 78vw);
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .answer-row {
    grid-template-columns: auto 1fr auto auto;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .board-hud {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.32rem;
  }

  .mode-badge,
  .score-ribbon {
    text-align: center;
  }

  .round-strikes {
    justify-content: center;
  }

  .topic-choices {
    grid-template-columns: 1fr;
  }

  .scoreboard-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (pointer: coarse) {
  :root {
    --touch-target: clamp(54px, 4vh, 72px);
  }

  .btn.tiny {
    min-height: clamp(44px, 3.3vh, 56px);
  }
}

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