:root {
  --bg: #10120f;
  --ink: #f5f3e9;
  --muted: #b9b7a9;
  --panel: rgba(245, 243, 233, 0.08);
  --panel-strong: rgba(245, 243, 233, 0.13);
  --line: rgba(245, 243, 233, 0.18);
  --green: #17c77e;
  --green-dark: #0b7c52;
  --gold: #f1bd42;
  --red: #ee5961;
  --purple: #a970ff;
  --cyan: #5ad6d6;
  --shadow: rgba(0, 0, 0, 0.35);
  --cell-size: clamp(34px, 2.9vw, 56px);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(23, 199, 126, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(241, 189, 66, 0.1), transparent 35%),
    var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.stream-frame {
  width: min(1920px, 100vw);
  height: min(1080px, 100vh);
  max-height: 1080px;
  margin: 0 auto;
  padding: clamp(12px, 1.5vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 1.8vw, 28px);
  overflow: hidden;
}

.game-shell,
.overlay-column {
  min-width: 0;
  min-height: 0;
}

.game-shell {
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.5vw, 24px);
}

.topbar,
.leaderboard-panel,
.chat-panel,
.results-panel,
.round-top-panel,
.instruction-bar,
.period-board,
.break-screen,
.words-panel,
.grid-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 50px var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 96px;
  padding: clamp(16px, 1.6vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.logo-lockup {
  min-width: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
}

.game-title {
  margin: 0;
  color: var(--gold);
  font-size: clamp(2.4rem, 3.2vw, 4rem);
  font-weight: 950;
  line-height: 0.95;
}

.beta-badge {
  margin-top: 4px;
  padding: 5px 9px 4px;
  border: 1px solid rgba(241, 189, 66, 0.58);
  background: rgba(241, 189, 66, 0.16);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(16, 18, 15, 0.36), 0 0 18px rgba(241, 189, 66, 0.14);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 3rem;
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.round-metrics {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 66px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(16, 18, 15, 0.58);
}

.metric span {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.metric small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.play-area {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px) minmax(300px, 360px);
  gap: clamp(14px, 1.5vw, 24px);
  align-items: stretch;
}

.instruction-bar {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.instruction-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instruction-bar strong {
  color: var(--gold);
  font-weight: 950;
}

.side-stack {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(210px, 0.72fr);
  gap: clamp(14px, 1.5vw, 24px);
}

.grid-panel {
  min-width: 0;
  padding: clamp(10px, 1.2vw, 18px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(13, var(--cell-size));
  grid-template-rows: repeat(13, var(--cell-size));
  gap: clamp(3px, 0.32vw, 6px);
  user-select: none;
}

.grid-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 243, 233, 0.2);
  background: rgba(245, 243, 233, 0.1);
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.grid-cell.found {
  border-color: rgba(23, 199, 126, 0.78);
  background: linear-gradient(180deg, rgba(23, 199, 126, 0.72), rgba(11, 124, 82, 0.72));
  color: #06140d;
  text-shadow: 0 1px 0 rgba(245, 243, 233, 0.3);
}

.grid-cell.spotlight {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(241, 189, 66, 0.76), 0 0 18px rgba(241, 189, 66, 0.42);
}

.grid-cell.start-spotlight {
  background: rgba(241, 189, 66, 0.92);
  color: #171000;
}

.grid-cell.bonus-flash {
  animation: bonusFlashCell 2600ms ease-out both;
  animation-delay: var(--found-animation-delay, 0ms);
}

@keyframes bonusFlashCell {
  0% {
    transform: scale(1);
  }

  12% {
    border-color: rgba(122, 227, 154, 0.98);
    background: linear-gradient(180deg, rgba(176, 255, 200, 0.96), rgba(98, 214, 136, 0.92));
    color: #06210f;
    box-shadow:
      inset 0 0 0 2px rgba(220, 255, 232, 0.7),
      0 0 24px rgba(98, 214, 136, 0.7);
    transform: scale(1.06);
  }

  70% {
    border-color: rgba(122, 227, 154, 0.7);
    background: rgba(98, 214, 136, 0.45);
    color: var(--ink);
    box-shadow: 0 0 10px rgba(98, 214, 136, 0.3);
    transform: scale(1);
  }

  100% {
    border-color: rgba(245, 243, 233, 0.2);
    background: rgba(245, 243, 233, 0.1);
    color: var(--ink);
    box-shadow: none;
    transform: scale(1);
  }
}

.grid-cell.found.latest-found {
  animation: latestFoundCell 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--found-animation-delay, 0ms);
}

@keyframes latestFoundCell {
  0% {
    border-color: rgba(245, 243, 233, 0.2);
    background: rgba(245, 243, 233, 0.1);
    color: var(--ink);
    box-shadow: none;
    transform: scale(1);
  }

  42% {
    border-color: rgba(241, 189, 66, 0.98);
    background: linear-gradient(180deg, rgba(255, 217, 102, 0.98), rgba(241, 189, 66, 0.92));
    color: #171000;
    box-shadow:
      inset 0 0 0 2px rgba(255, 247, 184, 0.72),
      0 0 26px rgba(241, 189, 66, 0.66);
    transform: scale(1.045);
  }

  100% {
    border-color: rgba(241, 189, 66, 0.98);
    background: linear-gradient(180deg, rgba(255, 217, 102, 0.98), rgba(241, 189, 66, 0.92));
    color: #171000;
    box-shadow:
      inset 0 0 0 2px rgba(255, 247, 184, 0.56),
      0 0 20px rgba(241, 189, 66, 0.48);
    transform: scale(1);
  }
}

.grid-cell.missed {
  animation: none;
  border-color: rgba(238, 89, 97, 0.94);
  background: linear-gradient(180deg, rgba(238, 89, 97, 0.9), rgba(148, 37, 51, 0.88));
  color: #1b0609;
  box-shadow:
    inset 0 0 0 2px rgba(255, 190, 195, 0.42),
    0 0 20px rgba(238, 89, 97, 0.44);
}

.words-panel {
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-heading {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(245, 243, 233, 0.2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(23, 199, 126, 0.36);
  background: rgba(23, 199, 126, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.twitch-status {
  border-color: rgba(169, 112, 255, 0.38);
  background: rgba(169, 112, 255, 0.12);
  color: var(--purple);
}

.twitch-status.connected {
  border-color: rgba(23, 199, 126, 0.36);
  background: rgba(23, 199, 126, 0.12);
  color: var(--green);
}

.twitch-status.offline {
  border-color: rgba(238, 89, 97, 0.36);
  background: rgba(238, 89, 97, 0.1);
  color: var(--red);
}

.word-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(12, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
}

.word-row {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.letter-boxes {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--word-length, 1), minmax(14px, 24px));
  align-items: center;
  justify-content: start;
  gap: 2px;
}

.letter-box {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 243, 233, 0.26);
  background: rgba(16, 18, 15, 0.64);
  color: transparent;
  font-size: clamp(0.54rem, 0.82vw, 0.76rem);
  font-weight: 900;
  line-height: 1;
}

.letter-box.hint {
  border-color: rgba(90, 214, 214, 0.74);
  color: var(--cyan);
}

.word-row.found .letter-box {
  border-color: rgba(23, 199, 126, 0.82);
  background: rgba(23, 199, 126, 0.9);
  color: #06140d;
}

.word-row.found.latest-found .letter-box {
  animation: latestFoundWordBox 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--found-animation-delay, 0ms);
}

.word-meta {
  max-width: 74px;
  min-width: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.word-row.found .word-meta {
  color: var(--green);
}

.word-row.found.latest-found .word-meta {
  color: var(--gold);
}

@keyframes latestFoundWordBox {
  0% {
    border-color: rgba(245, 243, 233, 0.26);
    background: rgba(16, 18, 15, 0.64);
    color: transparent;
    box-shadow: none;
    transform: scale(1);
  }

  42% {
    border-color: rgba(241, 189, 66, 0.92);
    background: rgba(241, 189, 66, 0.94);
    color: #171000;
    box-shadow: 0 0 14px rgba(241, 189, 66, 0.42);
    transform: scale(1.05);
  }

  100% {
    border-color: rgba(241, 189, 66, 0.92);
    background: rgba(241, 189, 66, 0.94);
    color: #171000;
    box-shadow: 0 0 10px rgba(241, 189, 66, 0.34);
    transform: scale(1);
  }
}

.word-row.missed .letter-box {
  animation: none;
  border-color: rgba(238, 89, 97, 0.86);
  background: rgba(238, 89, 97, 0.9);
  color: #1b0609;
  box-shadow: 0 0 10px rgba(238, 89, 97, 0.28);
}

.word-row.missed .word-meta {
  color: var(--red);
}

.results-panel {
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-top-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-top-panel .instructions-panel,
.round-top-panel > .subheading {
  display: none;
}

.event-log {
  min-height: 0;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}

.event-row {
  min-height: 35px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 243, 233, 0.12);
  background: rgba(16, 18, 15, 0.44);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.event-row.score {
  border-color: rgba(23, 199, 126, 0.32);
  background: rgba(23, 199, 126, 0.1);
}

.event-row.powerup {
  border-color: rgba(241, 189, 66, 0.28);
  background: rgba(241, 189, 66, 0.08);
}

.event-row.system {
  color: var(--gold);
}

.event-row.muted {
  grid-template-columns: 1fr;
}

.event-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row strong {
  color: var(--green);
}

.subheading {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.instructions-panel {
  padding: 10px;
  border: 1px solid rgba(245, 243, 233, 0.14);
  background: rgba(16, 18, 15, 0.42);
}

.instruction-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.28;
}

.instruction-list li + li {
  margin-top: 4px;
}

.instruction-list strong {
  color: var(--gold);
}

.score-list {
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.score-list.compact {
  flex: 1;
}

.score-list li {
  min-height: 29px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.score-list .rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(245, 243, 233, 0.12);
  color: var(--ink);
}

.score-list .name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--ink);
  white-space: nowrap;
}

.score-list .name-text,
.leaderboard .name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscriber-badge {
  flex: 0 0 auto;
  min-width: 34px;
  height: 18px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 217, 102, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 217, 102, 0.98), rgba(244, 139, 46, 0.92));
  color: #26200f;
  box-shadow: 0 0 14px rgba(255, 190, 77, 0.2);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.score-list .score {
  color: var(--gold);
}

.break-screen {
  grid-column: 1 / -1;
  min-height: 0;
  padding: clamp(22px, 2vw, 34px);
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(18px, 2vw, 34px);
  align-items: stretch;
}

.break-screen[hidden] {
  display: none;
}

.break-countdown {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.break-countdown span,
.break-countdown small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.break-countdown p {
  max-width: 420px;
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

.break-countdown strong {
  margin: 14px 0 10px;
  color: var(--gold);
  font-size: 9rem;
  line-height: 0.9;
}

.break-boards {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.period-board {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.break-phase .grid-panel,
body.break-phase .words-panel,
body.break-phase .side-stack,
body.stopped-phase .grid-panel,
body.stopped-phase .words-panel,
body.stopped-phase .side-stack {
  display: none;
}

body.break-phase .play-area,
body.stopped-phase .play-area {
  grid-template-columns: 1fr;
}

.stopped-screen {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: clamp(22px, 2vw, 34px);
}

.stopped-screen[hidden] {
  display: none;
}

.stopped-screen span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stopped-screen strong {
  color: var(--gold);
  font-size: 4.5rem;
  line-height: 1;
}

.stopped-screen p {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
}

.phase-transition {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(16, 18, 15, 0.72);
  backdrop-filter: blur(10px);
  transition:
    opacity 520ms ease,
    visibility 0ms linear 620ms;
}

.phase-transition[hidden] {
  display: none;
}

.phase-transition.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 520ms ease;
}

.phase-transition-copy {
  display: grid;
  gap: 12px;
  text-align: center;
  transform: translateY(12px) scale(0.96);
  transition: transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phase-transition.active .phase-transition-copy {
  transform: translateY(0) scale(1);
}

.phase-transition-copy span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-transition-copy strong {
  color: var(--gold);
  font-size: clamp(4rem, 7vw, 8rem);
  font-weight: 950;
  line-height: 0.92;
}

.overlay-column {
  display: grid;
  grid-template-rows: minmax(170px, 230px) minmax(0, 1fr);
  gap: clamp(14px, 1.5vw, 24px);
}

.production-mode .overlay-column,
.production-mode .dev-toggle {
  display: none;
}

.dev-toggle {
  display: none;
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 30;
  min-width: 58px;
  min-height: 42px;
  border: 1px solid rgba(241, 189, 66, 0.42);
  background: rgba(16, 18, 15, 0.9);
  color: var(--gold);
  font-weight: 900;
}

.dev-mode .dev-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dev-mode .overlay-column {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 410px;
  max-width: calc(100vw - 48px);
  padding-top: 56px;
  transform: translateX(calc(100% + 32px));
  transition: transform 180ms ease;
  pointer-events: none;
}

.dev-mode.dev-overlay-open .overlay-column {
  transform: translateX(0);
  pointer-events: auto;
}

.dev-mode.dev-overlay-open .dev-toggle {
  border-color: rgba(23, 199, 126, 0.62);
  color: var(--green);
}

.leaderboard-panel,
.chat-panel {
  min-width: 0;
  padding: 16px;
}

.leaderboard-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard {
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.leaderboard li {
  min-height: 34px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.leaderboard .rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(245, 243, 233, 0.12);
  color: var(--ink);
}

.leaderboard .name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--ink);
  white-space: nowrap;
}

.leaderboard .score {
  color: var(--gold);
}

.empty-state {
  color: var(--muted);
  font-weight: 700;
}

.chat-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-feed {
  min-height: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.chat-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(245, 243, 233, 0.1);
  background: rgba(16, 18, 15, 0.42);
}

.chat-line.system {
  grid-template-columns: minmax(0, 1fr);
  border-color: rgba(241, 189, 66, 0.3);
  background: rgba(241, 189, 66, 0.1);
  color: var(--gold);
  font-weight: 800;
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--avatar-color, var(--purple));
  color: #0b0612;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-copy {
  min-width: 0;
}

.chat-name {
  margin-right: 5px;
  color: var(--ink);
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-right: 4px;
  padding: 2px 5px;
  background: rgba(169, 112, 255, 0.22);
  color: #d9c4ff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.bits {
  background: rgba(241, 189, 66, 0.18);
  color: var(--gold);
}

.chat-message {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chat-result {
  margin-top: 4px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 900;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sub-toggle {
  min-height: 40px;
  padding: 0 10px;
  flex-direction: row;
  align-items: center;
  border: 1px solid rgba(245, 243, 233, 0.16);
  background: rgba(16, 18, 15, 0.52);
  color: var(--ink);
  white-space: nowrap;
}

.sub-toggle input {
  accent-color: var(--purple);
}

input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(245, 243, 233, 0.2);
  background: rgba(16, 18, 15, 0.72);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(90, 214, 214, 0.16);
}

.send-button,
.secondary-button,
.icon-button,
.powerup-button {
  min-height: 40px;
  border: 1px solid transparent;
  color: var(--ink);
  font-weight: 900;
}

.send-button {
  min-width: 104px;
  background: var(--green);
  color: #06140d;
}

.send-button:hover,
.send-button:focus-visible {
  background: #41df9d;
}

.secondary-button,
.icon-button,
.powerup-button {
  background: rgba(245, 243, 233, 0.1);
  border-color: rgba(245, 243, 233, 0.18);
}

.secondary-button {
  padding: 0 12px;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 1.1rem;
}

.powerups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.powerup-button {
  padding: 0 8px;
  color: var(--gold);
}

.secondary-button:hover,
.icon-button:hover,
.powerup-button:hover,
.secondary-button:focus-visible,
.icon-button:focus-visible,
.powerup-button:focus-visible {
  border-color: var(--gold);
}

@media (max-width: 1200px) {
  :root {
    --cell-size: clamp(31px, 5.8vw, 52px);
  }

  .stream-frame {
    grid-template-columns: 1fr;
  }

  .overlay-column {
    grid-template-columns: minmax(0, 0.85fr) minmax(330px, 1.15fr);
    grid-template-rows: minmax(240px, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --cell-size: min(6.35vw, 36px);
  }

  .stream-frame {
    padding: 10px;
  }

  .topbar,
  .play-area,
  .overlay-column {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2.2rem;
  }

  .game-title {
    font-size: 2.6rem;
  }

  .beta-badge {
    margin-top: 2px;
    padding: 4px 7px 3px;
    font-size: 0.62rem;
  }

  .grid-cell {
    font-size: 1.05rem;
  }

  .round-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .play-area {
    display: flex;
    flex-direction: column;
  }

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

  .word-list {
    max-height: 380px;
  }
}
