/* Layout: one-screen app; a fixed header band and one scrolling column, max 640px wide. */
/* Museum Pop tokens: bone + globe blue + globe green, LIGHT MODE ONLY (Jude, Nov 2).
   Blue and green are sampled from the clay globe icon. Old token names kept so markup doesn't change.
   Every text pair checked at 4.5:1 or better. */
:root {
  --bg: #FAF7F2; --surface: #FFFFFF; --raised: #F3EEE6; --border: #ECE6DC;
  --text: #1F2328; --muted: #5C6370;
  --brand: #245E9E;
  --primary: #61B76A; --primary-text: #1F2328; --selected: #DCEBFA; --selected-text: #1F2328;
  --accent-text: #2563A8; --hero: #245E9E; --track: #E6DFD3; --partial: #9A6B00;
  --hero-text: #FAF7F2; --hero-muted: #CFE3F7; --hero-accent: #B7D9F5; --hero-track: rgba(250, 247, 242, 0.22); --hero-mark: #FAF7F2; --hero-ring: #7FCB86;
  --correct: #1F7A54; --correct-fill: #DDF6EA; --incorrect: #C2333B; --incorrect-fill: #FDE3E4;
  --shadow: 0 0 0 1px var(--border);
  --p1-ink: #245E9E; --p1-fill: #DCEBFA; --p2-ink: #276B32; --p2-fill: #DDF3DE;
  --p3-ink: #9A4F0E; --p3-fill: #FDE0C2; --p4-ink: #6A4FB8; --p4-fill: #EADCF7;
  --g-flags: #DCEBFA; --g-countries: #DDF3DE; --g-languages: #FCF0C8; --g-world: #E2E7FB;
  --map-land: #E9E1D3; --map-line: #FFFFFF; --map-dim: #F3EEE6;
  --font: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces Variable", "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#app { height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.col {
  max-width: 640px; margin: 0 auto; box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 40px; display: flex; flex-direction: column; gap: 20px;
}
h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; margin: 8px 0 0; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; line-height: 1.35; text-wrap: balance; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.card { background: var(--surface); border-radius: 26px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }

/* Splash */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.logo { position: relative; width: 124px; height: 124px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; transform: rotate(-6deg); }
.logo span { border-radius: 16px; transform: scale(0); animation: pop 420ms cubic-bezier(.3,1.5,.6,1) forwards; }
.logo span:nth-child(1) { background: var(--p1-fill); animation-delay: 0ms; }
.logo span:nth-child(2) { background: var(--p2-fill); animation-delay: 120ms; }
.logo span:nth-child(3) { background: var(--p3-fill); animation-delay: 240ms; }
.logo span:nth-child(4) { background: var(--p4-fill); animation-delay: 360ms; }
.logo b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 900; opacity: 0; animation: fade 300ms 600ms forwards; }
.splash-mark .gmark.spin .lg-o { /* the globe turning on its axis: a world map sliding behind a round window, shaded to look round */
  position: relative; border-radius: 50%; filter: none; overflow: hidden;
  background: url(clay/globe-spin.webp) 0 50% / 1.24em 0.62em repeat-x;
  box-shadow: inset -0.08em -0.06em 0.12em rgba(10, 30, 60, 0.45), inset 0.05em 0.04em 0.08em rgba(255, 255, 255, 0.35), 0 0.02em 0.04em rgba(0, 0, 0, 0.2);
  animation: globe-turn 2.4s linear infinite;
}
.splash-mark .gmark.spin .lg-o::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.45), rgba(255,255,255,0) 42%), radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 58%, rgba(8,24,52,0.35) 100%); }
@keyframes globe-turn { from { background-position: 0 50%; } to { background-position: 1.24em 50%; } }
@media (prefers-reduced-motion: reduce) { .splash-mark .gmark.spin .lg-o { animation-duration: 12s; } }
.splash-mark { font-size: 56px; line-height: 1.1; animation: splash-in 420ms cubic-bezier(.3,1.4,.6,1) both; }
@keyframes splash-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash-mark { animation: none; } }
.splash .title { font-family: var(--font-display); font-size: 34px; font-weight: 700; opacity: 0; animation: fade 400ms 700ms forwards; }
.splash .title em { font-style: normal; color: var(--p4-ink); }
.loadbar { width: 160px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 40%; background: var(--selected); border-radius: 3px; animation: slide 1s ease-in-out infinite; }
@keyframes pop { to { transform: scale(1); } }
@keyframes fade { to { opacity: 1; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Picker */
.group { display: flex; flex-direction: column; gap: 10px; }
.group > .eyebrow { color: var(--accent-text); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.game { text-align: left; border: 0; border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: row; align-items: center; gap: 14px; min-height: 76px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); transition: transform 120ms ease; }
.game b { font-size: 17px; }
.game .gtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.game .gblurb { font-size: 14px; color: var(--muted); line-height: 1.35; }
.game .gicon.tile { width: 56px; height: 56px; align-items: center; justify-content: center; opacity: 1; margin: 0; }
.clayimg { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(31, 35, 40, 0.10)); }
.subject .clay.clayimg { width: 112px; height: 112px; margin: 4px 0 8px; }
.game:active { transform: scale(0.98); }
.credits { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }

/* Chips & buttons */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-width: 56px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--raised); font-weight: 700; font-size: 16px; }
.chip[aria-checked="true"] { background: var(--selected); color: var(--selected-text); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.btn { min-height: 56px; border: 0; border-radius: 18px; font-weight: 700; font-size: 17px; padding: 0 20px; }
.btn.primary { background: var(--primary); color: var(--primary-text); box-shadow: var(--shadow); }
.btn.secondary { background: var(--raised); }
.btn.danger { background: var(--incorrect-fill); color: var(--incorrect); }
.btn:disabled { background: var(--raised); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.linkbtn { border: 0; background: none; padding: 10px 0; font: inherit; font-size: 15px; font-weight: 600; text-decoration: underline; cursor: pointer; align-self: center; }
.linkbtn.danger-link { color: var(--incorrect); }
#delete-confirm { min-height: 52px; border-radius: 14px; border: 2px solid var(--border); padding: 0 14px; font: inherit; font-size: 17px; letter-spacing: 0.08em; background: var(--surface); color: var(--text); }
.back { align-self: flex-start; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 8px 0; }
.hint { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* Play header */
.bar { flex: none; }
.bar .col { padding-block: 8px 0; gap: 10px; }
.pill { display: flex; align-items: center; gap: 12px; border-radius: 18px; padding: 14px 18px; }
.pill .who { flex: 1; min-width: 0; }
.pill .who b { display: block; font-size: 20px; font-weight: 800; }
.pill .who span { font-size: 14px; opacity: 0.85; font-variant-numeric: tabular-nums; }
.pill button { border: 0; background: none; font-weight: 700; color: inherit; padding: 6px; }
.progress { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--selected); border-radius: 3px; transition: width 300ms; }
.confirm { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; text-align: center; font-weight: 700; }
.confirm .row { display: flex; gap: 10px; }
.confirm .row .btn { flex: 1; }

/* Question bodies */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: left; min-height: 58px; padding: 12px 16px; border-radius: 18px; border: 2px solid var(--surface); background: var(--surface); box-shadow: var(--shadow); font-size: 17px; font-weight: 600; line-height: 1.3; }
.opt.correct { border-color: var(--correct); background: var(--correct-fill); }
.opt.wrong { border-color: var(--incorrect); background: var(--incorrect-fill); }
.opt.dim { opacity: 0.45; }
.opt { position: relative; transition: transform 120ms ease; }
.options .opt { padding-right: 52px; }
.opt:not(:disabled):active { transform: scale(0.97); }
.badge-x { position: absolute; right: 14px; top: 50%; margin-top: -14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--bg); animation: badgepop 260ms cubic-bezier(.3,1.6,.6,1) both; }
.flaggrid .badge-x { top: 10px; right: 10px; margin-top: 0; }
.badge-x svg { stroke-width: 3.4; }
.badge-x.ok { background: var(--correct); }
.badge-x.no { background: var(--incorrect); }
.opt.wrong { animation: shake 200ms ease; }
@keyframes badgepop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
h2.prompt { font-size: 28px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.segbar { display: flex; gap: 6px; }
.segbar .seg { flex: 1; height: 8px; border-radius: 4px; background: var(--track); transition: background 200ms ease; }
.segbar .seg.now { box-shadow: inset 0 0 0 2px var(--text); background: transparent; }
.segbar .seg.sG { background: var(--correct); }
.segbar .seg.sY { background: var(--partial); }
.segbar .seg.sR { background: var(--incorrect); }
.btn.primary.ink { background: var(--brand); color: var(--bg); }
.note-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.feedback .note.bonus { background: var(--surface); box-shadow: var(--shadow); border-radius: 18px; padding: 14px 16px; }
@media (prefers-reduced-motion: reduce) {
  .opt, .segbar .seg { transition: none; }
  .opt.wrong, .badge-x { animation: none; }
  .opt:not(:disabled):active { transform: none; }
}
.opt:disabled { cursor: default; }
.flaggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flaggrid .opt { padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flaggrid .opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.flaggrid .opt small { font-size: 13px; font-weight: 600; min-height: 1.2em; }
.bigflag { width: 100%; max-width: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); align-self: center; }
.zoom { position: relative; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; box-shadow: var(--shadow); align-self: center; background: var(--raised); }
.zoom img { position: absolute; max-width: none; }
.sentence { font-size: 30px; font-weight: 700; text-align: center; padding: 26px 16px; border-radius: 22px; background: var(--g-languages); line-height: 1.35; word-break: break-word; }
.mapbox { width: 100%; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.mapbox svg { display: block; width: 100%; height: auto; }
.mapbox path { fill: var(--map-land); stroke: var(--map-line); stroke-width: 0.7; vector-effect: non-scaling-stroke; }
.mapbox path.tap { cursor: pointer; }
.mapbox path.hit { fill: var(--correct); }
.mapbox path.miss { fill: var(--incorrect); }
.outline path { fill: var(--selected); stroke: var(--text); stroke-width: 1.2; }
.feedback { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.feedback b { font-size: 22px; }
.feedback b.ok { color: var(--correct); }
.feedback b.no { color: var(--incorrect); }
.note { background: var(--raised); border-radius: 14px; padding: 12px 14px; text-align: left; line-height: 1.45; font-size: 15px; }

/* Typed list */
.timer { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.typed { display: flex; gap: 8px; }
.typed input { flex: 1; min-width: 0; min-height: 52px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; padding: 0 14px; }
.typed .btn { min-height: 52px; }
.found { display: flex; flex-wrap: wrap; gap: 8px; }
.found span { padding: 8px 12px; border-radius: 999px; background: var(--correct-fill); color: var(--text); font-weight: 600; font-size: 15px; }
.found span.missed { background: var(--raised); color: var(--muted); }
.msg { min-height: 1.4em; font-weight: 600; font-size: 15px; }
.msg.ok { color: var(--correct); }
.msg.no { color: var(--incorrect); }
.count { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Results */
.trophy { font-size: 64px; text-align: center; }
.board { display: flex; flex-direction: column; gap: 8px; }
.board div { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; font-weight: 700; border: 2px solid transparent; }
.board div.win { border-color: var(--primary); box-shadow: var(--shadow); }
.board .rank { width: 32px; }
.board .nm { flex: 1; font-size: 18px; }
.board .sc { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition: none !important; }
}

/* Home: subject tiles */
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Icons only, no boxes: a puffy 3D icon with a small label under it. */
.subject { border: 0; background: var(--surface); box-shadow: var(--shadow); padding: 14px 8px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); border-radius: 22px; transition: transform 0.15s ease; }
.subject .clay { transition: transform 0.2s ease; }
.subject:not(:disabled):hover .clay, .subject:not(:disabled):focus-visible .clay { transform: translateY(-3px) scale(1.04); }
.subject:not(:disabled):active .clay { transform: scale(0.96); }
.subject b { font-size: 16px; }
.subject span { font-size: 12px; color: var(--muted); font-weight: 700; }
.subject:disabled { cursor: default; }
.subject:disabled b { color: var(--muted); }
.subject:disabled { box-shadow: none; opacity: 0.8; filter: grayscale(1); cursor: not-allowed; }
.subject:not(:disabled):active { transform: scale(0.98); }
.game:disabled { opacity: 0.55; box-shadow: none; cursor: not-allowed; }

/* Accounts */
.auth { padding-top: 40px; }
.logo.small { width: 72px; height: 72px; gap: 4px; align-self: center; }
.logo.small span { border-radius: 10px; }
.logo.small b { font-size: 38px; }
.auth input { min-height: 52px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; padding: 0 14px; }
.whoami { display: flex; align-items: center; gap: 12px; background: var(--raised); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.whoami > div { min-width: 0; overflow-wrap: anywhere; }
.whoami img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.whoami.big { background: none; padding: 0; }
.whoami.big img, .whoami.big .fab-icon { width: 56px; height: 56px; }
.fab-icon { display: grid; place-items: center; border-radius: 50%; background: var(--raised); flex: none; }

.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(31, 35, 40, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 640px; max-height: 85%; overflow-y: auto; box-sizing: border-box;
  background: var(--bg); border-radius: 26px 26px 0 0; display: flex; flex-direction: column; gap: 16px;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.col { padding-bottom: 96px; }

/* Menu button, fixed to the bottom-right corner; opens Profile / Leaderboard / Add to Home Screen */
.fab {
  position: fixed; z-index: 20;
  right: calc(max(16px, env(safe-area-inset-right, 0px)));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface); color: var(--brand); box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(31, 35, 40, 0.12);
}
.fab:active { transform: scale(0.95); }
.menu-overlay { background: rgba(31, 35, 40, 0.25); align-items: flex-end; justify-content: flex-end; }
.menu {
  display: flex; flex-direction: column; gap: 8px;
  margin-right: max(16px, env(safe-area-inset-right, 0px));
  margin-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.menu button, .menu a { display: flex; align-items: center; gap: 12px; min-width: 200px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(31, 35, 40, 0.10); }
.menu button svg, .menu a svg { color: var(--brand); }
.menu a { text-decoration: none; }

/* Auth tabs */
.tabs { display: flex; gap: 6px; background: var(--raised); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth form input { min-height: 52px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; padding: 0 14px; }

/* Player names */
.namecard input { min-height: 52px; border-radius: 14px; border: 2px solid transparent; background: var(--surface); color: var(--text); font: inherit; font-size: 18px; font-weight: 600; padding: 0 14px; }
.namecard .msg { min-height: 0; }

/* Leaderboard */
.scrollx { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.scrollx::-webkit-scrollbar { display: none; }
.scrollx .chip { flex: none; white-space: nowrap; }
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board .sc { font-size: 18px; }

/* Guess the Year */
:root { --m0: #CFE6FA; --m1: #FFD9C7; --m2: #CFF0DF; --m3: #E1D6F8; --m4: #FFF0B3; --m5: #F9D3E2; --m6: #D6F0F0; --m7: #E8E4D3; --sea: #EEF4FB; --lbl: #2B2840; --lbl-halo: rgba(255,255,255,0.85); }
.yearmap { overflow: auto; }
.yearmap.zoomed svg { width: 230%; }
.yearmap .sea { fill: var(--sea); stroke: none; }
.yearmap .land { stroke: var(--surface); stroke-width: 0.35; vector-effect: non-scaling-stroke; }
.yearmap .c0 { fill: var(--m0); } .yearmap .c1 { fill: var(--m1); } .yearmap .c2 { fill: var(--m2); } .yearmap .c3 { fill: var(--m3); }
.yearmap .c4 { fill: var(--m4); } .yearmap .c5 { fill: var(--m5); } .yearmap .c6 { fill: var(--m6); } .yearmap .c7 { fill: var(--m7); }
.yearmap .lbl { font: 700 7px var(--font); fill: var(--lbl); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: var(--lbl-halo); stroke-width: 2px; pointer-events: none; }
.yearcard { align-items: stretch; }
.yearout { display: block; text-align: center; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.yearcard input[type="range"] { width: 100%; accent-color: var(--p4-ink); height: 36px; }
.yearscale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper { display: flex; gap: 8px; justify-content: center; }
.stepper .chip { min-width: 64px; }

/* Daily World */
.daily { background: var(--hero); color: var(--hero-text); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.daily .eyebrow { color: var(--hero-accent); }
.daily .hint { color: var(--hero-muted); }
.daily .gicon { color: var(--hero-text); }
.daily-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.daily-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.daily-globe { flex: none; width: 72px; height: 72px; margin: -6px -6px 0 0; }
.daily-globe svg { width: 100%; height: 100%; }
.segs { display: flex; gap: 6px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--hero-track); }
.daily .mark { background: var(--hero-mark); }
.daily .daily-done small { color: var(--hero-muted); }
.brandbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 12px; }
.wordmark { font-family: var(--font-display); font-style: italic; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--brand); }
.streakchip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.streakchip .inline-icon { color: var(--accent-text); margin-right: 4px; }
.daily-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.daily-grid { font-size: 30px; letter-spacing: 2px; display: flex; align-items: center; flex-wrap: wrap; }
.daily-grid span { font-size: 22px; font-weight: 800; letter-spacing: 0; margin-left: 6px; }
.daily-big { font-size: 44px; text-align: center; letter-spacing: 4px; }
.streak { font-weight: 800; font-size: 17px; margin: 0; }
.sharepreview { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--raised); font: 600 15px/1.5 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.sharebox { width: 100%; box-sizing: border-box; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: 15px/1.5 var(--font); padding: 10px; }

/* Install guide */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: 16px; padding: 12px 14px; line-height: 1.45; }
.stepnum { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--selected); color: var(--selected-text); font-weight: 800; }
.glyph { display: inline-grid; place-items: center; vertical-align: middle; width: 28px; height: 28px; border-radius: 8px; background: var(--raised); color: var(--p1-ink); }

/* ---------- Icons (custom line art, no emoji) ---------- */
.gicon { display: inline-flex; color: var(--text); opacity: 0.85; flex: none; }

.gamehead { display: flex; align-items: center; gap: 14px; }
.gamehead .gicon.big { width: 64px; height: 64px; align-items: center; justify-content: center; opacity: 1; }
.gamehead.small { gap: 8px; font-size: 18px; margin: 0; }
.inline-icon { display: inline-flex; vertical-align: -4px; margin-right: 6px; }
.trophy { display: flex; justify-content: center; color: var(--text); }

/* Bonus line after every answer */
.note.bonus { display: flex; gap: 10px; align-items: flex-start; }
.bonus-icon { display: inline-flex; color: var(--muted); margin-top: 2px; flex: none; }

/* ---------- Daily Challenge ---------- */
.daily-head { display: flex; align-items: center; gap: 8px; }
.daily-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.daily-done b { font-size: 24px; font-weight: 800; }
.marks { display: flex; gap: 6px; justify-content: center; }
.daily .marks { justify-content: flex-start; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface); }
.marks .mark svg { stroke-width: 3.2; }
.mark.mG { color: var(--correct); }
.mark.mY { color: #9A6B00; }
.mark.mR { color: var(--incorrect); }
.daily-hero .marks .mark { width: 46px; height: 46px; border-radius: 14px; }
.streak { display: flex; align-items: center; justify-content: center; gap: 2px; }
.daily .streak { justify-content: flex-start; }
.daily-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; background: var(--hero); color: var(--hero-text); border-radius: 28px; padding: 24px 16px; }
.daily-hero .eyebrow { color: var(--hero-accent); }
.daily-hero .ring-bg { stroke: var(--hero-track); }
.daily-hero .ring-txt { fill: var(--hero-text); }
.daily-hero .ring-sub { fill: var(--hero-muted); }
.daily-hero .ring-fg { stroke: var(--hero-ring); }
.daily-hero .mark { background: var(--hero-mark); }
.daily-hero .streak .inline-icon { color: var(--hero-accent); }
.daily-hero h1 { margin: 0; }
.cheer { margin: 0; font-weight: 700; font-size: 17px; }
.ring-bg { fill: none; stroke: var(--surface); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--correct); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }
.ring-txt { fill: var(--text); font: 700 30px var(--font-display); }

.answers { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.collapser { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 10px 0; font-weight: 800; font-size: 15px; color: var(--text); }
.collapser .chev { display: inline-flex; transition: transform 0.3s ease; }
.collapser[aria-expanded="false"] .chev { transform: rotate(180deg); }
/* Collapses upward: the panel's bottom edge slides up into the header. */
.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.3s ease; }
.collapse.closed { grid-template-rows: 0fr; }
.collapse-inner { overflow: hidden; min-height: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.collapse.closed .collapse-inner { transform: translateY(-16px); opacity: 0; }
.dqlist { list-style: none; margin: 0; padding: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.dq { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--raised); }
.dq .mark { width: 34px; height: 34px; border-radius: 10px; }
.dq .nm { flex: 1; font-weight: 700; }
.dq .sc { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Map Master zoom/pan ---------- */
.mapbox svg.zoomable { touch-action: none; user-select: none; -webkit-user-select: none; }
.mapbox svg.zoomable.panning { cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .collapse, .collapse-inner, .collapser .chev, .ring-fg { transition: none; } }

/* ---------- Profile: title, stats, badges, progress ---------- */
.profile { gap: 14px; }
.titlecard { gap: 8px; }
.titlename { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; }
.ladder span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); }
.ladder span.on { background: var(--selected); color: var(--selected-text); }
.reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reqrow { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.reqs li.met .reqrow b { color: var(--correct); }
.bar-track { height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; margin-top: 5px; }
.titlecard .bar-track { background: var(--raised); }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: var(--correct); transition: width 0.6s ease; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: var(--raised); color: var(--muted); }
.badge .bicon { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface); opacity: 0.55; }
.badge b { font-size: 13px; line-height: 1.2; }
.badge span:last-child { font-size: 11px; line-height: 1.3; }
.badge.earned { background: var(--primary); color: var(--primary-text); }
.badge.earned .bicon { opacity: 1; color: var(--primary-text); }
.gameprog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.gameprog li { display: flex; gap: 12px; align-items: flex-start; }
.gameprog .gicon { margin-top: 2px; }
.gp-main { flex: 1; min-width: 0; }
.gp-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 360px) { .stats { grid-template-columns: repeat(2, 1fr); } .badges { grid-template-columns: repeat(2, 1fr); } }

/* Weak-spot practice button */
.btn.accent { background: var(--selected); color: var(--selected-text); }
.practice-slot { display: flex; flex-direction: column; }
.practice-slot:empty { display: none; }

/* ---------- Difficulty ---------- */
.chips.wrap { flex-wrap: wrap; }
.chip.toggle { padding: 0 14px; }
.chip.toggle[aria-checked="true"] { background: var(--selected); color: var(--selected-text); box-shadow: inset 0 0 0 2px var(--selected-text); }
.diffnotes { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); line-height: 1.45; display: flex; flex-direction: column; gap: 2px; }
.verdict { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pts { font-weight: 800; font-size: 15px; padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.pts.up { background: var(--correct-fill); color: var(--correct); }
.pts.down { background: var(--incorrect-fill); color: var(--incorrect); }
.pts.zero { background: var(--raised); color: var(--muted); }
.qtimer { display: flex; align-items: center; gap: 10px; }
.qtimer .timer { flex: 1; }
.typed-mc input.correct { box-shadow: inset 0 0 0 2px var(--correct); background: var(--correct-fill); }
.typed-mc input.wrong { box-shadow: inset 0 0 0 2px var(--incorrect); background: var(--incorrect-fill); }
.tag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--selected); color: var(--selected-text); vertical-align: 2px; }

/* Daily: make clear the score is points, not questions */
.ring-sub { fill: var(--muted); font: 700 13px var(--font); }
.daily-done small { font-size: 14px; font-weight: 700; color: var(--muted); }
.dq .sc { font-size: 13px; font-weight: 700; }
.tag.region { background: var(--g-countries); color: var(--text); }
.chip.toggle:disabled { opacity: 0.35; }

/* Home: big spinning globe = the way into the World games */
.globe-cta { border: 0; background: none; padding: 8px 0 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.globe-cta .cta-text { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.01em; }
.globe-wrap { display: block; width: 300px; max-width: 82vw; transition: transform 160ms ease; }
.globe-wrap .bigglobe { filter: drop-shadow(0 14px 18px rgba(31, 35, 40, 0.16)); }
.globe-wrap svg, .globe-wrap img { display: block; width: 100%; height: auto; }
.globe-cta:hover .globe-wrap { transform: scale(1.02); }
.globe-cta:active .globe-wrap { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .globe-wrap { transition: none; } }

/* Game-mode tags on leaderboard rows */
.modetags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.tag.mode { margin-left: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; box-sizing: border-box; font-size: 11px; font-weight: 800; background: var(--selected); color: var(--brand); }
.tag.mode svg { stroke-width: 3.2; }
.modelegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 13px; color: var(--muted); }
.modelegend > span { display: inline-flex; align-items: center; gap: 6px; }

/* Leaderboard: your progress card */
.progcard .mrow { display: flex; flex-direction: column; gap: 2px; }
.progcard .pct { font-size: 17px; color: var(--brand); }
.bestlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bestlist li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "bm sc" "dt dt"; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--raised); }
.bestlist .bm { grid-area: bm; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bestlist .bm .modetags { margin-left: 0; }
.bestlist .sc { grid-area: sc; font-size: 17px; font-variant-numeric: tabular-nums; }
.bestlist .dt { grid-area: dt; font-size: 12px; color: var(--muted); }
.bestlist .tag.region { margin-left: 0; }
.tag.std { margin-left: 0; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }

/* Profile: next-title goals (collapsible) and "New" marks */
.nextgoals summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--brand); padding: 6px 0; list-style: none; }
.nextgoals summary::-webkit-details-marker { display: none; }
.nextgoals summary::after { content: ' \203A'; }
.nextgoals[open] summary::after { content: ' \2039'; }
.nextgoals .reqs { margin-top: 6px; }
.titlecard.isnew { box-shadow: 0 0 0 2px var(--primary); }
.titlecard.isnew .eyebrow { color: var(--correct); }
.badge { position: relative; }
.badge.isnew { box-shadow: 0 0 0 2px var(--primary); }
.newpill { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--brand); color: #FFFFFF; border-radius: 999px; padding: 2px 7px; }

/* Daily results: tap a question to review it */
.dq.hasrev { display: block; padding: 0; }
.dq.hasrev details summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.dq.hasrev details summary::-webkit-details-marker { display: none; }
.dq.hasrev .chev { display: inline-flex; color: var(--muted); transform: rotate(180deg); transition: transform 0.2s ease; }
.dq.hasrev details[open] .chev { transform: rotate(0deg); }
.rv { padding: 2px 12px 12px 54px; display: flex; flex-direction: column; gap: 6px; }
.rv-q { margin: 0; font-weight: 700; line-height: 1.35; }
.rv-flag { width: 120px; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); }
.rv-line { margin: 0; font-size: 14px; line-height: 1.4; }
.rv-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rv-line.ok { color: var(--correct); }
.rv-line.no { color: var(--incorrect); }
@media (prefers-reduced-motion: reduce) { .dq.hasrev .chev { transition: none; } }

/* Profile: title line under "Member since" */
.titleline { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.titleline .titlename { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--brand); line-height: 1.2; }
.newpill.inline { position: static; }

/* Badges as pendants: a small medal on a ribbon; filled when earned, grey when not */
.pendants { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
.pendant { position: relative; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); cursor: pointer; }
.pendant .ribbon { width: 22px; height: 12px; margin-bottom: -4px; background: linear-gradient(90deg, var(--track) 0 45%, transparent 45% 55%, var(--track) 55%); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%); }
.pendant .medal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: #A2A6B2; box-shadow: inset 0 0 0 3px #E2DDD3; }
.pendant .pname { font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center; }
.pendant.earned { color: var(--text); }
.pendant.earned .ribbon { background: linear-gradient(90deg, var(--brand) 0 45%, transparent 45% 55%, var(--primary) 55%); }
.pendant.earned .medal { background: radial-gradient(circle at 35% 30%, #5B9BE0, var(--brand) 70%); color: #FFFFFF; box-shadow: inset 0 0 0 3px #8FC0EE, 0 3px 6px rgba(31, 35, 40, 0.18); }
.pendant.isnew .medal { outline: 2px solid var(--primary); outline-offset: 2px; }
.pendant .newpill { top: 6px; right: 2px; }
.badge-about { margin: 0; min-height: 1.4em; }

/* Leaderboard tabs with a mastery bar inside each tab */
.chip.barchip { display: inline-flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; min-height: 54px; padding: 8px 14px; text-align: left; }
.barchip .bc-name { white-space: nowrap; }
.minibar { display: block; height: 4px; border-radius: 2px; background: rgba(31, 35, 40, 0.10); overflow: hidden; min-width: 56px; }
.minibar i { display: block; height: 100%; background: var(--correct); border-radius: 2px; transition: width 0.5s ease; }
.catgames { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.mrow.link { border: 0; background: none; padding: 0; text-align: left; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; }
/* Game view: Top 10 on the left, your progress + solo top 10 on the right (stacked on phones) */
.lbgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.lbcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 700px) { .lbgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .minibar i { transition: none; } }
.progcard .reqrow > span { white-space: nowrap; }

/* Profile: tap the title for a small pop-up of every title and its requirements */
.titlebtn { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: inherit; }
.tp-i { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; font-family: Georgia, serif; font-style: italic; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.titlepop { margin-top: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(31, 35, 40, 0.12); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.titlepop[hidden] { display: none; }
.tp-head { display: flex; justify-content: space-between; align-items: center; }
.tp-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; min-width: 32px; min-height: 32px; }
.tp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-name { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.tp-list li.cur .tp-name { color: var(--brand); }
.tp-ok { color: var(--correct); }
.tp-reqs { margin: 2px 0 0; padding-left: 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }
p.tp-reqs { padding-left: 0; }
.tp-reqs li.met { color: var(--correct); }

/* Leaderboard: collapsible progress card (closed = the main slider only) and game tags on cross-game boards */
.fold > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.foldhead { display: flex; align-items: center; gap: 10px; }
.foldhead > .mrow { flex: 1; min-width: 0; }
.fold .chev { display: inline-flex; color: var(--muted); transform: rotate(180deg); transition: transform 0.2s ease; }
.fold[open] .chev { transform: rotate(0deg); }
.fold[open] > summary { margin-bottom: 12px; }
.fold > .hint { margin-top: 12px !important; }
.tag.gname { margin-left: 6px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
@media (prefers-reduced-motion: reduce) { .fold .chev { transition: none; } }
.card.fold { display: block; }

/* Logo: Fraunces bold, the clay globe as the "o", a tiny globe as the dot on the "i" */
.gmark { display: inline-flex; align-items: baseline; white-space: nowrap; font-family: var(--font-display); font-style: normal; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.lg-o { width: 0.62em; height: 0.62em; display: inline-block; margin: 0 0.01em 0 0.02em; transform: translateY(0.06em); background: url(clay/subject-world.webp) center / 112% no-repeat; filter: drop-shadow(0 0.02em 0.03em rgba(0, 0, 0, 0.25)); }
.lg-i { position: relative; display: inline-block; }
.lg-dot { position: absolute; left: 50%; top: 0.13em; width: 0.21em; height: 0.21em; transform: translateX(-50%); background: url(clay/subject-world.webp) center / 112% no-repeat; }
h1.wordmark { margin: 0; font-style: normal; font-size: 34px; }
.gmark .lg-globe { color: var(--brand); }
.gmark .lg-ling { color: #2F8A3C; } /* a deeper shade of the globe's green: the exact light green (#61B76A) is too faint on bone at header size */
.gmark .lg-globe, .gmark .lg-ling { display: inline-flex; align-items: baseline; }

/* Mix: 2x2 clay icon tile and the game picker on its setup screen */
.mixicon { display: grid; grid-template-columns: 1fr 1fr; place-items: center; flex: none; }
.mixicon .clayimg { width: 100%; height: auto; }
.minibar.none { visibility: hidden; }
.eyecount { color: var(--muted); letter-spacing: 0.4px; text-transform: none; font-weight: 500; }
/* Sliding rows: fade the right edge so it reads as "more this way"; padding lets the last chip clear the fade. */
.scrollx { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }

/* Sign-in / sign-up: Globeling wordmark on top */
.auth-mark { align-self: center; font-style: normal; font-size: 52px; line-height: 1.1; margin-top: 8px; }
.gmark.short { align-items: center; }
.lg-ball { width: 0.95em; height: 0.95em; display: inline-block; margin-right: 0.04em; transform: translateY(0.08em); background: url(clay/subject-world.webp) center / 112% no-repeat; filter: drop-shadow(0 0.03em 0.05em rgba(0, 0, 0, 0.25)); }

/* New-badge toast: bottom right, above the round menu button */
.toast {
  position: fixed; z-index: 60;
  right: calc(max(16px, env(safe-area-inset-right, 0px)));
  bottom: calc(16px + 56px + 12px + env(safe-area-inset-bottom, 0px));
  max-width: min(340px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 4px;
  background: var(--surface); color: var(--text); border-radius: 18px;
  box-shadow: 0 0 0 1px var(--border), 0 10px 28px rgba(31, 35, 40, 0.18);
  animation: toast-in 260ms cubic-bezier(.2,.8,.2,1);
}
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 220ms, transform 220ms; }
.toast-body { flex: 1; display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 14px 4px 14px 14px; cursor: pointer; }
.toast-body b { display: block; font-size: 15px; line-height: 1.3; }
.toast-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.toast-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.toast-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; width: 40px; height: 44px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.out { transition: none; } }

/* Card header with a small button on the right (Profile: Badges / See all badges) */
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.minibtn { flex: none; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; min-height: 32px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.minibtn:hover { background: var(--raised); }
.footlink { align-self: center; color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 0 4px; }

/* ---------- Leaderboard (Nov 6 redesign) ---------- */
.col.wide { max-width: 1040px; }
.lb li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--raised); }
.lb li.mine { box-shadow: inset 0 0 0 2px var(--selected); }
.lb .rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.lb .rank.gold { background: #F2C94C; color: #3D2E00; box-shadow: inset 0 0 0 1.5px #D4A72C; }
.lb .rank.silver { background: #D9DEE3; color: #2B3138; box-shadow: inset 0 0 0 1.5px #B4BCC4; }
.lb .rank.bronze { background: #E6AF82; color: #3B1F08; box-shadow: inset 0 0 0 1.5px #C88A57; }
.lb .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb .nm { font-weight: 700; overflow-wrap: anywhere; }
.lb .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--muted); }
.lb .meta .modetags, .lb .meta .tag { margin-left: 0; }
.lb .meta .gname { font-weight: 700; color: var(--text); }
.lb .meta .gname::after { content: '\00b7'; margin-left: 6px; color: var(--muted); font-weight: 400; }
.lb .stdmode { font-weight: 600; }
.lb .sc { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
/* Mode icons stay side by side: never stacked */
.modetags { flex-wrap: nowrap; white-space: nowrap; flex: none; }
.boardbar { display: flex; flex-direction: column; gap: 6px; }
.bb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bb-title { margin: 0; font-family: var(--font-display); font-size: 22px; }
.fsum { font-size: 13px; color: var(--muted); }
.filterbtn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 0 14px; min-height: 40px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.filterbtn.on { border-color: var(--brand); color: var(--brand); }
.filterbtn[aria-expanded="true"] { background: var(--raised); }
.fcount { min-width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; }
.fpanel { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.fpanel[hidden] { display: none; }
.frow { display: flex; flex-direction: column; gap: 6px; }
.frow select { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; padding: 0 10px; }
.fpanel .linkbtn { justify-self: start; align-self: end; }
.infobtn { flex: none; border: 0; background: none; padding: 6px; margin: -6px; cursor: pointer; display: inline-grid; place-items: center; }
.infonote { margin-top: -4px !important; }
.progcard .cardhead { justify-content: flex-start; gap: 8px; }

/* Leaderboard tags: blue = game mode, green = region, yellow = games in a Mix. One line; extras fold into "+N". */
.tagstrip { display: flex; flex: 1 1 0; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; padding: 2px 0; }
.lb .meta { flex-wrap: nowrap; min-width: 0; }
.lb .meta .gname { flex: none; }
.tag.tt { position: relative; flex: none; margin: 0; border: 0; font: inherit; font-size: 11px; font-weight: 800; line-height: 1; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; cursor: help; white-space: nowrap; vertical-align: middle; }
.tag[hidden] { display: none !important; }
.tag.tt.mode { background: var(--selected); color: var(--brand); min-width: 22px; justify-content: center; }
.tag.tt.region { background: #D7F0DE; color: #1E5631; }
.tag.tt.games { background: #FBE7A6; color: #5A4300; }
.tag.tt.more { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.tag.tt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* The tooltip: shown on hover (mouse), keyboard focus, or tap (.open). Fixed so the row's one-line clip can't hide it. */
.tag.tt .tip { display: none; position: fixed; z-index: 70; max-width: min(280px, calc(100vw - 32px)); padding: 8px 10px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: 13px; font-weight: 600; line-height: 1.35; white-space: normal; text-align: left; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.tag.tt.open .tip { display: block; }
@media (hover: hover) { .tag.tt:hover .tip { display: block; } }
.tag.tt:focus-visible .tip { display: block; }
.badgesec { display: flex; flex-direction: column; gap: 12px; }
.sechead { margin: 0; font-family: var(--font-display); font-size: 22px; }
