:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #262b36;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #ff6b4a;
  --accent-dim: #4a2e26;
  --green: #34d399;
  --blue: #60a5fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 20px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-email {
  font-size: 13px;
  color: var(--muted);
}

.plan-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan-badge.free { background: var(--border); color: var(--muted); }
.plan-badge.pro { background: var(--accent); color: #1a0f0b; }

.btn-small { padding: 6px 12px; font-size: 12px; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

.upsell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-dim), #1a1614);
  border: 1px solid #3a2a20;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 14px;
}

.upsell-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-secondary:hover { background: rgba(255, 107, 74, 0.1); }

.dev-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.verify-note {
  background: var(--card);
  border: 1px solid var(--blue);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
}

.past-due-note {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid #f87171;
  border-radius: 10px;
  padding: 10px 16px;
  color: #f87171;
  justify-content: flex-start;
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
}
.flash-success { background: rgba(52, 211, 153, 0.12); border: 1px solid var(--green); color: var(--green); }
.flash-error { background: rgba(248, 113, 113, 0.12); border: 1px solid #f87171; color: #f87171; }
.flash-dev-email { background: rgba(96, 165, 250, 0.1); border: 1px solid var(--blue); color: var(--text); }

.flash-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--blue);
  margin-top: 6px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #1a0f0b; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.new-habit {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.emoji-input {
  width: 48px;
  text-align: center;
  font-size: 18px;
}
.new-habit input[type="text"]:not(.emoji-input) { flex: 1; }
.new-habit input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.new-habit input:focus { outline: none; border-color: var(--accent); }

.form-error {
  color: #f87171;
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0 16px;
}

.habits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.habit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

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

.habit-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.habit-title .emoji { font-size: 18px; }

.delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.delete-btn:hover { color: #f87171; }

.habit-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.streak { display: flex; align-items: baseline; gap: 6px; }
.streak-count { font-size: 22px; font-weight: 800; color: var(--accent); }
.streak-label { font-size: 12px; color: var(--muted); }

.checkin-btn {
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.checkin-btn.done { background: var(--green); color: #062a1d; }

.insure-btn {
  background: none;
  border: 1px solid var(--blue);
  color: var(--blue);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}
.insure-btn:hover { background: rgba(96, 165, 250, 0.12); }

.heatmap {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
}
.cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--border);
}
.cell.done { background: var(--green); }
.cell.insured { background: var(--blue); }

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
  font-size: 14px;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

.auth-brand { font-size: 24px; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }

.auth-hint {
  margin: -8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.auth-hint a { color: var(--accent); }

.auth-submit { width: 100%; margin-top: 4px; }

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.auth-switch a { color: var(--accent); }

.section-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); background: var(--card); border-color: var(--accent); }

.brain-streak {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.brain-streak .streak-count { font-size: 22px; font-weight: 800; color: var(--accent); }
.brain-streak .streak-label { font-size: 13px; color: var(--muted); }
/* Pushed to the far end of the streak bar — present on every game screen,
   but never the thing you look at first. */
.sound-toggle { margin-left: auto; align-self: center; }

.brain-games {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brain-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.brain-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.brain-card-header h2 { font-size: 16px; margin: 0; }

.brain-best { font-size: 12px; color: var(--muted); white-space: nowrap; }

.brain-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
}

.brain-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.brain-status {
  font-size: 13px;
  color: var(--text);
  min-height: 18px;
}

.brain-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plays-left {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.play-limit-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

[hidden] { display: none !important; }

/* Memory Match */

/* Difficulty picker — three toggle buttons, same role as iOS's segmented
   Picker. Plain buttons with aria-pressed (not radio inputs) so Enter/Space
   and Tab work with zero extra JS, while screen readers still hear each
   one's pressed state; the wrapping role="group" gives them a shared name. */
.memory-level-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.memory-level-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.memory-level-btn:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.memory-level-btn.active { background: var(--accent); border-color: var(--accent); color: #1a0f0b; }
.memory-level-btn:disabled { opacity: 0.5; cursor: default; }

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* The cell itself is only the stage: it carries the perspective and stays
   transparent, so what you see is always one of the two faces. */
.memory-cell {
  aspect-ratio: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  perspective: 600px;
}
.memory-cell:active { transform: scale(0.96); }

.memory-cell-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-in-out;
}
/* Matched cards stay face-up on their own, in case a future change stops
   leaving .flipped on them. */
.memory-cell.flipped .memory-cell-inner,
.memory-cell.matched .memory-cell-inner { transform: rotateY(180deg); }

.memory-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 22px;
  /* The half of the turn where a face points away from you simply isn't
     drawn, which is what swaps back for front exactly edge-on at 90°
     instead of cross-fading the two. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Purple back, matching the iOS app's Memory Match card. Hover lightens the
   gradient rather than applying opacity or a filter: either of those on a
   face — or on the cell holding the perspective — risks flattening the 3D
   context and losing the backface culling the flip depends on. */
.memory-back {
  background: linear-gradient(135deg, #9a5ceb, #6b41bd);
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
}
.memory-cell:hover .memory-back {
  background: linear-gradient(135deg, #b47dff, #8355d8);
}

.memory-front {
  background: #2a3040;
  transform: rotateY(180deg);
}
/* Levels 2-3 show a math expression or its answer ("6×7", "42") instead of
   a single emoji — smaller and bold so e.g. "6×7" stays readable and on one
   line even in the narrowest 4-column cell, instead of the 22px emoji size. */
.memory-front.memory-face-compact {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  padding: 0 2px;
}
.memory-cell.matched .memory-front {
  background: rgba(52, 211, 153, 0.18);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .memory-cell-inner { transition: none; }
  .memory-cell:active { transform: none; }
}

/* Quick Math */
.math-question {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  padding: 24px 0;
}

.math-answer {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-size: 18px;
  text-align: center;
}
.math-answer:focus { outline: none; border-color: var(--accent); }
.math-answer:disabled { opacity: 0.5; }

/* Reaction Time */
.reaction-box {
  width: 100%;
  height: 140px;
  border: none;
  border-radius: 12px;
  background: var(--border);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.reaction-box.waiting { background: #4a2e26; color: #ffb4a2; }
.reaction-box.ready { background: var(--green); color: #062a1d; }

/* Reading Speed */
.reading-passage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.reading-quiz { margin-top: 4px; }

.reading-question {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

.reading-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reading-choice, .stroop-choice {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.reading-choice:hover, .stroop-choice:hover { border-color: var(--accent); color: var(--text); }

/* Sequence Memory */
.sequence-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 260px;
  margin: 0 auto;
}

.sequence-cell {
  aspect-ratio: 1;
  background: var(--border);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.sequence-cell:hover { filter: brightness(1.15); }
.sequence-cell.active { background: var(--accent); color: #1a0f0b; }

/* Stroop Test */
.stroop-word {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  padding: 24px 0;
  letter-spacing: 0.05em;
}

.stroop-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Shared by the newer games' boards: "Press start" / "Time!" */
.game-message {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  padding: 28px 0;
}
.paused { opacity: 0.5; pointer-events: none; }

/* Bigger or Smaller */
.compare-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.compare-choice {
  background: var(--border);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 28px 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
}
.compare-choice:hover { border-color: var(--accent); }

/* Word Scramble */
.scramble-answer, .scramble-letters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.scramble-answer { min-height: 46px; margin-bottom: 12px; }
.scramble-answer:empty { display: none; }
.scramble-slot {
  width: 38px;
  height: 44px;
  border-bottom: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}
.scramble-answer.wrong .scramble-slot { border-color: #ef4444; color: #ef4444; }
.scramble-letter {
  width: 44px;
  height: 48px;
  background: var(--border);
  border: none;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
}
.scramble-letter:hover { filter: brightness(1.15); }
.scramble-letter:disabled { opacity: 0.2; cursor: default; }
.scramble-tools { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

/* Odd One Out */
.oddone-board {
  display: grid;
  gap: 6px;
  max-width: 300px;
  margin: 0 auto;
}
.oddone-cell {
  aspect-ratio: 1;
  background: var(--border);
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: clamp(18px, 6vw, 30px);
  cursor: pointer;
  padding: 0;
}
.oddone-cell.reveal { border-color: var(--accent); }

/* Number Memory */
.numbers-display {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 24px 0;
  overflow-wrap: anywhere;
}
.numbers-display.hidden-number { color: var(--muted); }
.numbers-display.idle { font-size: 18px; letter-spacing: normal; color: var(--muted); padding: 28px 0; }
.numbers-entry { display: flex; gap: 8px; justify-content: center; }
.numbers-entry input {
  width: 100%;
  max-width: 260px;
  font-size: 22px;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

/* Leaderboard */
.leaderboard-section { margin-top: 28px; }

.leaderboard-title {
  font-size: 18px;
  margin: 0 0 14px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.leaderboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.leaderboard-card h3 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--muted);
}
.lb-level-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.lb-level-tab {
  flex: 1; background: transparent; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 0; font-size: 11px; cursor: pointer; color: var(--muted);
}
.lb-level-tab.active { background: var(--accent-dim); border-color: var(--accent); }

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.leaderboard-list li.is-you { color: var(--accent); font-weight: 600; }

.lb-rank { color: var(--muted); width: 24px; flex-shrink: 0; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: var(--text); font-variant-numeric: tabular-nums; }
.is-you .lb-score { color: var(--accent); }

.leaderboard-you {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent);
}

.leaderboard-empty {
  font-size: 13px;
  color: var(--muted);
}

/* Account page, legal pages, footer */
a.brand, a.account-email { color: inherit; text-decoration: none; }
a.account-email:hover { color: var(--text); text-decoration: underline; }

.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.auth-container .site-footer { margin-top: 20px; }
.auth-legal { margin: 0; text-align: center; }
.auth-legal a { color: var(--accent); }

.back-link { margin: 0 0 16px; font-size: 13px; }
.back-link a { color: var(--muted); text-decoration: none; }

.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.account-card h1, .account-card h2 { margin: 0 0 12px; font-size: 18px; }
.account-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.account-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.account-row a { color: var(--accent); }
.account-label { width: 64px; flex-shrink: 0; color: var(--muted); }

.danger-zone { border-color: rgba(248, 113, 113, 0.45); }
.danger-zone form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; max-width: 340px; }
.danger-zone label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.danger-zone input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.danger-note { color: #fbbf24 !important; }
.btn-danger { background: #dc2626; color: #fff; align-self: flex-start; }
.btn-danger:hover { filter: brightness(1.1); }

.legal-page { line-height: 1.6; }
.legal-page h1 { font-size: 26px; margin: 8px 0 4px; }
.legal-page h2 { font-size: 17px; margin: 28px 0 8px; }
.legal-page p, .legal-page li { color: var(--text); font-size: 15px; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin-bottom: 8px; }
.legal-page a { color: var(--accent); }
.legal-updated { color: var(--muted) !important; font-size: 13px !important; margin-top: 0; }
.account-billing { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.account-hint { color: var(--muted); font-size: 12px; }
.account-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.account-inline-form input[type="text"],
.account-inline-form input[type="time"] {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 14px; width: 180px;
  color-scheme: dark;
}
.account-inline-form input[type="time"] { width: auto; }
.account-inline-form input:focus { outline: none; border-color: var(--accent); }
.account-inline-form .account-hint { flex-basis: 100%; }
.account-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.account-check input { accent-color: var(--accent); width: 16px; height: 16px; }

.upsell-note { flex-basis: 100%; margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Public home page (landing.html). The app's starfield look: a deep
   navy-to-purple gradient with a few CSS-drawn stars.
   --------------------------------------------------------------------------- */

body.landing {
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 42% 32%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 88% 44%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 22% 63%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 64% 78%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 8% 90%, rgba(255,255,255,.5), transparent),
    linear-gradient(180deg, #05051a 0%, #140529 45%, #03030d 100%);
  background-attachment: fixed;
  color: #f2effa;
}
.landing a { text-decoration: none; }
.landing a.btn { display: inline-block; }
.landing h1, .landing h2, .landing h3 { letter-spacing: -0.02em; }

.landing-top {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1080px; margin: 0 auto; padding: 18px 20px;
}
.landing-top .brand { color: #fff; }
.landing-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.landing-nav a:not(.btn) { color: #c4bedc; }
.landing-nav a:not(.btn):hover { color: #fff; }

.landing main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.landing-hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
  padding: 48px 0 72px;
}
.landing-hero h1 { font-size: 52px; line-height: 1.05; margin: 0 0 18px; }
.landing-hero h1 span {
  background: linear-gradient(90deg, #ffb24d, #ff3d7a, #8c3dff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.landing-lead { font-size: 18px; line-height: 1.5; color: #c4bedc; margin: 0 0 24px; max-width: 34em; }
.landing-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.landing-cta { padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.landing .btn-primary { background: linear-gradient(90deg, #ffb24d, #ff3d7a 55%, #8c3dff); color: #fff; }
.landing-appstore { background: #fff; color: #000; }
.landing-soon {
  padding: 13px 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  font-size: 14px; color: #c4bedc;
}
.landing-fine { font-size: 13px; color: #8f88aa; margin: 16px 0 0; }

.landing-phone { display: flex; justify-content: center; }
.landing-phone img {
  width: 300px; max-width: 100%; height: auto; border-radius: 40px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 80px rgba(140, 61, 255, .35), 0 0 0 8px rgba(255,255,255,.03);
}

.landing-feature {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: center;
  padding: 56px 0;
}
.landing-feature.reverse .landing-phone { order: 2; }
.landing-feature h2 { font-size: 36px; margin: 0 0 14px; }
.landing-feature p { font-size: 17px; line-height: 1.55; color: #c4bedc; margin: 0 0 14px; max-width: 32em; }
.landing-games {
  list-style: none; padding: 0; margin: 0 0 18px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 12em)); gap: 10px;
}
.landing-games li {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 10px 12px; font-size: 15px;
}

.landing-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 48px 0; }
.landing-point {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 22px;
}
.landing-point-icon { font-size: 28px; }
.landing-point h3 { margin: 10px 0 6px; font-size: 18px; }
.landing-point p { margin: 0; font-size: 15px; line-height: 1.5; color: #c4bedc; }

.landing-pricing { padding: 56px 0; text-align: center; }
.landing-pricing h2 { font-size: 36px; margin: 0 0 10px; }
.landing-pricing .landing-lead { margin: 0 auto 28px; }
.landing-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: left; }
.landing-plan {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 22px;
}
.landing-plan.featured { border-color: #8c3dff; box-shadow: 0 0 40px rgba(140, 61, 255, .25); }
.landing-plan h3 { margin: 0 0 8px; font-size: 17px; }
.landing-price { font-size: 28px; font-weight: 800; }
.landing-alt { font-size: 13px; color: #8f88aa; margin-top: 2px; }
.landing-plan ul { padding-left: 18px; margin: 14px 0 0; color: #c4bedc; font-size: 14px; line-height: 1.6; }

.landing-final { text-align: center; padding: 48px 0 24px; }
.landing-final h2 { font-size: 32px; margin: 0 0 20px; }

@media (max-width: 820px) {
  .landing-hero, .landing-feature { grid-template-columns: 1fr; gap: 28px; }
  .landing-hero { padding-top: 24px; text-align: left; }
  .landing-hero h1 { font-size: 38px; }
  .landing-feature.reverse .landing-phone { order: 0; }
  .landing-feature h2, .landing-pricing h2 { font-size: 28px; }
  .landing-points { grid-template-columns: 1fr; }
  .landing-plans { grid-template-columns: 1fr 1fr; }
  .landing-phone img { width: 260px; }
}
@media (max-width: 480px) {
  .landing-nav a[href="#pricing"] { display: none; }
  .landing-plans { grid-template-columns: 1fr; }
  .landing-games { grid-template-columns: 1fr 1fr; }
}

/* First-run starter habits on an empty dashboard. */
.quick-start {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-top: 8px;
}
.quick-start h2 { font-size: 17px; margin: 0 0 6px; }
.quick-start p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.quick-start-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quick-start-habit {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer;
}
.quick-start-habit:hover:not(:disabled) { border-color: var(--accent); }
.quick-start-habit:disabled { opacity: 0.5; cursor: default; }
.quick-start-next { margin: 0 !important; font-size: 13px !important; }
.quick-start-next a { color: var(--accent); }
