/* 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; --hint-fill: #EEF8F1; --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; }
/* Pinned to the screen and sized to the visible area (app.js keeps --app-h / --app-top in step with the keyboard). */
#app { position: fixed; left: 0; right: 0; top: 0; height: var(--app-h, 100%); transform: translateY(var(--app-top, 0px)); display: flex; flex-direction: column; }
/* Typing on a phone (Jude, Nov 21): the bone card slides up over the globe so the whole question fits above the
   keyboard. The header (quit, count, score) stays. The globe comes back when the keyboard closes. */
/* Keyboard up: fitSheet gives the globe whatever room is left above the keyboard (folding it away only if the
   question needs all of it), so there is no empty band under I'm done (Jude, Nov 21). */
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); }
.found button.more { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.why-star { min-width: 28px; min-height: 28px; margin: -6px -8px -6px 2px; padding: 0 6px; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 800; font-size: 17px; line-height: 1; cursor: pointer; vertical-align: middle; }
.rule-star { margin-left: 0; }
.rv-rare { color: #9A6B00; font-weight: 700; } /* rare answers on the results page: gold text, no icon (Jude, Nov 28) */
.why-star:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-radius: 6px; }
.rv-more { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.found button.more:focus-visible, .rv-more:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.msg { min-height: 1.4em; font-weight: 600; font-size: 15px; }
.msg.ok { color: var(--correct); }
.msg.why { color: var(--brand); } /* text behind an asterisk: same color as the asterisk */
.msg.no { color: var(--incorrect); }
/* Daily hints */
.hints { display: flex; flex-direction: column; gap: 8px; }
.hints:empty { display: none; }
.hint-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 18px; background: var(--selected); border: 1px solid var(--border); }
.hint-card .note-label { color: var(--accent-text); margin: 0; }
.hint-mask { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0.04em; color: var(--text); white-space: pre-wrap; }
.hint-flag { width: 96px; height: auto; border-radius: 6px; border: 1px solid var(--border); margin-top: 6px; }
.hint-text { margin: 2px 0 0; font-size: 18px; font-weight: 600; color: var(--text); }
.hint-card.solved { background: var(--correct-fill); }
.hint-card.solved .note-label { color: var(--correct); }
.list-actions { display: flex; gap: 10px; }
.list-actions .btn { flex: 1; }
.btn.hint-btn { background: var(--hint-fill); color: var(--correct); }
.awarded { font: inherit; font-weight: 700; color: var(--text); }
.hint-btn small { font-size: 13px; font-weight: 600; opacity: .75; margin-left: 6px; }
.hint-btn:disabled { opacity: .5; }
.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; }
.auth-why { margin: 0; text-align: center; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text); }
.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; }

/* Landing page (signed out, today's Daily not played): the turning globe + "ling", one line, one question, one button. */
.toplink { padding: 10px 0; font-size: 14px; color: var(--muted); align-self: center; }
.col.landing { min-height: 100%; padding-bottom: 24px; }
.land-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding-bottom: 6vh; }
.land-mark { font-size: clamp(84px, 26vw, 128px); line-height: 1; margin-bottom: 10px; animation: splash-in 520ms cubic-bezier(.3,1.4,.6,1) both; }
.land-mark .gmark.short.spin .lg-ball { /* same turning globe as the loading screen, sized for the big ball */
  position: relative; border-radius: 50%; overflow: hidden; filter: none;
  background: url(clay/globe-spin.webp) 0 50% / 1.9em 0.95em 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.03em 0.06em rgba(0, 0, 0, 0.2);
  animation: globe-turn-big 3.6s linear infinite;
}
.land-mark .gmark.short.spin .lg-ball::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-big { from { background-position: 0 50%; } to { background-position: 1.9em 50%; } }
.land-head { font-family: var(--font-display); font-size: clamp(30px, 8.4vw, 42px); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; max-width: 14em; }
.land-ask { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 6vw, 28px); font-weight: 500; color: var(--brand); }
.land-cta { width: 100%; max-width: 30rem; margin-top: 14px; }
.land-today { margin: 0; font-size: 14px; color: var(--muted); }
.land-foot { text-align: center; font-size: 13px; }
.land-foot a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .land-mark { animation: none; } .land-mark .gmark.short.spin .lg-ball { animation-duration: 18s; } }

/* Voyage (prototype, Nov 15): a turning globe with the route, hearts for lives, stops ticked off. */
.globe-box { display: flex; justify-content: center; }
.vglobe { display: block; width: 100%; max-width: 300px; height: auto; }
.vglobe.small { max-width: 150px; }
.vglobe .ocean { fill: var(--selected); stroke: var(--border); stroke-width: 1; }
.vglobe .grat { fill: none; stroke: #FFFFFF; stroke-opacity: 0.6; stroke-width: 0.6; }
.vglobe .land { fill: var(--primary); fill-opacity: 0.55; stroke: #FFFFFF; stroke-width: 0.4; }
.vglobe .route { fill: none; stroke: var(--brand); stroke-opacity: 0.5; stroke-width: 1.6; stroke-dasharray: 3 4; }
.vglobe .sailed { fill: none; stroke: var(--brand); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.vglobe .stop { fill: var(--surface); stroke: var(--brand); stroke-width: 1.6; }
.vglobe .stop.reached { fill: var(--brand); }
.vglobe .ship circle { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.vglobe .ship path { fill: none; stroke: var(--surface); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hearts { display: inline-flex; gap: 2px; flex: none; }
.hearts .full { color: var(--incorrect); display: inline-flex; }
.hearts .empty { color: var(--track); display: inline-flex; }
.hearts .full svg { animation: heart-pop 260ms cubic-bezier(.3,1.5,.6,1); }
@keyframes heart-pop { from { transform: scale(.6); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hearts .full svg { animation: none; } }
.pill .hearts { margin-right: 4px; }
.vrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vbar { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.vbar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; transition: width 300ms ease; }
.card.story p { margin: 0; line-height: 1.5; font-size: 16px; }
.card.out { background: var(--raised); box-shadow: none; }
.vstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.vstats div { display: flex; flex-direction: column; gap: 2px; }
.vstats b { font-family: var(--font-display); font-size: 30px; }
.vstats span { font-size: 13px; color: var(--muted); }
.vstops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vstops li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.vstops li span:nth-child(2) { flex: 1; }
.vstops small { color: var(--muted); font-size: 13px; }
.vstops .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); box-sizing: border-box; flex: none; }
.vstops li.done .dot { background: var(--brand); }
.vstops li.now { font-weight: 700; }
.vstops li.now .dot { box-shadow: 0 0 0 4px var(--selected); }
.linkbtn { align-self: center; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; padding: 8px; }
.game.voycard { width: 100%; }
.game.voycard .voyicon { background: var(--g-flags); border-radius: 18px; color: var(--brand); display: inline-flex; }
.keepcard .btn { display: flex; align-items: center; justify-content: center; }
.cta-stack { display: flex; flex-direction: column; gap: 10px; }
.cta-stack .btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.cta-stack .btn.secondary { background: var(--surface); border: 1px solid var(--border); }
.cta-row { display: flex; gap: 10px; }
.cta-row .btn { flex: 1 1 0; min-width: 0; width: auto; box-sizing: border-box; padding: 0 8px; gap: 0; font-size: 15px; border: 1px solid transparent; }
.cta-row .btn.secondary { border-color: var(--border); }
.cta-row .btn.ink { box-shadow: none; }
.cta-row .btn .inline-icon { flex: none; }
/* Voyage, Nov 15 (2): picker, intro, figurine, results */
.vfig { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 22px; background: var(--g-flags); color: var(--brand); overflow: hidden; }
.vfig img { width: 100%; height: 100%; object-fit: contain; }
.vfig.lockfig { background: var(--track); color: var(--muted); }
.vpick { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 16px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); font: inherit; color: inherit; }
.vpick b { display: block; font-family: var(--font-display); font-size: 20px; }
.vpick.locked { opacity: 0.6; }
.vintro-head { display: flex; align-items: center; gap: 16px; }
.vglobe .ship.figure ellipse { fill: var(--text); fill-opacity: 0.18; }
.vhero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.vhero .vfig { background: rgba(255,255,255,0.15); color: var(--hero-text, #FAF7F2); }
.vhero .vstats b { color: inherit; }
.vhero .vstats span { color: inherit; opacity: 0.8; }
.vbadge { display: flex; align-items: center; gap: 16px; }
.vbadge .pendant { pointer-events: none; }
.vrecap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.vrecap p { margin: 4px 0 0; line-height: 1.5; }
.game.voycard .vfig { border-radius: 16px; }
.vbadge .pendant { flex: none; width: 72px; min-width: 0; }
.vbadge > div { flex: 1; min-width: 0; }
.vbadge { flex-direction: row; text-align: left; }
.vpick { box-sizing: border-box; }
.pill .vfig { border-radius: 12px; background: transparent; }
.vbrief h2 { font-size: 22px; }
.vhero .vfig { background: transparent; }
/* Let the figurine stand above the globe's edge instead of being cut off. */
.vglobe { overflow: visible; }
.globe-box { padding-top: 34px; }
.globe-box.small { padding-top: 26px; }

/* ---------- Redesign (Nov 17): home = the 3D globe on a starry sky ---------- */
/* The one dark screen in the app. Bone pads and a bone bar float over it; green Play; blue icons. */
.screen.space {
  --space: #0A0F24; background-color: var(--space); /* text colour is set per item: bone cards on this screen keep dark text */
  background-image:
    radial-gradient(1.5px 1.5px at 11% 12%, #fff, transparent), radial-gradient(1px 1px at 31% 5%, #CFD8FF, transparent),
    radial-gradient(1.5px 1.5px at 85% 14%, #fff, transparent), radial-gradient(1px 1px at 69% 8%, #CFD8FF, transparent),
    radial-gradient(1px 1px at 6% 36%, #CFD8FF, transparent), radial-gradient(1.5px 1.5px at 94% 50%, #fff, transparent),
    radial-gradient(1px 1px at 15% 78%, #CFD8FF, transparent), radial-gradient(1.5px 1.5px at 82% 82%, #fff, transparent),
    radial-gradient(1px 1px at 49% 84%, #CFD8FF, transparent), radial-gradient(1px 1px at 4% 62%, #fff, transparent),
    radial-gradient(1px 1px at 58% 22%, #CFD8FF, transparent), radial-gradient(1px 1px at 40% 94%, #fff, transparent);
}
.homestage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; box-sizing: border-box;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.hometop { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.homebrand { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.space .wordmark { color: #FAF7F2; margin: 6px 0 0; font-size: 28px; }
.space .streakchip { color: var(--text); box-shadow: none; padding: 6px 12px; }
.padbtn {
  flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 16px; display: grid; place-items: center;
  background: var(--bg); color: var(--brand); box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(3, 8, 30, 0.4);
}
.padbtn:active, .navbtn:active { transform: scale(0.95); }
.space button:focus-visible { outline-color: #FAF7F2; }
.globebox { flex: 1; min-height: 0; width: 100%; position: relative; }
/* As tall as the space between the top row and the bar, never more than a bit wider than the screen; centred both ways. */
.globe3d { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.globebox .globe3d { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; max-height: 124vw; margin: auto 0; transform: translateX(-50%); }
.globe3d canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 400ms ease; }
.globe3d.ready canvas { opacity: 1; }
.globe3d.can-drag canvas { touch-action: none; cursor: grab; }
.globe3d.can-drag canvas:active { cursor: grabbing; }
.globe3d-still { width: 72%; height: auto; }
.homenav {
  position: relative; width: 100%; max-width: 420px; height: 72px; box-sizing: border-box; padding: 0 22px; border-radius: 36px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 14px 30px rgba(3, 8, 30, 0.5);
}
.navbtn {
  min-width: 96px; min-height: 56px; padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.navbtn svg { color: var(--brand); }
.playbtn {
  position: absolute; left: 50%; top: -18px; width: 88px; height: 88px; margin-left: -44px; padding: 0; box-sizing: border-box;
  border: 6px solid var(--bg); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-text); font-family: var(--font-display); font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 22px rgba(3, 8, 30, 0.5);
}
.playbtn:active { transform: scale(0.96); }
.playbtn.done { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .globe3d canvas { transition: none; } }
/* On the dark sky the wordmark uses the "on blue" logo colours: bone "Globe", the globe's light green "ling". */
.space .gmark .lg-globe { color: #FAF7F2; }
.space .gmark .lg-ling { color: #7FCB86; }
.homehi { font-size: 13px; font-weight: 600; color: #CFD8F0; margin-top: -2px; }
.padgap { flex: none; width: 48px; height: 48px; }
/* Home: the menu drops down from the profile button (app.js sets top and right from the button's position). */
.menu.drop { position: absolute; margin: 0; }

/* ---------- Redesign: pins and lit-up countries on the globe ---------- */
.gmarks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gshape { fill: rgba(255, 196, 60, 0.62); stroke: #FFF6DC; stroke-width: 1.5; stroke-linejoin: round; animation: gfade 500ms 600ms both; }
.gshape.eg { fill: rgba(255, 255, 255, 0.5); }
.gpin path { fill: #1F7A54; stroke: #fff; stroke-width: 2; }
.gpin circle { fill: #fff; }
.gpin text { fill: #fff; font: 800 12px var(--font); }
.gpin.eg path, .gpin.mR path { fill: #C2333B; }
.gpin.mY path { fill: #9A6B00; }
.gpin-in { animation: pindrop 450ms 800ms both cubic-bezier(.3, 1.4, .6, 1); }
.dres .gpin-in { animation-delay: 300ms; }
@keyframes pindrop { from { transform: translateY(-44px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ptsrise { from { transform: translateY(18px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Redesign: the Daily plays on the starry screen, globe on top, the question on a bone sheet ---------- */
.dhead { flex: none; width: 100%; max-width: 640px; margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.dtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dmid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.dq-count { font-size: 14px; font-weight: 700; color: #FAF7F2; }
.dmid .segbar { width: 100%; max-width: 190px; }
.space .segbar .seg { background: #2A3357; }
.space .segbar .seg.now { background: transparent; box-shadow: inset 0 0 0 2px #FAF7F2; }
.space .segbar .seg.sG { background: #7FCB86; }
.space .segbar .seg.sY { background: #F2C14E; }
.space .segbar .seg.sR { background: #F0878C; }
.dscore { flex: none; min-width: 48px; height: 44px; box-sizing: border-box; padding: 0 14px; border-radius: 22px; display: grid; place-items: center;
  background: var(--bg); color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; box-shadow: 0 8px 18px rgba(3, 8, 30, 0.4); }
.dhead .confirm { color: var(--text); }
.dglobe { flex: none; position: relative; height: clamp(150px, 30vh, 290px); display: flex; justify-content: center; }
.dglobe .globe3d { height: 124%; }
.ptsfloat { position: absolute; left: calc(50% + 34px); top: 16%; padding: 2px 14px; border-radius: 20px; border: 2px solid #fff;
  background: #1F7A54; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 24px; box-shadow: 0 8px 18px rgba(3, 8, 30, 0.45);
  animation: ptsrise 500ms 1100ms both cubic-bezier(.3, 1.4, .6, 1); }
/* The bone sheet is the column inside the scroller, not the scroller itself: a scrolling box with its own background
   painted a dark band over the top of the globe once its content was long enough to scroll (seen Nov 18). */
.dsheet { position: relative; z-index: 1; color: var(--text); }
.dsheet > .col { min-height: 100%; box-sizing: border-box; background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 30px rgba(3, 8, 30, 0.5); }
.dsheet .col { padding-top: 22px; }
@media (max-height: 560px) { .dglobe { height: 110px; } }

/* ---------- Redesign: Daily results on the starry screen; the globe shows a numbered pin per question ---------- */
.dres .daily-hero { background: none; padding: 0 0 4px; border-radius: 0; }
.hero-row { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.hero-globe { flex: none; width: min(52vw, 230px); }
.hero-globe .globe3d { width: 100%; }
.dres .col > .hint, .dres .daily-hero .cheer { color: #CFD8F0; }
.dres .daily-hero h1 { color: #FAF7F2; }
@media (prefers-reduced-motion: reduce) { .gpin-in, .gshape, .ptsfloat { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.dtop.pill { padding: 0; border-radius: 0; }
.dtop.pill .padbtn { padding: 0; background: var(--bg); color: var(--brand); }

/* ---------- Redesign: Explore = diorama cards you swipe through, the globe turning behind them ---------- */
.xscreen { position: relative; overflow: hidden; --xh: min(444px, 54vh); --xw: calc(var(--xh) * 300 / 444); }
.xhead { flex: none; position: relative; z-index: 2; width: 100%; max-width: 640px; margin: 0 auto; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.xhead h1 { margin: 0; font-size: 26px; color: #FAF7F2; }
.xglobe { position: absolute; z-index: 0; left: 50%; top: calc(58px + env(safe-area-inset-top, 0px)); width: min(124vw, 62vh); transform: translateX(-50%); pointer-events: none; }
.xglobe .globe3d { width: 100%; }
.xplace { position: absolute; left: calc(50% + 18px); top: 20%; padding: 4px 12px; border-radius: 14px; white-space: nowrap;
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 700; box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(3, 8, 30, 0.4); }
.groute { fill: none; stroke: #FAF7F2; stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; animation: gfade 500ms 500ms both; }
.xcar { position: relative; z-index: 1; margin-top: auto; flex: none; display: flex; align-items: center; gap: 14px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 26px calc(50% - var(--xw) / 2) 22px; }
.xcar::-webkit-scrollbar { display: none; }
.xcard { position: relative; flex: none; width: var(--xw); height: var(--xh); scroll-snap-align: center; overflow: hidden; border-radius: 26px;
  background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 20px 40px rgba(3, 8, 30, 0.6);
  transform: scale(0.9); opacity: 0.9; transition: transform 300ms ease, opacity 300ms ease; cursor: pointer; }
.xcard.before { transform: scale(0.9) rotate(-6deg); }
.xcard.after { transform: scale(0.9) rotate(6deg); }
.xcard.on { transform: none; opacity: 1; cursor: default; }
.xart { position: absolute; left: 0; top: 0; width: 100%; height: 84%; object-fit: cover; mix-blend-mode: multiply; display: block;
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); } /* fades the picture's own backdrop into the card */
.xbox { position: absolute; bottom: 10px; box-sizing: border-box; padding: 11px; border-radius: 18px; background: var(--bg);
  box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(70, 35, 15, 0.28); display: flex; flex-direction: column; gap: 6px; }
.xleft { left: 10px; width: calc(47% - 14px); }
.xright { right: 10px; width: calc(53% - 14px); gap: 9px; }
.xkind { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.xtag { font-size: 14px; line-height: 1.2; font-weight: 800; }
.xblurb { margin: 0; font-size: 12px; line-height: 1.4; font-weight: 600; color: var(--muted); }
.xtitle { margin: 0; font-size: 22px; line-height: 1.1; }
.xfacts { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.xfacts > div { display: flex; align-items: center; gap: 6px; }
.xfacts .inline-icon { color: var(--brand); display: inline-flex; }
.xfacts .xstatus { color: var(--correct); }
.xbtn { min-height: 44px; padding: 0 10px; border: 0; border-radius: 22px; background: var(--brand); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; box-shadow: 0 8px 18px rgba(36, 94, 158, 0.35); }
/* .vpick is the old voyage-list hook the tests and voyage code still use; undo its list-row look on the card button */
.xbtn.vpick { display: block; width: 100%; text-align: center; padding: 0 10px; border: 0; border-radius: 22px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.xbtn:active { transform: scale(0.97); }
.xbtn.xsoon { background: var(--raised); color: var(--muted); box-shadow: none; cursor: default; }
.xdots { position: relative; z-index: 1; flex: none; display: flex; justify-content: center; gap: 8px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.xdots i { width: 8px; height: 8px; border-radius: 4px; background: #3A4470; transition: width 200ms ease, background 200ms ease; }
.xdots i.on { width: 22px; background: var(--primary); }
@media (prefers-reduced-motion: reduce) { .xcard, .xdots i { transition: none; } .groute { animation: none; } }
/* Explore cards: the card is sized from the window height, so on a laptop it can be narrower than on a phone.
   Size the text and spacing from the card's own width (container units) so everything keeps the phone layout
   at any size (Jude, Nov 20). 300px wide = the phone design; px values above stay as a fallback. */
.xcard { container-type: inline-size; }
@supports (width: 1cqw) {
  .xbox { padding: 3.7cqw; border-radius: 6cqw; gap: 2cqw; bottom: 3.3cqw; }
  .xleft { left: 3.3cqw; width: calc(47% - 4.7cqw); }
  .xright { right: 3.3cqw; width: calc(53% - 4.7cqw); gap: 3cqw; }
  .xkind { font-size: 3.7cqw; }
  .xtag { font-size: 4.7cqw; }
  .xblurb { font-size: 4cqw; }
  .xtitle { font-size: 7.3cqw; }
  .xfacts { font-size: 4cqw; gap: 1.7cqw; }
  .xfacts > div { gap: 2cqw; }
  .xfacts .inline-icon svg { width: 5.3cqw; height: 5.3cqw; }
  .xbtn, .xbtn.vpick { min-height: 14.7cqw; font-size: 5.3cqw; border-radius: 7.3cqw; }
}


/* Daily, after answering: everything on one screen. Chips sit in rows that scroll sideways (--rows is set in app.js to what fits). */
.dsheet .col { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.dsheet .col.answered { gap: 12px; padding-top: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.dsheet .answered .typed, .dsheet .answered > .msg, .dsheet .answered .hints { display: none; }
.dsheet .answered .prompt { font-size: 18px; line-height: 1.3; }
.dsheet .answered .found {
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 8px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: none;
  margin-inline: -16px; padding-inline: 16px;
}
/* Only rows that run past the screen fade at the right edge (a hint to swipe); rows that fit stay crisp. */
.dsheet .answered .found.scrolls { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.chiprow { display: flex; gap: 8px; flex: none; width: max-content; }
.found.scrolls .chiprow { padding-right: 28px; }
.dsheet .answered .found::-webkit-scrollbar { display: none; }
.dsheet .answered .found span { white-space: nowrap; flex: none; }
.dsheet .answered .feedback { gap: 8px; }

/* ---------- Redesign: every other game screen sits on the starry sky ---------- */
/* .sky = cards floating on the sky (lists, setup, voyage pages, results). Text straight on the sky is light;
   anything that is its own surface (cards, tiles, buttons, chips, inputs) switches back to the normal dark-on-bone colours. */
.screen.sky { --text: #FAF7F2; --muted: #B6C1DE; --accent-text: #9CC6F2; color: var(--text); }
.sky .card, .sky .game, .sky .vpick, .sky .btn, .sky .chip, .sky .confirm, .sky .sheet, .sky .note, .sky input, .sky select, .sky .pill, .sky .vstops, .sky .toast, .sky .menu, .sky .overlay {
  --text: #1F2328; --muted: #5C6370; --accent-text: #2563A8; color: var(--text);
}
.sky .btn.primary.ink { color: var(--bg); }
.sky .btn.danger { color: var(--incorrect); }
/* The "‹ Back" text button becomes a bone pill, like the pads on home. */
.sky .col > .back, .sky .col > form > .back {
  min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--bg); color: #1F2328;
  box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(3, 8, 30, 0.4);
}
.sky .linkbtn { color: #CFD8F0; }
.sky .col { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
/* The voyage's own globe, in the new globe's colours with its blue glow. */
.space .vglobe { filter: drop-shadow(0 0 14px rgba(56, 140, 255, 0.55)); }
.space .vglobe .ocean { fill: #2278DC; stroke: #6CC0FF; stroke-width: 1.5; }
.space .vglobe .grat { stroke-opacity: 0.18; }
.space .vglobe .land { fill: #6DBB4E; fill-opacity: 1; stroke: #2C6B2A; stroke-opacity: 0.5; }
.space .vglobe .route { stroke: #FAF7F2; stroke-opacity: 0.85; }
.space .vglobe .sailed { stroke: #FFC43C; }
.space .vglobe .stop { fill: #FAF7F2; stroke: #17366B; }
.space .vglobe .stop.reached { fill: #FFC43C; }
/* .gplay = playing a game: the player bar on the sky, the question on a bone sheet (same sheet as the Daily). */
.gplay .bar { padding-top: env(safe-area-inset-top, 0px); }
.gplay .bar .col { padding-bottom: 14px; }
.gplay .segbar .seg.sG { background: #7FCB86; } .gplay .segbar .seg.sY { background: #F2C14E; } .gplay .segbar .seg.sR { background: #F0878C; }
.gplay .progress { background: #2A3357; }
.gplay .bar .confirm { color: #1F2328; }

/* Badges on the home globe: a finished exploration leaves its icon on the globe, at its place. The icon itself, no frame. */
.gpin.badge image { filter: drop-shadow(0 4px 5px rgba(3, 8, 30, 0.6)); }
.gpin.badge .gpin-in { animation-delay: 300ms; }

/* Voyage questions: Daily layout. The globe on top shows the whole route, the part sailed (gold) and the ship. */
.gsailed { fill: none; stroke: #FFC43C; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.groute.still, .gpin.ship .gpin-in { animation: none; }
.vsail .dmid { gap: 2px; }
.vsail .dmid span { font-size: 13px; font-weight: 600; color: #CFD8F0; text-align: center; }
.vsail .dhearts { flex: none; display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- No scrolling inside the question sheet (Daily and voyage questions) ---------- */
/* app.js fitSheet() adds .fit1 when a question is too tall, then shrinks the globe, then sets --pic (1 down to 0.4). */
.dplay.fit1 .dsheet .col { gap: 10px; padding-top: 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.dplay.fit1 .dsheet .prompt { font-size: 19px; line-height: 1.25; }
.dplay.fit1 .opt { min-height: 46px; padding: 8px 14px; font-size: 16px; }
.dplay.fit1 .options, .dplay.fit1 .flaggrid { gap: 8px; }
.dplay.fit1 .flaggrid .opt { padding: 6px; gap: 2px; }
.dplay.fit1 .feedback { gap: 8px; }
.dplay.fit1 .feedback b { font-size: 19px; }
.dplay.fit1 .note { padding: 9px 12px; font-size: 14px; line-height: 1.35; }
.dplay.fit1 .feedback .btn, .dplay.fit1 .typed input, .dplay.fit1 .typed .btn { min-height: 48px; }
.dplay.fit1 .sentence { font-size: 22px; padding: 14px 12px; border-radius: 16px; }
/* Once answered, the close-up gives way to the full flag shown under it. */
.dplay .col.done .zoom, .dplay .col.answered .zoom { display: none; }
.dplay.fit2 .options { display: grid; grid-template-columns: 1fr 1fr; }
.dplay.fit2 .options .opt { padding-right: 44px; }
.dplay.fit2 .col.done .opt.dim, .dplay.fit2 .col.answered .opt.dim { display: none; }
.dplay.fit2 .note { font-size: 13px; }
.dplay.fit3 .options .opt { font-size: 14px; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.dplay.fit3 .feedback h3, .dplay.fit3 .feedback .verdict { font-size: 16px; }
.dplay.fit3 .feedback .note.funfact b, .dplay.fit3 .funfact b { font-size: 14px; }
.dplay.fit3 .funfact, .dplay.fit3 .feedback .note { padding: 10px 12px; }
.dplay.fit3 .col { gap: 8px; }
.dplay .bigflag, .dplay .zoom { max-width: calc(360px * var(--pic, 1)); }
.dplay .flaggrid .opt img { width: calc(100% * var(--pic, 1)); }
.dplay .mapbox, .dplay .zoomflag, .dplay .flagclose { width: calc(100% * var(--pic, 1)); align-self: center; }

/* ---------- Voyage scene: the diorama full screen, a box at the bottom ---------- */
.screen.scn { position: relative; overflow: hidden; background: #F6F1E7; }
.scn-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.scn-stage:active { cursor: grabbing; }
.scn-pan { position: absolute; inset: 0; transform-origin: 50% 42%; will-change: transform; }
.scn-float { position: absolute; inset: -5%; animation: scnbob 7s ease-in-out infinite alternate; }
.scn-media { position: absolute; left: 0; top: -9%; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; user-select: none; -webkit-user-select: none; pointer-events: none; }
@keyframes scnbob { from { transform: translateY(-0.8%) rotate(-0.5deg) scale(1.0); } to { transform: translateY(0.9%) rotate(0.5deg) scale(1.04); } }
.scn-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.scn-top > * { pointer-events: auto; }
.scn-title { margin-top: 10px; padding: 6px 14px; border-radius: 16px; background: var(--bg); box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(70, 35, 15, 0.22); font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.scn-top { padding-right: 132px; justify-content: flex-start; }
.scn-globe, .scn-nog { position: absolute; z-index: 3; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.scn-globe { width: 104px; height: 104px; padding: 0; border: 0; border-radius: 50%; background: #0A0F24; overflow: hidden; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 0 0 3px var(--bg), 0 10px 22px rgba(70, 35, 15, 0.35); }
.scn-globe .globe3d { width: 118%; flex: none; pointer-events: none; }
.scn:not(.open) .scn-globe .gpin.badge image { width: 30px; height: 30px; x: -15px; y: -24px; }
/* Globe open (tap the corner globe): it covers the picture with a dark sky and sits in the space above the box. Tap again to close. */
.scn.open .scn-globe { inset: 0; top: 0; right: 0; width: auto; height: auto; border-radius: 0; box-shadow: none; z-index: 1; display: block;
  background-image: radial-gradient(1.5px 1.5px at 12% 14%, #fff, transparent), radial-gradient(1px 1px at 78% 9%, #cfd8ff, transparent), radial-gradient(1.5px 1.5px at 91% 38%, #fff, transparent), radial-gradient(1px 1px at 6% 46%, #cfd8ff, transparent), radial-gradient(1px 1px at 40% 4%, #cfd8ff, transparent), radial-gradient(1.5px 1.5px at 60% 52%, #fff, transparent); }
.scn.open .scn-globe .globe3d { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px) + (var(--gh, 50vh) - 64px - env(safe-area-inset-top, 0px)) / 2); transform: translate(-50%, -50%);
  width: min(112%, 620px, calc((var(--gh, 50vh) - 76px - env(safe-area-inset-top, 0px)) * 1.12)); }
.scn-box.scn-route, .scn.open.has-route .scn-box:not(.scn-route) { display: none; }
.scn.open .scn-box.scn-route { display: flex; }
.scn-box h2 + .scn-story { margin-top: -4px; }
.scn-box.scn-stop h2 { font-size: 30px; }
.scn-box.scn-stop .scn-story li { font-size: 14px; }
.scn-next { font-weight: 700; font-size: 15px; }
.scn-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.scn-box { position: absolute; z-index: 2; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); max-width: 460px; transform: translateX(-50%); box-sizing: border-box;
  padding: 16px; border-radius: 24px; background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 16px 34px rgba(70, 35, 15, 0.35); display: flex; flex-direction: column; gap: 10px; }
.scn-box h2 { margin: 0; font-size: 21px; line-height: 1.2; }
/* Swipe between legs: the dots under the box (tap one to jump), and the Completed / Locked tag on a leg you are only looking at. */
.scn-box { touch-action: pan-y; }
.scn-dots { display: flex; justify-content: center; gap: 2px; margin: -4px 0 -8px; }
.scn-dot { width: 28px; height: 28px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.scn-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: rgba(36, 31, 26, 0.2); }
.scn-dot.done::before { background: var(--primary); }
.scn-dot.now::before { background: var(--hero); }
.scn-dot.on::before { width: 22px; border-radius: 4px; }
.scn-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.scn-tag.done { background: rgba(97, 183, 106, 0.22); color: #23672c; }
.scn-tag.locked { background: rgba(36, 31, 26, 0.1); color: var(--muted); }
.scn-story { display: flex; flex-direction: column; gap: 6px; }
.scn-story b { font-size: 17px; line-height: 1.25; }
.scn-story ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.scn-story li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.35; color: var(--muted); }
.scn-story li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.scn-prog { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.scn-prog .vbar { flex: 1; }
.scn-prog span { flex: none; font-variant-numeric: tabular-nums; }
.scn-out { display: flex; flex-direction: column; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .scn-float { animation: none; } }
/* Voyage questions: kind of question + debated flag; results lists */
.vqtags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 -4px; }
.vqtag { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--selected); color: var(--selected-text); }
.vqtag.debated { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--muted); }
.vsources summary { cursor: pointer; list-style: none; }
.vsources summary::-webkit-details-marker { display: none; }
.vsources ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.vsources a { color: var(--accent-text); }

/* Voyage (Nov 19): fun facts, one page per stop, Explore more survey */
.feedback .note.funfact b, .funfact b { font-size: 17px; line-height: 1.35; font-weight: 700; color: var(--text); }
.feedback .note.funfact .note-label, .funfact .note-label { color: var(--accent-text); }
.funfact { display: flex; gap: 12px; align-items: flex-start; background: var(--selected); border-radius: 18px; padding: 14px 16px; text-align: left; }
.funfact .bonus-icon { color: var(--accent-text); }
.vstop { gap: 14px; }
.vnext { display: grid; gap: 4px; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.vstory summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 15px; }
.vstory p { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.vsurvey { gap: 16px; }
.vsurvey .vq { display: grid; gap: 6px; }
.vsurvey textarea, .vsurvey input[type="email"] { width: 100%; box-sizing: border-box; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; padding: 10px 14px; resize: vertical; }
.vsurvey input[type="email"] { min-height: 52px; }
.vsurvey textarea:focus, .vsurvey input[type="email"]:focus { outline: none; border-color: var(--accent-text); }
.vprice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.vprice legend { margin-bottom: 6px; }
.vopt { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
.vopt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent-text); background: var(--selected); }
.vopt input { accent-color: var(--accent-text); width: 18px; height: 18px; margin: 0; }
.vstart { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; align-items: baseline; }
.vstart dt { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.vstart dd { margin: 0; font-size: 16px; }
.gloss { cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: underline dotted; text-decoration-color: var(--accent-text); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gloss[aria-expanded="true"] { color: var(--accent-text); }
.gloss:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.gloss-tip { background: var(--selected); color: var(--text); border-radius: 14px; padding: 10px 14px; font-size: 15px; line-height: 1.4; margin-top: -4px; }
.gloss-tip[hidden] { display: none; }
/* Sign-up / sign-in fits on one phone screen, Create account button included (Jude, Nov 18: seeing the button and
   just three fields up front makes signing up feel quick). Tighter spacing, smaller logo, no empty message line. */
.col.auth { padding-top: 8px; gap: 12px; }
.col.auth .back { padding: 4px 0; }
.col.auth .auth-mark { font-size: 38px; margin-top: 0; }
.col.auth h1 { font-size: 26px; margin: 0; text-align: center; }
.col.auth .tabs button { min-height: 40px; }
.col.auth .auth-why { font-size: 15px; }
.col.auth form.card { gap: 6px; padding: 14px 16px; }
.col.auth form .eyebrow { margin-top: 4px; }
.col.auth form .hint { font-size: 13px; }
.col.auth form input { min-height: 46px; }
.col.auth form .msg:empty { display: none; }
.col.auth form .btn { margin-top: 8px; }
.col.auth > .hint { font-size: 13px; }
/* Short screens (iPhone SE in Safari): drop the logo and tighten more so the button still shows. */
@media (max-height: 620px) {
  .col.auth .auth-mark { display: none; }
  .col.auth { gap: 8px; padding-top: 0; }
  .col.auth form .eyebrow { margin-top: 0; }
  .col.auth form.card { gap: 4px; }
  .col.auth h1 { font-size: 22px; }
  .col.auth .tabs button { min-height: 36px; }
  .col.auth .auth-why { font-size: 14px; }
  .col.auth form input { min-height: 44px; }
  .col.auth form.card { padding: 12px 14px; }
}
/* Home: the globe can be zoomed in a little (pinch / scroll). It grows past its box, so the top row and the bar stay on top of it and tappable. */
.hometop, .homenav { position: relative; z-index: 2; }
.screen.space { overflow: hidden; }

/* ---------- Daily v2 (Nov 20): rare answers, the bonus round, answer animations ---------- */
.typed.shake { animation: shake 200ms 2; }
.typed.shake input { border-color: var(--incorrect); }
.found span.rare { background: #FFF1CC; box-shadow: inset 0 0 0 2px #E0A82E; display: inline-flex; align-items: center; gap: 4px; }
.found span.rare .inline-icon { padding: 0; background: none; color: #9A6B00; }
.msg.rare { color: #9A6B00; }
.msg .place-note { display: block; margin-top: 4px; font-weight: 500; font-size: 14px; line-height: 1.35; color: var(--muted); }
.cheer.dtitle { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; margin: 4px 0 0; line-height: 1.15; }
.cheer.dtitle .lead { font-size: 15px; font-weight: 500; opacity: 0.85; }
.cheer.dtitle .tword { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cheer.dtitle strong { font-family: var(--font-display); font-size: 32px; font-weight: 700; }
.cheer.dtitle .emo { font-size: 28px; }
.emobtn { border: 0; background: none; padding: 2px; margin: 0; line-height: 1; cursor: pointer; border-radius: 50%; }
.emobtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dtpop { box-sizing: border-box; width: 100%; max-width: 420px; margin: 10px auto 0; text-align: left; color: var(--text); }
.dsheet .msg:empty { min-height: 0; }
.know-more { margin: 0; font-size: 15px; color: var(--muted); }
.know-more b { color: var(--correct); }
.know-more[hidden] { display: none; }
.typed[data-tone="ok"] input { border-color: var(--correct); }
.typed[data-tone="rare"] input { border-color: #E0A82E; box-shadow: 0 0 0 3px rgba(224, 168, 46, 0.25); }
.typed[data-tone="no"] input { border-color: var(--incorrect); }
.best-today { margin: 0; font-size: 13px; opacity: 0.8; }
.gshape.old, .gpin.old .gpin-in { animation: none; }
.gshape.glow { animation: gglow 900ms 500ms both; }
.gshape.slam { fill: rgba(255, 168, 40, 0.85); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; animation: gslam 520ms 650ms both cubic-bezier(.2, .9, .3, 1.3); }
.gpin.slam .gpin-in { animation: pinslam 520ms 650ms both cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pinslam { 0% { transform: translateY(-110px) scale(2.8); opacity: 0; } 55% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes gglow { 0% { opacity: 0; } 40% { opacity: 1; fill: rgba(255, 236, 150, 0.98); } 100% { opacity: 1; } }
@keyframes gslam { 0% { transform: scale(3.4); opacity: 0; } 55% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typed.shake, .gshape.glow, .gshape.slam, .gpin.slam .gpin-in { animation: none; } }

/* Map questions: the corner button puts the map over the whole screen (bigger countries to tap), and back.
   Same colours as the card. Upright; the map covers the screen; drag with one finger to move, pinch to zoom. */
.mapbox { position: relative; }
.mapfull { position: absolute; right: 8px; top: 8px; z-index: 2; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  border: 1px solid rgba(10, 15, 36, 0.18); border-radius: 12px; background: #FAF7F2; color: #0A0F24; box-shadow: 0 4px 14px rgba(10, 15, 36, 0.35); cursor: pointer; }
.mapbox .mapfull svg { width: 22px; height: 22px; stroke-width: 3; }
.mapbox.full { position: fixed; inset: 0; z-index: 60; width: auto !important; border-radius: 0; box-shadow: none;
  overflow: hidden; }
.mapbox.full > svg { width: 100%; height: 100%; }
.mapbox.full .mapfull { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
html.mapopen, html.mapopen body { overflow: hidden; }

/* ---------- Home: the icons button (Nov 21) ---------- */
/* The icons button sits just above the round Play button (which pokes 18px up out of the bar). */
.globebar { position: relative; z-index: 2; display: flex; justify-content: center; margin: 4px 0 28px; }
.iconsbtn {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; background: rgba(250, 247, 242, 0.14); color: #CFD8F0; box-shadow: inset 0 0 0 1px rgba(250, 247, 242, 0.3);
}
.iconsbtn.on { background: var(--bg); color: var(--brand); box-shadow: 0 0 0 1px var(--border), 0 6px 14px rgba(3, 8, 30, 0.4); }
.iconsbtn:active { transform: scale(0.96); }

/* Typed-list questions (Jude, Nov 21): the last answer's note sits on the count line. With the keyboard down the sheet
   keeps its normal sizes (the globe shrinks if a hint makes it too tall). With the keyboard up (html.typing) the text
   and spacing tighten so the prompt, box, Add, chips, Hint and I'm done all fit above it. Text boxes stay 17px:
   iPhone zooms in on a box whose text is under 16px. */
.countrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.countrow .hint { margin-left: auto; }
.countrow .msg { min-height: 0; flex: 1 1 auto; min-width: 0; }
.countrow .msg:empty { display: none; }
html.typing .col.listq { gap: 6px; }
html.typing .dsheet .col.listq { padding-top: 10px; padding-bottom: 10px; }
html.typing .col.listq .prompt { font-size: 18px; line-height: 1.2; margin: 0; }
html.typing .col.listq .count, html.typing .col.listq .countrow .msg { font-size: 14px; }
html.typing .col.listq .typed input { min-height: 44px; font-size: 17px; padding-top: 0; padding-bottom: 0; }
html.typing .col.listq .typed .btn { min-height: 44px; font-size: 16px; padding: 0 16px; }
html.typing .col.listq .found { gap: 6px; }
html.typing .col.listq .found > span, html.typing .col.listq .found > .chiprow > span { padding: 5px 10px; font-size: 14px; }
html.typing .col.listq .found button.more { padding: 6px 12px; font-size: 14px; } /* stays 44px tall: a finger-sized target */
html.typing .col.listq .hints { gap: 6px; }
html.typing .col.listq .hint-card { padding: 6px 12px; border-radius: 14px; }
html.typing .col.listq .hint-card .hint-mask, html.typing .col.listq .hint-card .hint-text { font-size: 15px; margin: 0; }
html.typing .col.listq .know-more { font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.know-more .km-short, html.typing .know-more .km-long { display: none; }
html.typing .know-more .km-short { display: inline; }
html.typing .col.listq .list-actions .btn, html.typing .col.listq > .btn { min-height: 44px; font-size: 16px; }
/* Text boxes never below 17px (iPhone zooms into smaller ones). */
.typed input, .typed-mc input, .auth input, .namecard input { font-size: max(17px, 1em) !important; }

/* Rare chip: the spark sits close to the name (Jude, Nov 21). */
.found span.rare .inline-icon { margin-right: 0; display: inline-flex; }
.found span.has-why { cursor: pointer; }
/* "Know more?" sits on the count line once the bonus round starts; it takes its own line under the count. */
.countrow .know-more { flex: 1 1 auto; min-width: 0; margin: 0; }
/* Results of the 15 games: the pinned globe sits centred at the top, in place of the trophy. */
.col > .hero-globe { align-self: center; width: min(72vw, 290px); }

/* Daily results: three buttons side by side under Share (Jude, Nov 22). Labels stay on one line on a small phone. */
.cta-row.three { gap: 8px; }
.cta-row.three .btn { font-size: 14px; padding: 0 6px; white-space: nowrap; }

/* ========== Nov 22 restyle: Jude's hand-drawn atlas look, on every screen ==========
   Bone white everywhere (the starry sky is gone), no frame (removed the same day), ink-outlined bone buttons,
   the deep blue Daily card and green Play from the globe icon, and every globe drawn as the painted atlas (src/globe.js).
   Where an older rule above disagrees, this section wins. */
html.light { --bg: #FAF8F3; --ink: #3B2F22; --ink-soft: rgba(59, 47, 34, 0.16); --sea: #DCEAF4; --route: #B5442E; }
html.light body { background: var(--bg); }

/* No frame round the screens (Jude removed it, Nov 22). */
.screen { position: relative; }
.col { padding-left: max(22px, calc(14px + env(safe-area-inset-left, 0px))); padding-right: max(22px, calc(14px + env(safe-area-inset-right, 0px))); padding-top: 22px; }

/* No more dark sky: every screen is bone with dark text. */
html.light .screen.space { background: var(--bg); background-image: none; }
html.light .screen.sky { --text: #1F2328; --muted: #5C6370; --accent-text: #2563A8; color: var(--text); }
html.light .space button:focus-visible { outline-color: var(--text); }
html.light .space .wordmark { color: var(--brand); }
html.light .space .gmark .lg-globe { color: var(--brand); }
html.light .space .gmark .lg-ling { color: #2F8A3C; }
html.light .space .streakchip { box-shadow: 0 0 0 1px var(--ink-soft); }
html.light .sky .linkbtn { color: var(--brand); }

/* Buttons and boxes in the atlas style: bone with a thin ink outline (secondary), green (primary), deep blue (ink). */
html.light .btn.secondary, html.light .sky .col > .back, html.light .sky .col > form > .back, html.light .padbtn, html.light .dscore, html.light .xplace, html.light .scn-title {
  background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--ink), 0 4px 12px rgba(59, 47, 34, 0.1);
}
html.light .padbtn { color: var(--brand); border-radius: 50%; }
html.light .btn.primary { box-shadow: 0 6px 16px rgba(47, 138, 60, 0.22); }
html.light .btn.primary.ink { box-shadow: 0 6px 16px rgba(36, 94, 158, 0.25); }
html.light .card, html.light .game, html.light .opt, html.light .confirm, html.light .facts, html.light .steps li, html.light .subject { box-shadow: 0 0 0 1px #E6DDCD; }
html.light .chip { background: var(--bg); box-shadow: inset 0 0 0 1px var(--ink-soft); }
html.light .chip[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--brand); }

/* ---- Home: the atlas fills the screen ---- */
html.light .screen.atlashome { background: var(--bg); overflow: hidden; }
.atlashome .homestage { position: relative; padding: 0; }
.atlashome .globebox { position: absolute; inset: 0; z-index: 0; }
.atlashome .globebox .globe3d.atlas, .globe3d.atlas { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; max-height: none; margin: 0; transform: none; aspect-ratio: auto; display: block; touch-action: none; cursor: grab; }
.globe3d.atlas:active { cursor: grabbing; }
.globe3d .gstack { position: absolute; inset: 0; }
.globe3d .gstack canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 1; transition: none; }
.globe3d:not(.atlas) .gstack { transform-origin: 50% 50%; }
.atlashome .hometop {
  position: absolute; z-index: 2; left: 0; right: 0; top: 0; width: auto; max-width: none; box-sizing: border-box;
  padding: calc(30px + env(safe-area-inset-top, 0px)) 26px 70px; align-items: flex-start; pointer-events: none;
  /* a soft cloud of blur behind the logo with no hard edges: it fades out sideways and downwards (Jude, Nov 22) */
  background: radial-gradient(ellipse 75% 100% at 50% 0%, rgba(250, 248, 243, 0.9) 30%, rgba(250, 248, 243, 0.5) 62%, rgba(250, 248, 243, 0) 100%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, #000 45%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, #000 45%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
}
.atlashome .hometop > * { pointer-events: auto; }
.atlashome .homebrand { flex: 1; gap: 6px; pointer-events: none; }
.atlashome .wordmark { margin: 2px 0 0; font-size: 38px; font-style: normal; }
.atlashome .homehi { margin: 0; font-family: var(--font-display); font-style: italic; font-size: 14px; font-weight: 500; color: #5C4A33; text-align: center; }
.atlashome .padbtn { width: 46px; height: 46px; }
.atlashome .padgap { width: 46px; height: 46px; }
.atlashome .homenav {
  position: absolute; z-index: 2; left: 26px; right: 26px; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: 460px; height: auto;
  margin: 0 auto; padding: 0; border-radius: 0; background: none; box-shadow: none; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.atlashome .homenav > * { pointer-events: auto; }
.homedaily { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; background: var(--hero); color: var(--hero-text); box-shadow: 0 8px 24px rgba(31, 35, 40, 0.22); }
.homedaily .hd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.homedaily .eyebrow { color: var(--hero-accent); letter-spacing: 0.1em; }
.homedaily .hd-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.15; }
.atlashome .playbtn {
  position: static; flex: none; width: auto; height: 48px; margin: 0; padding: 0 22px; border: 0; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-text); font-family: var(--font); font-weight: 700; font-size: 16px; box-shadow: none;
}
.atlashome .playbtn.done { font-size: 15px; padding: 0 16px; }
.homebtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.atlashome .navbtn {
  min-width: 0; min-height: 48px; padding: 0 8px; border: 0; border-radius: 16px; flex-direction: row; gap: 0;
  background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 600; font-size: 15px; box-shadow: inset 0 0 0 1px var(--ink);
}
.atlashome .globebar { margin: 0; justify-content: flex-end; }
html.light .iconsbtn { background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--ink-soft); }
html.light .iconsbtn.on { background: var(--bg); color: var(--brand); box-shadow: inset 0 0 0 1px var(--ink); }
.atlashome .gmarks { z-index: 1; }

/* ---- Globes everywhere: the painted globe sits on bone with a soft shadow (drawn by globe.js), no blue glow ---- */
html.light .gpin.badge image { filter: drop-shadow(0 3px 4px rgba(59, 47, 34, 0.45)); }
html.light .groute { stroke: var(--route); stroke-width: 2; stroke-dasharray: 5 4; }
html.light .gsailed { stroke: var(--route); }
.gshape { stroke: #FFF6DC; }

/* ---- The Daily and voyage questions: the globe on bone, the question below it ---- */
.dhead { padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-left: max(22px, calc(14px + env(safe-area-inset-left, 0px))); padding-right: max(22px, calc(14px + env(safe-area-inset-right, 0px))); }
html.light .dq-count { color: var(--text); }
html.light .space .segbar .seg { background: var(--track); }
html.light .space .segbar .seg.now { background: transparent; box-shadow: inset 0 0 0 2px var(--text); }
html.light .space .segbar .seg.sG, html.light .gplay .segbar .seg.sG { background: var(--primary); }
html.light .space .segbar .seg.sY, html.light .gplay .segbar .seg.sY { background: #E0B04A; }
html.light .space .segbar .seg.sR, html.light .gplay .segbar .seg.sR { background: #E26A70; }
html.light .gplay .progress { background: var(--track); }
html.light .dsheet > .col { background: var(--bg); box-shadow: 0 -10px 24px rgba(59, 47, 34, 0.08); border-top: 1px solid var(--ink-soft); }
html.light .ptsfloat { box-shadow: 0 6px 14px rgba(59, 47, 34, 0.25); }
html.light .vsail .dmid span { color: var(--muted); }
html.light .dtop.pill .padbtn { background: var(--bg); color: var(--brand); }

/* ---- Results ---- */
html.light .dres .daily-hero h1 { color: var(--text); }
html.light .dres .col > .hint, html.light .dres .daily-hero .cheer { color: var(--muted); }

/* ---- Explore: cards over the globe on bone ---- */
.xhead { padding-top: calc(24px + env(safe-area-inset-top, 0px)); padding-left: max(22px, calc(14px + env(safe-area-inset-left, 0px))); padding-right: max(22px, calc(14px + env(safe-area-inset-right, 0px))); }
html.light .xhead h1 { color: var(--text); }
html.light .xcard { box-shadow: 0 0 0 1px var(--ink-soft), 0 16px 32px rgba(59, 47, 34, 0.22); }
.xdots { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
html.light .xdots i { background: #D9CFBF; }

/* ---- The small d3 voyage globe: atlas colours ---- */
html.light .space .vglobe { filter: drop-shadow(0 6px 8px rgba(59, 47, 34, 0.2)); }
html.light .space .vglobe .ocean { fill: var(--sea); stroke: var(--ink); stroke-width: 1.2; }
html.light .space .vglobe .grat { stroke-opacity: 0.12; }
html.light .space .vglobe .land { fill: #8FBF67; fill-opacity: 1; stroke: var(--ink); stroke-opacity: 0.7; stroke-width: 0.5; }
html.light .space .vglobe .route { stroke: var(--route); stroke-opacity: 0.7; }
html.light .space .vglobe .sailed { stroke: var(--route); }
html.light .space .vglobe .stop { fill: var(--bg); stroke: var(--ink); }
html.light .space .vglobe .stop.reached { fill: var(--route); }

/* ---- Voyage scenes: the corner globe on bone; opened, it covers the picture with bone, not a starry sky ---- */
.scn-top { padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-left: max(22px, calc(14px + env(safe-area-inset-left, 0px))); }
.scn-globe, .scn-nog { top: calc(22px + env(safe-area-inset-top, 0px)); right: max(22px, calc(14px + env(safe-area-inset-right, 0px))); }
/* The corner globe is just the globe (it draws its own outline and shadow): no circle behind it (Jude, Nov 22). */
html.light .scn:not(.open) .scn-globe { background: transparent; box-shadow: none; overflow: visible; border-radius: 50%; }
html.light .scn:not(.open) .scn-globe .globe3d { width: 100%; }
html.light .scn.open .scn-globe { background: var(--bg); background-image: none; }
html.light .scn-box { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 44px); box-shadow: 0 0 0 1px var(--ink), 0 14px 30px rgba(59, 47, 34, 0.25); }

/* ---- Menu, toasts and pop-ups keep their own surfaces above the frame ---- */
.menu, .toast, .overlay, .sheet-wrap { z-index: 60; }
/* "‹ Back" is a bone pill with an ink outline on every screen (it was only on the old sky screens). */
html.light .col > .back, html.light .col > form > .back {
  min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--bg); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--ink), 0 4px 12px rgba(59, 47, 34, 0.1);
}
.col.auth { padding-top: 12px; gap: 9px; }
.col.auth .back { padding: 0 14px; min-height: 36px; }
.col.auth form.card { gap: 5px; }
.col.auth .auth-mark { font-size: 34px; }
@media (max-height: 620px) { .col.auth { padding-top: 4px; gap: 6px; } .col.auth .back { min-height: 34px; } }
/* Daily results: the score ring and its labels were coloured for the old blue/dark hero; on bone they use the normal ink. */
html.light .dres { --hero-text: var(--text); --hero-muted: var(--muted); --hero-accent: var(--accent-text); --hero-track: var(--track); --hero-mark: var(--text); --hero-ring: var(--primary); }

/* Answer marks (results page, answers list): a soft tinted box per question, never black (Jude, Nov 22). */
.mark.mG, .daily-hero .mark.mG, .daily .mark.mG { background: var(--correct-fill); color: var(--correct); }
.mark.mY, .daily-hero .mark.mY, .daily .mark.mY { background: #FBEFCB; color: #8A5F00; }
.mark.mR, .daily-hero .mark.mR, .daily .mark.mR { background: var(--incorrect-fill); color: var(--incorrect); }

/* Explorations coming-soon page (prod only) */
.xsoon-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 4px 0 2px; }
.xsoon-hero h1 { margin: 0; font-family: var(--font-display); font-size: 34px; }
.xsoon-hero .lead { margin: 2px 0 0; max-width: 32ch; color: var(--muted); font-size: 16px; line-height: 1.4; }
.xsoon-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xsoon-points li { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px #E6DDCD; }
.xsoon-points strong { font-family: var(--font-display); font-size: 17px; }
.xsoon-points span { color: var(--muted); font-size: 15px; line-height: 1.4; }
.atlashome .homenav { align-items: stretch; }
.atlashome .homenav .globebar { align-self: flex-end; }
.vsurvey .msg:empty { display: none; }

/* ========== Nov 23: light / dark mode (Profile) ==========
   Dark (the default) = the globe screens on deep space with a blue glow round the globe; light = the bone-white look.
   Every bone-white colour above is scoped to html.light; these are the dark versions of the new home. */
:root { --ink: #3B2F22; --ink-soft: rgba(59, 47, 34, 0.16); --route: #B5442E; --sea: #1F5FA6; }
html:not(.light) .screen.atlashome { background-color: #040814; }
html:not(.light) .atlashome .hometop {
  background: radial-gradient(ellipse 75% 100% at 50% 0%, rgba(4, 8, 20, 0.82) 30%, rgba(4, 8, 20, 0.45) 62%, rgba(4, 8, 20, 0) 100%);
}
html:not(.light) .atlashome .homehi { color: #CFE3F7; }
html:not(.light) .atlashome .navbtn { background: rgba(255, 255, 255, 0.1); color: #FAF7F2; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html:not(.light) .groute { stroke: #FFD36B; stroke-width: 2; stroke-dasharray: 5 4; }
html:not(.light) .gsailed { stroke: #FFD36B; }

/* Profile: Appearance (theme + map icons) */
.prefrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.prefrow > span { font-weight: 600; }
.seg2 { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--track); gap: 2px; }
.seg2 button { min-height: 38px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer; }
.seg2 button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

/* Tapped country on the home map (Nov 23): its name, top left. Sits under the home header. */
.globe3d .gsel { position: absolute; left: 16px; top: calc(env(safe-area-inset-top, 0px) + 132px); z-index: 2; pointer-events: none;
  padding: 8px 14px; border-radius: 12px; background: rgba(15, 23, 42, 0.8); color: #F8FAFC; font: 600 15px/1.2 var(--ui, system-ui); }
html.light .globe3d .gsel { background: rgba(255, 255, 255, 0.9); color: #1F2328; border: 1px solid #ECE6DC; }
.globe3d .gsel[hidden] { display: none; }

/* ---------- Setup screen (Nov 27): one row of pickers, then the region picker ---------- */
.setrow { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.setbox { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 9px 12px; border-radius: 16px; border: 0; background: #FFFFFF; box-shadow: var(--shadow); text-align: left; font: inherit; color: #1F2328; cursor: pointer; box-sizing: border-box; min-width: 0; }
.setbox .setlabel { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #5C6370; }
.setbox .setval { display: flex; align-items: center; gap: 6px; width: 100%; font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setbox .caret { margin-left: auto; color: #5C6370; font-size: 14px; }
.sheethead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setbox .setsel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; } /* the phone's own picker, over the whole box */
.setbox:focus-within, .setbox:focus-visible { outline: 3px solid var(--selected); outline-offset: 1px; }
.modelist { display: flex; flex-direction: column; gap: 8px; }
.modeopt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: var(--text); }
.modeopt span { color: var(--muted); font-size: 14px; }
.modeopt[aria-checked="true"] { background: var(--selected); box-shadow: inset 0 0 0 2px var(--accent-text); }
.rgcard { gap: 10px; }
.rggrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rggrid.two { grid-template-columns: repeat(2, 1fr); }
.rgtile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 6px 8px; border-radius: 16px; border: 0; background: var(--raised); font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.rgtile .rgname { font-weight: 800; font-size: 13px; line-height: 1.15; text-align: center; }
.rgtile .rgsub { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.15; }
.rgtile[aria-pressed="true"] { background: var(--selected); box-shadow: inset 0 0 0 2px var(--accent-text); }
.rgtile:disabled { opacity: 0.4; cursor: not-allowed; }
.rgpic { display: block; }
.rgart { display: block; width: 100%; height: auto; border-radius: 11px; background: #DCEBFA; }
.rgart .rgbg { fill: #EFE8DC; }
.rgart .rgland { fill: #CFC6B6; } /* not picked */
.rgart[data-lit="all"] .rgland { fill: #61B76A; }
.rgart[data-lit~="af-n"] [data-part="af-n"], .rgart[data-lit~="af-w"] [data-part="af-w"], .rgart[data-lit~="af-m"] [data-part="af-m"],
.rgart[data-lit~="af-e"] [data-part="af-e"], .rgart[data-lit~="af-s"] [data-part="af-s"],
.rgart[data-lit~="as-w"] [data-part="as-w"], .rgart[data-lit~="as-c"] [data-part="as-c"], .rgart[data-lit~="as-s"] [data-part="as-s"],
.rgart[data-lit~="as-e"] [data-part="as-e"], .rgart[data-lit~="as-se"] [data-part="as-se"],
.rgart[data-lit~="eu-n"] [data-part="eu-n"], .rgart[data-lit~="eu-w"] [data-part="eu-w"], .rgart[data-lit~="eu-e"] [data-part="eu-e"], .rgart[data-lit~="eu-s"] [data-part="eu-s"],
.rgart[data-lit~="na-nc"] [data-part="na-nc"], .rgart[data-lit~="na-cb"] [data-part="na-cb"] { fill: #61B76A; }
.rgbottom { display: grid; grid-template-columns: 4fr 1fr; gap: 8px; }
.rgwide, .rgcustom { min-height: 54px; border-radius: 16px; border: 0; background: var(--raised); font: inherit; font-weight: 800; font-size: 16px; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 8px; }
.rgcustom { font-size: 14px; }
.rgwide[aria-pressed="true"], .rgcustom[aria-pressed="true"] { background: var(--selected); box-shadow: inset 0 0 0 2px var(--accent-text); }
.rgglobe { width: 26px; height: 26px; border-radius: 50%; background: url(clay/globe-spin.webp) 0 50% / 52px 26px repeat-x; }
.linkbtn { border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent-text); padding: 8px; cursor: pointer; }

/* source / report links under the answer (Dec 2): small, quiet, at the very bottom */
.srclinks { margin: 2px 0 0; display: flex; justify-content: center; gap: 18px; font-size: 13px; }
.srclinks a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
