/* ==========================================================================
   ANATOMLE: Study Notebook theme
   Every colour lives in the tokens below. Dark mode swaps them in the
   :root[data-theme="dark"] block further down (set by js/ui/theme.js).
   ========================================================================== */
:root {
    color-scheme: only light;   /* with the meta tag (js/ui/theme.js): stops phones force-darkening light mode */
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;   /* no phone font boosting */
    --paper:      #FBFCFF;
    --paper-line: #DCE6FA;
    --card:       #FFFFFF;
    --card-soft:  #FFFDE8;
    --ink:        #17213A;
    --ink-2:      #2B3654;
    --ink-3:      #4A5573;
    --rule:       #C9D3EA;
    --shadow:     #CBD7F4;
    --margin:     #FF6F91;
    --pen:        #1D3FBF;
    --pen-dk:     #122A85;

    /* highlighters */
    --hl-green:   #A8EBC0;
    --hl-yellow:  #FFE36B;
    --hl-pink:    #FFA3CB;
    --hl-red:     #FFC7CF;
    --hl-blue:    #8FD0FF;
    --hl-purple:  #C9B6FF;

    /* strong versions for text, dots and icons */
    --green:      #1E9E52;
    --green-dk:   #11733A;
    --yellow-dk:  #8A6100;
    --pink-dk:    #C2185B;
    --red:        #C8102E;
    --purple:     #6A3FD1;

    --on-ink:     #FFFFFF;
    --nav-bg:     rgba(251,252,255,.94);
    --soft-bg:    #F6F8FE;
    --cv-a: #F7F8FC; --cv-b: #ECEFF6; --cv-c: #E2E7F1;

    /* the guess box: a bold block so it is spotted right away */
    --ask-bg: #1D3FBF; --ask-ink: #FFFFFF; --ask-glow: rgba(29,63,191,.45);

    /* game layout */
    --nav: 64px; --bar: 56px; --panel: clamp(400px, 32vw, 480px); --ad: 0px;

    --font:  'Space Grotesk', system-ui, sans-serif;
    --hand:  'Caveat', 'Comic Sans MS', cursive;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        linear-gradient(var(--paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-font-smoothing: antialiased;
}

/* the pink margin line down the left of every page */
.nb-margin::before {
    content: '';
    position: fixed; top: 0; bottom: 0; left: 44px;
    width: 2px; background: var(--margin); opacity: .8;
    pointer-events: none; z-index: 1;
}

a { color: var(--pen); }
a:hover { color: var(--pen-dk); }

.hand { font-family: var(--hand); font-weight: 700; }

/* highlighter strokes: sit under the lower half of the text */
.hl        { background: linear-gradient(transparent 52%, var(--hl-yellow) 52%); padding: 0 .12em; }
.hl-green  { background: linear-gradient(transparent 52%, var(--hl-green) 52%); padding: 0 .12em; }
.hl-pink   { background: linear-gradient(transparent 52%, var(--hl-pink) 52%); padding: 0 .12em; }

.wordmark {
    font-family: var(--font); font-weight: 700; letter-spacing: -.045em;
    color: var(--ink); text-decoration: none; line-height: 1;
}
.wordmark:hover { color: var(--ink); }
/* the brand mark: the first "a" swiped with highlighter, like the favicon */
.wordmark .hl-a, .nb-page .nav-logo span {
    background: linear-gradient(transparent 22%, var(--hl-yellow) 22%, var(--hl-yellow) 94%, transparent 94%);
    padding: 0 .05em; margin-right: .02em; border-radius: 2px;
}

/* buttons */
.nb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 42px; padding: 0 16px; border-radius: 10px;
    border: 2px solid var(--ink); background: var(--card); color: var(--ink);
    font-family: var(--font); font-weight: 700; font-size: 14px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    box-shadow: 3px 3px 0 var(--shadow);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.nb-btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--shadow); color: var(--ink); }
.nb-btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--shadow); }
.nb-btn:disabled { opacity: .45; cursor: default; transform: none; }
.nb-btn.dark { background: var(--ink); color: var(--on-ink); }
.nb-btn.dark:hover { color: var(--on-ink); }
.nb-btn.hl-btn { background: var(--hl-yellow); }
/* Share on the end cards: the one blue button, so it catches the eye; green once shared */
.nb-btn.share-btn { gap: 8px; background: var(--pen); color: var(--on-ink); border-color: var(--ink); }
.nb-btn.share-btn:hover { color: var(--on-ink); }
.nb-btn.share-btn.done { background: var(--green); color: #fff; }
.nb-btn.big { height: 50px; padding: 0 24px; font-size: 16px; }
.nb-btn.wide { width: 100%; }

/* washi tape */
.tape {
    position: absolute; width: 96px; height: 26px;
    background: rgba(255,224,71,.7); pointer-events: none;
}
.tape.pink { background: rgba(255,142,191,.65); }
.tape.blue { background: rgba(143,208,255,.7); }

:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

.nb-scroll::-webkit-scrollbar { width: 6px; }
.nb-scroll::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

@keyframes nbShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.shake { animation: nbShake .3s ease-in-out; }
@keyframes overlayFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes cardPopIn { from { opacity:0; transform:translateY(28px) rotate(-2deg) scale(.94); } to { opacity:1; transform:translateY(0) rotate(-.6deg) scale(1); } }
@keyframes streakPop { 0% { opacity:0; transform:scale(.4) translateY(10px); } 60% { transform:scale(1.15) translateY(-4px); } 100% { opacity:1; transform:scale(1) translateY(0); } }
@keyframes flameDance { 0%,100% { transform:rotate(-4deg) scale(1); } 50% { transform:rotate(4deg) scale(1.08); } }
/* A sheet of paper that flips away when a page opens (pairs with the home peel).
   Add <div class="page-turn"></div> as the first element in <body>. */
.page-turn {
    position: fixed; inset: 0; z-index: 10000; pointer-events: none;
    background-color: var(--paper);
    background-image:
        linear-gradient(var(--paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
    background-size: 28px 28px;
    transform-origin: 0 50%;
    box-shadow: 20px 0 60px rgba(23,33,58,.25);
    animation: turnAway .85s cubic-bezier(.55,0,.25,1) .05s forwards;
}
@keyframes turnAway {
    0%   { transform: perspective(2200px) rotateY(0); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: perspective(2200px) rotateY(-96deg); opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .page-turn { display: none; } }

/* ── GAME PAGES ──────────────────────────────────────────────────────────── */
body.game { overflow: hidden; }

/* the 3D model sits on a taped-down white card */
#cv {
    position: fixed; z-index: 10;
    top: calc(var(--nav) + var(--bar) + 6px);
    left: 64px; right: calc(var(--panel) + var(--ad) + 24px);
    bottom: 18px;
    background:
        radial-gradient(ellipse at 50% 42%, var(--cv-a) 0%, var(--cv-b) 70%, var(--cv-c) 100%);
    border: 2px solid var(--ink); border-radius: 6px;
    box-shadow: 6px 6px 0 var(--shadow);
    overflow: hidden;
}
.cv-tape-l { position: fixed; z-index: 11; top: calc(var(--nav) + var(--bar) - 6px); left: 100px; transform: rotate(-4deg); }

/* "drawing the model… 40%" while the 3D model downloads (js/3d/hlFx.js) */
.cv-load {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
    max-width: 80%; text-align: center; pointer-events: none;
    font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--ink-3);
}
.cv-load.err { font-family: var(--font); font-size: 16px; color: var(--red); pointer-events: auto; }
.cv-load .nb-btn { margin-left: 8px; vertical-align: middle; }

/* "drag to turn · scroll to zoom" until the player first moves the model */
.cv-hint {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2;
    padding: 6px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
    background: var(--nav-bg); border: 1.5px solid var(--rule);
    font-size: 13px; font-weight: 500; color: var(--ink-2);
    transition: opacity .4s ease;
}
.cv-hint b { color: var(--ink); }
.cv-hint.gone { opacity: 0; }

.reset-view {
    position: fixed; z-index: 50;
    left: 80px; bottom: 32px;
    width: 40px; height: 40px; padding: 0; font-size: 18px;
}

/* Loading / no-puzzle screens (daily) */
.nb-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background-color: var(--paper);
    background-image:
        linear-gradient(var(--paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
    background-size: 28px 28px;
    text-align: center; padding: 24px;
}
.nb-screen .wordmark { font-size: 56px; }
.nb-screen .sub { font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--pen); }
.nb-dots { display: flex; gap: 8px; }
.nb-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--hl-yellow); border: 2px solid var(--ink); animation: nbBounce 1s ease-in-out infinite; }
.nb-dots i:nth-child(2) { background: var(--hl-pink); animation-delay: .15s; }
.nb-dots i:nth-child(3) { background: var(--hl-blue); animation-delay: .3s; }
@keyframes nbBounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }

/* ── GAME UI (js/ui/pathfindingUI.js) ─────────────────────────────────────── */
.g-nav {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav); z-index: 300;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 24px 0 64px;
    background: var(--nav-bg); backdrop-filter: blur(4px);
    border-bottom: 2px solid var(--ink);
}
.g-nav .brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.g-nav .wordmark { font-size: 30px; }
.g-nav .mode { font-family: var(--hand); font-weight: 700; font-size: 26px; color: var(--pen); transform: rotate(-2deg); display: inline-block; white-space: nowrap; }
.g-nav .acts { display: flex; gap: 10px; }
/* stats and shop: the games' top bar over a normal scrolling page */
body.has-nav { padding-top: calc(var(--nav) + 6px); }
body.has-nav .g-nav .mode { text-transform: none; }
body.has-nav .pg-h1 { margin: 0; font: inherit; line-height: 1.2; }
body.has-nav .stats, body.has-nav .shop { padding-top: 18px; }

.g-bar {
    position: fixed; top: var(--nav); left: 64px; right: calc(var(--panel) + var(--ad) + 24px);
    height: var(--bar); z-index: 200;
    display: flex; align-items: center; gap: 12px; padding: 0 4px;
}
.g-bar .ends { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.g-bar .bone { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.g-bar .to { font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--pen); }
.g-bar .counts { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.g-bar .left { line-height: 1; font-family: var(--hand); font-weight: 700; font-size: 28px; white-space: nowrap; }
.g-bar .left b { font-family: var(--font); font-size: 26px; }
.g-bar .left.danger { color: var(--red); }
/* "need at least N more": the fewest guesses that could still finish */
.g-bar .need {
    font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
    padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--card);
}
.g-bar .need.close { background: var(--hl-yellow); border-color: var(--ink); color: var(--ink); }
.g-bar .need.tight { background: var(--hl-red); border-color: var(--red); color: var(--ink); animation: needPulse 1.4s ease-in-out infinite; }
@keyframes needPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(200,16,46,.35); } 50% { box-shadow: 0 0 0 5px rgba(200,16,46,0); } }

.g-panel {
    position: fixed; top: calc(var(--nav) + 18px); right: calc(var(--ad) + 24px); width: calc(var(--panel) - 24px);
    bottom: 18px; z-index: 200;
    display: flex; flex-direction: column; gap: 14px;
}
.g-route {
    flex: 1.15 1 0; min-height: 0; display: flex; flex-direction: column;
    background: var(--card-soft); border: 2px solid var(--ink); border-radius: 4px;
    box-shadow: 6px 6px 0 var(--shadow); transform: rotate(.6deg);
    position: relative;
}
.g-route .tape { top: -12px; right: 40px; transform: rotate(5deg); }
.g-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 18px 4px; }
.g-head .t { font-family: var(--hand); font-weight: 700; font-size: 30px; line-height: 1; }
.g-head .n { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.g-list { overflow-y: auto; padding: 4px 18px 14px; flex: 1; }
.g-row {
    display: flex; align-items: center; gap: 10px; min-height: 38px;
    font-size: 16px; font-weight: 700; color: var(--ink);
    border-bottom: 1.5px solid var(--paper-line); cursor: default;
}
.g-row.clickable { cursor: pointer; }
.g-row.clickable:hover .nm { text-decoration: underline; text-decoration-thickness: 2px; }
.g-row .dot {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--on-ink); background: var(--green);
}
.g-row .dot.goal { background: var(--ink); }
.g-row .dot.empty { background: transparent; border: 2px dashed #8A93AC; }
.g-row .dot.reveal { background: var(--purple); }
.g-row.unknown { color: var(--ink-3); font-weight: 500; letter-spacing: .1em; }
.g-row .alts { font-weight: 500; color: var(--ink-2); }
.g-row .tag { margin-left: auto; padding-left: 8px; font-family: var(--hand); font-weight: 700; font-size: 19px; color: var(--ink-3); white-space: nowrap; }
.g-head .n.warn { color: var(--red); }

/* guess log */
.g-log { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; border-bottom: 1.5px solid var(--paper-line); }
.g-log:last-child { border-bottom: none; }
.g-log .num {
    flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; border: 2px solid var(--ink);
}
.g-log.ok .num { background: var(--hl-green); }
.g-log.detour .num { background: var(--hl-yellow); }
.g-log.bad .num { background: var(--hl-red); }
.g-log .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.g-log b { font-size: 15px; }
.g-log.ok b { background: linear-gradient(transparent 55%, var(--hl-green) 55%); align-self: flex-start; }
.g-log.detour b { background: linear-gradient(transparent 55%, var(--hl-yellow) 55%); align-self: flex-start; }
.g-log.bad b { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; align-self: flex-start; }
.g-log .why { font-size: 13px; color: var(--ink-2); }
.g-log.hint .num { background: var(--hl-purple); }
.g-log.hint b { background: linear-gradient(transparent 55%, var(--hl-purple) 55%); align-self: flex-start; }
.g-trail .chip.hint { background: var(--hl-purple); }
.g-feedback.hint { background: var(--hl-purple); }
.nb-btn .btn-sub { font-weight: 500; font-size: 12px; color: var(--ink-3); }
.g-log.bad .why { color: var(--red); }

.g-notes {
    flex: 1 1 0; min-height: 120px; display: flex; flex-direction: column;
    background: var(--card); border: 2px solid var(--ink); border-radius: 4px;
    box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-.4deg);
}
.g-notes .g-head .t { font-size: 26px; }
.g-chipwrap { overflow-y: auto; padding: 4px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.g-empty { font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--ink-3); }

.g-btns { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

/* Wide screens: the panel takes about a third of the page, and a strip on
   the right is kept free for an ad (a 160x600 skyscraper fits). Put the ad
   inside <div class="ad-rail"> on each game page. */
@media (min-width: 1450px) {
    :root { --panel: 34vw; --ad: 184px; }
}
.ad-rail {
    position: fixed; z-index: 150;
    top: calc(var(--nav) + 18px); bottom: 18px; right: 12px; width: calc(var(--ad) - 24px);
    display: flex; justify-content: center; align-items: flex-start;
}
@media (max-width: 1449px) { .ad-rail { display: none; } }


.g-guess { flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 5; }

/* the guess box at the top of the side panel */
.g-ask {
    position: relative; z-index: 20; display: block;
    background: var(--ask-bg); color: var(--ask-ink);
    border: 3px solid var(--ink); border-radius: 10px;
    padding: 10px 12px 12px;
    box-shadow: 6px 6px 0 var(--shadow);
}
.g-ask.fresh { animation: askPulse 1.6s ease-in-out 3; }
@keyframes askPulse { 0%,100% { box-shadow: 6px 6px 0 var(--shadow), 0 0 0 0 var(--ask-glow); } 50% { box-shadow: 6px 6px 0 var(--shadow), 0 0 0 10px rgba(0,0,0,0); } }
.ask-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.ask-t { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.ask-k { font-size: 13px; font-weight: 600; opacity: .9; }
/* the field stays white with dark text in both themes, for contrast on the block */
.g-field {
    position: relative; display: flex; align-items: center; gap: 12px;
    height: 54px; padding: 0 12px 0 16px;
    background: #FFFFFF; border: 2px solid #0E1526; border-radius: 8px;
}
.g-field:focus-within { box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
:root[data-theme="dark"] .g-field:focus-within { box-shadow: 0 0 0 3px rgba(20,26,41,.4); }
.g-field.err { border-color: #C8102E; }
.g-field input {
    flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent;
    font-family: var(--font); font-size: 19px; font-weight: 600; color: #17213A;
}
.g-field input::placeholder { color: #5A6480; font-weight: 500; }
.g-drop {
    position: absolute; top: calc(100% + 14px); left: -14px; right: -14px;
    max-height: 300px; overflow-y: auto; z-index: 450;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px;
    box-shadow: 4px 4px 0 var(--shadow);
}
.g-sug {
    padding: 11px 16px; font-size: 16px; font-weight: 700; cursor: pointer;
    border-bottom: 1.5px solid var(--paper-line);
}
.g-sug:last-child { border-bottom: none; }
.g-sug:hover { background: var(--soft-bg); }
.g-sug.sel { background: var(--hl-yellow); }

.g-over {
    position: fixed; inset: 0; z-index: 600; padding: 20px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(23,33,58,.45); backdrop-filter: blur(6px);
    animation: overlayFadeIn .3s ease both;
}
.g-card {
    position: relative; width: 100%; max-width: 470px; max-height: calc(100vh - 40px); overflow-y: auto;
    padding: 36px 34px 30px; text-align: center;
    background: var(--card); border: 2px solid var(--ink); border-radius: 6px;
    box-shadow: 8px 8px 0 var(--shadow);
    animation: cardPopIn .5s cubic-bezier(.34,1.4,.64,1) both;
    transform: rotate(-.6deg);
}
.g-card .tape { top: -13px; left: 50%; margin-left: -48px; transform: rotate(-3deg); }
.g-card .emoji { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.g-card h2 { margin: 0 0 8px; font-size: 38px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.g-card h2 .hl-green, .g-card h2 .hl-pink, .g-card h2 .hl { padding: 0 .1em; }
.g-card .stars { display: flex; justify-content: center; gap: 4px; font-size: 24px; margin-bottom: 6px; }
.g-card .detail { font-size: 16px; font-weight: 500; color: var(--ink-2); margin: 0 0 18px; }
.g-card .route { font-family: var(--hand); font-weight: 700; font-size: 26px; margin-bottom: 16px; }
.g-card .route .to { color: var(--pen); padding: 0 6px; }
.g-streak {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin: 0 auto 18px; padding: 10px 18px; width: fit-content;
    background: var(--card-soft); border: 2px solid var(--ink); border-radius: 8px;
    text-align: left;
}
.g-streak .num { font-weight: 700; font-size: 20px; line-height: 1.1; }
.g-streak .sub { font-size: 13px; color: var(--ink-2); }
.g-streak .saved { font-family: var(--hand); font-weight: 700; font-size: 17px; line-height: 1.2; color: var(--pen); margin: 2px 0; }
.g-grid {
    font-size: 20px; letter-spacing: 2px; line-height: 1.4; white-space: pre-wrap;
    padding: 10px 14px; margin-bottom: 10px;
    background: var(--soft-bg); border: 2px dashed var(--rule); border-radius: 8px;
}
.g-card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.g-card .route.small { font-size: 20px; margin: -10px 0 14px; }
.g-card .px-share-grid { font-size: 15px; letter-spacing: 1px; line-height: 1.3; padding: 6px 12px; width: fit-content; margin: 0 auto 14px; }
.g-share { margin-bottom: 10px; }
.share-plus { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 1px 8px 1px 9px; border-radius: 999px; background: #FFE047; color: #0E1526; font-size: 13px; font-weight: 800; }
/* the bottom row: small and quiet, three across */
.g-card .g-end-row { flex-wrap: nowrap; gap: 8px; margin-top: 4px; }
.g-card .g-end-row .nb-btn { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 10px; font-size: 14px; }
/* the streak and Sarcs on one line; tap for the details */
.g-sum { margin: 0 auto 16px; max-width: 380px; background: var(--card-soft); border: 2px solid var(--ink); border-radius: 8px; }
.g-sum-row {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 9px 14px;
    background: none; border: 0; color: var(--ink); font: 700 17px var(--font); cursor: pointer; border-radius: 6px;
}
.g-sum-row:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.g-sum-ico { font-size: 22px; line-height: 1; display: inline-flex; }
.g-sum-dot { color: var(--ink-3); }
.g-sum-sarc { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.g-sum-sarc.dim { color: var(--ink-2); }
.g-sum-chev { margin-left: 2px; font-size: 13px; color: var(--ink-3); transition: transform .2s ease; }
.g-sum.open .g-sum-chev { transform: rotate(180deg); }
.g-sum-line { margin: -4px 12px 8px; font-family: var(--hand); font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--pen); }
.g-sum-in { display: inline-flex; align-items: center; gap: 6px; margin: -2px 0 10px; padding: 2px 4px; background: none; border: 0; color: var(--pen); font: 700 14px var(--font); cursor: pointer; }
.g-sum-in u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.g-sum-in .sarc-bonus { font-size: 12px; }
.g-sum .sarc-unlock { margin: 0 12px 10px; }
.g-sum-more { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 12px; border-top: 1.5px dashed var(--rule); }
.g-card .row:last-child { margin-bottom: 0; }


/* ── STATIC PAGES (about, credits, contact) ───────────────────────────────── */
.nb-page nav {
    background: var(--nav-bg) !important; backdrop-filter: blur(6px);
    border-bottom: 2px solid var(--ink) !important; height: 64px !important;
}
.nb-page .nav-logo { font-family: var(--font) !important; font-weight: 700; letter-spacing: -.045em; color: var(--ink) !important; font-style: normal; }
.nb-page .nav-logo span { color: var(--ink) !important; font-style: normal !important; }
.nb-page .nav-menu { border: 2px solid var(--ink) !important; border-radius: 10px !important; color: var(--ink) !important; font-weight: 700 !important; box-shadow: 3px 3px 0 var(--shadow); background: var(--card) !important; }
.nb-page .nav-menu:hover { background: var(--ink) !important; color: var(--on-ink) !important; }
.nb-page main { position: relative; z-index: 2; }
.nb-page h1, .nb-page h2, .nb-page h3 { font-family: var(--font) !important; font-style: normal; letter-spacing: -.035em; }
.nb-page h1 span { color: var(--ink) !important; font-style: normal !important; background: linear-gradient(transparent 55%, var(--hl-pink) 55%); }
.nb-page .eyebrow { font-family: var(--hand) !important; font-weight: 700 !important; font-size: 26px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--pen) !important; }

/* turn pad in the corner of the 3D view (js/3d/hlFx.js); it has its own reset */
.reset-view { display: none !important; }
.cv-pad {
    position: absolute; right: 12px; bottom: 12px; z-index: 3;
    display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); gap: 2px;
    touch-action: none; user-select: none; -webkit-user-select: none;
}
.cv-pad button {
    padding: 0; border-radius: 50%; cursor: pointer;
    background: var(--nav-bg); color: var(--ink-2); border: 1.5px solid var(--rule);
    font-size: 13px; line-height: 1; touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
.cv-pad button:hover { color: var(--ink); border-color: var(--ink-3); }
.cv-pad button:active { background: var(--hl-yellow); color: var(--ink); }
.cv-pad .pad-up { grid-area: 1 / 2; }
.cv-pad .pad-left { grid-area: 2 / 1; }
.cv-pad .pad-mid { grid-area: 2 / 2; font-size: 16px; }
.cv-pad .pad-right { grid-area: 2 / 3; }
.cv-pad .pad-down { grid-area: 3 / 2; }
.cv-pad .pad-in { grid-area: 1 / 3; font-size: 18px; font-weight: 700; }
.cv-pad .pad-out { grid-area: 3 / 3; font-size: 18px; font-weight: 700; }
.lbl-short { display: none; }

/* static pages set their own body colour; keep the graph paper */
body.nb-page {
    background-color: var(--paper) !important;
    background-image:
        linear-gradient(var(--paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--paper-line) 1px, transparent 1px) !important;
    background-size: 28px 28px !important;
    color: var(--ink);
}

/* end card: guesses in the order they were made */
.g-trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -6px 0 18px; }
.g-trail .chip { padding: 3px 9px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; }
.g-trail .chip.ok { background: var(--hl-green); }
.g-trail .chip.detour { background: var(--hl-yellow); }
.g-trail .chip.bad { background: var(--hl-red); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

/* ── DARK MODE ───────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
    color-scheme: dark;
    --paper:      #141A29;
    --paper-line: #1E2639;
    --card:       #1C2335;
    --card-soft:  #232B40;
    --ink:        #E6EAF5;
    --ink-2:      #C2C9DC;
    --ink-3:      #9AA3BC;
    --rule:       #36405A;
    --shadow:     #0A0E18;
    --margin:     #B8476A;
    --pen:        #9DB2FF;
    --pen-dk:     #C3D0FF;

    --hl-green:   #2E6E4C;
    --hl-yellow:  #7A6418;
    --hl-pink:    #7E3A5E;
    --hl-blue:    #2B577E;
    --hl-purple:  #4E3F86;
    --hl-red:     #7A2E3A;

    --green:      #3DBA75;
    --green-dk:   #7FD8A6;
    --yellow-dk:  #E8C35A;
    --pink-dk:    #F08BBE;
    --red:        #FF7B8C;
    --purple:     #A88BF0;

    --on-ink:     #141A29;
    --nav-bg:     rgba(20,26,41,.94);
    --soft-bg:    #182033;
    --cv-a: #222A3E; --cv-b: #1A2133; --cv-c: #141A29;
    --ask-bg: #FFD54A; --ask-ink: #141A29; --ask-glow: rgba(255,213,74,.45);

    /* the static pages' own variables */
    --cream: #141A29; --card-bg: #1C2335; --border: #36405A;
    --ink-light: #C2C9DC; --muted: #9AA3BC; --coral: #F08BBE; --coral-dark: #FF7B8C;
}
:root[data-theme="dark"] .note { filter: brightness(.88) saturate(.9); }
:root[data-theme="dark"] .tape { opacity: .55; }
:root[data-theme="dark"] .g-row .dot.empty { border-color: #5A6480; }
:root[data-theme="dark"] .g-over { background: rgba(5,8,15,.6); }

.theme-toggle { width: 42px; padding: 0; font-size: 18px; }
.theme-fab { position: fixed; top: 14px; right: 16px; z-index: 900; }
.nb-page .theme-fab { top: auto; bottom: 16px; }

/* ── HOW TO PLAY (Osteomle; same card as the Muscle Mini and Plexus how-tos, .mx-how) */
.htp-over { z-index: 800; }
.htp-card { padding-top: 30px; }
.htp-card .htp-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; padding: 0; font-size: 22px; }
.htp-card h2 { padding: 0 40px; }
.htp-dot { display: inline-block; width: 12px; height: 12px; margin: 0 4px 0 2px; vertical-align: -1px;
           border-radius: 50%; border: 1.5px solid var(--ink); }
.htp-dot.ok { background: var(--hl-green); }
.htp-dot.detour { background: var(--hl-yellow); }
.htp-dot.bad { background: var(--hl-red); }
/* phones: five nav buttons leave no room for the game name, and the page below names the game */
@media (max-width: 440px) { body .g-nav .mode { display: none; } }
/* small phones (iPhone SE): keep Start on screen and the game name in the nav uncut */
@media (max-width: 380px) {
    body .mx-how ul { font-size: 14px; margin-bottom: 14px; line-height: 1.4; }
    .mx-how li { margin-bottom: 4px; }
    body .mx-how .detail { font-size: 15px; margin-bottom: 12px; }
    body .g-nav .wordmark { font-size: 20px; }
    body .g-nav .mode { font-size: 15px; }
    body .g-nav { padding: 0 8px 0 12px; }
    body .g-nav .acts { gap: 4px; }
    body .g-nav .nb-btn { height: 34px; padding: 0 8px; }
    body .g-nav .theme-toggle, body .g-nav .htp-btn, body .g-nav .games-btn, body .g-nav .kofi-btn { width: 32px; padding: 0; }
    body .htp-card { padding-top: 24px; padding-bottom: 16px; }
}

/* ── GUESS FEEDBACK + COLOUR KEY (game) ──────────────────────────────────── */
.g-key {
    position: fixed; z-index: 60;
    top: calc(var(--nav) + var(--bar) + 18px); left: 80px;
    display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100vw - var(--panel) - var(--ad) - 140px);
    padding: 6px 10px; border-radius: 8px;
    background: var(--nav-bg); border: 1.5px solid var(--rule);
    font-size: 12.5px; font-weight: 700; color: var(--ink-2);
    pointer-events: none;
}
.g-key span { display: inline-flex; align-items: center; gap: 5px; }
.k { display: inline-block; flex-shrink: 0; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--ink); }
.k.start { background: var(--green); }
.k.end { background: var(--hl-pink); }
.k.ok { background: var(--hl-green); }
.k.detour { background: var(--hl-yellow); }
.k.bad { background: var(--hl-red); }
.k.reveal { background: var(--purple); }

.g-feedback {
    position: relative; z-index: 1;
    padding: 9px 13px; border-radius: 8px;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--shadow);
    font-size: 15px; line-height: 1.35;
    animation: fbIn .45s cubic-bezier(.34,1.5,.64,1) both;
}
.g-feedback.ok     { background: var(--hl-green); }
.g-feedback.detour { background: var(--hl-yellow); }
.g-feedback.bad    { background: var(--hl-red); animation: fbIn .35s ease both, nbShake .35s ease-in-out .35s; }
.g-feedback.intro  { background: var(--card-soft); }
@keyframes fbIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.g-log.new { animation: logIn .5s cubic-bezier(.34,1.5,.64,1) both; }
.g-log.bad.new { animation: logIn .4s ease both, nbShake .35s ease-in-out .4s; }
@keyframes logIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* a found step draws its highlighter stroke in from the left */
.g-row .nm.hl-green, .g-log.ok.new b, .g-log.detour.new b {
    background-size: 100% 100%; background-repeat: no-repeat;
    animation: drawIn .7s ease-out both;
}
@keyframes drawIn { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }


/* letters of a correct guess pop in one by one */
.pop > span { display: inline-block; animation: letterPop .5s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes letterPop {
    0%   { opacity: 0; transform: translateY(10px) scale(.3) rotate(-14deg); }
    60%  { opacity: 1; transform: translateY(-4px) scale(1.25) rotate(6deg); }
    100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .g-feedback, .g-log.new, .g-row .nm.hl-green, .g-log.new b, .page-turn, .pop > span { animation: none !important; }
}

.g-feedback .warnline { display: block; margin-top: 6px; padding-top: 6px; border-top: 1.5px dashed var(--ink); font-weight: 700; font-size: 14.5px; }

/* ── FLASH CARDS (games/flashcards.html) ─────────────────────────────────── */
.fc-card { padding: 22px 24px; justify-content: center; text-align: center; }
.fc-kicker { font-size: 26px; color: var(--pink-dk); }
.fc-mask { margin: 14px 0 10px; font-size: 26px; font-weight: 700; letter-spacing: .04em; word-break: break-word; }
.fc-tip { margin: 0; font-size: 14px; color: var(--ink-3); }
.fc-verdict { font-family: var(--hand); font-weight: 700; font-size: 30px; }
.fc-verdict.ok { color: var(--green); }
.fc-verdict.bad { color: var(--red); }
.fc-name { margin: 4px 0 12px; font-size: 34px; letter-spacing: -.03em; line-height: 1.1; }
.fc-fact { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.fc-links { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.fc-panel .g-route { flex: 1 1 auto; }
.fc-decks {
    flex-shrink: 0; display: flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden;
    background: var(--card); box-shadow: 3px 3px 0 var(--shadow);
}
.fc-deck {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 38px; padding: 4px 10px; font-weight: 700; font-size: 13px; line-height: 1.15;
    color: var(--ink); text-decoration: none;
}
.fc-deck + .fc-deck { border-left: 2px solid var(--ink); }
.fc-deck:hover { background: var(--card-soft); color: var(--ink); }
.fc-deck.on { background: var(--hl-yellow); color: #0E1526; }
/* muscles deck: pick an area of the body, two rows of three */
.fc-areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--ink); }
.fc-areas .fc-deck { background: var(--card); min-height: 34px; font-size: 12.5px; }
.fc-areas .fc-deck + .fc-deck { border-left: 0; }
.fc-areas .fc-deck:hover { background: var(--card-soft); }
.fc-areas .fc-deck.on { background: var(--hl-yellow); }
.fc-pick[hidden] { display: none; }
.fc-pick .sub { max-width: 420px; }
.fc-pick-list { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); text-align: left; margin: 6px 0 8px; }
[hidden] { display: none !important; }

/* ── PHONES ──────────────────────────────────────────────────────────────────
   The model on top, then the guess box and buttons, then the route and the
   guesses, which scroll. Suggestions open upwards over the model so the
   phone keyboard never covers them. */
@media (max-width: 900px) {
    .nb-margin::before { left: 6px; }
    :root { --nav: 52px; --bar: 50px; --cvh: 42vh; }
    @supports (height: 1dvh) { :root { --cvh: 42dvh; } }

    .g-nav { padding: 0 10px 0 16px; gap: 8px; }
    .g-nav .brand { gap: 8px; }
    .g-nav .wordmark { font-size: 22px; }
    .g-nav .mode { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
    .g-nav .acts { gap: 6px; flex-shrink: 0; }
    .g-nav .nb-btn { height: 36px; padding: 0 11px; font-size: 13px; }
    .g-nav .theme-toggle, .g-nav .htp-btn { width: 36px; padding: 0; font-size: 16px; }
    .lbl-long { display: none; }
    .lbl-short { display: inline; }

    .g-bar { left: 12px; right: 10px; gap: 8px; padding: 0; }
    .g-bar .ends { gap: 0 6px; }
    .g-bar .bone { font-size: 16px; }
    .g-bar .to { font-size: 18px; }
    .g-bar .left { font-size: 20px; }
    .g-bar .left b { font-size: 18px; }
    .g-bar .need { font-size: 11px; padding: 1px 6px; }

    #cv { left: 10px; right: 10px; top: calc(var(--nav) + var(--bar)); bottom: auto; height: var(--cvh); box-shadow: 4px 4px 0 var(--shadow); }
    .cv-tape-l { display: none; }
    .cv-hint { bottom: 60px; font-size: 11.5px; padding: 4px 10px; }
    .cv-pad { right: 6px; bottom: 6px; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 30px); }
    .cv-hint, .g-key, .g-feedback.intro, .ask-head { display: none; }

    .g-panel {
        top: calc(var(--nav) + var(--bar) + var(--cvh) + 10px); left: 10px; right: 10px; bottom: 0; width: auto;
        overflow-y: auto; -webkit-overflow-scrolling: touch; gap: 10px; padding: 0 4px 16px 0;
    }
    .g-guess { order: 0; gap: 6px; }
    .g-btns { order: 1; flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .g-btns .nb-btn { flex: 1 1 0; min-width: 0; height: 36px; padding: 0 8px; font-size: 13px; box-shadow: 2px 2px 0 var(--shadow); }
    .g-btns .nb-btn .btn-sub { display: none; }
    .g-route { order: 2; }
    .g-notes { order: 3; }
    .g-route, .g-notes { flex: none; min-height: 0; transform: none; box-shadow: 4px 4px 0 var(--shadow); }
    .g-list, .g-chipwrap { overflow: visible; }
    .g-head { padding: 8px 14px 2px; }
    .g-head .t { font-size: 24px; }
    .g-notes .g-head .t { font-size: 22px; }
    .g-list { padding: 2px 14px 10px; }
    .g-chipwrap { padding: 2px 14px 10px; }
    .g-row { min-height: 32px; font-size: 15px; }
    .g-row .dot { width: 22px; height: 22px; }
    .g-row .tag { font-size: 16px; }

    .g-ask { padding: 6px; box-shadow: 4px 4px 0 var(--shadow); border-width: 2px; }
    .ask-head { margin: 0 2px 5px; }
    .ask-t { font-size: 16px; }
    .ask-k { display: none; }
    .g-field { height: 46px; }
    .g-field input { font-size: 17px; }   /* 16px+ stops iPhones zooming in on focus */
    /* fixed, so the scrolling panel can't clip it; its bottom edge sits just above the guess box */
    .g-drop { position: fixed; top: calc(var(--nav) + var(--bar) + var(--cvh) + 2px); bottom: auto; left: 14px; right: 14px;
              transform: translateY(-100%); max-height: calc(var(--cvh) - 6px); }
    .g-route .tape { display: none; }
    .g-feedback { font-size: 14px; padding: 7px 11px; }

    .g-over { padding: 12px; }
    .g-card { padding: 22px 16px 16px; max-height: calc(100vh - 24px); }
    .g-card .emoji { font-size: 36px; margin-bottom: 2px; }
    .g-card h2 { font-size: 30px; }
    .g-card .detail { margin-bottom: 14px; }
    .g-card .g-trail { margin-bottom: 14px; }
    .g-card .route { font-size: 22px; }

    /* flash cards: guess box, then the card, then the buttons */
    .fc-panel .fc-card { order: 1; padding: 14px 16px; }
    .fc-panel .g-btns { order: 2; }
    .fc-panel .fc-decks { order: 3; }
    .fc-panel .fc-areas { order: 4; }
    .fc-panel .fc-card { flex: none; }
    .fc-deck { min-height: 34px; font-size: 12.5px; padding: 3px 8px; }
    .fc-panel .fc-mask { font-size: 20px; margin: 8px 0 6px; }
    .fc-panel .fc-name { font-size: 26px; margin: 2px 0 8px; }
    .fc-panel .fc-kicker { font-size: 20px; }
}

/* hint letters: "Sca____" in the route list and the note */
.clue { font-weight: 700; letter-spacing: .14em; color: var(--ink); }
.g-soft { margin: 0 0 6px 36px; padding: 6px 10px; border-left: 3px solid var(--purple); background: var(--hl-purple); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.g-soft b { color: var(--ink); font-weight: 700; }
.g-row .clue { background: linear-gradient(transparent 55%, var(--hl-purple) 55%); }

/* ── MUSCLE MINI (js/ui/miniCrosswordUI.js) ──────────────────────────────────
   Wide screens: the clue and the grid, with the clue lists beside them.
   Phones: the clue, the grid, the buttons and the clue list; typing uses the
   phone's own keyboard. After solving,
   "See answers" (body.reviewing) swaps the grid for the clue list. */
:root { --mx-block: #17213A; --mx-cell: var(--card); }
:root[data-theme="dark"] { --mx-block: #070A12; --mx-cell: #2E3A58; }
.mx-bar .counts .left b { font-variant-numeric: tabular-nums; }
.mx-done-t { color: var(--green-dk); }
.mx-panel { gap: 12px; }
.mx-clue {
    flex-shrink: 0; display: flex; align-items: stretch; min-height: 62px;
    background: var(--ask-bg); color: var(--ask-ink);
    border: 3px solid var(--ink); border-radius: 10px; box-shadow: 6px 6px 0 var(--shadow);
}
.mx-arr {
    flex-shrink: 0; width: 38px; border: none; background: transparent; color: inherit;
    font: 700 28px var(--font); cursor: pointer; opacity: .85;
}
.mx-arr:hover { opacity: 1; }
.mx-clue-txt {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 2px;
    font-size: 16px; font-weight: 600; line-height: 1.25; cursor: pointer;
}
.mx-clue-n {
    flex-shrink: 0; padding: 2px 7px; border-radius: 6px;
    background: rgba(255,255,255,.18); font-weight: 700; font-size: 14px;
}

/* the grid scales to fit its box: as wide as it can, as tall as it can */
.mx-board {
    flex-shrink: 0; height: min(calc(var(--panel) - 24px), 46vh);
    container-type: size; display: flex; align-items: center; justify-content: center;
}
.mx-grid {
    --cell: min(100cqw / var(--cols), 100cqh / var(--rows));
    width: calc(var(--cell) * var(--cols)); height: calc(var(--cell) * var(--rows));
    display: grid; gap: 0;
    border: 3px solid var(--mx-block); border-radius: 4px; background: var(--mx-block);
    box-shadow: 6px 6px 0 var(--shadow);
    user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.mx-cell {
    position: relative; display: flex; align-items: center; justify-content: center;
    background: var(--mx-cell); color: var(--ink); cursor: pointer;
    box-shadow: inset 0 0 0 .5px var(--ink-3);
}
.mx-cell.block { background: var(--mx-block); cursor: default; box-shadow: none; }
.mx-cell.word { background: #CDE6FF; }
.mx-cell.sel  { background: var(--hl-yellow); }
:root[data-theme="dark"] .mx-cell.word { background: #2F5A93; }
:root[data-theme="dark"] .mx-cell.sel  { background: #8A6F12; }
.mx-num {
    position: absolute; top: 2px; left: 4px; line-height: 1;
    font-size: calc(var(--cell) * .24); font-weight: 700; color: var(--ink-2);
}
.mx-ltr { font-size: calc(var(--cell) * .56); font-weight: 700; line-height: 1; margin-top: calc(var(--cell) * .08); }
.mx-cell.bad .mx-ltr { color: var(--red); }
.mx-cell.bad::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top right, transparent calc(50% - 1px), var(--red) 50%, transparent calc(50% + 1px));
    opacity: .7;
}
.mx-cell.good .mx-ltr { color: var(--pen); }
.mx-cell.shown .mx-ltr { color: var(--purple); }
.mx-cell.shown::before {
    content: ''; position: absolute; top: 0; right: 0; pointer-events: none;
    border-style: solid; border-width: 0 calc(var(--cell) * .2) calc(var(--cell) * .2) 0;
    border-color: transparent var(--purple) transparent transparent;
}
.mx-grid.solved .mx-cell:not(.block) { background: var(--hl-green); animation: mxWave .5s ease both; }
:root[data-theme="dark"] .mx-grid.solved .mx-cell:not(.block) { background: #1E5A3A; }
@keyframes mxWave { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.mx-note {
    flex-shrink: 0; padding: 8px 12px; font-size: 14px; font-weight: 600;
    background: var(--hl-yellow); color: #17213A; border: 2px solid var(--ink); border-radius: 8px;
}
.mx-tools { flex-shrink: 0; display: flex; gap: 8px; }
.mx-tools > * { flex: 1 1 0; }
.mx-tools .nb-btn { width: 100%; }
.mx-menu-wrap { position: relative; }
.mx-menu {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 30;   /* opens upward: the tools sit low */
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--shadow);
}
.mx-menu button {
    padding: 10px 14px; border: none; border-bottom: 1.5px solid var(--paper-line);
    background: transparent; color: var(--ink); text-align: left; cursor: pointer;
    font: 600 15px var(--font); text-transform: capitalize;
}
.mx-menu button:last-child { border-bottom: none; }
.mx-menu button:hover { background: var(--hl-yellow); color: #17213A; }

.mx-clues { overflow-y: auto; padding: 4px 16px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-content: start; }
.mx-list-h { font-family: var(--hand); font-weight: 700; font-size: 26px; padding: 6px 0 2px; }
.mx-li { display: flex; gap: 8px; padding: 6px 6px; margin: 0 -6px; font-size: 14px; line-height: 1.3; border-radius: 6px; cursor: pointer; }
.mx-li b { flex-shrink: 0; min-width: 16px; }
.mx-li:hover { background: var(--soft-bg); }
.mx-li.on { background: #CDE6FF; color: #17213A; }
:root[data-theme="dark"] .mx-li.on { background: #24406B; color: var(--ink); }
.mx-li.filled span { color: var(--ink-3); }
.mx-li.on.filled span { color: inherit; }

/* the hidden box that takes the typing (see "typing" in miniCrosswordUI.js):
   on screen so phones will open their keyboard for it, but invisible.
   16px stops iOS zooming in on focus. */
.mx-type {
    position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0;
    opacity: 0; font-size: 16px; caret-color: transparent; pointer-events: none;
}
.mx-how ul { text-align: left; margin: 0 0 20px; padding-left: 20px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.mx-how li { margin-bottom: 6px; }

/* ── wide screens: the grid with the clues beside it */
body.mini .mx-bar,
body.mini .mx-panel {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(1040px, calc(100vw - 88px - var(--ad)));
}
body.mini .mx-panel {
    top: calc(var(--nav) + var(--bar) + 4px);
    flex-direction: row; align-items: flex-start; justify-content: center; gap: 32px;
}
.mx-main { display: flex; flex-direction: column; gap: 12px; flex: 0 1 600px; min-width: 0; }
body.mini .mx-clues { flex: 0 1 400px; min-width: 260px; max-height: 100%; grid-template-columns: 1fr; }
body.mini .mx-board { height: auto; aspect-ratio: 1; max-height: calc(100vh - var(--nav) - var(--bar) - 210px); }   /* grids are (nearly) square */
.mx-ans-btn { display: none; }   /* wide screens show the answers in the clue list already */
.mx-ans {
    display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px;
    font-style: normal; font-weight: 700; letter-spacing: .06em; background: var(--hl-green); color: #17213A;
}

@media (max-width: 1100px) and (min-width: 901px) {
    body.mini .mx-panel { gap: 20px; }
    body.mini .mx-clues { min-width: 220px; }
}

/* ── phones: the clue, the grid as wide as the screen, the buttons, then the
   clue list in whatever room is left. Tapping a square opens the phone's
   own keyboard; while it is open (body.kb-open) only the clue and the grid
   stay, sized to the part of the screen the keyboard leaves (--vvh). */
@media (max-width: 900px) {
    body.mini { --bar: 40px; }
    .mx-bar .bone { font-size: 16px; }
    .mx-bar .to { font-size: 18px; }
    body.mini .mx-bar, body.mini .mx-panel { left: 10px; right: 10px; width: auto; transform: none; }
    body.mini .mx-bar { left: 12px; }
    body.mini .mx-panel {
        top: calc(var(--nav) + var(--bar) + 4px); bottom: auto;
        height: calc(var(--vvh, 100dvh) - var(--nav) - var(--bar) - 4px);
        flex-direction: column; align-items: stretch; gap: 8px;
        overflow: hidden; padding: 0 4px 6px 0;
    }
    .mx-main { display: contents; }
    .mx-clue { min-height: 58px; box-shadow: 3px 3px 0 var(--shadow); border-width: 2px; }
    .mx-clue-txt { font-size: 16px; }
    /* square, as wide as the screen; gives way first to the clue and buttons */
    body.mini .mx-board { flex: 0 1 calc(100vw - 30px); min-height: 0; height: auto; aspect-ratio: auto; max-height: none; }
    .mx-grid { box-shadow: 3px 3px 0 var(--shadow); }
    .mx-tools .nb-btn { height: 38px; font-size: 14px; padding: 0 8px; box-shadow: 2px 2px 0 var(--shadow); }
    .mx-note { font-size: 13px; padding: 6px 10px; }
    body.mini .mx-clues {
        display: block; flex: 1 1 0; min-height: 0; max-height: none; transform: none;
        padding: 0 12px 8px; box-shadow: 3px 3px 0 var(--shadow);
    }
    .mx-list-h { font-size: 22px; }
    .mx-ans-btn { display: block; }

    /* small phones: no room for a useful clue list under the buttons */
    @media (max-height: 700px) { body.mini:not(.reviewing) .mx-clues { display: none; } }

    /* keyboard open: just the clue and the grid */
    body.kb-open .mx-tools, body.kb-open .mx-note, body.kb-open.mini .mx-clues { display: none; }
    body.kb-open.mini .mx-board { flex: 1 1 0; }

    /* after solving: the answers in place of the grid */
    body.reviewing .mx-board, body.reviewing .mx-clue { display: none; }
}
/* ── GAMES SWITCHER (js/ui/gameSwitch.js) ─────────────────────────────── */
.games-btn { gap: 8px; }
.gs-ico { display: inline-flex; line-height: 0; }
/* Ko-fi: a quiet "Support" button in the game nav, and a line in the switcher */
.kofi-btn { gap: 7px; text-decoration: none; }
.stats-btn { gap: 8px; text-decoration: none; }
.gs-stats { gap: 8px; text-decoration: none; margin-bottom: 8px; }

/* phones: Games, Stats, the theme switch and Menu fold into the ☰ menu */
.more-btn { display: none; }
@media (max-width: 600px) {
    body .g-nav .acts.has-more .games-btn, body .g-nav .acts.has-more .stats-btn, body .g-nav .acts.has-more .acct-btn,
    body .g-nav .acts.has-more .theme-toggle, body .g-nav .acts.has-more .menu-btn { display: none; }
    body .g-nav .acts.has-more .more-btn { display: inline-flex; width: 40px; padding: 0; }
    /* with fewer buttons there is room for the game name again */
    body .g-nav .mode { display: inline-block; }
}
/* tablets and computers: the theme switch, Menu and (once signed in, when
   the Sarc pill is there) the account button live in the ☰ menu too */
@media (min-width: 601px) {
    body .g-nav .acts.has-more .theme-toggle, body .g-nav .acts.has-more .menu-btn,
    html.signed-in body .g-nav .acts.has-more .acct-btn { display: none; }
    body .g-nav .acts.has-more .more-btn { display: inline-flex; width: 42px; padding: 0; }
}
@media (min-width: 601px) and (max-width: 900px) {
    .g-nav .stats-btn { width: 36px; padding: 0; gap: 0; }
}
.nav-more {
    position: fixed; z-index: 400; min-width: 200px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--card); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 10px; box-shadow: 5px 5px 0 var(--shadow);
    animation: nmIn .14s ease-out;
}
@keyframes nmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-more > a, .nav-more > button {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
    border: none; border-radius: 7px; background: transparent; color: inherit;
    font: 600 16px var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.nav-more > a:hover, .nav-more > button:hover, .nav-more > a:focus-visible, .nav-more > button:focus-visible { background: var(--hl-yellow); color: #0E1526; outline: none; }
.nav-more .gs-ico { width: 20px; justify-content: center; }
.nav-more .nm-sym { font-size: 18px; line-height: 1; }
.nav-more .nm-home { margin-top: 4px; border-top: 1.5px solid var(--rule); border-radius: 0 0 7px 7px; padding-top: 2px; }
@media (prefers-reduced-motion: reduce) { .nav-more { animation: none; } }
.kofi-btn .lbl-long { font-weight: 600; }
.gs-kofi {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px;
    font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--ink-3); text-decoration: none;
}
.gs-kofi u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gs-kofi:hover { color: var(--pen); }
.gs-card { text-align: left; max-width: 440px; }
.gs-card h2 { text-align: center; margin-bottom: 4px; }
.gs-x {
    position: absolute; top: 10px; right: 12px; width: 36px; height: 36px;
    border: none; background: none; font-size: 20px; color: var(--ink-2); cursor: pointer; border-radius: 6px;
}
.gs-x:hover { background: var(--card-soft); color: var(--ink); }
.gs-h { font-family: var(--hand); font-weight: 700; font-size: 24px; color: var(--pen); margin: 14px 0 6px; }
.gs-list { display: flex; flex-direction: column; gap: 10px; }
.gs-item {
    position: relative; display: flex; flex-direction: column; gap: 2px;
    padding: 10px 14px; border: 2px solid var(--ink); border-radius: 6px;
    color: #0E1526; text-decoration: none; box-shadow: 3px 3px 0 var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.gs-item:hover { color: #0E1526; transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--shadow); }
.gs-item.here { box-shadow: none; opacity: .62; cursor: default; transform: none; }
.gs-item.tone-yellow { background: #FFE047; }
.gs-item.tone-blue   { background: #8FD0FF; }
.gs-item.tone-pink   { background: #FF8EBF; }
.gs-item.tone-green  { background: var(--hl-green); }
.gs-item.tone-orange { background: #FFB46B; }
:root[data-theme="dark"] .gs-item { filter: brightness(.9) saturate(.9); }
.gs-name { font-weight: 700; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.gs-sub  { font-size: 14px; font-weight: 500; }
.gs-meta { font-size: 14px; font-weight: 500; }
.gs-home { margin-top: 18px; }
.gs-pastlink { display: block; margin: 2px 0 10px; font-family: var(--hand); font-weight: 700; font-size: 21px; color: var(--pen); text-decoration: none; }
.gs-pastlink u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gs-pastlink:hover { color: var(--ink); }
.gs-next { margin: 0 0 14px; }
.gs-countdown { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.gs-countdown b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* the shop line under the countdown (js/ui/gameSwitch.js ShopTeaser) */
.shop-teaser {
    display: flex; align-items: center; gap: 10px; margin: 12px auto 0; padding: 7px 10px 7px 7px; max-width: 380px;
    border: 2px dashed var(--ink-3); border-radius: 10px; background: transparent; color: var(--ink);
    text-decoration: none; text-align: left; transition: border-color .15s, background .15s, transform .12s;
}
.shop-teaser:hover { color: var(--ink); text-decoration: none; border-style: solid; border-color: var(--ink); background: var(--card-soft); transform: translateY(-1px); }
.shop-teaser:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.tz-thumb { flex: none; width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--ink); position: relative; overflow: hidden; background: var(--card); }
.tz-thumb.tz-coin { display: grid; place-items: center; border: 0; background: none; }
.tz-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.tz-txt b { font-size: 14.5px; }
.tz-txt > span { font-size: 12.5px; color: var(--ink-2); }
.tz-pic { position: relative; flex: none; display: flex; }
.tz-tag { position: absolute; left: 50%; bottom: -7px; padding: 0 4px; border: 1.5px solid #0E1526; border-radius: 4px; background: #D3263A; color: #fff; font: 800 8.5px/1.5 var(--font); letter-spacing: .04em; text-transform: uppercase; transform: translateX(-50%) rotate(-5deg); white-space: nowrap; }
:root[data-theme="dark"] .tz-tag { border-color: #fff; }
.tz-cta { flex: none; padding: 5px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 700; font-size: 13.5px; white-space: nowrap; box-shadow: 2px 2px 0 var(--shadow); }
.shop-teaser.tz-limited { border-color: #D3263A; }
.shop-teaser.tz-limited .tz-cta { background: #D3263A; border-color: #0E1526; color: #fff; }
/* the limited theme's swatch: its own wallpaper and a string of lights */
.tz-thumb.sw-christmas { background: #FBF8F2 url("../img/skins/christmas-bg-light.svg") 0 0/60px 57px; }
.tz-thumb.sw-christmas::after { content: ""; position: absolute; left: -4px; right: -4px; top: -3px; height: 18px; background: url("../img/skins/christmas-lights-light.svg") 0 0/90px 15px repeat-x; }
.tz-thumb.sw-christmas::before { content: ""; position: absolute; left: 7px; right: 7px; bottom: 5px; height: 15px; border-radius: 3px; background: #fff repeating-linear-gradient(-45deg, #D3263A 0 3px, #fff 3px 6px) 0 0/100% 4px no-repeat; box-shadow: 2px 2px 0 #E4C9BE; }
:root[data-theme="dark"] .tz-thumb.sw-christmas { background-color: #1B2434; background-image: url("../img/skins/christmas-bg-dark.svg"); }
:root[data-theme="dark"] .tz-thumb.sw-christmas::after { background-image: url("../img/skins/christmas-lights-dark.svg"); }
:root[data-theme="dark"] .tz-thumb.sw-christmas::before { background-color: #2A3348; background-image: repeating-linear-gradient(-45deg, #E04555 0 3px, #2A3348 3px 6px); box-shadow: 2px 2px 0 #0B1120; }
:root[data-theme="dark"] .shop-teaser.tz-limited { border-color: #F06272; }
:root[data-theme="dark"] .shop-teaser.tz-limited .tz-cta { border-color: #fff; }
@media (max-width: 380px) { .tz-txt > span { font-size: 12px; } .tz-cta { padding: 4px 9px; font-size: 13px; } }
/* short phones (iPhone SE): one line in place of the countdown, so the end
   card's bottom buttons stay in view */
@media (max-height: 600px) {
    .gs-next .gs-countdown { display: none; }
    .shop-teaser { margin-top: 6px; padding: 3px 4px 3px 10px; }
    .tz-pic, .tz-thumb, .tz-txt > span { display: none; }
    .tz-txt b { font-size: 13.5px; } .tz-cta { padding: 2px 9px; }
}
@media (prefers-reduced-motion: reduce) { .shop-teaser { transition: none; } }
.nb-btn.gs-go { color: #0E1526; font-weight: 600; text-decoration: none; }
.nb-btn.gs-go b { font-weight: 800; }
.nb-btn.gs-go.tone-yellow { background: #FFE047; }
.nb-btn.gs-go.tone-blue   { background: #8FD0FF; }
.nb-btn.gs-go.tone-purple { background: #C9B6FF; }
.nb-btn.gs-go.tone-green  { background: var(--hl-green); }
.nb-btn.gs-go.tone-orange { background: #FFB46B; }
:root[data-theme="dark"] .nb-btn.gs-go { filter: brightness(.9) saturate(.9); }
.gs-more { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* Rating: a small sticky note under "fancy another?" on daily end cards
   (js/ui/gameSwitch.js rateNote). Quiet on purpose: hand-written question,
   outline stars that fill with highlighter yellow. */
/* it pops up at the bottom of the screen, over the end card, now and then */
.rate-pop {
    position: fixed; z-index: 700; left: 50%; bottom: 16px; width: min(340px, calc(100vw - 24px));
    transform: translateX(-50%); animation: ratePopIn .45s cubic-bezier(.34,1.4,.64,1) both;
    transition: opacity .3s ease, transform .3s ease;
}
.rate-pop.out { opacity: 0; transform: translate(-50%, 24px); }
.rate-pop .rate-note { max-width: none; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-.8deg); }
.rate-pop .rate-note { padding: 12px 12px 8px; }
.rate-pop .rate-note .tape { display: none; }
.rate-pop .rate-q { font-size: 20px; padding: 0 24px; }
.rate-pop .rate-stars { margin: 2px 0 0; }
.rate-pop .rate-star { width: 40px; height: 40px; }
.rate-pop .rate-star svg { width: 30px; height: 30px; }
.rate-pop .rate-x { top: 6px; right: 6px; }
@keyframes ratePopIn { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .rate-pop { animation: none; } }
.rate-note {
    position: relative; max-width: 330px; margin: 0 auto; padding: 18px 16px 12px;
    background: var(--card-soft); text-align: center;
    box-shadow: 0 10px 16px -10px rgba(23,33,58,.4), 0 1px 0 rgba(23,33,58,.08);
    transform: rotate(1.2deg);
    transition: opacity .25s ease, transform .25s ease;
}
.rate-note.gone { opacity: 0; transform: rotate(4deg) translateY(8px); }
.rate-note .tape { top: -11px; left: 50%; margin-left: -32px; width: 64px; transform: rotate(-3deg); background: rgba(255,255,255,.62); border: 1px solid rgba(23,33,58,.08); }
.rate-x {
    position: absolute; top: 4px; right: 4px; width: 30px; height: 30px;
    border: none; background: none; border-radius: 6px; font-size: 14px; color: var(--ink-3); cursor: pointer;
}
.rate-x:hover { background: var(--paper-line); color: var(--ink); }
.rate-q { font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1.05; color: var(--pen); padding: 0 18px; }
.rate-stars { display: flex; justify-content: center; gap: 2px; margin: 6px 0 2px; }
.rate-star {
    width: 44px; height: 44px; padding: 0; border: none; background: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3); border-radius: 50%;
    transition: transform .15s cubic-bezier(.34,1.56,.64,1), color .15s ease;
}
.rate-star svg { fill: transparent; transition: fill .15s ease; }
.rate-star:nth-child(odd)  svg { transform: rotate(-6deg); }
.rate-star:nth-child(even) svg { transform: rotate(5deg); }
.rate-star.on { color: var(--ink); }
.rate-star.on svg { fill: var(--hl-yellow); }
.rate-star:not(:disabled):hover { transform: scale(1.15); }
.rate-star:disabled { cursor: default; }
.rate-star:focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.rate-note.picked .rate-star.on { animation: streakPop .45s cubic-bezier(.34,1.56,.64,1) both; }
.rate-word { min-height: 20px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.rate-more { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; text-align: left; }
.rate-more[hidden], .rate-thanks[hidden] { display: none; }
.rate-lbl { font-family: var(--hand); font-weight: 700; font-size: 20px; color: var(--ink-2); line-height: 1.1; }
.rate-lbl i { font-style: normal; font-size: 16px; color: var(--ink-3); }
.rate-txt {
    width: 100%; resize: vertical; min-height: 56px; padding: 8px 10px;
    font: 500 15px/1.35 var(--font); color: var(--ink);
    background: var(--card); border: 2px solid var(--ink); border-radius: 4px;
}
.rate-txt:focus { outline: none; box-shadow: 0 0 0 3px var(--hl-yellow); }
.rate-fine { font-size: 12px; color: var(--ink-3); }
.rate-send { align-self: flex-end; height: 36px; font-size: 13px; padding: 0 14px; }
.rate-thanks { font-family: var(--hand); font-weight: 700; font-size: 26px; color: var(--pink-dk); margin-top: 4px; }
:root[data-theme="dark"] .rate-note { box-shadow: 0 10px 16px -10px rgba(0,0,0,.7); }
:root[data-theme="dark"] .rate-star.on svg { fill: #E8C35A; }
.rate-card:focus { outline: none; }
:root[data-theme="dark"] .rate-note .tape { background: rgba(255,255,255,.3); }
.rate-card { max-width: 400px; padding: 34px 22px 24px; }
.rate-card .rate-note { box-shadow: none; transform: none; background: none; padding-top: 4px; }
.rate-card .rate-note .tape { display: none; }
.rate-card .rate-q { font-size: 30px; }
@media (max-width: 900px) {
    .rate-star { width: 42px; height: 42px; }
    .rate-txt { font-size: 16px; }   /* 16px stops iPhones zooming in */
}
@media (prefers-reduced-motion: reduce) {
    .rate-note.picked .rate-star.on { animation: none; }
}
@media (max-width: 900px) {
    .g-nav .games-btn { width: 36px; padding: 0; }
    /* phones: the Ko-fi cup as an icon button, like ? and Games */
    .g-nav .kofi-btn { width: 36px; padding: 0; gap: 0; }
    .gs-card { padding: 30px 20px 22px; }
}

/* ── PLEXUS (js/ui/plexusUI.js) ────────────────────────────────────────── */
/* 16 index cards on the notebook page; solved groups become taped notes */
.hl-purple { background: linear-gradient(transparent 52%, var(--hl-purple) 52%); padding: 0 .12em; }
body.plexus { overflow-x: hidden; overflow-y: auto; }
.px-main {
    position: relative; z-index: 5;
    width: min(700px, calc(100vw - 96px - var(--ad)));
    margin: 0 auto; padding: calc(var(--nav) + 14px) 0 40px;
    display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 901px) { .px-main { margin-left: max(72px, calc((100vw - var(--ad) - 700px) / 2)); } }
.px-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.px-title { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.px-title .bone { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.px-title .to { font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--pen); }
.px-lives { margin-left: auto; display: flex; gap: 2px; font-size: 26px; line-height: 1; color: var(--pink-dk); }
.px-life { display: inline-block; transition: transform .3s ease, color .3s ease; }
.px-life.gone { color: var(--ink-3); opacity: .55; transform: scale(.85); }
.px-ask { font-size: 24px; color: var(--ink-2); margin-top: -4px; }

.px-board { display: flex; flex-direction: column; gap: 12px; }
.px-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.px-card {
    position: relative; min-height: 84px; padding: 22px 8px 10px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: var(--hand); font-weight: 700; font-size: 25px; line-height: 1.02; color: var(--ink);
    background-color: var(--card);
    /* an index card: faint blue lines, and a red header rule (::before) */
    background-image: repeating-linear-gradient(transparent 0 21px, var(--paper-line) 21px 22px);
    background-position: 0 16px;
    border: 2px solid var(--ink); border-radius: 4px;
    box-shadow: 3px 3px 0 var(--shadow);
    transform: rotate(var(--tilt, 0deg));
    cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
    overflow-wrap: anywhere; hyphens: auto;
}
.px-card > span { position: relative; padding: 0 .1em; }
/* a real 2px stroke, not a gradient stop, so it stays crisp when the card is tilted */
.px-card::before {
    content: ''; position: absolute; left: 0; right: 0; top: 14px; height: 2px;
    background: var(--margin); border-radius: 1px; pointer-events: none;
}
.px-card.sm { font-size: 21px; }
.px-card.xs { font-size: 18px; }
.px-card:hover:not(:disabled) { transform: rotate(var(--tilt, 0deg)) translate(-1px,-2px); box-shadow: 4px 5px 0 var(--shadow); }
.px-card.on {
    background-color: var(--card-soft); border-color: var(--pen);
    transform: rotate(0deg) translateY(-3px); box-shadow: 4px 6px 0 var(--shadow);
}
.px-card.on > span { background: linear-gradient(transparent 38%, var(--hl-yellow) 38%, var(--hl-yellow) 92%, transparent 92%); }
.px-card.on::after {
    content: '✓'; position: absolute; top: -9px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font); font-size: 13px; color: var(--on-ink); background: var(--pen);
}
.px-card:disabled { cursor: default; }
.px-card.jump { animation: pxJump .45s ease both; }
@keyframes pxJump { 0%,100% { transform: translateY(-3px); } 45% { transform: translateY(-14px) rotate(-2deg); } }

.px-group {
    position: relative; padding: 14px 18px 12px; text-align: center; color: #0E1526;
    border: 2px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--shadow);
    animation: pxGroupIn .45s cubic-bezier(.34,1.4,.64,1) both;
}
.px-group:nth-child(odd) { transform: rotate(-.5deg); }
.px-group:nth-child(even) { transform: rotate(.4deg); }
.px-group .tape { top: -12px; left: 50%; margin-left: -40px; width: 80px; height: 22px; transform: rotate(-2deg); background: rgba(255,255,255,.6); border: 1px solid rgba(23,33,58,.08); }
.px-group.tone-green  { background: #A8EBC0; }
.px-group.tone-blue   { background: #8FD0FF; }
.px-group.tone-pink   { background: #FFA3CB; }
.px-group.tone-purple { background: #C9B6FF; }
.px-group.shown { background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255,255,255,.28) 10px 20px); }
.px-g-title { font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1.05; }
.px-g-terms { font-weight: 700; font-size: 15px; letter-spacing: .01em; margin-top: 4px; }
.px-g-why { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-top: 6px; opacity: .85; }
@keyframes pxGroupIn { from { opacity: 0; transform: scale(.92) translateY(8px); } }
:root[data-theme="dark"] .px-group { filter: brightness(.9) saturate(.9); }

.px-note-wrap { min-height: 38px; display: flex; justify-content: center; }
.px-note {
    align-self: center; padding: 6px 14px; border-radius: 8px; border: 2px solid var(--ink);
    font-weight: 700; font-size: 14px; background: var(--card); animation: pxGroupIn .25s ease both;
}
.px-note.close { background: var(--hl-yellow); }
.px-note.bad { background: var(--hl-red); }
.px-tools { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.px-check { min-width: 150px; }
.px-count { margin-left: 4px; font-weight: 500; font-size: 12px; opacity: .7; }
.px-share-grid { text-align: center; letter-spacing: 3px; }
.gs-item.tone-purple { background: #C9B6FF; }

@media (max-width: 900px) {
    .px-main { width: auto; margin: 0; padding: calc(var(--nav) + 10px) 12px 28px 16px; gap: 10px; }
    .px-title .bone { font-size: 20px; }
    .px-title .to { font-size: 21px; }
    .px-lives { font-size: 22px; }
    .px-ask { font-size: 20px; }
    .px-grid { gap: 7px; }
    .px-card { min-height: 72px; padding: 18px 3px 7px; font-size: 19px; border-width: 1.5px; box-shadow: 2px 2px 0 var(--shadow);
        background-image: repeating-linear-gradient(transparent 0 17px, var(--paper-line) 17px 18px);
        background-position: 0 13px; }
    .px-card::before { top: 11px; }
    .px-card.sm { font-size: 16.5px; }
    .px-card.xs { font-size: 14.5px; }
    .px-card.xxs { font-size: 13px; letter-spacing: -.02em; }
    .px-card.on::after { width: 18px; height: 18px; font-size: 11px; top: -7px; right: -6px; }
    .px-group { padding: 12px 12px 10px; }
    .px-g-title { font-size: 23px; }
    .px-g-terms { font-size: 13.5px; }
    .px-g-why { font-size: 12.5px; }
    .px-tools .nb-btn { height: 40px; padding: 0 12px; font-size: 13px; }
    .px-check { min-width: 0; flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .px-card.jump, .px-group, .px-note { animation: none; } }
/* the trap, shown once the day is over */
.px-trap {
    padding: 12px 16px; text-align: center; border: 2px dashed var(--ink-3); border-radius: 6px;
    background: var(--card); color: var(--ink);
}
.px-trap-h { font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--red); }
.px-trap-h b { color: var(--ink); }
.px-trap-terms { font-weight: 700; font-size: 14px; margin-top: 4px; }
.px-trap-note { font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }
.px-trap.in-card { margin: 0 0 16px; text-align: left; }
@media (max-width: 900px) { .px-trap-h { font-size: 21px; } .px-trap-terms { font-size: 13px; } }

/* ── Accounts (js/core/account.js): the box on the stats page, the
   "Sign in with Google" button and the note after signing in ─────────────── */
.acct-card {
    position: relative; max-width: 760px; margin: 14px 0 4px; padding: 20px 22px 18px;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px;
    box-shadow: 4px 4px 0 var(--shadow); display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
    scroll-margin-top: 20px;
}
.acct-card:empty { display: none; }
.acct-card .tape { top: -12px; left: 40px; background: rgba(255,224,71,.75); transform: rotate(-3deg); }
.acct-kick { font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1; color: var(--pen); }
.acct-p { margin: 0; font-size: 16px; line-height: 1.45; max-width: 60ch; overflow-wrap: anywhere; }
.acct-small { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.acct-small a { color: var(--pen); }
.acct-google {
    display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; cursor: pointer;
    background: #FFFFFF; color: #1F1F1F; border: 1px solid #747775; border-radius: 999px;
    font: 500 15px 'Roboto', var(--font); box-shadow: 3px 3px 0 var(--shadow);
}
.acct-google:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--shadow); }
.acct-google:focus-visible, .acct-link:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.acct-check { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; cursor: pointer; max-width: 60ch; }
.acct-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pen); flex: none; }
.acct-check > span:nth-of-type(1) { flex: 1 1 200px; }
.acct-msg { font-size: 13px; font-weight: 600; color: var(--green-dk); margin: 0; }
.acct-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.acct-link { background: none; border: 0; padding: 4px 0; font: 600 14px var(--font); color: var(--ink-3); text-decoration: underline; cursor: pointer; }
.acct-link:hover { color: var(--red); }
.acct-confirm { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 2px dashed var(--red); border-radius: 8px; }
.acct-confirm p { margin: 0; font-size: 14.5px; }
.nb-btn.acct-danger { background: var(--red); color: #FFFFFF; border-color: var(--ink); }
.nb-btn.acct-danger:hover { color: #FFFFFF; }
.acct-toast {
    position: fixed; z-index: 1000; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
    display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 16px 44px 16px 18px;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 5px 5px 0 var(--shadow);
    animation: acct-in .25s ease-out;
}
.acct-toast b { font-size: 17px; }
.acct-toast p { margin: 0; font-size: 14.5px; }
.acct-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; background: none; color: var(--ink); font-size: 16px; cursor: pointer; border-radius: 6px; }
.acct-x:hover { background: var(--soft-bg); }
@keyframes acct-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .acct-toast { animation: none; } }

.acct-name { display: flex; flex-direction: column; gap: 6px; width: min(100%, 420px); }
.acct-name label { font-weight: 700; font-size: 14.5px; }
.acct-name-row { display: flex; gap: 8px; }
.acct-name input {
    flex: 1 1 auto; min-width: 0; padding: 8px 12px; font: 500 16px var(--font);
    color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 8px;
}
.acct-name input:focus-visible { outline: 3px solid var(--pen); outline-offset: 1px; }
.acct-msg.acct-err { color: var(--red); }

/* the account button beside Stats in a game's nav (js/ui/gameSwitch.js) */
.nb-btn.acct-btn { width: 40px; padding: 0; text-decoration: none; position: relative; }
.nb-btn.acct-btn.on::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); border: 1.5px solid var(--card); }
@media (min-width: 601px) and (max-width: 900px) { .g-nav .acct-btn { width: 36px; } }
/* "sign in to save your streak" on a daily's end card */
.gs-signin {
    display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin: 0 0 6px; padding: 4px 0;
    background: none; border: 0; color: var(--pen); font: 700 15px var(--font); cursor: pointer;
}
.gs-signin:hover u { text-decoration-thickness: 2px; }
.gs-signin:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 4px; }
/* the sign-in popup (js/core/account.js) */
.acct-pop {
    position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: rgba(14,21,38,.45); animation: acct-fade .2s ease-out;
}
.acct-pop-card {
    position: relative; width: min(400px, 100%); max-height: 100%; overflow: auto;
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 24px 20px;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px;
    box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-.6deg); animation: acct-pop .25s cubic-bezier(.2,.8,.3,1.2);
}
.acct-pop-card .tape { top: -12px; left: 50%; margin-left: -44px; background: rgba(255,224,71,.75); transform: rotate(-2deg); }
.acct-pop-h { margin: 0; font: 700 26px/1.1 var(--font); letter-spacing: -.02em; text-wrap: balance; }
.acct-pop-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.acct-pop-list li { padding-left: 24px; position: relative; }
.acct-pop-list li::before { content: "✓"; position: absolute; left: 2px; font-weight: 700; color: var(--green); }
.acct-pop .acct-google { margin-top: 4px; }
.acct-pop .acct-link { align-self: flex-start; }
@keyframes acct-fade { from { opacity: 0; } }
@keyframes acct-pop { from { opacity: 0; transform: translateY(14px) rotate(-.6deg) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .acct-pop, .acct-pop-card { animation: none; } }

/* Read by screen readers and search engines, not shown on screen.
   Game pages use it for their heading and a short description of the game. */
.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── Sarcs (js/core/account.js, js/ui/gameSwitch.js) ──────────────────────── */
.sarc-coin { display: inline-block; vertical-align: middle; flex: none; }
/* only while signed in (html.signed-in, set by account.js / theme.js) */
[data-signed-in] { display: none !important; }
html.signed-in .nb-btn[data-signed-in] { display: inline-flex !important; }
/* the coin pill in the top bar: the balance once signed in, "Shop" before */
.sarc-pill .sp-shop { font-weight: 700; }
html.signed-in .sarc-pill .sp-shop, html:not(.signed-in) .sarc-pill [data-sarc-balance] { display: none; }
html:not(.signed-in) .nb-btn.sarc-pill[aria-current] { display: none; }
/* the balance in a game's nav */
.nb-btn.sarc-pill { position: relative; gap: 6px; padding: 0 12px 0 6px; border-radius: 999px; text-decoration: none; font-variant-numeric: tabular-nums; }
.sarc-pill [data-sarc-balance]:empty::before { content: "…"; }
.sarc-float {
    position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
    padding: 1px 8px; border-radius: 999px; background: var(--card); border: 2px solid #E54B64; color: #C2364F;
    font: 700 14px var(--font); pointer-events: none; animation: sarcFloat 1.6s ease-out both;
}
@keyframes sarcFloat { 0% { opacity: 0; transform: translate(-50%, 12px); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -22px); } }
@media (max-width: 600px) {
    body .g-nav .sarc-pill { height: 34px; padding: 0 9px 0 4px; font-size: 13px; gap: 4px; }
    body .g-nav .sarc-pill .sarc-coin { width: 22px; height: 22px; }
}
@media (max-width: 380px) { body .g-nav .sarc-pill [data-sarc-balance] { font-size: 12px; } }
/* the box under the streak on an end card */
.sarc-box {
    margin: -6px auto 18px; padding: 12px 16px; max-width: 380px;
    background: #FFF1F3; color: var(--ink); border: 2px dashed #C2364F; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    animation: streakPop .6s cubic-bezier(.34,1.56,.64,1) .5s both;
}
.sarc-top { display: flex; align-items: center; gap: 10px; }
.sarc-amt { font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.sarc-box.out .sarc-amt { font-size: 17px; }
.sarc-spin .sarc-coin { animation: sarcSpin 1.1s ease-in-out .8s both; }
@keyframes sarcSpin { 0% { transform: rotateY(0); } 100% { transform: rotateY(720deg); } }
.sarc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sarc-chip { padding: 2px 9px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 12.5px; font-weight: 700; }
.sarc-chip.hot { background: var(--hl-yellow); color: #0E1526; }
.sarc-note { margin: 0; font-size: 13px; color: var(--ink-2); text-align: center; }
.sarc-note a { font-weight: 700; }
/* the sign-up bonus, wherever it's offered */
.sarc-bonus { display: inline-block; padding: 1px 9px; border-radius: 999px; background: #FFE047; color: #0E1526; font-weight: 800; white-space: nowrap; transform: rotate(-1.5deg); box-shadow: 2px 2px 0 var(--shadow); }
.sarc-share { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--pen); }
.sarc-unlock { font-size: 14px; padding: 3px 10px; border-radius: 6px; background: var(--hl-yellow); color: #0E1526; }
.nb-btn.sarc-in { height: 38px; font-size: 14px; }
:root[data-theme="dark"] .sarc-box { background: #2A1C25; border-color: #F08BBE; }
@media (prefers-reduced-motion: reduce) { .sarc-box, .sarc-spin .sarc-coin, .sarc-float { animation: none; } }
/* the phone menu's Shop row */
.nav-more .nm-shop .sarc-coin { margin-left: -1px; }
/* the account box and the welcome note */
.acct-sarcs {
    display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; width: min(100%, 420px);
    border: 2px solid var(--ink); border-radius: 10px; background: var(--card-soft); color: var(--ink); text-decoration: none;
}
.acct-sarcs > span { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.acct-sarcs i { font-size: 13px; color: var(--ink-3); }
.acct-sarcs u { font-weight: 700; color: var(--pen); }
.acct-sarcs:hover { color: var(--ink); box-shadow: 3px 3px 0 var(--shadow); }
.acct-gift { display: flex; align-items: center; gap: 10px; }
.acct-wear { display: block; margin: 2px 0 12px; }
/* the bordered "Shop" button with the coin (stats page, shop links) */
.shop-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px 5px 6px;
    border: 2px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
    font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
    box-shadow: 3px 3px 0 var(--shadow); transition: transform .12s, box-shadow .12s;
}
.shop-btn .sarc-coin { width: 24px; height: 24px; }
.shop-btn:hover { color: var(--ink); text-decoration: none; transform: translateY(-2px); box-shadow: 4px 5px 0 var(--shadow); }


/* ── Shop themes ("skins"): <html data-skin="…">, set by js/ui/theme.js ───────
   Each one is a colourway, an illustrated backdrop (img/skins/*-bg-*.svg), a
   gently moving layer (*-fx-*), its own tape and card style, in light and
   dark. Light rules use :not([data-theme="dark"]) so dark mode's tokens win.
   The moving layers sit behind the page (z-index -1) and only move with
   transform, so they stay smooth on phones; reduced motion stops them. */
:root[data-skin]::before, :root[data-skin]::after {
    content: ""; position: fixed; left: 0; right: 0; z-index: -1; pointer-events: none; will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
    :root[data-skin]::before, :root[data-skin]::after, [data-skin] body::after { animation: none !important; }
}
@keyframes skinRise  { from { transform: translateY(0); } to { transform: translateY(var(--rise, -600px)); } }
@keyframes skinFall  { from { transform: translate(0, 0); } to { transform: translate(var(--drift, 170px), var(--fall, 420px)); } }
@keyframes skinSlide { from { transform: translateX(0); } to { transform: translateX(-600px); } }
@keyframes skinGlow  { 0%, 100% { opacity: .85; } 45% { opacity: 1; } 50% { opacity: .78; } 55% { opacity: .95; } }
[data-skin] .g-card, [data-skin] .acct-card, [data-skin] .acct-pop-card, [data-skin] .shop-card { transition: box-shadow .2s ease; }

/* ── Lab: hex tiles, molecules, a DNA helix; bubbles drift up ─────────────── */
:root[data-skin="lab"]:not([data-theme="dark"]) {
    --paper: #F2FAFA; --paper-line: #D3ECEA; --card: #FFFFFF; --card-soft: #E6F7F5;
    --rule: #BFDCDA; --shadow: #B5DCD8; --margin: #22A6A0; --pen: #0E7C86; --pen-dk: #075961;
    --nav-bg: rgba(242,250,250,.92); --soft-bg: #EDF8F7; --cream: #F2FAFA; --border: #BFDCDA;
    --skin-bg: url("../img/skins/lab-bg-light.svg"); --skin-fx: url("../img/skins/lab-fx-light.svg"); --skin-glow: rgba(34,166,160,.18);
}
:root[data-skin="lab"][data-theme="dark"] {
    --paper: #0D1B1F; --paper-line: #17303A; --card: #132A30; --card-soft: #18343A;
    --rule: #2B4A52; --shadow: #040C0E; --margin: #2BB3AC; --pen: #6FD6DA; --pen-dk: #A5ECEE;
    --nav-bg: rgba(13,27,31,.92); --soft-bg: #11252A; --cream: #0D1B1F; --border: #2B4A52;
    --cv-a: #1A3036; --cv-b: #14262B; --cv-c: #0D1B1F;
    --skin-bg: url("../img/skins/lab-bg-dark.svg"); --skin-fx: url("../img/skins/lab-fx-dark.svg"); --skin-glow: rgba(111,214,218,.16);
}
[data-skin="lab"] body { background-image: var(--skin-bg), radial-gradient(ellipse at 50% 0%, var(--skin-glow), transparent 60%); background-size: 448px 400px, 100% 100%; background-attachment: scroll, fixed; }
:root[data-skin="lab"]::after { top: 0; bottom: -600px; background: var(--skin-fx) 0 0 / 300px 600px; animation: skinRise 26s linear infinite; }
[data-skin="lab"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 18px; border-color: var(--pen);
    background-image: linear-gradient(170deg, var(--card-soft) 0, var(--card) 140px);
    box-shadow: 0 7px 0 var(--shadow), 0 0 0 6px var(--skin-glow);
}
[data-skin="lab"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    height: 22px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--card) 0 10px, var(--card-soft) 10px 20px);
    border: 2px solid var(--pen); opacity: 1;
}
[data-skin="lab"] .px-card { border-radius: 12px; box-shadow: 0 4px 0 var(--shadow); background-color: var(--card); }
[data-skin="lab"] .px-card.on { box-shadow: 0 6px 0 var(--shadow), 0 0 0 5px var(--skin-glow); }

/* ── Hospital: ECG paper, crosses, pills; a heartbeat trace runs across ──── */
:root[data-skin="hospital"]:not([data-theme="dark"]) {
    --paper: #F1F9F7; --paper-line: #D6EBE5; --card: #FFFFFF; --card-soft: #E6F4F0;
    --rule: #BCD9D1; --shadow: #BDDAD2; --margin: #E0464E; --pen: #1666B0; --pen-dk: #0D4A82;
    --nav-bg: rgba(241,249,247,.92); --soft-bg: #EAF5F2; --cream: #F1F9F7; --border: #BCD9D1;
    --skin-bg: url("../img/skins/hospital-bg-light.svg"); --skin-fx: url("../img/skins/hospital-fx-light.svg");
    --clip: linear-gradient(#C9D3DC, #8E9BA8);
}
:root[data-skin="hospital"][data-theme="dark"] {
    --paper: #0C1918; --paper-line: #16302C; --card: #132523; --card-soft: #182E2B;
    --rule: #2A4844; --shadow: #030909; --margin: #FF6B72; --pen: #7CC0FF; --pen-dk: #B0D8FF;
    --nav-bg: rgba(12,25,24,.92); --soft-bg: #112220; --cream: #0C1918; --border: #2A4844;
    --cv-a: #1A2F2C; --cv-b: #142624; --cv-c: #0C1918;
    --skin-bg: url("../img/skins/hospital-bg-dark.svg"); --skin-fx: url("../img/skins/hospital-fx-dark.svg");
    --clip: linear-gradient(#5D6B78, #36414C);
}
[data-skin="hospital"] body { background-image: var(--skin-bg); background-size: 300px 300px; }
:root[data-skin="hospital"]::after { top: 58vh; height: 140px; right: -600px; background: var(--skin-fx) 0 0 / 600px 140px repeat-x; animation: skinSlide 6s linear infinite; opacity: .55; }
[data-skin="hospital"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 10px; border-top: 10px solid var(--pen);
    background-image: linear-gradient(var(--card-soft) 0 34px, transparent 34px);
}
/* the tape becomes a clipboard clip */
[data-skin="hospital"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    width: 88px; height: 24px; top: -16px; transform: none; border-radius: 8px 8px 4px 4px; opacity: 1;
    background: var(--clip); border: 2px solid var(--ink); box-shadow: inset 0 -5px 0 rgba(0,0,0,.12);
}
[data-skin="hospital"] .px-card { border-top: 6px solid var(--pen); }
[data-skin="hospital"] .px-card::before { top: 10px; background: var(--margin); }

/* ── Uni library: shelves of books, warm lamp light, drifting dust ────────── */
:root[data-skin="library"]:not([data-theme="dark"]) {
    --paper: #F6EFE0; --paper-line: #E6DAC1; --card: #FFFBF1; --card-soft: #F4EBD5;
    --rule: #D6C6A3; --shadow: #D0BC93; --margin: #9B2D30; --pen: #2E6B45; --pen-dk: #1D4A2F;
    --nav-bg: rgba(246,239,224,.93); --soft-bg: #F8F2E4; --cream: #F6EFE0; --border: #D6C6A3; --card-bg: #FFFBF1;
    --skin-bg: url("../img/skins/library-bg-light.svg"); --skin-fx: url("../img/skins/library-fx-light.svg");
    --lamp: rgba(255,214,120,.45); --veil: rgba(246,239,224,.5);
}
:root[data-skin="library"][data-theme="dark"] {
    --paper: #1A140F; --paper-line: #2A2119; --card: #241C15; --card-soft: #2E241B;
    --rule: #4A3B2B; --shadow: #090604; --margin: #C2575A; --pen: #8FD3A5; --pen-dk: #B8E6C6;
    --ink: #F1E7D3; --ink-2: #D9CBB0; --ink-3: #ADA08A;
    --nav-bg: rgba(26,20,15,.93); --soft-bg: #201812; --cream: #1A140F; --border: #4A3B2B; --card-bg: #241C15;
    --cv-a: #2C231A; --cv-b: #241C15; --cv-c: #1A140F;
    --skin-bg: url("../img/skins/library-bg-dark.svg"); --skin-fx: url("../img/skins/library-fx-dark.svg");
    --lamp: rgba(255,190,90,.16); --veil: rgba(26,20,15,.35);
}
[data-skin="library"] body { background-image: linear-gradient(var(--veil), var(--veil)), var(--skin-bg); background-size: auto, 480px 170px; }
/* the green-shaded lamp's pool of light, flickering a touch */
:root[data-skin="library"]::before { top: 0; height: 75vh; background: radial-gradient(ellipse 60% 70% at 50% 0%, var(--lamp), transparent 70%); animation: skinGlow 7s ease-in-out infinite; }
:root[data-skin="library"]::after { top: 0; bottom: -600px; background: var(--skin-fx) 0 0 / 400px 600px; animation: skinRise 60s linear infinite; }
[data-skin="library"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 3px; box-shadow: 5px 5px 0 var(--shadow);
    background-image: linear-gradient(transparent 46px, var(--margin) 46px, var(--margin) 48px, transparent 48px),
                      repeating-linear-gradient(transparent 0 27px, var(--paper-line) 27px 28px);
}
/* the tape becomes a ribbon bookmark */
[data-skin="library"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    width: 22px; height: 56px; top: -6px; left: auto; right: 36px; margin: 0; transform: none; opacity: 1;
    background: var(--margin); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
[data-skin="library"] .px-card { border-radius: 2px; }

/* ── Study café: cups, beans and croissants on kraft; steam curls up ─────── */
:root[data-skin="cafe"]:not([data-theme="dark"]) {
    --paper: #F2E6D5; --paper-line: #E2D2BC; --card: #FFF9F0; --card-soft: #F6EADA;
    --rule: #D8C2A4; --shadow: #D2B48F; --margin: #C8743C; --pen: #8A4B26; --pen-dk: #61331A;
    --nav-bg: rgba(242,230,213,.93); --soft-bg: #F7EEE2; --cream: #F2E6D5; --border: #D8C2A4; --card-bg: #FFF9F0;
    --skin-bg: url("../img/skins/cafe-bg-light.svg"); --skin-fx: url("../img/skins/cafe-fx-light.svg"); --kraft: rgba(196,150,100,.7);
}
:root[data-skin="cafe"][data-theme="dark"] {
    --paper: #19120E; --paper-line: #2A1F18; --card: #241A14; --card-soft: #2E221A;
    --rule: #4D3A2C; --shadow: #090604; --margin: #E0965C; --pen: #F0B98A; --pen-dk: #F7D3B3;
    --ink: #F3E6D6; --ink-2: #DCC8B2; --ink-3: #B19C86;
    --nav-bg: rgba(25,18,14,.93); --soft-bg: #201712; --cream: #19120E; --border: #4D3A2C; --card-bg: #241A14;
    --cv-a: #2C2119; --cv-b: #241A14; --cv-c: #19120E;
    --skin-bg: url("../img/skins/cafe-bg-dark.svg"); --skin-fx: url("../img/skins/cafe-fx-dark.svg"); --kraft: rgba(140,100,66,.6);
}
[data-skin="cafe"] body { background-image: var(--skin-bg), radial-gradient(var(--paper-line) 1.4px, transparent 1.6px); background-size: 420px 400px, 18px 18px; }
:root[data-skin="cafe"]::after { top: 0; bottom: -500px; --rise: -500px; background: var(--skin-fx) 0 0 / 360px 500px; animation: skinRise 30s linear infinite; }
[data-skin="cafe"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 16px; box-shadow: 6px 6px 0 var(--shadow); outline: 2px dashed var(--rule); outline-offset: -10px;
}
[data-skin="cafe"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    background: var(--kraft); opacity: 1; height: 28px;
    clip-path: polygon(0 0, 4% 15%, 0 30%, 4% 45%, 0 60%, 4% 75%, 0 90%, 2% 100%, 98% 100%, 100% 85%, 96% 70%, 100% 55%, 96% 40%, 100% 25%, 96% 10%, 100% 0);
}
[data-skin="cafe"] .px-card { border-radius: 10px; }

/* ── Sakura: a blossom branch, blush sky, two drifts of falling petals ───── */
:root[data-skin="sakura"]:not([data-theme="dark"]) {
    --paper: #FFF4F7; --paper-line: #FBDDE6; --card: #FFFFFF; --card-soft: #FFEAF0;
    --rule: #F2C3D1; --shadow: #F3BACB; --margin: #F07AA0; --pen: #A3346B; --pen-dk: #74204B;
    --nav-bg: rgba(255,244,247,.9); --soft-bg: #FFF0F4; --cream: #FFF4F7; --border: #F2C3D1;
    --skin-bg: url("../img/skins/sakura-bg-light.svg"); --skin-fx: url("../img/skins/sakura-fx-light.svg");
    --skin-branch: url("../img/skins/sakura-branch-light.svg"); --skin-flower: url("../img/skins/sakura-flower-light.svg");
    --sky: linear-gradient(180deg, #FFE9F0 0%, #FFF6F8 45%, #F3EEFF 100%);
}
:root[data-skin="sakura"][data-theme="dark"] {
    --paper: #1C1220; --paper-line: #2C1C2D; --card: #26182A; --card-soft: #312034;
    --rule: #4E3250; --shadow: #0A050B; --margin: #F07AA0; --pen: #FFA8CC; --pen-dk: #FFCBE0;
    --nav-bg: rgba(28,18,32,.9); --soft-bg: #221625; --cream: #1C1220; --border: #4E3250;
    --cv-a: #2E1E30; --cv-b: #251827; --cv-c: #1C1220;
    --skin-bg: url("../img/skins/sakura-bg-dark.svg"); --skin-fx: url("../img/skins/sakura-fx-dark.svg");
    --skin-branch: url("../img/skins/sakura-branch-dark.svg"); --skin-flower: url("../img/skins/sakura-flower-dark.svg");
    --sky: linear-gradient(180deg, #2A1530 0%, #1C1220 50%, #171329 100%);
}
[data-skin="sakura"] body { background-image: var(--skin-bg), var(--sky); background-size: 280px 280px, 100% 100%; background-attachment: scroll, fixed; }
:root[data-skin="sakura"]::before { top: 0; bottom: -420px; left: -170px; background: var(--skin-fx) 0 0 / 340px 420px; animation: skinFall 22s linear infinite; }
:root[data-skin="sakura"]::after { top: 0; bottom: -420px; left: -170px; --fall: 420px; --drift: 170px; background: var(--skin-fx) 120px 60px / 230px 284px; opacity: .6; animation: skinFall 34s linear infinite; }
/* the branch reaches in from the top-right corner */
[data-skin="sakura"] body::after {
    content: ""; position: fixed; top: 0; right: 0; width: min(460px, 70vw); aspect-ratio: 460 / 220; z-index: -1; pointer-events: none;
    background: var(--skin-branch) right top / contain no-repeat;
}
[data-skin="sakura"] body.game::after { top: var(--nav, 64px); }
[data-skin="sakura"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 20px; box-shadow: 0 0 0 5px var(--card-soft), 7px 9px 0 5px var(--shadow);
    background-image: var(--skin-flower); background-repeat: no-repeat; background-size: 46px; background-position: right 12px bottom 12px;
}
[data-skin="sakura"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    opacity: 1; background: radial-gradient(circle at 25% 50%, #fff 0 2.5px, transparent 3px) 0 0 / 14px 14px, rgba(247,182,202,.85);
}
[data-skin="sakura"] .px-card { border-radius: 14px; }
[data-skin="sakura"] .px-card.on { box-shadow: 0 0 0 4px var(--card-soft), 4px 6px 0 4px var(--shadow); }

/* ── Fresher (free with a new account): highlighters, sticky notes, little
   bones and hearts on dot-grid paper; sparkles drift up; washi-tape cards ── */
:root[data-skin="fresher"]:not([data-theme="dark"]) {
    --paper: #F6F1FF; --paper-line: #E2D8FF; --card: #FFFFFF; --card-soft: #FFF0F6;
    --rule: #D4C6FA; --shadow: #CDBDFA; --margin: #FF5C93; --pen: #6A3FE0; --pen-dk: #4B24B8;
    --nav-bg: rgba(246,241,255,.92); --soft-bg: #F3EDFF; --cream: #F6F1FF; --border: #D4C6FA;
    --skin-bg: url("../img/skins/fresher-bg-light.svg"); --skin-fx: url("../img/skins/fresher-fx-light.svg");
    --washi-a: #9FE3C6; --washi-b: #FFB3CB; --washi-c: #FFE27A; --skin-glow: rgba(255,92,147,.12); --skin-glow-2: rgba(106,63,224,.10);
}
:root[data-skin="fresher"][data-theme="dark"] {
    --paper: #16112A; --paper-line: #271F42; --card: #1F1838; --card-soft: #2A1F3F;
    --rule: #3E3366; --shadow: #07040F; --margin: #FF7AA6; --pen: #BBA3FF; --pen-dk: #DCCFFF;
    --nav-bg: rgba(22,17,42,.92); --soft-bg: #1B1532; --cream: #16112A; --border: #3E3366;
    --cv-a: #262046; --cv-b: #1F1838; --cv-c: #16112A;
    --skin-bg: url("../img/skins/fresher-bg-dark.svg"); --skin-fx: url("../img/skins/fresher-fx-dark.svg");
    --washi-a: #2F7A62; --washi-b: #8E3D63; --washi-c: #8A6A1E; --skin-glow: rgba(255,122,166,.10); --skin-glow-2: rgba(187,163,255,.10);
}
[data-skin="fresher"] body {
    background-image: var(--skin-bg), radial-gradient(ellipse at 90% 0%, var(--skin-glow), transparent 50%), radial-gradient(ellipse at 0% 100%, var(--skin-glow-2), transparent 55%), radial-gradient(var(--paper-line) 1.5px, transparent 1.7px);
    background-size: 420px 400px, 100% 100%, 100% 100%, 22px 22px; background-attachment: scroll, fixed, fixed, scroll;
}
:root[data-skin="fresher"]::after { top: 0; bottom: -600px; background: var(--skin-fx) 0 0 / 360px 600px; animation: skinRise 40s linear infinite; }
[data-skin="fresher"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 16px; border-color: var(--pen);
    background-image: linear-gradient(90deg, var(--washi-b), var(--washi-c), var(--washi-a)), linear-gradient(175deg, var(--card-soft) 0, var(--card) 120px);
    background-size: 100% 6px, 100% 100%; background-repeat: no-repeat;
    box-shadow: 6px 6px 0 var(--shadow), 0 0 0 5px var(--skin-glow);
}
[data-skin="fresher"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    opacity: 1; height: 26px;
    background: repeating-linear-gradient(45deg, var(--washi-a) 0 8px, var(--washi-b) 8px 16px, var(--washi-c) 16px 24px);
    clip-path: polygon(0 0, 3% 20%, 0 40%, 3% 60%, 0 80%, 2% 100%, 98% 100%, 100% 80%, 97% 60%, 100% 40%, 97% 20%, 100% 0);
}
[data-skin="fresher"] .px-card { border-radius: 12px; box-shadow: 0 4px 0 var(--shadow); }
[data-skin="fresher"] .px-card.on { box-shadow: 0 6px 0 var(--shadow), 0 0 0 4px var(--skin-glow); }

/* ── Christmas (limited, 19 Nov to 26 Dec): fairy lights strung under the nav, snow
   falling, holly and candy-cane bones on snowy paper; cards are wrapped like
   presents with a candy-stripe edge and a ribbon bow ─────────────────────── */
:root[data-skin="christmas"]:not([data-theme="dark"]) {
    --paper: #FBF8F2; --paper-line: #E9E4D8; --card: #FFFFFF; --card-soft: #FFF3EE;
    --rule: #E2D6C6; --shadow: #E4C9BE; --margin: #2F7D4F; --pen: #B3202E; --pen-dk: #861522;
    --nav-bg: rgba(251,248,242,.93); --soft-bg: #F8F2EA; --cream: #FBF8F2; --border: #E2D6C6;
    --skin-bg: url("../img/skins/christmas-bg-light.svg"); --skin-fx: url("../img/skins/christmas-fx-light.svg");
    --skin-lights: url("../img/skins/christmas-lights-light.svg"); --skin-bow: url("../img/skins/christmas-bow-light.svg");
    --skin-holly: url("../img/skins/christmas-holly-light.svg");
    --sky: linear-gradient(180deg, #FFF7F0 0%, #FBF8F2 40%, #EEF4FA 100%); --cane: #D3263A;
}
:root[data-skin="christmas"][data-theme="dark"] {
    --paper: #0E1822; --paper-line: #1A2733; --card: #15212D; --card-soft: #1D2B38;
    --rule: #2E4152; --shadow: #05090D; --margin: #5FC28A; --pen: #FF7B7B; --pen-dk: #FFB1A8;
    --ink: #F1EEE6; --ink-2: #CFD6DC; --ink-3: #9EABB6;
    --nav-bg: rgba(14,24,34,.92); --soft-bg: #121D28; --cream: #0E1822; --border: #2E4152;
    --cv-a: #1C2A37; --cv-b: #15212D; --cv-c: #0E1822;
    --skin-bg: url("../img/skins/christmas-bg-dark.svg"); --skin-fx: url("../img/skins/christmas-fx-dark.svg");
    --skin-lights: url("../img/skins/christmas-lights-dark.svg"); --skin-bow: url("../img/skins/christmas-bow-dark.svg");
    --skin-holly: url("../img/skins/christmas-holly-dark.svg");
    --sky: linear-gradient(180deg, #13233A 0%, #0E1822 55%, #0B1410 100%); --cane: #E2384B;
}
[data-skin="christmas"] body { background-image: var(--skin-bg), var(--sky); background-size: 360px 340px, 100% 100%; background-attachment: scroll, fixed; }
/* two drifts of snow, the near one bigger and quicker */
:root[data-skin="christmas"]::before { top: 0; bottom: -480px; left: -90px; --fall: 480px; --drift: 90px; background: var(--skin-fx) 0 0 / 360px 480px; animation: skinFall 20s linear infinite; }
:root[data-skin="christmas"]::after { top: 0; bottom: -480px; left: -90px; --fall: 480px; --drift: 60px; background: var(--skin-fx) 140px 90px / 240px 320px; opacity: .55; animation: skinFall 32s linear infinite; }
/* fairy lights hang just under the nav, all the way across */
[data-skin="christmas"] body::after {
    content: ""; position: fixed; top: -14px; left: 0; right: 0; height: 64px; z-index: -1; pointer-events: none;
    background: var(--skin-lights) 0 0 / 400px 64px repeat-x;
}
[data-skin="christmas"] body:is(.has-nav, .game)::after { top: calc(var(--nav, 64px) - 20px); height: 56px; background-size: 360px 56px; }
[data-skin="christmas"] :is(.g-card, .acct-card, .acct-pop-card, .shop-card) {
    border-radius: 14px; box-shadow: 5px 6px 0 var(--shadow);
    background-image: repeating-linear-gradient(-45deg, var(--cane) 0 7px, var(--card) 7px 14px), var(--skin-holly);
    background-size: 100% 7px, 46px; background-repeat: no-repeat; background-position: 0 0, right 10px bottom 10px;
}
/* shop cards have buttons in that corner: stripe only */
[data-skin="christmas"] .shop-card { background-image: repeating-linear-gradient(-45deg, var(--cane) 0 7px, var(--card) 7px 14px); background-size: 100% 7px; }
/* the tape becomes a ribbon with a bow */
[data-skin="christmas"] :is(.g-card, .acct-card, .acct-pop-card) .tape {
    width: 120px; height: 40px; top: -20px; margin-left: -60px; transform: rotate(-2deg); opacity: 1;
    background: var(--skin-bow) center / contain no-repeat;
}
[data-skin="christmas"] .px-card { border-radius: 12px; }
[data-skin="christmas"] .px-card.on { box-shadow: 0 0 0 4px var(--card-soft), 4px 5px 0 4px var(--shadow); }

/* each theme tints the highlighter swipe on the logo */
[data-skin] .wordmark .hl-a, [data-skin] .nb-page .nav-logo span {
    background: linear-gradient(transparent 22%, var(--logo-hl) 22%, var(--logo-hl) 94%, transparent 94%);
}
:root[data-skin="lab"]:not([data-theme="dark"]) { --logo-hl: #A6E6DF; }
:root[data-skin="lab"][data-theme="dark"] { --logo-hl: #2B6E70; }
:root[data-skin="hospital"]:not([data-theme="dark"]) { --logo-hl: #AFD4F7; }
:root[data-skin="hospital"][data-theme="dark"] { --logo-hl: #2B4F78; }
:root[data-skin="library"]:not([data-theme="dark"]) { --logo-hl: #B5DCBF; }
:root[data-skin="library"][data-theme="dark"] { --logo-hl: #2E5A3C; }
:root[data-skin="cafe"]:not([data-theme="dark"]) { --logo-hl: #EDC196; }
:root[data-skin="cafe"][data-theme="dark"] { --logo-hl: #7A4E2E; }
:root[data-skin="sakura"]:not([data-theme="dark"]) { --logo-hl: #F9B9CE; }
:root[data-skin="sakura"][data-theme="dark"] { --logo-hl: #8E3D59; }
:root[data-skin="fresher"]:not([data-theme="dark"]) { --logo-hl: #FFB3CB; }
:root[data-skin="fresher"][data-theme="dark"] { --logo-hl: #6B3F8F; }
:root[data-skin="christmas"]:not([data-theme="dark"]) { --logo-hl: #F7B4B4; }
:root[data-skin="christmas"][data-theme="dark"] { --logo-hl: #8A2A33; }

/* ── "new!" sticker on the ways into the shop ────────────────────────────────
   Fixed colours (not theme tokens) so it pops the same on every shop theme,
   light or dark. Gone once the player has opened the shop (html.shop-seen,
   js/ui/gameSwitch.js). */
.sarc-pill, .nm-shop, .shop-pill { position: relative; }
html:not(.shop-seen) .nb-btn.sarc-pill::after, html:not(.shop-seen) .nav-more .nm-shop::after, html:not(.shop-seen) .area-h a.shop-pill::after {
    content: "new!"; position: absolute; z-index: 2; bottom: -11px; right: -12px;
    padding: 1px 5px 1px; border: 2px solid #0E1526; border-radius: 6px;
    background: #FF2E63; color: #fff; font: 800 10px/1.2 var(--font); letter-spacing: .03em; text-transform: uppercase;
    box-shadow: 2px 2px 0 #0E1526; transform: rotate(8deg); pointer-events: none;
    animation: newWiggle 2.8s ease-in-out 1s infinite;
}
html:not(.shop-seen) .nav-more > a.nm-shop::after { position: static; margin-left: auto; transform: rotate(4deg); animation: none; }
html[data-theme="dark"]:not(.shop-seen) .nb-btn.sarc-pill::after, html[data-theme="dark"]:not(.shop-seen) .nav-more .nm-shop::after, html[data-theme="dark"]:not(.shop-seen) .area-h a.shop-pill::after { border-color: #fff; box-shadow: 2px 2px 0 rgba(0,0,0,.6); }
@keyframes newWiggle { 0%, 84%, 100% { transform: rotate(8deg); } 88% { transform: rotate(-4deg) scale(1.12); } 92% { transform: rotate(12deg) scale(1.08); } 96% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { html:not(.shop-seen) .nb-btn.sarc-pill::after, html:not(.shop-seen) .area-h a.shop-pill::after { animation: none; } }

/* ── MUSCLE BLITZ (js/ui/blitzUI.js) ─────────────────────────────────────────
   The clock, score and combo in the bar over the model; four big choices in
   the panel. Combo tiers are classes on <body>: bz-lit (10 in a row),
   bz-fire (20) and bz-boom (30). */
.hl-orange { background: linear-gradient(transparent 52%, #FFB46B 52%); padding: 0 .12em; }
.bz-hud { gap: 10px; }
.bz-timer, .bz-stat {
    position: relative; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px;
    background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--shadow);
    overflow: hidden; color: var(--ink);
}
.bz-timer { flex: 1 1 auto; min-width: 0; }
.bz-timer i {
    position: absolute; inset: 0; transform-origin: 0 50%; background: var(--hl-yellow);
    transition: transform .1s linear, background-color .3s ease;
}
.bz-timer > :not(i) { position: relative; }
.bz-timer b { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bz-timer small, .bz-stat small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.bz-timer .bz-t-lbl { font-size: 16px; }
.bz-timer.low i { background: var(--hl-red); }
.bz-timer.low { animation: bzLow .5s ease-in-out infinite alternate; border-color: var(--red); }
.bz-timer.frozen i { background: var(--hl-blue); }
@keyframes bzLow { to { box-shadow: 3px 3px 0 var(--shadow), 0 0 0 4px rgba(200,16,46,.25); } }
.bz-stat { flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; min-width: 72px; line-height: 1; padding: 0 10px; }
.bz-stat b { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bz-stat b.bump { animation: bzBump .32s cubic-bezier(.34,1.8,.64,1); display: inline-block; }
@keyframes bzBump { 0% { transform: scale(1); } 45% { transform: scale(1.45); color: var(--green); } 100% { transform: scale(1); } }
.bz-combo { overflow: visible; transition: background-color .2s ease; }
.bz-combo.t1 { background: var(--hl-yellow); animation: bzLitPulse .9s ease-in-out infinite; }
.bz-combo.t2 { background: linear-gradient(90deg, #FF8A00, #FF3D3D, #FFB800, #FF8A00); background-size: 300% 100%; color: #fff; animation: bzFireBg 1s linear infinite; border-color: #8A1C00; }
.bz-combo.t2 small, .bz-combo.t3 small { color: rgba(255,255,255,.85); }
.bz-combo.t3 { background: linear-gradient(90deg, #FF3DCB, #FFB800, #00D1FF, #7CFF6B, #FF3DCB); background-size: 400% 100%; color: #fff; animation: bzFireBg .6s linear infinite, bzThrob .3s ease-in-out infinite alternate; border-color: #3A0050; }
@keyframes bzLitPulse { 0%,100% { box-shadow: 3px 3px 0 var(--shadow), 0 0 0 0 rgba(255,214,0,.7); } 50% { box-shadow: 3px 3px 0 var(--shadow), 0 0 14px 4px rgba(255,214,0,.85); } }
@keyframes bzFireBg { to { background-position: 300% 0; } }
@keyframes bzThrob { to { transform: scale(1.08) rotate(-2deg); } }
.bz-flames { position: absolute; left: 0; right: 0; top: -6px; height: 0; pointer-events: none; }
.bz-flames i { position: absolute; bottom: 0; font-style: normal; font-size: 16px; animation: bzFlame 1s ease-out infinite; opacity: 0; }
.bz-flames i:nth-child(1) { left: 8%; }
.bz-flames i:nth-child(2) { left: 42%; animation-delay: .33s; font-size: 20px; }
.bz-flames i:nth-child(3) { left: 74%; animation-delay: .66s; }
@keyframes bzFlame { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px) scale(1.1) rotate(10deg); } }

/* the model's card glows with the combo */
#cv { transition: box-shadow .3s ease, border-color .3s ease; }
body.bz-lit #cv { border-color: #C79A00; animation: bzCvLit 1s ease-in-out infinite; }
body.bz-fire #cv { border-color: #C23B00; animation: bzCvFire .45s ease-in-out infinite alternate; }
body.bz-boom #cv { border-color: #7A00A8; animation: bzCvBoom .35s linear infinite alternate; }
@keyframes bzCvLit { 0%,100% { box-shadow: 6px 6px 0 var(--shadow), 0 0 0 2px rgba(255,214,0,.6), 0 0 18px 2px rgba(255,214,0,.45); } 50% { box-shadow: 6px 6px 0 var(--shadow), 0 0 0 4px rgba(255,214,0,.9), 0 0 30px 8px rgba(255,214,0,.6); } }
@keyframes bzCvFire { from { box-shadow: 0 0 0 3px #FF7A00, 0 0 26px 8px rgba(255,80,0,.55); } to { box-shadow: 0 0 0 5px #FF3D00, 0 0 44px 16px rgba(255,140,0,.7); } }
@keyframes bzCvBoom { from { box-shadow: 0 0 0 4px #FF3DCB, 0 0 40px 14px rgba(255,61,203,.6); } to { box-shadow: 0 0 0 6px #FFB800, 0 0 60px 22px rgba(0,209,255,.6); } }

/* the panel: the question, then four choices */
.bz-panel { justify-content: flex-start; }
.bz-q { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; padding: 4px 2px 0; }
.bz-prog { font-size: 14px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bz-opt {
    position: relative; display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 12px 12px 12px 14px;
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow);
    font: 700 17px/1.2 var(--font); text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: transform .08s ease, box-shadow .08s ease, background-color .12s ease, opacity .15s ease;
    animation: bzOptIn .22s cubic-bezier(.34,1.5,.64,1) both;
}
.bz-opt:nth-child(2) { animation-delay: .03s; } .bz-opt:nth-child(3) { animation-delay: .06s; } .bz-opt:nth-child(4) { animation-delay: .09s; }
@keyframes bzOptIn { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.bz-opt:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--shadow); }
.bz-opt:active:not(:disabled) { transform: translate(2px,2px) scale(.98); box-shadow: 1px 1px 0 var(--shadow); }
.bz-opt:disabled { cursor: default; }
.bz-opts.wait .bz-opt, .bz-opt:disabled:not(.ok):not(.no):not(.reveal):not(.dim) { opacity: .5; }
.bz-opt.sm { font-size: 15px; } .bz-opt.xs { font-size: 13.5px; }
.bz-key { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.bz-opt.ok { background: var(--hl-green); border-color: var(--green-dk); animation: bzRight .26s cubic-bezier(.34,1.8,.64,1); }
.bz-opt.no { background: var(--hl-red); border-color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; animation: nbShake .25s ease 2; }
.bz-opt.reveal { background: var(--hl-green); border-color: var(--green-dk); animation: bzReveal .5s ease-in-out 2; }
.bz-opt.dim { opacity: .35; }
@keyframes bzRight { 0% { transform: scale(1); } 50% { transform: scale(1.07) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes bzReveal { 50% { box-shadow: 4px 4px 0 var(--shadow), 0 0 0 5px rgba(30,158,82,.35); } }
body.bz-lit .bz-opt:not(:disabled) { border-color: #A88200; }
body.bz-fire .bz-opt:not(:disabled) { border-color: #C23B00; box-shadow: 4px 4px 0 rgba(255,106,0,.45); }
body.bz-boom .bz-opt:not(:disabled) { border-color: #7A00A8; box-shadow: 4px 4px 0 rgba(255,61,203,.45); }
.bz-tip { font-size: 13px; color: var(--ink-3); text-align: center; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.bz-miss { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 6px 12px; border-radius: 10px;
           background: var(--hl-red); border: 2px solid var(--red); color: #0E1526; font-size: 16px; animation: fbIn .2s ease both; }

/* over the model: countdown, banners and "Time!" */
.bz-stage {
    position: fixed; z-index: 250; pointer-events: none;
    top: calc(var(--nav) + var(--bar) + 6px); left: 64px; right: calc(var(--panel) + var(--ad) + 24px); bottom: 18px;
    display: flex; align-items: center; justify-content: center;
}
.bz-count { font-size: 140px; font-weight: 700; letter-spacing: -.05em; color: var(--ink); text-shadow: 5px 5px 0 var(--hl-yellow); animation: bzCount .5s cubic-bezier(.34,1.6,.64,1) both; }
@keyframes bzCount { from { opacity: 0; transform: scale(2.2); } 60% { opacity: 1; } to { transform: scale(1); } }
.bz-banner {
    position: absolute; top: 14%; padding: 8px 20px; border: 3px solid var(--ink); border-radius: 14px;
    font-weight: 800; font-size: 30px; letter-spacing: -.02em; max-width: 92%; text-align: center; color: #0E1526;
    background: var(--hl-yellow); box-shadow: 5px 5px 0 rgba(23,33,58,.25);
    animation: bzBanner 1.3s cubic-bezier(.34,1.6,.64,1) both;
}
.bz-banner.fire { background: linear-gradient(90deg, #FF8A00, #FF3D3D, #FFB800); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.25); font-size: 36px; }
.bz-banner.boom { background: linear-gradient(90deg, #FF3DCB, #FFB800, #00D1FF); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.3); font-size: 40px; animation-duration: 1.8s; }
.bz-banner.lost { background: var(--card); color: var(--ink-2); font-size: 20px; border-width: 2px; }
.bz-banner.time { top: 38%; background: var(--hl-red); font-size: 64px; }
@keyframes bzBanner { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 18% { opacity: 1; transform: scale(1.15) rotate(2deg); } 30% { transform: scale(1) rotate(-1deg); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.9) translateY(-16px); } }

/* "+2s" hops up from where you tapped */
.bz-pops { position: fixed; inset: 0; z-index: 700; pointer-events: none; }
.bz-pop {
    position: absolute; padding: 3px 12px; border-radius: 999px; background: var(--green); color: #fff; border: 2px solid var(--green-dk);
    font: 800 22px var(--font); white-space: nowrap; box-shadow: 0 4px 10px rgba(17,115,58,.35);
    animation: bzHop .95s cubic-bezier(.2,.9,.3,1) both;
}
.bz-pop.big { font-size: 30px; background: linear-gradient(90deg, #1E9E52, #FFB800); }
@keyframes bzHop {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
    16%  { opacity: 1; transform: translate(-50%, -140%) scale(1.25); }
    30%  { transform: translate(-50%, -90%) scale(.92, 1.08); }
    42%  { transform: translate(-50%, -120%) scale(1.06); }
    54%  { transform: translate(-50%, -105%) scale(1); }
    78%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -230%) scale(.9); }
}

/* 30 in a row (or a perfect day): the screen explodes */
.bz-burst { position: fixed; inset: 0; z-index: 650; pointer-events: none; overflow: hidden; animation: bzFlash .5s ease-out both; }
@keyframes bzFlash { 0% { background: rgba(255,255,255,.75); } 100% { background: rgba(255,255,255,0); } }
.bz-burst i { position: absolute; left: 50%; top: 42%; font-style: normal; font-size: 30px; animation: bzFly 1.1s cubic-bezier(.1,.8,.3,1) both; }
@keyframes bzFly { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.3) rotate(240deg); } }
.bz-ring { position: absolute; left: 50%; top: 42%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; border: 8px solid #FFB800; animation: bzRing .7s ease-out both; }
.bz-ring.r2 { border-color: #FF3DCB; animation-delay: .12s; }
@keyframes bzRing { from { opacity: 1; transform: scale(.2); } to { opacity: 0; transform: scale(9); } }
body.bz-shake #cv, body.bz-shake .bz-panel, body.bz-shake .bz-hud { animation: bzShake .5s ease both; }
@keyframes bzShake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 3px) rotate(-.5deg); } 40%, 60% { transform: translate(6px, -3px) rotate(.5deg); } }

/* the start card and the end card */
.bz-kick { font-size: 26px; color: var(--pen); margin-bottom: 2px; }
.bz-start .detail { margin-bottom: 12px; }
.bz-how { text-align: left; margin: 0 0 14px; padding-left: 20px; font-size: 15px; line-height: 1.4; }
.bz-how li { margin-bottom: 4px; }
.bz-how .pink { color: var(--pink-dk); } .bz-how .grn { color: var(--green); }
.bz-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 16px; }
.bz-week span { display: flex; flex-direction: column; align-items: center; padding: 4px 0; border: 1.5px solid var(--rule); border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bz-week small { font-size: 10.5px; font-weight: 500; }
.bz-week span.on { background: #FFB46B; border-color: var(--ink); color: #0E1526; }
.nb-btn.bz-go { font-size: 18px; }
.bz-end .detail { margin-bottom: 10px; }
.bz-cut { color: var(--ink-3); }
.g-card .bz-grid { font-size: 14px; letter-spacing: 1px; line-height: 1.25; padding: 6px 12px; width: fit-content; margin: 0 auto 12px; }
.bz-missed { margin: -4px 0 12px; font-size: 13.5px; color: var(--ink-2); }
.bz-missed a { font-weight: 700; color: var(--pen); }
.bz-tmrw { margin: -6px 0 8px; font-size: 20px; color: var(--ink-3); }

@media (max-width: 900px) {
    body.blitz .bz-hud { left: 10px; right: 10px; gap: 6px; }
    .bz-timer, .bz-stat { height: 38px; box-shadow: 2px 2px 0 var(--shadow); }
    .bz-timer b { font-size: 21px; }
    .bz-stat { min-width: 60px; padding: 0 8px; }
    .bz-stat b { font-size: 17px; }
    .bz-stage { left: 10px; right: 10px; top: calc(var(--nav) + var(--bar)); bottom: auto; height: var(--cvh); }
    .bz-panel { gap: 8px; padding-top: 2px; }
    .bz-q { font-size: 16px; }
    .bz-opts { gap: 8px; }
    .bz-opt { min-height: 70px; font-size: 15.5px; padding: 10px 8px 8px; box-shadow: 3px 3px 0 var(--shadow); }
    .bz-opt.sm { font-size: 14px; } .bz-opt.xs { font-size: 12.5px; }
    .bz-key { display: none; }
    .bz-tip { min-height: 32px; font-size: 12px; }
    .bz-miss { min-height: 34px; font-size: 14.5px; }
    .bz-count { font-size: 110px; }
    .bz-banner { font-size: 22px; padding: 6px 14px; }
    .bz-banner.fire { font-size: 26px; } .bz-banner.boom { font-size: 28px; } .bz-banner.time { font-size: 48px; }
    .bz-how { font-size: 14px; margin-bottom: 10px; }
    .bz-kick { font-size: 22px; }
    .g-card .bz-grid { font-size: 12.5px; }
}
@media (max-width: 900px) and (max-height: 700px) { .bz-opt { min-height: 58px; } }
@media (prefers-reduced-motion: reduce) {
    .bz-timer.low, .bz-combo.t1, .bz-combo.t2, .bz-combo.t3, body.bz-lit #cv, body.bz-fire #cv, body.bz-boom #cv,
    .bz-opt, .bz-opt.ok, .bz-opt.no, .bz-opt.reveal, .bz-stat b.bump { animation: none; }
    .bz-pop { animation: bzHopSoft .9s ease both; }
    @keyframes bzHopSoft { 0% { opacity: 0; transform: translate(-50%, -100%); } 20%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -100%); } }
}

/* ── OSTEOMLE: ONE ROUTE CARD (js/ui/pathfindingUI.js, body.pf-game) ────────
   The route, every guess and what's left all live in one card beside the
   model. Each guess fills a slot (green on the route, yellow the long way,
   red wrong); the empty slots are the guesses left. Give up stays small and
   asks before it ends the game. */
.pf-panel .g-track { flex: 1 1 auto; min-height: 0; }
.pf-panel .g-row { min-height: 34px; }
/* short laptop screens: a long route scrolls, but the goal stays in view */
.pf-panel .g-row.is-goal { position: sticky; bottom: 0; z-index: 1; background: var(--card-soft); }
@media (min-width: 901px) and (max-height: 860px) {
    .pf-panel .g-row { min-height: 26px; font-size: 14.5px; }
    .pf-panel .g-row .dot { width: 20px; height: 20px; font-size: 10.5px; }
    .pf-panel .g-head { padding-top: 8px; }
    .pf-panel .g-tools { padding-top: 8px; padding-bottom: 10px; }
    .pf-panel .pip { height: 28px; }
}
.pf-panel .g-list { flex: 0 1 auto; min-height: 0; }
.pf-panel .g-row .dot.start { background: var(--green); }
.pf-panel .g-row .blank { color: #8A93AC; letter-spacing: .1em; }
.pf-panel .g-row .nmw { min-width: 0; }
.pf-panel .g-head.sub { padding-top: 10px; }
.pf-panel .g-head.sub .t { font-size: 24px; }
.g-tries { flex-shrink: 0; padding: 0 18px 4px; }
.g-tries .g-head { padding-left: 0; padding-right: 0; }
.g-pips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pip {
    display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px;
    border: 2px solid var(--ink); border-radius: 7px; background: var(--card);
    font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--ink);
}
.pip.ok { background: var(--hl-green); }
.pip.detour { background: var(--hl-yellow); }
.pip.bad { background: var(--hl-red); }
.pip.bad s { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.pip.hint { background: var(--hl-purple); }
.pip em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--ink-2); }
.pip.empty { width: 40px; padding: 0; border-style: dashed; border-color: var(--rule); background: transparent; }
.pip.new { animation: logIn .45s cubic-bezier(.34,1.5,.64,1) both; }
.pip.bad.new { animation: logIn .4s ease both, nbShake .35s ease-in-out .4s; }
.g-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.g-meta b { color: var(--ink); }
.g-meta .warn { font-weight: 700; color: var(--yellow-dk); }
.g-meta .warn.tight { color: var(--red); }
:root[data-theme="dark"] .g-meta .warn { color: var(--hl-yellow); filter: brightness(1.8); }
:root[data-theme="dark"] .g-meta .warn.tight { color: #FF8A9B; filter: none; }

.g-tools { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding: 12px 18px 14px; }
.g-tools.asking { display: none; }
.nb-btn.g-small, .nb-btn.g-giveup { height: 38px; padding: 0 14px; font-size: 14px; box-shadow: 2px 2px 0 var(--shadow); }
.nb-btn.g-giveup { color: var(--ink-2); }
.g-small .btn-sub { margin-left: 4px; }

.g-confirm { padding: 12px 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--shadow); }
.g-track .g-confirm { margin: 12px 18px 14px; }
.g-confirm p { margin: 0 0 10px; font-weight: 700; font-size: 16px; }
.g-confirm p span { display: block; margin-top: 2px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.g-confirm-btns { display: flex; gap: 8px; }
.g-confirm-btns .nb-btn { flex: 1 1 0; height: 42px; }
.g-confirm-btns .keep { background: var(--pen); color: var(--on-ink); }
.ask-row { display: flex; gap: 8px; align-items: stretch; }
.ask-row .g-field { flex: 1 1 auto; min-width: 0; }
.on-phone { display: none !important; }

@media (prefers-reduced-motion: reduce) { .pip.new { animation: none !important; } }

/* Phones: model on top, then the route card, then the guess box pinned to the
   bottom of what you can see. Nothing scrolls; the model takes the height that
   is left (--pfh is the panel's height, measured in pathfindingUI.js). */
@media (max-width: 900px) {
    .on-phone { display: revert !important; }
    .on-desk { display: none !important; }
    body.pf-game #cv { height: calc(var(--vvh, 100dvh) - var(--nav) - var(--bar) - var(--pfh, 300px) - 16px); min-height: 120px; }
    body.pf-game .pf-panel {
        top: calc(var(--vvh, 100dvh) - var(--pfh, 300px) - 2px); bottom: auto;
        overflow: visible; padding: 0 2px 8px 0; gap: 8px;
    }
    @supports (padding: env(safe-area-inset-bottom)) {
        body.pf-game:not(.kb-open) .pf-panel { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    }
    .pf-panel .g-track { order: 0; }
    .pf-panel .g-guess { order: 1; }
    .pf-panel .g-btns { order: 2; }
    .pf-panel.confirming .g-ask { display: none; }

    /* the latest guess floats over the bottom of the model */
    body.pf-game .pf-panel .g-feedback {
        position: fixed; z-index: 60; left: 20px; max-width: calc(100vw - 96px);
        top: calc(var(--vvh, 100dvh) - var(--pfh, 300px) - 22px); transform: translateY(-100%);
        padding: 5px 10px; font-size: 13.5px; animation: fbUp .4s cubic-bezier(.34,1.5,.64,1) both;
    }
    body.pf-game .pf-panel .g-feedback.intro { display: none; }

    /* the route as a row of chips */
    .pf-panel .g-head { padding: 8px 12px 4px; }
    .pf-panel .g-head .t { font-size: 22px; }
    .pf-panel .g-list { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; padding: 2px 12px 2px; }
    .pf-panel .g-row {
        position: relative; min-height: 0; gap: 0; padding: 2px 7px; border: 2px solid var(--ink); border-radius: 6px;
        background: var(--card); font-size: 14px; letter-spacing: 0; line-height: 1.3;
    }
    .pf-panel .g-row:not(:last-child)::after { content: '›'; position: absolute; right: -12px; color: var(--ink-3); font-weight: 500; }
    .pf-panel .g-row .dot, .pf-panel .g-row .tag { display: none; }
    .pf-panel .g-row .nm { background: none !important; }
    .pf-panel .g-row.is-start, .pf-panel .g-row.is-found { background: var(--hl-green); }
    .pf-panel .g-row.is-goal { background: var(--hl-pink); }
    .pf-panel .g-row.is-missed { background: var(--hl-purple); }
    .pf-panel .g-row.unknown { border-style: dashed; background: transparent; min-width: 34px; justify-content: center; }
    .pf-panel .g-row .blank { font-size: 0; }
    .pf-panel .g-row .blank::after { content: '?'; font-size: 14px; font-weight: 700; color: var(--ink-3); }
    .pf-panel .g-row .clue { background: none; letter-spacing: .08em; }
    .pf-panel .g-row .alts { font-size: 12px; }
    .pf-panel .g-soft { flex-basis: 100%; margin: 0; font-size: 12px; padding: 4px 8px; }
    .pf-panel:not(.is-review) .g-soft { display: none; }

    .g-tries { padding: 0 12px 10px; }
    .g-tries .g-head.sub { display: none; }
    .g-pips { flex-wrap: wrap; gap: 5px; margin-top: 8px; }
    .pip { height: 28px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }
    .pip em { font-size: 10.5px; }
    /* phones: no empty slots, the line below says how many are left */
    .pip.empty { display: none; }
    .g-pips:not(:has(.pip:not(.empty))) { display: none; }
    .g-meta { margin-top: 6px; font-size: 13px; }
    .g-meta .need-txt { display: none; }

    .g-tools { padding: 0 12px 10px; margin-top: 0; gap: 6px; }
    .g-tools:not(:has(> :not(.on-desk))) { display: none; }
    .nb-btn.g-small { flex: 1 1 0; height: 34px; padding: 0 8px; font-size: 13px; }
    .g-small .btn-sub { display: none; }
    .ask-row { gap: 6px; }
    .nb-btn.g-giveup.on-phone { flex: none; height: 46px; padding: 0 12px; font-size: 13px; border-radius: 8px; box-shadow: none; }

    /* suggestions open upwards from the guess box, over the card and model */
    body.pf-game .pf-panel .g-drop {
        position: absolute; top: auto; bottom: calc(100% + 12px); left: -8px; right: -8px; transform: none;
        max-height: min(320px, calc(var(--vvh, 100dvh) - var(--nav) - 90px));
    }

    /* keyboard open: the model gets small, so keep just what helps you type
       the next bone: the route chips and one line of guesses left. The
       guess slots, the turn pad and the buttons fold away until it closes. */
    body.pf-game.kb-open .pf-panel .g-pips, body.pf-game.kb-open .pf-panel .g-tools,
    body.pf-game.kb-open .pf-panel .g-track > .g-head,
    body.pf-game.kb-open .cv-pad, body.pf-game.kb-open .cv-hint { display: none; }
    body.pf-game.kb-open .pf-panel .g-list { padding-top: 8px; }
    body.pf-game.kb-open .g-tries { padding: 0 12px 8px; }
    body.pf-game.kb-open .g-meta { margin-top: 6px; }
    /* the start and goal are already the first and last chips, so the title
       line goes too and the model moves up into its space */
    body.pf-game.kb-open .g-bar { display: none; }
    body.pf-game.kb-open #cv { top: calc(var(--nav) + 8px); height: calc(var(--vvh, 100dvh) - var(--nav) - var(--pfh, 300px) - 18px); min-height: 0; }
}
@keyframes fbUp { from { opacity: 0; transform: translateY(calc(-100% + 12px)); } to { opacity: 1; transform: translateY(-100%); } }

/* Challenge links (js/ui/gameSwitch.js): the note a friend sees while they
   play, and the "you vs your friend" box on their end card. */
.ch-note {
    position: fixed; left: 50%; top: calc(var(--nav, 64px) + 10px); z-index: 550;
    transform: translateX(-50%) rotate(-1deg); width: min(420px, calc(100vw - 32px));
    display: flex; flex-direction: column; gap: 2px; padding: 12px 40px 12px 16px;
    background: var(--card-soft); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px;
    box-shadow: 4px 4px 0 var(--paper-line); cursor: pointer;
    animation: ch-in .35s ease both; transition: opacity .3s ease, transform .3s ease;
}
.ch-note.gone { opacity: 0; transform: translateX(-50%) translateY(-8px) rotate(-1deg); }
.ch-note .ch-tape { position: absolute; top: -9px; left: 50%; width: 70px; height: 16px; margin-left: -35px; background: #FFE047; opacity: .85; }
.ch-note .ch-k { font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--pen); line-height: 1.1; }
.ch-note .ch-t { font-size: 15px; line-height: 1.4; }
.ch-note .ch-x {
    position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; background: none;
    color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer;
}
@keyframes ch-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px) rotate(-1deg); } }

.ch-vs { margin: -4px auto 12px; font-size: 14px; color: var(--ink-2); text-align: center; line-height: 1.4; }
.ch-vs b { color: var(--ink); }
.ch-vs .ch-verdict { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ch-vs.win .ch-verdict { color: var(--green); }
.ch-vs .ch-replay { margin-left: 8px; font-weight: 600; color: var(--pen); }
