:root {
  --bg-0: #04111f;
  --bg-1: #08182c;
  --bg-2: #0f2744;
  --surface: rgba(10, 18, 34, 0.72);
  --surface-strong: rgba(9, 15, 27, 0.9);
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fbff;
  --muted: rgba(226, 232, 240, 0.72);
  --accent: #38bdf8;
  --accent-2: #60a5fa;
  --shadow: 0 24px 90px rgba(3, 11, 29, 0.34);
}

body.light-theme {
  --bg-0: #fffaf7;
  --bg-1: #ffffff;
  --bg-2: #eef6ff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 23, 42, 0.08);
  --text: #081423;
  --muted: rgba(30, 41, 59, 0.72);
  --accent: #ec4899;
  --accent-2: #2563eb;
  --shadow:
    0 32px 80px rgba(37, 99, 235, 0.1),
    0 18px 50px rgba(236, 72, 153, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(56, 189, 248, 0.22), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(236, 72, 153, 0.16), transparent 28%),
    radial-gradient(circle at 72% 78%, rgba(250, 204, 21, 0.14), transparent 24%),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
  color: var(--text);
  transition: background 220ms ease, color 220ms ease;
}

body::before,
body::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 8% 20%, rgba(59, 130, 246, 0.12), transparent 18%),
    radial-gradient(circle at 88% 14%, rgba(236, 72, 153, 0.1), transparent 20%),
    radial-gradient(circle at 76% 74%, rgba(251, 191, 36, 0.12), transparent 20%);
  filter: blur(12px);
}

body::after {
  background-image:
    radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-position:
    0 0,
    12px 12px;
  background-size:
    24px 24px,
    24px 24px;
  mask-image: radial-gradient(circle at center, black, transparent 90%);
  opacity: 0.35;
}

body,
button,
input,
textarea {
  font-family: "Manrope", system-ui, sans-serif;
}

#scene-canvas,
.noise-layer {
  inset: 0;
  pointer-events: none;
  position: fixed;
}

#scene-canvas {
  height: 100%;
  width: 100%;
  opacity: 0.85;
}

.noise-layer {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black, transparent 88%);
  opacity: 0.28;
}

.hero-panel,
.info-panel,
.glass-panel,
.surface-panel,
.stat-card,
.feature-card,
.hud-card,
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-panel,
.info-panel,
.glass-panel {
  backdrop-filter: blur(24px);
}

.hero-panel,
.info-panel {
  border-radius: 2rem;
  overflow: hidden;
  position: relative;
}

.hero-panel {
  padding: 2rem;
}

.hero-panel::before,
.info-panel::before,
.glass-panel::before {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.16), transparent 40%, rgba(34, 197, 94, 0.1));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.glass-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 18, 34, 0.92), rgba(7, 13, 25, 0.76));
}

body.light-theme .glass-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.86));
}

.brand-orb {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(125, 211, 252, 0.6), rgba(2, 132, 199, 0.2));
  border-radius: 999px;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.45);
  height: 1rem;
  width: 1rem;
}

.eyebrow,
.surface-label,
.hud-label,
.stat-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.stat-card {
  border-radius: 1.5rem;
  padding: 1.1rem;
}

.stat-value {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.stat-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.45rem;
}

.control-chip,
.category-chip,
.secondary-button,
.primary-button,
.input-button,
.mini-chip {
  align-items: center;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.control-chip,
.secondary-button,
.category-chip,
.mini-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.primary-button {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(37, 99, 235, 0.95));
  border: 1px solid rgba(191, 219, 254, 0.25);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
  color: white;
  padding: 0.95rem 1.4rem;
}

.secondary-button {
  padding: 0.95rem 1.3rem;
}

.control-chip {
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
}

.category-chip {
  min-height: 2.7rem;
  padding: 0.75rem 1rem;
}

.category-chip.active,
.mini-chip.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.38);
  color: #d7f3ff;
}

.control-chip:hover,
.secondary-button:hover,
.primary-button:hover,
.category-chip:hover,
.input-button:hover,
.mini-chip:hover {
  transform: translateY(-1px);
}

.mini-pill {
  align-items: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  color: #d8f4ff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  min-height: 2rem;
  padding: 0.45rem 0.85rem;
  text-transform: uppercase;
}

body.light-theme .mini-pill {
  color: #164e63;
}

.arcade-preview {
  border-radius: 1.5rem;
  min-height: 17rem;
  overflow: hidden;
  position: relative;
}

.preview-grid {
  background:
    radial-gradient(circle at center, rgba(14, 165, 233, 0.18), transparent 52%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size:
    auto,
    24px 24px,
    24px 24px;
  inset: 0;
  position: absolute;
}

.preview-orb {
  background: radial-gradient(circle, rgba(125, 211, 252, 0.75), transparent 70%);
  filter: blur(18px);
  height: 14rem;
  position: absolute;
  right: -1rem;
  top: -1rem;
  width: 14rem;
}

.preview-card {
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.4rem;
  bottom: 1rem;
  left: 1rem;
  max-width: 15rem;
  padding: 1rem;
  position: absolute;
}

body.light-theme .preview-card {
  background: rgba(255, 255, 255, 0.74);
}

.feature-card {
  align-items: center;
  border-radius: 1.25rem;
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 4.5rem;
  padding: 1rem;
  text-align: center;
}

.hud-card {
  border-radius: 1.35rem;
  padding: 0.9rem;
}

.hud-value {
  color: var(--text);
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.45rem;
}

.surface-panel {
  border-radius: 1.75rem;
  overflow: hidden;
  padding: 1.25rem;
}

.game-card {
  border-radius: 1.9rem;
  overflow: hidden;
  position: relative;
}

.game-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.game-card-top {
  min-height: 11rem;
  position: relative;
}

.game-card-top::after {
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.82));
  content: "";
  inset: 0;
  position: absolute;
}

.game-pattern {
  inset: 0;
  position: absolute;
}

.game-card-body {
  padding: 1.3rem;
  position: relative;
}

.game-card-title {
  color: var(--text);
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.game-card-copy {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 0.55rem;
}

.game-card-footer {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1.1rem;
}

.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-value {
  color: var(--text);
  font-weight: 800;
}

.canvas-shell {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.75rem;
  overflow: hidden;
  padding: 0.9rem;
}

.game-canvas {
  background: linear-gradient(180deg, rgba(7, 15, 30, 0.95), rgba(2, 6, 23, 0.85));
  border-radius: 1.25rem;
  display: block;
  height: auto;
  width: 100%;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.input-button,
.mini-chip {
  min-height: 2.9rem;
  min-width: 2.9rem;
  padding: 0.7rem 1rem;
}

.input-button {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.input-button.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.36);
  color: #e0f2fe;
}

.keyboard-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(2.9rem, 1fr));
}

.letter-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 3.1rem;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.letter-button:hover {
  transform: translateY(-1px);
}

.letter-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.memory-grid,
.daily-pad-grid,
.ladder-chain,
.tag-cloud {
  display: grid;
  gap: 0.9rem;
}

.memory-grid {
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.memory-stage {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr);
}

.memory-side {
  display: grid;
  gap: 1rem;
}

.memory-board-wrap {
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.76), rgba(7, 15, 30, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.6rem;
  padding: 1rem;
}

.memory-summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.35rem;
  padding: 1rem;
}

.memory-kicker {
  color: rgba(224, 242, 254, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.memory-stat-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  padding: 0.8rem;
}

.memory-stat-label {
  color: rgba(226, 232, 240, 0.64);
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.memory-stat-value {
  color: #f8fafc;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.memory-found-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.memory-found-pill {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  color: #e0f2fe;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
}

.memory-progress {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  height: 0.65rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.memory-progress span {
  background: linear-gradient(90deg, #38bdf8, #f472b6, #f59e0b);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 220ms ease;
}

.memory-card {
  cursor: pointer;
  min-height: 8.1rem;
  perspective: 1000px;
  position: relative;
}

.memory-card > div {
  border-radius: 1.3rem;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 240ms ease;
  width: 100%;
}

.memory-card.flipped > div {
  transform: rotateY(180deg);
}

.memory-card.selected > div {
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.28), 0 20px 38px rgba(15, 23, 42, 0.2);
}

.memory-card.matched > div {
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2), 0 18px 34px rgba(34, 197, 94, 0.16);
}

.memory-face {
  align-items: center;
  backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.3rem;
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.memory-front {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.28), rgba(3, 7, 18, 0.94));
  overflow: hidden;
}

.memory-front::after {
  background: linear-gradient(135deg, transparent 0 32%, rgba(255, 255, 255, 0.08) 32% 40%, transparent 40% 100%);
  content: "";
  inset: 0;
  position: absolute;
}

.memory-front-mark {
  color: #f8fafc;
  font-size: 1.7rem;
  position: relative;
  z-index: 1;
}

.memory-front-index {
  bottom: 0.8rem;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  position: absolute;
  right: 0.9rem;
  text-transform: uppercase;
}

.memory-back {
  color: var(--text);
  font-weight: 800;
  padding: 0.75rem;
  text-align: center;
  transform: rotateY(180deg);
}

.memory-card.previewing .memory-back,
.memory-card.matched .memory-back {
  filter: saturate(1.08) brightness(1.02);
}

.connect-board {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 1.6rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 1rem;
}

.connect-slot {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.15rem;
  display: inline-flex;
  justify-content: center;
}

.connect-disc {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.08);
  display: block;
  height: 72%;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  width: 72%;
}

.connect-disc.player-one {
  background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b 70%, #b45309);
}

.connect-disc.player-two {
  background: radial-gradient(circle at 30% 30%, #f9a8d4, #ec4899 70%, #9d174d);
}

.connect-disc.winner {
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.22), inset 0 8px 18px rgba(255, 255, 255, 0.08);
  transform: scale(1.02);
}

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

.mole-hole {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.92), rgba(68, 26, 3, 0.96));
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 1.5rem;
  color: #fef3c7;
  display: inline-flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.mole-hole.active {
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.95), rgba(190, 24, 93, 0.96));
  border-color: rgba(253, 164, 175, 0.42);
  box-shadow: 0 18px 36px rgba(244, 114, 182, 0.24);
  transform: translateY(-2px);
}

.mole-hole-index {
  left: 0.8rem;
  opacity: 0.72;
  position: absolute;
  top: 0.75rem;
}

.mole-hole-label {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.grid-board,
.ladder-box,
.daily-panel,
.guess-panel,
.score-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 1rem;
}

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

.tile-2048 {
  align-items: center;
  border-radius: 1.25rem;
  display: flex;
  font-family: "Sora", system-ui, sans-serif;
  font-size: clamp(1rem, 4vw, 1.9rem);
  font-weight: 700;
  height: 4.7rem;
  justify-content: center;
}

.word-display,
.hangman-word,
.ladder-word,
.score-callout {
  font-family: "Sora", system-ui, sans-serif;
  letter-spacing: 0.12em;
}

.hangman-word,
.ladder-word {
  font-size: clamp(1.3rem, 4vw, 2rem);
}

.field-input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  color: var(--text);
  min-height: 3.25rem;
  outline: none;
  padding: 0.85rem 1rem;
  width: 100%;
}

.field-input:focus {
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.tag-cloud {
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.tag-pill {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  color: var(--text);
  padding: 0.65rem 0.9rem;
  text-align: center;
}

.daily-pad-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-pad {
  aspect-ratio: 1;
  border-radius: 1.5rem;
  cursor: pointer;
  min-height: 7rem;
  opacity: 0.88;
  transition:
    transform 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.daily-pad.active {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 20px 40px rgba(56, 189, 248, 0.22);
  opacity: 1;
  transform: scale(0.98);
}

.mini-grid {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
}

.mini-cell {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 0.8rem;
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 2.9rem;
}

.mine-cell {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.mine-cell.revealed {
  background: rgba(255, 255, 255, 0.14);
}

.mine-cell.flagged {
  background: rgba(250, 204, 21, 0.14);
  color: #facc15;
}

.mine-cell.exploded {
  background: rgba(244, 63, 94, 0.22);
  color: #fecdd3;
}

.minefield-panel {
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.92), rgba(17, 24, 39, 0.96));
  border-color: rgba(248, 113, 113, 0.24);
  color: #fecaca;
}

.minefield-panel .surface-label,
.minefield-panel .helper-copy,
.minefield-panel .text-sm,
.minefield-panel .mini-pill,
.minefield-panel .input-button {
  color: #fecaca;
}

.minefield-panel .mini-pill {
  background: rgba(127, 29, 29, 0.46);
  border-color: rgba(248, 113, 113, 0.24);
}

.minefield-panel .input-button {
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(248, 113, 113, 0.18);
}

.minefield-panel .input-button.active {
  background: rgba(220, 38, 38, 0.24);
  border-color: rgba(248, 113, 113, 0.38);
  color: #fee2e2;
}

.minefield-panel .mine-cell {
  background: rgba(69, 10, 10, 0.55);
  border-color: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.minefield-panel .mine-cell.revealed {
  background: rgba(127, 29, 29, 0.42);
}

.minefield-panel .mine-cell.flagged {
  background: rgba(190, 24, 93, 0.24);
  color: #ffe4e6;
}

.minefield-panel .mine-cell.exploded {
  background: rgba(220, 38, 38, 0.42);
  color: #fff1f2;
}

.guess-bubble {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  max-width: 30rem;
  padding: 0.9rem 1rem;
}

.guess-bubble.user {
  background: rgba(14, 165, 233, 0.18);
  margin-left: auto;
}

.guess-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 18rem;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.mode-switcher,
.score-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mode-switcher {
  margin-top: 1rem;
}

.mode-chip {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  min-height: 2.65rem;
  padding: 0.7rem 0.95rem;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.mode-chip:hover {
  transform: translateY(-1px);
}

.mode-chip.active {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(236, 72, 153, 0.14)),
    rgba(255, 255, 255, 0.88);
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

body:not(.light-theme) .mode-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body:not(.light-theme) .mode-chip.active {
  color: #e0f2fe;
}

.score-strip {
  margin-top: 1rem;
}

.score-box {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.66)),
    linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1.2rem;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
  min-width: 9rem;
  padding: 0.9rem 1rem;
}

.score-box.active {
  border-color: rgba(59, 130, 246, 0.24);
  box-shadow:
    0 16px 30px rgba(37, 99, 235, 0.12),
    0 8px 18px rgba(236, 72, 153, 0.08);
}

body:not(.light-theme) .score-box {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.score-box-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.score-box-value {
  color: var(--text);
  display: block;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.turn-banner,
.setup-card,
.answer-column {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.64)),
    linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1.2rem;
  padding: 1rem;
}

body:not(.light-theme) .turn-banner,
body:not(.light-theme) .setup-card,
body:not(.light-theme) .answer-column {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.turn-banner {
  margin-top: 1rem;
}

.setup-stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.answer-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.answer-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.answer-column-title {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.helper-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.retry-panel {
  display: grid;
  gap: 0.8rem;
}

.retry-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  margin: 0;
  text-transform: uppercase;
}

.retry-title {
  background-image: linear-gradient(90deg, #2563eb 0%, #ec4899 58%, #f59e0b 100%);
  background-clip: text;
  color: transparent;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.light-theme) .retry-title {
  background-image: linear-gradient(90deg, #f8fafc 0%, #7dd3fc 32%, #f9a8d4 72%, #fde68a 100%);
}

.retry-copy {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.retry-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.site-topbar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body:not(.light-theme) .site-topbar {
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.74), rgba(15, 23, 42, 0.56)),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
  border-color: rgba(255, 255, 255, 0.1);
}

.hero-panel,
.info-panel,
.glass-panel,
.surface-panel,
.stat-card,
.feature-card,
.hud-card,
.game-card,
.spotlight-panel,
.spotlight-inner,
.grid-board,
.ladder-box,
.daily-panel,
.guess-panel,
.score-panel,
.canvas-shell {
  backdrop-filter: blur(24px);
}

body.light-theme .hero-panel,
body.light-theme .info-panel,
body.light-theme .glass-panel,
body.light-theme .surface-panel,
body.light-theme .stat-card,
body.light-theme .feature-card,
body.light-theme .hud-card,
body.light-theme .game-card,
body.light-theme .spotlight-panel,
body.light-theme .spotlight-inner,
body.light-theme .grid-board,
body.light-theme .ladder-box,
body.light-theme .daily-panel,
body.light-theme .guess-panel,
body.light-theme .score-panel,
body.light-theme .canvas-shell {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(236, 72, 153, 0.05));
  border-color: rgba(148, 163, 184, 0.14);
}

.hero-panel::after,
.info-panel::after {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.38) 0 2px, transparent 2px),
    radial-gradient(circle at 50% 62%, rgba(59, 130, 246, 0.14) 0 2px, transparent 2px);
  background-size:
    18px 18px,
    24px 24px;
  content: "";
  height: 10rem;
  opacity: 0.55;
  position: absolute;
  right: -1rem;
  top: -1rem;
  width: 10rem;
}

.hero-title,
.section-title,
#player-title,
#daily-name,
#daily-type {
  background-image: linear-gradient(90deg, #0f172a 0%, #2563eb 28%, #ec4899 64%, #f59e0b 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.light-theme) .hero-title,
body:not(.light-theme) .section-title,
body:not(.light-theme) #player-title,
body:not(.light-theme) #daily-name,
body:not(.light-theme) #daily-type {
  background-image: linear-gradient(90deg, #f8fafc 0%, #7dd3fc 28%, #f9a8d4 62%, #fde68a 100%);
}

.hero-accent {
  white-space: nowrap;
}

.hero-accent-sky {
  color: #2563eb;
}

.hero-accent-pink {
  color: #ec4899;
}

.hero-copy,
.spotlight-meta,
.spotlight-score,
#player-description,
#player-instructions,
#player-status {
  color: rgba(30, 41, 59, 0.76);
}

body:not(.light-theme) .hero-copy,
body:not(.light-theme) .spotlight-meta,
body:not(.light-theme) .spotlight-score,
body:not(.light-theme) #player-description,
body:not(.light-theme) #player-instructions,
body:not(.light-theme) #player-status {
  color: rgba(226, 232, 240, 0.76);
}

.hero-print-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.print-chip {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 0.68rem 0.95rem;
  text-transform: uppercase;
}

.print-chip-sky {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

.print-chip-pink {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.18);
  color: #db2777;
}

.print-chip-gold {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

body:not(.light-theme) .print-chip-sky {
  color: #dbeafe;
}

body:not(.light-theme) .print-chip-pink {
  color: #fce7f3;
}

body:not(.light-theme) .print-chip-gold {
  color: #fef3c7;
}

.eyebrow {
  background-image: linear-gradient(90deg, #2563eb, #ec4899, #f59e0b);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-value {
  background-image: linear-gradient(90deg, #0f172a 0%, #2563eb 36%, #ec4899 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.light-theme) .stat-value {
  background-image: linear-gradient(90deg, #ffffff 0%, #7dd3fc 36%, #f9a8d4 100%);
}

.control-chip,
.secondary-button,
.category-chip,
.mini-chip,
.input-button,
.field-input,
.letter-button {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

body.light-theme .control-chip,
body.light-theme .secondary-button,
body.light-theme .category-chip,
body.light-theme .mini-chip,
body.light-theme .input-button,
body.light-theme .field-input,
body.light-theme .letter-button {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.16);
}

.primary-button {
  background:
    linear-gradient(135deg, #2563eb 0%, #38bdf8 34%, #ec4899 72%, #f59e0b 100%);
  box-shadow:
    0 18px 36px rgba(37, 99, 235, 0.18),
    0 10px 22px rgba(236, 72, 153, 0.14);
}

.category-chip.active,
.mini-chip.active,
.mini-pill {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(236, 72, 153, 0.18)),
    rgba(255, 255, 255, 0.8);
  border-color: rgba(99, 102, 241, 0.24);
  color: #1d4ed8;
}

body:not(.light-theme) .category-chip.active,
body:not(.light-theme) .mini-chip.active,
body:not(.light-theme) .mini-pill {
  color: #e0f2fe;
}

.spotlight-panel,
.spotlight-inner {
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.spotlight-inner {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.58)),
    linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
}

body:not(.light-theme) .spotlight-inner {
  background:
    linear-gradient(145deg, rgba(2, 6, 23, 0.64), rgba(15, 23, 42, 0.56)),
    linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
}

.spotlight-score {
  color: #db2777;
}

.preview-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.66)),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
  border-color: rgba(148, 163, 184, 0.16);
}

body:not(.light-theme) .preview-card {
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.76)),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(236, 72, 153, 0.08));
}

.feature-card:nth-child(1) {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(255, 255, 255, 0.7));
}

.feature-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(255, 255, 255, 0.7));
}

.feature-card:nth-child(3) {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(255, 255, 255, 0.7));
}

.feature-card:nth-child(4) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.7));
}

body:not(.light-theme) .feature-card:nth-child(1),
body:not(.light-theme) .feature-card:nth-child(2),
body:not(.light-theme) .feature-card:nth-child(3),
body:not(.light-theme) .feature-card:nth-child(4) {
  background: rgba(255, 255, 255, 0.06);
}

.game-card {
  --card-accent: var(--accent);
  --card-accent-soft: rgba(236, 72, 153, 0.18);
  box-shadow:
    0 28px 48px rgba(15, 23, 42, 0.09),
    0 12px 26px var(--card-accent-soft);
}

.game-card::after {
  background:
    radial-gradient(circle at 84% 12%, var(--card-accent-soft), transparent 34%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.18), transparent 26%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.game-card-body::before {
  background:
    linear-gradient(90deg, var(--card-accent), transparent 42%);
  content: "";
  height: 3px;
  left: 1.3rem;
  opacity: 0.65;
  position: absolute;
  right: 1.3rem;
  top: 0;
}

.game-card-title {
  background-image: linear-gradient(90deg, #0f172a 0%, var(--card-accent) 75%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.light-theme) .game-card-title {
  background-image: linear-gradient(90deg, #ffffff 0%, #e0f2fe 24%, var(--card-accent) 100%);
}

.game-card-wordmark {
  letter-spacing: 0.04em;
  text-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
}

.card-control-box {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.12)),
    rgba(15, 23, 42, 0.18);
}

.player-backdrop {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 25%),
    radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.18), transparent 22%),
    rgba(255, 255, 255, 0.72);
}

body:not(.light-theme) .player-backdrop {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 25%),
    radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.18), transparent 22%),
    rgba(2, 6, 23, 0.76);
}

body.light-theme .game-canvas {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.92), rgba(236, 246, 255, 0.9));
}

.player-open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

button,
input {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) {
  .hero-panel {
    padding: 1.4rem;
  }

  .memory-stage {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
