:root {
  --color-correct: #6aaa64;
  --color-present: #c9b458;
  --color-absent: #787c7f;
  --tile-border: #d3d6da;
  --tile-border-filled: #878a8c;
  --key-bg: #d3d6da;
  --key-text: #1a1a1b;
  --text: #1a1a1b;
  --muted: #6b6f70;
  --bg: #ffffff;
  --card-bg: #f7f7f8;
  --accent: #538d4e;
  --danger: #d93838;
  --border-radius: 8px;
}

:root[data-theme="dark"] {
  --tile-border: #3a3a3c;
  --tile-border-filled: #565758;
  --key-bg: #565758;
  --key-text: #d7dadc;
  --text: #d7dadc;
  --muted: #9aa0a6;
  --bg: #121213;
  --card-bg: #1e1e1f;
}
:root[data-theme="dark"] .glyph-stroke { stroke: #b8b5ad; }
:root[data-theme="dark"] .glyph-fill { fill: #b8b5ad; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--tile-border);
}

.brand {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.brand span { color: var(--accent); }

.tabs { display: flex; gap: 8px; }

.tab-btn {
  background: none;
  border: 1px solid var(--tile-border);
  border-radius: 8px;
  padding: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.tab-btn svg { width: 20px; height: 20px; }
.tab-btn.active { background: var(--text); color: #fff; border-color: var(--text); }

.view { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---------- Auth ---------- */
.auth-view {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse 700px 420px at 50% 0%, rgba(106, 170, 100, 0.08), transparent 70%);
}
.auth-card {
  max-width: 380px;
  width: 100%;
  padding: 40px 32px 32px;
  border-radius: 16px;
  text-align: center;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  animation: auth-card-in 0.4s ease both;
}
:root[data-theme="dark"] .auth-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
}
@keyframes auth-card-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.auth-logo { width: 52px; height: 52px; margin-bottom: 18px; }
.auth-title { margin: 0 0 10px; font-size: 1.5rem; }
.auth-card > .muted { margin: 0 0 26px; font-size: 0.92rem; line-height: 1.5; }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--tile-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.google-btn:hover {
  background: var(--card-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.auth-fineprint { font-size: 0.78rem; color: var(--muted); margin: 18px 0 0; }

#pickUsernameForm { display: flex; flex-direction: column; gap: 14px; text-align: left; }
#pickUsernameForm label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
#pickUsernameForm input {
  padding: 10px 12px; border: 1px solid var(--tile-border); border-radius: 6px; font-size: 1rem;
  background: var(--bg); color: var(--text);
}
.auth-error { color: var(--danger); font-size: 0.85rem; min-height: 1em; margin: 0; }

.primary-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 12px; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.primary-btn:disabled { opacity: 0.6; cursor: default; }
.secondary-btn {
  background: var(--bg); color: var(--text); border: 1px solid var(--tile-border); border-radius: 6px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.secondary-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Already played today ---------- */
.already-played {
  max-width: 340px;
  margin: 20px auto 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.already-played-logo { width: 44px; height: 44px; margin-bottom: 6px; }
.already-played h2 { margin: 0; font-size: 1.5rem; }
.already-played p { margin: 0 0 6px; }
.already-played .primary-btn { padding: 10px 24px; }

/* ---------- Game board ---------- */
#view-game.view {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.game-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.2svh, 20px);
}

.board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 5px;
  width: min(300px, 88vw, 38svh);
}
.board-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }

.tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--tile-border);
  color: var(--text);
  user-select: none;
  perspective: 500px;
}
.tile.filled { border-color: var(--tile-border-filled); }
.tile.pop { animation: pop 0.1s ease; }

.tile.correct { background: var(--color-correct); border-color: var(--color-correct); color: #fff; }
.tile.present { background: var(--color-present); border-color: var(--color-present); color: #fff; }
.tile.absent { background: var(--color-absent); border-color: var(--color-absent); color: #fff; }

.tile.flip { animation: flip 0.5s ease forwards; }
.tile.bounce { animation: bounce 0.6s ease; }
.board-row.shake { animation: shake 0.5s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes flip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}
@keyframes bounce {
  0%, 20% { transform: translateY(0); }
  40% { transform: translateY(-18px); }
  60% { transform: translateY(0); }
  80% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.keyboard { display: flex; flex-direction: column; gap: clamp(4px, 1svh, 8px); width: min(500px, 96vw); }
.keyboard-row { display: flex; gap: 6px; justify-content: center; }
.key {
  flex: 1;
  max-width: 44px;
  height: clamp(34px, 6svh, 54px);
  border: none;
  border-radius: 4px;
  background: var(--key-bg);
  color: var(--key-text);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: uppercase;
}
.key.wide { max-width: 66px; font-size: 0.7rem; }
.key.correct { background: var(--color-correct); color: #fff; }
.key.present { background: var(--color-present); color: #fff; }
.key.absent { background: var(--color-absent); color: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

/* ---------- Profile ---------- */
.profile-wrap h2 { margin-bottom: 4px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.stat-tile {
  border: 1px solid var(--tile-border);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.stat-tile .num { font-size: 1.6rem; font-weight: 800; display: block; }
.stat-tile .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.modal.settings-modal { text-align: left; max-width: 400px; }
.settings-modal h2 { margin-top: 0; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--tile-border);
  padding: 18px 0;
}
.settings-row:first-of-type { border-top: none; padding-top: 20px; }
.settings-row .muted { margin: 4px 0 0; font-size: 0.85rem; }
.settings-row-column { flex-direction: column; align-items: stretch; }
.grace-note { font-size: 0.8rem; color: var(--muted); margin: -10px 0 0; padding-bottom: 4px; }

.username-form { display: flex; gap: 8px; margin-top: 8px; }
.username-form input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--tile-border); border-radius: 6px;
  font-size: 1rem; background: var(--bg); color: var(--text);
}
#usernameError { margin: 6px 0 0; text-align: left; }

#reminderTimeRow { gap: 6px; }
#reminderTimeInput {
  padding: 10px 12px; border: 1px solid var(--tile-border); border-radius: 6px;
  font-size: 1rem; background: var(--bg); color: var(--text); align-self: flex-start;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--tile-border);
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.toggle-switch.on { background: var(--accent); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.toggle-switch.on .toggle-knob { transform: translateX(20px); }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 18px 10px;
  margin-top: 12px;
}
/* No card, no border — just the icon and its name, like NYT's own badge strip.
   Tier is conveyed by each icon's own artwork (numeral hex gold ring, etc.), not a wrapper. */
.badge {
  position: relative;
  text-align: center;
  opacity: 0.4;
  filter: grayscale(1);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.badge:hover { transform: translateY(-2px); opacity: 0.6; }
.badge.unlocked:hover { opacity: 1; }
.badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.badge.unlocked { opacity: 1; filter: none; }
.badge .icon { display: block; width: 56px; height: 56px; margin: 0 auto 6px; }
.badge .icon svg { width: 100%; height: 100%; display: block; }
.badge .name { font-weight: 600; font-size: 0.74rem; line-height: 1.2; min-height: 2.4em; display: flex; align-items: flex-start; justify-content: center; }

/* ==========================================================================
   Badge "hero" presentation: no card, no border — just the medallion itself.
   Used for the unlock-celebration page and the badge detail modal. Static at
   rest; the only motion is a one-shot pop + confetti burst fired from JS when
   the view opens for an unlocked badge (see .confetti-particle below).
   ========================================================================== */
.badge-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.badge-hero .icon {
  display: block;
  width: 140px;
  height: 140px;
  position: relative;
  border-radius: 50%;
  overflow: visible;
  opacity: 0.35;
  filter: grayscale(1);
}
.badge-hero.unlocked .icon { opacity: 1; filter: none; }
.badge-hero .icon svg { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.hero-name { font-weight: 800; font-size: 1.2rem; }

/* Soft static glow behind an unlocked medallion — no border, no animation, just settles here. */
.badge-hero.unlocked .icon::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 170, 100, 0.28), rgba(106, 170, 100, 0) 72%);
  z-index: 0;
}

.badge-hero.pop-in .icon { animation: badge-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ==========================================================================
   Badge illustration styling (public/js/badge-icons.js builds the markup).
   Every badge's SVG has its own animated parts, not just a whole-icon wiggle.
   ========================================================================== */
.badge-icon-svg { overflow: visible; }
.medallion-bg { fill: var(--card-bg); }
.badge.locked-badge .medallion-bg,
.badge:not(.unlocked) .medallion-bg { fill: #ececeb; }

.glyph-stroke { fill: none; stroke: #57534e; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glyph-fill { fill: #57534e; }
.glyph-fill-soft { fill: #fdfcf8; }
.glyph-fill-light { fill: #fdfcf8; }
.tile-letter { font-size: 11px; font-weight: 800; fill: #57534e; font-family: inherit; }

.numeral-hex { fill: #e2f2e4; stroke: #d4af37; stroke-width: 1.5; }
.badge:not(.unlocked) .numeral-hex { fill: #ececeb; stroke: #c7c7c5; }
.numeral-text { font-size: 12px; font-weight: 800; fill: #2d5a34; font-family: inherit; }
.badge:not(.unlocked) .numeral-text { fill: #9a9a97; }
.numeral-deco.deco-a, .numeral-deco.deco-c { fill: #d4af37; }
.numeral-deco.deco-b, .numeral-deco.deco-d { fill: #6aaa64; }
.badge:not(.unlocked) .numeral-deco { fill: #c7c7c5; }

.sparkle, .medal-star, .star-glow, .twinkle-top { fill: #e0b84c; }
.flame, .flame-outer, .flame-inner, .lava-flicker path { fill: #e2793a; }
.worm-seg { fill: #8bb86a; }
.smoke { fill: #c6c6c4; }
.confetti-a { fill: #6aaa64; }
.confetti-b { fill: #c9b458; }
.confetti-c { fill: #d97b3a; }

/* Per-badge color accents — each illustration gets its own palette instead of one flat ink tone. */
.icon-played_1 .tile-outline { stroke: #4a7c59; }
.icon-played_10 .glyph-stroke { stroke: #3a5a7a; }
.icon-played_25 .quill { stroke: #8a5a34; fill: #f3ddc0; }
.icon-played_25 .ink-trail { stroke: #8a5a34; }
.icon-played_50 rect.glyph-fill-soft:nth-of-type(1) { fill: #f6e2c6; stroke: #c98a3f; }
.icon-played_50 rect.glyph-fill-soft:nth-of-type(2) { fill: #dbe9dd; stroke: #6f9a76; }
.icon-played_50 rect.glyph-fill-soft:nth-of-type(3) { fill: #e3d7ef; stroke: #8a6bab; }
.icon-played_100 .page { stroke: #7a4a2b; fill: #f6ead9; }
.icon-streak_3 .glyph-stroke { stroke: #a9714f; }
.icon-streak_3 rect.glyph-fill-soft { fill: #f3e4c6; }
.icon-streak_14 .bolt { fill: #5b6ee1; }
.icon-streak_30 .volcano { stroke: #8a6a52; fill: #e9d9c8; }
.icon-streak_50 .burst-line { stroke: #d84f8c; }
.icon-streak_100 .spiral { stroke: #2a9d8f; }
.icon-streak_100 .spiral-tip { fill: #2a9d8f; }
.icon-streak_200 .ribbon { stroke: #b23a48; fill: #f0c6cb; }
.icon-streak_365 .wreath { stroke: #4c7a4c; fill: #d6e8d6; }

.badge-icon-svg [class] {
  transform-box: fill-box;
  transform-origin: center;
}

/* Hero icons are static (no ambient loops) — see .confetti-particle for the one-shot open animation. */
.badge-hero.unlocked .gleam { display: none; }


@keyframes badge-pop-in {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* One-shot confetti burst, spawned from JS when a hero view opens for an unlocked badge. */
.confetti-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
  animation: confetti-burst 0.85s cubic-bezier(0.2, 0.7, 0.35, 1) forwards;
}
@keyframes confetti-burst {
  0% { transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% {
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge, .badge *, .badge::before, .badge::after,
  .badge-hero, .badge-hero *, .confetti-particle {
    animation: none !important;
  }
}

/* ---------- Friends ---------- */
.friend-search { display: flex; gap: 8px; margin-bottom: 12px; }
.friend-search input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--tile-border); border-radius: 6px; font-size: 1rem;
  background: var(--bg); color: var(--text);
}
.search-results, .request-block { margin-bottom: 16px; }
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--tile-border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.person-row .name { font-weight: 700; }
.person-row .sub { font-size: 0.78rem; color: var(--muted); }
.person-row .actions { display: flex; gap: 6px; }
.mini-btn {
  border: none; border-radius: 6px; padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.mini-btn.accept { background: var(--accent); color: #fff; }
.mini-btn.decline { background: var(--tile-border); color: var(--text); }
.friends-list .person-row .streak-badge {
  background: var(--card-bg); border-radius: 20px; padding: 4px 10px; font-size: 0.78rem; font-weight: 700;
}
.holiday-pill {
  background: #fff3cd; color: #8a6d00; border-radius: 20px; padding: 2px 8px; font-size: 0.68rem; font-weight: 700; margin-left: 6px;
}

.leaderboard-row { align-items: center; }
.leaderboard-row.leaderboard-you { background: var(--card-bg); }
.leaderboard-left { display: flex; align-items: center; gap: 12px; }
.leaderboard-right { display: flex; align-items: center; gap: 10px; }
.rank-badge {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
  background: var(--card-bg); color: var(--muted);
}
.rank-badge.rank-1 { background: #c9b458; color: #fff; }
.rank-badge.rank-2 { background: #a8adb3; color: #fff; }
.rank-badge.rank-3 { background: #c2793f; color: #fff; }
.played-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--tile-border);
}
.played-dot.played { background: var(--color-correct); }

.leaderboard-row { cursor: pointer; transition: background 0.1s ease; }
.leaderboard-row:hover { background: var(--card-bg); }

.week-tabs {
  display: inline-flex;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 14px;
  gap: 2px;
}
.week-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 16px;
  cursor: pointer;
}
.week-tab.active { background: var(--bg); color: var(--text); }

.back-link {
  display: inline-block;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 300;
}
.modal {
  background: var(--bg); border-radius: 12px; padding: 28px; max-width: 380px; width: 90vw;
  position: relative; text-align: center;
  max-height: 85vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted);
}
.modal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.modal-stats div { text-align: center; }
.modal-stats .num { font-size: 1.3rem; font-weight: 800; display: block; }
.modal-stats .label { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }

.badge-page-eyebrow { font-size: 1.3rem; font-weight: 800; margin: 4px 0 20px; }
.modal-badges { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-bottom: 22px; }
#modalBadgePage .primary-btn { width: 100%; }

/* ---------- Badge progress bars (locked badges) ---------- */
.badge-progress { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 6px; }
.badge-progress-track {
  width: 100%; height: 4px; border-radius: 2px; background: var(--tile-border); overflow: hidden;
}
.badge-progress-fill { height: 100%; background: var(--muted); border-radius: 2px; }
.badge-progress-label { font-size: 0.62rem; color: var(--muted); white-space: nowrap; }
#badgeDetailHero .badge-progress { flex-direction: row; }
#badgeDetailHero .badge-progress-track { width: auto; height: 6px; }

/* ---------- Guess distribution ---------- */
.guess-dist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dist-row { display: flex; align-items: center; gap: 8px; }
.dist-label { width: 12px; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.dist-bar { flex: 1; }
.dist-fill {
  background: var(--color-absent); color: #fff; font-weight: 700; font-size: 0.78rem;
  padding: 3px 8px; border-radius: 3px; text-align: right; min-width: 22px; box-sizing: border-box;
}
.dist-fill.today { background: var(--color-correct); }

.badge-hint { margin: -4px 0 4px; font-size: 0.82rem; }
.dist-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; margin: 18px 0 8px; text-align: left; }
#modalStatsPage .guess-dist { text-align: left; }

/* ---------- Badge hero (detail modal content) ---------- */
.badge-detail-modal { max-width: 340px; }
.hero-detail { font-size: 0.85rem; margin: 4px 0 0; max-width: 280px; }
.hero-unlocked-date { font-size: 0.78rem; color: var(--muted); margin: 10px 0 0; }
.badge-hero .icon { cursor: pointer; }
#badgeDetailHero .badge-progress { width: 100%; max-width: 220px; margin-top: 6px; }

.muted { color: var(--muted); }

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
