/* Geonly, Frutiger Aero × pixel art.
 * Glossy glass panels and aqua buttons; pixel type for headings/numbers; Nunito for reading. */

:root {
  --ink: #0d3a52;
  --ink-soft: #3f6a80;
  --ink-faint: #7c9caf;
  --aqua: #16b2dc;
  --aqua-deep: #0784b3;
  --aqua-light: #7fe3fb;
  --grass: #5cc443;
  --grass-deep: #2e9435;
  --sun: #ffcd3a;
  --coral: #ff6b4a;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --shadow: 0 14px 40px rgba(6, 72, 110, 0.18), 0 2px 6px rgba(6, 72, 110, 0.10);

  --r-common: #7f97a3;
  --r-uncommon: #27b569;
  --r-rare: #2b86f0;
  --r-ultra: #8f52f5;
  --r-top1-a: #ffd84a;
  --r-top1-b: #ff9a1f;

  --px-font: "Silkscreen", "Courier New", monospace;
  --ui-font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --globe-h: 34vh;
  --step: 4px; /* pixel step for notched corners */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--ink);
  background: linear-gradient(180deg, #5fc6f2 0%, #93dbf8 34%, #c8efff 66%, #ecfbff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ───── backdrop layers ───── */
.sky-glare {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vmax 40vmax at 88% -8%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 60%),
    radial-gradient(50vmax 30vmax at 0% 110%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);
}
#sky, #globe { position: fixed; left: 0; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
#sky { top: 0; z-index: 0; opacity: 0.95; }
#globe { bottom: 0; z-index: 1; }

#app {
  position: relative; z-index: 2;
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0) 16px 0;
}

/* ───── top bar ───── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 980px; width: 100%; margin: 0 auto; padding: 14px 0 6px;
}
.logo { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; }
.logo-text {
  font-family: var(--px-font); font-weight: 700; font-size: 26px; letter-spacing: 0.5px;
  color: #fff; text-shadow: 0 2px 0 var(--aqua-deep), 0 0 12px rgba(255, 255, 255, 0.6);
}
body[data-screen="home"] .logo { visibility: hidden; }
.logo-globe {
  width: 26px; height: 26px; image-rendering: pixelated;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%230784b3' d='M4 0h5v1h2v2h1v2h1v3h-1v2h-1v2h-2v1H4v-1H2v-2H1V8H0V5h1V3h1V1h2z'/%3E%3Cpath fill='%2318b4dc' d='M4 1h5v1h2v2h1v5h-1v2h-2v1H4v-1H2V9H1V4h1V2h2z'/%3E%3Cpath fill='%235cc443' d='M3 3h3v1h1v2H5v1H3V5H2V4h1zM8 6h2v1h1v2h-1v1H8V9H7V7h1zM4 9h2v2H4z'/%3E%3Cpath fill='%23fff' d='M4 2h2v1H4zM3 3h1v1H3z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.hud { display: flex; align-items: center; gap: 8px; }
.hud-mode, .hud-km {
  font-family: var(--px-font); font-weight: 600; font-size: 15px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  border: 1px solid var(--glass-edge); box-shadow: 0 4px 14px rgba(6, 72, 110, .15);
}
.hud-mode { color: var(--aqua-deep); }
.hud-km b { font-weight: 700; font-size: 17px; }
.hud-km.bump b { animation: bump .5s ease; display: inline-block; }
.plane {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff9a1f' d='M3 0h1v2h3v1H4v2h1v1H2V5h1V3H0V2h3z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(220,244,255,.7));
  border: 1px solid #fff; box-shadow: 0 4px 14px rgba(6, 72, 110, .15), inset 0 1px 0 #fff;
}
.icon-btn:hover { filter: brightness(1.05); }
.spk {
  width: 20px; height: 20px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Cpath fill='%230784b3' d='M1 3h2v4H1zM3 2h1v6H3zM4 1h1v8H4z'/%3E%3Cpath fill='%2316b2dc' d='M6 3h1v1H6zM6 6h1v1H6zM7 4h1v2H7zM8 2h1v1H8zM8 7h1v1H8zM9 3h1v4H9z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.icon-btn.muted .spk {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Cpath fill='%237c9caf' d='M1 3h2v4H1zM3 2h1v6H3zM4 1h1v8H4z'/%3E%3Cpath fill='%23ff6b4a' d='M6 3h1v1H6zM7 4h1v1H7zM8 5h1v1H8zM9 6h1v1H9zM9 3h1v1H9zM8 4h1v1H8zM7 5h1v1H7zM6 6h1v1H6z'/%3E%3C/svg%3E");
}

/* ───── screens ───── */
.screen {
  flex: 1; width: 100%; max-width: 980px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: calc(var(--globe-h) * 0.72 + 24px);
}
#screen-game { justify-content: flex-start; padding-top: 2vh; }
#screen-results { padding-bottom: calc(var(--globe-h) * 0.35 + 24px); }

/* ───── glass ───── */
.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.62) 46%, rgba(240,251,255,.55) 100%);
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(160, 220, 245, .5);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
}
.glass::before { /* glossy top reflection */
  content: ""; position: absolute; left: 10px; right: 10px; top: 6px; height: 42%;
  border-radius: 18px 18px 50% 50% / 18px 18px 22px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0));
  pointer-events: none;
}
.glass > * { position: relative; }

/* ───── buttons ───── */
.btn {
  --b1: #6fe0ff; --b2: #12a6d6; --b3: #0a7fae;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
  min-height: 46px; padding: 0 26px;
  font-family: var(--px-font); font-weight: 700; font-size: 19px; letter-spacing: .5px;
  color: #fff; text-shadow: 0 1px 0 rgba(0, 60, 90, .45);
  border-radius: 999px; border: 1px solid var(--b3);
  background: linear-gradient(180deg, var(--b1) 0%, var(--b2) 55%, var(--b3) 100%);
  box-shadow: 0 6px 16px rgba(8, 110, 160, .30), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(0, 60, 100, .25);
  transition: transform .08s ease, filter .15s ease;
}
.btn::after { /* aqua capsule highlight */
  content: ""; position: absolute; left: 8%; right: 8%; top: 2px; height: 46%;
  border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.08));
  pointer-events: none;
}
.btn:hover { filter: brightness(1.06) saturate(1.1); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, .mode-card:focus-visible, .link:focus-visible, .r-row:focus-visible, .opt:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--aqua); }
.btn-green { --b1: #a6f07a; --b2: #4dbb3c; --b3: #2b8f30; box-shadow: 0 6px 16px rgba(40, 140, 50, .28), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(0, 80, 20, .22); }
.btn-glass {
  --b3: rgba(255,255,255,.95); color: var(--ink); text-shadow: none;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(225,245,255,.75));
  box-shadow: 0 6px 16px rgba(8, 110, 160, .15), inset 0 1px 0 #fff;
}
.btn-red {
  --b1: #ffa48f; --b2: #f2553d; --b3: #c2341f;
  box-shadow: 0 5px 14px rgba(200, 60, 35, .28), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(110, 20, 0, .22);
}
.btn-sm { min-height: 34px; padding: 0 16px; font-size: 13px; }
.link { background: none; border: 0; color: var(--ink-soft); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.link:hover { color: var(--ink); }

/* ───── home ───── */
.hero { text-align: center; margin: 1vh 0 22px; }
.title {
  margin: 0; font-family: var(--px-font); font-weight: 700;
  font-size: clamp(54px, 11vw, 112px); line-height: .95; letter-spacing: 0;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 45%, #c9f3ff 52%, #7fdcf7 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #0a86b6) drop-shadow(0 10px 18px rgba(0, 90, 140, .35));
}
.tagline {
  display: inline-block; margin: 14px 0 0; padding: 4px 14px; border-radius: 999px;
  font-weight: 900; font-size: clamp(15px, 2.2vw, 19px); color: var(--ink);
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .9);
}

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 720px; }
.mode-group {
  width: 100%; max-width: 720px; margin: 18px 0 8px; padding-left: 4px;
  font-family: var(--px-font); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 1px;
  color: #fff; text-shadow: 0 2px 0 var(--aqua-deep);
}
.hero + .mode-group { margin-top: 4px; }
.mode-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 20px 20px 18px; border-radius: 22px; transition: transform .15s ease;
}
.mode-card:hover { transform: translateY(-2px); }
.mode-kicker { font-family: var(--px-font); font-weight: 600; font-size: 14px; color: var(--aqua-deep); text-transform: uppercase; letter-spacing: 1px; }
.kicker-green { color: var(--grass-deep); }
.mode-title { font-weight: 900; font-size: 22px; line-height: 1.15; }
.mode-meta { font-size: 14px; font-weight: 700; color: var(--ink-soft); min-height: 2.5em; }
.mode-card .btn { margin-top: 8px; min-height: 40px; font-size: 17px; }

.how { width: 100%; max-width: 720px; margin-top: 16px; padding: 16px 20px 18px; }
.px-h { margin: 0 0 8px; font-family: var(--px-font); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: 1px; color: var(--aqua-deep); }
.how-list { margin: 0 0 12px; padding-left: 18px; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }
.how-list b { color: var(--ink); }
.ladder { display: flex; flex-wrap: wrap; gap: 8px; }
.ladder .rung { display: flex; align-items: center; gap: 6px; font-family: var(--px-font); font-weight: 600; font-size: 14px; color: var(--ink-soft); }

.bests { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.best {
  font-family: var(--px-font); font-weight: 600; font-size: 14px; color: var(--ink-soft);
  padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid #fff;
  box-shadow: 0 4px 12px rgba(6, 72, 110, .1);
}
.best b { color: var(--ink); font-size: 16px; }
.best.current { background: linear-gradient(180deg, #fff, #e2f8ff); border-color: var(--aqua-light); }

/* ───── social links (not wired yet) ───── */
.socials { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.social {
  --s1: #fff; --s2: #ddd;
  position: relative; overflow: hidden; width: 50px; height: 50px; border-radius: 16px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(180deg, var(--s1), var(--s2));
  box-shadow: 0 6px 16px rgba(6, 72, 110, .22), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -3px 6px rgba(0,0,0,.18);
  transition: transform .12s ease, filter .15s ease;
}
.social::after { /* glossy cap */
  content: ""; position: absolute; left: 4px; right: 4px; top: 2px; height: 45%;
  border-radius: 12px 12px 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.05)); pointer-events: none;
}
.social { animation: bob 2.8s ease-in-out infinite; }
.social:nth-child(2) { animation-delay: -.7s; }
.social:nth-child(3) { animation-delay: -1.4s; }
.social:nth-child(4) { animation-delay: -2.1s; }
.social:hover { transform: scale(1.08); filter: brightness(1.08); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.social svg { width: 28px; height: 28px; image-rendering: pixelated; position: relative; z-index: 1; }
.s-instagram { --s1: #ffb35c; --s2: #d62f8f; background: linear-gradient(45deg, #ffb347 0%, #f2584c 35%, #d62f8f 65%, #8b3cf0 100%); }
.s-tiktok { --s1: #3a3f47; --s2: #0c0e12; }
.s-x { --s1: #3a3f47; --s2: #0c0e12; }
.s-discord { --s1: #8f9bff; --s2: #4e5bea; }

/* ───── all answers (results) ───── */
.ans-all { grid-column: 1 / -1; margin-top: 8px; }
.ans-all summary { cursor: pointer; font-weight: 800; color: var(--aqua-deep); }
.ans-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.ans-chip { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid #d7e6ee; color: var(--ink); }
.ans-chip.r-uncommon { border-color: var(--r-uncommon); }
.ans-chip.r-rare { border-color: var(--r-rare); }
.ans-chip.r-ultra { border-color: var(--r-ultra); }
.ans-chip.r-top1 { background: linear-gradient(180deg, #fff3c4, #ffd36b); border-color: var(--r-top1-b); }
.ans-chip.mine { outline: 2px solid var(--aqua); outline-offset: 1px; }
.ans-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; }

/* ───── rarity badges (notched pixel corners) ───── */
.rar {
  --c: var(--r-common);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--px-font); font-weight: 700; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap;
  color: #fff; background: var(--c); padding: 3px 9px 4px;
  clip-path: polygon(0 var(--step), var(--step) var(--step), var(--step) 0, calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step), 100% var(--step),
                     100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step)) 100%, var(--step) 100%,
                     var(--step) calc(100% - var(--step)), 0 calc(100% - var(--step)));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.35);
}
.r-common { --c: var(--r-common); }
.r-uncommon { --c: var(--r-uncommon); }
.r-rare { --c: var(--r-rare); }
.r-ultra { --c: var(--r-ultra); }
.r-top1 { background: linear-gradient(180deg, var(--r-top1-a), var(--r-top1-b)); color: #5a2a00; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.r-none { --c: #b7c6ce; }
.rar.big { font-size: 22px; padding: 7px 18px 9px; --step: 6px; }
.r-top1.big { animation: shine 1.6s ease-in-out infinite; }

/* ───── game card ───── */
.qcard { width: 100%; max-width: 640px; padding: 18px 22px 18px; }
.qhead { display: flex; align-items: center; gap: 12px; }
.chip {
  font-family: var(--px-font); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--aqua-deep); background: rgba(22, 178, 220, .12); border: 1px solid rgba(22, 178, 220, .35);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.pips { display: flex; gap: 5px; flex: 1; justify-content: center; }
.pip { width: 12px; height: 12px; background: rgba(13, 58, 82, .14); clip-path: polygon(0 3px, 3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px)); }
.pip.now { background: #fff; box-shadow: inset 0 0 0 2px var(--aqua); animation: blink 1s steps(2) infinite; }
.pip.r-common { background: var(--r-common); } .pip.r-uncommon { background: var(--r-uncommon); }
.pip.r-rare { background: var(--r-rare); } .pip.r-ultra { background: var(--r-ultra); }
.pip.r-top1 { background: linear-gradient(180deg, var(--r-top1-a), var(--r-top1-b)); }
.pip.r-none { background: #c9d6dc; }
.qnum { font-family: var(--px-font); font-weight: 700; font-size: 16px; color: var(--ink-soft); white-space: nowrap; }

.prompt { margin: 18px 0 14px; font-weight: 900; font-size: clamp(24px, 4.2vw, 34px); line-height: 1.15; letter-spacing: -.2px; text-wrap: balance; }

.timer { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cells { flex: 1; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; height: 14px; }
.cell { background: linear-gradient(180deg, #8ff0a0, #3fc35a); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.5); }
.cell.off { background: rgba(13, 58, 82, .1); box-shadow: none; }
.timer.warn .cell:not(.off) { background: linear-gradient(180deg, #ffb199, var(--coral)); }
.timer.warn .secs { color: var(--coral); animation: blink .5s steps(2) infinite; }
.secs { font-family: var(--px-font); font-weight: 700; font-size: 22px; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }

.answer { display: flex; gap: 10px; }
.answer input {
  flex: 1; min-width: 0; height: 54px; padding: 0 18px;
  font-family: var(--ui-font); font-weight: 800; font-size: 20px; color: var(--ink);
  border-radius: 16px; border: 2px solid rgba(22, 178, 220, .45);
  background: linear-gradient(180deg, #f3fbff, #ffffff 40%);
  box-shadow: inset 0 2px 6px rgba(6, 72, 110, .12);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.answer input::placeholder { color: #9bb7c6; font-weight: 700; }
.answer input:focus { border-color: var(--aqua); box-shadow: inset 0 2px 6px rgba(6, 72, 110, .12), 0 0 0 4px rgba(22, 178, 220, .2); }
.answer input:disabled { opacity: .6; }
.answer .go { min-height: 54px; padding: 0 22px; }
.answer.shake { animation: shake .35s; }
.answer.shake input { border-color: var(--coral); }

.feedback { min-height: 30px; margin-top: 10px; font-weight: 800; font-size: 15px; }
.feedback .bad { color: #d6452a; }
.feedback .ask { color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt {
  font-weight: 800; font-size: 15px; padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(180deg, #fff, #dff6ff); border: 1px solid var(--aqua-light); color: var(--aqua-deep);
  box-shadow: 0 3px 8px rgba(6, 72, 110, .12);
}
.opt:hover { background: linear-gradient(180deg, #fff, #c9efff); }
.opt.no { color: var(--ink-soft); border-color: #d3e3ea; background: #fff; }
.qfoot { display: flex; justify-content: flex-end; margin-top: 2px; }

.reveal { text-align: center; padding: 4px 0 2px; animation: pop .35s ease; }
.reveal-answer { font-weight: 900; font-size: clamp(26px, 4.6vw, 36px); line-height: 1.1; }
.reveal-answer .typed { display: block; font-size: 14px; font-weight: 700; color: var(--ink-faint); margin-top: 4px; }
.reveal-badge { margin: 12px 0 6px; }
.reveal-badge .rar { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
.reveal-gain { font-family: var(--px-font); font-weight: 700; font-size: 24px; color: var(--aqua-deep); }
.reveal-gain .km { color: var(--grass-deep); }
.reveal-extra { margin: 8px auto 0; max-width: 46ch; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.reveal-extra b { color: var(--ink); }
.reveal .next { margin-top: 14px; min-width: 180px; }
.hint { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-faint); }
kbd { font-family: var(--px-font); font-size: 12px; padding: 1px 6px; border-radius: 5px; background: #fff; border: 1px solid #cfe2ea; box-shadow: 0 2px 0 #cfe2ea; }
.timeout-title { color: var(--coral); }

/* ───── results ───── */
.rcard { width: 100%; max-width: 680px; padding: 22px 22px 18px; text-align: center; }
.r-kicker { font-family: var(--px-font); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--aqua-deep); }
.r-label { margin-top: 8px; font-family: var(--px-font); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: 2px; }
.r-km {
  font-family: var(--px-font); font-weight: 700; font-size: clamp(34px, 11vw, 88px); line-height: 1; white-space: nowrap;
  color: #fff; -webkit-text-stroke: 0;
  text-shadow: 0 3px 0 var(--aqua-deep), 0 6px 0 rgba(7, 132, 179, .35), 0 12px 24px rgba(0, 90, 140, .3);
  margin: 4px 0 6px;
}
.r-sub { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 800; color: var(--ink-soft); }
.dot { color: var(--ink-faint); }
.r-newbest { display: inline-block; margin-top: 10px; font-family: var(--px-font); font-weight: 700; color: #5a2a00; padding: 4px 12px;
  background: linear-gradient(180deg, var(--r-top1-a), var(--r-top1-b)); border-radius: 999px; animation: shine 1.6s ease-in-out infinite; }

.r-list { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.r-row {
  width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.6); text-align: left; transition: background .15s;
}
.r-row:hover { background: rgba(255,255,255,.88); }
.r-row.is-flag { grid-template-columns: 26px 44px minmax(0, 1fr) auto; }
.r-flag { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(13, 58, 82, .18), 0 2px 5px rgba(6, 72, 110, .15); }
.r-bigflag { grid-column: 1 / -1; margin-top: 8px; }
.r-bigflag img { width: 160px; max-width: 100%; border-radius: 6px; box-shadow: 0 0 0 1px rgba(13, 58, 82, .18), 0 6px 14px rgba(6, 72, 110, .2); }

/* ───── flag quiz ───── */
.flag-wrap { display: flex; justify-content: center; margin: -4px 0 14px; }
.flag-wrap img {
  width: min(300px, 70vw); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #fff;
  box-shadow: 0 0 0 1px rgba(13, 58, 82, .18), 0 10px 26px rgba(6, 72, 110, .22);
  animation: pop .35s ease;
}
body[data-mode="flags"] .prompt { font-size: clamp(18px, 3vw, 24px); text-align: center; margin: 14px 0 12px; }
@media (max-height: 760px) { .flag-wrap img { width: min(220px, 60vw); } }
.r-n { font-family: var(--px-font); font-weight: 700; font-size: 16px; color: var(--ink-faint); }
.r-main { min-width: 0; }
.r-q { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-a { display: block; font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-a.miss { color: var(--ink-faint); font-weight: 800; }
.r-right { display: flex; align-items: center; gap: 8px; }
.r-gain { font-family: var(--px-font); font-weight: 700; font-size: 15px; color: var(--grass-deep); min-width: 64px; text-align: right; }
.r-detail {
  margin: 2px 4px 6px; padding: 10px 14px; border-radius: 12px; background: rgba(230, 248, 255, .75);
  border: 1px dashed rgba(22, 178, 220, .45); font-size: 14px; font-weight: 700; color: var(--ink-soft);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; animation: pop .2s ease;
}
.r-detail dt { color: var(--ink-faint); }
.r-detail dd { margin: 0; color: var(--ink); }
.r-detail .r-note { grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.r-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.r-next { margin-top: 10px; font-family: var(--px-font); font-weight: 600; font-size: 14px; color: var(--ink-soft); min-height: 1em; }

/* ───── animation ───── */
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-6deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes bump { 30% { transform: scale(1.3); color: var(--grass-deep); } }
@keyframes shine { 50% { filter: brightness(1.15) saturate(1.2); box-shadow: 0 0 18px rgba(255, 190, 40, .7); } }

/* ───── small screens ───── */
@media (max-width: 640px) {
  .modes { grid-template-columns: 1fr; }
  .mode-meta { min-height: 0; }
  .qcard, .rcard { padding: 16px 16px 14px; border-radius: 18px; }
  .prompt { margin: 14px 0 12px; }
  .answer input { height: 50px; font-size: 18px; }
  .answer .go { min-height: 50px; padding: 0 16px; }
  .pips { gap: 3px; } .pip { width: 9px; height: 9px; }
  .r-row { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; }
  .r-gain { min-width: 0; }
  .r-right .rar { display: none; }
  .screen { padding-bottom: calc(var(--globe-h) * 0.55 + 16px); }
  .logo-text { font-size: 19px; }
  .logo-globe { width: 22px; height: 22px; }
  .hud-mode { display: none; }
  .hud-km { font-size: 13px; padding: 6px 10px; }
  .hud-km b { font-size: 15px; }
  .chip { font-size: 11px; letter-spacing: .5px; padding: 3px 8px; }
  .qnum { font-size: 14px; margin-left: auto; }
  .r-kicker { font-size: 13px; letter-spacing: .5px; }
  .r-label { font-size: 18px; }
}
@media (max-width: 480px) {
  .pips { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* flag quiz: shrink the flag while the answer is revealed so the globe animation stays visible */
#qcard:has(#revealView:not([hidden])) .flag-wrap img { width: min(150px, 40vw); }
#qcard:has(#revealView:not([hidden])) .timer { display: none; }

/* ───── v4: flag section (smaller, warm sunset palette so the geography quiz stands out) ───── */
.mode-group-flags { max-width: 600px; margin-top: 22px; font-size: 13px; text-shadow: 0 2px 0 #d9622b; }
.modes-flags { max-width: 600px; gap: 12px; }
.modes-flags .mode-card {
  padding: 13px 16px 12px; gap: 3px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,251,242,.9) 0%, rgba(255,236,212,.7) 55%, rgba(255,224,200,.6) 100%);
  border-color: rgba(255, 246, 230, .95);
  box-shadow: 0 10px 26px rgba(170, 80, 20, .16), inset 0 1px 0 #fff;
}
.modes-flags .mode-kicker { color: #d9622b; font-size: 12px; }
.modes-flags .mode-title { font-size: 17px; }
.modes-flags .mode-meta { font-size: 12.5px; min-height: 0; }
.modes-flags .btn { min-height: 32px; padding: 0 18px; font-size: 14px; margin-top: 6px; }
.btn-sun {
  --b1: #ffe48f; --b2: #ffb12f; --b3: #e07812;
  color: #5a2600; text-shadow: 0 1px 0 rgba(255,255,255,.45);
  box-shadow: 0 5px 14px rgba(210, 110, 20, .28), inset 0 1px 0 rgba(255,255,255,.85), inset 0 -3px 6px rgba(120, 50, 0, .18);
}
.rar.r-correct, .pip.r-correct { --c: #27b569; background: #27b569; }
body[data-mode="flags"] .hud-km .plane { display: none; }

/* social icons bob 35% slower */
.social { animation-duration: 4.3s; }
.social:nth-child(2) { animation-delay: -1.08s; }
.social:nth-child(3) { animation-delay: -2.15s; }
.social:nth-child(4) { animation-delay: -3.23s; }
body[data-mode="flags"] .r-sub .dot { display: none; }
div.r-row { cursor: default; }
div.r-row:hover { background: rgba(255,255,255,.6); }

/* ═════════════ v5: Daily Archive / Flag Archive ═════════════ */

/* ───── home: geography quiz = [Daily][Archive] over a full-width, half-height Unlimited ───── */
.modes-geo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modes-geo > .mode-card:not(.mode-wide) .mode-meta { margin-bottom: 8px; }
.modes-geo > .mode-card:not(.mode-wide) .btn,
.modes-flags > .mode-card .btn { margin-top: auto; }
.mode-card.mode-wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 20px; row-gap: 2px;
  padding: 14px 22px 14px 20px;
  background: linear-gradient(100deg, rgba(232, 255, 220, .92) 0%, rgba(255, 255, 255, .72) 42%, rgba(240, 251, 255, .58) 100%);
}
.mode-wide > .mode-kicker, .mode-wide > .mode-title, .mode-wide > .mode-meta { grid-column: 1; }
.mode-wide > .mode-title { font-size: 20px; }
.mode-wide > .mode-meta { min-height: 0; }
.mode-card.mode-wide > .btn { grid-column: 2; grid-row: 1 / span 3; margin: 0; min-height: 48px; padding: 0 38px; font-size: 19px; }

.kicker-blue { color: #1d62c6; }
.btn-blue {
  --b1: #9fd6ff; --b2: #3a8ff0; --b3: #1d62c6;
  box-shadow: 0 6px 16px rgba(29, 98, 198, .28), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(0, 40, 110, .22);
}
.mode-archive { background: linear-gradient(180deg, rgba(255,255,255,.88) 0%, rgba(236,245,255,.66) 50%, rgba(224,238,255,.58) 100%); }
.modes-flags .mode-archive { background: linear-gradient(180deg, rgba(255,251,242,.9) 0%, rgba(255,236,212,.7) 55%, rgba(255,224,200,.6) 100%); }
.ico-cal {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -1px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11' shape-rendering='crispEdges'%3E%3Cpath fill='%230d3a52' d='M1 2h9v1h1v8H0V3h1z'/%3E%3Cpath fill='%23fff' d='M1 5h9v5H1z'/%3E%3Cpath fill='%23ff6b4a' d='M1 3h9v2H1z'/%3E%3Cpath fill='%230d3a52' d='M3 1h1v3H3zM7 1h1v3H7z'/%3E%3Cpath fill='%2316b2dc' d='M2 6h1v1H2zM4 6h1v1H4zM6 6h1v1H6zM8 6h1v1H8zM2 8h1v1H2zM4 8h1v1H4zM6 8h1v1H6z'/%3E%3Cpath fill='%235cc443' d='M8 8h1v1H8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ───── home: flag quiz = three equal tiles in one row ───── */
.mode-group-flags, .modes-flags { max-width: 720px; }
.modes-flags { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modes-flags .mode-meta { margin-bottom: 4px; }

/* ───── archive screen ───── */
.acard {
  --ac: var(--aqua); --ac-deep: var(--aqua-deep); --ac-light: var(--aqua-light);
  --ac-1: #6fe0ff; --ac-2: #12a6d6; --ac-3: #0a7fae; --ac-tint: rgba(230, 248, 255, .75); --ac-cell: #e6f8ff;
  width: 100%; max-width: 560px; padding: 20px 22px 16px; text-align: center;
}
#screen-archive[data-type="flags"] .acard {
  --ac: #ffb12f; --ac-deep: #d9622b; --ac-light: #ffd59a;
  --ac-1: #ffe48f; --ac-2: #ffb12f; --ac-3: #e07812; --ac-tint: rgba(255, 240, 222, .8); --ac-cell: #fff1de;
  background: linear-gradient(180deg, rgba(255,251,242,.9) 0%, rgba(255,240,222,.72) 50%, rgba(255,230,208,.62) 100%);
}
#screen-archive[data-type="flags"] .r-kicker { color: var(--ac-deep); }
.a-title { margin: 6px 0 2px; font-weight: 900; font-size: clamp(22px, 4vw, 28px); line-height: 1.15; }
.a-sub { margin: 0 0 16px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-month { font-family: var(--px-font); font-size: 18px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.cal-month b { color: var(--ink); }
.cal-arrow {
  width: 40px; height: 40px; flex: none; border-radius: 50%; padding: 0;
  border: 1px solid #fff; box-shadow: 0 4px 14px rgba(6, 72, 110, .15), inset 0 1px 0 #fff;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%230d3a52' d='M4 0h2v1H4zM3 1h2v1H3zM2 2h2v1H2zM1 3h2v1H1zM2 4h2v1H2zM3 5h2v1H3zM4 6h2v1H4z'/%3E%3C/svg%3E") center/14px no-repeat,
              linear-gradient(180deg, rgba(255,255,255,.95), rgba(220,244,255,.7));
  image-rendering: pixelated; transition: transform .12s ease, filter .15s ease, opacity .15s;
}
.cal-arrow.next { transform: scaleX(-1); }
.cal-arrow:not(:disabled):hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(6, 72, 110, .22), inset 0 1px 0 #fff, 0 0 0 2px var(--ac-light); }
.cal-arrow:not(:disabled):active { translate: 0 1px; }
.cal-arrow:disabled { opacity: .35; cursor: default; box-shadow: none; }
.cal-arrow:focus-visible, .cal-day:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { margin-bottom: 6px; font-family: var(--px-font); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); }
.cal-dow span:nth-child(n+6) { color: var(--ac-deep); opacity: .7; }
.cal-grid.slide-l { animation: calL .22s ease; }
.cal-grid.slide-r { animation: calR .22s ease; }
@keyframes calL { from { opacity: 0; transform: translateX(14px); } }
@keyframes calR { from { opacity: 0; transform: translateX(-14px); } }

.cal-day {
  position: relative; overflow: hidden; aspect-ratio: 1 / .84; min-width: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 12px; border: 1px solid transparent; background: none; color: var(--ink);
}
.cal-num { font-family: var(--px-font); font-weight: 700; font-size: 16px; line-height: 1; position: relative; z-index: 1; }
.cal-day.is-blank { visibility: hidden; }
.cal-day.is-off { color: rgba(13, 58, 82, .26); background: rgba(255, 255, 255, .2); border: 1px dashed rgba(255, 255, 255, .7); }
.cal-day.is-off .cal-num { font-weight: 400; }
.cal-day.is-available, .cal-day.is-today {
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.cal-day.is-available {
  background: linear-gradient(180deg, #fff 0%, var(--ac-cell) 100%); border-color: var(--ac-light);
  box-shadow: 0 3px 8px rgba(6, 72, 110, .12), inset 0 1px 0 #fff, inset 0 -2px 0 rgba(22, 178, 220, .15);
}
.cal-day.is-today {
  color: #fff; text-shadow: 0 1px 0 rgba(0, 60, 90, .45); border-color: var(--ac-3);
  background: linear-gradient(180deg, var(--ac-1) 0%, var(--ac-2) 58%, var(--ac-3) 100%);
  box-shadow: 0 5px 12px rgba(8, 110, 160, .28), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(0, 60, 100, .22);
}
#screen-archive[data-type="flags"] .cal-day.is-today { color: #5a2600; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.cal-day.is-available::after, .cal-day.is-today::after {   /* glossy cap, like the aqua buttons */
  content: ""; position: absolute; left: 8%; right: 8%; top: 2px; height: 42%; border-radius: 9px 9px 40% 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,0)); pointer-events: none;
}
.cal-day.is-available:hover, .cal-day.is-today:hover { transform: translateY(-2px); border-color: var(--ac); box-shadow: 0 7px 14px rgba(6, 72, 110, .2), inset 0 1px 0 #fff; }
.cal-day.is-available:active, .cal-day.is-today:active { transform: translateY(0) scale(.97); }
.cal-day.is-selected, .cal-day.is-selected:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--ac), 0 8px 16px rgba(6, 72, 110, .22);
}
.cal-tag { font-family: var(--px-font); font-size: 8.5px; letter-spacing: .5px; text-transform: uppercase; line-height: 1; position: relative; z-index: 1; }
.cal-mark { position: absolute; z-index: 2; top: 3px; right: 3px; width: 13px; height: 13px; image-rendering: pixelated; }
.cal-mark.done, .lg-done {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%2327b569' d='M1 0h7v1h1v7H8v1H1V8H0V1h1z'/%3E%3Cpath fill='%23fff' d='M6 2h1v1H6zM5 3h1v1H5zM2 4h1v1H2zM4 4h1v1H4zM3 5h1v1H3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.cal-mark.prog { width: 8px; height: 8px; top: 5px; right: 5px; background: var(--sun); box-shadow: 0 0 0 1px #e09a12; animation: blink 1.2s steps(2) infinite; }

.a-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.lg { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 4px; image-rendering: pixelated; }
.lg-avail { background: linear-gradient(180deg, #fff, var(--ac-cell)); border: 1px solid var(--ac-light); }
.lg-done { border-radius: 0; }
.lg-today { background: linear-gradient(180deg, var(--ac-1), var(--ac-3)); }

.a-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px;
  padding: 12px 14px 12px 18px; border-radius: 16px; text-align: left;
  background: var(--ac-tint); border: 1px dashed var(--ac-light);
}
.a-pick-text { min-width: 0; }
.a-pick-date { font-weight: 900; font-size: 17px; line-height: 1.2; }
.a-pick-status { margin-top: 2px; font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.a-pick .btn { flex: none; min-height: 42px; font-size: 17px; }
.a-pick.is-empty { justify-content: center; text-align: center; }
.acard .r-actions { margin-top: 12px; }

/* ───── archive: small screens ───── */
@media (max-width: 640px) {
  .modes-geo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .modes-geo > .mode-card:not(.mode-wide) { padding: 14px 13px 13px; gap: 4px; border-radius: 18px; }
  .modes-geo .mode-kicker { font-size: 11px; letter-spacing: .2px; }
  .modes-geo > .mode-card:not(.mode-wide) .mode-title { font-size: 17px; }
  .modes-geo > .mode-card:not(.mode-wide) .mode-meta { font-size: 12.5px; }
  .modes-geo > .mode-card:not(.mode-wide) .btn { align-self: stretch; min-height: 38px; padding: 0 10px; font-size: 15px; }
  .mode-card.mode-wide { padding: 12px 14px 12px 16px; column-gap: 12px; border-radius: 18px; }
  .mode-wide > .mode-title { font-size: 17px; }
  .mode-wide > .mode-meta { font-size: 12.5px; }
  .mode-card.mode-wide > .btn { min-height: 42px; padding: 0 22px; font-size: 16px; }
  .hide-sm { display: none; }

  /* flag tiles: one compact row each (text left, button right) */
  .modes-flags { grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 8px; }
  .modes-flags .mode-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 1px; padding: 10px 12px 10px 14px; }
  .modes-flags .mode-card > :not(.btn) { grid-column: 1; }
  .modes-flags .mode-card > .btn { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .modes-flags .mode-meta { margin-bottom: 0; }

  .acard { padding: 16px 14px 14px; border-radius: 18px; }
  .a-sub { font-size: 12.5px; margin-bottom: 12px; }
  .cal-dow, .cal-grid { gap: 4px; }
  .cal-day { border-radius: 9px; }
  .cal-num { font-size: 14px; }
  .cal-tag { font-size: 7px; letter-spacing: 0; }
  .cal-mark { width: 11px; height: 11px; top: 2px; right: 2px; }
  .cal-month { font-size: 16px; }
  .cal-arrow { width: 36px; height: 36px; }
  .a-pick { flex-wrap: wrap; padding: 12px 14px; }
  .a-pick .btn { flex: 1 1 100%; }
}
@media (max-width: 360px) {
  .modes-geo { grid-template-columns: 1fr; }
  .cal-tag { display: none; }
}

/* ───── how to play: rarity ladder as an even 3 × 2 grid (incl. Skip = +0 km) ───── */
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ladder .rung {
  justify-content: space-between; gap: 8px; min-width: 0;
  padding: 6px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .9);
}
.ladder .rung-km { white-space: nowrap; }

/* ───── game: quiet reminder under the answer box (geography Daily) ───── */
.qfoot { align-items: center; gap: 12px; }
.q-hint { margin-right: auto; font-size: 12.5px; font-weight: 700; color: var(--ink-faint); }

@media (max-width: 640px) {
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ladder .rung { padding: 5px 8px; font-size: 12px; }
  .ladder .rar { font-size: 11px; padding: 3px 6px 4px; letter-spacing: .4px; }
  .q-hint { font-size: 11.5px; }
}
.ladder .rung { padding: 6px 8px; gap: 6px; }
.ladder .rar { font-size: 11.5px; letter-spacing: .2px; padding: 3px 7px 4px; }
.ladder .rung-km { font-size: 13px; }
@media (max-width: 640px) {
  .ladder .rung { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 6px; }
  .ladder .rung-km { font-size: 12.5px; }
}

/* ───── socials: YouTube + five icons ───── */
.s-youtube { --s1: #ff6a5c; --s2: #d4110a; }
.social:nth-child(2) { animation-delay: -.86s; }
.social:nth-child(3) { animation-delay: -1.72s; }
.social:nth-child(4) { animation-delay: -2.58s; }
.social:nth-child(5) { animation-delay: -3.44s; }
@media (max-width: 380px) {
  .socials { gap: 10px; }
  .social { width: 46px; height: 46px; border-radius: 14px; }
  .social svg { width: 26px; height: 26px; }
}

/* ───── home: best scores = one glass strip aligned with the sections (4 equal cells) ───── */
.mode-group-bests { margin-top: 22px; }
.home-bests {
  width: 100%; max-width: 720px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0; border-radius: 18px;
}
.home-bests::before { border-radius: 14px 14px 50% 50% / 14px 14px 18px 18px; }
.hb-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 13px 16px 14px; }
.hb-cell + .hb-cell { border-left: 1px solid rgba(22, 178, 220, .2); }
.hb-cell.hb-flags:nth-child(3) { border-left-color: rgba(22, 178, 220, .38); }
.hb-k { font-family: var(--px-font); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--aqua-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-flags .hb-k { color: #d9622b; }
.hb-v { font-family: var(--px-font); font-weight: 700; font-size: 20px; line-height: 1.1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-v.none { font-size: 14px; font-weight: 400; color: var(--ink-faint); line-height: 1.6; }

/* ───── follow line with a pixel heart, set like a letter of the text ───── */
.follow {
  margin: 26px 0 0; text-align: center;
  font-family: var(--px-font); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 1px;
  color: #fff; text-shadow: 0 2px 0 var(--aqua-deep);
}
.px-heart {
  display: inline-block; width: 1.05em; height: .9em; margin-left: .45em; vertical-align: -.02em; image-rendering: pixelated;
  filter: drop-shadow(0 2px 0 var(--aqua-deep));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath fill='%2318a8e8' d='M1 0h2v1H1zM4 0h2v1H4zM0 1h7v2H0zM1 3h5v1H1zM2 4h3v1H2zM3 5h1v1H3z'/%3E%3Cpath fill='%23fff' d='M1 1h1v1H1z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.follow + .socials { margin-top: 12px; }

@media (max-width: 640px) {
  .home-bests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-cell { padding: 11px 14px 12px; }
  .hb-cell:nth-child(3) { border-left: 0; }
  .hb-cell:nth-child(n+3) { border-top: 1px solid rgba(22, 178, 220, .38); }
  .hb-k { font-size: 11px; letter-spacing: .4px; }
  .hb-v { font-size: 18px; }
  .follow { font-size: 14px; }
}
.hb-k { font-size: 11px; letter-spacing: .6px; white-space: normal; overflow: visible; line-height: 1.25; }
.hb-v { overflow: visible; }
.hb-v small { font-size: .62em; font-weight: 600; color: var(--ink-soft); }
.hb-cell { justify-content: space-between; padding: 13px 14px 14px; }
@media (max-width: 640px) {
  .hb-k { font-size: 10.5px; letter-spacing: .3px; }
  .hb-v { font-size: 17px; }
}
@media (max-width: 360px) {
  .hb-cell { padding: 10px 11px 11px; }
  .hb-v { font-size: 15px; }
}

/* ───── title: the O of GEONLY is a tiny spinning pixel Earth ───── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.title-o {
  /* same box as the Silkscreen "O": 0.875em advance, ink 0.64em wide × 0.63em tall, sitting on the baseline */
  display: inline-block; width: .875em; height: .63em; vertical-align: baseline; position: relative;
}
.title-o canvas {
  position: absolute; left: .115em; bottom: 0; width: .64em; height: .64em;
  image-rendering: pixelated; image-rendering: crisp-edges;
  animation: titleBob 4.9s ease-in-out infinite;
}
@keyframes titleBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.025em; } }

/* ───── phones: full-bleed sky, no white bars, no rubber-band pull ─────
   iOS ignores background-attachment: fixed, so the sky gradient lives on a fixed layer sized to the
   LARGE viewport (address bar hidden). The document colour behind everything is sky blue, so the
   browser's own bars, the notch area and any overscroll are tinted blue instead of white. */
html { background: #5fc6f2; overscroll-behavior: none; }
body { background: none; overscroll-behavior: none; }
body::before {
  content: ""; position: fixed; z-index: 0; left: 0; right: 0; top: 0; pointer-events: none;
  height: 100vh; height: 100lvh;
  background: linear-gradient(180deg, #5fc6f2 0%, #93dbf8 34%, #c8efff 66%, #ecfbff 100%);
}
#app { min-height: 100vh; min-height: 100dvh; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
#app { padding-top: 0; }
@media (display-mode: fullscreen), (display-mode: standalone) { .fs-btn { display: none !important; } }

/* full-screen toggle (only where the browser supports it, e.g. Android Chrome) */
.fs-ico {
  width: 18px; height: 18px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%230784b3' d='M0 0h3v1H1v2H0zM6 0h3v3H8V1H6zM0 6h1v2h2v1H0zM8 6h1v3H6V8h2z'/%3E%3Cpath fill='%2316b2dc' d='M3 3h3v3H3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fs-btn.on .fs-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%230784b3' d='M2 0h1v3H0V2h2zM6 0h1v2h2v1H6zM0 6h3v3H2V7H0zM6 6h3v1H7v2H6z'/%3E%3Cpath fill='%2316b2dc' d='M4 4h1v1H4z'/%3E%3C/svg%3E");
}

/* iPhone (no full-screen API in Safari): a one-time tip to add Geonly to the Home Screen */
.ios-tip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 6px 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; color: var(--ink-soft);
  background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .95);
}
.ios-tip b { color: var(--ink); }
.ios-tip button { width: 22px; height: 22px; border: 0; border-radius: 50%; padding: 0; background: rgba(13, 58, 82, .1); color: var(--ink-soft); font-weight: 900; line-height: 1; }

/* ═════════════ v7: accounts, Premium, ads, legal ═════════════ */

/* ───── account button (top right) ───── */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px; border-radius: 999px;
  font-family: var(--px-font); font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: var(--aqua-deep);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(220,244,255,.7));
  border: 1px solid #fff; box-shadow: 0 4px 14px rgba(6, 72, 110, .15), inset 0 1px 0 #fff;
  transition: filter .15s ease, transform .08s ease;
}
.acct-btn:hover { filter: brightness(1.05); }
.acct-btn:active { transform: translateY(1px); }
.acct-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--aqua); }
.acct-face { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(180deg, #e6f8ff, #bfeaff); box-shadow: inset 0 0 0 1px rgba(7, 132, 179, .25); }
.acct-face svg { width: 18px; height: 18px; image-rendering: pixelated; }
.acct-face .acct-img, .acct-face .px-face { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.acct-label { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-premium .acct-face { box-shadow: 0 0 0 2px var(--r-top1-b), 0 0 8px rgba(255, 180, 40, .6); }

.acct-menu {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 32px));
  padding: 16px; border-radius: 20px; text-align: left; animation: pop .18s ease;
}
.am-head { display: flex; align-items: center; gap: 12px; }
.am-head > div { min-width: 0; display: flex; flex-direction: column; }
.am-head b { font-weight: 900; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-head span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.am-face { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(6, 72, 110, .2); }
.px-face { display: grid; place-items: center; background: linear-gradient(180deg, #e6f8ff, #bfeaff); }
.am-face.px-face svg { width: 26px; height: 26px; image-rendering: pixelated; }
body.is-premium .am-face { box-shadow: 0 0 0 2px var(--r-top1-b), 0 4px 12px rgba(255, 160, 30, .45); }
.g-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 14px; min-height: 46px; padding: 0 16px;
  font-family: var(--ui-font); font-weight: 800; font-size: 16px; color: #1f1f1f;
  background: #fff; border: 1px solid #dadce0; border-radius: 999px; box-shadow: 0 3px 10px rgba(6, 72, 110, .14);
  transition: background .15s ease, box-shadow .15s ease;
}
.g-btn:hover { background: #f7fbff; box-shadow: 0 5px 14px rgba(6, 72, 110, .2); }
.g-btn svg { width: 20px; height: 20px; }
.am-note { margin: 10px 2px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.45; }
.am-err { margin: 8px 2px 0; font-size: 12.5px; font-weight: 800; color: #d6452a; }
.am-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(230, 248, 255, .8); border: 1px solid rgba(22, 178, 220, .3); font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.am-status > span { display: flex; flex-direction: column; }
.am-status b { color: var(--ink); font-size: 14px; font-weight: 900; }
.am-status.is-premium { justify-content: flex-start; background: linear-gradient(180deg, #fff6d6, #ffe39a); border-color: #ffc95a; color: #7a4300; }
.am-status.is-premium b { font-family: var(--px-font); font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: #6a3300; }
.am-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.am-stats > div { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .95); }
.am-stats dt { font-family: var(--px-font); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--aqua-deep); }
.am-stats dd { margin: 2px 0 0; font-family: var(--px-font); font-weight: 700; font-size: 15px; color: var(--ink); }
.am-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.am-del { font-size: 12.5px; color: var(--ink-faint); }
.am-del[data-armed] { color: #d6452a; }

/* pixel icons: padlock (locked modes) and gem (Premium) */
.ico-lock, .ico-gem { display: inline-block; flex: none; image-rendering: pixelated; }
.ico-lock {
  width: 9px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 9' shape-rendering='crispEdges'%3E%3Cpath fill='%235a2a00' d='M2 0h3v1h1v3h1v5H0V4h1V1h1zM2 1v3h3V1z'/%3E%3Cpath fill='%23fff3c4' d='M3 5h1v2H3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ico-gem {
  width: 18px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23c25e00' d='M2 0h5v1h1v1h1v2H8v1H7v1H6v1H5v1H4V7H3V6H2V5H1V4H0V2h1V1h1z'/%3E%3Cpath fill='%23ffd84a' d='M2 1h5v1h1v2H7v1H6v1H5v1H4V6H3V5H2V4H1V2h1z'/%3E%3Cpath fill='%23fff6c8' d='M2 2h2v1H2zM3 1h1v1H3z'/%3E%3Cpath fill='%23ff9a1f' d='M5 4h2v1H6v1H5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ───── locked Premium tiles ───── */
.lock-chip {
  display: none; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 7px 2px 6px; vertical-align: 1px;
  font-family: var(--px-font); font-weight: 700; font-size: 10px; letter-spacing: .6px; line-height: 1.3; color: #5a2a00;
  background: linear-gradient(180deg, var(--r-top1-a), var(--r-top1-b)); border-radius: 6px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .5);
}
body.premium-locked [data-premium] .lock-chip { display: inline-flex; }
body.premium-locked [data-premium] .btn { filter: saturate(.85); }

/* ───── modals (Premium, checkout result) ───── */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(143, 220, 247, .55), rgba(6, 72, 110, .45)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-card { width: 100%; max-width: 440px; padding: 26px 26px 20px; text-align: center; animation: pop .25s ease; }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 20px; font-weight: 900; line-height: 1; color: var(--ink-soft);
  background: rgba(255, 255, 255, .8); border: 1px solid #fff; box-shadow: 0 3px 8px rgba(6, 72, 110, .15);
}
.modal-x:hover { color: var(--ink); background: #fff; }
.pm-gem { width: 64px; height: 56px; margin: 2px auto 10px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 #c25e00) drop-shadow(0 10px 18px rgba(255, 160, 30, .45)); animation: bob 4.3s ease-in-out infinite; }
.pm-gem { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23c25e00' d='M2 0h5v1h1v1h1v2H8v1H7v1H6v1H5v1H4V7H3V6H2V5H1V4H0V2h1V1h1z'/%3E%3Cpath fill='%23ffd84a' d='M2 1h5v1h1v2H7v1H6v1H5v1H4V6H3V5H2V4H1V2h1z'/%3E%3Cpath fill='%23fff6c8' d='M2 2h2v1H2zM3 1h1v1H3z'/%3E%3Cpath fill='%23ff9a1f' d='M5 4h2v1H6v1H5z'/%3E%3C/svg%3E") center/contain no-repeat; }
.pm-title { margin: 6px 0 4px; font-family: var(--px-font); font-weight: 700; font-size: clamp(21px, 5vw, 26px); line-height: 1.15; text-transform: uppercase; letter-spacing: .5px; color: var(--ink); }
.pm-sub { margin: 0 0 14px; font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.pm-list { list-style: none; margin: 0 auto 16px; padding: 0; max-width: 330px; text-align: left; display: grid; gap: 7px; }
.pm-list li { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.pm-list i {
  flex: none; width: 18px; height: 18px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%2327b569' d='M1 0h7v1h1v7H8v1H1V8H0V1h1z'/%3E%3Cpath fill='%23fff' d='M6 2h1v1H6zM5 3h1v1H5zM2 4h1v1H2zM4 4h1v1H4zM3 5h1v1H3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pm-price { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border-radius: 16px; background: linear-gradient(180deg, #fff6d6, #ffe7a6); border: 1px solid #ffd27a; }
.pm-price b { font-family: var(--px-font); font-weight: 700; font-size: 30px; color: #6a3300; text-shadow: 0 2px 0 #ffc24a; }
.pm-price span { font-family: var(--px-font); font-weight: 700; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; color: #8a4a00; }
.pm-cta { width: 100%; min-height: 52px; font-size: 20px; }
.pm-cta:disabled { opacity: .75; cursor: progress; }
.pm-note { margin: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pm-note.bad { color: #d6452a; }
.pm-fine { margin: 8px 0 0; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); }
.pm-fine a, .pm-note a { color: inherit; }
.co-card { max-width: 400px; }
.co-icon { width: 64px; height: 56px; margin: 4px auto 10px; image-rendering: pixelated; }
.co-icon.wait { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%230784b3' d='M4 0h5v1h2v2h1v2h1v3h-1v2h-1v2H9v1H4v-1H2v-2H1V8H0V5h1V3h1V1h2z'/%3E%3Cpath fill='%2318b4dc' d='M4 1h5v1h2v2h1v5h-1v2H9v1H4v-1H2V9H1V4h1V2h2z'/%3E%3Cpath fill='%235cc443' d='M3 3h3v1h1v2H5v1H3V5H2V4h1zM8 6h2v1h1v2h-1v1H8V9H7V7h1zM4 9h2v2H4z'/%3E%3Cpath fill='%23fff' d='M4 2h2v1H4zM3 3h1v1H3z'/%3E%3C/svg%3E") center/contain no-repeat; animation: spinY 1.6s steps(8) infinite; }
.co-icon.done { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23c25e00' d='M2 0h5v1h1v1h1v2H8v1H7v1H6v1H5v1H4V7H3V6H2V5H1V4H0V2h1V1h1z'/%3E%3Cpath fill='%23ffd84a' d='M2 1h5v1h1v2H7v1H6v1H5v1H4V6H3V5H2V4H1V2h1z'/%3E%3Cpath fill='%23fff6c8' d='M2 2h2v1H2zM3 1h1v1H3z'/%3E%3Cpath fill='%23ff9a1f' d='M5 4h2v1H6v1H5z'/%3E%3C/svg%3E") center/contain no-repeat; filter: drop-shadow(0 4px 0 #c25e00); animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
.co-card #coBtn { margin-top: 4px; min-width: 200px; }
@keyframes spinY { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.25); } }
@keyframes fade { from { opacity: 0; } }

/* ───── toast ───── */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px; text-align: center;
  font-weight: 800; font-size: 14.5px; animation: pop .25s ease; transition: opacity .3s ease;
}
.toast.out { opacity: 0; }

/* ───── best scores: total distance row ───── */
.hb-total {
  grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px 13px; border-top: 1px solid rgba(22, 178, 220, .38);
  background: linear-gradient(90deg, rgba(232, 255, 220, .55), rgba(255, 255, 255, 0) 70%);
}
.hb-total .hb-k { color: var(--grass-deep); }
.hb-total .hb-v { font-size: 22px; }

/* ───── advertising ───── */
.ad-slot { position: relative; }
.ad-tag { display: block; margin-bottom: 4px; font-family: var(--px-font); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: rgba(13, 58, 82, .45); text-align: center; }
.ad-box { overflow: hidden; border-radius: 10px; }
/* side rails: only when there is room beside the 720 px column, never over the game */
.ad-rail { position: fixed; z-index: 3; top: 96px; width: 160px; display: none; }
.ad-rail .ad-box { width: 160px; height: 600px; }
.ad-left { left: calc(50% - 360px - 40px - 160px); }
.ad-right { right: calc(50% - 360px - 40px - 160px); }
@media (min-width: 1160px) and (min-height: 760px) { body.ads-on .ad-rail:not([hidden]) { display: block; } }
@media (min-width: 1500px) and (min-height: 760px) {
  .ad-rail { width: 300px; } .ad-rail .ad-box { width: 300px; }
  .ad-left { left: calc(50% - 360px - 48px - 300px); } .ad-right { right: calc(50% - 360px - 48px - 300px); }
}
.ad-bottom { width: 100%; max-width: 728px; margin: 22px auto 0; }
.ad-bottom .ad-box { min-height: 90px; }
@media (max-width: 640px) { .ad-bottom { margin-top: 18px; } .ad-bottom .ad-box { min-height: 100px; } }
/* ?ads=preview: outlines to check the layout (no real or fake ads) */
body.ads-preview .ad-box { border: 2px dashed rgba(7, 132, 179, .5); background: rgba(255, 255, 255, .35); display: grid; place-items: center; }
body.ads-preview .ad-box::after { content: "Ad space"; font-family: var(--px-font); font-size: 12px; color: rgba(7, 132, 179, .7); }

/* ───── legal links ───── */
.legal { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.legal a, .legal button { color: var(--ink-soft); background: none; border: 0; padding: 2px; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.legal a:hover, .legal button:hover { color: var(--ink); }
.legal-ps { display: inline-flex; gap: 8px; }

@media (max-width: 640px) {
  .acct-label { display: none; }
  .acct-btn { padding: 0 5px; width: 40px; justify-content: center; }
  .lock-chip { font-size: 0; gap: 0; padding: 3px 4px; margin-left: 6px; }
  .modal-card { padding: 22px 18px 18px; }
  .pm-list li { font-size: 14px; }
  .hb-total { padding: 11px 14px 12px; }
  .hb-total .hb-v { font-size: 19px; }
}

/* ───── privacy policy / terms pages ───── */
body.doc-page { min-height: 100vh; padding: max(20px, env(safe-area-inset-top)) 16px 40px; }
.doc { position: relative; z-index: 2; width: 100%; max-width: 760px; margin: 0 auto; padding: 26px 30px 24px; line-height: 1.6; font-weight: 600; color: var(--ink-soft); }
.doc h1 { margin: 4px 0 2px; font-family: var(--px-font); font-weight: 700; font-size: clamp(26px, 5vw, 34px); text-transform: uppercase; letter-spacing: .5px; color: var(--ink); }
.doc h2 { margin: 22px 0 6px; font-family: var(--px-font); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; color: var(--aqua-deep); }
.doc p, .doc li { font-size: 15px; }
.doc b, .doc em { color: var(--ink); }
.doc a { color: var(--aqua-deep); font-weight: 800; }
.doc ul { padding-left: 20px; }
.doc-date { margin: 0 0 8px; font-size: 13px; color: var(--ink-faint); }
.doc-back { display: inline-block; margin-bottom: 12px; font-size: 14px; text-decoration: none; }
.doc-foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(22, 178, 220, .25); font-size: 14px; }
.todo { color: #c2341f !important; background: #ffe3dc; border-radius: 4px; padding: 0 4px; font-weight: 800; }
@media (max-width: 640px) { .doc { padding: 20px 18px 18px; } }
.am-status .btn { flex: none; white-space: nowrap; padding: 0 14px; }
.am-status > span { min-width: 0; }
/* AdSense had nothing to show for a slot: hide the whole place (no empty "Advertisement" box) */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }

/* ───── account: a round icon next to the sound button (same look), the whole account menu below it ───── */
.acct-btn { width: 40px; height: 40px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; }
.acct-btn .acct-face { width: 32px; height: 32px; background: none; box-shadow: none; }
.acct-btn .acct-face svg { width: 20px; height: 20px; }
.acct-btn.in .acct-face { box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(6, 72, 110, .25); }
body.is-premium .acct-btn.in .acct-face { box-shadow: 0 0 0 2px var(--r-top1-b), 0 0 8px rgba(255, 180, 40, .6); }
.acct-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--aqua-light), 0 4px 14px rgba(6, 72, 110, .15); }
/* the menu lines up with the right edge of the top bar (under the sound button) */
.acct-menu { position: fixed; top: calc(max(14px, env(safe-area-inset-top)) + 52px); right: max(16px, calc((100vw - 980px) / 2)); }
/* anchor the account menu to the button group, so it lines up exactly with the sound button */
.top-right { position: relative; }
.acct { position: static; }
.acct-menu { position: absolute; top: calc(100% + 10px); right: 0; }
.g-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
