:root {
  --bg-1: #e9d5ff;
  --bg-2: #d8b4fe;
  --bg-3: #c4a3fb;
  --surface: #ffffff;
  --surface-2: #f5f1ff;
  --text: #2c2350;
  --text-dim: #8a83a8;
  --accent: #7c3aed;
  --accent-2: #f59e0b;
  --accent-3: #ec4899;
  --accent-4: #14b8a6;
  --good: #16a34a;
  --bad: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(124, 58, 237, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-1: #1e1a38;
    --bg-2: #2b2350;
    --bg-3: #201c42;
    --surface: #241f42;
    --surface-2: #322b56;
    --text: #f0edff;
    --text-dim: #a89fc9;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg-1: #1e1a38;
  --bg-2: #2b2350;
  --bg-3: #201c42;
  --surface: #241f42;
  --surface-2: #322b56;
  --text: #f0edff;
  --text-dim: #a89fc9;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  will-change: transform;
}
.blob.b1 {
  width: 70vmax;
  height: 70vmax;
  left: -20vmax;
  top: -25vmax;
  opacity: 0.6;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
}
.blob.b2 {
  width: 55vmax;
  height: 55vmax;
  right: -22vmax;
  top: 10vmax;
  background: radial-gradient(circle at 60% 40%, var(--accent-3), transparent 70%);
}
.blob.b3 {
  width: 50vmax;
  height: 50vmax;
  left: 10vmax;
  bottom: -25vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent-4), transparent 70%);
}
.blob.b4 {
  width: 40vmax;
  height: 40vmax;
  right: 5vmax;
  bottom: -15vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent-2), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .blob.b1 { animation: float1 22s ease-in-out infinite alternate; }
  .blob.b2 { animation: float2 26s ease-in-out infinite alternate; }
  .blob.b3 { animation: float3 30s ease-in-out infinite alternate; }
  .blob.b4 { animation: float2 24s ease-in-out infinite alternate; }
}
@keyframes float1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vmax, 8vmax) scale(1.08); }
}
@keyframes float2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-7vmax, 5vmax) scale(1.1); }
}
@keyframes float3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5vmax, -6vmax) scale(1.06); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px var(--ad-clearance, 90px);
}

h1, h2, h3 { margin: 0 0 8px; }

.bg-decor.custom-scene .blob { display: none; }

.scene-banner {
  height: 150px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.scene-banner-label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-wrap {
  position: relative;
}

.home-btn {
  border: none;
  background: var(--surface-2);
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-toggle,
.header-share-btn {
  border: none;
  background: var(--surface-2);
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-share-btn { color: var(--accent); }
.settings-toggle:hover,
.header-share-btn:hover { opacity: 0.85; }

.settings-panel {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 12px;
  min-width: 220px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.settings-row + .settings-row {
  border-top: 1px solid var(--surface-2);
}

.settings-lang-switch {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  max-width: 190px;
}

.lang-opt, .theme-opt {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-opt.active, .theme-opt.active {
  background: var(--accent);
  color: #fff;
}

.avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.cosmetic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cosmetic-swatch {
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  width: 84px;
}
.cosmetic-swatch.bg-swatch {
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
}
.cosmetic-swatch.bg-swatch span {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.3;
}
.cosmetic-swatch.avatar-swatch {
  background: var(--surface-2);
}
.cosmetic-swatch.avatar-swatch .avatar-badge {
  margin: 0 auto 6px;
  width: 40px;
  height: 40px;
  font-size: 20px;
}
.cosmetic-swatch.active {
  border-color: var(--accent);
}

.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand span { color: #16a34a; }

.streak-pill {
  background: linear-gradient(135deg, #fff1d6, #ffe0b8);
  color: #92400e;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(124, 58, 237, 0.06);
}

.date-line {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 2px;
  text-transform: capitalize;
}
.greeting-heading {
  font-size: 18.72px;
  color: #2563eb;
}

.greeting-row {
  color: #2563eb;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.name-input {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  text-align: center;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: var(--surface-2);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid rgba(124, 58, 237, 0.15);
}
.btn.danger {
  background: #fff0f0;
  color: #dc2626;
  box-shadow: none;
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.btn.share {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}
.flash-toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translate(-50%, 16px);
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 200;
  pointer-events: none;
}
.flash-toast.show { opacity: 1; transform: translate(-50%, 0); }
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.puzzle-tile {
  background: var(--surface-2);
  color: #2c2350;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}
.puzzle-tile .icon { font-size: 22px; }
.puzzle-tile.practice { cursor: pointer; transition: transform 0.12s ease; }
.puzzle-tile.practice:active { transform: scale(0.96); }
.practice-hint { margin-top: 10px; font-size: 12px; }
.home-stats-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 16px;
}
.home-stat {
  flex: 1;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 9px 4px;
  text-align: center;
  font-size: 15px;
  line-height: 1.25;
}
.home-stat b { font-weight: 800; }
.home-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
}
.home-mission-line {
  text-align: center;
  margin: 8px 0 10px;
}
.review-card { margin-top: 14px; }
.review-card h3 { margin-bottom: 4px; }
.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.review-actions .btn {
  flex: 1;
  margin-top: 0;
  padding: 12px 8px;
}
.puzzle-tile .soon {
  color: var(--text-dim);
  font-size: 11px;
}
.puzzle-tile:nth-child(1) { background: #ffe1ef; }
.puzzle-tile:nth-child(2) { background: #e0f0ff; }
.puzzle-tile:nth-child(3) { background: #e2fbea; }
.puzzle-tile:nth-child(4) { background: #c299fa; }
.puzzle-tile:nth-child(5) { background: #fff1d6; }
.puzzle-tile:nth-child(6) { background: #dffaf5; }
.puzzle-tile:nth-child(7) { background: #ffe8d9; }

.progress-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.progress-dot {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-2);
}
.progress-dot.done { background: var(--good); }
.progress-dot.active { background: var(--accent); }

.timer-bar-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.timer-bar-fill {
  height: 100%;
  background: var(--accent-2);
  transition: width 1s linear;
}
.timer-bar-fill.expired {
  background: #d8d2ea;
}
.bonus-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -10px;
  margin-bottom: 16px;
}
.bonus-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 8px;
}

.puzzle-title {
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.math-question {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  margin: 24px 0;
  color: var(--accent);
}

.math-input {
  width: 100%;
  font-size: 24px;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
  margin-bottom: 12px;
}
.math-input:focus { outline: none; border-color: var(--accent); }
.math-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 13px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.memory-cell {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--surface-2);
  transition: background 0.15s;
}
.memory-cell.lit { background: var(--accent); }
.memory-cell.ok { background: var(--good); }
.memory-cell.wrong { background: var(--bad); }
.memory-status {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 8px;
  min-height: 20px;
}

.word-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.word-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  border: 2px solid transparent;
  color: var(--text);
}
.word-cell.filled { border-color: rgba(124, 58, 237, 0.35); }
.word-cell.correct { background: var(--good); color: #fff; }
.word-cell.present { background: var(--accent-2); color: #4a2e00; }
.word-cell.absent { background: #e5e1f0; color: var(--text-dim); }

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key {
  flex: 1;
  max-width: 34px;
  padding: 12px 0;
  text-align: center;
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.kb-key.wide { max-width: 56px; font-size: 11px; }
.kb-key.correct { background: var(--good); color: #fff; }
.kb-key.present { background: var(--accent-2); color: #4a2e00; }
.kb-key.absent { background: #e5e1f0; color: var(--text-dim); }

.result-score {
  font-size: 48px;
  font-weight: 800;
  text-align: center;
  color: var(--accent-3);
  margin: 8px 0;
}
.result-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.result-row {
  display: flex;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}
.result-row b { color: var(--accent-3); }

.badge-toast {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 14px;
}

.muted { color: var(--text-dim); font-size: 13px; }
.center { text-align: center; }
.spacer { flex: 1; }
.transition-emoji { font-size: 48px; text-align: center; margin: 20px 0; }

/* Sudoku */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-width: 280px;
  margin: 16px auto;
}
.sudoku-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  color: var(--text);
}
.sudoku-cell.given { color: var(--text-dim); cursor: default; }
.sudoku-cell.selected { border-color: var(--accent); }
.sudoku-cell.conflict { background: rgba(239, 68, 68, 0.18); color: #ef4444; border-color: #ef4444; }
.sudoku-cell.border-right { margin-right: 4px; }
.sudoku-cell.border-bottom { margin-bottom: 4px; }
.numpad {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.numpad-key {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 0;
  flex: 1;
  max-width: 56px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}
.numpad-key.wide { max-width: 90px; font-size: 13px; }

/* Word search */
.wordlist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.wordlist-item {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.wordlist-item.found {
  background: var(--good);
  color: #fff;
  text-decoration: line-through;
}
.wordsearch-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  touch-action: none;
}
.wordsearch-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  color: var(--text);
}
.wordsearch-cell.selecting { background: var(--accent); color: #fff; }
.wordsearch-cell.found { background: var(--good); color: #fff; }

/* Blocks */
.blocks-status {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 10px;
  min-height: 18px;
}
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}
.blocks-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 6px;
  cursor: pointer;
}
.blocks-cell.filled { background: var(--accent); }
.hand-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.hand-piece {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  cursor: pointer;
}
.hand-piece.selected { border-color: var(--good); }
.hand-piece.empty { visibility: hidden; }
.hand-mini {
  display: grid;
  gap: 3px;
}
.hand-mini-cell { width: 18px; height: 18px; background: transparent; border-radius: 3px; }
.hand-mini-cell.on { background: var(--accent-2); }

/* Logic puzzle */
.logic-clues {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
}
.logic-clues ul { margin: 0; padding-left: 18px; }
.logic-clues li { margin-bottom: 6px; }
.logic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.logic-table th, .logic-table td {
  padding: 8px 6px;
  text-align: left;
}
.logic-select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 6px;
  padding: 6px 4px;
}

/* Albums — home summary */
.album-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.album-mini {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.album-mini.complete { background: rgba(22, 163, 74, 0.14); color: var(--good); }

/* Albums — overview grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.album-tile {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}
.album-tile.complete { background: rgba(22, 163, 74, 0.12); }
.album-tile-emoji { font-size: 32px; margin-bottom: 6px; }
.album-tile-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.album-tile-progress { color: var(--text-dim); font-size: 12px; }
.album-tile.complete .album-tile-progress { color: var(--good); }

/* Album detail grid */
.collect-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.collect-card {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  overflow: hidden;
}
.collect-card.locked { opacity: 0.5; }
.collect-card-emoji { font-size: 26px; margin-bottom: 4px; }
.collect-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
  display: block;
}
.collect-card-name { font-size: 11px; color: var(--text-dim); }

/* Earned cards on results screen */
.cards-earned-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.earned-card {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  min-width: 120px;
  max-width: 160px;
  border: 2px solid var(--accent-2);
  overflow: hidden;
}
.earned-card-emoji { font-size: 28px; margin-bottom: 4px; }
.earned-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
  display: block;
}
.earned-card-name { font-size: 12px; font-weight: 700; }
.earned-card-album { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* Milestones */
.milestone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.milestone-chip {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.milestone-chip:nth-child(1) { background: #c299fa; color: #6d28d9; }
.milestone-chip:nth-child(2) { background: #dffaf5; color: #0f766e; }
.milestone-chip.complete { background: rgba(245, 158, 11, 0.18); color: #b45309; }

.challenge-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.challenge-track-fill {
  height: 100%;
  background: var(--good);
  transition: width 0.3s ease;
}

/* Achievements page */
.achievement-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  font-size: 13px;
}
.achievement-row:last-child { border-bottom: none; }
.achievement-emoji { font-size: 20px; }

/* Multiplayer */
.mp-error {
  background: #fff0f0;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
}
.mp-join-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(124, 58, 237, 0.1);
}
.mp-join-inline {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.mp-code-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: var(--surface-2);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
}
.mp-room-code {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
  margin-top: 8px;
}
.mp-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  font-size: 14px;
  font-weight: 600;
}
.mp-player-row:last-child { border-bottom: none; }
.mp-host-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 8px;
  border-radius: 999px;
}
.mp-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}
.mp-result-row:last-child { border-bottom: none; }
.mp-medal { font-size: 18px; width: 26px; text-align: center; }
.mp-result-name { flex: 1; font-weight: 700; font-size: 14px; }
.mp-result-score { font-size: 18px; color: var(--accent); min-width: 34px; text-align: right; }
.lb-you {
  background: rgba(124, 58, 237, 0.06);
  margin: 0 -14px;
  padding: 10px 14px;
  border-radius: 10px;
}
.ad-card {
  border-radius: var(--radius);
  padding: 32px 22px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
}
.ad-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
}
.ad-emoji { font-size: 48px; margin-bottom: 10px; }
.ad-card h2 { margin: 0 0 8px; }
.ad-card p { margin: 0; opacity: 0.92; font-size: 14px; }
.ad-hint {
  text-align: center;
  font-size: 12px;
  margin: 10px 0;
}
.ad-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 44px;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}
.ad-banner-label {
  background: rgba(255, 255, 255, 0.25);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ad-banner-emoji { font-size: 18px; flex-shrink: 0; }
.ad-banner-title {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-done-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--good);
  background: rgba(22, 163, 74, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
}
