/* ─── THEME VARIABLES ───────────────────────────────────────────────────────── */

:root {
  --yellow: #FFD100;
  --black: #0d0d0d;
  --card: #181818;
  --border: #252525;
  --muted: #888;
  --text: #e0e0e0;
}

/* ─── RESET ─────────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── BASE ──────────────────────────────────────────────────────────────────── */

body {
  background: var(--black);
  color: var(--yellow);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  transition: background 0.3s, color 0.3s;
}

#app {
  width: 100%;
  max-width: 400px;
}

/* ─── HOME ──────────────────────────────────────────────────────────────────── */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.theme-toggle:hover {
  opacity: 1;
}

.logo-area {
  text-align: center;
}

.bee-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 2px;
}

h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--yellow);
}

.tagline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.stats-row {
  display: flex;
  width: 100%;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 12px 0;
}

.stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 1px;
  background: var(--border);
}

/* ─── CATEGORY PICKER ───────────────────────────────────────────────────────── */

.section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.cat-btn {
  padding: 14px 8px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--muted);
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cat-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.cat-btn.selected {
  border-color: var(--yellow);
  color: var(--yellow);
  background: #1f1a00;
}

.cat-emoji {
  font-size: 20px;
}

.cat-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.cat-btn.capitals-mode {
  border-color: #2a4a7f;
  background: #0d1f3c;
  color: #7aadff;
}

.cat-btn.capitals-mode:hover {
  border-color: #4a7abf;
  background: #162d52;
  color: #a8cbff;
}

.cat-btn.surprise {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 12px;
}

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */

.btn-primary {
  width: 100%;
  padding: 18px;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color 0.15s;
}

.btn-secondary:hover {
  color: var(--yellow);
}

/* ─── HOW TO ────────────────────────────────────────────────────────────────── */

.how-to {
  background: var(--card);
  border-radius: 14px;
  padding: 18px 20px;
  width: 100%;
  border: 1px solid var(--border);
}

.how-to-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.how-to-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── DIFFICULTY BAR ────────────────────────────────────────────────────────── */

.diff-bar-wrap {
  width: 100%;
  margin-bottom: 4px;
}

.diff-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.diff-bar-title {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.diff-bar-value {
  font-size: 11px;
  color: var(--yellow);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.diff-bar-track {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.diff-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ─── GAME HEADER ───────────────────────────────────────────────────────────── */

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

.lives {
  display: flex;
  gap: 4px;
}

.heart {
  font-size: 22px;
}

.heart.lost {
  filter: grayscale(1);
  opacity: 0.2;
}

.score-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 700;
}

.streak-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
}

.home-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.home-btn:hover {
  color: var(--yellow);
}

/* ─── GAME BODY ─────────────────────────────────────────────────────────────── */

.game-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.mechanic-badge {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
}

.word-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: opacity 0.15s;
}

.speak-btn:hover {
  opacity: 0.9;
}

.speak-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
  margin-top: 14px;
}

.speak-btn-small:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

.cat-tag {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.def-text {
  font-size: 20px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
}

/* ─── SCRAMBLE ──────────────────────────────────────────────────────────────── */

.scramble-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.s-letter {
  width: 38px;
  height: 46px;
  background: var(--yellow);
  color: var(--black);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, opacity 0.1s;
}
.s-letter:active { transform: scale(0.92); }

.scramble-text-display {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px dashed var(--yellow);
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.18em;
  flex-wrap: wrap;
}
.scramble-placed { color: var(--yellow); }
.scramble-empty  { color: var(--muted);  }
.scramble-hint-slot { color: var(--text); opacity: 0.55; }

.scramble-undo-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 4px 12px;
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.scramble-undo-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text); }
.scramble-undo-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── LETTER GAP ────────────────────────────────────────────────────────────── */

.gap-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.gap-tile-sm .gap-input, .gap-tile-sm .gap-letter { width: 26px; height: 32px; font-size: 14px; }
.gap-tile-md .gap-input, .gap-tile-md .gap-letter { width: 30px; height: 36px; font-size: 16px; }

.gap-letter {
  width: 34px;
  height: 42px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.gap-letter.shown {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--yellow);
}

.gap-letter.hidden {
  background: #1f1a00;
  border: 2px dashed #444;
  color: transparent;
}

.gap-instruction {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.gap-input {
  width: 34px;
  height: 42px;
  background: #1f1a00;
  border: 2px dashed #555;
  border-radius: 7px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  text-transform: uppercase;
  padding: 0;
  caret-color: transparent;
}

.gap-input:focus {
  border-color: var(--yellow);
  border-style: solid;
}

.gap-active {
  border-color: var(--yellow) !important;
  background: rgba(251, 191, 36, 0.12);
}

.gap-input.gap-hinted {
  background: #2a2000;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  opacity: 0.85;
  cursor: default;
}

body.day .gap-input.gap-hinted {
  background: #fef08a;
  border: 2px solid #b45309;
  color: #92400e;
}

/* ─── ONE LETTER OFF ────────────────────────────────────────────────────────── */

.olo-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.olo-tile-sm .olo-letter { width: 28px; height: 36px; font-size: 14px; padding: 0; }
.olo-tile-md .olo-letter { width: 32px; height: 40px; font-size: 16px; padding: 0; }

.olo-letter {
  width: 36px;
  height: 44px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--yellow);
  cursor: pointer;
  transition: all 0.15s;
}

.olo-letter:hover {
  border-color: var(--yellow);
  background: #1f1a00;
}

.olo-letter.selected-wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fff;
}

.olo-letter.confirmed-wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fff;
  cursor: default;
}

.olo-letter.confirmed-right {
  background: #14532d;
  border-color: #22c55e;
  color: #fff;
  cursor: default;
}

.olo-fix-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.olo-fix-label {
  font-size: 13px;
  color: var(--muted);
}

.olo-fix-input {
  width: 52px;
  height: 52px;
  background: var(--card);
  border: 2px solid var(--yellow);
  border-radius: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--yellow);
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  text-transform: uppercase;
}

.olo-submit {
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  height: 52px;
  font-size: 20px;
  cursor: pointer;
  font-weight: 700;
}

.olo-instruction {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* ─── FEEDBACK ──────────────────────────────────────────────────────────────── */

.feedback {
  border-radius: 12px;
  padding: 13px 16px;
  text-align: center;
  font-size: 14px;
  color: #fff;
}

.feedback.correct {
  background: #14532d;
}

.feedback.try {
  background: #78350f;
}

.feedback.wrong {
  background: #7f1d1d;
}

/* ─── HINT ──────────────────────────────────────────────────────────────────── */

.hint-box {
  background: var(--card);
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint-label {
  color: var(--yellow);
  font-weight: 600;
}

.hint-text {
  font-size: 13px;
  color: #bbb;
  line-height: 1.6;
}

/* ─── INPUT ─────────────────────────────────────────────────────────────────── */

.input-row {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 17px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--yellow);
}

.submit-btn {
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 22px;
  cursor: pointer;
  font-weight: 700;
  min-width: 54px;
  transition: opacity 0.15s;
}

.submit-btn:hover {
  opacity: 0.9;
}

.hint-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 100%;
  transition: color 0.15s;
}

.hint-btn:hover {
  color: var(--yellow);
}

.skip-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 100%;
  cursor: pointer;
  transition: color 0.15s;
}

.skip-btn:hover {
  color: #ef4444;
}

/* ─── LOADING ───────────────────────────────────────────────────────────────── */

.loading-wrap {
  text-align: center;
  padding: 60px 0;
}

.loading-bee {
  font-size: 48px;
  animation: float 1.5s ease-in-out infinite;
}

.loading-text {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
  letter-spacing: 0.5px;
}

/* ─── GAME OVER ─────────────────────────────────────────────────────────────── */

.gameover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.gameover-bee {
  font-size: 72px;
  line-height: 1;
}

.gameover-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
}

.gameover-score {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 72px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.gameover-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.gameover-cat {
  font-size: 14px;
  color: var(--muted);
}

.new-best {
  font-size: 15px;
  color: var(--yellow);
}

/* ─── TOAST ─────────────────────────────────────────────────────────────────── */

#toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--yellow);
  color: var(--black);
  padding: 12px 24px;
  border-radius: 40px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 1000;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── CELEBRATION ───────────────────────────────────────────────────────────── */

#celebration {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  z-index: 999;
}

#celebration.show {
  display: flex;
  animation: fadeInOut 1.5s ease forwards;
}

.celeb-emoji {
  font-size: 56px;
  animation: bounce 0.5s ease infinite alternate;
}

/* ─── ANIMATIONS ────────────────────────────────────────────────────────────── */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-20px); }
}

@keyframes fadeInOut {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

.shake {
  animation: shake 0.3s ease;
}

/* ─── MODE SELECT ───────────────────────────────────────────────────────────── */

.mode-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.mode-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 16px;
}

.mode-btn:hover {
  border-color: var(--yellow);
}

.mode-btn.spelling:hover {
  border-color: var(--yellow);
  background: #1f1a00;
}

.mode-btn.quiz {
  border-color: #2a4a7f;
}

.mode-btn.quiz:hover {
  border-color: #4a7abf;
  background: #0d1f3c;
}

.mode-btn.audio {
  border-color: #2a5a4a;
}

.mode-btn.audio:hover {
  border-color: #4abf9a;
  background: #0d2d22;
}

.mode-btn.math {
  border-color: #4a2a7f;
}

.mode-btn.math:hover {
  border-color: #8a5abf;
  background: #1a0d3c;
}

.mode-btn.math .mode-title {
  color: #b89aff;
}

body.day .mode-btn.math {
  border-color: #c4b5fd;
}

body.day .mode-btn.math:hover {
  border-color: #7c3aed;
  background: #f5f3ff;
}

body.day .mode-btn.math .mode-title {
  color: #5b21b6;
}

.mode-btn.mixed {
  padding: 14px 20px;
  border-style: dashed;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.mode-btn.mixed:hover {
  border-color: #666;
  color: var(--text);
}

.mode-icon {
  font-size: 32px;
  line-height: 1;
}

.mode-info {
  flex: 1;
}

.mode-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1.2;
}

.mode-btn.quiz .mode-title {
  color: #7aadff;
}

.mode-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.mode-arrow {
  font-size: 20px;
  color: var(--muted);
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.5px;
  transition: color 0.15s;
  align-self: flex-start;
}

.back-btn:hover {
  color: var(--yellow);
}

.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.cat-btn.quiz-mode {
  border-color: #2a4a7f;
  background: #0d1f3c;
  color: #7aadff;
}

.cat-btn.quiz-mode:hover {
  border-color: #4a7abf;
  background: #162d52;
  color: #a8cbff;
}

/* ─── TRIVIA CATEGORY SCREEN ────────────────────────────────────────────────── */

.trivia-header {
  text-align: center;
  padding: 8px 0 20px;
}

.trivia-header-emoji {
  font-size: 40px;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}

.trivia-header-title {
  font-size: 26px;
  font-weight: 900;
  color: #7aadff;
  margin: 0 0 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.trivia-header-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.trivia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.trivia-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 2px solid;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  text-align: left;
  gap: 4px;
}

.trivia-cat-btn:active {
  transform: scale(0.97);
}

.trivia-cat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 4px;
}

.trivia-cat-emoji {
  font-size: 28px;
  line-height: 1;
}

.trivia-cat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  color: inherit;
  opacity: 0.85;
  white-space: nowrap;
}

.trivia-cat-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.trivia-cat-hook {
  font-size: 11px;
  opacity: 0.7;
  line-height: 1.3;
}

/* Per-category color themes */
.trivia-teal   { border-color: #0d9488; background: rgba(13,148,136,0.08);  color: #2dd4bf; }
.trivia-blue   { border-color: #2563eb; background: rgba(37,99,235,0.08);   color: #7aadff; }
.trivia-purple { border-color: #7c3aed; background: rgba(124,58,237,0.08);  color: #c4b5fd; }
.trivia-orange { border-color: #ea580c; background: rgba(234,88,12,0.08);   color: #fb923c; }
.trivia-amber  { border-color: #d97706; background: rgba(217,119,6,0.08);   color: #fbbf24; }
.trivia-rose   { border-color: #e11d48; background: rgba(225,29,72,0.08);   color: #f87171; }

.trivia-teal:active   { box-shadow: 0 0 16px rgba(13,148,136,0.3);  }
.trivia-blue:active   { box-shadow: 0 0 16px rgba(37,99,235,0.3);   }
.trivia-purple:active { box-shadow: 0 0 16px rgba(124,58,237,0.3);  }
.trivia-orange:active { box-shadow: 0 0 16px rgba(234,88,12,0.3);   }
.trivia-amber:active  { box-shadow: 0 0 16px rgba(217,119,6,0.3);   }
.trivia-rose:active   { box-shadow: 0 0 16px rgba(225,29,72,0.3);   }

/* Day mode overrides */
body.day .trivia-header-title { color: #1d4ed8; }
body.day .trivia-teal   { border-color: #0d9488; background: #f0fdfa; color: #0f766e; }
body.day .trivia-blue   { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
body.day .trivia-purple { border-color: #7c3aed; background: #f5f3ff; color: #5b21b6; }
body.day .trivia-orange { border-color: #ea580c; background: #fff7ed; color: #c2410c; }
body.day .trivia-amber  { border-color: #d97706; background: #fffbeb; color: #92400e; }
body.day .trivia-rose   { border-color: #e11d48; background: #fff1f2; color: #9f1239; }
body.day .trivia-cat-badge { background: rgba(0,0,0,0.08); }

/* ─── DAY MODE ──────────────────────────────────────────────────────────────── */

body.day {
  --yellow: #b45309;
  --black: #fffbeb;
  --card: #ffffff;
  --border: #fde68a;
  --muted: #78716c;
  --text: #1c1917;
}

/* Inputs hardcoded to white text — override for readability on light bg */
body.day input[type="text"] {
  color: var(--text);
}

body.day .gap-input {
  background: #fef9c3;
  border: 2px dashed #d4a800;
  color: var(--text);
}

body.day .gap-input:focus {
  border-color: var(--yellow);
}

body.day .gap-letter.hidden {
  background: #fef9c3;
  border: 2px dashed #d4a800;
}

/* Game-over score was hardcoded white — invisible on light bg */
body.day .gameover-score {
  color: var(--text);
}

/* Hint text was hardcoded #bbb — too light on white cards */
body.day .hint-text {
  color: var(--muted);
}

/* Dark hover/selected backgrounds swap to warm yellow-tint */
body.day .cat-btn.selected {
  background: #fef9c3;
}

body.day .mode-btn.spelling:hover {
  background: #fef9c3;
}

body.day .olo-letter:hover {
  background: #fef9c3;
}

/* Quiz blue theme — dark blues become light blues on white */
body.day .mode-btn.quiz {
  border-color: #93c5fd;
}

body.day .mode-btn.quiz:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

body.day .mode-btn.quiz .mode-title {
  color: #1d4ed8;
}

body.day .mode-btn.audio {
  border-color: #6ee7b7;
}

body.day .mode-btn.audio:hover {
  border-color: #10b981;
  background: #ecfdf5;
}

body.day .mode-btn.audio .mode-title {
  color: #065f46;
}

body.day .cat-btn.quiz-mode {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

body.day .cat-btn.quiz-mode:hover {
  border-color: #3b82f6;
  background: #dbeafe;
  color: #1e40af;
}

body.day .cat-btn.capitals-mode {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

body.day .cat-btn.capitals-mode:hover {
  border-color: #3b82f6;
  background: #dbeafe;
  color: #1e40af;
}

/* ─── HOME TABS ─────────────────────────────────────────────────────────────── */

.home-tabs {
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.tab-pill {
  flex: 1;
  padding: 8px 24px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-pill.active {
  background: var(--yellow);
  color: var(--black);
}

/* ─── STATS PAGE ────────────────────────────────────────────────────────────── */

.stats-streak-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stats-streak-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
}

.stats-streak-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding-bottom: 8px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card.muted {
  opacity: 0.45;
}

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

.stat-card-emoji {
  font-size: 20px;
  line-height: 1;
}

.stat-card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--yellow);
}

.stat-card-unplayed {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.stat-card-best {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
}

.stat-card-diff {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card-diff-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  min-width: 52px;
}

.stat-mini-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.stat-mini-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 2px;
}

.stat-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ─── DAY THEME: STATS ──────────────────────────────────────────────────────── */

body.day .tab-pill.active {
  background: var(--yellow);
  color: #1a1a1a;
}

body.day .tab-pill {
  color: #888;
}

body.day .stat-card {
  background: #fff;
  border-color: #e5e7eb;
}

body.day .stat-card-name {
  color: #1a1a1a;
}

body.day .stat-card-best {
  color: #1a1a1a;
}

body.day .stat-mini-bar {
  background: #e5e7eb;
}

body.day .stat-mini-bar-fill {
  background: #1a1a1a;
}

/* ─── VISUAL SIMPLIFICATION ─────────────────────────────────────────────────── */

/* Word card — keep as the one prominent container but lighten it */
.word-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
}

/* Hint box — just text, no competing frame */
.hint-box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mechanic badge — whisper-quiet tag */
.mechanic-badge {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  opacity: 0.6;
}

/* Difficulty bar — remove the "Difficulty" label, keep the level name */
.diff-bar-title { display: none; }

/* ─── WORD FADE-IN ───────────────────────────────────────────────────────────── */

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

.word-card-enter {
  animation: wordFadeIn 0.25s ease forwards;
}

/* ─── PROGRESSIVE CELEBRATIONS ──────────────────────────────────────────────── */

#celebration {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 40px;
  pointer-events: none;
  z-index: 999;
}

#celebration.show {
  display: flex;
}

#celebration.tier-1 { animation: fadeInOut 0.9s ease forwards; }
#celebration.tier-2 { animation: fadeInOut 1.3s ease forwards; }
#celebration.tier-3 { animation: fadeInOut 1.8s ease forwards; }

.celeb-emoji {
  animation: celebBounce 0.4s ease infinite alternate;
  display: inline-block;
}

@keyframes celebBounce {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-18px) scale(1.15); }
}

/* ─── RESPONSIVE LAYOUT ──────────────────────────────────────────────────────── */

/* Desktop: phone-in-center feel */
@media (min-width: 600px) {
  body {
    align-items: flex-start;
    padding-top: 48px;
  }
  #app {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* Mobile: full-bleed, input always visible, no page scroll */
@media (max-width: 599px) {
  body {
    padding: 0;
    align-items: flex-start;
    overflow: hidden;
    height: 100dvh;
  }
  #app {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    overflow: hidden;
  }
  .game-screen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 14px 16px 0;
    overflow: hidden;
  }
  .game-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .game-footer {
    flex-shrink: 0;
    background: var(--black);
    padding: 10px 0 max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .home, .gameover {
    padding: 24px 20px;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Word card grows to fill available space — no dead zone between card and input */
  .word-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 16px;
  }
  .score-num {
    font-size: 26px;
  }
  .game-header {
    margin-bottom: 6px;
  }
}

/* Desktop: keep existing layout, no game-footer stickiness needed */
@media (min-width: 600px) {
  .game-screen {
    display: block;
    padding: 0;
  }
  .game-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

/* ─── BLITZ TIMER ────────────────────────────────────────────────────────────── */

.blitz-timer-wrap {
  width: 100%;
  margin-bottom: 4px;
  position: relative;
}

.blitz-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.blitz-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 4px;
  transition: width 0.1s linear, background 0.5s ease;
}

.blitz-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.blitz-time-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.blitz-time-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.5px;
  min-width: 28px;
  text-align: right;
}

.blitz-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
  background: #1f1a00;
  border: 1px solid #3a3000;
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
}

/* ─── BLITZ COUNTDOWN ────────────────────────────────────────────────────────── */

.blitz-countdown-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 20px;
  text-align: center;
}

.countdown-num {
  font-size: 120px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
  animation: countPop 0.3s ease;
}

@keyframes countPop {
  0%   { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.countdown-go {
  font-size: 64px;
  font-weight: 900;
  color: var(--yellow);
  animation: countPop 0.25s ease;
}

/* ─── BLITZ HERO CARD (STATS PAGE) ──────────────────────────────────────────── */

.blitz-hero-card {
  background: #1f1a00;
  border: 2px solid var(--yellow);
  border-radius: 20px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blitz-hero-card.muted {
  opacity: 0.4;
}

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

.blitz-hero-emoji {
  font-size: 24px;
  line-height: 1;
}

.blitz-hero-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--yellow);
  flex: 1;
}

.blitz-toggle {
  display: flex;
  background: var(--black);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  border: 1px solid #3a3000;
}

.blitz-toggle-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.15s, color 0.15s;
}

.blitz-toggle-btn.active {
  background: var(--yellow);
  color: var(--black);
}

.blitz-hero-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.blitz-hero-num {
  font-size: 52px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
}

.blitz-hero-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.blitz-hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ─── SHARE CARD ─────────────────────────────────────────────────────────────── */

.share-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.share-btn {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}

.share-btn:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ─── HOME BLITZ BUTTON ──────────────────────────────────────────────────────── */

.mode-btn.blitz {
  border-color: #3a3000;
  background: #1a1600;
  color: var(--yellow);
  font-weight: 700;
  justify-content: center;
  text-align: center;
  padding: 16px 20px;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.mode-btn.blitz:hover {
  border-color: var(--yellow);
  background: #1f1a00;
}

/* ─── DAY THEME UPDATES ──────────────────────────────────────────────────────── */

body.day .hint-box {
  background: transparent;
  border: none;
}

body.day .hint-text {
  color: #555;
}

body.day .blitz-hero-card {
  background: #fffbe6;
  border-color: #d4a000;
}

body.day .blitz-hero-name,
body.day .blitz-hero-num {
  color: #1a1a1a;
}

body.day .blitz-toggle {
  background: #fff;
  border-color: #e5c000;
}

body.day .blitz-time-num {
  color: #1a1a1a;
}

body.day .blitz-bar-fill {
  background: #d4a000;
}

body.day .blitz-badge {
  background: #fffbe6;
  border-color: #e5c000;
  color: #7a5800;
}

body.day .share-card {
  background: #fff;
  border-color: #e5e7eb;
}

body.day .mode-btn.blitz {
  background: #fffbe6;
  border-color: #e5c000;
  color: #7a5800;
}

body.day .mode-btn.blitz:hover {
  background: #fff3b0;
  border-color: #d4a000;
}

body.day .game-footer {
  background: #f9f9f9;
  border-top-color: #e5e7eb;
}

/* ─── MULTIPLE CHOICE ────────────────────────────────────────────────────────── */

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 4px 0;
}

.mc-options-math {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mc-options-math .mc-btn {
  width: 100%;
  min-height: 56px;
  font-size: 1.2rem;
}

.mc-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mc-btn:hover:not(:disabled) {
  background: var(--border);
  border-color: var(--yellow);
  transform: translateY(-1px);
}

.mc-btn:disabled {
  cursor: default;
}

.mc-btn.mc-correct {
  background: #14532d;
  border-color: #22c55e;
  color: #bbf7d0;
}

.mc-btn.mc-wrong {
  background: #450a0a;
  border-color: #ef4444;
  color: #fecaca;
}

.mc-flag-emoji {
  font-size: 32px;
  line-height: 1;
}

.mc-flag-label {
  font-size: 14px;
  font-weight: 600;
}

body.day .mc-btn {
  background: #ffffff;
  border-color: #e5e7eb;
  color: var(--text);
}

body.day .mc-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: var(--yellow);
}

body.day .mc-btn.mc-correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

body.day .mc-btn.mc-wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

/* ─── OLO LETTER GRID ───────────────────────────────────────────────────────── */

.olo-fix-section {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.olo-key-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 320px;
}

.olo-key {
  width: 36px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--yellow);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.olo-key:hover {
  border-color: var(--yellow);
  background: #1f1a00;
}

.olo-key:active {
  transform: scale(0.93);
}

body.day .olo-key {
  background: #fff;
  border-color: #e5e7eb;
  color: #1a1a1a;
}

body.day .olo-key:hover {
  border-color: var(--yellow);
  background: #fef9c3;
}

/* ─── BUILT-IN QWERTY KEYBOARD ──────────────────────────────────────────────── */

.builtin-keyboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 8px 0 2px;
}

.kb-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.kb-key {
  width: 30px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.kb-key:active {
  background: var(--border);
}

.kb-backspace {
  width: 44px;
  font-size: 16px;
}

.kb-submit {
  width: 44px;
  font-size: 18px;
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}

.kb-submit:active {
  opacity: 0.85;
}

.kb-space {
  width: 200px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

body.day .kb-key {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1a1a1a;
}

body.day .kb-key:active {
  background: #e5e7eb;
}

body.day .kb-submit {
  background: var(--yellow);
  color: #1a1a1a;
  border-color: var(--yellow);
}

/* Hint tiles */
.hint-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0 4px;
}

.hint-tile {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.hint-tile.blank {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
}

.hint-tile.revealed {
  background: var(--yellow);
  color: #1a1a1a;
  border: 2px solid var(--yellow);
}

body.day .hint-tile.blank {
  background: #f3f4f6;
  border-color: #d1d5db;
}

body.day .hint-tile.revealed {
  background: var(--yellow);
  color: #1a1a1a;
  border-color: var(--yellow);
}

/* ─── MATH KEYBOARD ─────────────────────────────────────────────────────────── */

.math-display {
  font-size: 42px;
  font-weight: 800;
  text-align: center;
  color: var(--yellow);
  letter-spacing: 2px;
  min-height: 56px;
  margin: 16px 0 8px;
}

.math-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.math-key {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 18px 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s;
}

.math-key:active {
  background: var(--yellow);
  color: #000;
}

.math-key.del-key {
  color: var(--muted);
}

.math-key.dec-key {
  color: var(--yellow);
  font-weight: 700;
  font-size: 22px;
}

.math-key.submit-key {
  grid-column: 1 / -1;
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

.math-key.submit-key:active {
  opacity: 0.85;
}

body.day .math-key {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1a1a1a;
}

body.day .math-key:active {
  background: var(--yellow);
  color: #000;
}

/* ─── TYPEWRITER MECHANIC ───────────────────────────────────────────────────── */

.typewriter-display {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--yellow);
  text-align: center;
  min-height: 56px;
  margin: 16px 0 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: opacity 0.3s ease;
}

.typewriter-display.tw-done {
  opacity: 0.25;
  letter-spacing: 8px;
  color: var(--muted);
}

.tw-instruction {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* ─── BEEBLITZ HERO CARD ────────────────────────────────────────────────────── */

.beeblitz-hero {
  width: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid var(--yellow);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 20px rgba(255, 209, 0, 0.15);
}

.beeblitz-hero:active {
  transform: scale(0.98);
  box-shadow: 0 0 30px rgba(255, 209, 0, 0.3);
}

.beeblitz-hero-inner {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 14px;
}

.beeblitz-icon {
  font-size: 32px;
  line-height: 1;
  animation: beeblitz-pulse 2s ease-in-out infinite;
}

@keyframes beeblitz-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.beeblitz-text {
  flex: 1;
  text-align: left;
}

.beeblitz-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--yellow);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.5px;
}

.beeblitz-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.beeblitz-arrow {
  font-size: 28px;
  color: var(--yellow);
  opacity: 0.7;
  font-weight: 300;
}

.beeblitz-best-row {
  background: rgba(255, 209, 0, 0.08);
  border-top: 1px solid rgba(255, 209, 0, 0.2);
  padding: 8px 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.beeblitz-best-label {
  font-size: 12px;
  color: var(--yellow);
  opacity: 0.8;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.beeblitz-best-sep {
  font-size: 12px;
  color: var(--muted);
}

.cat-blitz-tag {
  display: block;
  font-size: 11px;
  color: var(--yellow);
  opacity: 0.7;
  margin-top: 2px;
  font-weight: 600;
}

.cat-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.blitz-hero-your-best {
  display: block;
  font-size: 10px;
  color: var(--yellow);
  opacity: 0.6;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ─── STATS PREFERENCES PANEL ───────────────────────────────────────────────── */

.prefs-panel {
  width: 100%;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}

.pref-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pref-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pref-row-sub {
  font-size: 12px;
  color: var(--muted);
}

.pref-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.2s;
}

.pref-toggle.on {
  background: #22c55e;
}

.pref-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pref-toggle.on .pref-toggle-thumb {
  transform: translateX(18px);
}

body.day .prefs-panel {
  border-top-color: rgba(0,0,0,0.08);
}

body.day .pref-toggle {
  background: rgba(0,0,0,0.12);
}

/* ─── STATS RESET PANEL ─────────────────────────────────────────────────────── */

.reset-panel {
  width: 100%;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.reset-panel-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: center;
}

.reset-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reset-option-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.reset-option-btn:active {
  border-color: #ef4444;
  color: #ef4444;
}

.reset-confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 10px 14px;
}

.reset-confirm-label {
  flex: 1;
  font-size: 13px;
  color: #ef4444;
  font-weight: 600;
}

.reset-confirm-yes {
  background: #ef4444;
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.reset-confirm-no {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

body.day .reset-option-btn {
  border-color: rgba(0,0,0,0.12);
  color: #666;
}

body.day .reset-panel {
  border-top-color: rgba(0,0,0,0.08);
}

/* ─── BEEBLITZ HERO BUTTON — DAY MODE ──────────────────────────────────────── */

body.day .beeblitz-hero {
  background: linear-gradient(135deg, #fffbe6 0%, #fef3c7 50%, #fde68a 100%);
  box-shadow: 0 0 20px rgba(180, 83, 9, 0.12);
}

body.day .beeblitz-hero:active {
  box-shadow: 0 0 30px rgba(180, 83, 9, 0.28);
}

body.day .beeblitz-best-row {
  background: rgba(180, 83, 9, 0.06);
  border-top-color: rgba(180, 83, 9, 0.2);
}

/* ─── WORD SEARCH MECHANIC ──────────────────────────────────────────────────── */

.ws-wrap {
  position: relative;
  margin: 0 auto;
  touch-action: none;
}

.ws-grid {
  display: grid;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.ws-cell {
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: inherit;
  color: var(--text);
  border-radius: 5px;
  border: 1.5px solid var(--border);
  box-sizing: border-box;
  cursor: pointer;
  transition: color 0.1s;
}

.ws-cell.ws-selected {
  color: var(--yellow);
}

.ws-cell.ws-hint-cell {
  background: var(--border);
  color: var(--yellow);
  border-color: var(--yellow);
  opacity: 0.75;
}

.ws-cell.ws-wrong {
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  animation: ws-wrong-flash 0.6s ease-out;
}

@keyframes ws-wrong-flash {
  0%   { background: rgba(239,68,68,0.22); }
  100% { background: var(--card); }
}

.ws-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ─── CONTINUE MODAL ─────────────────────────────────────────────────────────── */

.continue-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.continue-modal-card {
  max-width: 340px;
  width: 100%;
}

.continue-modal-btns {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.continue-modal-btns .btn-primary,
.continue-modal-btns .btn-secondary {
  flex: 1;
  width: auto;
}
