:root {
  --bg-main: #101a2d;
  --bg-alt: #15223b;
  --panel: #1e2c49;
  --panel-soft: #26365a;
  --ink: #e8f5ff;
  --muted: #9bc0d9;
  --line: #4ea1c6;
  --red: #ef4f4f;
  --blue: #4aa8ff;
  --green: #36e892;
  --yellow: #ffd84a;
  --orange: #ff974f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  background:
    linear-gradient(transparent 0, transparent 94%, rgba(78, 161, 198, 0.18) 95%) 0 0 / 100% 26px,
    linear-gradient(90deg, transparent 0, transparent 94%, rgba(78, 161, 198, 0.16) 95%) 0 0 / 26px 100%,
    radial-gradient(circle at 15% 10%, #2a4068 0%, #1a2a46 38%, #121c31 100%);
}

.app {
  width: min(1500px, 98vw);
  margin: 1.2rem auto;
  padding: 1.1rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--bg-alt), var(--bg-main));
  box-shadow: 0 0 0 2px rgba(11, 212, 252, 0.2), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.app-shell {
  display: block;
  position: relative;
}

.app-shell.teams-hidden {
  display: block;
}

.main-stage {
  min-width: 0;
}

@media (min-width: 980px) {
  body.arcade-stage-active {
    overflow: hidden;
  }

  body.arcade-stage-active .app {
    width: min(1560px, 98vw);
    height: calc(100vh - 1.8rem);
    margin: 0.9rem auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.arcade-stage-active .app-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.arcade-stage-active .main-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
  }

  body.arcade-stage-active #codeNameGame,
  body.arcade-stage-active #wordHuntGame,
  body.arcade-stage-active #wordTrainGame,
  body.arcade-stage-active #scrambleGame,
  body.arcade-stage-active #rebusGame,
  body.arcade-stage-active #wavelengthGame,
  body.arcade-stage-active #scatterGame {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 0.25rem;
  }

  body.arcade-stage-active #wordHuntGame,
  body.arcade-stage-active #wordTrainGame,
  body.arcade-stage-active #scrambleGame,
  body.arcade-stage-active #rebusGame,
  body.arcade-stage-active #wavelengthGame,
  body.arcade-stage-active #scatterGame {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.arcade-stage-active #codeNameGame {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.arcade-stage-active #codeNameGame #board {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 0.62rem;
  }

  body.arcade-stage-active #codeNameGame .card {
    height: auto;
    min-height: 0;
    font-size: clamp(1.02rem, 1.25vw, 1.36rem);
    letter-spacing: 0.085em;
    border-radius: 13px;
  }

  body.arcade-stage-active #wordHuntGame .word-hunt,
  body.arcade-stage-active #wordTrainGame .word-hunt,
  body.arcade-stage-active #scrambleGame .word-hunt,
  body.arcade-stage-active #rebusGame .word-hunt,
  body.arcade-stage-active #wavelengthGame .word-hunt,
  body.arcade-stage-active #scatterGame .word-hunt {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
    overflow: auto;
    padding-bottom: 0.5rem;
  }

  body.arcade-stage-active .arcade-score-anchor {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: 0.55rem 0 0.2rem;
    border-top: 1px solid rgba(123, 197, 239, 0.28);
    background: linear-gradient(180deg, rgba(21, 34, 59, 0.02), rgba(21, 34, 59, 0.92) 34%, rgba(21, 34, 59, 0.98));
  }

  body.arcade-stage-active .arcade-score-anchor-list {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(123, 197, 239, 0.28);
    background: linear-gradient(180deg, rgba(21, 34, 59, 0.02), rgba(21, 34, 59, 0.92) 34%, rgba(21, 34, 59, 0.98));
  }

  body.arcade-stage-active #codeNameBottomScores.arcade-score-anchor,
  body.arcade-stage-active #wordHuntGame #pointsSection.arcade-score-anchor {
    margin-top: auto;
    bottom: 0;
    z-index: 5;
  }

  body.arcade-stage-active #arcadeScroller {
    flex: 0 0 auto;
    margin-top: 0.55rem;
  }
}

.global-teams-panel {
  width: min(520px, 44vw);
  border: 1px solid #6c8fd6;
  border-radius: 12px;
  background: linear-gradient(180deg, #253d66, #1f3255);
  padding: 0.8rem;
  position: fixed;
  right: 16px;
  top: 108px;
  max-height: calc(100vh - 132px);
  overflow: auto;
  z-index: 25;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.global-teams-panel h3 {
  margin: 0;
  color: #ffe271;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.global-teams-panel .word-hunt-row input {
  width: 100%;
}

.global-teams-panel .team-lanes {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.global-teams-head {
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
}

.teams-open-tab {
  position: fixed;
  right: 0;
  top: 46%;
  transform: translateY(-50%);
  border-radius: 12px 0 0 12px;
  padding: 0.7rem 0.55rem;
  min-width: 46px;
  background: linear-gradient(180deg, #2e4f75, #21395a);
  border-right: 0;
  font-weight: 800;
  letter-spacing: 0.03em;
  z-index: 30;
}

.header h1 {
  margin: 0;
  color: #ffe271;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-shadow: 0 0 8px rgba(255, 212, 74, 0.45);
}

.header p {
  margin: 0.45rem 0 1rem;
  color: var(--muted);
}

.header-top {
  display: flex;
  gap: 0.9rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-control label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.theme-control select {
  border: 1px solid #7bc5ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #2e4f75, #21395a);
  color: #e5f5ff;
  padding: 0.36rem 0.5rem;
  font-size: 0.9rem;
}

.library-nav {
  display: none;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

#homeArcadePicker {
  margin-top: 0.25rem;
}

#homeArcadeCupBtn,
#homeJustForFunBtn,
#homeOpenWerewolfBtn {
  font-size: 1.15rem;
  padding: 0.72rem 1.05rem;
  min-height: 48px;
}

.fun-game-btn {
  font-size: 1.06rem !important;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.72rem 1.15rem !important;
  border-width: 1px;
  border-color: #8dd8ff;
  background: linear-gradient(180deg, #3c6ca2, #2a4f7a);
  box-shadow:
    0 7px 18px rgba(3, 10, 22, 0.38),
    0 0 0 1px rgba(148, 223, 255, 0.33) inset;
}

.fun-game-btn:hover {
  border-color: #b2e8ff;
  background: linear-gradient(180deg, #4f84bf, #34679d);
  box-shadow:
    0 10px 22px rgba(2, 8, 20, 0.44),
    0 0 14px rgba(135, 213, 255, 0.3),
    0 0 0 1px rgba(184, 235, 255, 0.4) inset;
}

.hows-yours-word {
  font-size: clamp(2rem, 7vw, 3.6rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hows-yours-hidden {
  filter: blur(16px);
  user-select: none;
}

.hows-yours-category-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.45rem 0 0.7rem;
}

.hows-yours-category-pill {
  border: 1px solid #6ea8db;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.86rem;
  color: #d2ebff;
  background: rgba(35, 66, 102, 0.5);
}

.hows-yours-category-pill.active {
  border-color: #ffd870;
  color: #ffe79c;
  background: rgba(110, 88, 24, 0.58);
}

#howsYoursCategorySelectLabel.muted {
  opacity: 0.62;
}

.taboo-card {
  align-items: flex-start;
}

#tabooTargetWord {
  text-transform: lowercase;
  font-size: clamp(2rem, 7vw, 3.2rem);
  letter-spacing: 0.04em;
}

#tabooBannedList {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

#tabooBannedList li {
  margin: 0.2rem 0;
  font-weight: 700;
}

#homeJustForFunPanel .word-hunt-row {
  justify-content: center;
}

#homeArcadeCupBtn.home-mode-card,
#homeJustForFunBtn.home-mode-card {
  padding: 0;
  min-height: 0;
}

.home-mode-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.8rem;
  margin: 0.15rem 0 0.95rem;
}

.home-mode-card {
  display: inline-flex;
  flex: 0 0 auto;
  width: fit-content;
  position: relative;
  border: 1px solid #6fb9e8;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #182f53 0%, #0d1c36 72%);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.home-mode-card:hover {
  transform: translateY(-1px);
  border-color: #95d7ff;
}

.home-mode-card[data-desc]:hover::after,
.home-mode-card[data-desc]:focus-visible::after {
  content: attr(data-desc);
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  border: 1px solid #7bc5ef;
  border-radius: 10px;
  background: rgba(8, 22, 44, 0.9);
  color: #d9eeff;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.45rem 0.55rem;
  pointer-events: none;
}

.home-mode-card.active {
  border-color: #ffe78c;
  box-shadow: inset 0 0 0 1px rgba(255, 187, 74, 0.35), 0 0 14px rgba(255, 124, 214, 0.22);
  transform: none;
}

.home-mode-card img {
  display: block;
  width: auto;
  max-width: min(44vw, 420px);
  height: auto;
  max-height: 300px;
  object-fit: contain;
  object-position: center;
  background: #0b1633;
}

#homeArcadePicker .library-btn {
  font-size: 1.02rem;
  padding: 0.6rem 0.95rem;
  min-height: 44px;
}

.home-mode-card.image-missing {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.home-mode-card.image-missing::after {
  content: "Image not found. Add file in /assets";
  color: #c9dff1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-mode-card img.missing {
  display: none;
}

.home-settings-card {
  display: flex;
  width: fit-content;
  margin: 0.15rem auto 0.7rem auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#homePage h2,
#homePage .word-hunt-help,
#homeModesStatus {
  text-align: center;
}

.home-settings-card img {
  width: auto;
  max-width: min(26.4vw, 252px);
  height: auto;
  max-height: 75.6px;
  background: transparent;
}

.arcade-scroller {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.55rem 0 0;
  padding: 0.48rem;
  border: 1px solid #4f7a9a;
  border-radius: 12px;
  background: linear-gradient(180deg, #213453, #1b2b46);
}

.arcade-scroller-track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.42rem;
  overflow-x: auto;
  padding-bottom: 0.12rem;
}

.arcade-chip {
  white-space: nowrap;
  border: 1px solid #7bc5ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #2e4f75, #21395a);
  color: #e5f5ff;
  padding: 0.35rem 0.62rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.arcade-chip.active {
  background: linear-gradient(180deg, #ffd24f, #ff9f33);
  color: #101726;
  border-color: #ffe78c;
}

.home-panel {
  border: 1px solid #4f7a9a;
  border-radius: 12px;
  background: linear-gradient(180deg, #213453, #1b2b46);
  padding: 1rem;
}

.home-panel h2 {
  margin: 0 0 0.35rem;
  color: #ffe271;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-panel p {
  margin: 0 0 0.75rem;
  color: #b6d4e7;
}

.library-btn.active {
  background: linear-gradient(180deg, #ffd24f, #ff9f33);
  color: #101726;
  border-color: #ffe78c;
}

.hidden {
  display: none !important;
}

.game-panel.hidden {
  display: none;
}

.hud {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.turn-panel,
.score-panel,
.timer-panel,
.category-controls,
.controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid #00000045;
  font-weight: 700;
}

.badge.red {
  color: #fff;
  background: linear-gradient(180deg, #ff6a6a, #db4040);
}

.badge.blue {
  color: #fff;
  background: linear-gradient(180deg, #68b6ff, #2d89e6);
}

.score,
.timer,
.word-hunt-challenge div {
  min-width: 132px;
  padding: 0.45rem 0.62rem;
  border-radius: 10px;
  border: 1px solid #5c7e9e;
  background: linear-gradient(180deg, #304665, #263b5a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.score.red {
  box-shadow: inset 0 0 0 2px rgba(239, 79, 79, 0.3);
}

.score.blue {
  box-shadow: inset 0 0 0 2px rgba(74, 168, 255, 0.3);
}

.score span,
.timer span,
.word-hunt-challenge span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ec9e4;
}

.score strong,
.timer strong,
.word-hunt-challenge strong {
  font-size: 1.2rem;
  color: #f6fbff;
}

#firstLetter,
#lastLetter {
  font-size: 2.15rem;
  line-height: 1;
}

#firstLetter,
#lastLetter,
#minLength {
  display: inline-block;
  min-width: 1.2em;
}

.word-hunt-challenge div:has(#firstLetter),
.word-hunt-challenge div:has(#lastLetter) {
  min-width: 180px;
  padding: 0.62rem 0.78rem;
}

.timer {
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.timer.red {
  border-color: #d67373;
  background: linear-gradient(180deg, #6d2a2a, #562020);
}

.timer.blue {
  border-color: #72a6df;
  background: linear-gradient(180deg, #1f4168, #193858);
}

.timer.active {
  transform: translateY(-1px);
}

.timer.red.active {
  box-shadow: inset 0 0 0 2px rgba(239, 79, 79, 0.62), 0 0 10px rgba(239, 79, 79, 0.35);
}

.timer.blue.active {
  box-shadow: inset 0 0 0 2px rgba(74, 168, 255, 0.62), 0 0 10px rgba(74, 168, 255, 0.35);
}

.controls {
  margin: 0.95rem 0;
  flex-wrap: wrap;
}

.codenames-hud {
  align-items: stretch;
  margin-bottom: 0.45rem;
}

.codenames-hud .team-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  flex-wrap: nowrap;
}

.codenames-hud .team-corner-blue {
  margin-left: auto;
  align-items: flex-end;
  justify-content: flex-start;
}

#codeNameGame .turn-panel {
  margin: 0 0 0.5rem;
}

.codenames-corner-score {
  width: min(360px, 92vw);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #5c7e9e;
  border-radius: 12px;
  padding: 0.46rem 0.58rem;
  background: linear-gradient(180deg, #304665, #263b5a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.codenames-corner-score.team-red {
  border-color: #d67373;
  background: linear-gradient(180deg, #8a2f2f, #662222);
}

.codenames-corner-score.team-blue {
  border-color: #72a6df;
  background: linear-gradient(180deg, #1f4168, #193858);
}

.codenames-corner-score span {
  flex: 1 1 auto;
  min-width: 0;
  color: #eef7ff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.codenames-corner-score .score-adjust-btn:first-of-type {
  margin-left: auto;
}

.codenames-bottom-scores {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.45rem;
  width: 100%;
  align-self: stretch;
}

.codenames-bottom-scores .codenames-corner-score {
  width: 100%;
}

#codeNameBottomScores {
  width: 100%;
  align-self: stretch;
}

#codeNameGame .codenames-turn-meta {
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cards-left-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #4f7a9a;
  border-radius: 9px;
  padding: 0.2rem 0.48rem;
  background: linear-gradient(180deg, #2b4367, #233859);
  color: #d8eeff;
  font-size: 0.82rem;
  font-weight: 700;
}

.cards-left-chip strong {
  color: #f6fbff;
}

#winTotals > div:first-child strong {
  color: #ff8f8f;
}

#winTotals > div:last-child strong {
  color: #8bc8ff;
}

#winTotals .wins-red {
  border-color: #d67373 !important;
  background: linear-gradient(180deg, #8a2f2f, #662222) !important;
  box-shadow: inset 0 0 0 2px rgba(239, 79, 79, 0.35);
}

#winTotals .wins-red span,
#winTotals .wins-red strong {
  color: #ffd7d7 !important;
}

#winTotals .wins-blue {
  border-color: #72a6df;
  background: linear-gradient(180deg, #1f4168, #193858);
}

#winTotals .wins-blue span,
#winTotals .wins-blue strong {
  color: #d7edff;
}

.category-controls label {
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.category-controls input,
.word-hunt-row input,
.word-hunt-row select {
  width: min(360px, 90vw);
  border: 1px solid #4b7ea3;
  border-radius: 10px;
  background: #1a2d4a;
  color: var(--ink);
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
}

.category-controls input:focus,
.word-hunt-row input:focus,
.word-hunt-row select:focus {
  outline: 2px solid #65d3ff;
  outline-offset: 1px;
}

button {
  border: 1px solid #7bc5ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #2e4f75, #21395a);
  color: #e5f5ff;
  padding: 0.48rem 0.8rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(161, 229, 255, 0.4), 0 6px 16px rgba(0, 0, 0, 0.28);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.word-hunt,
.word-hunt-online,
.player-banner,
.word-hunt-join {
  border: 1px solid #4f7a9a;
  border-radius: 12px;
  background: linear-gradient(180deg, #213453, #1b2b46);
}

.word-hunt {
  padding: 1rem;
}

.word-hunt-online,
.player-banner,
.word-hunt-join {
  padding: 0.8rem;
  margin: 0 0 1rem;
}

.word-hunt h2,
.word-hunt h3 {
  margin: 0 0 0.55rem;
  color: #ffe271;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.word-hunt-help {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  color: #b6d4e7;
}

.friendship-award-title {
  border: 1px solid #4f7a9a;
  border-radius: 10px;
  background: linear-gradient(180deg, #2b4367, #233859);
  padding: 0.65rem 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffe271;
}

.word-hunt-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.word-hunt-challenge {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0.6rem 0;
}

.werewolf-embed-wrap {
  margin-top: 0.75rem;
  border: 1px solid #4f7a9a;
  border-radius: 14px;
  overflow: hidden;
  background: #0f1728;
}

.werewolf-embed-frame {
  display: block;
  width: 100%;
  height: min(78vh, 980px);
  border: 0;
  background: #0f1728;
}

.wavelength-track {
  display: block;
  margin: 0.65rem 0 0.9rem;
}

.wavelength-track span {
  font-size: 0.85rem;
  color: #b6d4e7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wavelength-track input[type="range"] {
  width: 100%;
}

.wavelength-dial-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.wavelength-dial-svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
}

.wavelength-end-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 8.35%;
  margin-top: -16px;
  font-size: clamp(2.4rem, 4.6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: none;
}

.wavelength-end-label {
  color: var(--wl-color, #d9efff);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.05;
}

.wavelength-end-label > span {
  color: var(--wl-color, #d9efff) !important;
}

.wavelength-arrow {
  font-size: 1.05em;
  opacity: 0.9;
}

.wavelength-base-sector {
  fill: #9aa8b8;
}

.wavelength-near-sector {
  fill: #f7c957;
}

.wavelength-close-sector {
  fill: #ff974f;
}

.wavelength-bull-sector {
  fill: #ef4b4b;
}

.wavelength-scale {
  pointer-events: none;
}

.wavelength-scale-tick {
  stroke: rgba(236, 246, 255, 0.92);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.wavelength-scale-label {
  fill: rgba(236, 246, 255, 0.96);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(32, 56, 86, 0.75);
  stroke-width: 1.2px;
}

.wavelength-target-needle,
.wavelength-guess-needle {
  stroke-width: 4;
  stroke-linecap: round;
}

.wavelength-target-needle {
  stroke: #f0dca3;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 8px rgba(240, 220, 163, 0.95))
    drop-shadow(0 0 14px rgba(240, 220, 163, 0.65));
}

.wavelength-guess-needle {
  stroke: #f6fbff;
}

.wavelength-center-dot {
  fill: #f6fbff;
  stroke: #2f4f72;
  stroke-width: 2;
}

#wavelengthTeamRedBtn.active {
  border-color: #d67373;
  background: linear-gradient(180deg, #6d2a2a, #562020);
}

#wavelengthTeamBlueBtn.active {
  border-color: #82c1ff;
  background: linear-gradient(180deg, #163d74, #0a1f47);
  color: #eaf5ff;
  box-shadow: inset 0 0 0 2px rgba(74, 168, 255, 0.62), 0 0 12px rgba(35, 122, 212, 0.45);
}

.join-qr {
  width: 180px;
  height: 180px;
  border: 1px solid #7bc5ef;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}

#spyShareSection {
  margin-top: 0.25rem;
}

.team-lanes {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-lane {
  border: 1px solid #4f7a9a;
  border-radius: 10px;
  background: linear-gradient(180deg, #233859, #1e3150);
  padding: 0.5rem;
}

.team-lane[data-team="red"] {
  border-color: #d67373;
  background: linear-gradient(180deg, #6d2a2a, #562020);
}

.team-lane[data-team="blue"] {
  border-color: #72a6df;
  background: linear-gradient(180deg, #1f4168, #193858);
}

.team-lane[data-team="none"] {
  border-color: #b9a88e;
  background: linear-gradient(180deg, #4f4a3a, #403b2f);
}

.team-lane h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #d7efff;
}

.team-list {
  list-style: none;
  margin: 0;
  min-height: 80px;
  padding: 0;
}

.team-list li {
  border: 1px solid #5d88aa;
  border-radius: 8px;
  background: #2d466b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  margin: 0 0 0.35rem;
  cursor: grab;
  user-select: none;
  min-width: 0;
  overflow: hidden;
}

.team-player-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-name-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-lane[data-team="red"] .team-list li {
  border-color: #d67373;
  background: #7a3333;
}

.team-lane[data-team="blue"] .team-list li {
  border-color: #72a6df;
  background: #29517c;
}

.team-lane[data-team="none"] .team-list li {
  border-color: #b9a88e;
  background: #5a5342;
  color: #f2ebd6;
}

.team-list li.dragging {
  opacity: 0.55;
}

.team-lane.drag-over {
  box-shadow: inset 0 0 0 2px rgba(109, 206, 255, 0.45);
}

.winner-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.winner-modal-card {
  width: min(420px, 92vw);
  border: 1px solid #7bc5ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #213453, #1a2b45);
  padding: 1rem;
  text-align: center;
}

.winner-modal-card h3 {
  margin: 0 0 0.45rem;
}

.winner-modal-card p {
  margin: 0 0 0.8rem;
}

.winner-modal-card.red {
  border-color: rgba(245, 117, 117, 0.9);
  background: linear-gradient(180deg, #4a1e26, #3a1720);
}

.winner-modal-card.blue {
  border-color: rgba(120, 178, 255, 0.9);
  background: linear-gradient(180deg, #1f3154, #182743);
}

.live-answers {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  max-height: 220px;
  overflow: auto;
}

#pointsLeaderboard,
#scrambleScoresList,
#scatterScoresList,
#rebusScoresList,
#tabooScoresList,
#wordTrainScoresList,
#codeNameScoresList,
#wavelengthScoresList,
#globalPlayersScoreList {
  list-style: none;
  padding-left: 0;
}

.global-players-title {
  margin: 0 0 0.45rem;
  color: #ffe271;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
}

#globalPlayersScoreList li.global-player-score-row {
  border: 1px solid rgba(123, 197, 239, 0.5);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  background: rgba(34, 58, 92, 0.62);
}

.live-answers li {
  margin: 0.24rem 0;
}

.live-answers li.manual-score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.live-answers li.manual-score-row span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-answers li.manual-score-row button {
  padding: 0.24rem 0.52rem;
  font-size: 0.82rem;
  min-width: 42px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.live-answers li.manual-score-row .score-adjust-btn:first-of-type {
  margin-left: auto;
}

#pointsLeaderboard.team-mode {
  list-style: none;
  padding-left: 0;
}

#pointsLeaderboard li.score-row,
#scrambleScoresList li.score-row,
#scatterScoresList li.score-row,
#rebusScoresList li.score-row,
#tabooScoresList li.score-row,
#wordTrainScoresList li.score-row,
#codeNameScoresList li.score-row,
#wavelengthScoresList li.score-row {
  border: 1px solid #5c7e9e;
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
  margin: 0.44rem 0;
  background: linear-gradient(180deg, #304665, #263b5a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #eef7ff;
  font-weight: 800;
  min-height: 50px;
}

#pointsLeaderboard li.score-row.team-red,
#scrambleScoresList li.score-row.team-red,
#scatterScoresList li.score-row.team-red,
#rebusScoresList li.score-row.team-red,
#tabooScoresList li.score-row.team-red,
#wordTrainScoresList li.score-row.team-red,
#codeNameScoresList li.score-row.team-red,
#wavelengthScoresList li.score-row.team-red {
  border-color: #d67373;
  background: linear-gradient(180deg, #8a2f2f, #662222);
}

#pointsLeaderboard li.score-row.team-blue,
#scrambleScoresList li.score-row.team-blue,
#scatterScoresList li.score-row.team-blue,
#rebusScoresList li.score-row.team-blue,
#tabooScoresList li.score-row.team-blue,
#wordTrainScoresList li.score-row.team-blue,
#codeNameScoresList li.score-row.team-blue,
#wavelengthScoresList li.score-row.team-blue {
  border-color: #72a6df;
  background: linear-gradient(180deg, #1f4168, #193858);
}

#pointsLeaderboard li.score-row.leading,
#scrambleScoresList li.score-row.leading,
#scatterScoresList li.score-row.leading,
#rebusScoresList li.score-row.leading,
#tabooScoresList li.score-row.leading,
#wordTrainScoresList li.score-row.leading,
#codeNameScoresList li.score-row.leading,
#wavelengthScoresList li.score-row.leading {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 0 12px rgba(255, 255, 255, 0.14);
}

.score-adjust-btn {
  margin-left: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  min-width: 48px;
  border-radius: 8px;
}

body:not(.arcade-stage-active) #pointsSection {
  margin-top: 0.9rem;
}

body:not(.arcade-stage-active) #scramblePointsSection {
  margin-top: 0.9rem;
}

#scrambleCategoryCard {
  display: none !important;
}

#scrambleGame .word-hunt-challenge {
  justify-content: center;
}

#scrambleWordCard {
  width: min(100%, 980px);
  margin: 0 auto;
  text-align: center;
}

#scrambleWordCard span {
  text-align: center;
}

#scrambleWordDisplay {
  display: block;
  text-align: center;
  font-size: clamp(3rem, 11vw, 6.4rem) !important;
  letter-spacing: 0.08em;
  line-height: 1.05;
  font-weight: 900;
}

.teams-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.teams-score-table th,
.teams-score-table td {
  border: 1px solid rgba(123, 197, 239, 0.45);
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.teams-score-table thead th {
  background: rgba(17, 35, 67, 0.7);
  font-weight: 700;
}

.teams-score-table tbody th {
  text-align: left;
  background: rgba(19, 41, 75, 0.45);
}

.teams-score-table .score-red-col,
.teams-score-table td:nth-child(2) {
  color: #ff8a8a;
  font-weight: 700;
}

.teams-score-table .score-blue-col,
.teams-score-table td:nth-child(3) {
  color: #91c4ff;
  font-weight: 700;
}

.teams-score-table .teams-score-total-row th,
.teams-score-table .teams-score-total-row td {
  background: rgba(42, 61, 102, 0.65);
  font-weight: 800;
}

.rebus-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid #5a83aa;
  border-radius: 12px;
  background: rgba(13, 24, 42, 0.42);
}

.rebus-image {
  width: min(100%, 560px);
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.team-word-red {
  color: #ff8a8a;
  font-weight: 700;
}

.team-word-blue {
  color: #91c4ff;
  font-weight: 700;
}

.team-red-btn {
  border-color: #ff8a8a;
  color: #ffe5e5;
  background: linear-gradient(180deg, #6a2424, #4d1919);
}

.team-blue-btn {
  border-color: #91c4ff;
  color: #e5f2ff;
  background: linear-gradient(180deg, #1f3a67, #172b4d);
}

.players-list {
  margin: 0.45rem 0 0.8rem;
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem;
}

.players-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #4f7a9a;
  border-radius: 10px;
  background: linear-gradient(180deg, #2b4367, #233859);
  padding: 0.45rem 0.55rem;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffe67a, #ffb84f);
  border: 1px solid #ffd874;
  font-size: 1rem;
}

.status {
  min-height: 1.5rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: #d9f4ff;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.card {
  height: clamp(64px, 10vw, 92px);
  border: 1px solid #4f7a9a;
  border-radius: 12px;
  background: linear-gradient(180deg, #2e4468, #24395a);
  color: #ecf8ff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  padding: 0.45rem;
  cursor: pointer;
  animation: rise 240ms ease both;
}

.card.revealed {
  color: #fff;
  border-color: #00000044;
  cursor: default;
}

.card.revealed.neutral {
  color: #1f1e1d;
  background: #dbcda8;
}

.card.revealed.red {
  background: linear-gradient(180deg, #ff7777, #da4747);
}

.card.revealed.blue {
  background: linear-gradient(180deg, #74beff, #327fd0);
}

.card.revealed.assassin {
  background: #0f1119;
}

.card.key-red:not(.revealed) {
  background: #6d2a2a;
  color: #ffd7d7;
  border-color: #d67373;
}

.card.key-blue:not(.revealed) {
  background: #1f4168;
  color: #d7edff;
  border-color: #72a6df;
}

.card.key-neutral:not(.revealed) {
  background: #4f4a3a;
  color: #f2ebd6;
  border-color: #b9a88e;
}

.card.key-assassin:not(.revealed) {
  background: #111;
  color: #fff;
  border-color: #5f5f5f;
}

body.spy-mode {
  background: #ece9df;
  color: #262626;
}

body.spy-mode .app {
  width: min(760px, 96vw);
  margin: 0.5rem auto;
  padding: 0.55rem;
  border: 1px solid #c8c0af;
  background: #f7f3e8;
  box-shadow: none;
}

body.spy-mode .header,
body.spy-mode .library-nav,
body.spy-mode #arcadeScroller,
body.spy-mode #globalTeamsPanel,
body.spy-mode #openGlobalTeamsTabBtn,
body.spy-mode #homePage,
body.spy-mode #wordHuntGame,
body.spy-mode #wordTrainGame,
body.spy-mode #wavelengthGame,
body.spy-mode #friendshipGame,
body.spy-mode #scatterGame,
body.spy-mode #codeNameGame .hud,
body.spy-mode #codeNameGame .controls,
body.spy-mode #codeNameGame #winTotals,
body.spy-mode #codeNameGame #status,
body.spy-mode #codeNameBottomScores,
body.spy-mode #codeNameGame #spyShareSection,
body.spy-mode #codeNameGame .winner-modal {
  display: none !important;
}

body.taboo-player-mode .header,
body.taboo-player-mode .library-nav,
body.taboo-player-mode #arcadeScroller,
body.taboo-player-mode #globalTeamsPanel,
body.taboo-player-mode #openGlobalTeamsTabBtn {
  display: none !important;
}

body.taboo-player-mode .app {
  width: min(740px, 98vw);
  margin: 0.6rem auto;
}

body.spy-mode #codeNameGame {
  display: block;
}

body.spy-mode #codeNameGame .board {
  margin: 0 auto;
  width: min(700px, 100%);
  gap: 0.35rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.spy-mode #spyColorControls {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

body.spy-mode .card {
  min-height: 58px;
  height: clamp(58px, 11vw, 72px);
  padding: 0.35rem 0.3rem;
  border-radius: 9px;
  font-size: clamp(0.55rem, 1.45vw, 0.8rem);
  line-height: 1.15;
  letter-spacing: 0.015em;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  animation: none;
}

body.spy-mode .card.key-red:not(.revealed),
body.spy-mode .card.revealed.red {
  background: #c59a99;
  color: #231f1f;
  border-color: #b18d8c;
}

body.spy-mode .card.key-blue:not(.revealed),
body.spy-mode .card.revealed.blue {
  background: #99afc6;
  color: #20262d;
  border-color: #8fa5bb;
}

body.spy-mode .card.key-neutral:not(.revealed),
body.spy-mode .card.revealed.neutral {
  background: #bdb5a8;
  color: #2f2b27;
  border-color: #a9a193;
}

body.spy-mode .card.key-assassin:not(.revealed),
body.spy-mode .card.revealed.assassin {
  background: #7b7770;
  color: #161412;
  border-color: #6c685f;
}

body.spy-mode.spy-colors-hidden .card {
  background: #d5cec0 !important;
  color: #2d2a25 !important;
  border-color: #b9b19f !important;
}

@media (max-width: 740px) {
  .global-teams-panel {
    width: min(94vw, 540px);
    right: 3vw;
    top: 96px;
    max-height: calc(100vh - 118px);
  }

  .teams-open-tab {
    top: auto;
    bottom: 12px;
    right: 12px;
    transform: none;
    border-radius: 10px;
    border-right: 1px solid #7bc5ef;
  }

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 740px) {
  .app {
    margin: 0.85rem auto;
    padding: 0.8rem;
  }

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

  .home-mode-card img {
    max-width: min(92vw, 520px);
    max-height: 240px;
  }

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

  .codenames-hud .team-corner,
  .codenames-hud .team-corner-blue {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .category-controls,
  .controls {
    width: 100%;
  }
}

body[data-theme="plain"] {
  color: #1e1e1e;
  background: #efeee9;
}

body[data-theme="plain"] .app {
  border-color: #bfb9ae;
  background: #faf8f3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body[data-theme="plain"] .header h1,
body[data-theme="plain"] .home-panel h2,
body[data-theme="plain"] .word-hunt h2,
body[data-theme="plain"] .word-hunt h3 {
  color: #1f1f1f;
  text-shadow: none;
}

body[data-theme="plain"] .header p,
body[data-theme="plain"] .label,
body[data-theme="plain"] .theme-control label,
body[data-theme="plain"] .score span,
body[data-theme="plain"] .timer span,
body[data-theme="plain"] .word-hunt-challenge span {
  color: #4d4d4d;
}

body[data-theme="plain"] button,
body[data-theme="plain"] .theme-control select {
  background: #f5f5f5;
  color: #222;
  border-color: #b7b7b7;
}

body[data-theme="plain"] .library-btn.active {
  background: #dbdbdb;
  border-color: #8f8f8f;
  color: #222;
}

body[data-theme="plain"] .score,
body[data-theme="plain"] .timer,
body[data-theme="plain"] .home-panel,
body[data-theme="plain"] .word-hunt,
body[data-theme="plain"] .word-hunt-online,
body[data-theme="plain"] .player-banner,
body[data-theme="plain"] .word-hunt-join,
body[data-theme="plain"] .word-hunt-challenge div,
body[data-theme="plain"] .players-list li,
body[data-theme="plain"] .card {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #c6c6c6;
  box-shadow: none;
}

body[data-theme="plain"] .timer.red {
  border-color: #d7a3a3;
  background: #f0dfdf;
}

body[data-theme="plain"] .timer.blue {
  border-color: #a8c4df;
  background: #e1ebf6;
}

body[data-theme="plain"] #winTotals .wins-red {
  border-color: #d7a3a3;
  background: #f0dfdf;
}

body[data-theme="plain"] #winTotals .wins-red span,
body[data-theme="plain"] #winTotals .wins-red strong {
  color: #8e3d3d;
}

body[data-theme="plain"] #winTotals .wins-blue {
  border-color: #a8c4df;
  background: #e1ebf6;
}

body[data-theme="plain"] #winTotals .wins-blue span,
body[data-theme="plain"] #winTotals .wins-blue strong {
  color: #355b87;
}

body[data-theme="plain"] .status {
  color: #2a2a2a;
}

body[data-theme="plain"] .home-panel p {
  color: #444;
}

body[data-theme="plain"] .category-controls input,
body[data-theme="plain"] .word-hunt-row input,
body[data-theme="plain"] .word-hunt-row select {
  background: #fff;
  color: #222;
  border-color: #bbbbbb;
}

body[data-theme="plain"] .wavelength-track span {
  color: #555;
}

body[data-theme="plain"] .wavelength-base-sector {
  fill: #b8b8b8;
}

body[data-theme="plain"] .wavelength-scale-tick {
  stroke: rgba(38, 38, 38, 0.88);
}

body[data-theme="plain"] .wavelength-scale-label {
  fill: rgba(33, 33, 33, 0.95);
  stroke: rgba(248, 248, 248, 0.85);
}

body[data-theme="plain"] .wavelength-near-sector {
  fill: #d8c28c;
}

body[data-theme="plain"] .wavelength-close-sector {
  fill: #d9ab8c;
}

body[data-theme="plain"] .wavelength-bull-sector {
  fill: #cb6f6f;
}

body[data-theme="plain"] .wavelength-target-needle {
  stroke: #8a7a57;
}

body[data-theme="plain"] .wavelength-guess-needle {
  stroke: #333;
}

body[data-theme="plain"] .wavelength-center-dot {
  fill: #222;
  stroke: #fff;
}

body[data-theme="plain"] #wavelengthTeamRedBtn.active {
  border-color: #d7a3a3;
  background: #f0dfdf;
  color: #8e3d3d;
}

body[data-theme="plain"] #wavelengthTeamBlueBtn.active {
  border-color: #5f8ebf;
  background: #1f3f67;
  color: #eef6ff;
  box-shadow: inset 0 0 0 2px rgba(130, 176, 224, 0.45);
}

body[data-theme="dark"] {
  color: #e7e9ee;
  background: #0b0d12;
}

body[data-theme="dark"] .app {
  border-color: #2f3440;
  background: #12151d;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

body[data-theme="dark"] .header h1,
body[data-theme="dark"] .word-hunt h2,
body[data-theme="dark"] .word-hunt h3,
body[data-theme="dark"] .home-panel h2 {
  color: #f1f4fb;
  text-shadow: none;
}

body[data-theme="dark"] .header p,
body[data-theme="dark"] .label,
body[data-theme="dark"] .theme-control label,
body[data-theme="dark"] .score span,
body[data-theme="dark"] .timer span,
body[data-theme="dark"] .word-hunt-challenge span,
body[data-theme="dark"] .home-panel p {
  color: #aab2c2;
}

body[data-theme="dark"] button,
body[data-theme="dark"] .theme-control select {
  background: #1a1f2b;
  color: #e7ebf5;
  border-color: #3a4254;
}

body[data-theme="dark"] .library-btn.active {
  background: #2a3140;
  border-color: #56607a;
  color: #f1f4fb;
}

body[data-theme="dark"] .score,
body[data-theme="dark"] .timer,
body[data-theme="dark"] .home-panel,
body[data-theme="dark"] .word-hunt,
body[data-theme="dark"] .word-hunt-online,
body[data-theme="dark"] .player-banner,
body[data-theme="dark"] .word-hunt-join,
body[data-theme="dark"] .word-hunt-challenge div,
body[data-theme="dark"] .players-list li,
body[data-theme="dark"] .card {
  background: #181d29;
  color: #e7e9ee;
  border-color: #343b4d;
  box-shadow: none;
}

body[data-theme="dark"] .status {
  color: #d8dfef;
}

body[data-theme="dark"] .category-controls input,
body[data-theme="dark"] .word-hunt-row input,
body[data-theme="dark"] .word-hunt-row select {
  background: #131925;
  color: #e6eaf3;
  border-color: #3a4358;
}

body[data-theme="dark"] .wavelength-track span {
  color: #aab2c2;
}

body[data-theme="dark"] .wavelength-base-sector {
  fill: #576276;
}

body[data-theme="dark"] .wavelength-scale-tick {
  stroke: rgba(228, 236, 247, 0.9);
}

body[data-theme="dark"] .wavelength-scale-label {
  fill: rgba(228, 236, 247, 0.94);
  stroke: rgba(24, 31, 43, 0.9);
}

body[data-theme="dark"] .wavelength-near-sector {
  fill: #b8a161;
}

body[data-theme="dark"] .wavelength-close-sector {
  fill: #b67a52;
}

body[data-theme="dark"] .wavelength-bull-sector {
  fill: #b45757;
}

body[data-theme="dark"] .wavelength-target-needle {
  stroke: #c5b181;
}

body[data-theme="dark"] .wavelength-guess-needle {
  stroke: #ecf0f8;
}

body[data-theme="dark"] .wavelength-center-dot {
  fill: #ecf0f8;
  stroke: #2d3344;
}

body[data-theme="plain"] .friendship-award-title {
  background: #fff;
  border-color: #c6c6c6;
  color: #222;
}

body[data-theme="dark"] .friendship-award-title {
  background: #181d29;
  border-color: #343b4d;
  color: #f1f4fb;
}

/* Game worlds */
body[data-active-game="home"] {
  background:
    radial-gradient(circle at 20% 20%, #2b4671 0%, #182845 40%, #0f1b31 100%);
}

body[data-active-game="codenames"] {
  background:
    linear-gradient(rgba(12, 18, 30, 0.86), rgba(12, 18, 30, 0.86)),
    repeating-linear-gradient(90deg, rgba(180, 195, 210, 0.07) 0 2px, transparent 2px 14px),
    #101722;
}

body[data-active-game="codenames"] .app {
  border-color: #8ea7c2;
  background: linear-gradient(145deg, #1e2d42, #111a2a);
}

body[data-active-game="wordhunt"] {
  background:
    linear-gradient(rgba(10, 18, 31, 0.86), rgba(10, 18, 31, 0.86)),
    repeating-linear-gradient(90deg, rgba(130, 178, 214, 0.08) 0 2px, transparent 2px 14px),
    #0f1a2d;
}

body[data-active-game="wordhunt"] .app {
  border-color: #85b1d1;
  background: linear-gradient(145deg, #1b2e4a, #121f35);
}

body[data-theme="plain"] .global-teams-panel {
  background: linear-gradient(180deg, #f1f6ff, #e4ecfb);
  border-color: #9eb4d8;
}

body[data-theme="dark"] .global-teams-panel {
  background: linear-gradient(180deg, #1b2740, #141f34);
  border-color: #4a5f86;
}

body[data-active-game="wordhunt"] .global-teams-panel {
  background: linear-gradient(180deg, #253d66, #1f3255);
  border-color: #6c8fd6;
}

body[data-active-game="wavelength"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 255, 0.18), transparent 45%),
    repeating-linear-gradient(0deg, rgba(0, 197, 255, 0.12) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #21082d 0%, #14062c 45%, #070d24 100%);
}

body[data-active-game="wavelength"] .app {
  border-color: #53d2ff;
  background: linear-gradient(145deg, #18133a, #0f1233);
  box-shadow: 0 0 0 2px rgba(83, 210, 255, 0.25), 0 10px 28px rgba(0, 0, 0, 0.42);
}

body[data-active-game="wavelength"] .header h1 {
  color: #63d8ff;
  text-shadow: 0 0 12px rgba(99, 216, 255, 0.52);
}

body[data-active-game="wavelength"] .wavelength-dial-wrap {
  filter: drop-shadow(0 0 10px rgba(74, 236, 255, 0.25));
}

body[data-active-game="werewolf"] {
  background:
    radial-gradient(circle at 20% 0%, rgba(204, 58, 58, 0.2), transparent 36%),
    radial-gradient(circle at 88% 10%, rgba(86, 122, 221, 0.16), transparent 40%),
    #0d101d;
}

body[data-active-game="werewolf"] .app {
  border-color: #a04f5e;
  background: linear-gradient(145deg, #1f1a2b, #141727);
}

body[data-active-game="wordtrain"] {
  background:
    repeating-linear-gradient(90deg, rgba(208, 172, 111, 0.08) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #32241a 0%, #221711 100%);
}

body[data-active-game="wordtrain"] .app {
  border-color: #cc9f64;
  background: linear-gradient(145deg, #402c1f, #2c1f17);
}

body[data-active-game="rebus"] {
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 210, 120, 0.2), transparent 34%),
    radial-gradient(circle at 86% 14%, rgba(232, 160, 90, 0.14), transparent 36%),
    linear-gradient(180deg, #2a1d14 0%, #1d150f 100%);
}

body[data-active-game="rebus"] .app {
  border-color: #c89b63;
  background: linear-gradient(145deg, #3a2a1e, #2a1f16);
}

body[data-active-game="friendship"] {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 224, 156, 0.28), transparent 35%),
    radial-gradient(circle at 86% 10%, rgba(255, 153, 201, 0.2), transparent 35%),
    linear-gradient(180deg, #3b1b3f 0%, #25173a 100%);
}

body[data-active-game="friendship"] .app {
  border-color: #f2b5cf;
  background: linear-gradient(145deg, #412248, #2c1d3f);
}

body[data-active-game="scatter"] {
  background:
    radial-gradient(circle at 18% 14%, rgba(160, 255, 207, 0.18), transparent 30%),
    linear-gradient(180deg, #103734 0%, #0a2622 100%);
}

body[data-active-game="scatter"] .app {
  border-color: #72d8b0;
  background: linear-gradient(145deg, #133f3b, #0c2f2b);
}
