:root {
  --bg: #090d13;
  --surface: #111722;
  --surface-2: #172131;
  --surface-3: #202b3d;
  --line: #2e3c52;
  --text: #f7f9fc;
  --muted: #98a9c1;
  --gold: #d8ff3e;
  --teal: #55d8e6;
  --coral: #ff766c;
  --violet: #a99cff;
  --green: #80e999;
}

* {
  box-shadow: none !important;
}

html,
body {
  background: var(--bg);
}

body::before {
  display: none;
}

body:not(.in-game):not(.maintenance-page) {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body:not(.in-game):not(.maintenance-page) .app {
  flex: 1 0 auto;
  display: flex;
}

button {
  min-height: 42px;
  border-radius: 7px;
  border-color: var(--line);
  background: var(--surface-3);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.primary {
  border-color: transparent;
  background: var(--gold);
  color: #10150d;
}

.app,
.home-footer {
  width: min(1180px, calc(100% - 48px));
}

/* Home */
.home-shell {
  width: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 28px;
  padding: 30px 0;
}

.home-nav {
  padding: 0;
}

.brand strong {
  color: var(--text);
  font-size: 21px;
  font-weight: 950;
  letter-spacing: -.035em;
}

.brand strong::first-letter {
  color: var(--gold);
}

.nav-pills {
  gap: 0;
  border: 1px solid #28364a;
  border-radius: 999px;
  padding: 3px;
  background: #0d131d;
}

.nav-pills span {
  border: 0;
  border-radius: 999px;
  color: #aab8cb;
  padding: 7px 11px;
}

.nav-pills span:first-child {
  background: var(--gold);
  color: #10150d;
}

.home-hero {
  grid-template-columns: minmax(300px, .78fr) minmax(540px, 1.22fr);
  align-items: center;
  gap: clamp(44px, 5.2vw, 72px);
  padding: 42px 0 24px;
}

.hero-copy {
  position: relative;
  padding-top: 22px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 5px;
  background: var(--coral);
}

.hero-copy .eyebrow {
  color: var(--teal);
}

.hero-copy h1 {
  max-width: 490px;
  color: var(--text);
  font-size: clamp(45px, 4.9vw, 70px);
  line-height: .92;
  letter-spacing: -.06em;
}

.home-lead {
  max-width: 390px;
  color: #b7c5d7;
  font-size: 16px;
}

.entry-board {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.entry-board .panel {
  min-height: 298px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 24px;
}

.entry-board .create-card {
  border-right: 1px solid var(--line);
}

.panel-head {
  margin-bottom: 22px;
}

.panel-head span {
  display: none;
}

.panel-head h2 {
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.045em;
}

label,
.mode-field {
  color: #94a5bc;
  font-size: 10px;
  letter-spacing: .05em;
}

input,
textarea,
select {
  border-color: #314158;
  border-radius: 7px;
  background: #0b1119;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(85, 216, 230, .16) !important;
}

.home-mode-picker {
  gap: 3px;
  border-color: #314158;
  border-radius: 7px;
  background: #0b1119;
}

.home-mode-picker span {
  border-radius: 5px;
}

.home-mode-picker input:checked + span {
  border-color: transparent;
  background: var(--gold);
  color: #10150d;
}

.home-details {
  border-color: #202b3c;
}

.home-details article,
.home-details article + article {
  min-height: 82px;
  border-color: #202b3c;
  background: transparent;
  padding: 14px 20px;
}

.home-details article p {
  max-width: 290px;
  margin-top: 4px;
}

.home-footer {
  margin-top: auto;
  border-color: #202b3c;
}

/* Game */
.in-game .app {
  width: min(1180px, calc(100% - 48px));
  padding-top: 20px;
}

.roombar {
  grid-template-columns: 165px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.roombar h2 {
  font-size: 28px;
  letter-spacing: .04em;
}

.timer {
  min-width: 0;
  border-color: #314158;
  border-radius: 8px;
  background: #101722;
  color: var(--gold);
}

.close-room {
  border-radius: 8px;
  background: transparent;
}

.grid {
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 28px;
}

.room-panel {
  align-self: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.room-panel h3 {
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid #202b3c;
}

.player,
.queue {
  border-color: #2b3a50;
  border-radius: 7px;
  background: #101722;
}

#copyCodeButton,
#copyLinkButton {
  border-color: #2b3a50;
  border-radius: 7px;
  background: var(--surface-3);
}

.stage,
.stage.lobby-stage {
  height: auto;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.stage-top {
  min-height: 46px;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #202b3c;
}

.state-label,
.turn-chip {
  border-radius: 6px;
  background: rgba(85, 216, 230, .13);
  color: var(--teal);
}

.team-lobby {
  flex: 0 0 auto;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.team-lobby-head,
.team-lobby-head .summary-grid,
.compact-settings .lobby-settings {
  gap: 8px;
}

.summary-grid div {
  border-color: #2b3a50;
  border-radius: 8px;
  background: #101722;
  padding: 10px 12px;
}

.summary-grid strong {
  font-size: 21px;
}

.compact-settings {
  border: 0;
  background: transparent;
  padding: 0;
}

.setting-select,
.setting-toggle,
.readonly-number {
  min-height: 58px;
  border-color: #2b3a50;
  border-radius: 8px;
  background: #141d2a;
}

.team-word-grid {
  align-items: start;
  gap: 12px;
}

.stage.lobby-stage .team-word-column {
  min-height: 0;
  border-radius: 9px;
  background: #101722;
  padding: 12px;
}

.stage.lobby-stage .team-word-column:has(.empty-words) {
  min-height: 112px;
}

.stage.lobby-stage .team-word-player {
  border-color: #3b4a5d;
  border-radius: 7px;
  background: #141b25;
  padding: 10px;
}

.stage.lobby-stage .team-word-player.mine {
  border-color: rgba(216, 255, 62, .55);
  background: #161c22;
}

.stage.lobby-stage .empty-words {
  margin: 20px auto;
}

.stage.lobby-stage .mini-word-builder {
  min-height: 0;
  margin-top: 8px;
}

.stage.lobby-stage .mini-word-list {
  max-height: min(300px, 34dvh);
}

.stage.lobby-stage .setup-actions {
  margin-top: 2px;
}

.stage.lobby-stage .setup-actions .primary {
  min-height: 50px;
  border-radius: 8px;
}

.word-card,
.feed,
.round-result,
.stats-row div,
.score-final div,
.owned-word-table {
  border-color: #2b3a50;
  border-radius: 9px;
  background: #101722;
}

@media (max-width: 860px) {
  .app,
  .home-footer,
  .in-game .app {
    width: min(100% - 24px, 680px);
  }

  .home-shell {
    padding: 16px 0 30px;
    gap: 22px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 26px 0 12px;
  }

  .hero-copy h1 {
    max-width: 540px;
  }

  .entry-board .create-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid {
    gap: 16px;
  }

  .room-panel {
    border-bottom: 1px solid #202b3c;
    padding-bottom: 14px;
  }
}

@media (max-width: 520px) {
  .app,
  .home-footer,
  .in-game .app {
    width: calc(100% - 20px);
  }

  .home-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-pills {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-pills span {
    text-align: center;
  }

  .home-hero {
    padding-top: 16px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 13vw, 56px);
  }

  .entry-board .panel {
    padding: 18px 16px;
  }

  .home-details article,
  .home-details article + article {
    padding: 13px 0;
  }

  .roombar {
    gap: 9px;
  }

  .grid {
    gap: 14px;
  }

  .team-lobby-head .summary-grid,
  .compact-settings .lobby-settings {
    grid-template-columns: 1fr;
  }
}
