/* Colours: Feetle is always dark */
:root {
  --bg: #212121; --fg: #e8e8e8; --muted: #9a9a9a; --border: #6b6b6b; --key: #5a5a5a;
  --accent: #f2a81d; --accent-fg: #212121; --bad: #ff6b5b;
  --panel: #2c2c2c; --line: #3a3a3a; --line2: #555; --faint: #333333;
  color-scheme: dark;
}
* { box-sizing: border-box; }
button { font-family: inherit; }
/* Stop double-tap-to-zoom when tapping keys quickly (pinch zoom still works) */
html, body, button, .key { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  background: var(--bg); color: var(--fg); font-family: system-ui, sans-serif; }
header { width: 100%; text-align: center; padding: 12px 16px 8px; border-bottom: 1px solid var(--faint); }
h1 { margin: 0; font-size: 1.8rem; display: inline-flex; align-items: center; gap: 8px; }
.logo { height: 1.3em; }
#subheader { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
main { flex: 1; width: 100%; max-width: 500px; overflow-y: auto; padding: 20px 16px 0; }
#board { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.row { display: flex; gap: 8px; }
.tile { width: 66px; height: 66px; display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  border: 2px solid var(--border); text-transform: uppercase; }
.row.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
#message { text-align: center; min-height: 1.4em; font-weight: 600; }
#message.bad { color: var(--bad); }
#keyboard { width: 100%; max-width: 500px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.krow { display: flex; gap: 6px; justify-content: center; }
.key { flex: 1; max-width: 40px; height: 44px; border: none; border-radius: 4px; background: var(--key); color: var(--fg);
  font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.key.wide { max-width: 56px; flex: 1.4; font-size: .8rem; }
footer { display: flex; gap: 26px; justify-content: center; padding: 12px 16px 20px; flex-wrap: wrap; }
.link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; }
.link:hover { color: var(--fg); }
dialog { border: none; border-radius: 10px; background: var(--panel); color: var(--fg); max-width: min(420px, calc(100vw - 32px)); padding: 24px; }
dialog::backdrop { background: #000a; }
dialog .close:not(.primary) { position: absolute; top: 8px; right: 12px; background: none; border: none; color: var(--fg); font-size: 1.2rem; cursor: pointer; }
.primary { font-family: inherit; display: block; margin: 16px auto 0; padding: 10px 28px; border: none; border-radius: 6px; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 1rem; cursor: pointer; }
.example { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.example div { display: flex; gap: 4px; }
.example span { width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--border); font-weight: 700; }
.example span.hl { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 4px; }
.stats-grid b { font-size: 1.6rem; display: block; }
.stats-grid small { color: var(--muted); }
.stats-grid.three { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.stat-tabs { display: flex; gap: 6px; justify-content: center; }
.stat-tab { font-family: inherit; font-weight: 700; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line2); background: none; color: var(--muted); cursor: pointer; }
.stat-tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
@media (max-width: 520px) { .stat-tab { padding: 10px 18px; font-size: 1.05rem; } }
.primary:disabled { opacity: .4; cursor: default; }
.bar { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.bar span:first-child { width: 2em; text-align: right; }
.bar div { background: var(--key); padding: 1px 6px; min-width: 1.6em; text-align: right; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini .row { gap: 4px; }
.mini .tile { width: 34px; height: 34px; font-size: 1rem; }
.credit { color: var(--accent); text-align: center; }
.credit a { color: inherit; }
.guide-link { text-align: center; margin: 18px 0 6px; }
.guide-link a { color: var(--accent); font-weight: 600; }
.tile.hit { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
a.link { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.poop { height: 1.2em; }
dialog[open] { animation: fade-in .2s ease-out; }
dialog[open]::backdrop { animation: fade-in .2s ease-out; }
dialog.closing, dialog.closing::backdrop { animation: fade-out .2s ease-in forwards; }
/* new entry row: boxes fade in one by one, left to right (same timing as the ability cards) */
.row.enter .tile { opacity: 0; animation: diffIn .5s ease-out forwards; }
.row.enter .tile:nth-child(2) { animation-delay: .15s; }
.row.enter .tile:nth-child(3) { animation-delay: .3s; }
.row.enter .tile:nth-child(4) { animation-delay: .45s; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes fade-out { from { opacity: 1 } to { opacity: 0 } }
@media (max-width: 520px) {
  footer { width: 100%; gap: 6px 10px; padding: 10px 8px 16px; flex-wrap: nowrap; justify-content: space-evenly; }
  footer .link { font-size: .75rem; padding: 4px 0; white-space: nowrap; }
}
.link.icon { display: inline-flex; align-items: center; padding: 0; }
header { position: relative; }
.corner-l, .corner-r { position: absolute; top: 50%; transform: translateY(-50%); }
/* Keep icons inside the same 500px column as the board, so desktop matches mobile */
.corner-l { left: max(28px, calc(50% - 222px)); }
.corner-r { right: max(28px, calc(50% - 222px)); }
/* Phone bottom banner: space reserved up front so the page doesn't jump when the ad loads.
   Gap above keeps it away from the links; padding below clears the phone's home bar. */
/* #kb-space: the game pages' space under the keyboard for the bottom ad (named so ad blockers don't hide it: they hide #ad-bottom) */
:is(#ad-bottom, #kb-space) { width: 100%; height: calc(50px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); margin-top: 4px; display: flex; justify-content: center; overflow: hidden; flex-shrink: 0; }
:is(#ad-bottom, #kb-space)[hidden] { display: none; }
/* Local ad-placement preview */
.ad-mock { display: grid; place-items: center; background: #ffffff14; border: 1px dashed #ffffff55; color: #ffffff88; font-size: .75rem; pointer-events: none; }
/* side rails grow with the free margin: 160px wide on smaller desktops, up to 300px (the high-paying 300x600) on wide ones */
.ad-mock.rail, .ad-rail { position: fixed; top: 50%; transform: translateY(-50%); width: clamp(160px, calc((100vw - 600px) / 2), 300px);   /* keeps at least ~40px between the ad and the game */ height: 600px; max-height: calc(100vh - 40px); }
.ad-mock.rail.l { left: 8px; }
.ad-mock.rail.r { right: 8px; }
.ad-mock.rail { text-align: center; line-height: 1.4; z-index: 1; }
@media (max-width: 1100px), (max-height: 639px) { .ad-mock.rail.page { display: none; } }
/* game pages: Publift's lhs/rhs_game_vrec take narrower sizes, so they show from 772px wide (matches the ad test pages) */
.ad-mock.rail.game { width: clamp(120px, calc((100vw - 500px) / 2 - 24px), 300px); }
@media (max-width: 771px), (max-height: 639px) { .ad-mock.rail.game { display: none; } }
/* phones: Publift's sticky footer (320x50), in a 100px space under the game keyboard */
/* scrolling pages (answers, blog, articles) on phones: room at the bottom sized to the ad footer (ad-space.js) */
@media (max-width: 520px) { body.ad-foot-pad { padding-bottom: calc(var(--ad-foot, 50px) + env(safe-area-inset-bottom)); transition: padding-bottom .25s ease; } }
#kb-space.fuse-space { height: calc(var(--ad-foot, 50px) + env(safe-area-inset-bottom)); align-items: flex-end; transition: height .25s ease; }   /* sized to the ad footer (ad-space.js) */
/* local mockup of the ad network's sticky footer (ad-mock.js): pinned to the bottom like the real one; tap it to try 100 / 50 / closed */
.ad-mock.fuse-foot.fuse-mock-foot { position: fixed; left: 50%; bottom: 0; translate: -50% 0; z-index: 30; width: 320px; height: var(--mock-h, 100px); cursor: pointer; pointer-events: auto; background: #2b2b2b; }   /* solid and tappable, like the real one */
.ad-mock.fuse-foot.fuse-mock-foot[hidden] { display: none; }
.ad-mock.fuse-foot { width: 320px; height: 50px; text-align: center; line-height: 1.3; }
.ad-mock small { font-size: .65rem; opacity: .8; }
/* live side-rail ads: same spot and size as the local placeholders (wide desktop only, added by game.js / unlimited.js) */
.ad-rail { z-index: 1; }
.ad-rail.l { left: 8px; }
.ad-rail.r { right: 8px; }
@media (max-width: 1100px), (max-height: 639px) { .ad-rail { display: none; } }
.link.faint { color: var(--faint); }
.link.faint:hover { color: var(--muted); }
a.stats-follow { display: flex; width: fit-content; margin: 14px auto 0; gap: 6px; }
.stats-yesterday { display: block; margin: 14px auto 0; text-decoration: underline; }
#countdown { margin: 4px 0 0; color: var(--muted); font-size: .85rem; text-align: center; }
/* Unlimited mode */
.mode-tag { font-size: .8rem; font-weight: 700; color: var(--accent-fg); background: var(--accent); border-radius: 4px; padding: 2px 6px; }
/* Unlimited abilities: rarity colours */
.common { --rar: #9a9a9a; } .uncommon { --rar: #4caf50; } .rare { --rar: #42a5f5; } .legendary { --rar: #f2a81d; }
#tools { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 6px; }
#slots { display: flex; gap: 8px; justify-content: center; }
.give-up { font-family: inherit; font-weight: 700; font-size: .9rem; height: 50px; padding: 0 14px; border: none; border-radius: 8px; background: #d93a2b; color: #fff; cursor: pointer; }
.give-up:hover { background: #ef4a3a; }
.give-up[hidden] { display: none; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.confirm-btns .primary { margin: 0; height: 50px; }
#slots[hidden] { display: none; }
.slot { font-family: inherit; width: 64px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 8px; border: 2px solid var(--rar, var(--line)); background: var(--panel); color: var(--fg); cursor: pointer; padding: 0; }
.slot span { font-size: 1.1rem; line-height: 1; }
.slot small { font-size: .65rem; color: var(--muted); }
.slot.empty { border: 2px dashed var(--line); background: none; cursor: default; }
.slot:disabled { opacity: .5; cursor: default; }
#offer[hidden] { display: none; }
.cards { display: flex; gap: 8px; justify-content: center; }
.card { font-family: inherit; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 8px; border: 2px solid var(--rar); background: var(--panel); color: var(--fg); cursor: pointer; opacity: 0; animation: diffIn .7s ease-out forwards; }   /* same timing as the difficulty buttons */
.card:nth-child(2) { animation-delay: .35s; } .card:nth-child(3) { animation-delay: .7s; }
.card:hover { background: #353535; }
.card .icon { font-size: 1.5rem; }
.card small { font-size: .7rem; color: var(--muted); line-height: 1.25; }
.card .rar { color: var(--rar); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.skip { display: block; margin: 12px auto 0; text-decoration: underline; }
.offer-btns { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.offer-btns .primary { margin: 0; padding: 10px 20px; }
.offer-btns .primary.ghost { background: transparent; color: var(--fg, inherit); box-shadow: inset 0 0 0 2px #555; }
.offer-btns .primary:has(.key-hint) { position: relative; }
.key-hint { position: absolute; left: 0; right: 0; bottom: 4px; font-size: .52rem; font-weight: 600; line-height: 1; opacity: .75; }   /* sits in the padding, so the button text stays put */
@media (hover: none) { .key-hint { display: none; } }   /* touch screens have no spacebar */
#skipYes { background: #d93a2b; color: #fff; }   /* the confirm Skip: red like Give up, since it throws hints away */
#skipYes:hover { background: #ef4a3a; }
.skip:disabled { opacity: .4; cursor: default; text-decoration: none; }
#startPick h2 { text-align: center; }
.tile.pin { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#roundLine { margin: 6px 0 0; color: var(--muted); font-weight: 600; text-align: center; min-height: 1.2em; }   /* Unlimited: difficulty + par */
#streakLine { margin: 2px 0 2px; color: var(--fg); font-weight: 600; font-size: 1.1rem; text-align: center; }   /* Unlimited: Feet streak */
#picker { text-align: center; margin-top: 16px; flex: 1; display: flex; flex-direction: column; }
main:has(#picker:not([hidden])) { display: flex; flex-direction: column; }
main:has(#picker:not([hidden])) #message { display: none; }
#picker .diffs { margin: auto 0; }   /* centred in the space between the heading and the keyboard */
.diffs .diff { opacity: 0; animation: diffIn .7s ease-out forwards; }
.diffs .diff:nth-child(2) { animation-delay: .35s; }
.diffs .diff:nth-child(3) { animation-delay: .7s; }
@keyframes diffIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#picker[hidden], .primary[hidden] { display: none; }
#picker h2 { font-size: 1.1rem; margin: 0 0 12px; }
.diffs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.diff { font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 92px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--fg); cursor: pointer; }
.diff:hover { border-color: var(--accent); }
.diff b { font-size: 1rem; }
.diff small { color: var(--muted); font-size: .75rem; }
.next-label { text-align: center; color: var(--muted); margin: 18px 0 8px; }
.gave-up { text-align: center; color: var(--muted); margin: 4px 0 0; font-size: .85rem; }
.streak-big { text-align: center; font-size: 1.05rem; }
/* Enter key: muted green that sits with the dark grey + gold scheme */
.key[data-k="enter"] { background: #3f7a4c; }
.key[data-k="enter"]:hover { background: #47895a; }
/* Game pages (phone and desktop): the page itself stays put and just the word grid scrolls */
body:is(.game-page, :has(#keyboard)) { height: 100dvh; min-height: 0; overflow: hidden; }
body:is(.game-page, :has(#keyboard)) main { min-height: 0; overscroll-behavior: contain; }
/* solve: each FEET tile expands then compresses, left to right (delays set in celebrate.js) */
.tile.bob { animation: bob .45s ease-in-out both; }
@keyframes bob { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } 70% { transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .tile.bob { animation-delay: calc(var(--i, 0) * .22s) !important; } }
/* under par: the gold wave that sweeps down the board (rows timed in celebrate.js) */
.tile.wave { animation: wave .42s ease-out; }
@keyframes wave { 0% { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); box-shadow: 0 0 14px #ffd36b; } 100% { } }
/* our foot logo used in place of the 🦶 emoji in on-screen text */
.emoji-foot { height: 1.15em; width: auto; vertical-align: -0.2em; display: inline-block; margin-left: .2em; }
/* stats popup: Share results + Share streak side by side */
.share-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.share-btns .primary { margin: 0; padding: 8px 18px; font-size: .9rem; }
/* local preview only: mock of a Google Auto ads side rail (light ad on the far window edge) */
/* accounts: header person icon (left of stats), sign-in popup, guest nudge */
.corner-acct { position: absolute; top: 50%; transform: translateY(-50%); left: calc(max(28px, calc(50% - 222px)) + 36px); }
.corner-acct.signed-in { color: var(--accent); }
#account { max-width: min(380px, calc(100vw - 32px)); }
#account h2 { margin-top: 0; }
.acct-sub { color: var(--muted); font-size: .9rem; }
.acct-small { color: var(--muted); font-size: .8rem; text-align: center; margin: 4px 0 0; }
.acct-error { color: var(--bad); font-weight: 600; }
.acct-google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-radius: 6px; background: #fff; color: #222 !important; font-weight: 700; text-decoration: none; }
.acct-google.disabled { opacity: .45; pointer-events: none; }
.acct-or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 14px 0; font-size: .85rem; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-email, .acct-user { display: flex; flex-direction: column; gap: 8px; }
.acct-email input, .acct-user input { font: inherit; padding: 10px; border-radius: 6px; border: 1px solid var(--line2); background: #1b1b1b; color: var(--fg); }
.acct-email .primary, .acct-user .primary { margin: 0; }
.acct-msg { min-height: 1.2em; font-size: .85rem; color: var(--muted); }
.acct-msg a { color: var(--accent); }
.acct-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.acct-actions a.link { text-decoration: none; }
.acct-danger { color: var(--bad) !important; }
.acct-nudge { text-align: center; color: var(--muted); font-size: .85rem; margin: 14px 0 0; }
.acct-nudge .link { color: var(--accent); text-decoration: underline; font-size: inherit; padding: 0; }
.acct-small a { color: var(--accent); }
/* player avatar: the foot logo with a color filter + accessory layered on top (src/avatar.js) */
.foot-av { position: relative; display: inline-block; aspect-ratio: 254 / 480; vertical-align: middle; flex: none; }
.foot-av img { display: block; height: 100%; width: 100%; }
.foot-av svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.av-rainbow img { animation: av-rainbow 4s linear infinite; animation-delay: var(--rb, 0s); }   /* --rb (avatar.js): every rainbow foot follows one shared clock, so a redrawn foot does not restart at red */
@keyframes av-rainbow { to { filter: hue-rotate(360deg) saturate(1.3); } }
h1 .foot-av.logo { height: 1.3em; }
.corner-acct .foot-av { margin: 0 2px; }
.av-head { display: flex; align-items: center; gap: 14px; }
.av-head h2 { margin: 0; }
.av-title { margin: 18px 0 2px; font-size: 1rem; }
.av-label { margin: 10px 0 6px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
/* Accessory: greyed out and not tappable, with COMING SOON floating over the boxes */
.av-soon { position: relative; }
.av-soon .av-grid { filter: grayscale(1) brightness(.45); opacity: .55; pointer-events: none; }
.av-soon .av-grid > * { color: transparent; }
.av-soon .av-grid > * > * { visibility: hidden; }   /* blank boxes */
.av-soon > span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg); opacity: .6; font-size: 1.25rem; font-weight: 800; letter-spacing: .1em; text-shadow: 0 2px 8px #000; pointer-events: none; }
.av-opt { font-family: inherit; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 6px; border-radius: 8px; border: 2px solid var(--line); background: #262626; color: var(--fg); cursor: pointer; }
.av-opt:hover { border-color: var(--line2); }
.av-opt.on { border-color: var(--accent); }
.av-opt small { font-size: .62rem; color: var(--muted); line-height: 1.1; text-align: center; }
.av-opt.locked { cursor: default; }
.av-lock { position: absolute; top: 18px; font-size: 1rem; }
.av-msg { min-height: 1em; color: var(--bad); font-size: .85rem; margin: 6px 0 0; }
#account { max-height: calc(100dvh - 32px); overflow-y: auto; }
/* local testing only: the Restart puzzle and Reset rating buttons (game.js) */
.dev-resets { display: flex; gap: 6px; justify-content: center; margin: 2px auto 6px; }
.dev-reset { display: block; margin: 0; padding: 3px 10px; font-size: .75rem; color: #ff9d9d; background: transparent; border: 1px dashed #ff9d9d; border-radius: 6px; cursor: pointer; }
/* under par message: gold text with a soft, steady glow */
#message.underpar { color: var(--accent); font-weight: 700; text-shadow: 0 0 10px rgba(255, 211, 107, .7); }
/* stats popup: "Try again" offer after a solve that wasn't under par (game.js) */
.retry { text-align: center; margin: 10px 0 4px; }
.retry p { margin: 0 0 8px; color: var(--accent); font-weight: 600; }/* word suggestions: the small red "?" beside a row whose word isn't in the list (suggest.js) */
#board .row.current { position: relative; }
.suggest-q { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 6px; padding: 6px 8px; background: none; border: none;
  color: var(--bad); font: inherit; font-weight: 600; font-size: 1rem; line-height: 1; cursor: pointer; }
.suggest-dlg h2 { margin-top: 0; }
/* DUTT easter egg (egg.js): Flight's face in place of the red "?" */
.suggest-q.dutt-egg { padding: 0; margin-left: 8px; line-height: 0; }
.dutt-egg img { display: block; width: 30px; height: auto; filter: drop-shadow(0 2px 4px #0008); transition: transform .12s; }
.dutt-egg img { transform-origin: left center; }
.dutt-egg.pop img { animation: dutt-pop .35s ease-out; }
@media (max-width: 420px) { .suggest-q.dutt-egg { margin-left: 4px; } }   /* phones: less room beside the row */
@keyframes dutt-pop { 40% { transform: scale(1.1) rotate(-6deg); } 100% { transform: scale(1); } }
.suggest-dlg .secondary { background: transparent; border: 1px solid var(--line2); color: var(--fg); }
/* 👍 / 👎 under Results, and the feedback popup it can open (src/feedback.js) */
.rate { margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.rate p { margin: 0 0 8px; color: var(--muted); font-size: .9rem; width: 0; min-width: 100%; }   /* wraps inside the popup instead of widening it */
.rate.stacked { display: grid; }   /* 👍 👎 row: its versions stacked in one cell (feedback.js) */
.rate-layer { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; visibility: hidden; }
.rate-layer.on { visibility: visible; }
.rate-btns { display: flex; gap: 10px; justify-content: center; }
.rate-btns button:not(.primary) { display: grid; place-items: center; width: 52px; height: 40px; padding: 0; line-height: 1; border-radius: 8px; border: 1px solid var(--line2); background: transparent; font-size: 1.3rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rate-btns button:not(.primary):hover { border-color: var(--accent); }
.rate-btns .primary { margin: 0; padding: 8px 16px; font-size: .9rem; flex: 0 1 9.5em; }   /* Leave feedback and No thanks: same width */
.rate .secondary, .feedback-dlg .secondary { background: transparent; border: 1px solid var(--line2); color: var(--fg); }
.feedback-dlg { width: 100%; }
.feedback-dlg.over-shade::backdrop { background: transparent; animation: none; }   /* opened from the menu: the menu's shade is already behind it */
.feedback-dlg.over-shade[open] { animation: none; }
.feedback-dlg h2 { margin-top: 0; }
.feedback-dlg p { color: var(--muted); font-size: .9rem; }
.feedback-dlg textarea, .feedback-dlg input { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 10px; border-radius: 6px;
  border: 1px solid var(--line2); background: #1b1b1b; color: var(--fg); font: inherit; font-size: .95rem; resize: vertical; }
.feedback-dlg .fb-msg { min-height: 1.2em; margin: 0 0 6px; color: var(--accent); }
/* "New version available" bar (update.js) */
.update-bar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 10px 8px 14px; font-size: .9rem;
  box-shadow: 0 4px 16px #0008; width: max-content; max-width: calc(100vw - 32px); }
.update-bar button { margin: 0; padding: 4px 12px; font-size: .8rem; line-height: 1.2; }
/* phone menu (menu.js): the menu button top right opens a panel that fades in over the middle of the screen (the
   .menu-center rules further down). Desktop keeps the footer links instead. */
.side-menu, .menu-shade, .menu-handle { display: none; }   /* desktop: no phone menu (the tab can sit outside the panel in the fade in style) */
@media all {
  .phone-menu header .corner-r[data-open="intro"] { right: 50px; }
  .phone-menu .menu-shade { display: block; position: fixed; inset: 0; z-index: 70; background: #0009; opacity: 0; pointer-events: none; transition: opacity .3s .1s; }
  .menu-shade.open { opacity: 1; pointer-events: auto; }
  .phone-menu .side-menu { --w: min(260px, 78vw); display: block; position: fixed; top: 0; bottom: 0; right: 0; width: var(--w); z-index: 71;
    background: var(--panel); border-left: 2px solid var(--line2); transform: translateX(100%); transition: transform .32s ease .12s; }
  .side-menu.open { transform: none; transition-delay: .12s; box-shadow: -8px 0 24px #0008; }
  /* the tab: a rounded square on its own; open, it steps right to meet the panel and its right side joins it */
  .menu-handle { position: absolute; top: calc(var(--tab-y, 30px) - 11px); left: -52px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0;
    color: var(--muted); background: transparent; border: 2px solid currentColor; border-radius: 6px; cursor: pointer;
    transition: left .12s ease, border-radius .12s, background .12s, border-color .12s; }
  .menu-list { display: flex; flex-direction: column; padding: calc(var(--tab-y, 30px) + 26px) 18px 14px; gap: 4px; }
  .menu-list a, .menu-list button[data-open], .menu-list button[data-page] { color: var(--fg); text-decoration: none; padding: 12px 4px; border: none; border-bottom: 1px solid var(--line); background: none;
    font: inherit; font-size: 1.02rem; text-align: left; display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .menu-list a.new-badge-text { color: var(--accent); font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { .side-menu, .menu-shade, .menu-handle { transition: none !important; } }
@media all {
  .menu-acct { display: flex; align-items: center; gap: 10px; padding: 12px 4px; background: none; border: none; border-bottom: 1px solid var(--line);
    color: var(--fg); font: inherit; font-size: 1.05rem; font-weight: 700; text-align: left; cursor: pointer; }
  .menu-acct svg { color: var(--muted); }
  .menu-acct small { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .85rem; }
}
@media all {
  /* the account page inside the menu (account.js): replaces the list until "‹ Menu" */
  .side-menu { overflow: visible; }
  .menu-list { max-height: 100%; overflow-y: auto; box-sizing: border-box; overscroll-behavior: contain; }
  .menu-acct-view { display: none; }
  .menu-list.acct-mode > :not(.menu-acct-view) { display: none !important; }
  .menu-list.acct-mode .menu-acct-view { display: block; }
  .menu-back { background: none; border: none; color: var(--accent); font: inherit; font-weight: 700; padding: 4px 0 10px; cursor: pointer; }
  .menu-acct-body .close { display: none; }
  .menu-acct-body .av-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .menu-acct-body .acct-actions { flex-wrap: wrap; }
}
/* phones: the account lives in the menu, so the header account button is hidden there */
@media all { .phone-menu header .link.icon.corner-acct { display: none; } }
/* phones: Instagram and Hints live in the menu, so the footer drops them */
@media all { .phone-menu footer .link.foot-ig, .phone-menu footer .link.foot-hints { display: none; } }
@media all {
  /* "How to play" as a page inside the menu (menu.js) */
  .menu-page { display: none; }
  .menu-list.page-mode > :not(.menu-page) { display: none !important; }
  .menu-list.page-mode .menu-page { display: block; }
  .menu-page-body h2 { margin-top: 4px; font-size: 1.25rem; }
  .menu-page-body p { line-height: 1.45; }
  .menu-page-body a { display: inline !important; padding: 0 !important; border: none !important; color: var(--accent) !important; text-decoration: underline !important; }
}
@media all {
  /* the account row at the top of the menu: bigger name and foot */
  .menu-list .menu-acct { font-size: 1.35rem; gap: 12px; padding: 10px 4px 14px; }
  .menu-list .menu-acct svg { width: 34px; height: 34px; }
}
@media all {
  /* the account row sits level with the menu tab, so the menu's header lines up with the header bar */
  .menu-list { padding-top: max(10px, calc(var(--tab-y, 44px) - 34px)); }
}
/* ---- the menu panel (menu.js adds .menu-center): fades in over the middle of the screen; the rules above are its base ---- */
@media all {
  .phone-menu.menu-center .side-menu { inset: 0; margin: auto; width: min(340px, calc(100vw - 32px)); height: fit-content; max-height: min(560px, calc(100dvh - 120px));
    border: none; border-radius: 22px; background: var(--panel); transform: none;   /* same grey as the popups */ opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s; }
  .phone-menu.menu-center .side-menu.open { opacity: 1; visibility: visible; transition: opacity .25s ease; box-shadow: 0 12px 40px #000a; }
  /* the tab stays in the header (fixed to the screen, not the panel) and just spins */
  .phone-menu.menu-center .menu-handle { position: fixed; right: auto; left: 28px; z-index: 72; transition: color .15s; }
  .phone-menu.menu-center .menu-handle.open { color: var(--fg); }
  .phone-menu.menu-center .menu-handle.open svg { transform: rotate(180deg); }
  .menu-center .menu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 20px 24px; max-height: inherit; }
  .menu-center .menu-list > * { order: var(--o, 9); }
  .menu-center .menu-list > [data-open="feedback"] { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }   /* Feedback: last, centered under About and Privacy */
  .menu-center .menu-list .menu-acct { order: 0; grid-column: 1 / -1; border-bottom: 2px solid var(--fg); border-radius: 0; padding: 4px 4px 12px; margin-bottom: 4px; justify-content: flex-start; }
  .menu-center .menu-list a, .menu-center .menu-list button[data-open], .menu-center .menu-list button[data-page] {
    border: 2px solid var(--fg); border-radius: 12px; padding: 14px 10px; justify-content: center; text-align: center; font-size: .95rem; min-height: 52px; line-height: 1.2; }
  .menu-center .menu-list.acct-mode, .menu-center .menu-list.page-mode { display: block; }
  .menu-center .menu-acct-view, .menu-center .menu-page { grid-column: 1 / -1; }
  .menu-center .menu-shade { background: #000b; }
  .menu-page-body p a svg { vertical-align: -3px; margin-right: 4px; }
}
@media all {
  /* centered style: the tab is just the two-column list glyph, same size as the ? icon, no box and no spin */
  .phone-menu.menu-center .menu-handle { border: none; background: none; color: var(--muted); }
  .phone-menu.menu-center .menu-handle.open { color: var(--fg); }
  .phone-menu.menu-center .menu-handle.open svg { transform: none; }
}
/* fade in menu buttons: a glyph above each label; every label the same size and on one line */
.menu-list .mi { display: none; }
@media all {
  .menu-center .menu-list a, .menu-center .menu-list button[data-open], .menu-center .menu-list button[data-page] {
    flex-direction: column; gap: 7px; padding: 14px 6px 13px; font-size: .84rem; }
  .menu-center .menu-list .mi { display: block; line-height: 0; color: var(--muted); }
  .menu-center .menu-list .ml { white-space: nowrap; line-height: 1.15; }
}
@media all {
  /* fade in menu: button outlines use the same grey as their glyphs */
  .menu-center .menu-list a, .menu-center .menu-list button[data-open], .menu-center .menu-list button[data-page] { border-color: var(--muted); }
}
@media all {
  /* with the phone menu on, the header ? button goes (How to play lives in the menu; the first visit popup still opens by itself);
     the menu tab takes its corner, the same 28px from the edge as the stats button on the left */
  .phone-menu header .corner-r[data-open="intro"] { display: none; }
}
@media all {
  /* fade in menu: the line under the account name matches the glyph grey */
  .menu-center .menu-list .menu-acct { border-bottom-color: var(--muted); }
}
@media all {
  /* fade in menu: each button sits slightly raised off the panel */
  .menu-center .menu-list a, .menu-center .menu-list button[data-open], .menu-center .menu-list button[data-page] {
    box-shadow: 0 7px 6px -4px #000c; }   /* shadow only below the button (negative spread keeps it off the sides) */
}
@media all {
  /* fade in menu: thinner button outlines */
  .menu-center .menu-list a, .menu-center .menu-list button[data-open], .menu-center .menu-list button[data-page] { border-width: .5px; }   /* hairline on phone screens */
}
@media all {
  /* fade in menu labels: same font as the "Try to solve in N words" line (semi-bold, grey) */
  .menu-center .menu-list .ml { font-weight: 600; color: var(--muted); }
}
@media all {
  /* links inside menu pages (the Poople link in menu How to play, Instagram in Socials) are plain text links, not buttons */
  .menu-center .menu-list .menu-page-body a { box-shadow: none; min-height: 0; border-radius: 0; flex-direction: row;
    font: inherit; line-height: inherit; text-align: inherit; gap: 0; }
}
/* stats popup: second row (over / at / under par), a little apart from the first */
.stats-grid.par-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
/* stats popup sized like the fade in menu (menu.js matchMenuSize) */
dialog.menu-sized { max-width: none; box-sizing: border-box; border-radius: 22px; overflow-y: auto; }
@media all {
  /* with the phone menu on, the header stats button goes too (Stats is in the menu) */
  .phone-menu header .corner-l[data-open="stats"] { display: none; }
}
@media all {
  /* with the phone menu on, the footer's About and Privacy links sit at the very top left of the page instead */
  .phone-menu .link.foot-about, .phone-menu .link.foot-privacy { position: absolute; top: 0; z-index: 5; text-decoration: underline; font-size: 11px; }
  .phone-menu .link.foot-about { right: 52px; }   /* spacing scaled with the 11px text */
  .phone-menu .link.foot-privacy { right: 8px; }
}
/* back caret: pages inside the menu, and Stats when opened from the menu (menu.js) */
.menu-back { line-height: 0; padding: 2px 0 8px !important; color: var(--muted) !important; }
dialog .dlg-back { position: absolute; top: 10px; left: 10px; background: none; border: none; color: var(--muted); padding: 4px; line-height: 0; cursor: pointer; }
dialog .dlg-back[hidden] { display: none; }
dialog:has(> .dlg-back:not([hidden])) > h2 { padding-left: 26px; }   /* make room for the back caret */
/* Stats opened from the menu (menu.js): centred, no ✕, and the menu's shade behind it instead of the popup backdrop */
dialog.from-menu[open] { display: flex; flex-direction: column; justify-content: safe center; align-items: center; text-align: center; }
dialog.from-menu > .close { display: none; }
dialog.from-menu > h2 { padding-left: 0 !important; margin-left: 0; margin-right: 0; width: 100%; text-align: center; }
dialog.from-menu::backdrop { background: transparent; }
dialog.from-menu[open], dialog.from-menu[open]::backdrop { animation: none; }   /* from the menu, Stats just appears */
dialog.from-menu #statsBody, dialog.from-menu #rvBoard, dialog.from-menu .share-btns { width: 100%; }   /* #rvBoard = the Reverse page's leaderboard */
/* the back caret sits where it does on the other menu pages (panel padding 20px, caret 2px down) */
dialog.from-menu > .dlg-back { top: 20px; left: 16px; }
dialog.from-menu .stats-follow { display: none; }   /* Instagram is in the menu (Socials) */
@media all {
  /* links on the account page inside the fade in menu (Download my data, Privacy Policy...) are plain links, not menu buttons */
  .menu-center .menu-list .menu-acct-view a { border: none; box-shadow: none; min-height: 0; padding: 0; border-radius: 0; flex-direction: row; font: inherit; }
  /* menu buttons that stay on this page show their content at once (menu.js instant): no fade, slide or spin */
  .instant, .instant svg, .phone-menu .side-menu.instant .menu-handle { transition: none !important; }
  /* account page inside the menu: a slightly smaller foot (84px -> 70px) */
  .menu-acct-body .av-head .foot-av { height: calc(2.4 * 1.35rem) !important; }   /* same size as the foot on the menu's account row */
  /* fade in menu: the account page's foot and name sit exactly where they are on the menu's account row, at the same
     size, so tapping the row looks like the page opens around them. Signed in, there is no caret. */
  .menu-center .menu-list .menu-acct span:not(.foot-av) { font-size: 1.5rem; }   /* the name, same size as on the account page */
  /* a › on the right shows the name row can be tapped (opens the account page). Guests already have the gold "Sign in",
     so only the signed-in row (no <small>) gets it. */
  .menu-center .menu-list .menu-acct:not(:has(small))::after {
    /* drawn (two borders of a turned square), not a "›" character, so it sits exactly at the row's middle */
    content: ""; flex: none; align-self: center; width: 9px; height: 9px; margin: 0 8px 0 auto;
    border: solid var(--muted); border-width: 2.5px 2.5px 0 0; transform: rotate(45deg); }
  .menu-center .menu-list .menu-acct:active { background: #ffffff0f; }   /* pressed */
  .menu-center .menu-acct-body .av-head { padding: 4px 4px 12px; gap: 12px; margin: 0 0 4px; border-bottom: 2px solid var(--muted); }
  .menu-center .menu-acct-body .av-head h2 { font-size: 1.5rem; line-height: inherit; }
  .menu-center .menu-acct-view > .menu-back { display: block; margin: 0 0 4px; }   /* guests: the caret sits above "Sign in" */
  /* signed in: no caret, the foot and name row is the way back (account.js). Guests and "pick a username" keep the caret. */
  .menu-acct-view:has(.av-head) > .menu-back { display: none; }
  .menu-acct-body .av-head { cursor: pointer; }
  .phone-menu.menu-center .side-menu[style*="height"] .menu-list { height: 100%; }   /* the account page scrolls inside the kept size */
}
/* a small underlined link at the bottom of a menu page (Settings: Privacy) */
.menu-page-body .page-foot-link { text-align: center; margin: 22px 0 0; font-size: .9rem; }
.menu-list .menu-page-body .page-foot-link a { color: var(--faint) !important; }   /* same faint grey as the page's About / Privacy links */
/* stats popup: leaderboard */
.leaderboard { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.leaderboard h3 { margin: 0 0 8px; font-size: 1rem; text-align: center; }
.leaderboard h3 small { color: var(--muted); font-weight: 600; font-size: .7rem; margin-left: 4px; }
.leaderboard ol { margin: 0; padding: 0; list-style: none; }
.leaderboard li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: .9rem; }
.leaderboard li[value]::before { content: attr(value); width: 1.4em; color: var(--muted); font-weight: 700; text-align: right; }
.leaderboard li[value="1"]::before { color: var(--accent); }
.leaderboard li.lb-gap { justify-content: center; color: var(--muted); padding: 0; line-height: 1; }
.leaderboard li.me { background: var(--line); }
.leaderboard .lb-name { flex: 1; font-weight: 600; }
.leaderboard .lb-pts { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-note { margin: 6px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
/* ---- Settings (settings.js) ---- */
/* Reduced motion: no animations or transitions anywhere (the fireworks/confetti are handled in celebrate.js) */
/* Reduced motion: no animations or transitions, so everything just pops in at its final look. The pieces that normally
   fade in from invisible (new rows' tiles, hint cards, difficulty buttons) are shown directly, or they'd stay invisible. */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after, html.reduce-motion ::backdrop { animation: none !important; transition: none !important; }
html.reduce-motion .row.enter .tile, html.reduce-motion .card, html.reduce-motion .diffs .diff { opacity: 1; }
/* Swap Enter and Backspace: Backspace moves to the left end of the bottom row, Enter to the right */
html.keys-swapped .key[data-k="enter"] { order: 1; }
html.keys-swapped .key[data-k="back"] { order: -1; }
/* the Settings page: one row per setting, an on/off switch on the right */
.settings-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.set-row b { display: block; font-size: .95rem; }
.set-row small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; line-height: 1.3; }
.switch { flex: none; width: 44px; height: 26px; border-radius: 13px; border: none; background: var(--line2); position: relative; cursor: pointer; padding: 0; transition: background .22s ease; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .22s cubic-bezier(.3, .7, .4, 1); box-shadow: 0 1px 3px #0006; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(18px); }
@media all {
  /* Socials button: three glyphs in a row (Instagram, YouTube, TikTok) */
  .menu-center .menu-list .mi.mi-row { display: flex; gap: 8px; }
}
/* social links: icon then an underlined name (the underline skips the icon and the gap) */
.menu-page-body a:has(> svg) { text-decoration: none !important; display: inline-flex !important; align-items: center; gap: 6px; }
.menu-page-body a:has(> svg) > span { text-decoration: underline; }
@media all {
  /* Socials button: even spacing between the three glyphs */
  .menu-center .menu-list .mi.mi-row { gap: 12px; }
}
/* Socials page: each icon in a 22px column, centred on its name, with even space between the links */
.menu-page-body a:has(> svg) { gap: 10px; line-height: 1.3; }
.menu-page-body a:has(> svg) > svg { width: 22px; height: 22px; flex: none; }
.menu-page-body p:has(> a > svg) { margin: 0 0 14px; }
@media all {
  /* Socials button fine-tuning: the TikTok note is narrower than its square, so nudge it 2px closer to keep the visible
     gaps between the three glyphs equal, and shift the row so the glyphs (not their squares) are centred on the button */
  .menu-center .menu-list .mi.mi-row > svg:last-child { margin-left: -2px; }
  .menu-center .menu-list .mi.mi-row { transform: translateX(2px); }
}
/* Results popup after a daily solve (game.js renderResults): each line fades in one after another, then the total */
.pt-list { width: 100%; max-width: 280px; margin: 10px auto 4px; }
.pt-row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line);
  font-size: 1.05rem; animation: pt-in .4s ease-out both; animation-delay: calc(.25s + var(--i) * .45s); }
.pt-row span { color: var(--muted); font-weight: 600; }
.pt-row b { font-variant-numeric: tabular-nums; }
.pt-row.pt-total { border-bottom: none; border-top: 2px solid var(--fg); margin-top: 4px; padding-top: 12px; font-size: 1.35rem; }
.pt-row.pt-total span { color: var(--fg); }
.pt-row.pt-total b { color: var(--accent); }
@keyframes pt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pts-nudge { margin-top: 14px; animation: pt-in .4s ease-out both; animation-delay: 2.2s; }
/* stats page: this week's and all-time points with placements */
.stats-grid.two { grid-template-columns: 1fr 1fr; }
.stats-grid.pts-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.stats-grid.pts-row em { display: block; font-style: normal; color: var(--accent); font-weight: 700; font-size: .8rem; margin-top: 2px; }
/* Unlimited: points after each word, and the run's results when it ends */
.word-pts { text-align: center; margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.word-pts b { color: var(--accent); font-size: 1.15rem; }
.run-title { text-align: center; margin: 16px 0 0; font-size: 1.05rem; }
.u-pts { margin-top: 0; padding-top: 0; border-top: none; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.av-drop > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.av-drop > summary::-webkit-details-marker { display: none; }
.av-label .av-cur { color: var(--text, inherit); text-transform: none; letter-spacing: 0; font-weight: 600; }
.av-drop .av-caret { margin-left: auto; transition: transform .2s; }
.av-drop[open] .av-caret { transform: rotate(180deg); }
.acct-tabs { display: flex; gap: 6px; margin: 14px 0 10px; }
.acct-tab { flex: 1; font-family: inherit; padding: 8px 6px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); color: var(--fg); font-weight: 700; font-size: .9rem; cursor: pointer; }
.acct-tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
dialog#account:not(.menu-sized) { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; }   /* same width on every tab */
.acct-pw-toggle { display: block; margin: 8px auto 0; color: var(--accent); font-size: .85rem; }
.acct-h { font-size: 1rem; margin: 14px 0 4px; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.acct-k { font-weight: 600; }
.acct-v { margin-left: auto; color: var(--muted); font-size: .9rem; text-align: right; overflow-wrap: anywhere; }
.acct-reveal { color: var(--accent); font-size: .85rem; padding: 0; }
.acct-edit { font-family: inherit; flex: none; padding: 7px 16px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); color: var(--fg); font-weight: 700; font-size: .85rem; cursor: pointer; }
.acct-done { text-align: center; color: var(--accent); }
.acct-lbl { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); text-align: left; }
.acct-lbl input { font: inherit; font-weight: 400; padding: 10px; border-radius: 6px; border: 1px solid var(--line2); background: #1b1b1b; color: var(--fg); }
.acct-code { text-align: center; font-size: 1.5rem !important; letter-spacing: .4em; font-weight: 700; }
dialog#acct-edit { width: min(380px, calc(100vw - 32px)); box-sizing: border-box; }
.acct-btns { display: flex; gap: 8px; margin-top: 14px; } .acct-btns > * { flex: 1; margin: 0; padding: 10px 8px; }
.menu-list a.acct-google, .menu-center .menu-list a.acct-google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border: none; border-radius: 6px; background: #fff; color: #222 !important; font-weight: 700; }   /* the menu's plain link style must not flatten the Google button */
/* color wheel (Custom color, account.js) */
.cw { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.cw-preview { height: 96px; }
.cw-wheel { position: relative; width: min(220px, 70vw); aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: crosshair;
  background: radial-gradient(closest-side, #808080, #80808000), conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.cw-wheel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cw-knob { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #0008, 0 2px 6px #0009; transform: translate(-50%, -50%); pointer-events: none; }
.cw-light { display: flex; flex-direction: column; gap: 6px; width: min(220px, 70vw); font-size: .85rem; font-weight: 600; color: var(--muted); }
.cw-light input { width: 100%; accent-color: var(--accent); }
.cw .acct-btns { width: 100%; }
.av-tint { position: absolute; inset: 0; mix-blend-mode: color; pointer-events: none; -webkit-mask: url(/foot.png) center / contain no-repeat; mask: url(/foot.png) center / contain no-repeat; }   /* Custom color: the wheel color in the foot's shape (avatar.js) */
.av-face { position: absolute; inset: 0; pointer-events: none; background: center / 100% 100% no-repeat; -webkit-mask: url(/foot.png) center / contain no-repeat; mask: url(/foot.png) center / contain no-repeat; }   /* picture skins (DUTT): the picture in the foot's shape */
/* Leaderboard popup (leaderboard.js) */
.lb-root { width: 100%; text-align: center; }
.lb-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
/* the Leaderboard popup keeps one size on every tab (when it isn't already sized to the menu) */
dialog:has(.lb-root):not(.menu-sized) { width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 48px)); box-sizing: border-box; overflow-y: auto; }
.lb-reset { text-align: center; margin: -6px 0 6px; color: var(--muted); font-size: .8rem; }
.lb-today { margin: 6px 0 0; font-size: .9rem; }
.lb-today b { color: var(--accent); }
.lb-root .leaderboard { margin-top: 10px; }
.lb-guest { margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.lb-guest .link { color: var(--accent); text-decoration: underline; font-size: inherit; padding: 0; }
.lb-how { margin-top: 10px; font-size: .85rem; text-align: left; }
.lb-how summary { cursor: pointer; color: var(--accent); font-weight: 600; text-align: center; list-style: none; }
.lb-how summary::-webkit-details-marker { display: none; }
.lb-how table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.lb-how td { padding: 4px 2px; border-top: 1px solid var(--line); }
.lb-how td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
/* account page Stats tab (account.js statsPaneHTML) */
.st-body { text-align: center; }
.st-body .stats-grid { margin-top: 6px; }
.st-help { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin: -2px 0 -2px 2px; padding: 0; vertical-align: middle; position: relative; top: -2px;
  background: none; border: 1.5px solid var(--accent); border-radius: 50%; color: var(--accent); font: 700 .8em/1 Georgia, serif; font-style: italic; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st-help.picked { background: var(--accent); color: #111; }
.st-h { margin: 16px 0 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.st-bars { display: flex; flex-direction: column; gap: 5px; }
.st-bar { display: grid; grid-template-columns: 5.2em 1fr 2.2em; align-items: center; gap: 8px; font-size: .85rem; }
.st-bar span { text-align: left; color: var(--muted); }
.st-bar i { display: block; height: 14px; width: max(3px, var(--w)); border-radius: 4px; background: var(--muted); }
.st-bar.under i { background: var(--accent); }
.st-bar.at i { background: var(--fg); }
.st-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.st-dots { display: flex; justify-content: space-between; gap: 6px; }
.st-dot { flex: 1; aspect-ratio: 1; max-width: 30px; border-radius: 50%; border: 2px solid var(--line2); }
.st-dot.under { background: var(--accent); border-color: var(--accent); }
.st-dot.at { background: var(--fg); border-color: var(--fg); }
.st-dot.over { background: var(--muted); border-color: var(--muted); }
.st-dot.solved { display: grid; place-items: center; }
.st-dot.solved::after { content: ""; width: 30%; height: 30%; border-radius: 50%; background: var(--muted); }
.st-dot.future { border-style: dashed; opacity: .5; }
.st-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 7px; font-size: .72rem; color: var(--muted); }
.st-day .st-dot { width: 100%; max-width: 24px; flex: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st-day .st-dot:not(.under, .at, .over) { background: none; }   /* it's a button now: no default button fill */
.st-day .st-dot.picked { transform: scale(1.18); }
.acct-pane { position: relative; }
.st-explain { display: none; }   /* the info text, shown in the bubble instead */
/* the speech bubble over a tapped info button or week circle; JS sets left, top and --arrow (the tapped thing's center) */
.st-bubble { position: absolute; z-index: 2; width: max-content; max-width: min(240px, 100%); margin: 0; padding: 8px 11px;
  border-radius: 8px; background: #f2f2f2; color: #1b1b1b; font-size: .8rem; line-height: 1.35; text-align: left; box-shadow: 0 4px 14px #0008; animation: fade-in .15s ease-out; }
.st-bubble::after { content: ""; position: absolute; top: 100%; left: var(--arrow, 50%); margin-left: -7px; border: 7px solid transparent; border-top-color: #f2f2f2; }   /* smaller than the column, so retry rings (box-shadow) fit around it */
.st-day.today { color: var(--fg); font-weight: 700; }
.st-trend { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.st-trend b { color: var(--fg); }
.st-up { color: #6fd38a; font-weight: 700; } .st-down { color: var(--bad); font-weight: 700; }
.st-empty { color: var(--muted); margin: 18px 0; }
.st-diffs { margin-top: 2px; }
.st-diffs .acct-tab { padding: 6px; font-size: .8rem; }
.st-h .st-help { text-transform: none; font-size: .95em; }
.st-tip { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line2); font-size: .85rem; text-align: left; }
.lb-scores { margin-top: 4px; }
.lb-scores b { font-size: 2rem; }
.lb-scores em { display: block; font-style: normal; color: var(--accent); font-weight: 700; font-size: .8rem; margin-top: 2px; }
#message.win-link { cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; } #message.win-link:hover { opacity: .85; } #message.win-link:focus:not(:focus-visible) { outline: none; } #message.win-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }   /* the win line opens the win popup again (game.js winMessage) */

/* a newly unlocked skin: red-orange ! on the menu button, your name and the skin (account.js) */
#menuBtn.has-new::after, .corner-acct.has-new::after, .av-opt.has-new::after, .menu-acct.has-new > span:not(.foot-av)::after { content: ""; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(#fff, #fff) 50% 3px / 2px 5px no-repeat, linear-gradient(#fff, #fff) 50% 9px / 2px 2px no-repeat, #f0501e; pointer-events: none; }
.av-opt.has-new::after { top: 3px; right: 3px; }
.menu-acct.has-new > span:not(.foot-av) { position: relative; }
.menu-acct.has-new > span:not(.foot-av)::after { top: -2px; right: -15px; }
/* desktop with the phone layout: a phone-sized column in the middle, scaled by menu.js (html zoom, --z) */
@media (min-width: 521px) {
  .phone-menu body { min-height: calc(100dvh / var(--z, 1)); }
  .phone-menu body:is(.game-page, :has(#keyboard)) { height: calc(100dvh / var(--z, 1)); min-height: 0; }
  .phone-menu.menu-center .side-menu { max-height: min(560px, calc(100dvh / var(--z, 1) - 120px)); }
  .phone-menu main, .phone-menu #keyboard { max-width: 375px; }
  .phone-menu footer { width: 100%; max-width: 375px; gap: 6px 10px; padding: 10px 8px 16px; flex-wrap: nowrap; justify-content: space-evenly; }
  .phone-menu footer .link { font-size: .75rem; padding: 4px 0; white-space: nowrap; }
  .phone-menu.menu-center .menu-handle { left: calc(50vw / var(--z, 1) - 160px); }
  .phone-menu .link.foot-about { right: calc(50vw / var(--z, 1) - 136px); }
  .phone-menu .link.foot-privacy { right: calc(50vw / var(--z, 1) - 180px); }
  .phone-menu .ad-rail, .phone-menu .ad-mock.rail { zoom: calc(1 / var(--z, 1)); }
}
/* Socials page: glyph and name share one line, centred on the letters */
.menu-list .menu-page-body a:has(> svg) { align-items: center; line-height: 22px; }
.menu-page-body a:has(> svg) > svg { display: block; }
.menu-page-body a:has(> svg) > span { display: block; line-height: 22px; }
/* the header keeps its final height from the start, so the menu button can't move while the logo and subheader load */
header h1 { height: calc(1.8rem * 1.3); vertical-align: top; }
#subheader { height: 1.2em; line-height: 1.2; }
/* Socials page: Instagram and YouTube glyphs sit visually high next to their names */
.menu-page-body a[href*="instagram"] > svg, .menu-page-body a[href*="youtube"] > svg { transform: translateY(2px); }
/* the menu button is in the page HTML so it's there from the first paint; off when the phone menu is off */
html:not(.phone-menu) .menu-handle { display: none !important; }
/* reduced motion keeps one animation: the FEET row's bob on a solve */
html.reduce-motion .tile.bob { animation: bob .45s ease-in-out both !important; animation-delay: calc(var(--i, 0) * .22s) !important; }
/* "COMING SOON" badge: gold rounded outline with the label cutting through its top edge; not a button */
.soon-badge { position: relative; flex: none; border: 2.5px solid var(--accent); border-radius: 8px; padding: 4px 18px; color: var(--fg); cursor: default; user-select: none; }
footer .soon-badge { font-size: .75rem; white-space: nowrap; }
.soon-badge::before { content: "COMING SOON"; position: absolute; top: 0; left: 50%; transform: translate(-50%, -55%); padding: 0 3px; background: var(--bg); color: var(--accent); font-size: .4rem; font-weight: 700; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
/* sign-in dialog's email button, and the ad-free /account page */
a.acct-email-btn { width: 100%; text-align: center; text-decoration: none; box-sizing: border-box; }
.account-page { max-width: 375px; padding-top: 28px; flex: none; }
.account-page .primary { width: 100%; }
.account-page #msg a { color: var(--accent); }
/* inside the fade in menu, menu link styles would otherwise strip this button */
a.acct-email-btn, .menu-center .menu-list .menu-acct-view a.acct-email-btn { display: block; width: 100%; min-height: 0; margin: 12px 0 0; padding: 12px 16px; border: none; border-radius: 6px; box-shadow: none; background: var(--accent); color: var(--accent-fg); font: 700 1rem system-ui, sans-serif; text-align: center; text-decoration: none; }
/* the eye in a password box (/account) */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap:has(input[hidden]) { display: none; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; padding: 4px; border: none; background: none; color: var(--muted); cursor: pointer; }
.pw-eye.on { color: var(--accent); }
/* blog and hints pages (page-ads.js): the phone banner stays on screen, and the page gets room so it never covers the last lines */
#ad-bottom.ad-fixed { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 20; background: var(--bg); }
body.has-ad-bottom { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
/* MOCKUP (local only): modal ad slot at the top of the win popup, under the ✕ */
.win-ad-mock { width: 300px; max-width: min(320px, 100%); height: 250px; margin: 28px auto 14px; flex-direction: column; text-align: center; display: flex; align-items: center; justify-content: center; border: 2px dashed #666; border-radius: 8px; background: #2c2c2c; color: #999; font: 600 14px system-ui; }
/* notifications (notify.js): the unlock bar that drops from under the header, the bell, and the Messages popup */
.noti-bar { position: fixed; inset: auto; left: 50%; margin: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: 10px 10px 10px 14px; border: 1px solid var(--accent); border-radius: 10px;
  background: var(--panel); color: var(--fg); box-shadow: 0 6px 20px #000a; font-size: .92rem; animation: noti-drop .35s ease-out both; }
.noti-bar.out { animation: noti-up .25s ease-in both; }
@keyframes noti-drop { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes noti-up { to { opacity: 0; transform: translate(-50%, -14px); } }
.noti-ic { font-size: 1.3rem; line-height: 1; }
.noti-txt { flex: 1; }
.noti-bar .noti-view { margin: 0; padding: 5px 12px; font-size: .8rem; }
.noti-x { background: none; border: 0; color: var(--muted); font-size: 1.1rem; min-width: 36px; min-height: 36px; padding: 0; margin: -6px -6px -6px 0; cursor: pointer; }   /* big tap target */
/* the bell: on the menu's account row, in place of the › caret (same grid cell as the row, pinned to its right end) */
.menu-center .menu-list .menu-acct { grid-row: 1; }
.menu-bell { display: none; }
.menu-center .menu-list > .menu-bell { display: grid; place-items: center; grid-row: 1; grid-column: -2 / -1; justify-self: end; align-self: center; order: 0;
  position: relative; width: 40px; height: 40px; margin: -4px 0 8px; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }
.menu-center .menu-list > .menu-bell:active { background: #ffffff14; }
.menu-center .menu-list:has(.menu-bell) .menu-acct::after { display: none; }   /* the bell replaces the caret */
.menu-bell.has-new::after { content: ""; position: absolute; top: 6px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: #e8334f; border: 2px solid var(--panel); }
#menuBtn.has-msg::after { content: ""; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(#fff, #fff) 50% 3px / 2px 5px no-repeat, linear-gradient(#fff, #fff) 50% 9px / 2px 2px no-repeat, #f0501e; pointer-events: none; }
/* Messages page inside the menu (notify.js), shown like the account page */
.menu-msgs-view { display: none; }
.menu-list.msg-mode > :not(.menu-msgs-view) { display: none !important; }
.menu-list.msg-mode .menu-msgs-view { display: block; }
.menu-center .menu-list.msg-mode { display: block; }
.menu-msgs-view > .menu-back { display: block; }
.menu-msgs-view .msgs-title { margin: 0 0 8px; font-size: 1.5rem; text-align: left; }
.msg-list { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; }
.msg-list li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; margin-bottom: 6px; background: #2a2a2a; }
.msg-list li.unread { background: #3a3420; box-shadow: inset 3px 0 0 var(--accent); }
.msg-txt { flex: 1; font-size: .9rem; } .msg-txt small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.msg-list .msg-view { margin: 0; font-size: .75rem; }
.msg-empty { color: var(--muted); }
/* Local test buttons (never on the live site): a column just right of the game frame, out of the game's way.
   Small screens have no room beside the frame, so they stay under the board there. */
@media (min-width: 760px) {
  .dev-resets { position: fixed; top: 90px; left: calc(50% + 262px); z-index: 5; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; width: max-content; max-width: calc(50% - 280px); }
  .dev-resets > button { text-align: left; }
  .dev-resets .rv-devnew { margin: 0; }
  .dev-resets .rv-answer { margin: 4px 0 0; text-align: left; }
}
@media (max-width: 759px) { .rv-devs { flex-direction: column; align-items: center; } }   /* small screens: Reverse keeps its stacked buttons under the board */
/* the Messages bell on the account page too: at the right end of the foot + name row */
.av-head .acct-bell { display: grid; place-items: center; position: relative; margin-left: auto; width: 40px; height: 40px; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; flex: none; }
.av-head .acct-bell:active { background: #ffffff14; }
/* the menu keeps room for its scrollbar on every page (both sides, so it stays centred): a long page (the account page)
   shows a scrollbar and a short one (the main menu) doesn't, and without this the bell and name shifted between them */
.menu-center .menu-list { scrollbar-gutter: stable both-edges; }
.menu-center .menu-acct-view .av-head .acct-bell { margin-right: -4px; top: 1px; }   /* same spot as the bell on the main menu row (this row has 4px padding) */
/* local test tab: one test notification per unlockable, folded away until opened (notify.js) */
.dev-notis { font-size: .75rem; color: #ff9d9d; border: 1px dashed #ff9d9d; border-radius: 6px; padding: 3px 10px; }
.dev-notis summary { cursor: pointer; }
.dev-notis[open] { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.dev-notis[open] summary { margin-bottom: 4px; }
.dev-notis .dev-reset { text-align: left; }
.dev-notis-msg { margin: 0; }
.msg-list .msg-x { background: none; border: 0; color: var(--muted); font-size: .8rem; min-width: 28px; min-height: 28px; margin: -6px -6px -6px 0; padding: 0; cursor: pointer; flex: none; }   /* clear one message */
/* ---------- badges (src/badges.js): Customize drop-down + leaderboard player card ---------- */
.badge-emoji { font-size: 1.7rem; line-height: 1; }
.badge-img { width: 34px; height: 34px; object-fit: contain; }
.bd-help, .bd-msg { margin: 6px 0; color: var(--muted); font-size: .8rem; text-align: left; }
.bd-msg:empty { display: none; }
.bd-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border: 1px solid var(--line2); border-radius: 10px; background: #00000022; }
.bd-group { margin: 12px 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.bd-opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; height: 72px; padding: 6px 2px;
  border: 1px solid var(--line2); border-radius: 8px; background: none; color: var(--fg); cursor: pointer; font: inherit; }
.bd-opt small { font-size: .62rem; line-height: 1.15; color: var(--muted); height: 2.3em; width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }   /* every badge the same height: icon on one line, name in a 2-line box that shrinks to fit (fitBadgeNames in account.js) */
.bd-opt > .badge-emoji, .bd-opt > .badge-img { height: 34px; display: flex; align-items: center; justify-content: center; flex: none; }
.bd-opt.bd-empty { height: 72px; }
.bd-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bd-opt.locked { cursor: help; }
.bd-opt.locked .badge-emoji, .bd-opt.locked .badge-img { filter: grayscale(1); opacity: .35; }
.bd-opt.locked::after { content: "🔒"; position: absolute; top: 3px; right: 4px; font-size: .6rem; }
.bd-opt.secret .badge-emoji, .bd-opt.secret .badge-img { filter: brightness(0) invert(.35); opacity: .8; }   /* easter eggs: a silhouette until found */
.av-opt.secret .av, .av-opt.secret > :first-child { filter: brightness(0) invert(.35); }   /* secret skins: a silhouette until found */
.bd-empty { border-style: dashed; cursor: default; min-height: 64px; }
.badge-n { position: absolute; top: 2px; right: 4px; font-size: .62rem; color: var(--accent); }
/* player card: a popup over the leaderboard */
.player-card { width: min(360px, calc(100vw - 32px)); text-align: center; }
.pc-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.pc-head h2 { margin: 4px 0 0; }
.pc-since { margin: 0; color: var(--muted); font-size: .8rem; }
.pc-badges { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }   /* always one row of up to 5 */
.badge-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: calc((100% - 24px) / 5); max-width: 64px; min-height: 64px; box-sizing: border-box;
  border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; }
.badge-tile small { font-size: .6rem; line-height: 1.15; color: var(--muted); padding: 0 2px; }
.badge-tile.empty { border-style: dashed; cursor: default; }
.badge-tile.tipped { border-color: var(--accent); }
.pc-tip { margin: 6px 0 0; font-size: .8rem; color: var(--fg); }
.pc-none { margin: 0; color: var(--muted); font-size: .85rem; }
.pc-stats { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.pc-mode, .pc-loading { margin: 10px 0 0; color: var(--muted); font-size: .75rem; }
.lb-player { cursor: pointer; }
.lb-player:hover .lb-name { text-decoration: underline; }
.dev-notis-head { margin: 6px 0 0; font-weight: 700; } .dev-notis { max-height: 70vh; overflow-y: auto; }   /* the tab has a lot of buttons now */
/* new badge: the same red ! as a new skin, on the badge and on the Badges label */
.bd-opt.has-new::after { content: ""; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(#fff, #fff) 50% 3px / 2px 5px no-repeat, linear-gradient(#fff, #fff) 50% 9px / 2px 2px no-repeat, #f0501e; }
.av-drop > summary.has-new { position: relative; }
.av-drop > summary.has-new::before { content: ""; order: 1; margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: #f0501e; }   /* the dot sits left of the caret */
.av-drop > summary.has-new .av-caret { order: 2; margin-left: 0; }
.dev-accts { display: flex; flex-direction: column; gap: 6px; }
/* all-time points from every mode: Stats tab (above the mode tabs) and the leaderboard player card */
.st-total { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 4px auto 12px; padding: 8px 14px; border-radius: 8px; background: #2c2c2c; }
.st-total b { font-size: 1.3rem; color: var(--accent); }
.st-total small { color: var(--muted); font-size: .8rem; }
.pc-total { margin-top: 10px; }
/* small hover peek on leaderboard names (player-card.js attachPeek) */
.pc-peek { position: fixed; z-index: 50; pointer-events: none; background: var(--bg2, #2a2a2a); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; box-shadow: 0 4px 14px #0008; text-align: center; max-width: 220px; }
.pc-peek { display: flex; flex-direction: column; align-items: center; }
.pc-peek > b { display: block; font-size: .85rem; margin: 4px 0 6px; }
.pc-peek-badges { display: flex; justify-content: center; gap: 0; border: 1px solid var(--line2); border-radius: 8px; padding: 4px 6px; }
.pc-peek-badges span { width: 24px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.pc-peek-badges span > * { max-width: 100%; max-height: 100%; }
.pc-peek-badges small { color: var(--muted); font-size: .7rem; }

/* Flight mode (DUTT egg, egg.js): the face above the keyboard's left end, mirrored, bobbing on each key press */
#keyboard { position: relative; }
.flight-face { position: absolute; left: 14px; bottom: 100%; width: 32px; height: auto; transform: scaleX(-1); transform-origin: bottom center; pointer-events: none; filter: drop-shadow(0 2px 4px #0008); }
.flight-face.bob { animation: flight-bob .18s ease-out; }
@keyframes flight-bob { 0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(0); } 40% { transform: scaleX(-1) translate(var(--bx, 0px), var(--by, -6px)) rotate(var(--br, -8deg)); } }   /* --bx/--by/--br picked per press in egg.js */
@media (prefers-reduced-motion: reduce) { .flight-face.bob { animation: none; } }


/* Golden Feetle Token shoutout question (shoutout.js): the popup after the animation, and the card at the top of Messages.
   Gold like the token reveal (pirate.js): same title font and colours, the big faint title panning behind the token */
.so-font { font-family: "Burbank Big Condensed", Impact, "Haettenschweiler", "Arial Narrow Bold", "Arial Black", sans-serif; font-weight: 900; text-transform: uppercase; line-height: .95; letter-spacing: .01em; }
.so-dlg { text-align: center; overflow: hidden; border: 2px solid #e7b94f; background: radial-gradient(ellipse 90% 55% at 50% 0%, #6b4a0c 0%, #3a2a0e 45%, #241c10 100%); box-shadow: 0 0 0 1px #fff6c855 inset, 0 0 36px #ffd86a44; }
.so-dlg .close { color: #f6f08c; z-index: 2; }   /* above the token area (.so-hero), which otherwise covers it and swallows the click */
.so-hero { position: relative; height: 96px; margin: -6px -24px 4px; }
.so-pan { position: absolute; left: 0; top: 50%; display: flex; width: max-content; font-size: 64px; white-space: nowrap; color: #f3ee8a; opacity: .3; animation: so-pan 9s linear infinite; }
/* two copies side by side, sliding right by one copy's width: a seamless loop that never fades */
@keyframes so-pan { from { transform: translate(-50%, -50%); } to { transform: translate(0, -50%); } }
.so-glow { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; transform: translate(-50%, -50%); background: radial-gradient(circle, #ffe9a0aa 0%, #ffcf5a55 35%, #ffcf5a00 70%); }
.so-token { position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 10px #ffe06a99); }
.so-title { margin: 0 0 12px; font-size: 1.9rem; color: #f6f08c; text-shadow: 0 2px 0 #6b4a0c, 0 0 10px #ffe86a55; }
.so-title span { display: block; font-size: 1.05rem; color: #fff; text-shadow: 0 2px 0 #3d2a06aa; margin-bottom: 2px; }
.so-q { margin: 0 0 20px; line-height: 1.4; }
.so-dlg .so-q { color: #fff3d0; }
.so-btns { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 0 6px; }
.so-btn { flex: 1 1 140px; margin: 0; padding: 10px 16px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  border: 2px solid #e7b94f; background: #00000033; color: #f6e7a8; }
.so-btn:hover { background: #e7b94f22; }
.so-btn.gold { border-color: #fff6c8; background: linear-gradient(150deg, #f6d48a, #dca447 55%, #c68a2c); color: #3d2a06; box-shadow: 0 0 14px #ffd86a55; }
.so-btn.gold:hover { filter: brightness(1.08); }
.so-btn:disabled { opacity: .5; cursor: default; }
.so-later { display: block; margin: 18px auto 0; padding: 4px 8px; background: none; border: none; font: inherit; font-size: .9rem; color: #d9bf72; text-decoration: underline; cursor: pointer; }
.so-later:hover { color: #f6f08c; }
.so-handle label { display: block;  text-align: left; font-size: .85rem; color: #d9bf72; margin-bottom: 12px; }
.so-handle input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-size: 1rem; padding: 9px 11px; border-radius: 8px; border: 2px solid #c9952a; background: #1a140a; color: #fff3d0; }
.so-handle input:focus { outline: none; border-color: #f6d48a; }
.so-handle label { margin-bottom: 16px; }
.so-msg { margin: 10px 0 0; font-size: .85rem; color: #ffb05a; }
.so-msg:empty { display: none; }
.so-note { margin: 18px 0 0; font-size: .75rem; color: #b89c58; }
.so-card { border: 2px solid #e7b94f; border-radius: 10px; padding: 14px; margin: 0 0 12px; text-align: center; background: radial-gradient(ellipse 90% 70% at 50% 0%, #4d360c, #2a2010); color: #fff3d0; }
.so-card:empty { display: none; }
/* the Golden Feetle Token's sign-in step (shoutout.js guestToken): the account popup's sign-in, in the token's gold */
.so-back-caret { position: absolute; top: 12px; left: 10px; z-index: 2; background: none; border: none; padding: 6px; color: #e7b94f; cursor: pointer; line-height: 0; }
.so-dlg .so-token-sm { display: block; position: static; width: 64px; height: 64px; margin: 4px auto 6px; filter: drop-shadow(0 0 14px #ffd86a88); transform: none; }
.so-signin-h { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.1; color: #ffe27a; text-shadow: 0 2px 0 #7a4f0c; }
.so-signin { text-align: center; }
.so-signin .acct-google { border: 2px solid #e7b94f; }
.so-signin .acct-email-btn { background: linear-gradient(#f6d48a, #dca447 55%, #c68a2c); color: #3d2a06; border: 2px solid #fff1c4; box-shadow: 0 0 14px #ffcf5a55; }
.so-signin .acct-or { color: #d9bf72; }
.so-signin .acct-or::before, .so-signin .acct-or::after { background: #e7b94f66; }
.so-signin .acct-small, .so-signin .acct-small a { color: #c9ad66; }
.so-card:not(:empty) ~ .msg-empty { display: none; }   /* the shoutout card counts as a message */.so-q:last-child { margin-bottom: 0; }   /* a message on its own (Messages card after answering) sits centred, no gap under it */
@media (prefers-reduced-motion: reduce) { .so-pan { animation: none; transform: translate(-25%, -50%); } }
.so-btns[hidden], .so-handle[hidden], .so-later[hidden] { display: none; }   /* display: flex above would otherwise beat the hidden attribute */
.so-handle label small { display: inline; margin-left: 4px; }
.so-follow { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: #d9bf72; font-weight: 600; text-decoration: none; }
.so-follow:hover { color: #f6f08c; }
.so-badge { margin: -2px auto 16px; padding: 7px 12px; width: fit-content; border: 1px solid #e7b94f88; border-radius: 999px; background: #e7b94f1f; color: #f6e7a8; font-size: .9rem; }
.so-badge b { color: #f6f08c; }

.msgs-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.msg-clear { font: 600 .8rem system-ui, sans-serif; color: var(--muted); background: none; border: 1px solid var(--line2, #555); border-radius: 6px; padding: 4px 10px; cursor: pointer; }   /* Messages: Clear all */
.msg-clear:hover { color: var(--fg); }
.msg-clear-wrap { display: flex; align-items: center; }
.msg-clear[hidden] { display: none; }
.msg-confirm { display: flex; box-sizing: border-box; border: 1px solid var(--line2, #555); border-radius: 6px; overflow: hidden; }   /* the same outline as Clear all, split in two */
.msg-confirm[hidden] { display: none; }
.msg-confirm button { flex: 1; min-width: 0; height: 100%; border: none; border-radius: 0; background: none; font: 700 .9rem system-ui, sans-serif; cursor: pointer; padding: 0; }
.msg-confirm .msg-no { border-left: 1px solid var(--line2, #555); }
.msg-yes { color: #6fcf6f; }
.msg-no { color: #e06c5c; }
/* footer on the game pages: every mode (the current one gold), in one row that scrolls sideways when it doesn't fit */
footer.foot-scroll, .phone-menu footer.foot-scroll { gap: 28px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
footer.foot-scroll::-webkit-scrollbar { display: none; }
footer.foot-scroll::before, footer.foot-scroll::after { content: ""; margin: auto; }   /* centred while it fits, scrolls from the start when it doesn't */
footer.foot-scroll > * { flex: none; }
footer .link.foot-here { color: var(--accent); font-weight: 700; text-decoration: none; pointer-events: none; }
/* fades at the edge(s) there's more to scroll to (set by account.js) */
footer.foot-scroll.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
footer.foot-scroll.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px); mask-image: linear-gradient(90deg, transparent, #000 16px); }
footer.foot-scroll.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
/* the scrolling footer + its ‹ › buttons sit inside the keyboard's keys (the keyboard has 8px padding), a little tighter */
.foot-wrap { display: flex; align-items: center; gap: 2px; box-sizing: border-box; width: calc(100% - 28px); max-width: 472px; margin: 0 auto; }
.phone-menu .foot-wrap { max-width: 347px; }
.foot-wrap > footer.foot-scroll, .phone-menu .foot-wrap > footer.foot-scroll { flex: 1; min-width: 0; width: auto; max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
.foot-arrow { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 6px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.foot-arrow:hover:not(:disabled) { color: var(--fg); background: #ffffff14; }
.foot-arrow:disabled { opacity: .25; cursor: default; }
.foot-wrap.fits .foot-arrow { visibility: hidden; }   /* everything fits: no buttons (they keep their room so nothing jumps) */
footer.foot-scroll.dragging { cursor: grabbing; user-select: none; }
footer.foot-scroll.dragging a { pointer-events: none; }
/* the line under the logo is filled in by the page's script: it fades in instead of popping in */
#subheader:not(:empty) { animation: subIn .45s ease-out both; }
/* game pages: it waits for the game, then fades with it (Reverse has this text in the page from the start, so it would go early) */
body:is(.game-page, :has(#keyboard)):not(.game-in) #subheader { opacity: 0; animation: none; }
@keyframes subIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #subheader:not(:empty) { animation: none; } }
/* game pages: everything in the game but the keyboard (board, messages, round and streak lines, countdown) fades in once
   the game has drawn itself, at the same speed as the line under the logo. account.js adds .game-in (with a fallback) */
body:is(.game-page, :has(#keyboard)):not(.game-in) > :is(main, #tools, #roundLine, #streakLine, #countdown) { opacity: 0; }
body.game-in:has(#keyboard) > :is(main, #tools, #roundLine, #streakLine, #countdown) { animation: subIn .45s ease-out both; }
@media (prefers-reduced-motion: reduce) { body.game-in:has(#keyboard) > :is(main, #tools, #roundLine, #streakLine, #countdown) { animation: none; } }
/* the mode tag beside the logo (Daily / Unlimited / Reverse): its box morphs to the new mode's width while the words
   cross-fade (mode-tag.js); the title stays centred, so the logo glides along */
header h1 .mode-tag { position: relative; display: inline-flex; justify-content: center; align-items: center; box-sizing: border-box; overflow: hidden; white-space: nowrap; vertical-align: middle; }
header h1 .mode-tag .mt-word { flex: none; position: relative; }   /* relative: slid with left (sharp), mode-tag.js */
header h1 .mode-tag .mt-old { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }   /* the old word, centred over the new one while they cross-fade */
/* switching between pages (e.g. Daily -> Unlimited): the keyboard is the same everywhere, so it stays on screen through the
   change instead of disappearing and redrawing (a cross-page view transition; browsers without it just change page as before).
   The rest of the page isn't cross-faded here: it has its own fades (the game content, the line under the logo, the mode tag) */
@view-transition { navigation: auto; }
#keyboard { view-transition-name: feetle-keyboard; }
/* switching mode: the old page (minus the keyboard and footer, carried over above) fades out quickly as the new one is already
   underneath; the new game then fades in on its own (body.game-in). Done here, not by delaying the click, because a delayed
   switch made the browser skip the transition, and the keyboard flashed */
::view-transition-old(root) { animation: subOut .18s ease-in forwards; }
::view-transition-new(root) { animation: none; }
::view-transition-group(feetle-keyboard) { animation-duration: .2s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
/* footer: a new mode's link gets the gold box with a NEW label on its border (like Duel's COMING SOON) */
footer a.new-badge { position: relative; flex: none; display: inline-flex; align-items: center; border: 2.5px solid var(--accent); border-radius: 8px; padding: 5px 20px; line-height: 1; font-size: .75rem; white-space: nowrap; text-decoration: none; }
footer a.new-badge::before { content: "NEW"; position: absolute; top: 0; left: 50%; transform: translate(-50%, -55%); padding: 0 3px; background: var(--bg); color: var(--accent); font-size: .55rem; font-weight: 700; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
footer a.new-badge:not(.foot-here) { color: var(--fg); }   /* white text, like Duel */
footer a.link.new-badge, .phone-menu footer a.link.new-badge { padding: 5px 12px; }   /* wins over the footer links' "padding: 4px 0", so the word has room at its sides like Duel */
/* the footer row is carried over between game pages like the keyboard (only the gold "you are here" changes) */
.foot-wrap { view-transition-name: feetle-footer; }
::view-transition-group(feetle-footer) { animation-duration: .2s; }
@keyframes subOut { from { opacity: 1; } to { opacity: 0; } }
#tools .tool-in { animation: toolPan .45s ease-out both; }   /* Unlimited: hint boxes + Give up pan up one by one (unlimited.js bobTools) */
@keyframes toolPan { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* phones, local testing only (account.js): the test buttons live in a drawer opened by the 🧪 button */
.dev-drawer-btn { position: fixed; left: 8px; bottom: 8px; z-index: 60; width: 38px; height: 38px; border-radius: 50%; border: 1px dashed #ff9d9d; background: #2a1d1d; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.dev-drawer-btn.on { background: #4a2a2a; }
.dev-drawer { position: fixed; left: 8px; right: 8px; bottom: 54px; z-index: 60; max-height: 60dvh; overflow-y: auto; padding: 10px; border: 1px dashed #ff9d9d; border-radius: 10px; background: #1b1b1bf2; box-shadow: 0 6px 24px #000a; }
.dev-drawer[hidden] { display: none; }
.dev-drawer > :is(.dev-resets, .dev-accts) { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: auto; max-width: none; margin: 0 0 6px; }
.dev-drawer :is(.dev-reset, .rv-devnew, button) { width: 100%; margin: 0; text-align: left; white-space: normal; font-size: .7rem; line-height: 1.2; padding: 6px 8px; }
.dev-drawer details, .dev-drawer .rv-answer, .dev-drawer p { grid-column: 1 / -1; }
/* phones (mode-tag.js): the gold is a layer behind the words that stretches, so the change runs on the graphics chip */
header h1 .mode-tag.mt-gpu { background: transparent; isolation: isolate; overflow: visible; }   /* nothing clipped: the gold layer and the old word may be wider than the box while it changes */
header h1 .mode-tag .mt-bg { position: absolute; inset: 0; z-index: -1; background: var(--accent); border-radius: inherit; transform-origin: center; }   /* stretches about its centre (mode-tag.js) */
