/* Google Fonts, self-hosted (OFL): Bricolage Grotesque for headings and numbers, Figtree for the rest. */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-display: swap;
    font-weight: 500 800; /* only the weights in use, normal width (README → Cache) */
    src: url("../fonts/bricolage-grotesque-2.woff2") format("woff2-variations"), url("../fonts/bricolage-grotesque-2.woff2") format("woff2");
}
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url("../fonts/figtree.woff2") format("woff2-variations"), url("../fonts/figtree.woff2") format("woff2");
}

/*
 * Hover effects only with a mouse or trackpad: @media (hover: hover) and (pointer: fine). Not just
 * (hover: hover): phones with a stylus (Galaxy with S Pen) say they can hover too, and then showed a
 * hover state on a long press. On touch a button answers with its pressed state (:active) instead.
 */

/* ======================================================================
   Colours and sizes
   ====================================================================== */

:root {
    --paper: #f3f1ed;
    --card: #ffffff;
    --board: #ffffff;
    --fill: rgba(24, 23, 26, .055);
    --fill-2: rgba(24, 23, 26, .09);
    --sk-base: rgba(24, 23, 26, .085);
    --lu-gold: #b97f00;
    --lu-top: #f5b51e;
    /* The level number on the light rays: darker gold than in dark mode, or it fades into them. */
    --lu-mid: #e3920a;
    --lu-bot: #b85600;
    --sk-shine: rgba(255, 255, 255, .7);
    --ink: #18171a;
    --ink-2: #5d5a55;
    --ink-3: #706c65; /* 4.6:1 on --paper: tertiary text still has to be readable (WCAG AA) */
    --line: rgba(24, 23, 26, .09);
    --ring-dim: .38; /* an 8-kamp ring's arcs not played yet (duels.js legRingSvg) */
    --line-2: rgba(24, 23, 26, .16);
    --grid: #ebe8e2;
    --on-ink: #ffffff;
    --given: #f2efe9;
    --sunken: #f6f4f0;

    --red: #db4429;
    --blue: #2a55d6;
    --yellow: #f3b82c;
    --good: #1f8a5b;
    --on-good: #ffffff; /* text and check marks on a green fill */
    --bad: #d93d24;
    --wa: #1fa855;

    --spoor: var(--red);
    --spoor-soft: color-mix(in srgb, var(--red) 13%, var(--board));
    --sym-a: var(--red);
    --sym-b: var(--blue);
    --me: color-mix(in srgb, var(--yellow) 14%, var(--card));
    --streak: color-mix(in srgb, var(--yellow) 45%, var(--card));

    /* Tuinen: soft, easily distinguishable garden colours */
    --g0: #f4c7b4; --g1: #bcd6f5; --g2: #cfe8b5; --g3: #f2dd92; --g4: #dcc8f0;
    --g5: #b3e3da; --g6: #f3bfd3; --g7: #dcd6cc; --g8: #fbcd94;
    --tree: #1d7a45;
    --tree-lift: none; /* dark: a soft shadow under a tree (.t-cell .tree) */
    --trunk: #7a5230;
    --mark: rgba(24, 23, 26, .42);
    --edge-solid: rgb(24, 23, 26); --edge-pct: 78%; /* the same, as a mix (Tuinen: see .t-cell) */

    --glass: color-mix(in srgb, var(--paper) 74%, transparent);
    /* Liquid glass (tab bar, game toolbar): more see-through than --glass, with a light rim on top */
    --lg-tint: color-mix(in srgb, var(--paper) 60%, transparent);
    --lg-hi: rgba(255, 255, 255, .9);
    --lg-hi-2: rgba(255, 255, 255, .45);
    --lg-shadow: 0 10px 30px rgba(24, 23, 26, .14), 0 1px 3px rgba(24, 23, 26, .08);
    --lg-shadow-sm: 0 2px 8px -2px rgba(24, 23, 26, .16); /* (for small pieces: a choice pill, a round button) */
    /* The rim of a piece of glass: bright top left, softer bottom right, a hairline all round */
    --lg-rim: inset 1.5px 1.5px 1px -.5px var(--lg-hi), inset -1.5px -1.5px 1px -.5px var(--lg-hi-2), inset 0 0 0 .5px var(--lg-hi-2);
    --elev: 0 0 0 1px var(--line), 0 1px 2px rgba(24, 23, 26, .04);

    --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
    --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --r: 14px;
    --r-lg: 20px;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.3, 1.5, .5, 1);
    color-scheme: light;
}

/* Dark: follows the device, unless the user picks light or dark under Jij → Instellingen. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #111113;
        --card: #1c1c1f;
        --board: #1c1c1f;
        --fill: rgba(255, 255, 255, .07);
        --fill-2: rgba(255, 255, 255, .11);
        --sk-base: rgba(255, 255, 255, .075);
        --lu-gold: #f3b82c;
        --lu-top: #fff6c8;
        --lu-mid: #f3b82c;
        --lu-bot: #e07a00;
        --sk-shine: rgba(255, 255, 255, .07);
        --ink: #f3f2ef;
        --ink-2: #aaa7a1;
        --ink-3: #8a8782; /* 4.8:1 on --card */
        --line: rgba(255, 255, 255, .08);
        --ring-dim: .55;
        --line-2: rgba(255, 255, 255, .15);
        --grid: #2b2b2f;
        --on-ink: #111113;
        --given: #242428;
        --sunken: #151517;
        --red: #ef5a3e;
        --blue: #6088f5;
        --yellow: #f5c04c;
        --good: #3fb07c;
        --on-good: #111113; /* white on this lighter green is too weak (2.7:1), dark reaches 6.9:1 */
        --bad: #ef5a3e;
        --spoor-soft: color-mix(in srgb, var(--red) 20%, var(--board));
        --me: color-mix(in srgb, var(--yellow) 9%, var(--card));
        --streak: color-mix(in srgb, var(--yellow) 25%, var(--card));
        /* Nine clearly different hues, but no red: red is for errors (brown, blue, green, yellow, purple, teal, pink, grey, orange) */
        --g0: #7b5a44; --g1: #2b5c9e; --g2: #3c7a34; --g3: #9a8420; --g4: #6a47a6;
        --g5: #18786f; --g6: #a03c70; --g7: #5d5a54; --g8: #b8691d;
        --tree: #9be3b0;
        --tree-lift: drop-shadow(0 1px 1.5px rgb(0 0 0 / .55));
        --trunk: #d9b48a;
        --mark: rgba(255, 255, 255, .5);
        --edge-solid: rgb(243, 242, 239); --edge-pct: 80%;
        --elev: 0 0 0 1px var(--line);
        --lg-tint: color-mix(in srgb, var(--paper) 58%, transparent);
        --lg-hi: rgba(255, 255, 255, .4);
        --lg-hi-2: rgba(255, 255, 255, .14);
        --lg-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .3);
        --lg-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --paper: #111113;
    --card: #1c1c1f;
    --board: #1c1c1f;
    --fill: rgba(255, 255, 255, .07);
    --fill-2: rgba(255, 255, 255, .11);
    --sk-base: rgba(255, 255, 255, .075);
    --lu-gold: #f3b82c;
    --lu-top: #fff6c8;
    --lu-mid: #f3b82c;
    --lu-bot: #e07a00;
    --sk-shine: rgba(255, 255, 255, .07);
    --ink: #f3f2ef;
    --ink-2: #aaa7a1;
    --ink-3: #8a8782;
    --line: rgba(255, 255, 255, .08);
    --ring-dim: .55;
    --line-2: rgba(255, 255, 255, .15);
    --grid: #2b2b2f;
    --on-ink: #111113;
    --given: #242428;
    --sunken: #151517;
    --red: #ef5a3e;
    --blue: #6088f5;
    --yellow: #f5c04c;
    --good: #3fb07c;
    --on-good: #111113;
    --bad: #ef5a3e;
    --spoor-soft: color-mix(in srgb, var(--red) 20%, var(--board));
    --me: color-mix(in srgb, var(--yellow) 9%, var(--card));
    --streak: color-mix(in srgb, var(--yellow) 25%, var(--card));
    /* Nine clearly different hues, but no red: red is for errors (brown, blue, green, yellow, purple, teal, pink, grey, orange) */
    --g0: #7b5a44; --g1: #2b5c9e; --g2: #3c7a34; --g3: #9a8420; --g4: #6a47a6;
    --g5: #18786f; --g6: #a03c70; --g7: #5d5a54; --g8: #b8691d;
    --tree: #9be3b0;
    --tree-lift: drop-shadow(0 1px 1.5px rgb(0 0 0 / .55));
    --trunk: #d9b48a;
    --mark: rgba(255, 255, 255, .5);
    --edge-solid: rgb(243, 242, 239); --edge-pct: 80%;
    --elev: 0 0 0 1px var(--line);
    --lg-tint: color-mix(in srgb, var(--paper) 58%, transparent);
    --lg-hi: rgba(255, 255, 255, .4);
    --lg-hi-2: rgba(255, 255, 255, .14);
    --lg-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .3);
    --lg-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* ======================================================================
   Base
   ====================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    background: var(--paper);
    /* Nothing may stick out sideways (a phone would zoom out to fit it): also while a screen slides in
       from the side (router.js). Always on, not only during the slide: switching it on and off made
       Safari rebuild the page, which restarted what was animating in (the XP card came in twice). */
    overflow-x: clip;
}
/* While playing: no overscroll at all (no bounce, no glow), so a downward swipe on the board
   can never pull the page (and the line you are drawing) along. */
html:has(body.is-game), body.is-game { overscroll-behavior: none; }
/* App feel: no double-tap zoom (and no tap delay); installed on the home screen no pinch zoom either
   (class set in app.js). In the browser pinching still works: there it is a web page. */
html { touch-action: manipulation; }
/* Chrome's own pull-to-refresh (reloads the whole page) off: the app has its own (app.js). Chrome
   decides on the first finger movement, before ours knows it is a pull, so preventDefault alone would miss
   it now and then. "contain" keeps normal scrolling and the edge glow. */
html { overscroll-behavior-y: contain; }
/* Text only for screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* A heading that gets focus when a screen opens (router.js): for screen readers, never a visible ring */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
/* The Spoor board can take keyboard focus (screen readers, spoor.js): the ring follows its rounded frame */
.spoor-svg:focus-visible { outline-offset: 4px; border-radius: 15px; }
html.app { touch-action: pan-x pan-y; }
/* Installed as an app: no rubber-band bounce at all (the app's own pull to refresh needs none, app.js).
   On an iPhone the bounce dragged the fixed tab bar off the bottom of the screen. */
html.app, html.app body { overscroll-behavior-y: none; }
/*
 * Room for the phone's status bar at the top (--sat): only when Puzzelduel runs as an app from the home
 * screen, where the page starts under the status bar. In a browser tab the browser's own bar takes care
 * of that; some browsers (DuckDuckGo) still report the status bar's height there, which would push
 * the logo far down. html.app: set in app.js, also for an iPhone home-screen app (navigator.standalone).
 */
:root { --sat: 0px; }
@media (display-mode: standalone), (display-mode: fullscreen) { :root { --sat: env(safe-area-inset-top, 0px); } }
html.app { --sat: env(safe-area-inset-top, 0px); }
/*
 * Room for the bar at the bottom of the screen (--sab, under the tab bar and sheets): as an app from
 * the home screen, and on an iPhone or iPad (Safari's home indicator, where the page runs under it;
 * -webkit-touch-callout only exists there). Not in other browser tabs: Chrome reports 0 there anyway,
 * but DuckDuckGo reports Android's navigation bar, and changes it while its own bars slide in and out
 * as you scroll: the tab bar would then bob up and down.
 */
:root { --sab: 0px; }
@supports (-webkit-touch-callout: none) { :root { --sab: env(safe-area-inset-bottom, 0px); } }
@media (display-mode: standalone), (display-mode: fullscreen) { :root { --sab: env(safe-area-inset-bottom, 0px); } }
html.app { --sab: env(safe-area-inset-bottom, 0px); }
/* While a sheet is open the page behind it stays put (touch screens): scrolling it would slide the
   browser's address bar away underneath, and DuckDuckGo would then show an empty band below the sheet. */
@media (pointer: coarse) { html:has(dialog[open]) { overflow: hidden; } }
/* No text selection by a long press on cards and buttons; only where text is worth copying. */
body { -webkit-user-select: none; user-select: none; }
input, textarea, .doc, .share-link span, .big-code { -webkit-user-select: text; user-select: text; }
/* Pull to refresh (app.js): a ball comes down from under the top bar */
.ptr { position: fixed; left: 50%; top: calc(var(--sat) + 56px); z-index: 19; /* just under the top bar (20), so it comes out from under it */ pointer-events: none; opacity: 0;
    transform: translate(-50%, calc(var(--pull, 0px) - 52px)); transition: transform .32s cubic-bezier(.2, .9, .3, 1.15), opacity .2s; }
.ptr.show { opacity: var(--ptr-o, 1); } /* --ptr-o grows with the pull (app.js): the bar is see-through at the top */
.ptr.drag { transition: opacity .15s; }
.ptr-ball { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card); color: var(--ink-3);
    box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0, 0, 0, .16); transition: color .15s, transform .2s; }
.ptr svg { width: 20px; height: 20px; transform: rotate(var(--turn, 0deg)); }
.ptr.armed .ptr-ball { color: var(--ink); transform: scale(1.08); }
.ptr.busy svg { animation: spin .45s linear infinite; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip; /* (see html) */
    /* No background of its own: html has it. Then a screen sliding away (router.js, the ghost) can lie
       under the page (z-index -1) instead of the page being lifted above it. */
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    letter-spacing: 0;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button, .practice-tile { cursor: pointer; -webkit-touch-callout: none; } /* (practice tiles are links: no link preview on a long press) */
a { color: inherit; }
h1, h2, h3 { line-height: 1.08; margin: 0; font-weight: 700; }
p { margin: 0; }
b, strong { font-weight: 650; }
[hidden] { display: none !important; }
button, .btn, .tile, .practice-tile, .topbar, .game-bar, .controls, .lb, .tabs { -webkit-user-select: none; user-select: none; }

/* No border-radius of its own: the outline follows the element's shape (a board cell stays square) */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A dialog gets the focus itself when it opens. Safari on iPhone would then draw this outline around
   the sheet: a white rim along its top in dark mode. The sheet doesn't need a focus ring (its buttons do). */
dialog:focus-visible, dialog:focus { outline: none; }
/* No outline on headings that only receive focus for screen readers (tabindex -1) */
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }
/* Rows reaching the edge of a list (overflow: hidden): outline inside the row, otherwise it is clipped */
.menu > :is(button, a):focus-visible, .recent a:focus-visible { outline-offset: -3px; }

/* ======================================================================
   Top bar: only the logo, so it scrolls away with the page (no bar that stays)
   ====================================================================== */

.topbar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(8px + var(--sat)) max(16px, calc((100% - 888px) / 2)) 8px;
}
body.is-game .topbar { display: none; }
/* As an app with a status bar over the page (--sat): frosted glass behind the clock once something
   scrolls underneath, so the content doesn't run through it. In a browser tab --sat is 0: nothing. */
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: 25;
    height: var(--sat);
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
body.scrolled:not(.is-game)::before { opacity: 1; }
/*
 * Installed as an app (iOS 27): the system blurs the top edge of a home-screen app, over whatever is
 * there. A real element fixed at the very top with a background colour stops that (WebKit looks at
 * the top few pixels); clipped to its (absent) text it paints nothing. The pattern other apps found
 * to work: a real element, not a ::before, 11px. (index.php, right after <body>.)
 */
.pwa-top-strip { display: none; }
@media (display-mode: standalone) {
    .pwa-top-strip { display: block; position: fixed; inset: 0 0 auto; height: 11px; z-index: 10000; background-color: var(--paper); -webkit-background-clip: text; background-clip: text; pointer-events: none; }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    text-decoration: none;
    font-family: var(--display);
    font-weight: 900;
    font-size: 18px;
    letter-spacing: -0.01em;
}
.brand-mark { width: 28px; height: 28px; flex: none; }

main {
    max-width: 920px;
    margin: 0 auto;
    padding: 4px 16px calc(104px + var(--sab)); /* room for the tab bar */
}
body.is-game main { padding: 0 12px; max-width: 620px; }
/* Phones: keep the board out of the system back-swipe zone at the screen edges (Android cannot
   be told to ignore it), so a drag that starts on the outer column draws instead of going back. */
@media (pointer: coarse) { body.is-game main { padding: 0 max(24px, env(safe-area-inset-left)) 0 max(24px, env(safe-area-inset-right)); } }

/* ======================================================================
   Bottom tab bar (Spelen · Duels · Jij): a floating pill of liquid glass
   ====================================================================== */

/* The glass look: see-through tint, a light rim (bright top left, softer bottom right) and a soft
   shadow. Only blur, no refraction: that works in every browser. */
.tabbar, .controls {
    background: var(--lg-tint);
    box-shadow: var(--lg-rim), inset 0 0 18px -6px var(--lg-hi-2), var(--lg-shadow);
}
.tabbar {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    /* On an iPhone (--sab: the home indicator's 34 pt) not the whole inset above the edge (that floated
       high), but just clear of the home indicator, as iOS's own floating tab bars */
    bottom: max(14px, calc(var(--sab) - 14px));
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 6px;
    border-radius: 999px;
    /* A layer of its own: iOS Safari can lose a fixed bar with backdrop-filter (it just disappears) when
       the layers under it change, as they do while pages slide. (And in the app from the home screen
       app.js draws it anew after a slide and a scroll: iOS 26 lost it all the same.) */
    transform: translateZ(0);
    /* Real glass, also while pages slide underneath: the router animates the pages itself and leaves
       this bar alone (no View Transitions, which turned it into a picture without blur). */
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
}
/* The current tab: a glass drop that flows to the tab you pick (instead of one tab losing its
   background and the other getting it: that blinked). Here its resting place; the liquid way there
   (stretch, squash against the edge, wobble back) is liquidMove() in core.js, called from setTab() in router.js. */
.tab-drop {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc((100% - 12px) / 3);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 8%, transparent);
    box-shadow: inset 1px 1px 0 -.5px var(--lg-hi), inset 0 0 0 .5px var(--lg-hi-2);
    transform: translateX(calc(var(--tab-i, 0) * 100%));
    transform-origin: 0 0;
    transition: opacity .2s;
    pointer-events: none;
}
.tabbar:not(:has(a[aria-current="page"])) .tab-drop { opacity: 0; }
.tabbar:has(a[data-tab="duels"][aria-current="page"]) { --tab-i: 1; }
.tabbar:has(a[data-tab="me"][aria-current="page"]) { --tab-i: 2; }
body.is-game .tabbar { display: none; }
/* Panes that slide/fade when you switch tabs (swapContent) lie under the glass tab bar. Safari
   briefly drops the blur (the bar flashes) when such a pane gets its own layer at the start of the
   animation and loses it at the end. Keeping them on their own layer all the time avoids that. */
#mePane, .boards-rest { will-change: opacity, transform; }
.tabbar a {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 7px 4px 6px;
    border-radius: 999px;
    color: var(--ink-2); /* not --ink-3: on the see-through glass that fades into colourful tiles */
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
    transition: color .15s, transform .1s;
}
.tabbar a:active { transform: scale(.94); }
.tabbar a > svg { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] > svg { fill: color-mix(in srgb, var(--ink) 12%, transparent); }
.tabbar a[aria-current="page"] > svg path { fill: none; } /* the VS letters are lines: only the circle gets the tint */
.tab-avatar {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--fill-2);
    color: var(--ink-2);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 800;
}
.tabbar a[aria-current="page"] .tab-avatar { background: var(--ink); color: var(--on-ink); }
/* Your own pixel avatar in the tab bar (instead of your initial) */
.tab-avatar.has-av { padding: 0; background: none; }
.tab-avatar .face { width: 100%; height: 100%; }
.tab-avatar .face.av svg { box-shadow: none; }
/* Active without a frame: a ring in the ink colour. With a frame, the frame is the ring. */
.tabbar a[aria-current="page"] .tab-avatar.has-av { background: none; }
.tabbar a[aria-current="page"] .tab-avatar .face.frame-0 svg { box-shadow: 0 0 0 2px var(--ink); }
.tab-dot { position: absolute; top: 5px; left: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--paper); }
/* On a large screen: not the full width, but at the bottom centre */
@media (min-width: 720px) {
    .tabbar {
        left: 50%;
        right: auto;
        bottom: max(16px, calc(var(--sab) - 14px));
        width: 380px;
        transform: translate3d(-50%, 0, 0);
    }
}

/* Tab page header */
.page { max-width: 560px; margin: 8px auto 0; }
/* The heading of a page. As tall as its button, also without one: every title at the same height. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 14px; }
.page-head .btn { min-height: 44px; padding: 9px 16px; }
.me-head { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; padding-left: 4px; } /* room for a frame that reaches outside */
.me-head .link-btn { margin-top: 2px; padding: 2px 0; }
.me-head .link-btn::after { inset: -10px -6px; } /* narrow button, yet a thumb-sized tap target */
.empty-duels { margin-top: 8px; padding: 22px 20px; border-radius: 24px; background: var(--card); box-shadow: var(--elev); text-align: center; }
.empty-duels .vs-badge { margin: 0 auto 12px; }
.empty-duels h2 { font-family: var(--display); font-size: 26px; font-weight: 800; }
.empty-duels > p { color: var(--ink-2); margin-top: 6px; }
.empty-duels .steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; text-align: left; }
.empty-duels .steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.empty-duels .steps b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill-2); font-size: 14px; }
.empty-duels .steps h3 { font-size: 16px; font-weight: 700; }
.empty-duels .steps p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }

/* Result: the next step right below your time */
/* Spacing rhythm: 8px within a group (these buttons), 14px between stacked cards, 28px between separate parts. */
.result-actions { display: grid; gap: 8px; margin-top: 20px; }
.ra-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ra-row.single { grid-template-columns: minmax(0, 1fr); } /* an ended duel: only "Naar het begin" */
.ra-row .btn { min-height: 46px; font-size: 15px; }
/* Two buttons side by side: half a phone wide. Less side padding, and a long label ("Challenge someone",
   or a bigger system font) wraps onto two balanced lines instead of running into the edge. */
:is(.ra-row, .home-duel-actions, .share-row, .gp-actions) .btn { padding-inline: 12px; white-space: normal; text-wrap: balance; text-align: center; line-height: 1.2; }
/* With an icon: wrapped lines stay next to it (centred, they would float off into the free space). */
:is(.ra-row, .home-duel-actions, .share-row, .gp-actions) .btn:has(> svg) { text-align: start; }

/* ======================================================================
   Buttons
   ====================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 11px 18px;
    border: 0;
    border-radius: var(--r);
    background: var(--card);
    box-shadow: var(--elev);
    font-weight: 600;
    font-size: 15.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .1s ease, background-color .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
/* The dark buttons press in: down a pixel, their bottom edge sinks away. */
.btn-primary:not(:disabled):active, .duel-hero-btn:not(:disabled):active { transform: translateY(1px) scale(.98); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(0, 0, 0, .2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-primary {
    background: var(--ink);
    color: var(--on-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .18), 0 4px 14px rgba(24, 23, 26, .14);
}
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn-wa svg { color: var(--wa); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 16.5px; border-radius: 16px; }
@media (hover: hover) and (pointer: fine) {
    /* The dark button in the duel panel has fixed colours (white text): it gets its own hover below */
    .btn:not(.btn-primary):not(.duel-hero-btn):not(:disabled):hover { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
    .btn-ghost:hover { background: var(--fill) !important; }
    .btn-primary:not(:disabled):hover { background: color-mix(in srgb, var(--paper) 12%, var(--ink)); }
    .duel-hero-btn:not(:disabled):hover { background: #2c2b30; }
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    transition: background-color .15s, transform .1s;
}
.icon-btn:active { transform: scale(.92); background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--fill); } }
.icon-btn svg { width: 22px; height: 22px; }

/* ======================================================================
   Home
   ====================================================================== */

/* The greeting on Spelen: a page heading like Duels has (.page-head), at the same height (.page) */
.hello { margin-top: 8px; }
/* A block on Spelen that didn't load (home.js): what went wrong, and try again */
.load-error { display: grid; justify-items: center; gap: 12px; padding: 22px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); color: var(--ink-2); text-align: center; }
.offline-card p { display: grid; gap: 4px; max-width: 30em; }
.offline-card b { color: var(--ink); font-size: 16px; }

.tile {
    --tile: #db4429;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 14px;
    padding: 18px 16px 16px 18px;
    border-radius: 24px;
    background: var(--tile);
    color: #fff;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .08);
}
.tile-spoor { --tile: #db4429; }
.tile-balans { --tile: #2a55d6; }
.tile-tuinen { --tile: #1f8a5b; }
.tile-kavels { --tile: #b5590e; } /* a shade deeper than its icon colour: white text on it reaches 4.8:1 */
.tile-zestal { --tile: #6a46cc; }
.tile-leidingen { --tile: #c2387a; }
.tile-bruggen { --tile: #14857f; }
.tile-lampen { --tile: #9b6b0a; } /* idem, 4.7:1 (the icon's #b07a0c gave 3.7) */
.tile h2, .tile h1 { font-family: var(--display); font-size: 34px; font-weight: 900; letter-spacing: -0.02em; }
.tile p { font-size: 15px; max-width: 22em; line-height: 1.35; margin-top: 4px; }
.tile .art { grid-row: 1; grid-column: 2; width: 84px; height: 84px; margin: -2px -2px 0 0; }
.tile-text { grid-row: 1; grid-column: 1; align-self: center; }
.levels { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.level {
    position: relative;
    display: grid;
    gap: 7px;
    justify-items: start;
    min-height: 66px;
    padding: 10px 12px;
    border: 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .12);
    color: #fff;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.1;
    transition: background-color .15s, transform .1s, color .15s;
}
.level small { display: block; font-weight: 500; font-size: 12.5px; opacity: .72; margin-top: 3px; }
.level:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .level:hover { background: rgba(255, 255, 255, .22); } }
.level.loading { background: #fff; color: var(--tile); }
/* Practice: first the game (grid), then the level in a dialog */
.practice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* A key to press: a touch lighter at the top, a darker edge at the bottom that sinks away when you tap. */
.practice-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 10px; border: 0; text-decoration: none; -webkit-tap-highlight-color: transparent; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--tile) 86%, #fff), var(--tile) 55%, color-mix(in srgb, var(--tile) 88%, #000)); color: #fff; font-weight: 750; font-size: clamp(11.5px, 3.6vw, 13.5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -3px 0 rgba(0, 0, 0, .16), 0 1px 2px rgba(0, 0, 0, .08); transition: transform .1s, box-shadow .1s; }
.practice-tile:active { transform: translateY(2px) scale(.97); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .16), 0 0 0 rgba(0, 0, 0, 0); }
.practice-tile .art { width: 50px; height: 50px; }
/* "Verras me" under the game tiles: a tile in their style (one colour, light top edge, darker bottom
   rim, pressed in), in ink like the main buttons: it can become any of them. */
.surprise-btn { justify-content: flex-start; gap: 12px; margin-top: 8px; padding: 12px 16px 14px; border-radius: 18px; text-align: left; white-space: normal; background: var(--ink); color: var(--on-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 -3px 0 rgba(0, 0, 0, .22), 0 1px 2px rgba(0, 0, 0, .08); transition: transform .1s, box-shadow .1s; }
.surprise-btn:not(:disabled):active { transform: translateY(2px) scale(.98); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(0, 0, 0, .22); }
@media (hover: hover) and (pointer: fine) { .surprise-btn:not(:disabled):hover { background: var(--ink) !important; filter: brightness(1.12); } }
.surprise-btn svg { width: 26px; height: 26px; flex: none; color: currentColor; }
.surprise-btn span { display: grid; gap: 1px; min-width: 0; line-height: 1.25; }
.surprise-btn b { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.surprise-btn small { font-size: 13px; font-weight: 500; opacity: .75; }
.practice-tile b { font-weight: 750; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-sheet { margin: -4px -4px 0; }
/* 8-kamp (octathlon.js): its button under Verras me, a card in the games' style (light, not ink: Verras
   me stays the main way in), its sheet and the run on a leg's result */
.octathlon-btn { justify-content: flex-start; gap: 12px; margin-top: 8px; padding: 12px 16px 14px; border-radius: 18px; text-align: left; white-space: normal;
    background: var(--card); color: var(--ink); box-shadow: var(--elev); transition: transform .1s; }
.octathlon-btn:not(:disabled):active { transform: translateY(2px) scale(.98); }
.octathlon-btn svg { width: 26px; height: 26px; flex: none; color: #e9a400; }
.octathlon-btn span { display: grid; gap: 1px; min-width: 0; line-height: 1.25; }
.octathlon-btn b { font-weight: 750; }
.octathlon-btn small { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.oc-legs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.oc-leg { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--fill); }
.oc-leg .oc-art { width: 78%; height: 78%; }
.oc-leg.todo .oc-art { opacity: .3; filter: grayscale(1); }
.oc-leg.now { box-shadow: inset 0 0 0 2px #e9a400; }
.oc-leg.quit .oc-art { opacity: .35; }
.oc-leg.quit::after { content: ""; position: absolute; inset: 22%; background: linear-gradient(45deg, transparent 46%, var(--bad) 46% 54%, transparent 54%); }
.oc-tick { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: var(--good); color: #fff; box-shadow: 0 0 0 2px var(--card); }
.oc-tick svg { width: 10px; height: 10px; }
.oc-card { margin: 16px 0 0; padding: 12px 14px 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); display: grid; gap: 10px; text-align: left; }
.oc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.oc-head b { font-weight: 800; }
.oc-head span { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.oc-meta { font-size: 13.5px; color: var(--ink-2); }
.oc-done-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.oc-done-head div { display: grid; gap: 1px; min-width: 0; }
.oc-done-head b { font-weight: 800; }
.oc-done-head span { font-size: 13px; color: var(--ink-3); }
.oc-done-head strong { font-family: var(--display); font-size: 34px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.oc-chip svg { width: 14px; height: 14px; }
.oc-chip.rec { color: var(--ink); background: color-mix(in srgb, #f3b82c 22%, var(--fill)); }
.oc-chip.rec svg { color: #c98d00; }
.oc-meta.rec { color: var(--good); font-weight: 700; }
.oc-sheet .lead { margin-bottom: 12px; }
.oc-open { display: grid; gap: 10px; margin: 0 0 16px; padding: 12px; border-radius: 16px; background: var(--fill); }
.oc-levels { margin-top: 4px; }
.oc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.oc-stats div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.oc-stats span { font-size: 12.5px; color: var(--ink-3); }
.oc-stats b { font-family: var(--display); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.oc-week-title { margin: 16px 0 6px; font-size: 15px; font-weight: 800; }
.oc-week { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 2px; }
.oc-week li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.oc-week li.me { background: color-mix(in srgb, #f3b82c 20%, transparent); }
.oc-rank { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.oc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.oc-week b { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.oc-week b small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.oc-none { margin: 0 0 14px; font-size: 14px; color: var(--ink-3); }
/* 8-kamp duel (octduel.js): the duel's page, its players with their legs, and the rows in a list */
/* The new-duel sheet's choice between rounds and an 8-kamp: right under the lead, before the rest */
.format-seg { margin: 4px 0 6px; }
/* An 8-kamp's ring (duels.js, legRingSvg): an arc per game in its colour, faint until you played that leg */
.leg-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-width: 3.2; stroke-linecap: round; pointer-events: none; }
.leg-ring circle { stroke: var(--tile); opacity: var(--ring-dim); }
.leg-ring circle.on { opacity: 1; }
/* An 8-kamp duel's row among the duels (octduelRowHtml): the faces as in a duel's row, a size smaller,
   inside the ring (the row keeps a face's 40 px: the ring reaches 2 px past it on each side) */
.od-ring { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -2px; }
.od-ring .faces { transform: scale(.78); }
/* (inside the ring no avatar frame: its glow and rim lay right over the arcs; the frame shows on the page and card) */
.od-ring .face.av { filter: none; }
.od-ring .face.av::before, .od-ring .face.av::after { display: none; }
.od-player.invited { opacity: .7; padding-bottom: 10px; }
/* The 8-kamp's page head (octduel.js): the duel's yellow tile, a round "8" where a duel has its VS */
.od-head-badge { position: relative; flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: #18171a; color: #f3b82c; font-family: var(--display); font-size: 30px; font-weight: 900; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
/* Its ring just inside the disc's edge, on the dark: the arcs you played in colour, the rest a faint trace */
.od-head-badge .leg-ring { inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.od-head-badge .leg-ring circle { opacity: .55; } /* (on its dark disc in both themes) */
.od-head-badge .leg-ring circle.on { opacity: 1; }
.od-page .od-players { margin-top: 0; }
.od-face { flex: none; display: grid; }
.od-face .face { width: 34px; height: 34px; margin: 3px; } /* (room for a frame's ring) */
.od-face[data-profile] { cursor: pointer; }
.od-players { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.od-player { padding: 10px 12px 12px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); display: grid; gap: 10px; }
.od-player.me { box-shadow: var(--elev), inset 0 0 0 2px color-mix(in srgb, #f3b82c 70%, transparent); }
.od-p-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.od-rank { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.od-rank.first { color: #c98d00; }
.od-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; font-weight: 750; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.od-name svg { width: 16px; height: 16px; flex: none; color: #c98d00; }
.od-name small { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
/* Playing a leg right now (octduel.js): the duel's green dot */
.od-name .od-live { display: inline-flex; align-items: center; color: var(--good); }
.od-name .od-live .live-dot { width: 7px; height: 7px; margin-right: 5px; }
.od-right { flex: none; display: grid; justify-items: end; gap: 1px; }
.od-total { font-family: var(--display); font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.od-total.muted { color: var(--ink-3); }
.od-right small { font-size: 12px; color: var(--ink-3); }
.od-legs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.od-legs li { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.od-legs .od-art { width: 100%; max-width: 30px; aspect-ratio: 1; }
.od-legs li.todo .od-art { opacity: .3; filter: grayscale(1); }
.od-legs small { font-size: 10.5px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.od-legs small.cap, .od-legs small.quit { color: var(--bad); }
.od-legs small i { display: block; font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 1.1; text-align: center; }
.od-player.dnf { opacity: .75; }
.od-help { margin-top: 18px; }
/* The "8" heading the help sheet (octduel.js showOctduelHelp), as a duel's VS badge heads its help */
dialog.sheet > .od-head-badge { margin-bottom: 10px; }
/* Loading a level: the text makes way for the spinner in the middle, so they never overlap */
.practice-sheet .level.loading > * { visibility: hidden; }
.practice-sheet .level.loading::after { left: 50%; right: auto; top: 50%; margin: -7px 0 0 -7px; }
.rules-inline { margin-top: 14px; }
.rules-inline summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 2px; font-weight: 650; color: var(--ink-2); list-style: none; }
.rules-inline summary::-webkit-details-marker { display: none; }
/* A small chevron (instead of the browser's triangle) that turns when the rules open */
.rules-inline summary::after { content: ""; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s, margin .2s; }
.rules-inline[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
/* Start of a duel round: two panels slam together, VS crashes down in between */
/* The backdrop is the app's own (light in light mode, under the light status bar; dark in dark mode) */
.vs-intro { --vs-a: #db4429; --vs-b: #2a55d6; position: fixed; inset: 0; z-index: 150; overflow: hidden; cursor: pointer; color: #fff; background: var(--paper); animation: vs-shake .4s linear .5s; }
/* One column as wide as the screen (minus padding): without it the column would grow with the
   names, and a long line of opponents would run off the left edge instead of being cut off. */
.vs-half { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); padding: 24px; }
.vs-half.top { background: linear-gradient(160deg, color-mix(in srgb, var(--vs-a) 80%, #fff), var(--vs-a) 60%); clip-path: polygon(0 0, 100% 0, 100% 42%, 0 54%); align-items: start; justify-items: start; padding-top: max(13vh, 64px); animation: vs-in-left .42s cubic-bezier(.7, 0, .3, 1.15) both; }
.vs-half.bottom { background: linear-gradient(340deg, color-mix(in srgb, var(--vs-b) 80%, #000), var(--vs-b) 60%); clip-path: polygon(0 56%, 100% 44%, 100% 100%, 0 100%); align-items: end; justify-items: end; padding-bottom: max(22vh, 150px); animation: vs-in-right .42s cubic-bezier(.7, 0, .3, 1.15) .08s both; }
.vs-who { display: flex; align-items: center; gap: 14px; max-width: 100%; min-width: 0; }
.vs-half.bottom .vs-who { flex-direction: row-reverse; }
.vs-who b { font-family: var(--display); font-size: clamp(26px, 8vw, 40px); font-weight: 900; letter-spacing: -0.02em; line-height: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.vs-half.top .vs-who { animation: vs-who-in .5s cubic-bezier(.2, 1.4, .4, 1) .3s both; }
.vs-half.bottom .vs-who { animation: vs-who-in .5s cubic-bezier(.2, 1.4, .4, 1) .4s both; }
.vs-who .face, .vs-who .faces { width: 76px; height: 76px; font-size: 34px; flex: none; }
/* Several opponents: their names on up to two lines, a bit smaller */
.vs-who.many b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: clamp(22px, 6.4vw, 32px); line-height: 1.05; text-align: right; overflow-wrap: anywhere; }
.vs-intro .vs-who .face { background: #fff; color: var(--vs-a); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.vs-intro .vs-half.bottom .vs-who .face { color: var(--vs-b); }
.vs-intro .vs-who .faces.two .face { width: 52px; height: 52px; font-size: 22px; box-shadow: 0 0 0 3px var(--vs-b); }
.vs-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: vs-flash .45s ease-out .5s; }
.vs-mid { position: absolute; left: 0; right: 0; top: 49%; transform: translateY(-50%) rotate(-6deg); display: grid; justify-items: center; pointer-events: none; }
.vs-word { font-family: var(--display); font-size: clamp(88px, 30vw, 150px); font-weight: 900; font-style: italic; line-height: .8; letter-spacing: -0.05em; color: #fff; -webkit-text-stroke: 3px #0d0d0f; paint-order: stroke fill; text-shadow: 6px 6px 0 #f3b82c, 0 0 40px rgba(243, 184, 44, .55); animation: vs-slam .38s cubic-bezier(.5, 0, .6, 1.4) .45s both; }
.vs-round { margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: #0d0d0f; color: #f3b82c; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; opacity: 0; animation: vs-rise .4s cubic-bezier(.2, 1.3, .4, 1) .85s forwards; }
.vs-foot { position: absolute; left: 0; right: 0; bottom: max(5vh, 24px); display: grid; justify-items: center; gap: 12px; padding: 0 16px; }
.vs-game { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 999px; background: #fff; color: #18171a; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; animation: vs-rise .5s cubic-bezier(.2, 1.3, .4, 1) 1.15s forwards; }
.vs-game .r-icon { width: 40px; height: 40px; }
.vs-game span { display: grid; line-height: 1.2; color: #5c5a60; font-size: 14px; }
.vs-game b { color: #18171a; font-size: 18px; font-weight: 800; }
.vs-tap { font-size: 13px; color: rgba(255, 255, 255, .8); text-align: center; opacity: 0; animation: appear .5s ease 1.6s forwards; }
.vs-intro.leaving { cursor: default; }
/* "Verras me": a slot machine (game.js, surpriseIntro). --tile comes from .tile-<game>. In the colours
   of the theme: paper and ink, frame and sparks in ink. */
.sp-intro { --sp-line: color-mix(in srgb, var(--ink) 22%, transparent); position: fixed; inset: 0; z-index: 150; display: grid; place-content: center; justify-items: center; gap: 20px; padding: 24px; color: var(--ink); background: var(--paper); cursor: pointer; overflow: hidden; animation: fade .2s ease both; }
.sp-intro::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(circle at 50% 45%, var(--tile), transparent 55%); opacity: .12; transition: opacity .45s ease; pointer-events: none; }
.sp-intro.landed::before { opacity: .6; }
.sp-kicker { position: relative; display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lu-gold); font-size: 14px; }
/* The reel: one slot in the middle, the icons above and below fading out as they slide past. */
.sp-window { position: relative; width: calc(var(--h) + 24px); height: calc(var(--h) * 2.1); overflow: hidden;
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.sp-reel { display: grid; justify-items: center; gap: var(--gap); padding-top: calc((var(--h) * 2.1 - var(--h)) / 2); will-change: transform; }
.sp-reel .r-icon { display: block; width: var(--h); height: var(--h); }
.sp-stage { --h: 132px; --gap: 16px; position: relative; } /* sizes for the window, the slot frame and the sparks */
.sp-slot { position: absolute; left: 50%; top: 50%; width: calc(var(--h) + 12px); height: calc(var(--h) + 12px); margin: calc((var(--h) + 12px) / -2) 0 0 calc((var(--h) + 12px) / -2); border-radius: 38px; box-shadow: 0 0 0 3px var(--sp-line); pointer-events: none; }
/* A few sparks out of the slot when it lands (game.js) */
.sp-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.sp-burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2.5px; background: var(--tile); opacity: 0; animation: sp-spark .9s forwards; }
.sp-burst i:nth-child(3n) { background: var(--yellow); border-radius: 50%; }
.sp-burst i:nth-child(3n + 1) { background: var(--ink); }
/* Out fast and slowing down, visible until 70%, then fading. */
@keyframes sp-spark {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(-76px) scale(var(--s)); animation-timing-function: cubic-bezier(.15, .75, .3, 1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-76px - var(--d))) scale(calc(var(--s) * .4)) rotate(140deg); }
}
.sp-intro.landed .sp-slot { animation: sp-slot .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes sp-slot { 0% { box-shadow: 0 0 0 3px var(--sp-line); transform: scale(1); } 35% { transform: scale(1.08); box-shadow: 0 0 0 4px var(--ink), 0 0 46px 6px var(--tile); } 100% { transform: scale(1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 60%, transparent), 0 0 34px 2px color-mix(in srgb, var(--tile) 80%, transparent); } }
.sp-what { position: relative; display: grid; justify-items: center; gap: 8px; min-height: 84px; }
.sp-name { font-family: var(--display); font-size: 44px; font-weight: 900; letter-spacing: -0.02em; line-height: 1; opacity: 0; }
.sp-intro.landed .sp-name { opacity: 1; }
.sp-intro.landed .sp-name { animation: vs-rise .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.sp-tap { position: absolute; left: 0; right: 0; bottom: max(5vh, 24px); text-align: center; color: var(--ink-2); }
.sp-intro.leaving { cursor: default; }
.sp-intro.leaving > * { animation: fade-out .2s ease forwards; }
.sp-intro.out { animation: fade-out .3s ease forwards; pointer-events: none; }
.vs-intro.leaving .vs-half.top { animation: vs-out-left .38s cubic-bezier(.6, 0, .8, .4) forwards; }
.vs-intro.leaving .vs-half.bottom { animation: vs-out-right .38s cubic-bezier(.6, 0, .8, .4) forwards; }
.vs-intro.leaving .vs-mid { animation: vs-burst .3s ease-in forwards; }
.vs-intro.leaving .vs-foot { animation: fade-out .2s ease forwards; }
.vs-intro.out { animation: fade-out .3s ease forwards; pointer-events: none; }
@keyframes vs-in-left { from { transform: translateX(-105%); } }
@keyframes vs-in-right { from { transform: translateX(105%); } }
@keyframes vs-out-left { to { transform: translateX(-105%); } }
@keyframes vs-out-right { to { transform: translateX(105%); } }
@keyframes vs-who-in { from { opacity: 0; transform: scale(.6); } }
@keyframes vs-slam { from { opacity: 0; transform: scale(3.2) rotate(8deg); } 70% { opacity: 1; } }
@keyframes vs-flash { 0% { opacity: 0; } 15% { opacity: .75; } 100% { opacity: 0; } }
@keyframes vs-shake { 0%, 100% { transform: none; } 20% { transform: translate(-7px, 4px); } 40% { transform: translate(6px, -5px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 3px); } }
@keyframes vs-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes vs-burst { to { opacity: 0; transform: translateY(-50%) rotate(-6deg) scale(1.6); } }
/* Race intro (game.js raceIntro): a starting grid with lights instead of VS. On the app's own ground (light
   in light mode, dark in dark), with a warm glow from the top; the lights stay a dark housing, as real ones. */
.rc-intro { position: fixed; inset: 0; z-index: 150; display: grid; grid-template-columns: minmax(0, 420px); place-content: center; justify-items: center; gap: 18px; padding: 24px 24px 150px; overflow: hidden; cursor: pointer; color: var(--ink);
    background: radial-gradient(120% 55% at 50% 0%, color-mix(in srgb, var(--yellow) 22%, transparent), transparent 60%), var(--paper); animation: fade .2s ease both; }
.rc-kicker { display: inline-flex; align-items: center; gap: 6px; color: color-mix(in srgb, var(--yellow) 55%, var(--ink)); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; animation: fade-in .3s ease both; }
.rc-kicker svg { width: 17px; height: 17px; }
.rc-lights { display: flex; gap: 14px; padding: 12px 18px; border-radius: 999px; background: #1c1b20; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 30px rgba(0, 0, 0, .25); animation: vs-rise .4s cubic-bezier(.2, 1.3, .4, 1) .1s both; }
.rc-lights i { width: 38px; height: 38px; border-radius: 50%; background: #2c2b31; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .55); transition: background-color .06s, box-shadow .06s; }
.rc-lights i.on { background: #ff3b30; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25), 0 0 22px rgba(255, 59, 48, .8); }
.rc-intro.green .rc-lights i { background: #34c759; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .2), 0 0 26px rgba(52, 199, 89, .85); }
.rc-go { font-family: var(--display); font-size: clamp(40px, 13vw, 60px); font-weight: 900; line-height: 1; letter-spacing: -0.02em; color: var(--good); opacity: 0; transform: scale(.6); }
.rc-intro.green .rc-go { animation: rc-go .35s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.rc-lanes { display: grid; gap: 8px; justify-self: stretch; }
.rc-lane { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 14px 10px 24px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px var(--line); overflow: hidden; opacity: 0; animation: rc-lane-in .45s cubic-bezier(.2, 1.2, .4, 1) .15s forwards; }
.rc-lane.them { animation-delay: .23s; }
/* The chequered start line on the left */
.rc-lane::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 10px; background: repeating-conic-gradient(#fff 0 25%, #18171a 0 50%) 0 0 / 10px 10px; opacity: .85; }
.rc-lane.me { box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 75%, transparent); }
.rc-lane .face { width: 46px; height: 46px; font-size: 20px; flex: none; }
.rc-id { display: grid; min-width: 0; line-height: 1.15; }
.rc-id b { font-family: var(--display); font-size: 20px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-id small { font-size: 13px; color: var(--ink-3); }
.rc-intro .vs-game { animation-delay: .5s; }
.rc-intro .vs-tap { animation-delay: .9s; color: var(--ink-3); }
.rc-intro .vs-game { background: var(--card); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .12), inset 0 0 0 1px var(--line); }
.rc-intro .vs-game span { color: var(--ink-2); }
.rc-intro .vs-game b { color: var(--ink); }
/* Off they go: both dash out of their lane, the lights and the rest fade */
.rc-intro.leaving { cursor: default; }
.rc-intro.leaving .rc-lane .face, .rc-intro.leaving .rc-id { animation: rc-dash .34s cubic-bezier(.6, 0, .85, .3) forwards; }
.rc-intro.leaving .rc-lane.them .face, .rc-intro.leaving .rc-lane.them .rc-id { animation-delay: .04s; }
.rc-intro.leaving .rc-lights, .rc-intro.leaving .rc-kicker, .rc-intro.leaving .vs-foot { animation: fade-out .25s ease forwards; }
.rc-intro.out { animation: fade-out .3s ease forwards; pointer-events: none; }
@keyframes rc-lane-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes rc-go { to { opacity: 1; transform: none; } }
@keyframes rc-dash { to { transform: translateX(110vw); } }
/* Week strip below the daily puzzle */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: -2px 2px 12px; }
.ws { display: grid; justify-items: center; gap: 3px; }
.ws i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--line-2); font-style: normal; }
.ws small { font-size: 11px; font-weight: 650; color: var(--ink-3); }
.ws-played i { background: var(--streak); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 70%, transparent); }
.ws-played i svg { width: 14px; height: 14px; }
.ws i .flame { display: block; margin: 0; vertical-align: 0; } /* without the spacing the flame has next to text */
.ws-pause i { box-shadow: inset 0 0 0 1.5px var(--ink-3); background: var(--fill); }
.ws-pause i b { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.ws-missed i { opacity: .75; }
.ws-future i, .ws-before i { opacity: .6; }
/* New player: one clear starting point */
.surprise-btn.start-here { box-shadow: 0 0 0 2px var(--yellow), var(--elev); }
/* A new player: Verras me at the top of Spelen (home.js, viewHome), a part of its own above the daily puzzles */
.surprise-btn.surprise-top { margin: 0 0 28px; }
/* "Begin hier" for a new player: right after "Verras me", on its title line. */
.dt-start { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--yellow); color: #161513; font-size: 11.5px; font-weight: 800; font-style: normal; line-height: 1.35; white-space: nowrap; animation: dt-start 1.6s ease-in-out infinite; }
@keyframes dt-start { 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .dt-start { animation: none; } }
.ws.is-today small { color: var(--ink); }
.ws-today i { position: relative; box-shadow: inset 0 0 0 2px var(--ink); }
/* Today pulses: a yellow ring that fades in and out (only its opacity moves: no repaint every frame) */
.ws-today i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 40%, transparent); opacity: 0; pointer-events: none; animation: ws-pulse 1.8s ease-in-out infinite; }
@keyframes ws-pulse { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ws-today i::after { animation: none; } }
/* Day standings + share side by side, week standings below */
.daily-bar { display: flex; gap: 8px; margin-top: 10px; }
.daily-bar .daily-score { margin-top: 0; flex: 1; min-width: 0; }
.daily-share { flex: none; display: grid; place-items: center; width: 46px; border: 0; border-radius: var(--r); background: var(--card); box-shadow: var(--elev); color: var(--ink); transition: transform .1s; }
.daily-share:active { transform: scale(.94); }
.daily-share svg { width: 19px; height: 19px; }
.week-list { list-style: none; margin: 14px 0 0; padding: 0; }
.week-list li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line); }
/* Pace rows (richttijden) in the daily leaderboards: a marker, not a player */
.lb li.pace, .week-list li.pace { min-height: 0; padding-top: 6px; padding-bottom: 6px; border-top-style: dashed; color: var(--ink-3); }
.lb li.pace + li, .week-list li.pace + li { border-top-style: dashed; }
.pace-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--ink-3) 70%, transparent); }
.pace-ic svg { width: 16px; height: 16px; }
/* (a little smaller than a player's name: secondary, and "Gemiddelde speler" was cut off on a 320 px screen) */
.lb li.pace .nm, .week-list li.pace .wl-name { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.lb li.pace .sub { display: block; font-size: 12px; color: var(--ink-3); }
.lb li.pace .t, .week-list li.pace b { font-weight: 650; color: var(--ink-2); }
.week-list li.me { background: color-mix(in srgb, var(--yellow) 14%, transparent); border-radius: 10px; }
/* No dividing line on your own row's rounded edges (above or below): its colour sets it apart already */
.week-list li.me, .week-list li.me + li { border-top-color: transparent; }
.wl-rank { width: 20px; text-align: center; font-weight: 750; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.week-list .face { width: 30px; height: 30px; font-size: 13px; flex: none; }
.wl-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-name small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.week-list b { font-size: 17px; font-variant-numeric: tabular-nums; }
.week-list b small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.week-list .secret { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.week-list .secret svg { width: 13px; height: 13px; }
/* Name field: message below it and the checkbox for the daily leaderboard */
.name-form { display: grid; gap: 0; }
/* A field right under the explanation (the name dialogs, joining the standings): room between them, as the
   feedback field and the code field have */
.lead + :is(form, .name-form) { margin-top: 16px; }
/* And after the name block (it ends with the switch "Voornaam zichtbaar") the next step gets the same
   16px: the start page of a puzzle and joining the standings (a form with gap 12), the box under your
   time on the result (a grid with gap 8) */
.landing form:has(> .name-form) { gap: 16px; }
.name-box .check + .btn { margin-top: 8px; }
.name-box .check { margin-top: 4px; } /* (with the grid's 8px: 12px under the field, as elsewhere) */
.name-error { min-height: 0; margin: 6px 4px 0; font-size: 13.5px; font-weight: 600; color: var(--bad); }
.name-error:empty { display: none; }
/* Setting next to a field (e.g. show my name): text left, a switch right, like the settings menu */
.check, .field label.check { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--fill); text-align: left; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.check small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); line-height: 1.35; }
.check input { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--fill-2); cursor: pointer; transition: background-color .2s; }
.check input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease-out); }
.check input:checked { background: var(--good); }
.check input:checked::after { transform: translateX(18px); }
.check input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.name-box .name-form { display: grid; gap: 8px; }
/* Without duel partners: everyone's boards, with this invitation below them */
/* The standings sheet: today or this week */
.st-switch { margin-top: 14px; }
/* The date line belongs to the list under it: closer to that than to the switch above */
dialog.sheet .st-pane .lead:first-child { margin-top: 14px; }
.st-pane .lead:first-child + .ds-list, .st-pane .lead:first-child + .week-list, .st-pane .lead:first-child + .st-alone { margin-top: 8px; }
/* Switching: the lists slide side by side (standings.js slidePane), up to the sheet's edges */
.st-pane.sliding { position: relative; overflow: clip; margin-inline: calc(-1 * var(--sheet-pad, 20px)); padding-inline: var(--sheet-pad, 20px); }
.st-pane .slide-out { position: absolute; top: 0; left: var(--sheet-pad, 20px); right: var(--sheet-pad, 20px); pointer-events: none; }
/* The top margin of the list that slides away: in the pane it falls outside it (collapsed), loose it would push the list down 14px as it starts to slide */
dialog.sheet .st-pane .slide-out > :first-child { margin-top: 0; }
.ds-note { font-size: 13.5px; }
/* Nobody in your standings yet: an invitation instead of a list (standings.js, aloneHtml) */
/* Everyone's standings above the invitation (a new player, standings.js everyoneHtml): the title as a
   board's, its list right under it, and the invitation a part of its own */
.st-pane .st-everyone { margin-inline: 0; } /* in line with the date above it (a board's title steps in 4px, with its cards) */
.st-pane .lead:first-child + .st-everyone { margin-top: 18px; }
.st-everyone + .week-list { margin-top: 0; }
.week-list + .st-alone { margin-top: 20px; }
.st-alone { display: grid; justify-items: center; gap: 8px; margin-top: 14px; padding: 22px 18px 18px; border-radius: var(--r); background: var(--fill); text-align: center; }
.st-alone .faces { --ring: var(--fill); width: 52px; height: 52px; margin-bottom: 4px; }
.st-alone .faces.two .face { width: 36px; height: 36px; font-size: 15px; }
.st-alone h3 { font-family: var(--display); font-size: 20px; font-weight: 850; letter-spacing: -0.01em; }
.st-alone p { font-size: 14.5px; color: var(--ink-2); text-wrap: balance; }
.st-alone .btn { margin-top: 8px; }
/* Result: narrow margin, and a streak milestone */
/* (the moments of the result page pop in one by one with their chime: result.js adds .go) */
.streak-line.milestone { padding: 8px 16px; font-size: 18px; background: color-mix(in srgb, var(--yellow) 55%, var(--card)); }
.streak-line.milestone:not(.go), .all-daily:not(.go), .record-line.fresh:not(.go) { opacity: 0; }
.streak-line.milestone.go { animation: pop-move .8s var(--spring) both, fade-in 0.3s ease both; }
.feedback-text { width: 100%; margin-top: 14px; resize: vertical; min-height: 120px; font: inherit; line-height: 1.4; }
/* Result: all daily puzzles done */
.all-daily { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 30%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 60%, transparent); font-size: 14.5px; }
.all-daily.go { animation: pop-move .7s var(--spring) both, fade-in 0.3s ease both; }
.all-daily svg { width: 18px; height: 18px; flex: none; }
/* A button waiting for the server (busyButton in core.js): a small spinner at its right edge, and no
   second tap. Floating, so the button keeps its size and its label stays put: in the flow it became a
   third line under a two-line button ("Volgende verrassing") and pushed Verras me's text onto another
   line. (The level tiles have their own, .level.loading below.) */
.busy:has(> .btn-spin) { position: relative; }
.btn-spin { position: absolute; top: 50%; right: 16px; width: 15px; height: 15px; margin-top: -7.5px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: spin .7s linear infinite; }
.busy { pointer-events: none; }
/* A narrow button ("Race terug") has no room beside its label: the spinner takes the label's place, in
   the middle, and the button keeps its size. (Text hidden by its fill: the spinner keeps the text colour.) */
.btn:not(.btn-block):has(> .btn-spin) { -webkit-text-fill-color: transparent; }
.btn:not(.btn-block):has(> .btn-spin) > :not(.btn-spin) { visibility: hidden; }
.btn:not(.btn-block) > .btn-spin { right: auto; left: 50%; margin-left: -7.5px; }
.unplayed-btn .btn-spin { top: 7px; right: 7px; width: 12px; height: 12px; margin-top: 0; }
.level.loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}
/* Compact game card on the home screen: icon, name and description, with the three levels below. */
.tile.game-card { grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; padding: 14px 14px 14px 14px; border-radius: 22px; }
.game-card .art { grid-row: 1; grid-column: 1; align-self: center; width: 54px; height: 54px; margin: 0; }
.game-card .tile-text { grid-row: 1; grid-column: 2; }
.game-card h2 { font-size: 24px; line-height: 1.05; }
.game-card p {
    margin-top: 3px;
    font-size: 13.5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* (two cut off the longer ones on a phone: "Cijfers en vorme...") */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card .levels { margin-top: 12px; gap: 6px; }
.game-card .level { min-height: 0; padding: 8px 11px; gap: 0; font-size: 14px; border-radius: 12px; }
.game-card .level small { font-size: 11.5px; margin-top: 2px; }
.game-card .level .pips { display: none; }
.game-card .level.loading::after { top: 50%; margin-top: -7px; }
/* Someone else started the round just before you */
.beaten {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 12px 0 10px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: color-mix(in srgb, var(--yellow) 22%, var(--card));
    box-shadow: var(--elev);
    font-size: 14.5px;
    line-height: 1.4;
    animation: fade-in .3s ease both;
}
.beaten b { display: block; }
.beaten svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
/* Personal record, archive, rematch */
.record-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--good) 16%, var(--card)); color: var(--ink); font-size: 14.5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
.record-line svg { width: 18px; height: 18px; color: var(--good); flex: none; }
.record-line.fresh.go { animation: pop-move .7s var(--spring) both, fade-in 0.3s ease both; }
.clean-line { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-wrap: balance; margin-top: 10px; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--blue) 14%, var(--card)); color: var(--ink); font-size: 14.5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 40%, transparent); }
.clean-line svg { width: 18px; height: 18px; color: var(--blue); flex: none; }
.clean-line.soft { background: var(--fill); box-shadow: none; color: var(--ink-2); }
.clean-line.soft svg { color: var(--ink-3); }
.clean-mark { color: var(--blue); font-weight: 650; }
/* Pills on the result screen: same height and alignment, neatly side by side (or stacked) */
.result-pills { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; }
.result-pills > p, .result-pills > button { display: inline-flex; align-items: center; gap: 7px; height: 36px; margin: 0; padding: 0 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; line-height: 1; white-space: nowrap; }
.result-pills > p b, .result-pills > button b { font-weight: 700; }
.result-pills > p svg, .result-pills > button svg { width: 17px; height: 17px; flex: none; }
.result-pills > .streak-line.milestone { height: 42px; padding: 0 18px; font-size: 17px; }
.daily-side { display: flex; align-items: center; gap: 6px; flex: none; }
.daily-more { position: relative; padding: 5px 11px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s, transform .1s; }
/* Small pill, but a thumb-high tap target */
.daily-more::after { content: ""; position: absolute; inset: -7px -3px; }
.daily-more:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .daily-more:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); } }
.archive-head { justify-content: flex-start; gap: 4px; }
.archive-head .icon-btn { margin-left: -10px; }
.archive-note { margin: 6px 4px 4px; color: var(--ink-3); font-size: 14px; }
.archive-day .section-title { margin-top: 22px; flex-wrap: wrap; row-gap: 4px; }
/* The date gets the whole line; level and "telt voor de weekstand" go underneath */
.archive-day .section-title small { flex-basis: 100%; display: flex; align-items: center; gap: 8px; margin: 0; }
.link-btn.other-game { display: flex; width: fit-content; margin: 12px auto 0; }
/* Exactly in the middle between the buttons above and the next part (28px apart without this line):
   20px above, and -8px below makes 20px to that part's 28px. */
.next-info { margin: 20px 0 -8px; } /* (the rest: with .stat, further down) */
.next-info:empty { display: none; }
/* Recently played: paused puzzle */
.r-resume { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 700; }
/* Button with a second line (Revanche · nog een keer Lampen) */
#next:has(.btn-sub), .btn:has(> .btn-sub) { flex-direction: column; gap: 1px; }
.btn-main { display: inline-flex; align-items: center; gap: 8px; }
/* New duel: with whom, and pick yourself or surprise */
.picker-note { margin: 8px 4px 0; font-size: 13.5px; color: var(--ink-3); }
/* The note under the number of rounds: both texts in one cell, the other one invisible (duels.js, lenNote) */
.len-note { display: grid; }
.len-note > span { grid-area: 1 / 1; }
.len-note > [aria-hidden="true"] { visibility: hidden; }
.picker-note.big { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; padding: 14px; border-radius: var(--r); background: var(--fill); color: var(--ink-2); font-size: 14.5px; line-height: 1.4; }
.picker-note.big svg { flex: none; width: 28px; height: 28px; color: var(--ink); }
.field-label small { font-weight: 500; color: var(--ink-3); }
.who-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* 8px: search and chips are one group, in New duel and on a duel page (Nodig nog iemand uit). (Also with
   dialog.sheet in front: dialog.sheet .input further down sets 2px and would win.) */
.input.who-search, dialog.sheet .input.who-search { margin-bottom: 8px; }
.who-none { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.who-more { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1.5px var(--line); }
.who-more:active { transform: scale(.96); }
.who-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px 6px 6px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink); font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1.5px transparent; transition: background-color .15s, box-shadow .15s, transform .1s; }
.who-chip .face { width: 28px; height: 28px; font-size: 13px; }
.who-chip .sk.face { border-radius: 50%; } /* a placeholder chip (whoSkeletonHtml) */
.who-chip:active { transform: scale(.96); }
.who-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--yellow) 30%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--ink); }
/* Duel list in groups */
.old-duels { margin-top: 22px; }
/* Result screen: the solved puzzle, folded away */
.sol-box { margin-top: 28px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.sol-box summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 650; }
.sol-box summary::-webkit-details-marker { display: none; }
.sol-box summary span { flex: 1; }
.sol-box summary svg { width: 20px; height: 20px; color: var(--ink-2); }
.sol-box summary svg:last-child { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; }
.sol-box[open] summary svg:last-child { transform: rotate(90deg); }
.sol-board { width: min(340px, 100%); margin: 0 auto; padding: 6px 16px 0; pointer-events: none; } /* room for the board's outer rim at the top */
/* Under the board as far as the title above it (14px), and as much again to the edge.
   (.sol-box .sol-later: .hint-note further down set 4px and won.) */
.sol-box .sol-toggle { display: flex; width: fit-content; margin: 14px auto; }
.sol-box .sol-later { margin: 14px 16px; text-align: center; }
.sol-board .z-pad, .sol-board .controls { display: none; } /* only the board: no keypad */
.welcome-list { display: grid; gap: 16px; margin: 18px 0 0; padding: 0; list-style: none; }
.welcome-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.welcome-list h3 { font-size: 16px; font-weight: 700; }
.welcome-list p { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }
.wl-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--fill-2); color: var(--ink); }
.wl-ic svg { width: 20px; height: 20px; }
.wl-ic.daily { background: color-mix(in srgb, var(--red) 14%, var(--card)); }
.wl-ic.daily .flame { margin: 0; width: 20px; height: 20px; }
.welcome-list .vs-badge { box-shadow: none; }
.home-none { margin: 2px 4px 0; color: var(--ink-2); font-size: 15px; }
.past-link { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); color: var(--ink); font-weight: 650; text-decoration: none; }
.past-link > svg:first-child { width: 20px; height: 20px; flex: none; color: #e0a400; }
.past-link span { flex: 1; }
.past-link small { color: var(--ink-3); font-weight: 600; }
.past-link > svg:last-child { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.past-link + .past-link { margin-top: 8px; } /* past duels and races: one group */
.page-head + .past-link { margin-top: 0; } /* right under the title (no duels yet): the head's 14px, as a card elsewhere */
.past-link.race-link > svg:first-child { color: var(--ink); }
/* The race page: rating and record, the start button, then every race */
/* A race back (from a notification): above the rest, with who it is */
.race-back { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 12px; margin-bottom: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev), inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 70%, transparent); }
.race-back .face { width: 48px; height: 48px; font-size: 20px; }
.rb-text { display: grid; gap: 2px; min-width: 0; }
.rb-text b { font-size: 17px; line-height: 1.25; }
.rb-text span { font-size: 13.5px; color: var(--ink-3); }
.race-back .race-start { grid-column: 1 / -1; }
.race-back-none { margin: 0 4px 14px; }
.race-hero { display: grid; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.race-hero .race-kpis { margin-top: 0; } /* (.prof-kpis, further down, has its own margin) */
.race-start { gap: 8px; background: var(--yellow); color: #18171a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .08); }
.race-start svg { width: 20px; height: 20px; stroke-width: 2.2; }
@media (hover: hover) and (pointer: fine) { .race-start:not(:disabled):hover { background: var(--yellow) !important; filter: brightness(1.05); } }
.race-hero .race-how { justify-self: center; margin: -8px 0 -6px; } /* text 12px under the button, 16px above the edge */
/* Your rating: the number in the yellow pill as under faces everywhere (outlined while provisional);
   tapping it goes to its graph on Jij. Wins and losses below it, two tiles. */
.race-rating { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.rr-pill { flex: none; min-width: 64px; padding: 6px 12px; border-radius: 999px; background: var(--yellow); color: #18171a; text-align: center; font-family: var(--display); font-size: 20px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rr-pill.prov { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--yellow) 75%, transparent); }
.rr-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.race-hero .race-kpis { grid-template-columns: 1fr 1fr; }
.rr-text b { font-size: 16px; font-weight: 700; }
.rr-text small { font-size: 13px; color: var(--ink-3); }
.race-rating > svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.race-rating:active { opacity: .7; }
.race-row .r-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Your races | Tegen jou: a switch instead of two lists one under the other */
.race-tabs { margin: 26px 0 2px; }
.race-tabs small { margin-left: 4px; font-size: .85em; font-weight: 600; color: var(--ink-3); }
.race-page [data-pane] > .section-title:first-child, .race-page [data-pane] > .recent:first-child { margin-top: 18px; }
/* Races against you (race.js): like a row of the list, with "Race terug" on the right */
.recent .vs-me { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border-top: 1px solid var(--line); }
.recent .vs-me:first-child { border-top: 0; }
.recent .vs-me[hidden] { display: none; }
.vs-me .face { width: 40px; height: 40px; flex: none; }
.vs-me.lost .r-title { color: var(--ink); }
.vs-me .vm-back { flex: none; min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 999px; }
.race-empty { margin-top: 28px; text-align: center; }
.rr-res { display: grid; justify-items: end; flex: none; line-height: 1.15; }
.rr-res b { font-family: var(--display); font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; }
.rr-res small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.rr-res.won b { color: var(--good); }
.rr-res.lost b, .rr-res.quit b { color: var(--bad); }
.rr-res.zero b { color: var(--ink); } /* won or lost, but the rating stayed the same */
.rr-resume { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--card); font-size: 13px; font-weight: 700; }
.past-more { margin-top: 16px; }
.past-sum { text-align: center; margin-top: 18px; }
.old-duels summary { cursor: pointer; padding: 10px 4px; font-weight: 650; color: var(--ink-2); list-style: none; }
.old-duels summary::-webkit-details-marker { display: none; }
.old-duels summary small, .section-title small { font-family: var(--font); font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
/* Day standings: bar below the daily puzzles, and the overview */
.daily-score {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 11px 14px;
    border: 0;
    border-radius: var(--r);
    background: var(--card);
    box-shadow: var(--elev);
    color: var(--ink-2);
    font-size: 14px;
    line-height: 20px; /* 42px high, as its skeleton (.sk-rowbar): with the font's own line height it was 42.3 */
    text-align: left;
    transition: transform .1s;
}
.daily-score:active { transform: scale(.985); }
.daily-score > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-score b { color: var(--ink); }
.daily-score > svg { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.daily-score > svg:first-child { color: var(--yellow); }
@media (max-width: 359px) { .daily-score .sl-head { display: none; } } /* (standLine) */
/* Last week's result is waiting (standLine, recapPending): the line lights up until you looked. */
.daily-score:has(.sl-recap) { background: color-mix(in srgb, var(--yellow) 22%, var(--card)); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 70%, transparent); }
.daily-score:has(.sl-recap) > svg:last-child { color: var(--ink); }
/* Day standings: one line per duel partner, a pip per daily puzzle */
.ds-list { margin: 14px -4px 0; padding: 0 4px; }
.ds-row { border-top: 1px solid var(--line); }
.ds-row summary { display: flex; align-items: center; gap: 8px; padding: 9px 6px; cursor: pointer; list-style: none; } /* as .week-list li: ranks and points line up with your own row */
.ds-row summary::-webkit-details-marker { display: none; }
.ds-row .face { width: 28px; height: 28px; font-size: 12px; flex: none; }
/* Name on top, the pips under it: the name gets the whole width (so long names aren't cut off) */
.ds-who { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ds-name { min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.ds-pips { display: flex; gap: 3px; }
.pip { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); vertical-align: -1px; }
.pip.win { background: var(--good); box-shadow: none; }
.pip.lose { background: var(--bad); box-shadow: none; border-radius: 50%; }
.pip.tie { background: var(--ink-3); box-shadow: none; }
.pip.hidden { background: var(--fill-2); box-shadow: none; }
.pip.none { box-shadow: inset 0 0 0 1.5px var(--line-2); } /* (thinner and fainter, it would be hard to see) */
/* Ranked as the week (wl-rank, points); your own row as there, highlighted */
.ds-row .wl-rank { flex: none; }
.ds-pts { flex: none; font-size: 17px; font-variant-numeric: tabular-nums; }
.ds-pts small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.ds-me { border-radius: 10px; background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.ds-me + .ds-row, .ds-row.gap { border-top-color: transparent; }
.ds-sum { display: flex; align-items: center; gap: 8px; padding: 9px 6px; }
.ds-sub { font-size: 12px; color: var(--ink-3); line-height: 1.2; }
/* Who already played, before you did (standings.js, dayHtml): how many, where the points would be */
.ds-count { flex: none; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ds-detail { list-style: none; margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--fill); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ds-detail li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 56px 56px; align-items: center; gap: 8px; padding: 3px 0; }
.ds-detail li > span { text-align: right; }
.ds-detail .r-icon { width: 22px; height: 22px; }
.ds-detail b { font-weight: 600; }
.ds-detail .ds-head { font-size: 11.5px; color: var(--ink-3); font-weight: 650; }
.ds-detail .ds-head span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-detail .best { color: var(--good); font-weight: 700; }
.ds-detail .none { color: var(--ink-3); }
.ds-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.ds-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
/* Daily puzzles as a grid: four per row, everything at a glance */
.daily-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.daily-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 4px 9px; border-radius: 16px; background: var(--card); box-shadow: var(--elev); color: var(--ink); text-decoration: none; text-align: center; transition: transform .1s; }
.daily-tile:active { transform: translateY(1px) scale(.97); }
.daily-tile .r-icon { width: 38px; height: 38px; margin-bottom: 2px; }
/* Fixed line heights: every tile 100px high, played (a time) or not, as its skeleton (.sk-tile). With the
   font's own line heights a time made a tile 1.5px taller than "Spelen", and the skeleton was neither. */
.daily-tile b { font-size: clamp(11.5px, 3.47vw, 13px); font-weight: 650; line-height: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-tile .dt-time { font-size: 13.5px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--good); }
.daily-tile .dt-go { font-size: 12.5px; line-height: 18px; font-weight: 600; color: var(--ink-3); }
.daily-tile .dt-check { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: var(--on-good); }
.daily-tile .dt-check svg { width: 12px; height: 12px; stroke-width: 3; }
/* Home screen: duels at the top */
.home-duels:empty { display: none; }
.home-duels { margin-bottom: 28px; }
/* Nothing solved yet: the yellow card at the bottom, under the practice games (viewHome) */
.home-duels-low:not(:empty) { margin-top: 28px; }
/* New players see the daily puzzle first: then the duel block needs room above it */
.daily-slot + .home-duels:not(:empty) { margin-top: 28px; }
.home-duels .section-title { margin-top: 6px; }
.section-link { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.home-new-duel { margin-top: 8px; gap: 6px; }
.home-new-duel svg { width: 18px; height: 18px; color: var(--red); stroke-width: 2.6; }
/* Nieuw duel and Race side by side; Race in yellow, the colour of playing against others */
.home-duel-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.home-new-duel.race-btn { background: var(--yellow); color: #18171a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .08); }
.home-new-duel.race-btn svg { color: currentColor; stroke-width: 2.2; }
@media (hover: hover) and (pointer: fine) { .home-new-duel.race-btn:not(:disabled):hover { background: var(--yellow) !important; filter: brightness(1.05); } }
.nh-surprise svg { width: 18px; height: 18px; }
/* The race explanation's mark: the stopwatch on yellow, like the Race button */
.race-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 50%; background: var(--yellow); color: #18171a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.race-badge svg { width: 30px; height: 30px; stroke-width: 2.2; }
.duel-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
    align-items: center;
    margin: 4px 0 6px;
    padding: 18px;
    border-radius: 24px;
    /* Yellow with some depth: lighter at the top left, warmer towards the bottom right. */
    background: radial-gradient(120% 110% at 100% 100%, color-mix(in srgb, var(--yellow) 80%, #ff8a1c), transparent 62%),
        linear-gradient(165deg, color-mix(in srgb, var(--yellow) 80%, #fff), var(--yellow) 48%);
    color: #18171a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(0, 0, 0, .08);
    animation: fade-in .3s ease both;
}
.duel-hero h2 { font-family: var(--display); font-size: 25px; font-weight: 900; letter-spacing: -0.015em; line-height: 1.05; }
.duel-hero p { margin-top: 5px; font-size: 14.5px; line-height: 1.35; opacity: .8; }
.duel-hero .faces { --ring: var(--yellow); width: 52px; height: 52px; }
.duel-hero .faces.two .face { width: 36px; height: 36px; font-size: 15px; }
.duel-hero-btn { grid-column: 1 / -1; margin-top: 10px; background: #18171a; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 2px 6px rgba(120, 80, 0, .18); }
.duel-hero .link-btn { grid-column: 1 / -1; justify-self: center; color: #18171a; opacity: .7; }
/* Daily puzzles done, not your turn anywhere: what next (home.js, paintNext) */
.next-hero { margin-bottom: 22px; }
.nh-done { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #18171a; color: var(--yellow); }
.nh-done svg { width: 28px; height: 28px; stroke-width: 3; }
.nh-surprise { grid-column: 1 / -1; gap: 8px; background: rgba(255, 255, 255, .55); color: #18171a; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .nh-surprise:hover { background: rgba(255, 255, 255, .75) !important; } }
/* That card always has "Daag iemand uit": a player without duels then doesn't also get the yellow
   "Speel tegen iemand" card below it (one yellow card at a time). */
#nextBox:has(.next-hero) ~ .home-duels:has(> .duel-hero) { display: none; }
/* Your next goals on that card (home.js, goalHtml): light rows on the yellow, like the Race button.
   The card is yellow in both themes, so these colours are fixed too. */
.goals { grid-column: 1 / -1; display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.goal { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px 10px 10px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .55); color: #18171a; font: inherit; text-align: left; cursor: pointer; transition: transform .12s ease; }
.goal:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .goal:hover { background: rgba(255, 255, 255, .75); } }
.goal.busy { opacity: .7; }
/* Waiting for the puzzle (busyButton): the spinner takes the arrow's place, never over "Verras me" */
.goal .btn-spin { right: 12px; width: 12px; height: 12px; margin-top: -6px; }
.goal.busy .g-go svg { visibility: hidden; }
.g-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; }
.g-mark .rank-em { width: 36px; height: 36px; }
.g-mark .bm { width: 40px; height: 40px; }
.g-mark .bm svg { width: 21px; height: 21px; }
.g-mark .g-art { width: 40px; height: 40px; border-radius: 12px; }
.g-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #18171a; color: var(--yellow); }
.g-ic svg { width: 21px; height: 21px; stroke-width: 2.4; }
.g-lvl b { font-family: var(--display); font-size: 17px; font-weight: 900; color: var(--yellow); }
.g-main { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.25; }
.g-main b { font-weight: 750; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-main small { font-size: 12.5px; color: rgba(24, 23, 26, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar { height: 5px; margin-top: 4px; border-radius: 999px; background: rgba(24, 23, 26, .12); overflow: hidden; }
.g-bar i { display: block; width: calc(var(--p) * 100%); height: 100%; border-radius: inherit; background: #18171a; }
.g-go { flex: none; display: inline-flex; align-items: center; gap: 1px; font-size: 13px; font-weight: 750; }
.g-go svg { width: 16px; height: 16px; stroke-width: 2.6; }
.pips { display: flex; gap: 3px; }
.pips i { width: 13px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .32); }
.pips i.on { background: currentColor; }

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin: 28px 4px 10px;
}

/* minmax(0, 1fr): a row is never wider than the card. Without it one line that cannot wrap would make
   the grid (and so every row) wider than the screen, and tags on the right would fall off. */
.recent { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--card); border-radius: var(--r-lg); box-shadow: var(--elev); overflow: hidden; }
.recent a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px 16px 10px 12px;
    text-decoration: none;
    border-top: 1px solid var(--line);
    transition: background-color .12s;
}
.recent a:first-child { border-top: 0; }
/* An opened duel invitation in the duel lists: the VS badge where a face would be */
.recent a.invite-link .vs-badge { box-shadow: none; }
.recent a:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .recent a:hover { background: color-mix(in srgb, var(--ink) 2.5%, var(--card)); } }
.recent .r-icon { width: 40px; height: 40px; flex: none; }
.recent .r-main { flex: 1; min-width: 0; }
.recent .r-title { font-weight: 600; line-height: 1.25; } /* over two lines (a tag beside it) without a big gap */
.recent .r-sub { font-size: 13px; color: var(--ink-3); }
.recent .r-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ======================================================================
   Daily puzzle
   ====================================================================== */

/* No card around the cards: a heading, with two separate cards below. */
.daily-slot { min-height: 128px; margin-bottom: 8px; }
.daily-slot:empty { min-height: 0; margin-bottom: 0; } /* offline: the one card above says it (home.js) */
.daily { animation: fade-in .25s ease both; }
.daily-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.daily-head h2 { font-family: var(--display); font-size: 22px; font-weight: 800; }
.daily-head p { font-size: 14px; color: var(--ink-2); margin-top: 1px; }
.streak { flex: none; padding: 5px 11px; border-radius: 999px; background: var(--streak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 55%, transparent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ======================================================================
   Duels
   ====================================================================== */

.vs-badge {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* The duel mark: red against blue, split diagonally like the VS intro */
    background: linear-gradient(135deg, #db4429 0 47%, #18171a 47% 53%, #2a55d6 53% 100%);
    color: #fff;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 13px;
    letter-spacing: -0.04em;
    text-shadow: 0 1.5px 0 #18171a, 1.5px 1.5px 0 #f3b82c;
    box-shadow: 0 0 0 2.5px var(--card), 0 4px 12px rgba(0, 0, 0, .18);
    transform: rotate(-6deg);
    /* Optical centre: italic letters lean right and the shadow sits bottom-right */
    padding: 0 0.14em 0.08em 0;
    line-height: 1;
}
.vs-badge.big { width: 56px; height: 56px; font-size: 19px; margin-bottom: 12px; }

/* Avatars: the opponent's initial, in one of the four brand colours. */
.faces { --ring: var(--card); flex: none; position: relative; display: inline-flex; width: 40px; height: 40px; }
.face {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-family: var(--display);
    font-weight: 850;
    font-size: 17px;
    line-height: 1;
}
.face.f-b { background: var(--blue); }
.face.f-y { background: var(--yellow); color: #18171a; }
.face.f-g { background: var(--good); color: var(--on-good); }
.face.f-none { background: var(--fill-2); color: var(--ink-3); }
.faces.two .face { position: absolute; width: 29px; height: 29px; font-size: 13px; box-shadow: 0 0 0 2.5px var(--ring); }
.faces.two .face:first-child { left: 0; top: 0; }
.faces.two .face:last-child { right: 0; bottom: 0; }
/* The back face's letter stays centred in its circle, partly behind the front face: the pair reads as
   "a group", the names are next to it anyway. (In the corner it would look lost.) */

/* Custom flame icon for the streak. */
.flame { display: inline-block; width: .95em; height: .95em; margin-right: .22em; vertical-align: -.1em; color: var(--red); }

.recent .r-tag { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.recent .r-score { font-family: var(--display); font-weight: 850; font-size: 17px; font-variant-numeric: tabular-nums; }
.recent .r-score i { font-style: normal; color: var(--ink-3); margin: 0 3px; }
.turn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink);
    font-weight: 650;
}
.turn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 30%, transparent); }
.recent .turn { margin-right: 4px; }
.rounds .turn, .rounds .won { flex: none; font-size: 13px; }
.rounds .turn.dot { margin-right: 6px; } /* just the dot: in line with the dot of the labelled one */
/* A round after your next one (duelRoundsHtml): not yet, so not a link; dimmed, with a lock */
.rounds a.locked { cursor: default; }
.rounds a.locked > :not(.r-lock) { opacity: .5; }
.rounds .r-lock { flex: none; display: grid; color: var(--ink-3); }
.rounds .r-lock svg { width: 16px; height: 16px; }
.won-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.won-ic svg { width: 16px; height: 16px; }
/* Fastest so far in a round others still have to play */
.ended-note { margin: 4px 4px 12px; text-align: center; color: var(--ink-2); font-size: 15px; }
.stand-note { margin: 10px 6px 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.lead-tag { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.won { color: var(--good); font-weight: 650; }

.picker { margin-top: 18px; }
.field-label { font-size: 14px; font-weight: 650; color: var(--ink-2); margin: 14px 2px 6px; }
dialog.sheet .input { margin-bottom: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 13px; background: var(--fill); }
.seg button {
    min-width: 0;
    min-height: 42px;
    padding: 0 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-weight: 600;
    font-size: clamp(13px, 4.2vw, 15px); /* "Moeilijk" plus a count fits on a 320px screen */
    color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
/* Sliding pill under the selected button (see placePill in app.js) */
.seg, .tabs { position: relative; isolation: isolate; }
.seg-pill {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    background: var(--card); /* see-through while it moves: liquidMove (core.js) lowers its opacity */
    /* A piece of glass at rest too, like the tab bar's drop: the light rim, a faint shade along the
       bottom edge, a hairline and a soft lift */
    box-shadow: var(--lg-rim), inset 0 -1px 1px -.5px rgba(24, 23, 26, .07), 0 0 0 .5px var(--line), var(--lg-shadow-sm);
    pointer-events: none;
    transform-origin: 0 0; /* liquidMove (core.js) moves it like the tab bar's drop: spring, lens, pushed in at the ends */
    transition: opacity .15s;
}
.has-pill > :not(.seg-pill) { position: relative; z-index: 1; }
.has-pill > [aria-pressed="true"], .has-pill > [aria-selected="true"] { background: transparent !important; box-shadow: none !important; }
/* Game picker: four per row (two rows with eight games); the pill also slides up and down */
.seg-types { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg-types button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 80px; padding: 8px 4px; }
.seg-types .seg-art { width: 38px; height: 38px; transition: transform .15s var(--spring); }
.seg-types button[aria-pressed="false"] .seg-art { opacity: .55; filter: saturate(.6); }
.seg-types button[aria-pressed="true"] .seg-art { transform: scale(1.06); }
.share-sheet { margin-top: 4px; }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--line-2);
    text-underline-offset: 3px;
    position: relative;
}
/* Invisible larger tap target (about 44px high) without making the button look bigger */
.link-btn::after { content: ""; position: absolute; inset: -6px -4px; }
.link-btn svg { width: 17px; height: 17px; }

.duel { max-width: 480px; margin: 4px auto 0; }
.tile-duel-head { --tile: #f3b82c; color: #18171a; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 20px; }
.tile-duel-head .eyebrow { font-size: 14px; font-weight: 600; opacity: .75; }
.tile-duel-head h1 { font-size: clamp(26px, 7vw, 34px); margin-top: 4px; overflow-wrap: anywhere; }
.tile-duel-head .vs-badge { margin: 0; box-shadow: 0 0 0 3px #18171a, 0 6px 16px rgba(0, 0, 0, .2); }
.duel-score { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: center; gap: 18px; margin-top: 14px; }
.duel-score div { display: grid; justify-items: center; min-width: 80px; }
.duel-score b { font-family: var(--display); font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
/* Only the name is cut off when long, not the face: its frame may reach outside */
.duel-score .ds-who { display: inline-flex; align-items: center; gap: 8px; max-width: 124px; margin-top: 4px; font-size: 14px; font-weight: 600; }
.duel-score .ds-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-score .ds-who .face { width: 22px; height: 22px; font-size: 10px; margin: 0; flex: none; box-shadow: 0 0 0 1.5px rgba(24, 23, 26, .28); }
.duel-score .ds-who .face.av::after { inset: -2px; border-width: 2px; padding: 2px; }
/* Top-aligned, so both scores stay level when only one side has a rating label under it */
.duel-score i { font-style: normal; font-size: 32px; line-height: 52px; opacity: .4; }
.duel-rank { grid-column: 1 / -1; margin-top: 10px; font-weight: 650; }
.duel-action { margin-top: 14px; }
.duel-action .btn-lg { flex-direction: column; gap: 1px; min-height: 60px; }
.btn-sub { display: block; font-size: 13px; font-weight: 500; opacity: .65; }
.duel-wait { margin: 14px 0 -4px; font-size: 14px; color: var(--ink-2); text-align: center; text-wrap: balance; }
/* Times under a round: one calm line of text ("Jij 6:52 · Andri 9:10 · Sanne de Vries 20:34") that
   wraps between players, never inside one, with the same line spacing as the title above it. */
.rounds .results { display: block; margin-top: 2px; line-height: 1.35; white-space: normal; overflow: visible; text-overflow: clip; }
/* Name and time stay together (a non-breaking space in duels.js); a very long name may still break. */
.rounds .results > span { white-space: normal; }
.rounds .results > .secret-line, .rounds .results > .mine-line { white-space: normal; } /* a sentence, not a player: may wrap (otherwise it pushed the turn tag out of the row) */
.rounds .results > span:not(.mine-line):has(+ span:not(.live):not(.nf):not(.more))::after { content: "·"; margin-left: 5px; color: var(--ink-3); font-weight: 400; font-style: normal; } /* the dot ends a line, never starts one */
/* Who is playing, paused, gave up: each on a line of its own under the times */
.rounds .results > .live, .rounds .results > .nf, .rounds .results > .mine-line { display: block; }
.rounds .results > .more { color: var(--ink-3); }
.rounds .results .win { color: var(--ink); font-weight: 650; }
.rounds .results .nf { color: var(--ink-3); font-style: italic; }
.rounds .results .live { color: var(--ink-2); font-weight: 600; }
.rounds .results .live-dot { width: 7px; height: 7px; margin-right: 6px; flex: none; }
.rounds .results > .live { display: flex; align-items: center; } /* the dot centred on the text line */

/* Notifications card */
.push-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 8px 12px 14px;
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: var(--elev);
    animation: fade-in .25s ease both;
}
.pc-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--yellow) 28%, var(--card)); }
.pc-icon svg { width: 20px; height: 20px; }
.pc-text b { display: block; font-size: 15px; font-weight: 650; line-height: 1.25; }
.pc-text p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.push-card .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.pc-x { width: 36px; height: 36px; }
.pc-x svg { width: 18px; height: 18px; color: var(--ink-3); }
@media (max-width: 400px) {
    .push-card { grid-template-columns: auto minmax(0, 1fr) auto; }
    .push-card .btn { grid-column: 2 / 3; justify-self: start; }
    .pc-x { grid-row: 1; grid-column: 3; }
}

.install-card { margin: 0 0 12px; } /* (carryCard, settings.js) */
/* On a computer: play on with your phone (push.js, phoneCard): the text, the QR code beside it, the cross. */
.phone-card { grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 14px 8px 14px 18px; }
.phone-card .pc-text b { font-size: 16px; }
.phone-card .pc-text p { font-size: 14px; margin-top: 4px; }
.phone-card .pc-x { align-self: start; }
/* The QR code (qr.js) on its own white, also in dark mode: a scanner wants dark on light */
.qr-box { width: 124px; aspect-ratio: 1; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.qr-box:empty { background: var(--fill); box-shadow: none; }
.qr-box .qr { display: block; width: 100%; height: 100%; }
.qr-transfer { width: 176px; margin: 18px auto 0; }
.install-banner {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 14px;
    padding: 16px 8px 16px 16px;
    overflow: hidden;
    border-radius: var(--r-lg);
    color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, #f0643f 0%, transparent 55%), linear-gradient(135deg, #e04a2c, #c2361c);
    box-shadow: 0 10px 26px -12px rgba(194, 54, 28, .7);
    animation: fade-in .25s ease both;
}
#pushBox .install-banner { margin: 14px 0 0; }
.ib-icon { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 6px 14px -6px rgba(0, 0, 0, .45); }
.ib-text b { display: block; font-family: var(--display); font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.ib-text p { margin-top: 3px; font-size: 13.5px; line-height: 1.35; color: rgba(255, 255, 255, .88); }
.ib-x { align-self: start; width: 34px; height: 34px; margin: -6px 0 0; }
.ib-x svg { width: 18px; height: 18px; color: rgba(255, 255, 255, .8); }
.ib-btn { grid-column: 1 / -1; margin: 10px 8px 0 0; min-height: 46px; gap: 8px; background: #fff; color: #18171a; font-weight: 700; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.ib-btn svg { width: 19px; height: 19px; }
.ib-btn:active { transform: translateY(1px); }

/* Mini tutorial */
.tut-board { width: min(250px, 70vw); margin: 18px auto 0; }
/* Step dots of the tutorial: done, current, still to come */
.tut-steps { display: flex; gap: 6px; margin-top: 10px; }
.tut-steps i { width: 22px; height: 5px; border-radius: 3px; background: var(--fill-2); transition: background .2s; }
.tut-steps i.now { background: var(--ink-3); }
.tut-steps i.done { background: var(--good); }
/* Room for two lines (most hints), centred in it: the buttons below don't move when a hint comes or goes */
.tut-hint { min-height: 2.9em; margin-top: 12px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14.5px; line-height: 1.4; color: var(--ink-3); text-wrap: balance; }
.tut-hint.warn { color: var(--bad); font-weight: 600; }
.tut-hint.ok { color: var(--good); font-weight: 700; font-size: 16px; }
/* Hint in the tutorial: free, small, under the hint line */
/* Hint, and once solved Next, in one place of a fixed height (help.js) */
.tut-tools { display: flex; justify-content: center; align-items: center; min-height: 56px; margin-top: 8px; }
.tut-tools [data-next] { width: 100%; }
.tut-hint-btn { min-height: 40px; padding: 8px 16px; font-size: 14.5px; }
.tut-hint-btn svg { width: 17px; height: 17px; color: #c98a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tut-hint-btn svg { color: var(--yellow); } }
:root[data-theme="dark"] .tut-hint-btn svg { color: var(--yellow); }
.btn.pulse { animation: btn-pulse 1.4s ease-in-out 2; }
@keyframes btn-pulse { 50% { transform: scale(1.03); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ink) 15%, transparent); } }

/* ======================================================================
   Profile, transfer, privacy
   ====================================================================== */

.avatar-big {
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--on-ink);
    font-family: var(--display);
    font-weight: 900;
    font-size: 24px;
}
.menu { margin-top: 16px; border-radius: var(--r-lg); box-shadow: var(--elev); overflow: hidden; background: var(--card); }
.menu > button, .menu > a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 10px 14px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    text-align: left;
    font-size: 15.5px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    transition: background-color .12s;
}
.menu > :first-child { border-top: 0; }
.menu > button:active, .menu > a:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .menu > button:hover, .menu > a:hover { background: color-mix(in srgb, var(--ink) 3%, var(--card)); } }
.menu > :is(button, a) > svg:first-child { width: 22px; height: 22px; flex: none; color: var(--ink-2); }
.menu > :is(button, a) > svg:last-child { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.menu > :is(button, a) > span { flex: 1; min-width: 0; line-height: 1.3; }
.menu > button small { display: block; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--ink-3); margin-top: 2px; }
.theme-switch, .theme-switch * { transition: none !important; }

/* Disclosures ("Hoe werkt ...?") slide open instead of jumping (where the browser supports it) */
:root { interpolate-size: allow-keywords; }
details::details-content { block-size: 0; overflow: hidden; transition: block-size .3s cubic-bezier(.2, .8, .2, 1), content-visibility .3s allow-discrete;
    /* Room for the edge of buttons inside (drawn as a shadow just outside them), or the clipping that
       makes it slide would cut it off; the negative margin keeps everything where it was. Not on top: there
       it would lie over the summary and take its taps. */
    padding: 0 4px 4px; margin: 0 -4px -4px; }
/* flow-root: that negative margin would otherwise collapse through the details instead of taking the
   padding back, leaving a closed card 4px taller under its summary (text no longer centred) */
details { display: flow-root; }
details[open]::details-content { block-size: auto; }
/* Content that appears after loading fades in softly */
.daily, .recent, .lb, .stat-card, .duel-list { animation: fade-in .3s ease both; }
/* ...but not if it was already there (restored from memory): then the screen slides in complete */
.instant .daily, .instant .recent, .instant .duel-list, .instant .duel-hero { animation: none; }
/* ...and not on pull to refresh (app.js): the screen is rebuilt, but what was there stays put. Only what
   is new (a row, a number) changes; fading in the yellow card or the duel list again would look like a glitch.
   (Duration 0, not "animation: none": removing the class would then switch the animation on again and
   play it after all. A finished animation whose duration changes stays finished.) */
.refreshing :is(.daily, .recent, .lb, .stat-card, .duel-list, .duel-hero, .push-card, .beaten) { animation-duration: 0s; }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 5px 14px; border-top: 1px solid var(--line); font-size: 15.5px; font-weight: 600; }
.menu-row > svg { width: 22px; height: 22px; flex: none; color: var(--ink-2); }
.menu-row > span { flex: 1; min-width: 0; }
.menu-row .seg { flex: none; }
/* A narrow screen: the choice (Weergave: Auto, Licht, Donker) under its label, in line with the text (beside it the label was cut off to "Wee") */
@media (max-width: 359px) {
    .menu-row:has(> .seg) { flex-wrap: wrap; row-gap: 8px; padding-block: 10px; }
    .menu-row:has(> .seg) > .seg { flex: 1 1 calc(100% - 34px); margin-left: 34px; }
}
/* 38px high + 2x 3px strip border + 2x 5px: the row stays 56px, like the other rows */
.menu-row .seg button { padding: 6px 10px; font-size: 13.5px; min-height: 38px; }
.switch { flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--fill-2); transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease-out); }
.menu > button.on .switch { background: var(--good); }
/* Busy (notifications being switched on or off, settings.js): the switch breathes */
.menu > button.busy { cursor: progress; }
.menu > button.busy .switch { animation: sw-busy .7s ease-in-out infinite alternate; }
@keyframes sw-busy { to { background: color-mix(in srgb, var(--good) 45%, var(--fill-2)); } }
@media (prefers-reduced-motion: reduce) { .menu > button.busy .switch { animation: none; opacity: .6; } }
.menu > button.dim > span, .menu > button.dim > svg, .menu > button.dim .switch { opacity: .55; }
.menu > button[hidden] { display: none; }
.menu > button.on .switch::after { transform: translateX(18px); }

.sheet-back { margin: -6px 0 6px -10px; }
.code-copy { margin-top: 2px; }
/* The note belongs to the code (8px under its button), Klaar is a part of its own (28px) */
.fine-center.code-note { margin-top: 8px; }
dialog.sheet .actions.code-done { margin-top: 28px; }
.big-code.small { margin: 8px 0 2px; padding: 8px 12px; font-size: 24px; letter-spacing: .08em; text-align: left; }
.big-code.small.fail { font-size: 14px; letter-spacing: 0; white-space: normal; font-weight: 600; color: var(--ink-2); }
.big-code {
    margin: 18px 0 8px;
    padding: 18px;
    border-radius: var(--r-lg);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--line);
    text-align: center;
    font-family: var(--display);
    font-size: min(44px, 11.5vw); /* (44px broke the code over two lines on a 320 phone) */
    font-weight: 900;
    letter-spacing: .06em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.code-input { margin-top: 16px; text-align: center; font-size: 28px; letter-spacing: .15em; font-variant-numeric: tabular-nums; min-height: 64px; }
.fine-center { font-size: 13px; color: var(--ink-3); text-align: center; text-wrap: balance; margin-top: 10px; }
dialog.sheet .steps.small li { gap: 10px; }
dialog.sheet .steps.small b { width: 26px; height: 26px; font-size: 13px; }
dialog.sheet .steps.small p { margin: 2px 0 0; color: var(--ink); }

/* Statistics */
.stats { max-width: 560px; margin: 8px auto 0; }
.page-title { font-family: var(--display); font-size: clamp(30px, 7vw, 38px); font-weight: 900; letter-spacing: -0.02em; }
.stats > .lead { color: var(--ink-2); margin-top: 8px; }
.stats .me-tabs { margin: 16px 0 14px; } /* (.tabs further down sets 26px) */
/* When switching, the whole pane already slides: the cards need not fade in again */
#mePane .stat-card, #mePane .menu { animation: none; }
#mePane > .stat-card:first-child { margin-top: 0; }
/* Jij > Statistieken > Overzicht: tiles of two, an odd last one takes the full width */
.stat-card.overview header { margin-bottom: 10px; }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ov { position: relative; overflow: hidden; padding: 12px 12px 11px; border-radius: 14px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.ov:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ov b { display: block; font-family: var(--display); font-size: 24px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov b small { font-size: 15px; color: var(--ink-3); font-weight: 700; }
.ov b .flame { width: .8em; height: .8em; vertical-align: -.04em; }
.ov span { display: block; margin-top: 3px; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.ov > small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
/* Games you never played: one compact card with a button per game (starts an easy one) */
.stat-unplayed header h2 { font-size: 18px; }
.stat-empty { margin: 6px 0 16px; color: var(--ink-3); font-size: 15px; }
.unplayed-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.unplayed-btn { min-width: 0; display: grid; justify-items: center; gap: 4px; padding: 10px 2px 8px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); font-size: clamp(11px, 3.5vw, 12.5px); font-weight: 650; }
.unplayed-btn .r-icon { width: 30px; height: 30px; }
.unplayed-btn:active { transform: scale(.96); }
.stat-card { margin-top: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.stat-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stat-card header .r-icon { width: 36px; height: 36px; }
/* Stars (profile.js, starsHtml): gold, an empty one a hollow outline */
.stars { display: inline-flex; gap: 1px; vertical-align: -2px; }
.star { width: 14px; height: 14px; flex: none; }
.star path { fill: none; stroke: color-mix(in srgb, var(--ink) 28%, transparent); stroke-width: 1.8; stroke-linejoin: round; }
.star.on path { fill: #f3b82c; stroke: #d99400; stroke-width: 1.2; }
/* The Sterren card on Jij: a row per game, a cell per level, each cell a button that plays it */
.stars-card header { justify-content: space-between; }
.sc-total { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.sc-total::before { content: ""; width: 18px; height: 18px; background: #f3b82c; clip-path: polygon(50% 4%, 61.9% 28.8%, 89% 32.3%, 69.2% 51%, 74.2% 77.9%, 50% 64.8%, 25.8% 77.9%, 30.8% 51%, 11% 32.3%, 38.1% 28.8%); }
.sc-total b { font-family: var(--display); font-size: 22px; font-weight: 900; line-height: 1; }
.sc-total small { color: var(--ink-3); font-weight: 650; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); gap: 6px 6px; align-items: center; }
.sc-diff { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; }
.sc-game { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 650; }
.sc-game > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-art { width: 26px; height: 26px; flex: none; border-radius: 8px; }
/* A game you master (all nine stars): its icon in a gold rim, its name in gold */
.sc-game.master .sc-art { box-shadow: 0 0 0 2px #f3b82c, 0 0 6px rgba(243, 184, 44, .6); }
.sc-game.master > span { color: #c98a00; }
.sc-cell { position: relative; display: grid; place-items: center; padding: 7px 8px; border: 0; border-radius: 10px; background: var(--fill); }
.sc-cell:active { transform: scale(.95); }
.sc-cell.busy .stars { opacity: .25; }
.sc-cell .btn-spin { right: 50%; width: 12px; height: 12px; margin: -6px -6px 0 0; }
.sc-legend { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
/* A level without a pace yet: its 2nd and 3rd star faint (they can't be earned there now) */
.sc-cell.nopace .star:not(:first-child):not(.on) { opacity: .35; }
.sc-nopace { display: inline-block; margin-top: 4px; }
/* In a goal's line: the stars you have, small */
.g-main small .stars { margin-right: 4px; }
.g-main small .star { width: 11px; height: 11px; }
.stat-card h2 { font-family: var(--display); font-size: 22px; font-weight: 900; }
.seg button small { margin-left: clamp(2px, 1.2vw, 5px); font-size: 12px; color: var(--ink-3); font-weight: 600; }
/* Jij → Statistieken: the count under the level, so "Gemiddeld 1000" fits on any phone and all three look alike. */
.stat-card [data-levels] button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; padding-block: 5px; }
.stat-card [data-levels] button small { margin-left: 0; }
.stat-card [data-levels] button small:empty { display: none; }
.stat-body { margin-top: 14px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-kpis div { min-width: 0; container-type: inline-size; padding: 10px clamp(8px, 2.6vw, 12px); border-radius: 12px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
/* Scales with the tile, so "1:02:03" (an average over an hour) still fits on a narrow phone; 20px on most. */
.mini-kpis b { display: block; font-size: min(20px, 26cqi); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-kpis span { font-size: clamp(11.5px, 3.6vw, 12.5px); color: var(--ink-3); }
.trend-box { margin-top: 14px; }
.trend-pick { margin-bottom: 10px; }
.trend-read { font-size: 13.5px; color: var(--ink-2); min-height: 20px; }
.trend-read b { color: var(--ink); font-variant-numeric: tabular-nums; }
.trend { display: block; width: 100%; height: auto; margin-top: 4px; overflow: visible; touch-action: pan-y; }
.trend .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend.t-spoor .line { stroke: var(--red); }
.trend.t-balans .line { stroke: var(--blue); }
.trend.t-tuinen .line { stroke: var(--good); }
.trend.t-kavels .line { stroke: #c9630f; }
.trend.t-zestal { --z: #6a46cc; } /* lighter purple in dark mode, like the board (see Zestal) */
.trend.t-zestal .line { stroke: var(--z); }
.trend.t-leidingen .line { stroke: #c2387a; }
.trend.t-bruggen .line { stroke: #14857f; }
.trend.t-lampen .line { stroke: #b07a0c; }
.trend .avg { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.trend .dot, .trend .hover { stroke: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend.t-spoor .dot, .trend.t-spoor .hover { fill: var(--red); }
.trend.t-balans .dot, .trend.t-balans .hover { fill: var(--blue); }
.trend.t-tuinen .dot, .trend.t-tuinen .hover { fill: var(--good); }
.trend.t-tuinen .dot.best { fill: var(--yellow); }
.trend.t-kavels .dot, .trend.t-kavels .hover { fill: #c9630f; }
.trend.t-zestal .dot, .trend.t-zestal .hover { fill: var(--z); }
.trend.t-leidingen .dot, .trend.t-leidingen .hover { fill: #c2387a; }
.trend.t-bruggen .dot, .trend.t-bruggen .hover { fill: #14857f; }
.trend.t-lampen .dot, .trend.t-lampen .hover { fill: #b07a0c; }
.trend .dot.best { fill: var(--good); }
.trend .cross { stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-cap { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.doc { max-width: 620px; margin: 8px auto 0; }
.doc h2 { font-size: 18px; font-weight: 700; margin: 26px 0 8px; }
.doc .lead { color: var(--ink-2); font-size: 17px; }
.doc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc p, .doc li { color: var(--ink-2); }
.doc .btn { margin-top: 16px; }
/* A quiet link at the end of a page (Hide duel, How a duel works): halfway between the last block and
   the tab bar. The page already leaves 20px above the bar (main); the 11px below makes up for the
   link's own room above (its margin and padding), so both gaps are the same (39px to the text). */
.footer-note { margin: 17px 0 11px; font-size: 13px; color: var(--ink-3); text-align: center; }
.footer-note a { color: inherit; }

/* ======================================================================
   Invitation
   ====================================================================== */

.landing { max-width: 480px; margin: 4px auto 0; }
.landing .tile { padding: 20px; }
.landing .tile .eyebrow { grid-column: 1; font-size: 14px; font-weight: 600; opacity: .9; }
.landing .tile h1 { font-size: 40px; }
.landing .tile .sub { font-size: 15px; opacity: .88; font-weight: 500; margin-top: 4px; }
.landing .tile .art { grid-row: 1 / span 3; grid-column: 2; }
/* Who played it, who is on it: a text line like .next-info under a result (no card), exactly in the
   middle between the tile and Start (20px above and below). */
.stat, .next-info { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; line-height: 1.4; color: var(--ink-2); text-align: center; }
.stat { margin: 20px 4px 0; }
.stat b { color: var(--ink); font-weight: 650; }
.stat .live, .next-info .live { display: inline-flex; align-items: center; color: var(--ink); font-weight: 600; }
.landing form { margin-top: 20px; display: grid; gap: 12px; }
/* The note belongs to the button: 8px (one group); "Hoe werkt ...?" is a part of its own (28px). */
.landing .fine { font-size: 13px; color: var(--ink-3); margin-top: 8px; text-align: center; }

.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 4px 6px; }
.input {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    background: var(--card);
    font-size: 17px;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--fill-2); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 15%, transparent); animation: shake .35s; }

.rules { margin-top: 28px; border-radius: var(--r); background: var(--card); box-shadow: var(--elev); padding: 2px 16px; }
.rules summary {
    cursor: pointer;
    min-height: 50px;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: ""; width: 7px; height: 7px; margin: -3px 4px 0 0; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s, margin .2s; }
.rules[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.rules[open] { padding-bottom: 16px; }
.rule-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: rule; }
.rule-list li { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.rule-list li::before {
    counter-increment: rule;
    content: counter(rule);
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fill-2);
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-1px);
}
.rule-example { display: flex; justify-content: center; gap: 18px; margin: 16px 0 4px; }
.rule-example svg { width: 132px; height: auto; }
.how-hint { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.ex-rows { display: grid; gap: 8px; justify-items: center; }
.ex-row { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.ex-row .mini-sym { width: 20px; height: 20px; margin: 0 3px; }
.ex-row .mini-sym.b { width: 15px; height: 15px; margin: 0 5.5px; }
.ex-row b { margin-left: 10px; font-size: 18px; color: var(--good); }
.ex-row.nok b { color: var(--bad); }

.mini-sym { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin: 0 2px; }
.mini-sym.a { border-radius: 50%; background: var(--sym-a); }
.mini-sym.b { width: 11px; height: 11px; background: var(--sym-b); transform: rotate(45deg); border-radius: 2px; margin: 0 4px; }

/* ======================================================================
   Game screen
   ====================================================================== */

.game {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: var(--sat) 0 calc(10px + var(--sab));
}
.game-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
}
/* Back, sound and help: small round pieces of glass, like the toolbar under the board */
.game-bar .icon-btn { width: 40px; height: 40px; margin: 2px; background: var(--lg-tint); box-shadow: var(--lg-rim), var(--lg-shadow-sm); }
.game-bar .icon-btn:active { background: color-mix(in srgb, var(--ink) 8%, var(--lg-tint)); }
@media (hover: hover) and (pointer: fine) { .game-bar .icon-btn:hover { background: color-mix(in srgb, var(--ink) 5%, var(--lg-tint)); } }
.game-bar .icon-btn svg { width: 20px; height: 20px; }
.game-title { min-width: 0; padding-left: 4px; }
.game-title h1 { font-family: var(--display); font-size: 19px; font-weight: 900; }
.game-title span { display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-btn.off svg { opacity: .45; }

.progress { height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; margin: 2px 4px 0; }
.progress i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ink); border-radius: 2px; transition: width .2s var(--ease-out); }
.game.solved .progress i { background: var(--good); }
/*
 * Waiting for the next hint: the button is dimmed, and a short bar under it fills up in the time left
 * (game.js, paintHintBtn: --hint-from, --hint-ms). Ready: one small pop.
 */
.btn-hint { position: relative; }
.btn-hint.waiting > * { opacity: .55; }
.btn-hint::before, .btn-hint::after { content: ""; position: absolute; left: calc(50% - 18px); bottom: 4px; width: 36px; height: 3px; border-radius: 2px; opacity: 0; pointer-events: none; }
.btn-hint::before { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.btn-hint::after { background: #c98a00; transform-origin: left; transform: scaleX(0); }
.btn-hint.waiting::before, .btn-hint.waiting::after { opacity: 1; }
.btn-hint.waiting::after { animation: hint-fill var(--hint-ms, 15s) linear both; }
@keyframes hint-fill { from { transform: scaleX(var(--hint-from, 0)); } to { transform: scaleX(1); } }
.btn-hint.ready { animation: hint-ready .4s var(--spring); }
@keyframes hint-ready { 40% { transform: scale(1.08); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-hint::after { background: var(--yellow); } }
:root[data-theme="dark"] .btn-hint::after { background: var(--yellow); }
/* Reduced motion: the bar still fills (it is information, not decoration), only the pop goes */
@media (prefers-reduced-motion: reduce) { .btn-hint.waiting::after { animation-duration: var(--hint-ms, 15s) !important; } }

.stage {
    flex: 1;
    min-height: 0;
    container-type: size;
    display: grid;
    place-items: center;
    padding: 10px 0 4px;
}
.board-wrap { position: relative; width: min(100cqw, 100cqh, 560px); }
/* Board with a row of number buttons below it (Zestal) */
.board-wrap.with-pad { width: min(100cqw, calc(100cqh - 76px), 560px); }
.game-hint {
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 14.5px;
    line-height: 1.32;
    color: var(--ink-3);
    /* Fixed height: a message must never shift the board. Three lines, more on taller screens (there
       is room above the board), so a long "what if" hint fits without scrolling. If it still does
       not fit, it scrolls instead of being cut off. */
    flex: none;
    height: clamp(70px, 12.5dvh, 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 2px 12px;
    text-wrap: balance;
    transition: color .2s;
}
/* Too long for three lines (the JS sets .dense when the text does not fit): slightly smaller, so four fit */
.game-hint.dense { font-size: 13px; line-height: 1.24; }
.game-hint.ctl { color: var(--ink-3); font-size: 13.5px; }
/* Icons in hints: a tree, lamp, cross, sun or diamond instead of the word */
.h-ic { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.28em; margin: 0 .05em; }
.h-ic svg { display: block; width: 100%; height: 100%; }
.h-nobr { white-space: nowrap; }
.h-ic .cross { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; opacity: .75; transform: scale(1.45); transform-origin: center; overflow: visible; }
.h-ic.h-lamp { --l-bulb: #ffb81c; --l-bulb-edge: #b07a0c; --l-ray: color-mix(in srgb, #b07a0c 70%, var(--ink)); --board: var(--card); }
/* A fixed box with the symbol centred inside, so a circle and a diamond sit at exactly the same height */
.h-ic.h-bol, .h-ic.h-ruit { position: relative; width: 1em; height: 1em; vertical-align: -.15em; }
.h-ic .mini-sym { position: absolute; left: 50%; top: 50%; margin: 0; translate: -50% -50%; }
.h-ic .mini-sym.a { width: .8em; height: .8em; }
.h-ic .mini-sym.b { width: .6em; height: .6em; }
.game-hint.warn { color: var(--bad); font-weight: 600; }
.game-hint.tip { color: var(--ink); font-weight: 600; }
.game.solved .game-hint { color: var(--good); font-weight: 700; font-size: 16px; }
/* Solved: the line is stamped in with the fanfare (game.js, onSolved) */
.game-hint.stamp > span { display: inline-block; animation: hint-stamp .45s var(--spring) both; }
@keyframes hint-stamp { 0% { transform: scale(.82); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
/* The solution after giving up, or looking back at one: the finished board without the victory show */
/* (also the ::before/::after: Kavels draws its plots there, and they would still bounce; and no
   transitions: the = and × of Balans would still turn green in a wave) */
.game.gave-up .solved, .game.gave-up .solved *, .game.gave-up .solved *::before, .game.gave-up .solved *::after,
.sol-inner .solved, .sol-inner .solved *, .sol-inner .solved *::before, .sol-inner .solved *::after { animation: none !important; transition: none !important; }
/* (Spoor's shine is only visible while it runs: without its animation it lay over the whole line) */
.game.gave-up .path-glow, .sol-inner .path-glow { visibility: hidden !important; }

/* Toolbar at the bottom, app-style */
.controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 5px;
    margin-top: 4px;
    border-radius: 30px; /* glass pill like the tab bar (see .tabbar); nothing scrolls under it, so no blur */
}
.controls .btn {
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 25px; /* follows the pill: 30px minus its padding */
    background: transparent;
    box-shadow: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}
.controls .btn svg { width: 22px; height: 22px; color: var(--ink); }
.controls .btn small { font-weight: 500; color: var(--ink-3); }
/* Not for the dark button (Opnieuw versturen): it keeps its own background, otherwise the text disappears */
.controls .btn:not(.btn-primary):active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .controls .btn:not(.btn-primary):not(:disabled):hover { background: var(--fill) !important; } }
.controls .btn-hint svg { color: #c98a00; }
.controls .btn-primary { grid-column: 1 / -1; min-height: 58px; }
/* Solved: the toolbar fades away (it keeps its place, so the board doesn't move) */
.controls { transition: opacity .3s ease; }
/* Terug or Opnieuw with nothing to undo or clear: a small shake, no change (game.js, nope) */
.controls .btn.nope { animation: btn-nope .24s ease-out; }
@keyframes btn-nope { 20%, 60% { translate: -3px 0; } 40%, 80% { translate: 3px 0; } }
.controls.done { opacity: 0; pointer-events: none; }
/* Saving takes longer than usual: a plain line instead of the bar */
.controls.saving-box { background: none; box-shadow: none; }
.controls .saving { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; margin: 0; color: var(--ink-2); font-size: 14.5px; }
.controls .saving .spinner { width: 18px; height: 18px; border-width: 2px; }
.controls .btn-primary { color: var(--on-ink); background: var(--ink); font-size: 15px; flex-direction: row; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .controls .btn-hint svg { color: var(--yellow); } }
:root[data-theme="dark"] .controls .btn-hint svg { color: var(--yellow); }

/* ======================================================================
   Spoor
   ====================================================================== */

.spoor-svg {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    overflow: visible;
}
.spoor-svg .cell { fill: var(--board); transition: fill .14s ease; }
.spoor-svg .cell.on { fill: var(--spoor-soft); }
.spoor-svg .grid { fill: none; stroke: var(--grid); stroke-width: 2; }
.spoor-svg .path { fill: none; stroke: var(--spoor); stroke-linecap: round; stroke-linejoin: round; }
.spoor-svg .path-glow { fill: none; stroke: #fff; stroke-opacity: .6; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.spoor-svg .ghost { fill: none; stroke: var(--spoor); stroke-opacity: .7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 25; animation: march .8s linear infinite; }
.spoor-svg .wall { stroke: var(--ink); stroke-linecap: round; }
.spoor-svg .frame { fill: none; stroke: var(--ink); stroke-width: 6; transition: stroke .3s; }
/* Solved: the frame turns green, as on every other board (Spoor's stayed black) */
.spoor-svg.solved .frame { stroke: var(--good); }
.spoor-svg .num { transform-box: fill-box; transform-origin: center; }
.spoor-svg .num .dot { fill: var(--dot, var(--ink)); transition: fill .15s; } /* (--dot: its colour now, also the end of dot-bad) */
.spoor-svg .num .ring { fill: none; stroke: var(--spoor); stroke-width: 7; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.spoor-svg .num.pop .ring { animation: ring-burst .6s cubic-bezier(.2, .8, .2, 1); }
.spoor-svg .num text { fill: var(--board); font-weight: 800; font-family: var(--display); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.spoor-svg .num.hit .dot { --dot: var(--spoor); }
.spoor-svg .num.hit text { fill: #fff; }
.spoor-svg .num.pop { animation: num-pop .32s var(--spring); }
.spoor-svg .head { fill: #fff; pointer-events: none; transform-box: fill-box; transform-origin: center; transition: transform .18s cubic-bezier(.3, 1.5, .5, 1); }
.spoor-svg.dragging .head { transform: scale(1.45); }
.spoor-svg.solved { animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.spoor-svg .start-ring { fill: none; stroke: var(--spoor); stroke-width: 6; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.spoor-svg.fresh .start-ring { animation: ring 1.6s ease-out infinite; }
/* A number out of order shakes and flashes red, the next one you need rings (spoor.js, bump) */
.spoor-svg .num.nope { animation: num-nope .32s ease-out; }
.spoor-svg .num.nope .dot { animation: dot-bad .5s ease-out; }
.spoor-svg .num.call .ring { animation: ring-burst .7s cubic-bezier(.2, .8, .2, 1); }
@keyframes num-nope { 20%, 60% { translate: -4px 0; } 40%, 80% { translate: 4px 0; } }
/* Back to its own colour written out (see pulse): the dot may be mixed (.early), red is not */
@keyframes dot-bad { 0%, 55% { fill: var(--bad); } 100% { fill: var(--dot, var(--ink)); } }
.spoor-svg.solved .cell.on { animation: wave .7s ease both; animation-delay: calc(var(--i) * 420ms); }
.spoor-svg.solved .path-glow { visibility: visible; animation: streak 1s cubic-bezier(.45, 0, .25, 1) both; }
.spoor-svg .cell.empty-hint { animation: pulse 1s ease 2; }
/* The last number reached with cells still empty: a dashed ring, not done yet (spoor.js) */
.spoor-svg .num.early .ring { opacity: .9; stroke-dasharray: 9 9; animation: none; }
.spoor-svg .num.early .dot { --dot: color-mix(in srgb, var(--spoor) 55%, var(--ink)); }
/* A wall in the way flashes; the end of the line rings when you tap somewhere it can't reach */
.spoor-svg .wall.hit { animation: wall-hit .45s ease-out; }
@keyframes wall-hit { 0%, 35% { stroke: var(--spoor); } }
.spoor-svg .head-ring { fill: none; stroke: var(--spoor); stroke-width: 7; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.spoor-svg .head-ring.call { animation: ring-burst .7s cubic-bezier(.2, .8, .2, 1); }
/* Reduced motion: these cues consist only of their animation; without it, a short static mark */
@media (prefers-reduced-motion: reduce) {
    .spoor-svg .wall.hit { stroke: var(--spoor); }
    .spoor-svg .head-ring.call, .spoor-svg .num.call .ring { opacity: .7; }
}
.spoor-svg { cursor: pointer; }
.spoor-svg.dragging { cursor: grabbing; }

@keyframes num-pop { 40% { transform: scale(1.22); } }
@keyframes ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes wave {
    0% { fill: var(--spoor-soft); }
    35% { fill: color-mix(in srgb, var(--spoor) 45%, var(--board)); }
    100% { fill: color-mix(in srgb, var(--spoor) 22%, var(--board)); }
}
@keyframes streak {
    from { stroke-dasharray: .12 2; stroke-dashoffset: .12; }
    to { stroke-dasharray: .12 2; stroke-dashoffset: -1.02; }
}
/* Begin and end written out (the empty cell's own fill), here: Chrome 157 turns an SVG
   fill black when keyframes run from the element's own plain colour to a color-mix() it has to fill in
   itself (an HTML background is fine). The empty cells flashed black instead of red. */
@keyframes pulse { 0%, 100% { fill: var(--board); } 50% { fill: color-mix(in srgb, var(--bad) 30%, var(--board)); } }
@keyframes march { to { stroke-dashoffset: -25; } }

/* ======================================================================
   Balans
   ====================================================================== */

.balans {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    grid-template-rows: repeat(var(--n), minmax(0, 1fr));
    aspect-ratio: 1;
    width: 100%;
    background: var(--board);
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    container-type: inline-size; /* the = and × scale with the board (.b-edge) */
}
.b-cell {
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    border-right: 1px solid var(--grid); /* 1px, as Zestal and Kavels: calmer, and a mark sits centred on its line */
    border-bottom: 1px solid var(--grid);
    background: var(--board);
    padding: 0;
    overflow: hidden; /* for the tap ripple */
    transition: background-color .12s;
}
.b-cell.lc { border-right: 0; }
.b-cell.lr { border-bottom: 0; }
.b-cell.given { background: var(--given); cursor: default; }
.b-cell:not(.given):active { background: color-mix(in srgb, var(--ink) 6%, var(--board)); }
@media (hover: hover) and (pointer: fine) { .b-cell:not(.given):hover { background: color-mix(in srgb, var(--ink) 3.5%, var(--board)); } }
.b-cell:focus-visible { outline-offset: -4px; }
.b-cell.err::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 24%, transparent) 0 5px, transparent 5px 10px);
    pointer-events: none;
    animation: fade-in .2s ease both;
}
/* (translate, not transform: a given ruit keeps its 45° turn while it shakes) */
.b-cell.nope .sym { animation: sym-nope .25s; }
@keyframes sym-nope { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
/* A cell that just turned red: a small nudge, so you see where (balans.js, showErrors) */
.b-cell.err-new .sym { animation: sym-nope .3s; }
.b-cell.hint-rel { background: color-mix(in srgb, var(--yellow) 32%, var(--board)); animation: hint-rel-pulse-bg 1.1s ease-in-out infinite alternate; }
/* Hint spotlight: the related cells light up, the rest of the board briefly calms down. */
/* (Balans: no transition here, the .sym itself has one that includes opacity: this one replaced the pop) */
.balans.hinting .b-cell:not(.hint-rel):not(.hint-target) .sym:not(.ghost) { opacity: .3; }
.zestal.hinting .z-cell:not(.hint-rel):not(.hint-target) .z-num,
.kavels.hinting .k-cell:not(.hint-rel):not(.hint-in) .k-num { opacity: .3; transition: opacity .25s; }
.kavels.hinting .k-rect:not(.k-ghost):not(.k-preview) { opacity: .35; transition: opacity .25s; }
.zestal.hinting .z-cell:not(.hint-rel):not(.hint-target),
.balans.hinting .b-cell:not(.hint-rel):not(.hint-target) { background: color-mix(in srgb, var(--ink) 5%, var(--board)); }
.b-cell.hint-target { z-index: 1; animation: hint-glow 1.1s ease-in-out infinite alternate; }
.b-cell.hint-wrong { z-index: 1; box-shadow: inset 0 0 0 3px var(--bad); animation: shake .3s; }
/*
 * Bol and ruit. scale and rotate as separate properties: a ruit keeps its 45° while it pops, shakes
 * or shrinks away. New: a springy pop (a ruit turns into place); gone: it shrinks in its own shape.
 */
.sym { position: relative; z-index: 1; display: block; width: 50%; height: 50%; scale: 0; opacity: 0; transition: scale .18s var(--spring), opacity .2s, rotate .22s var(--spring); }
.sym.a, .sym.b { scale: 1; opacity: 1; }
.sym.a { border-radius: 50%; background: var(--sym-a); }
.sym.b { width: 42%; height: 42%; border-radius: 12%; background: var(--sym-b); rotate: 45deg; }
.sym.out { scale: 0; opacity: 0; transition: scale .15s ease-in, opacity .15s ease-in; }
.balans.resetting .sym.out { transition-delay: calc(var(--i) * 14ms); }
/* Terug after Opnieuw: they come back in the same wave (balans.js, wave) */
.balans.resetting .sym.in { animation-delay: calc(var(--i) * 14ms); animation-fill-mode: backwards; }
.sym.a.in { animation: sym-in .28s var(--spring); }
.sym.b.in { animation: sym-in-b .32s var(--spring); }
@keyframes sym-in { 0% { scale: .35; } 60% { scale: 1.12; } 100% { scale: 1; } }
@keyframes sym-in-b { 0% { scale: .35; rotate: 0deg; } 60% { scale: 1.12; } 100% { scale: 1; rotate: 45deg; } }
/* The finger lands: the cell sinks at once (balans.js, press) */
.b-cell.press { background: color-mix(in srgb, var(--ink) 7%, var(--board)); transition: none; }
.b-cell.press .sym { scale: .88; }
.b-cell.press .sym.out { scale: 0; } /* an emptied cell: no ghost of the old symbol under the finger */
/* Terug: the cells that changed back blink once */
.b-cell.undone { animation: cell-undone .45s ease-out; }
.sym.ghost { position: absolute; inset: 0; margin: auto; opacity: .3; pointer-events: none; }
.b-cell.given .sym.a, .b-cell.given .sym.b { opacity: .8; }
.b-edge {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    /* With the board: 22px on 6×6, about 17px on 8×8 (it covered the points of the diamonds there) */
    --e: clamp(17px, calc(38cqw / var(--n)), 22px);
    width: var(--e);
    height: var(--e);
    margin: calc(var(--e) / -2) 0 0 calc(var(--e) / -2);
    border-radius: 50%;
    background: var(--board);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 900;
    font-size: calc(var(--e) * .68);
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 1.5px var(--grid);
}
/* Hint spotlight: the = and × inside it stay and get a yellow ring, the others dim (balans.js, showHint) */
.balans.hinting .b-edge:not(.hint-rel) { opacity: .3; transition: opacity .25s; }
.b-edge.hint-rel { box-shadow: 0 0 0 2px var(--yellow); }
.b-edge.err { color: #fff; background: var(--bad); box-shadow: none; }
.balans.solved .b-cell { animation: pop .55s ease both; animation-delay: calc(var(--i) * 22ms); }
/* The finale: the symbols bounce with the wave, and the = and × turn green as it passes */
.balans.solved .sym:not(.ghost) { animation: sym-cheer .5s var(--spring) both; animation-delay: calc(var(--i) * 22ms + 60ms); }
@keyframes sym-cheer { 40% { scale: 1.25; } }
.balans.solved .b-edge { color: #fff; background: var(--good); box-shadow: none; transition: color .25s, background-color .25s; transition-delay: calc(var(--i, 0) * 22ms + 60ms); }
.balans.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.b-cell .ripple { position: absolute; width: 150%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); opacity: 0; transform: translate(-50%, -50%) scale(0); pointer-events: none; animation: ripple .45s ease-out; }
@keyframes ripple { 0% { opacity: .14; transform: translate(-50%, -50%) scale(0); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
@keyframes ring-burst { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes board-pop { 30% { transform: scale(1.025); } 60% { transform: scale(.995); } }

/* ======================================================================
   Kavels
   ====================================================================== */

.kavels {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    grid-template-rows: repeat(var(--n), minmax(0, 1fr));
    aspect-ratio: 1;
    width: 100%;
    background: var(--board);
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none; /* dragging draws a plot */
}
.k-cell {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: inset -1px -1px 0 var(--grid);
    cursor: pointer;
}
.k-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
/* Clues: kept light (64% wide, 2px edges), so they don't look bulky side by side on a board of 8.
   The number stays the strongest thing in them. */
.k-num {
    display: grid;
    place-items: center;
    width: 54%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--board);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(14px, 4.3cqw, 22px);
    line-height: 1;
    box-shadow: 0 0 0 1.75px var(--ink);
    transition: background-color .2s, box-shadow .2s, color .2s, transform .2s var(--spring);
}
/* Shape clues: the circle becomes a square, a lying or a standing block. */
.k-num.s { width: 48%; border-radius: 6px; }
.k-num.h { width: 66%; height: 40%; aspect-ratio: auto; border-radius: 6px; }
.k-num.v { width: 40%; height: 66%; aspect-ratio: auto; border-radius: 6px; }
.k-num.v, .k-num.h, .k-num.x { font-size: clamp(12px, 3.7cqw, 19px); }
.mini-shape { display: inline-block; vertical-align: -2px; margin: 0 2px; border: 2px solid currentColor; border-radius: 3px; }
.mini-shape.h { width: 18px; height: 10px; }
.mini-shape.v { width: 10px; height: 18px; vertical-align: -5px; }
.mini-shape.s { width: 13px; height: 13px; }
/* Oblong: a horizontal and a vertical block on top of each other (you do not know which it is) */
.k-num i { font-style: normal; position: relative; z-index: 1; }
/* Oblong: a lying and a standing block as one shape, with only its outer edge (kavels.js, X_SHAPE):
   the strokes are drawn twice as wide and the fills cover their inner half. */
.k-num.x { position: relative; width: 70%; aspect-ratio: 1; border-radius: 0; background: none !important; box-shadow: none !important; }
.k-x { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.k-x .o rect { fill: none; stroke: var(--ink); stroke-width: 3.5px; vector-effect: non-scaling-stroke; transition: stroke .2s; }
.k-x .f rect { fill: var(--board); transition: fill .2s; }
/* Oblong in the rules: one shape with only its outer edge, as on the board (kavels.js, X_SHAPE) */
.mini-shape.x {
    width: 16px; height: 16px; border: 0; vertical-align: -4px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 1H10.5V5.5H15V10.5H10.5V15H5.5V10.5H1V5.5H5.5Z' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 1H10.5V5.5H15V10.5H10.5V15H5.5V10.5H1V5.5H5.5Z' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Inside a plot a clue has done its job: no disc of its own on the plot's colour, only the number and a
   faint outline (a dark disc with a ring would be heavy on every plot). Its grid lines go too:
   a plot reads as one piece. */
.k-cell.in { box-shadow: none; }
.k-cell.in .k-num { background: transparent; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent); }
.k-cell.in .k-x .o rect { stroke: color-mix(in srgb, var(--ink) 30%, transparent); }
.k-cell.in .k-x .f rect { fill: transparent; }
/* A shape without a number: the outline is the whole clue, so inside a plot it stays readable
   (at 30% it would nearly vanish, on the red stripes of a wrong plot most of all) */
.k-cell.in .k-num:has(> i:empty) { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 60%, transparent); }
.k-cell.in .k-num:has(> i:empty) .k-x .o rect { stroke: color-mix(in srgb, var(--ink) 60%, transparent); }
.k-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.k-rect {
    position: absolute;
    transition: left .15s var(--ease-out), top .15s var(--ease-out), width .15s var(--ease-out), height .15s var(--ease-out);
}
.k-rect::before {
    content: "";
    position: absolute;
    inset: 2.5px;
    border-radius: 7px;
    background: var(--g);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 16%, transparent);
    transition: box-shadow .2s, background-color .2s;
}
.k-rect.new::before { animation: rect-in .32s var(--spring); }
.k-rect.good::before { animation: rect-good .55s var(--spring); }
@keyframes rect-good {
    0% { transform: scale(.9); opacity: .5; }
    45% { transform: scale(1.035); box-shadow: inset 0 0 0 3px var(--good), 0 0 0 5px color-mix(in srgb, var(--good) 30%, transparent); }
}
.k-num.cheer { animation: num-cheer .45s var(--spring); }
@keyframes rect-in { from { transform: scale(.92); opacity: .4; } }
.k-rect.ok::before { box-shadow: inset 0 0 0 1.75px color-mix(in srgb, var(--ink) 34%, transparent); }
.k-rect.bad::before {
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 22%, var(--board)) 0 6px, color-mix(in srgb, var(--bad) 8%, var(--board)) 6px 12px);
    box-shadow: inset 0 0 0 2.5px var(--bad);
}
.k-rect.bad.shake::before { animation: shake .3s; }
/* Going (removed, Terug, Opnieuw): it shrinks away. Grabbed: it sinks a little. In the way: a nudge. */
.k-rect.k-out { pointer-events: none; }
/* (important: else a red plot (shake) or one that was nudged would keep its own animation, and not shrink) */
.k-rect.k-out::before { animation: rect-out .16s ease-in forwards !important; }
@keyframes rect-out { to { transform: scale(.88); opacity: 0; } }
.k-rect.grab::before { transform: scale(.97); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--ink) 50%, transparent); transition: transform .08s; }
.k-rect.nudge::before { animation: k-nudge .25s ease-out; }
@keyframes k-nudge { 30% { transform: scale(.96); } }
/* A plot without a clue: shown red for a moment (kavels.js, addRect), then it fades away. */
.k-gone { transition: opacity .3s; }
.k-gone.out { opacity: 0; }
.k-preview { z-index: 3; transition: none; }
.k-rect.replacing { opacity: .25; transition: opacity .12s; }
.k-preview::before { background: color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: inset 0 0 0 2px var(--ink); }
.k-preview.ok::before { background: color-mix(in srgb, var(--good) 22%, transparent); box-shadow: inset 0 0 0 2px var(--good); }
/* Can't fit any more (two clues, or bigger than its number): a red edge (kavels.js, showPreview) */
.k-preview.no:not(.ok)::before { background: color-mix(in srgb, var(--bad) 10%, transparent); box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.k-preview.snap::before { animation: k-snap .18s var(--spring); }
@keyframes k-snap { 50% { transform: scale(1.03); } }
.k-ghost { z-index: 3; }
.k-ghost::before { background: transparent; box-shadow: inset 0 0 0 3px var(--yellow); animation: k-ghost-ring 1.1s ease-in-out infinite alternate; }
@keyframes k-ghost-ring { to { box-shadow: inset 0 0 0 5px var(--yellow); } }
.k-cell.hint-rel { background: color-mix(in srgb, var(--yellow) 40%, transparent); animation: hint-rel-pulse-tr 1.1s ease-in-out infinite alternate; }
@keyframes hint-rel-pulse-tr { from { background: color-mix(in srgb, var(--yellow) 18%, transparent); } }
/* Cells not in a plot (the board changed while the hint was on its way): a ring per cell */
.k-cell.hint-wrong:not(.in) { box-shadow: inset 0 0 0 3px var(--bad); animation: shake .3s; }
/* A wrong plot in a hint: one red ring around the whole plot (kavels.js, showHint): a plot is one piece */
.k-rect.hint-wrong::before { box-shadow: inset 0 0 0 3px var(--bad); animation: shake .3s; }
.kavels.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.kavels.solved .k-num { animation: num-cheer .5s var(--spring) both; animation-delay: calc(var(--i) * 35ms); }
/* Its own keyframes without a start state: with rect-good (which starts small and faded) and "both",
   every plot would jump to faded at the moment of solving and only come back when the wave reaches it. */
.kavels.solved .k-rect::before { animation: rect-cheer .55s var(--spring) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rect-cheer { 45% { transform: scale(1.035); box-shadow: inset 0 0 0 3px var(--good), 0 0 0 5px color-mix(in srgb, var(--good) 30%, transparent); } }
@keyframes num-cheer { 40% { transform: scale(1.22); } }
.ex-kavels { display: block; width: 210px; height: auto; margin: 0 auto; }

/* ======================================================================
   Zestal
   ====================================================================== */

.zestal {
    --z: #6a46cc;
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 1px; /* thin lines = the background between the cells: equally crisp everywhere */
    aspect-ratio: 1;
    width: 100%;
    background: var(--grid);
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.zestal, .z-pad, .trend.t-zestal) { --z: #a58cf5; } }
:root[data-theme="dark"] :is(.zestal, .z-pad, .trend.t-zestal) { --z: #a58cf5; }
.z-cell {
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: var(--board);
    color: var(--z);
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(20px, 7cqw, 34px);
    line-height: 1;
    transition: background-color .12s;
    cursor: pointer;
}
/* Thick block lines as two layers over the board (after column 3, after rows 2 and 4) */
.zestal::before, .zestal::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.zestal::before { background: linear-gradient(to right, transparent calc(50% - 1.5px), var(--ink) calc(50% - 1.5px), var(--ink) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.zestal::after {
    background: linear-gradient(to bottom,
        transparent calc(33.333% - 1.5px), var(--ink) calc(33.333% - 1.5px), var(--ink) calc(33.333% + 1.5px), transparent calc(33.333% + 1.5px),
        transparent calc(66.667% - 1.5px), var(--ink) calc(66.667% - 1.5px), var(--ink) calc(66.667% + 1.5px), transparent calc(66.667% + 1.5px));
}
.z-cell.given { color: var(--ink); font-weight: 850; }
.z-cell.same { background: color-mix(in srgb, var(--z) 18%, var(--board)); }
.z-cell.sel { background: color-mix(in srgb, var(--z) 30%, var(--board)); transition-duration: 0s; } /* a new selection shows at once (zestal.js selects on touch); the old one still fades out */
.z-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.z-cell.err { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, var(--board)); }
/* Selected and red at once: still clearly selected (red comes later and would hide it, just when you fix a clash) */
.z-cell.err.sel { background: color-mix(in srgb, var(--bad) 26%, var(--board)); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--bad) 70%, var(--board)); }
.z-cell.hint-rel.sel { box-shadow: inset 0 0 0 3px var(--z); }
.z-cell.nope .z-num { animation: shake .25s; }
.z-num { position: relative; z-index: 1; }
/* Own name: num-pop belongs to Spoor (with the same name the last @keyframes wins for the whole document) */
.z-num.pop { animation: z-num-in .28s var(--spring); }
@keyframes z-num-in { from { transform: scale(.4); opacity: .3; } }
/* A digit that goes: it shrinks away on top of the cell (zestal.js, renderCell) */
.z-num.z-out { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; animation: z-num-out .18s ease-in forwards; }
@keyframes z-num-out { to { transform: scale(.5); opacity: 0; } }
.z-cell .ghost { position: absolute; inset: 0; display: grid; place-items: center; color: var(--z); opacity: .45; pointer-events: none; }
.z-cell.hint-rel { background: color-mix(in srgb, var(--yellow) 32%, var(--board)); animation: hint-rel-pulse-bg 1.1s ease-in-out infinite alternate; }
@keyframes hint-rel-pulse-bg { from { background: color-mix(in srgb, var(--yellow) 18%, var(--board)); } }
.z-cell.hint-target::after, .z-cell.hint-wrong::after { content: ""; position: absolute; inset: 3px; border-radius: 6px; pointer-events: none; }
.z-cell.hint-target::after { animation: hint-ring 1.1s ease-in-out infinite alternate; }
.z-cell.hint-wrong::after { box-shadow: 0 0 0 3px var(--bad); }
.zestal.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.zestal.solved .z-cell { animation: pop .55s ease both; animation-delay: calc(var(--i) * 22ms); }
.z-pad { --z: #6a46cc; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.z-key {
    display: grid;
    place-items: center;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--elev);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 800;
    font-size: 24px;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.z-key:active { transform: scale(.94); }
.z-key.tap { animation: key-tap .25s var(--spring); }
@keyframes key-tap { 40% { background: color-mix(in srgb, var(--z) 22%, var(--card)); } }
.z-key.done { opacity: .38; }
/* The selected cell's digit; a digit just placed for the sixth time */
.z-key.cur { box-shadow: var(--elev), inset 0 0 0 2px var(--z); }
.z-key.just-done { animation: key-done .45s var(--spring); }
@keyframes key-done { 40% { transform: scale(1.12); background: color-mix(in srgb, var(--good) 28%, var(--card)); opacity: 1; } }
/*
 * The keypad as wide as the screen allows (up to 440px), not as narrow as the board: on a short
 * phone the board shrinks to fit the height, and the keys would get to about 30px wide.
 */
.board-wrap.with-pad .z-pad { width: min(100cqw, 440px); margin-inline: calc((100% - min(100cqw, 440px)) / 2); }
.z-erase svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.z-pad.off { opacity: .4; pointer-events: none; transition: opacity .3s; }
.tut-board .z-pad { margin-top: 10px; }
.tut-board .z-key { height: 48px; font-size: 21px; }
/* Zestal's tutorial has a keypad of 7 keys: at the narrow tutorial width those would be tiny fingertip
   targets (about 30 px wide on an iPhone). That board gets the full width of the sheet. */
.tut-board:has(.zestal) { width: 100%; }
.ex-zestal { display: grid; grid-template-columns: repeat(3, 34px); grid-auto-rows: 34px; width: max-content; margin: 0 auto; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink); background: var(--board); }
.ex-zestal span { display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: inset -1px -1px 0 var(--grid); }

/* ======================================================================
   Tuinen
   ====================================================================== */

.tuinen {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    grid-template-rows: repeat(var(--n), minmax(0, 1fr));
    aspect-ratio: 1;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none; /* swipe to cross out */
}
.t-cell {
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: var(--g);
    overflow: hidden;
    cursor: pointer;
    /* thin lines inside a garden (the thick ones between gardens: .t-edges) */
    box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--ink) 14%, transparent);
    transition: filter .12s;
}
/*
 * The garden borders, drawn over the cells in one go (tuinen.js): 3 px, square ends, one solid colour
 * (the old half see-through one over a light garden). Clipped by the board's rounded corners.
 */
.t-edges { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: hidden; }
.t-edges path { fill: none; stroke: color-mix(in srgb, var(--edge-solid) var(--edge-pct), var(--board)); stroke-width: 3px; vector-effect: non-scaling-stroke; stroke-linecap: square; }
.t-cell:active { filter: brightness(.94); }
@media (hover: hover) and (pointer: fine) { .t-cell:hover { filter: brightness(.97); } }
.t-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.t-mark { position: relative; z-index: 1; display: grid; width: 84%; height: 84%; pointer-events: none; }
.t-mark > svg, .t-cell .ghost > svg { grid-area: 1 / 1; width: 100%; height: 100%; }
.t-cell .cross { padding: 18%; stroke: var(--mark); stroke-width: 2.6; stroke-linecap: round; fill: none; opacity: 0; transform: scale(.4); transition: opacity .12s, transform .18s var(--spring); }
.t-cell .tree { opacity: 0; transform: scale(.2) translateY(20%); transform-origin: 50% 85%; transition: opacity .1s, transform .3s var(--spring); }
/* In dark the light trees sank into the green and teal gardens: a soft shadow lifts them off any colour */
.t-cell .tree { filter: var(--tree-lift); }
.tree .crown { fill: var(--tree); }
.tree .trunk { fill: var(--trunk); }
.tree .shine { fill: #fff; opacity: .28; }
.t-cell[data-s="1"] .t-mark .cross { opacity: 1; transform: none; }
.t-cell[data-s="2"] .t-mark .tree { opacity: 1; transform: none; }
.t-cell.planted .t-mark .tree { animation: tree-sway .5s ease-out .12s; }
/* A tree going in: a green ring bursts out (tuinen.js, plant) */
.t-cell .burst { position: absolute; inset: 24%; /* (grows to 1.9x: from 16% it would be cut off square by the cell) */ border-radius: 50%; border: 3px solid var(--tree); opacity: 0; pointer-events: none; animation: ring-burst .6s cubic-bezier(.2, .8, .2, 1); }
/* The finger lands: the cell sinks at once (tuinen.js, press) */
.t-cell.press { filter: brightness(.9); transition: none; }
.t-cell.press .t-mark { scale: .9; }
.t-mark { transition: scale .12s; }
/* Terug: the cells that changed back blink once */
.t-cell.undone { animation: cell-undone .45s ease-out; }
@keyframes cell-undone { 0% { filter: brightness(.78); } }
@keyframes tree-sway { 30% { rotate: -6deg; } 65% { rotate: 3deg; } }
/* Cell where a neighbouring tree rules out another tree */
.t-cell::after {
    content: "";
    position: absolute;
    width: 14%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--mark);
    opacity: 0;
    transform: scale(0);
    transition: opacity .15s, transform .2s var(--spring);
    transition-delay: var(--d, 0ms);
    pointer-events: none;
}
.t-cell.blk[data-s="0"]::after { opacity: .7; transform: none; }
/* A swipe passing over a dot: it stays (it says "no tree" already), with a little nod (tuinen.js, dragTo) */
.t-cell.blk.swept[data-s="0"]::after { animation: swept-nod .3s var(--spring); }
@keyframes swept-nod { 40% { transform: scale(1.7); opacity: 1; } }
/* Errors */
.t-cell.err .tree .crown { fill: var(--bad); }
/* An error is never just a colour: also a red ring around the cell (a garden can itself be warm-coloured) */
.t-cell.err::before { content: ""; position: absolute; inset: 3px; border-radius: 7px; box-shadow: 0 0 0 3px var(--bad), inset 0 0 0 999px color-mix(in srgb, var(--bad) 18%, transparent); pointer-events: none; animation: fade-in .2s ease both; }
.t-cell.err .t-mark { animation: shake .3s; }
.t-cell.dead::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 30%, transparent) 0 5px, transparent 5px 10px);
    pointer-events: none;
    animation: fade-in .2s ease both;
}
/* Hints */
/* The garden (or row, column) a hint is about: yellow stripes, not a flat yellow tint. A flat tint
   vanishes on the sandy and yellow gardens ("ik zie geen gemarkeerde tuin"). The rest fades back more. */
.t-cell.hint-rel::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, #e0a400 62%, transparent) 0 5px, transparent 5px 11px);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #c98a00 70%, transparent);
    animation: hint-rel-pulse 1.1s ease-in-out infinite alternate;
}
@keyframes hint-rel-pulse { from { opacity: .55; } }
.tuinen.hinting .t-cell:not(.hint-rel):not(.hint-target) { filter: saturate(.25) brightness(.72); transition: filter .25s; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tuinen.hinting .t-cell:not(.hint-rel):not(.hint-target) { filter: saturate(.2) brightness(.88) opacity(.7); } }
:root[data-theme="light"] .tuinen.hinting .t-cell:not(.hint-rel):not(.hint-target) { filter: saturate(.2) brightness(.88) opacity(.7); }
.t-cell.hint-target::before { content: ""; position: absolute; inset: 3px; border-radius: 6px; pointer-events: none; animation: hint-ring 1.1s ease-in-out infinite alternate; }
.t-cell.hint-wrong::before { content: ""; position: absolute; inset: 3px; border-radius: 6px; box-shadow: 0 0 0 3px var(--bad); pointer-events: none; }
.t-cell.hint-wrong .t-mark { animation: shake .3s; }
@keyframes hint-ring { from { box-shadow: 0 0 0 3px var(--yellow); } to { box-shadow: 0 0 0 5px var(--yellow); } }
.t-cell .ghost { position: absolute; inset: 8%; display: grid; opacity: .45; pointer-events: none; } /* as big as the real tree: it lands right on its ghost */
.t-cell .ghost .tree, .t-cell .ghost .cross { opacity: 1; transform: none; }
.t-cell .ripple { position: absolute; width: 150%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); opacity: 0; transform: translate(-50%, -50%) scale(0); pointer-events: none; animation: ripple .45s ease-out; }
/* Solved: the trees sway one by one, the board briefly bounces */
.tuinen.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
/* The trees hop for joy, but stay inside their cell (it clips): a smaller jump, no springy overshoot. */
.tuinen.solved .t-cell[data-s="2"] .tree { animation: tree-cheer .6s ease-out both; animation-delay: calc(var(--i) * 30ms); }
@keyframes tree-cheer { 35% { transform: translateY(-4%) scale(1.15); } 65% { transform: scale(1.04, .95); } }
/* The finale: the gardens light up in the same wave as the trees, and the crosses and dots wipe away with it */
/* (no fill mode: kept after the wave, the filter put every cell on a layer of its own, and thin seams
   showed between the cells of the solved board: white lines in light mode, dark ones in dark mode) */
.tuinen.solved .t-cell { animation: unit-bright .5s var(--ease-out); animation-delay: calc(var(--i) * 30ms); }
.tuinen.solved .t-cell[data-s="1"] .cross, .tuinen.solved .t-cell::after { opacity: 0; transition-delay: calc(var(--i) * 30ms); }

/* Example in the rules */
.ex-minis { display: flex; justify-content: center; gap: 18px; }
.ex-mini { display: flex; align-items: center; gap: 10px; }
.ex-grid { display: grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 26px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink); background: var(--g2); }
.ex-grid span { display: grid; place-items: center; box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--ink) 14%, transparent); }
.ex-grid .tree { width: 80%; height: 80%; }
.ex-mini b { font-size: 18px; color: var(--good); }
.ex-mini.nok b { color: var(--bad); }

@keyframes pop {
    40% { background: color-mix(in srgb, var(--good) 24%, var(--board)); transform: scale(.92); }
    100% { background: color-mix(in srgb, var(--good) 9%, var(--board)); transform: none; }
}
@keyframes hint-glow {
    from { box-shadow: inset 0 0 0 3px var(--yellow); }
    to { box-shadow: inset 0 0 0 5px var(--yellow); }
}

/* ======================================================================
   Result
   ====================================================================== */

.result { max-width: 480px; margin: 0 auto; }
/* No padding at the bottom: what follows (XP card, buttons) sits exactly 20px below the last line. */
.result-top { text-align: center; padding: 14px 0 0; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--elev);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}
.badge.ok { background: var(--good); color: var(--on-good); box-shadow: none; }
.big-time {
    font-family: var(--display);
    font-size: clamp(68px, 22vw, 96px);
    font-weight: 900;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 12px;
}
/* The time as the last thing on top: its line box has .145em of air under the digits. Without that,
   the XP card hung 34px under the digits and the buttons 20px under the card. */
.big-time:last-child { margin-bottom: -0.145em; }
/* A race you gave up: "Opgegeven" in place of the time, smaller (a word, not digits) and muted */
.big-time.quit { font-size: clamp(40px, 13vw, 56px); letter-spacing: -0.02em; color: var(--ink-3); }
.result.fresh .big-time { animation: time-move .5s var(--spring) both, fade-in 0.3s ease both; }
/* The counted-up time lands with a stamp (result.js) */
.result.fresh .big-time.landed { animation: time-land .32s var(--spring); }
@keyframes time-land { 40% { transform: scale(1.07); } }
/* Just solved: what the time means rises in once it has landed, one line after the other (result.js
   adds .seq-in and then .go). Until then it holds its place, so nothing below moves. */
.result.seq .seq-in:not(.go) { opacity: 0; animation: none; }
.result.seq .seq-in.go { opacity: 0; animation: rise-move .45s var(--spring) both, appear .25s ease forwards; animation-delay: calc(var(--i, 0) * 70ms); }
/* The parts of the XP gain wait dimmed, and light up with a pop as the count passes them (profile.js, playXp) */
.result.seq .xp-parts span { transition: opacity .2s ease; }
.result.seq .xp-parts span:not(.go) { opacity: .4; animation: none; }
.result.seq .xp-parts span.go { animation: pop-move .4s var(--spring) both; }
/* The end of a duel comes in with the screen, as the XP card (at .6s it left a big empty space a moment);
   a won one pops on its moment, with the chime (result.js) */
.result.seq .duel-end-strip.go { animation: strip-pop .6s var(--spring); }
@keyframes strip-pop { 35% { transform: scale(1.04); box-shadow: var(--elev), 0 0 0 4px color-mix(in srgb, var(--yellow) 45%, transparent); } }
/*
 * The lines under the big time (result.js: rankLine, then topLines): your place a size larger, what
 * follows (this puzzle, how close it was) smaller, all in one style: grey text, names and times bold.
 * Each its own block with the same gap, also the one with a trophy (a flex row, not inline: an inline
 * box sat in a line of the page's own height and got extra space).
 */
.rank-line { margin-top: 8px; font-size: 17px; line-height: 1.35; color: var(--ink-2); text-wrap: balance; }
.rank-line:empty { display: none; }
.rank-line strong, .on-puzzle strong, .close-line strong { color: var(--ink); font-weight: 700; }
.on-puzzle, .close-line { margin-top: 6px; font-size: 14.5px; line-height: 1.35; color: var(--ink-2); text-wrap: balance; }
.on-puzzle { display: flex; justify-content: center; align-items: center; gap: 6px; }
/* No place line (practice): the first line keeps the same distance to the time */
.rank-line:empty + :is(.on-puzzle, .close-line) { margin-top: 8px; }
.on-puzzle svg { width: 16px; height: 16px; color: #c98a00; flex: none; }
.hint-note { margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.streak-line { display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: var(--streak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 55%, transparent); font-weight: 650; font-size: 15px; }
/* Rows skipped above this one: a dashed line. Not above your own row: its colour already sets it apart
   and the place number says rows were skipped (as the day standings, .ds-row.gap) */
.lb li.gap, .week-list li.gap { border-top: 2px dashed var(--line); }
.lb li.me.gap, .week-list li.me.gap { border-top-color: transparent; }

.panel { margin-top: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.panel h2 { font-family: var(--display); font-size: 21px; font-weight: 850; letter-spacing: -0.01em; }
.panel > p { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.invite-more { padding: 4px 18px; }
.invite-first { margin: 14px 0; }
/* Duel page: invite your duel partners directly, above the link */
.invite-label { margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
[data-invite-direct] .invite-go { margin-top: 10px; }
.invite-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.invite-or::before, .invite-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.invite-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; font-weight: 650; list-style: none; }
.invite-more summary::-webkit-details-marker { display: none; }
.invite-more summary::after { content: ""; width: 7px; height: 7px; margin: -3px 4px 0 0; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s, margin .2s; }
.invite-more[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.invite-more[open] { padding-bottom: 18px; }
.invite-more > p { margin-top: 0; font-size: 15px; color: var(--ink-2); }
.share-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 5px 5px 5px 14px;
    border-radius: var(--r);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.share-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.share-link .btn { min-height: 38px; padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }

.name-box { margin-top: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.name-box p { font-weight: 650; margin-bottom: 10px; }
.name-box form { display: flex; gap: 8px; }
.name-box .input { min-height: 48px; }
.name-box .btn { flex: none; }

.tabs { display: flex; gap: 2px; padding: 3px; margin: 26px 0 10px; border-radius: 13px; background: var(--fill); }
.tab { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }

.board-title { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--ink); margin: 28px 4px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.board-title small { font-family: var(--font); font-weight: 500; font-size: 13px; color: var(--ink-3); }
.lb { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--elev); overflow: hidden; }
.lb li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 16px; border-top: 1px solid var(--line); }
.lb li:first-child { border-top: 0; }
.lb .pos { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: center; }
.lb .medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #18171a; }
.lb .medal.m1 { background: var(--yellow); }
.lb .medal.m2 { background: #cfccc6; }
.lb .medal.m3 { background: #dca27a; }
.lb li.with-face { grid-template-columns: 30px 34px minmax(0, 1fr) auto; }
/* Who is in a duel before there are standings (duels.js): no place number, so no column for it */
.lb.members li.with-face { grid-template-columns: 34px minmax(0, 1fr); }
.lb li.with-face .face { margin-right: 0; }
/* Only the name is cut off when there is little room: "jij" and your emoji stay visible */
.lb .who { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-weight: 600; min-width: 0; white-space: nowrap; }
.lb .who .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb .who small, .lb .who .re { flex: none; }
.lb .who .live-dot { flex: none; align-self: center; margin-right: 0; }
.lb .who small { font-weight: 600; color: var(--ink-3); font-size: 13px; }
.lb .who .sub { display: block; flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.lb .t { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.lb .t small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
/* Standings: the points as a big number with "punten" below, so the line next to it has room */
.lb .t.pts { min-width: 44px; font-size: 20px; line-height: 1; text-align: center; } /* (one width for every row: "1 punt" stood out of line with "punten") */
.lb .t.pts small { margin-top: 2px; font-size: 11px; }
.lb li.me { background: var(--me); }
.lb li.playing .who { color: var(--ink-3); font-weight: 500; }
.lb li.playing .t { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.lb li.quit .t { color: var(--ink-3); font-weight: 500; font-style: italic; font-size: 14px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 8px; animation: blink 1.4s infinite; }

.lb .who .re { font-size: 16px; }
.lb .who .re.in { display: inline-block; animation: react-pop .4s var(--spring); }
.react { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.react button {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--card);
    box-shadow: var(--elev);
    font-size: 22px;
    line-height: 1;
    transition: transform .12s var(--spring), background-color .15s, box-shadow .15s;
}
.react button:active { transform: scale(.88); }
.react button[aria-pressed="true"] { background: color-mix(in srgb, var(--yellow) 45%, var(--card)); box-shadow: none; transform: scale(1.06); }
.react button.pop { animation: react-pop .4s var(--spring); }
@keyframes react-pop { 40% { transform: scale(1.3) rotate(-8deg); } }

.rate { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.rate button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--elev); display: grid; place-items: center; color: var(--ink-2); transition: transform .1s; }
.rate button:active { transform: scale(.9); }
.rate button svg { width: 19px; height: 19px; }
.rate button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }

/* ======================================================================
   Dialog (sheet) with blurred backdrop
   ====================================================================== */

dialog.sheet {
    --sheet-pad: 24px; /* its side padding: what slides (standings) slides up to the edge */
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100dvh - 40px);
    padding: 24px;
    border: 0;
    border-radius: 26px;
    /*
     * A hair short of solid (99.5%: to the eye the same). Chrome on Android leaves out what lies under a
     * solid layer, also in its round corners: the blurred background then stopped at the sheet's box and
     * the page showed sharp in the corners (a tall sheet like a profile card most of all). Not solid, it
     * draws what is behind it, round corners and all. (A clip-path in their shape did not help.) The
     * glow of the week-end screen covers the corners too: .wr-glow, the same.
     */
    background: color-mix(in srgb, var(--card) 99.5%, transparent);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--line), 0 24px 64px rgba(0, 0, 0, .22);
    overscroll-behavior: contain;
}
dialog.sheet::backdrop {
    background: rgba(14, 14, 16, .22);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}
/* On a touch screen no scrollbar in a sheet, as in apps: it ran straight up along the round corners. With
   a mouse it stays, where it is the only sign that a sheet goes on below. */
@media (pointer: coarse) {
    dialog.sheet { scrollbar-width: none; }
    dialog.sheet::-webkit-scrollbar { display: none; }
}
dialog.sheet[open] { animation: rise .3s var(--ease-out); }
dialog.sheet[open]::backdrop { animation: fade .25s ease; }
dialog.sheet h2 { font-family: var(--display); font-size: 28px; font-weight: 900; letter-spacing: -0.015em; }
dialog.sheet .actions { display: grid; gap: 10px; margin-top: 20px; }
dialog.sheet .art { width: 54px; height: 54px; margin-bottom: 12px; }
dialog.sheet .lead { color: var(--ink-2); margin-top: 8px; }
dialog.sheet .steps { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
dialog.sheet .steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
dialog.sheet .steps b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill-2); font-size: 14px; font-weight: 700; }
dialog.sheet .steps h3 { font-size: 16px; font-weight: 650; }
dialog.sheet .steps p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }

@media (max-width: 599px) {
    dialog.sheet {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
        border-radius: 26px 26px 0 0;
        --sheet-pad: 20px;
        padding: 12px 20px calc(20px + var(--sab));
        max-height: 92dvh;
    }
    dialog.sheet::before {
        content: "";
        display: block;
        width: 36px;
        height: 5px;
        margin: 0 auto 14px;
        border-radius: 3px;
        background: var(--line-2);
    }
    dialog.sheet[open] { animation: sheet-up .34s var(--ease-out); }
}

/* ======================================================================
   Toast, confetti, loading
   ====================================================================== */

/* The toast (and the notice below) may be a popover: then it sits in the top layer, above an open
   dialog (showModal) and the intro animation. We reset the browser's [popover] styles here (inset,
   margin, border, overflow), and display is fixed: even when closed it stays a fixed layer that fades
   in and out via .show. Without popover support everything works as before. */
.toast {
    position: fixed;
    inset: auto;
    left: 50%;
    bottom: calc(92px + var(--sab)); /* above the tab bar */
    z-index: 50;
    display: block;
    margin: 0;
    border: 0;
    overflow: visible;
    transform: translate(-50%, 16px);
    width: max-content;
    max-width: min(calc(100vw - 32px), 520px);
    padding: 12px 18px;
    border-radius: 20px; /* not a pill: with two lines it would become an oval */
    /* Liquid glass, floating over the page: dense enough to read over anything */
    background: color-mix(in srgb, var(--paper) 72%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--ink);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
    text-wrap: balance;
    opacity: 0;
    visibility: hidden; /* empty and hidden: keep it out of screen transitions too */
    pointer-events: none;
    transition: opacity .2s, transform .25s var(--ease-out), visibility 0s .25s;
    box-shadow: var(--lg-rim), var(--lg-shadow);
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* In-app notice (shown instead of a push notification while the app is open). */
.notice {
    position: fixed;
    inset: auto;
    top: calc(var(--sat) + 10px);
    left: 50%;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    border: 0;
    overflow: visible;
    width: min(calc(100vw - 24px), 440px);
    padding: 12px 14px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--paper) 72%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--lg-rim), var(--lg-shadow);
    color: var(--ink);
    text-decoration: none;
    touch-action: none;
    user-select: none;
    transform: translate(-50%, calc(-100% - 24px));
    transition: transform .42s var(--spring);
}
.notice.show { transform: translate(-50%, 0); }
.notice-mark { flex: none; width: 34px; height: 34px; }
.notice-text { min-width: 0; display: grid; gap: 1px; }
.notice-text b { font-weight: 700; font-size: 15px; }
.notice-text span { font-size: 14px; color: var(--ink-2); line-height: 1.3; text-wrap: pretty; }
/* While playing: above the toolbar */
body.is-game .toast { bottom: calc(96px + var(--sab)); }
/* Over an open sheet: at the top, on the dimmed page (at the bottom it covered the sheet's own fields and buttons) */
/* Shown while a sheet is open (toast in core.js): at the top, where the sheet doesn't cover it */
.toast.top, body.is-game .toast.top { bottom: auto; top: calc(var(--sat) + 16px); transform: translate(-50%, -16px); }
.toast.top.show { transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: 36%; left: 50%; width: 10px; height: 10px; opacity: 0; animation: confetti 1.4s cubic-bezier(.15, .7, .4, 1) forwards; }
.confetti i.c { border-radius: 50%; }
.confetti i.d { transform: rotate(45deg); border-radius: 2px; }
.confetti i.l { width: 16px; height: 5px; border-radius: 3px; }

@keyframes confetti {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}

/* Skeletons: shapes of what is loading, with a shimmer running over them (see skeletonHtml) */
.sk { position: relative; display: block; overflow: hidden; border-radius: 10px; background: var(--sk-base); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--sk-shine), transparent); animation: sk-shimmer 1.3s ease-in-out infinite; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }
/* The shapes only after a moment: when the data comes quickly, grey blocks that vanish at once read as a flash. The
   layout is there from the start, so nothing shifts */
.sk { animation: sk-in .2s ease .2s both; }
@keyframes sk-in { from { opacity: 0; } }
.sk-line { height: 13px; border-radius: 7px; }
.sk-line.sm { height: 10px; }
.sk-face { flex: none; width: 34px; height: 34px; border-radius: 50%; }
.sk-face.big { width: 58px; height: 58px; }
.sk-num { flex: none; width: 34px; height: 16px; border-radius: 8px; }
.sk-list { display: grid; }
.sk-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-top: 1px solid var(--line); }
.sk-row:first-child { border-top: 0; }
.sk-lines { flex: 1; display: grid; gap: 7px; min-width: 0; }
.sk-page { display: grid; gap: 14px; padding-top: 4px; }
/* Duels: the real layout's sizes (header 44, title 28 below it, opponents row 126, next title 27 below) */
.sk-page.sk-duels { display: block; padding-top: 0; margin-top: 8px; }
.sk-duels .sk-dhead { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.sk-duels .sk-dhead .sk-line { width: 34%; height: 30px; margin: 0 4px; }
.sk-duels .sk-dhead .sk-pill { width: 139px; height: 44px; border-radius: 999px; }
.sk-duels .sk-title { margin: 28px 4px 0; }
.sk-duels .sk-rivals + .sk-title { margin-top: 27px; }
.sk-duels .sk-block { margin-top: 10px; }
.sk-rivals { display: flex; gap: 6px; height: 126px; margin-top: 10px; padding: 12px 0 0; overflow: hidden; }
.sk-rivals > span { flex: none; display: grid; justify-items: center; align-content: start; gap: 10px; width: 76px; }
.sk-rivals .sk-face { width: 52px; height: 52px; }
.sk-rivals .sk-line { width: 48px; }
.sk-hero { height: 132px; border-radius: var(--r-lg); }
.sk-hero.tall { height: 236px; }
.sk-btn { height: 58px; border-radius: var(--r); }
.sk-title { width: 34%; height: 22px; margin: 10px 4px 0; border-radius: 8px; }
.sk-card-line { height: 56px; border-radius: var(--r); }
.sk-card-line.tall { height: 62px; margin-top: 4px; }
.sk-game { justify-items: center; padding-top: 8px; }
.sk-game .sk-board { width: 100%; aspect-ratio: 1; border-radius: 18px; margin-top: 40px; }
.sk-game .sk-bar { width: 100%; height: 66px; border-radius: 20px; margin-top: 60px; }
/* Home skeleton: the same sizes as the real blocks (measured), so nothing shifts when they arrive */
.sk-daily .daily-head { align-items: center; height: 45px; }
.sk-daily .daily-head > div { display: grid; align-content: center; height: 45px; }
.sk-pill { width: 66px; height: 31px; border-radius: 999px; }
.sk-daily .week-strip { height: 45px; overflow: hidden; }
.sk-daily .ws { gap: 6px; align-content: start; }
/* (.ws i styles the real circles: don't let it round the letter placeholder too) */
.ws i.sk-dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: none; background: var(--sk-base); }
.ws i.sk-letter { width: 9px; height: 9px; border-radius: 4px; box-shadow: none; background: var(--sk-base); }
.sk-tile { height: 100px; border-radius: 18px; } /* = .daily-tile */
.sk-rowbar { flex: 1; height: 42px; border-radius: var(--r); }
.sk-block { border-radius: var(--r-lg); }
.sk-list-card .sk-duel { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 10px 16px 10px 12px; border-top: 1px solid var(--line); }
.sk-list-card .sk-duel:first-child { border-top: 0; }
.sk-list-card .sk-face { width: 40px; height: 40px; }
.home-duels .section-title .sk { margin: 1px 0; }
.sk-prof-head { display: flex; align-items: center; gap: 14px; }
.week-list .sk.face { border-radius: 50%; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--ink); animation: spin .7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
/* Springy entrances move with the spring, but fade in on a plain curve: a spring that overshoots
   100% on opacity made Chrome on Android flash the element once, right after it appeared. */
@keyframes rise-move { from { transform: translateY(14px) scale(.98); } }
@keyframes pop-move { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } }
@keyframes time-move { from { transform: scale(.85); } }
@keyframes badge-move { from { transform: translateY(-120%) scale(.9); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes sink { to { transform: translateY(14px) scale(.98); opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
dialog.sheet.closing { animation: sink .2s ease-in forwards; pointer-events: none; }
/* The blurred background fades evenly with the sheet's way out (linear, done just before it: the dialog
   really closes when the sheet's animation ends). With "ease" half of it was gone before the sheet moved. */
dialog.sheet.closing::backdrop { animation: fade-out .2s linear forwards; }
@media (max-width: 599px) {
    dialog.sheet.closing { animation: sheet-down .26s cubic-bezier(.4, 0, 1, 1) forwards; }
    dialog.sheet.closing::backdrop { animation-duration: .24s; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
/*
 * Coming in after a delay: hidden in the element's own style (opacity: 0), and "appear" brings it in
 * and keeps it (forwards). Not only through the animation's start (fade-in ... both): Safari sometimes
 * draws a new screen or panel before a delayed animation has begun, and the element flashed in full
 * view, vanished, and then came in.
 */
@keyframes appear { to { opacity: 1; } }

.noscript { text-align: center; padding: 60px 0; }

/* ======================================================================
   Sliding between screens (router.js, slide()): the old screen in a
   "ghost" layer, the new one is the page itself; the bars stay live.
   ====================================================================== */

.ghost-view { position: fixed; inset: 0; overflow: hidden; background: var(--paper); pointer-events: none; }
/* While sliding, the new screen needs its own ground (it moves over the ghost, or out from under it).
   Only paint and size change here, never position or overflow: Safari rebuilds the page for those,
   and what was animating in on the new screen started all over again when the slide ended. */
/* Down to the bottom of the screen, from where it starts (--main-top, router.js): a whole screen's height
   under the top bar made a short page taller than the screen while it slid in. It scrolled, and when
   the slide ended and the page got its own height back, iOS put the tab bar half under the edge. */
html.sliding main { min-height: calc(100dvh - var(--main-top, 0px)); background: var(--paper); }
/*
 * What comes in by itself on a new screen (the podium) waits until the screen has arrived, on every
 * device: animating during the slide, Safari started it over when the slide ended (it vanished and
 * came in a second time). Hidden meanwhile (opacity 0, "appear"), it starts once the slide is done.
 */
html.sliding #app .pod { animation: none; }
html.sliding .topbar { background: var(--paper); }
/* Moved into the ghost, the old screen would replay its entrance animations: it simply stays as it was */
.ghost-view, .ghost-view * { animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; } /* (straight to the end: what came in stays in) */
/* The edge of the screen on top casts a soft shadow on the one below */
.slide-edge { box-shadow: -12px 0 40px rgba(0, 0, 0, .12); }

@media (prefers-reduced-motion: reduce) {
    /* Once (straight to the end), not infinitely: a repeating .01ms animation flickers */
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    /* A spinner may keep turning slowly, otherwise the app looks frozen */
    .spinner, .level.loading::after, .btn-spin, .ptr.busy svg { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
    /* These hints consist only of their animation: without motion, a static ring */
    .b-cell.hint-target { box-shadow: inset 0 0 0 4px var(--yellow); }
    .z-cell.hint-target::after, .t-cell.hint-target::before, .v-cell.hint-target::before { box-shadow: 0 0 0 4px var(--yellow); }
    .l-cell.hint-target::after { box-shadow: 0 0 0 4px var(--l-ring); }
    .spoor-svg.fresh .start-ring { opacity: .6; }
}

/* ======================================================================
   Intro animation (once per session): the logo draws itself as a
   Spoor line, the name appears, and the red backdrop retracts as a
   circle. Same red as the app's splash screen.
   ====================================================================== */

.intro {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    color: #fff;
    /* Fallback without JavaScript: simply disappears after a while */
    animation: intro-out .55s cubic-bezier(.7, 0, .25, 1) 3s forwards;
}
.intro-bg { position: absolute; inset: 0; background: #db4429; }
.intro.flying { animation: none; pointer-events: none; }
.intro.out { animation: intro-out .45s cubic-bezier(.7, 0, .25, 1) forwards; }
.no-intro .intro { display: none; }
/* During the intro the real logo waits invisibly at the top left as the landing spot */
.intro-on .topbar .brand { visibility: hidden; }
.intro-mark { position: relative; display: grid; justify-items: center; gap: 16px; transform: translateY(-4%); }
.intro svg, .intro-name { transform-origin: 0 0; }
.intro svg { width: 104px; height: 104px; overflow: visible; animation: intro-pop .4s cubic-bezier(.3, 1.6, .5, 1) .94s both; }
/* On the red only the lines, as on the splash screen: the edge of the board would show there as a square
   that suddenly stops. The board (src/php/logo.php) fades in while the mark flies to the top bar (app.js). */
.intro .logo-board { opacity: 0; }
/* The logo draws itself as a Spoor line */
.intro-line {
    fill: none;
    stroke: #fff;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    /* Hidden until it draws: an undrawn line still shows its round end cap as a dot */
    visibility: hidden;
    animation: intro-draw .5s cubic-bezier(.65, 0, .35, 1) .16s forwards;
}
.intro-dot { fill: #fff; transform-box: fill-box; transform-origin: center; animation: intro-dot .4s cubic-bezier(.3, 1.6, .5, 1) both; }
/* The d (the opponent) answers the p a beat later, in softer white: solid (LOGO_SOFT_RED), through a
   translucent line the gaps of the board would show once it fades in */
.intro-d .intro-line { stroke: #f1b8ae; animation-delay: .44s; }
.intro-d .intro-dot { fill: #f1b8ae; animation-delay: .3s; }
.intro-name {
    font-family: var(--display);
    font-weight: 800;
    font-size: 30px;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: intro-name .45s cubic-bezier(.2, .8, .2, 1) .55s forwards;
}
/* Picking up from Android's splash screen (the Play app, an installed app; index.php): the logo stands
   there finished, as big and as central as on the splash (--splash-logo), without the name under it
   (that fades in while flying, app.js). */
.intro-cont .intro-mark { transform: none; }
.intro-cont .intro svg { width: var(--splash-logo); height: var(--splash-logo); animation: none; }
.intro-cont .intro-line, .intro-cont .intro-dot { animation: none; stroke-dashoffset: 0; visibility: visible; }
.intro-cont .intro-name { position: absolute; top: 100%; margin-top: 16px; animation: none; }
@keyframes intro-draw { from { visibility: visible; } to { visibility: visible; stroke-dashoffset: 0; } }
@keyframes intro-dot { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes intro-pop { 50% { transform: scale(1.1); } }
@keyframes intro-name { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes intro-out {
    from { clip-path: circle(150% at 50% 46%); }
    to { clip-path: circle(0% at 50% 46%); visibility: hidden; }
}

/* ======================================================================
   Lampen
   ====================================================================== */

.lampen, .ex-lampen {
    /* Warm light. Mixed with the board: a soft yellow on white, a glow on the dark board. */
    --l-light: #ffbe2e;
    --l-lit: color-mix(in srgb, var(--l-light) 31%, var(--board));
    --l-hot: color-mix(in srgb, var(--l-light) 62%, var(--board)); /* area right around the lamp */
    --l-bulb: #ffb81c;
    --l-bulb-edge: #b07a0c;
    --l-ray: color-mix(in srgb, var(--l-bulb-edge) 70%, var(--ink)); /* darker on white, lighter in dark mode */
    /* Walls: near black on white, stone grey in dark mode (lighter than the board, but never bright) */
    --l-wall: color-mix(in srgb, var(--ink) 20%, #1b1a1d);
    --l-x: color-mix(in srgb, var(--ink) 42%, transparent);
    --l-ring: color-mix(in srgb, var(--yellow) 62%, var(--ink)); /* hint ring: yellow would vanish against the lit cells */
}
.lampen {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    grid-template-rows: repeat(var(--n), minmax(0, 1fr));
    gap: 1px; /* thin lines = the background between the cells */
    aspect-ratio: 1;
    width: 100%;
    background: var(--grid);
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    container-type: inline-size; /* numbers and lamps scale with the cells */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none; /* swipe to cross out */
}
/*
 * Boards whose lines are their background showing between the cells (gap: 1px). The frame (a shadow
 * outside the board) and the last column or row don't always end on the same device pixel: on a phone
 * the cells could stop a hair short, and a sliver of line colour showed between a dark cell and the
 * frame (on the right, not on the left, where both start together). The outermost pixel of the board
 * is the frame's colour, so such a sliver disappears into the frame.
 */
:is(.zestal, .lampen) { background: linear-gradient(var(--grid), var(--grid)) 1px 1px / calc(100% - 2px) calc(100% - 2px) no-repeat, var(--frame, var(--ink)); }
:is(.zestal.solved, .lampen.solved) { --frame: var(--good); }
.l-cell {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background-color: var(--board);
    background-repeat: no-repeat;
    overflow: hidden;
    cursor: pointer;
    /* turning on spreads as a ripple from the lamp, turning off drains back into it (--d, lampen.js) */
    transition: background-color .3s var(--ease-out) var(--d, 0ms), box-shadow .25s ease;
}
.l-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; z-index: 3; }
.l-cell:not(.wall):active { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ink) 7%, transparent); }
@media (hover: hover) and (pointer: fine) { .l-cell:not(.wall):hover { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ink) 4%, transparent); } }
.l-cell.lit { background-color: var(--l-lit); }
/* A swipe passing over a lit cell: it stays (its light says "no lamp" already), with a little glint (lampen.js, dragTo) */
.l-cell.lit.swept { animation: swept-glint .3s ease-out; }
@keyframes swept-glint { 35% { filter: brightness(1.18); } }
.l-cell.lit[data-s="2"] { background-image: radial-gradient(closest-side, var(--l-hot), transparent); }

/* The ripple: a warm flash running outward from the new lamp */
.l-glow { position: absolute; inset: 0; background: var(--l-light); opacity: 0; pointer-events: none; }
.l-cell.wave .l-glow { animation: l-wave .55s ease-out var(--d, 0ms) both; }
@keyframes l-wave { 0% { opacity: 0; } 30% { opacity: .5; } 100% { opacity: 0; } }

/* Lamp and cross */
.l-mark { position: relative; z-index: 1; display: grid; width: 82%; height: 82%; pointer-events: none; }
.l-mark > svg, .l-cell .ghost > svg { grid-area: 1 / 1; width: 100%; height: 100%; overflow: visible; }
.l-cell .cross { padding: 20%; stroke: var(--l-x); stroke-width: 2.6; stroke-linecap: round; fill: none; opacity: 0; transform: scale(.4); transition: opacity .12s, transform .18s var(--spring); }
.l-cell .lamp { opacity: 0; transform: scale(.3); transition: opacity .1s, transform .25s var(--spring); }
.lamp .glass { fill: var(--l-bulb); stroke: var(--l-bulb-edge); stroke-width: 1.3; stroke-linejoin: round; }
.lamp .base { fill: color-mix(in srgb, var(--ink) 55%, var(--board)); }
.lamp .shine { fill: #fff; opacity: .6; }
.lamp .rays { fill: none; stroke: var(--l-ray); stroke-width: 1.8; stroke-linecap: round; }
.l-cell[data-s="1"] .l-mark .cross { opacity: 1; transform: none; transition-delay: var(--d, 0ms); } /* (back when the light has drained away) */
/* Light sweeps the crosses away: a crossed-out cell that is lit fades (no lamp can go there anyway) */
.l-cell.lit[data-s="1"] .l-mark .cross { opacity: .3; transition-delay: var(--d, 0ms); }
/* The finger lands: the cell sinks at once (lampen.js, press) */
.l-cell.press:not(.wall) { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ink) 9%, transparent); transition: none; }
.l-cell.press .l-mark { scale: .9; }
.l-mark { transition: scale .12s; }
/* Terug: the cells that changed back blink once */
.l-cell.undone { animation: cell-undone .45s ease-out; }
.l-cell[data-s="2"] .l-mark .lamp { opacity: 1; transform: none; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--l-light) 80%, transparent)); }
/* Just switched on: the lamp pops on and a ring of light radiates from it */
.l-cell.on .l-mark .lamp { animation: l-on .45s var(--spring); }
.l-cell.on .lamp .rays { animation: l-rays .5s ease-out; }
.l-cell.on:not(.err)::after { content: ""; position: absolute; inset: 16%; border-radius: 50%; box-shadow: 0 0 0 3px var(--l-light); opacity: 0; pointer-events: none; animation: l-burst .55s ease-out; }
@keyframes l-on { 0% { transform: scale(.3); } 55% { transform: scale(1.12); } }
@keyframes l-rays { 0%, 30% { opacity: 0; } }
@keyframes l-burst { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }

/* Walls */
.l-cell.wall { background-color: var(--l-wall); cursor: default; }
.l-num {
    position: relative;
    z-index: 1;
    color: #fff;
    font-family: var(--display);
    font-weight: 800;
    font-size: calc(54cqw / var(--n));
    line-height: 1;
    transition: color .25s;
}
/* A number with exactly enough lamps lights up too */
.l-cell.wall.ok .l-num { color: var(--l-light); }
.l-cell.wall.cheer .l-num { animation: l-cheer .45s var(--spring); }
.l-cell.wall.nope .l-num { animation: shake .25s; } /* a tap on a wall: "not here" (lampen.js), as a given in Balans */
@keyframes l-cheer { 40% { transform: scale(1.25); } }

/* Errors: never just a colour, also a ring and/or stripes. They shake once, when they first become wrong. */
.l-cell.err::before, .l-cell.clash::before, .l-cell.dead::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 30%, transparent) 0 5px, transparent 5px 10px);
    pointer-events: none;
    animation: fade-in .2s ease both;
}
.l-cell.wall.err::before, .l-cell.wall.dead::before { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 60%, transparent) 0 5px, transparent 5px 10px); }
.l-cell.err::after { content: ""; position: absolute; z-index: 2; inset: 3px; border-radius: 7px; box-shadow: 0 0 0 3px var(--bad); pointer-events: none; animation: fade-in .2s ease both; }
.l-cell.err .lamp .glass { fill: var(--bad); stroke: color-mix(in srgb, var(--bad) 55%, var(--ink)); }
.l-cell.err .l-mark, .l-cell.wall.err .l-num { animation: shake .3s; }
.l-cell.wall.err .l-num, .l-cell.wall.dead .l-num { color: #fff; text-shadow: 0 0 4px rgba(0, 0, 0, .6); }

/* Hints. Yellow light is already on the board, so the related cells get a dotted border. */
.lampen.hinting .l-cell:not(.hint-rel):not(.hint-target):not(.hint-focus) { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--board) 62%, transparent); }
.lampen.hinting .l-cell:not(.hint-rel):not(.hint-target):not(.hint-focus) :is(.l-mark, .l-num) { opacity: .35; transition: opacity .25s; }
.l-cell.hint-rel::after { content: ""; position: absolute; z-index: 2; inset: 3px; border-radius: 6px; border: 2px dashed color-mix(in srgb, var(--ink) 55%, transparent); pointer-events: none; animation: l-rel 1.1s ease-in-out infinite alternate; }
.l-cell.wall.hint-rel::after { border-color: rgba(255, 255, 255, .75); }
/* The cell a hint is about ("het vakje met de gouden rand"): gold, apart from the grey places that fell away */
.l-cell.hint-focus::after { content: ""; position: absolute; z-index: 2; inset: 3px; border-radius: 6px; border: 3px dashed var(--l-ring, #c98a00); pointer-events: none; animation: l-rel 1.1s ease-in-out infinite alternate; }
@keyframes l-rel { from { opacity: .45; } }
.l-cell.hint-target::after { content: ""; position: absolute; z-index: 2; inset: 3px; border-radius: 6px; pointer-events: none; animation: l-hint-ring 1.1s ease-in-out infinite alternate; }
@keyframes l-hint-ring { from { box-shadow: 0 0 0 3px var(--l-ring); } to { box-shadow: 0 0 0 5px var(--l-ring); } }
.l-cell.hint-wrong::after { content: ""; position: absolute; z-index: 2; inset: 3px; border-radius: 6px; box-shadow: 0 0 0 3px var(--bad); pointer-events: none; }
.l-cell.hint-wrong .l-mark { animation: shake .3s; }
.l-cell .ghost { position: absolute; z-index: 1; inset: 9%; display: grid; opacity: .5; pointer-events: none; }
.l-cell .ghost .lamp, .l-cell .ghost .cross { opacity: 1; transform: none; }
.l-cell .ripple { position: absolute; z-index: 1; width: 150%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); opacity: 0; transform: translate(-50%, -50%) scale(0); pointer-events: none; animation: ripple .45s ease-out; }

/* Solved: the whole board glows in a wave, the lamps pop one by one */
.lampen.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
/* Its own keyframes: with the same name as the light wave (l-wave), cells that have already lit up
   would keep their finished animation and stay dark, so the finale glow would mostly never show */
.lampen.solved .l-glow { animation: l-finale .8s ease-out both; animation-delay: calc(var(--i) * 30ms); }
@keyframes l-finale { 0% { opacity: 0; } 30% { opacity: .5; } 100% { opacity: 0; } }
.lampen.solved .l-cell[data-s="2"] .lamp { animation: l-cheer .6s var(--spring) both; animation-delay: calc(var(--i) * 30ms); }
.lampen.solved .l-cell[data-s="1"] .cross { opacity: 0; }
/* ... and every number lights up with the wave, the 0s too (while playing a 0 never lights: it would
   be "done" from the start; on the solved board it stayed the only white number) */
.lampen.solved .l-cell.wall .l-num { color: var(--l-light); transition: color .3s; transition-delay: calc(var(--i, 0) * 30ms); }

/* Example in the rules (inside .ex-minis / .ex-mini from Tuinen) */
.ex-lampen { display: grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 26px; gap: 1px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink); background: var(--grid); }
.ex-lampen span { display: grid; place-items: center; position: relative; background: var(--board); }
.ex-lampen .lit { background: var(--l-lit); }
.ex-lampen .wall { background: var(--l-wall); color: #fff; font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1; }
.ex-lampen .lamp { width: 84%; height: 84%; overflow: visible; }
.ex-lampen .bad .lamp .glass { fill: var(--bad); stroke: color-mix(in srgb, var(--bad) 55%, var(--ink)); }
.ex-lampen .bad, .ex-lampen .clash { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 30%, transparent) 0 4px, transparent 4px 8px); }
.ex-lampen .bad::after { content: ""; position: absolute; inset: 2px; border-radius: 4px; box-shadow: 0 0 0 2px var(--bad); }

/* ======================================================================
   Bruggen
   ====================================================================== */

.bruggen, .ex-bruggen {
    /* The tile's petrol (#14857f), mixed slightly towards the ink: a bit darker in light mode and a bit
       lighter in dark mode, so bridges and full islands stay legible in both. */
    --br: color-mix(in srgb, #14857f 86%, var(--ink));
    --br-soft: color-mix(in srgb, var(--br) 18%, var(--board));
    --br-water: color-mix(in srgb, var(--br) 5%, var(--board));
}
.bruggen {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none; /* dragging lays a bridge */
}
.bruggen .br-water { fill: var(--br-water); }
.bruggen .br-frame { fill: none; stroke: var(--ink); stroke-width: 3px; vector-effect: non-scaling-stroke; transition: stroke .3s; }
/* Dots on the empty cells: calm water, but the rows and columns stay visible */
.bruggen .br-dots circle { fill: color-mix(in srgb, var(--br) 24%, var(--board)); transition: opacity .15s; }
.bruggen .br-dots .hide { opacity: 0; }

/* Bridges. pathLength = 1, so one dash spans the full length: that lets a new bridge "shoot out". */
.bruggen .br-line {
    stroke: var(--br-line, var(--br)); /* (--br-line: another colour for now, also the ends of br-nope) */
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 1 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}
.bruggen .br-bridge[data-n="1"] .l0,
.bruggen .br-bridge[data-n="2"] .l1,
.bruggen .br-bridge[data-n="2"] .l2 { opacity: 1; transition: none; }
.bruggen .br-line.grow { animation: br-grow .17s var(--ease-out) both; }
.bruggen .br-line.split { animation: br-split .32s var(--spring) both; }
@keyframes br-grow { from { stroke-dashoffset: var(--d0, 1); } }
@keyframes br-split { from { transform: translate(var(--sx, 0px), var(--sy, 0px)); } }
/* Going: a bridge pulls back into the island it came from, a double folds into one (Terug). They stay
   visible for that (no fade), and end invisible, so nothing flashes once the class is gone. */
.bruggen .br-line.shrink, .bruggen .br-line.merge { opacity: 1; transition: none; }
.bruggen .br-line.shrink { animation: br-shrink .2s cubic-bezier(.5, 0, .9, .6) both; }
.bruggen .br-line.merge { animation: br-merge .17s ease-in both; }
@keyframes br-shrink { from { stroke-dashoffset: 0; opacity: 1; } 85% { opacity: 1; } to { stroke-dashoffset: var(--d0, 1); opacity: 0; } }
@keyframes br-merge { from { opacity: 1; } 80% { opacity: 1; } to { transform: translate(var(--sx, 0px), var(--sy, 0px)); opacity: 0; } }
/* While dragging: these bridges disappear when you let go */
.bruggen .br-bridge.dim { opacity: .28; transition: opacity .12s; }
/* ... the single bridge makes way for the double that comes */
.bruggen .br-bridge.to2 .l0 { opacity: .3; }
/* ... these bridges are in the way */
.bruggen .br-bridge.blocker .br-line { --br-line: var(--bad); }
/* A bridge under a finger (tapping it changes it) */
.bruggen .br-bridge.press .br-line { stroke-width: 11; }
/* This bridge is in the way (crossing is not allowed) */
.bruggen .br-bridge.nope .br-line { animation: br-nope .6s ease; }
/* Begin and end written out (see pulse): the bridge colour is mixed (--br), red is not; with only the red
   in the middle, Chrome 157 drew garbage colours on the way there and back */
@keyframes br-nope { 0%, 100% { stroke: var(--br-line, var(--br)); } 30%, 60% { stroke: var(--bad); } }

/* Preview while dragging: a dotted line of what will be placed */
.bruggen .br-pre {
    stroke: var(--br);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 1 15;
    opacity: .6;
    pointer-events: none;
    animation: br-march .6s linear infinite;
}
.bruggen .br-pre.blocked { stroke: var(--bad); }
@keyframes br-march { to { stroke-dashoffset: -16; } }

/* Islands */
.bruggen .br-island {
    cursor: pointer;
    outline: none;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .18s var(--spring), opacity .25s;
}
.bruggen .br-disc { fill: var(--board); stroke: var(--ink); stroke-width: 4; transition: fill .2s, stroke .2s; }
.bruggen .br-num {
    fill: var(--ink);
    font-family: var(--display);
    font-weight: 800;
    font-size: 44px;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    transition: fill .2s;
}
.bruggen .br-hatch { opacity: 0; pointer-events: none; }
.bruggen .br-stripe { fill: color-mix(in srgb, var(--bad) 32%, transparent); }
.bruggen .br-halo { fill: none; stroke: transparent; stroke-width: 5; transition: stroke .15s; }
.bruggen .br-burst { fill: none; stroke: var(--br); stroke-width: 6; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .bruggen .br-island:hover .br-disc { stroke: var(--br); } }
.bruggen .br-island:focus-visible .br-halo { stroke: var(--ink); stroke-width: 4; }

/* Dragging: the starting island lifts briefly, the target gets a soft ring */
.bruggen .br-island.from { transform: scale(1.1); }
.bruggen .br-island.from .br-disc { stroke: var(--br); }
.bruggen .br-island.aim .br-disc { stroke: var(--br); stroke-width: 7; }
.bruggen .br-island.aim .br-halo { stroke: var(--br-soft); stroke-width: 10; }

/* Exactly enough bridges: the island fills in, with a pop and an expanding ring */
.bruggen .br-island.done .br-disc { fill: var(--br); stroke: var(--br); }
.bruggen .br-island.done .br-num { fill: var(--board); } /* white in light mode; dark on the lighter petrol in dark mode */
.bruggen .br-island.pop { animation: br-pop .42s var(--spring); }
.bruggen .br-island.pop .br-burst { animation: ring-burst .6s var(--ease-out); }
@keyframes br-pop { 40% { transform: scale(1.18); } }

/* Errors: never just a colour, also stripes and a thick ring (dotted for a closed-off group) */
.bruggen .br-island.over .br-disc,
.bruggen .br-island.shut .br-disc { fill: var(--board); stroke: var(--bad); stroke-width: 6; }
.bruggen .br-island.shut .br-disc { stroke-dasharray: 12 8; }
.bruggen .br-island.over .br-hatch,
.bruggen .br-island.shut .br-hatch { opacity: 1; }
.bruggen .br-island.over .br-num,
.bruggen .br-island.shut .br-num,
.bruggen .br-island.near-over .br-num { fill: var(--bad); }
.bruggen .br-island.shake { animation: br-shake .3s; }
/* Letting go fills this island up / gives it too many bridges (after the full and wrong looks: this preview wins over them) */
.bruggen .br-island.will-done:not(.done) .br-disc { fill: var(--br-soft); }
.bruggen .br-island.will-done .br-halo { stroke: color-mix(in srgb, var(--br) 55%, var(--board)); stroke-width: 10; }
.bruggen .br-island.will-over .br-disc { fill: var(--board); stroke: var(--bad); }
.bruggen .br-island.will-over .br-halo { stroke: color-mix(in srgb, var(--bad) 35%, var(--board)); stroke-width: 10; }
.bruggen .br-island.will-over .br-num { fill: var(--bad); }
@keyframes br-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* Hints: what the hint explains lights up, the rest of the board briefly calms down */
.bruggen.hinting .br-island:not(.hint-rel):not(.hint-target) { opacity: .35; }
/* (Not the hint's own bridges: the one you lay there as the hint says is yours, so it doesn't come
   in dimmed, as if it didn't count. A bridge being removed keeps its own, fainter look.) */
.bruggen.hinting .br-bridge:not(.hint-rel):not(.dim) { opacity: .45; transition: opacity .25s; }
.bruggen .br-island.hint-rel .br-halo { stroke: var(--yellow); stroke-width: 6; animation: br-halo 1.1s ease-in-out infinite alternate; }
.bruggen .br-island.hint-target .br-halo { stroke: var(--yellow); stroke-width: 9; animation: br-halo 1.1s ease-in-out infinite alternate; }
/* The island the hint is about is filled yellow ("de gele 3"); the neighbours only get a ring */
.bruggen .br-island.hint-target .br-disc { fill: var(--yellow); stroke: var(--yellow); }
.bruggen .br-island.hint-target .br-num { fill: #161513; }
@keyframes br-halo { from { stroke-opacity: .45; } }
.bruggen .br-ghost {
    stroke: var(--yellow);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 1 17;
    pointer-events: none;
    animation: br-march-ghost .6s linear infinite;
}
@keyframes br-march-ghost { to { stroke-dashoffset: -18; } }
.bruggen .br-island.hint-wrong .br-disc { stroke: var(--bad); stroke-width: 7; }
.bruggen .br-island.hint-wrong { animation: br-shake .3s; }
.bruggen .br-bridge.hint-wrong { animation: br-blink .9s ease-in-out 3; } /* on the group: on the lines it would beat their own split/grow, and a double would jump in */
.bruggen .br-bridge.hint-wrong .br-line { --br-line: var(--bad); }
@keyframes br-blink { 50% { stroke-opacity: .3; } }

/* Solved: the islands pop one by one, the board briefly bounces */
.bruggen.solved { animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.bruggen.solved .br-frame { stroke: var(--good); }
.bruggen.solved .br-island { cursor: default; animation: br-cheer .5s var(--spring) both; animation-delay: calc(var(--i) * 35ms); }
/* ... and the bridges between them light up in the same wave */
.bruggen.solved .br-bridge { stroke: var(--br); stroke-width: 8; animation: unit-bruggen .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
.bruggen.solved .br-bridge .br-line { stroke: inherit; stroke-width: inherit; }
@keyframes br-cheer { 40% { transform: scale(1.2); } }

/* Example in the rules */
.ex-bruggen { display: block; width: 210px; height: auto; margin: 0 auto; }

/* ======================================================================
   Leidingen
   ====================================================================== */

/*
 * Nine saturated line colours, in the same order as the colour names in leidingen.php/js
 * (blue, orange, green, purple, yellow, pink, teal, brown, light green). Mid tones, so they work
 * on both the light (#fff) and the dark board (#1c1c1f). No red: red is for errors.
 */
.leidingen, .ex-leidingen {
    --v0: #2f6fe4;
    --v1: #f07c12;
    --v2: #22a052;
    --v3: #8e4fdc;
    --v4: #eeb40b;
    --v5: #e3439d;
    --v6: #10a8b6;
    --v7: #9d6234;
    --v8: #8cc234;
}
/* On the white board yellow and light green were too faint (under 3:1): a shade darker in light mode */
.leidingen, .ex-leidingen { --v4: #c99400; --v8: #6ea322; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.leidingen, .ex-leidingen) { --v4: #eeb40b; --v8: #8cc234; } }
:root[data-theme="dark"] :is(.leidingen, .ex-leidingen) { --v4: #eeb40b; --v8: #8cc234; }
.leidingen {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    grid-template-rows: repeat(var(--n), minmax(0, 1fr));
    aspect-ratio: 1;
    width: 100%;
    background: var(--board);
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none; /* dragging draws a line */
}
.leidingen.dragging { cursor: grabbing; }
.v-cell {
    position: relative;
    border: 0;
    padding: 0;
    background: var(--board);
    box-shadow: inset -1px -1px 0 var(--grid);
    cursor: pointer;
    transition: background-color .14s ease;
}
/* Cells under a line take on a soft tint; a bit stronger once the pair is connected. */
.v-cell.on { background: color-mix(in srgb, var(--c) 13%, var(--board)); }
.v-cell.done { background: color-mix(in srgb, var(--c) 24%, var(--board)); }
.v-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }

/* Lines and dots live in one svg over the cells (it does not catch taps itself). */
.v-svg { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.v-line { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; transition: opacity .25s; }
.v-dot { transition: opacity .25s; }
.v-dot .v-disc { fill: var(--c); transform-box: fill-box; transform-origin: center; transition: transform .2s var(--spring); }
.v-dot .v-ring { fill: none; stroke: var(--c); stroke-width: 7; opacity: 0; transform-box: fill-box; transform-origin: center; }
/* Connected: a white core in the dot (visible without relying on colour) */
.v-dot .v-core { fill: #fff; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: opacity .15s, transform .3s var(--spring); }
.v-dot.done .v-core { opacity: .92; transform: none; }
/*
 * Colour-blind mode (html.cvd, Jij → Instellingen): the pair's number on each dot (leidingen.js), white
 * with a dark edge so it reads on every colour. "Connected" then is a ring around the dot in the ink
 * colour (dark on the light board, light on the dark one), as the number takes the core's place.
 */
.v-num { display: none; fill: #fff; stroke: rgba(0, 0, 0, .38); stroke-width: 5px; paint-order: stroke; font-family: var(--display); font-weight: 800;
    text-anchor: middle; dominant-baseline: central; pointer-events: none; transform-box: fill-box; transform-origin: center; transition: transform .2s var(--spring); }
.cvd .v-num { display: inline; }
.cvd .v-dot .v-core { display: none; }
.cvd .v-dot .v-disc { stroke: var(--ink); stroke-width: 0; transition: transform .2s var(--spring), stroke-width .2s var(--spring); }
.cvd .v-dot.done .v-disc { stroke-width: 7px; }
.v-dot.grab .v-disc, .v-dot.grab .v-num { transform: scale(1.12); } /* (the number grows along with its dot) */
.v-dot.pop .v-disc, .v-dot.pop .v-num { animation: v-pop .4s var(--spring); }
.v-dot.pop .v-ring { animation: ring-burst .6s var(--ease-out); }
.v-dot.ping .v-ring { animation: ring-burst .6s var(--ease-out) 2; } /* tap on an unused colour: where is the other dot? */
@keyframes v-pop { 40% { transform: scale(1.32); } }
/* Soft circle under your finger, in the colour being drawn */
.v-halo { fill: var(--c); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.5); transition: opacity .15s, transform .22s var(--spring); }
.v-halo.on { opacity: .2; transform: none; }

/* Enclosed area: striped (never just a colour), and it shakes once when it first appears */
.v-cell.dead::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 30%, transparent) 0 5px, transparent 5px 10px);
    pointer-events: none;
    animation: fade-in .2s ease both;
}
.v-cell.dead.nope::after { animation: fade-in .2s ease both, shake .3s; }

/* Hints */
.v-ghost { fill: none; stroke: var(--c); stroke-opacity: .8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 25; animation: march .8s linear infinite; }
.v-cell.hint-rel { background: color-mix(in srgb, var(--yellow) 36%, var(--board)); animation: hint-rel-pulse-bg 1.1s ease-in-out infinite alternate; }
.v-cell.hint-target::before { content: ""; position: absolute; inset: 3px; z-index: 2; border-radius: 8px; pointer-events: none; animation: hint-ring 1.1s ease-in-out infinite alternate; }
.v-cell.hint-wrong::after {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: 2;
    border-radius: 8px;
    box-shadow: 0 0 0 3px var(--bad);
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 22%, transparent) 0 5px, transparent 5px 10px);
    pointer-events: none;
    animation: shake .3s;
}
/* Spotlight: only the hint's colour stays bright, the rest briefly calms down. */
.leidingen.hinting .v-line:not(.lit), .leidingen.hinting .v-dot:not(.lit) { opacity: .3; }
.leidingen.hinting .v-cell.on:not(.hint-rel):not(.hint-target):not(.hint-lit) { background: color-mix(in srgb, var(--c) 6%, var(--board)); }

/* Solved: the board bounces, the cells light up in a wave and the dots pop along */
.leidingen.solved { box-shadow: 0 0 0 3px var(--good); transition: box-shadow .3s; animation: board-pop .55s cubic-bezier(.3, 1.4, .5, 1); }
.leidingen.solved .v-cell.on { animation: v-wave .7s ease both; animation-delay: calc(var(--i) * 35ms); }
.leidingen.solved .v-dot .v-disc { animation: v-pop .5s var(--spring) both; animation-delay: calc(var(--i) * 35ms); }
.leidingen.solved .v-halo { opacity: 0; }
.leidingen.solved .v-line { animation: unit-leidingen-line .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes v-wave { 40% { background: color-mix(in srgb, var(--c) 42%, var(--board)); } }

/* Example in the rules */
.ex-leidingen { display: block; width: 150px; height: auto; margin: 0 auto; }

/* ======================================================================
   Small reward along the way (Zestal, Balans, Tuinen, Kavels): a row, column,
   block, garden or plot that was just completed lights up cell by cell. The JS
   sets .unit-done on those cells for ~680 ms, with --u (0 to 1) = how far the
   cell is from your move: so the light runs through from your finger.
   Decoration only (the sound and the "done" signal say nothing about right or wrong).
   ====================================================================== */

/* Zestal, Balans and Kavels: a soft tile blooming behind the number or symbol.
   On ::before, so it never clashes with the cells' own animations (hints, finale). */
.z-cell.unit-done::before,
.b-cell.unit-done::before,
.k-cell.unit-done::before {
    content: "";
    position: absolute;
    inset: 7%;
    border-radius: 9px;
    background: color-mix(in srgb, var(--good) 26%, transparent);
    opacity: 0;
    pointer-events: none;
    animation: unit-glow .42s var(--ease-out);
    animation-delay: calc(var(--u, 0) * 240ms);
}
/* Kavels: the cells sit above the coloured plot; white light briefly lightens any colour.
   z-index -1: below the number, but inside the cell (which is its own stacking context). */
.k-cell.unit-done::before { z-index: -1; inset: 10%; background: color-mix(in srgb, #fff 42%, transparent); }
@keyframes unit-glow {
    0% { opacity: 0; transform: scale(.55); }
    40% { opacity: 1; transform: scale(1.04); }
    100% { opacity: 0; transform: scale(1); }
}

/* Tuinen: the whole garden briefly lights up and the tree (and the crosses) bounce along.
   (The cells already need their ::before and ::after for errors, hints and dots.) */
.t-cell.unit-done { animation: unit-bright .42s var(--ease-out); animation-delay: calc(var(--u, 0) * 240ms); }
.t-cell.unit-done .t-mark { animation: unit-bump .42s var(--spring); animation-delay: calc(var(--u, 0) * 240ms); }
@keyframes unit-bright { 40% { filter: brightness(1.16) saturate(1.12); } }
@keyframes unit-bump { 40% { transform: scale(1.14); } }

/* Reduced motion: no light, only the sound. */
@media (prefers-reduced-motion: reduce) {
    .z-cell.unit-done::before, .b-cell.unit-done::before, .k-cell.unit-done::before { content: none; }
    .t-cell.unit-done, .t-cell.unit-done .t-mark { animation: none; }
}

/* ======================================================================
   Small reward along the way (Spoor, Lampen, Bruggen, Leidingen). Same
   convention as Zestal, Balans, Tuinen and Kavels: the JS sets .unit-done
   for ~680 ms on the parts of what was just completed, with --u (0 to 1) =
   how far the part is from your move, so the light runs through from your
   finger. Decoration only: what "done" means does not change.
   Selectors deliberately less specific than .solved: the finale wins.
   ====================================================================== */

/* Spoor: the stretch of line since the previous number, running back from the new number */
.spoor-svg .unit-done.on { animation: unit-spoor .42s var(--ease-out); animation-delay: calc(var(--u, 0) * 240ms); }
@keyframes unit-spoor { 40% { fill: color-mix(in srgb, var(--spoor) 34%, var(--board)); } }

/* Lampen: the number just completed and its lamps briefly get warm light (never over an error).
   An inset shadow: it sits below the lamp and the number, and does not clash with ::before/::after. */
.lampen .unit-done:not(.err):not(.dead) { animation: unit-lampen .42s var(--ease-out); animation-delay: calc(var(--u, 0) * 240ms); }
@keyframes unit-lampen { 40% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--l-light) 32%, transparent); } }

/* Bruggen: the bridges of an island that just filled up light up one by one and briefly swell,
   after the island's pop. The group animates and the lines inherit it meanwhile, so their own
   animations (shooting out and unfolding) carry on undisturbed. */
.bruggen .br-bridge.unit-done { stroke: var(--br); stroke-width: 8; animation: unit-bruggen .42s var(--ease-out) both; animation-delay: calc(90ms + var(--u, 0) * 150ms); }
.bruggen .br-bridge.unit-done .br-line { stroke: inherit; stroke-width: inherit; }
@keyframes unit-bruggen {
    0%, 100% { stroke: var(--br); stroke-width: 8; }
    40% { stroke: color-mix(in srgb, var(--br) 65%, #fff); stroke-width: 11; }
}

/* Leidingen: the whole line briefly swells, the cells below light up from where you connected it */
.v-line.unit-done { animation: unit-leidingen-line .42s var(--ease-out); }
@keyframes unit-leidingen-line { 40% { stroke-width: 42; } }
.v-cell.unit-done { animation: unit-leidingen .42s var(--ease-out); animation-delay: calc(var(--u, 0) * 240ms); }
@keyframes unit-leidingen { 40% { background: color-mix(in srgb, var(--c) 40%, var(--board)); } }

/* Reduced motion: no light, only the sound (the JS does not set the class then either). */
@media (prefers-reduced-motion: reduce) {
    .spoor-svg .unit-done.on, .lampen .unit-done:not(.err):not(.dead), .bruggen .br-bridge.unit-done, .v-line.unit-done, .v-cell.unit-done { animation: none; }
}

/* Finale: no new CSS needed. The existing .solved waves still use --i; on solving, the JS sets --i
   to the distance from your last move (sometimes fractional), stretched to the duration of the old
   wave. Spoor: --i counts back from the end of the line (the shine too). */

/* ======================================================================
   Progress: avatars, levels, XP, badges, duels that end
   ====================================================================== */

/* Pixel avatar instead of a letter, with the frame you unlocked */
.face.av { position: relative; padding: 0; background: none; overflow: visible; }
.face.av svg { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.face.av > i { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--fill-2); }
.face.av::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; }
/* Bronze, silver and gold (and the crown): metal, not flat brown, grey and yellow. A ring with light
   and dark bands (conic gradient, cut out as a ring with a mask) and a soft glow in its own colour.
   The glow is a drop-shadow on the face itself: on the masked ring it would be cut off. */
.face.av:is(.frame-b, .frame-s, .frame-g, .frame-k, .frame-x)::after {
    inset: -4px; padding: 3px; border: 0; box-shadow: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.face.av.frame-b::after { background: conic-gradient(from 200deg, #fbd2a6, #b4672c 18%, #f2ad6c 38%, #7a3d10 58%, #e9a463 78%, #fbd2a6); }
.face.av.frame-s::after { background: conic-gradient(from 200deg, #ffffff, #9ea8b4 18%, #f4f7fa 38%, #737e8b 58%, #dde3ea 78%, #ffffff); }
.face.av:is(.frame-g, .frame-k, .frame-x)::after { background: conic-gradient(from 200deg, #fff6c2, #d39200 18%, #ffe27a 38%, #a46800 58%, #ffd447 78%, #fff6c2); }
.face.av.frame-b { filter: drop-shadow(0 0 3px rgba(222, 138, 66, .55)); }
.face.av.frame-s { filter: drop-shadow(0 0 4px rgba(170, 190, 214, .8)); }
.face.av:is(.frame-g, .frame-k, .frame-x) { filter: drop-shadow(0 0 5px rgba(243, 184, 44, .75)); }
/* Earned with a feat (avatar_feats), not a level. Weekwinnaar: a gold medal, a broad rim with a
   milled edge and a glint that goes round. Alleskunner: a bold purple ring that slowly turns.
   (Nothing on top, such as a cup or a crown: sticking far out on one side, it would be cut off in
   lists, and run into what is above.) */
.face.av.frame-x::after {
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    background: repeating-conic-gradient(rgba(110, 62, 0, .5) 0 2deg, transparent 2deg 7.5deg),
        conic-gradient(from 200deg, #fff6c2, #d39200 18%, #ffe27a 38%, #a46800 58%, #ffd447 78%, #fff6c2);
}
.face.av.frame-x::before {
    content: ""; position: absolute; z-index: 1; pointer-events: none; border-radius: 50%;
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    background: conic-gradient(transparent 0 76%, rgba(255, 255, 255, .95) 85%, transparent 94%);
    animation: spin 3.6s linear infinite;
}
.face.av.frame-m::after {
    --w: clamp(3px, 13%, 6px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    background: conic-gradient(from 210deg, #2e0f57, #8a4dff 16%, #e6d2ff 30%, #6a2ad6 46%, #b98bff 62%, #4a1a91 80%, #2e0f57);
    animation: spin 9s linear infinite;
}
.face.av.frame-m { filter: drop-shadow(0 0 5px rgba(138, 77, 255, .7)); }
.face.av.frame-n::after, .face.av.frame-v::after {
    inset: -4px; padding: 3px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.face.av.frame-n::after { background: conic-gradient(#ff3df2, #3dd5ff, #7dff6b, #ffe83d, #ff3df2); animation: spin 3s linear infinite; }
.face.av.frame-v::after { background: conic-gradient(from 0deg, #ff4d00, #ffb300, #ff2a00, #ffd000, #ff4d00); animation: spin 1.6s linear infinite; filter: drop-shadow(0 0 4px #ff6a00); }
/* After level 50: rarer frames, months to years of playing */
.face.av.frame-d::after, .face.av.frame-c::after, .face.av.frame-a::after, .face.av.frame-l::after {
    inset: -4px; padding: 3px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.face.av.frame-d::after { background: conic-gradient(#e8f7ff, #8fd8ff, #ffffff, #b9e9ff, #6fc8ff, #e8f7ff); animation: spin 6s linear infinite; filter: drop-shadow(0 0 5px rgba(143, 216, 255, .9)); }
.face.av.frame-e::after { border: 3px solid #17b26a; box-shadow: 0 0 0 2px rgba(23, 178, 106, .35), 0 0 12px rgba(23, 178, 106, .8); }
/* Its glow breathes: a stronger glow on top fades in and out (only opacity moves: no repaint every frame) */
.face.av.frame-e::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(23, 178, 106, .45), 0 0 18px rgba(23, 178, 106, 1); opacity: 0; pointer-events: none; animation: fr-glow 2.4s ease-in-out infinite; }
/* Kroon and Legende: a crown seen from above, its points with a pearl all round the gold ring, behind
   the face. The same on every side, and about as far out as the other frames. Legende's
   slowly turns. */
.face.av:is(.frame-k, .frame-l) { isolation: isolate; }
.face.av:is(.frame-k, .frame-l)::before {
    content: ""; position: absolute; inset: calc(-1 * min(23%, 14px)); z-index: -1; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22g%22 cx=%2250%22 cy=%2250%22 r=%2247%22 gradientUnits=%22userSpaceOnUse%22%3E%3Cstop offset=%22.7%22 stop-color=%22%23c98a00%22/%3E%3Cstop offset=%22.86%22 stop-color=%22%23ffd447%22/%3E%3Cstop offset=%221%22 stop-color=%22%23fff1a8%22/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d=%22M38.9 15.8L50.0 4.0L61.1 15.8L74.7 16.0L79.1 28.8L93.7 35.8L86.0 50.0L89.9 63.0L79.1 71.2L77.0 87.2L61.1 84.2L50.0 92.0L38.9 84.2L23.0 87.2L20.9 71.2L10.1 63.0L14.0 50.0L6.3 35.8L20.9 28.8L25.3 16.0ZM83 50A33 33 0 1 0 17 50A33 33 0 1 0 83 50Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%238a5600%22 stroke-width=%22.8%22 stroke-linejoin=%22round%22/%3E%3Ccircle cx=%2250.0%22 cy=%222.4%22 r=%222.5%22 fill=%22%23fffaf0%22 stroke=%22%23c79a3a%22 stroke-width=%22.6%22/%3E%3Ccircle cx=%2295.3%22 cy=%2235.3%22 r=%222.5%22 fill=%22%23fffaf0%22 stroke=%22%23c79a3a%22 stroke-width=%22.6%22/%3E%3Ccircle cx=%2278.0%22 cy=%2288.5%22 r=%222.5%22 fill=%22%23fffaf0%22 stroke=%22%23c79a3a%22 stroke-width=%22.6%22/%3E%3Ccircle cx=%2222.0%22 cy=%2288.5%22 r=%222.5%22 fill=%22%23fffaf0%22 stroke=%22%23c79a3a%22 stroke-width=%22.6%22/%3E%3Ccircle cx=%224.7%22 cy=%2235.3%22 r=%222.5%22 fill=%22%23fffaf0%22 stroke=%22%23c79a3a%22 stroke-width=%22.6%22/%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 0 2px rgba(255, 196, 0, .45));
}
.face.av.frame-l::before { animation: spin 24s linear infinite; }
.face.av.frame-c::after { background: conic-gradient(#1a0b3d, #6a3dff, #ff5fd2, #1a0b3d, #3dc9ff, #1a0b3d); animation: spin 8s linear infinite; filter: drop-shadow(0 0 6px rgba(106, 61, 255, .9)); }
.face.av.frame-a::after { background: conic-gradient(#3dffb1, #2bd9ff, #8a5bff, #ff6bd6, #3dffb1); animation: spin 5s linear infinite; filter: drop-shadow(0 0 7px rgba(61, 255, 177, .8)); }
.face.av.frame-l::after { background: conic-gradient(#fff3b0, #f3b82c, #ffffff, #ff9d00, #fff3b0, #f3b82c, #fff3b0); animation: spin 2.4s linear infinite; filter: drop-shadow(0 0 7px rgba(255, 196, 0, 1)); }
/* How far a frame reaches outside the face: a share of the face, but at most ~10 px, so on the big
   avatar (Jij, a profile) a sun or wreath does not run into the name or the card below. */
/* More frames (after Brons ... Legende): shapes beyond a ring, most of them moving.
   Sizes in % of the face, so they scale from a 22 px face in a list to the big one on Jij. */
.face.av.frame-p::after { inset: -11%; border: 2.5px dotted #14a3a0; animation: spin 12s linear infinite; }
.face.av.frame-w::after { inset: calc(-1 * min(22%, 9px)); border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cpath d=%22M42.8 90.9 A41.5 41.5 0 0 1 19.2 22.2%22 fill=%22none%22 stroke=%22%233d7f2a%22 stroke-width=%221.4%22 stroke-linecap=%22round%22/%3E%3Cellipse cx=%2239.3%22 cy=%2292.7%22 rx=%224.2%22 ry=%223.0%22 fill=%22%2362ad44%22 transform=%22rotate(152.0 39.3 92.7)%22/%3E%3Cellipse cx=%2240.1%22 cy=%2287.9%22 rx=%224.2%22 ry=%222.6%22 fill=%22%23468f30%22 transform=%22rotate(228.0 40.1 87.9)%22/%3E%3Cellipse cx=%2227.2%22 cy=%2287.5%22 rx=%224.0%22 ry=%222.9%22 fill=%22%2362ad44%22 transform=%22rotate(169.4 27.2 87.5)%22/%3E%3Cellipse cx=%2229.3%22 cy=%2283.4%22 rx=%224.0%22 ry=%222.5%22 fill=%22%23468f30%22 transform=%22rotate(245.4 29.3 83.4)%22/%3E%3Cellipse cx=%2217.2%22 cy=%2279.0%22 rx=%223.8%22 ry=%222.7%22 fill=%22%2362ad44%22 transform=%22rotate(186.9 17.2 79.0)%22/%3E%3Cellipse cx=%2220.3%22 cy=%2275.9%22 rx=%223.8%22 ry=%222.3%22 fill=%22%23468f30%22 transform=%22rotate(262.9 20.3 75.9)%22/%3E%3Cellipse cx=%2210.2%22 cy=%2267.9%22 rx=%223.6%22 ry=%222.6%22 fill=%22%2362ad44%22 transform=%22rotate(204.3 10.2 67.9)%22/%3E%3Cellipse cx=%2213.9%22 cy=%2266.0%22 rx=%223.6%22 ry=%222.2%22 fill=%22%23468f30%22 transform=%22rotate(280.3 13.9 66.0)%22/%3E%3Cellipse cx=%226.8%22 cy=%2255.3%22 rx=%223.5%22 ry=%222.4%22 fill=%22%2362ad44%22 transform=%22rotate(221.7 6.8 55.3)%22/%3E%3Cellipse cx=%2210.6%22 cy=%2254.6%22 rx=%223.5%22 ry=%222.1%22 fill=%22%23468f30%22 transform=%22rotate(297.7 10.6 54.6)%22/%3E%3Cellipse cx=%227.3%22 cy=%2242.3%22 rx=%223.3%22 ry=%222.2%22 fill=%22%2362ad44%22 transform=%22rotate(239.1 7.3 42.3)%22/%3E%3Cellipse cx=%2210.9%22 cy=%2242.8%22 rx=%223.3%22 ry=%221.9%22 fill=%22%23468f30%22 transform=%22rotate(315.1 10.9 42.8)%22/%3E%3Cellipse cx=%2211.6%22 cy=%2230.1%22 rx=%223.1%22 ry=%222.1%22 fill=%22%2362ad44%22 transform=%22rotate(256.6 11.6 30.1)%22/%3E%3Cellipse cx=%2219.3%22 cy=%2219.7%22 rx=%222.9%22 ry=%221.9%22 fill=%22%2362ad44%22 transform=%22rotate(274.0 19.3 19.7)%22/%3E%3Cpath d=%22M57.2 90.9 A41.5 41.5 0 0 0 80.8 22.2%22 fill=%22none%22 stroke=%22%233d7f2a%22 stroke-width=%221.4%22 stroke-linecap=%22round%22/%3E%3Cellipse cx=%2260.7%22 cy=%2292.7%22 rx=%224.2%22 ry=%223.0%22 fill=%22%2362ad44%22 transform=%22rotate(28.0 60.7 92.7)%22/%3E%3Cellipse cx=%2259.9%22 cy=%2287.9%22 rx=%224.2%22 ry=%222.6%22 fill=%22%23468f30%22 transform=%22rotate(-48.0 59.9 87.9)%22/%3E%3Cellipse cx=%2272.8%22 cy=%2287.5%22 rx=%224.0%22 ry=%222.9%22 fill=%22%2362ad44%22 transform=%22rotate(10.6 72.8 87.5)%22/%3E%3Cellipse cx=%2270.7%22 cy=%2283.4%22 rx=%224.0%22 ry=%222.5%22 fill=%22%23468f30%22 transform=%22rotate(-65.4 70.7 83.4)%22/%3E%3Cellipse cx=%2282.8%22 cy=%2279.0%22 rx=%223.8%22 ry=%222.7%22 fill=%22%2362ad44%22 transform=%22rotate(-6.9 82.8 79.0)%22/%3E%3Cellipse cx=%2279.7%22 cy=%2275.9%22 rx=%223.8%22 ry=%222.3%22 fill=%22%23468f30%22 transform=%22rotate(-82.9 79.7 75.9)%22/%3E%3Cellipse cx=%2289.8%22 cy=%2267.9%22 rx=%223.6%22 ry=%222.6%22 fill=%22%2362ad44%22 transform=%22rotate(-24.3 89.8 67.9)%22/%3E%3Cellipse cx=%2286.1%22 cy=%2266.0%22 rx=%223.6%22 ry=%222.2%22 fill=%22%23468f30%22 transform=%22rotate(-100.3 86.1 66.0)%22/%3E%3Cellipse cx=%2293.2%22 cy=%2255.3%22 rx=%223.5%22 ry=%222.4%22 fill=%22%2362ad44%22 transform=%22rotate(-41.7 93.2 55.3)%22/%3E%3Cellipse cx=%2289.4%22 cy=%2254.6%22 rx=%223.5%22 ry=%222.1%22 fill=%22%23468f30%22 transform=%22rotate(-117.7 89.4 54.6)%22/%3E%3Cellipse cx=%2292.7%22 cy=%2242.3%22 rx=%223.3%22 ry=%222.2%22 fill=%22%2362ad44%22 transform=%22rotate(-59.1 92.7 42.3)%22/%3E%3Cellipse cx=%2289.1%22 cy=%2242.8%22 rx=%223.3%22 ry=%221.9%22 fill=%22%23468f30%22 transform=%22rotate(-135.1 89.1 42.8)%22/%3E%3Cellipse cx=%2288.4%22 cy=%2230.1%22 rx=%223.1%22 ry=%222.1%22 fill=%22%2362ad44%22 transform=%22rotate(-76.6 88.4 30.1)%22/%3E%3Cellipse cx=%2280.7%22 cy=%2219.7%22 rx=%222.9%22 ry=%221.9%22 fill=%22%2362ad44%22 transform=%22rotate(-94.0 80.7 19.7)%22/%3E%3Cpath d=%22M50 91 l-6 7 3.6 .8 2.4-3.6 2.4 3.6 3.6-.8z%22 fill=%22%23d4951a%22/%3E%3Ccircle cx=%2250%22 cy=%2291%22 r=%222.8%22 fill=%22%23f3b82c%22/%3E%3C/svg%3E") center / contain no-repeat; animation: fr-sway 3.2s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.face.av.frame-t::after { inset: -4px; border: 2px solid rgba(255, 213, 74, .75); }
.face.av.frame-t::before { content: ""; position: absolute; inset: calc(-1 * min(26%, 10px)); z-index: 1; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1.5l2.9 6.6 7.1.7-5.4 4.8 1.6 7-6.2-3.7-6.2 3.7 1.6-7L2 8.8l7.1-.7z%22 fill=%22%23ffd54a%22 stroke=%22%23e0a21c%22 stroke-width=%221%22/%3E%3C/svg%3E") 50% 0 / 24% no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1.5l2.9 6.6 7.1.7-5.4 4.8 1.6 7-6.2-3.7-6.2 3.7 1.6-7L2 8.8l7.1-.7z%22 fill=%22%23ffd54a%22 stroke=%22%23e0a21c%22 stroke-width=%221%22/%3E%3C/svg%3E") 6% 74% / 19% no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1.5l2.9 6.6 7.1.7-5.4 4.8 1.6 7-6.2-3.7-6.2 3.7 1.6-7L2 8.8l7.1-.7z%22 fill=%22%23ffd54a%22 stroke=%22%23e0a21c%22 stroke-width=%221%22/%3E%3C/svg%3E") 94% 74% / 15% no-repeat;
    animation: spin 9s linear infinite; }
.face.av.frame-z::before, .face.av.frame-z::after { content: ""; position: absolute; inset: calc(-1 * min(24%, 10px)); border: 0; border-radius: 0; z-index: 1; pointer-events: none; animation: fr-twinkle 1.8s ease-in-out infinite; }
.face.av.frame-z::before { background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1c1 6.5 4.5 10 11 11-6.5 1-10 4.5-11 11-1-6.5-4.5-10-11-11 6.5-1 10-4.5 11-11z%22 fill=%22%23ffd84d%22 stroke=%22%23c48a00%22 stroke-width=%22.9%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 12% 10% / 26% no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1c1 6.5 4.5 10 11 11-6.5 1-10 4.5-11 11-1-6.5-4.5-10-11-11 6.5-1 10-4.5 11-11z%22 fill=%22%23ffd84d%22 stroke=%22%23c48a00%22 stroke-width=%22.9%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 92% 58% / 20% no-repeat; }
.face.av.frame-z::after { background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1c1 6.5 4.5 10 11 11-6.5 1-10 4.5-11 11-1-6.5-4.5-10-11-11 6.5-1 10-4.5 11-11z%22 fill=%22%23ffd84d%22 stroke=%22%23c48a00%22 stroke-width=%22.9%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 84% 6% / 18% no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 1c1 6.5 4.5 10 11 11-6.5 1-10 4.5-11 11-1-6.5-4.5-10-11-11 6.5-1 10-4.5 11-11z%22 fill=%22%23ffd84d%22 stroke=%22%23c48a00%22 stroke-width=%22.9%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 8% 86% / 22% no-repeat; animation-delay: .9s; }
.face.av.frame-o::after { border: 2.5px solid #2a9df4; box-shadow: 0 0 8px rgba(42, 157, 244, .6); }
.face.av.frame-o::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #2a9df4; pointer-events: none; animation: fr-ripple 2s ease-out infinite; }
/* Zon: pointed rays, long and short, behind the face. As far out as the other frames with shapes
   (about a fifth of the face, at most 11 px), so in a list it doesn't run into the name. */
.face.av.frame-r::before { content: ""; position: absolute; inset: calc(-1 * min(20%, 11px)); z-index: -1; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20140%20140%22%3E%3Cpath%20d=%22M62.5%2020.6L77.5%2020.6L70.0%200.5zM89.2%2023.8L100.4%2030.3L101.5%2015.4zM109.1%2038.8L116.6%2051.8L130.2%2035.2zM119.6%2063.5L119.6%2076.5L133.0%2070.0zM116.6%2088.2L109.1%20101.2L130.2%20104.7zM100.4%20109.7L89.2%20116.2L101.5%20124.6zM77.5%20119.4L62.5%20119.4L70.0%20139.5zM50.8%20116.2L39.6%20109.7L38.5%20124.6zM30.9%20101.2L23.4%2088.2L9.8%20104.8zM20.4%2076.5L20.4%2063.5L7.0%2070.0zM23.4%2051.8L30.9%2038.8L9.8%2035.2zM39.6%2030.3L50.8%2023.8L38.5%2015.4z%22%20fill=%22%23ffb300%22%20stroke=%22%23ffb300%22%20stroke-width=%221.5%22%20stroke-linejoin=%22round%22/%3E%3C/svg%3E") center / contain no-repeat;
    animation: spin 24s linear infinite; }
.face.av.frame-r { isolation: isolate; } /* the rays sit behind the face, not behind the card */
.face.av.frame-r::after { inset: -3px; border: 2.5px solid #ffb300; box-shadow: 0 0 8px rgba(255, 179, 0, .65); }
/* Robijn and Diamant: reaching the top two rating classes (avatar_feats). Rings like Weekwinnaar and
   Alleskunner (the other frames you earn with a feat): a broad rim, cut out with a mask, as far out as
   those. Robijn: a cut ruby, facets in deep and bright red, a glint going round. Diamant: a brilliant,
   white facets with the fire of a diamond (a little rainbow) turning in them, and a cool glow. */
.face.av:is(.frame-f, .frame-u)::after {
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.face.av.frame-f::after {
    background: repeating-conic-gradient(rgba(255, 255, 255, .28) 0 3deg, transparent 3deg 15deg, rgba(60, 0, 12, .35) 15deg 18deg, transparent 18deg 30deg),
        conic-gradient(from 200deg, #ff8fa3, #cf2546 18%, #ff5a78 38%, #7a0c22 58%, #e8364f 78%, #ff8fa3);
}
.face.av:is(.frame-f, .frame-u)::before {
    content: ""; position: absolute; z-index: 1; pointer-events: none; border-radius: 50%;
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    background: conic-gradient(transparent 0 80%, #ffe3e9 87%, #ffffff 89%, transparent 95%);
    animation: spin 4.2s linear infinite;
}
.face.av.frame-f { filter: drop-shadow(0 0 4px rgba(207, 37, 70, .6)); }
.face.av.frame-u::after {
    background: repeating-conic-gradient(rgba(140, 170, 200, .35) 0 2deg, transparent 2deg 12deg, rgba(255, 255, 255, .9) 12deg 13.5deg, transparent 13.5deg 24deg),
        conic-gradient(from 0deg, #ffffff, #d8f3ff 14%, #ffffff 26%, #bfe6f7 40%, #ffffff 54%, #e2f6ff 70%, #c7ecfa 85%, #ffffff);
}
.face.av.frame-u::before { background: conic-gradient(rgba(255, 120, 160, .55), rgba(255, 220, 120, .55) 12%, transparent 22% 50%, rgba(120, 220, 255, .6) 62%, rgba(180, 140, 255, .55) 72%, transparent 82%); animation-duration: 7s; }
.face.av.frame-u { filter: drop-shadow(0 0 5px rgba(30, 163, 200, .7)); }
/* Sterrenhemel: collecting 36 stars (avatar_feats). The same broad ring, a night sky with golden stars
   twinkling in it, slowly turning. */
.face.av.frame-h::after {
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    background: repeating-conic-gradient(from 8deg, #ffe27a 0 1.6deg, transparent 1.6deg 21deg),
        repeating-conic-gradient(from 18deg, rgba(255, 255, 255, .85) 0 .9deg, transparent .9deg 33deg),
        radial-gradient(circle at 50% 50%, #3a3f9e, #161a4a 75%);
    animation: spin 20s linear infinite;
}
.face.av.frame-h::before {
    content: ""; position: absolute; z-index: 1; pointer-events: none; border-radius: 50%;
    --w: clamp(3px, 12%, 5px); inset: calc(-1 * var(--w) - 1px); padding: var(--w);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    background: conic-gradient(transparent 0 70%, rgba(255, 226, 122, .9) 80%, transparent 90%);
    animation: spin 5s linear infinite reverse;
}
.face.av.frame-h { filter: drop-shadow(0 0 4px rgba(90, 100, 230, .6)); }
@keyframes fr-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes fr-twinkle { 0%, 100% { opacity: .15; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes fr-ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
@keyframes fr-glow { 50% { opacity: 1; } }
.faces.two .face.av::after { inset: -2px; border-width: 2px; padding: 2px; }
/* In list rows (a card that clips, with 10 px above a face): frames with a shape (Kroon, Legende, Sterren,
   Zon, Vonken, Lauwerkrans) reach no further than the class emblems do, so they never touch the row's edge. */
.recent .face.av:is(.frame-k, .frame-l, .frame-t, .frame-r)::before,
.recent .face.av.frame-z::before, .recent .face.av.frame-z::after,
.recent .face.av.frame-w::after { inset: calc(-1 * min(18%, 8px)); }
@media (prefers-reduced-motion: reduce) { .face.av::after, .face.av::before { animation: none !important; } }

.lb .face { width: 30px; height: 30px; font-size: 13px; margin-right: 8px; flex: none; }

/* Level ring: fills with --p (0..1), number in the middle */
.lvl-ring { --xp: #e9a400; flex: none; position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--xp) calc(var(--p, 0) * 360deg), var(--fill-2) 0); }
.lvl-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.lvl-ring b { position: relative; font-family: var(--display); font-weight: 900; font-size: 19px; font-variant-numeric: tabular-nums; }
.xp-bar { position: relative; height: 10px; margin-top: 12px; border-radius: 5px; background: var(--fill-2); overflow: hidden; }
.xp-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: 5px; background: linear-gradient(90deg, #f3b82c, #ff8a1c); box-shadow: 0 0 10px rgba(255, 160, 30, .45); }
/*
 * After a puzzle: one bar, calm up to where you were (--p0), bright for what you just earned. At
 * least the last 7px are bright: at level 35 or 100 a puzzle is only a sliver of the level.
 */
.xp-card.gained .xp-bar i {
    --cut: min(calc(var(--p0, 0) / max(var(--p, 0), .001) * 100%), calc(100% - 7px));
    min-width: 7px;
    background: linear-gradient(90deg, color-mix(in srgb, #f3b82c 55%, var(--fill-2)) 0 var(--cut), #ffc93a var(--cut), #ff8a1c);
}
.xp-card.gained.done .xp-bar i { animation: xp-gain-glow 1.4s ease-in-out 3; }
@keyframes xp-gain-glow { 50% { box-shadow: 0 0 14px 1px rgba(255, 150, 20, .7); } }
@media (prefers-reduced-motion: reduce) { .xp-card.gained.done .xp-bar i { animation: none; } }
.xp-shine { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%); transform: translateX(-120%); }
.xp-card.live .xp-shine { animation: xp-shine 1.3s ease .1s; }
@keyframes xp-shine { to { transform: translateX(120%); } }

/* XP on the result screen */
/* Right after the time (.3s): at .9s there would be a big empty gap first, and then the card. */
.xp-card { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); } /* (in view with the screen, at your level and XP before; playXp, profile.js, fills it when its turn comes) */
.xp-head { display: flex; align-items: center; gap: 12px; }
.xp-who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.xp-who b { font-weight: 750; }
.xp-who span { font-size: 13px; color: var(--ink-3); }
.xp-gain { font-family: var(--display); font-size: 24px; font-weight: 900; color: #e08a00; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xp-card.burst .lvl-ring { animation: lvl-burst .7s var(--spring); }
@keyframes lvl-burst { 30% { transform: scale(1.35); box-shadow: 0 0 0 10px rgba(243, 184, 44, .25); } }
.xp-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.xp-parts span { padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--ink-2); animation: rise-move .4s var(--spring) both, fade-in 0.3s ease both; animation-delay: calc(1.4s + var(--d) * .12s); }
.xp-parts b { color: #e08a00; font-weight: 800; }

/* Level-up moment (top layer, also above an open panel) */
.lvl-up, .lvl-up[popover] { position: fixed; inset: 0; z-index: 160; margin: 0; width: auto; height: auto; max-width: none; max-height: none; border: 0; padding: 24px; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--ink); background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--yellow) 34%, var(--paper)), var(--paper) 70%); overflow: hidden; animation: fade .3s ease both; cursor: pointer; }
.lvl-up.out { animation: fade-out .3s ease forwards; }
.lu-rays { position: absolute; left: 50%; top: 42%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; background: repeating-conic-gradient(rgba(243, 184, 44, .16) 0 8deg, transparent 8deg 22deg); animation: spin 18s linear infinite; pointer-events: none; }
.lu-kicker { position: relative; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lu-gold); opacity: 0; animation: rise-move .5s var(--spring) .1s both, appear 0.3s ease .1s forwards; }
.lu-num { position: relative; font-family: var(--display); font-size: clamp(110px, 38vw, 170px); font-weight: 900; line-height: .9; background: linear-gradient(180deg, var(--lu-top), var(--lu-mid, #f3b82c) 55%, var(--lu-bot, #e07a00)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 24px rgba(243, 184, 44, .5)); animation: lu-slam .6s cubic-bezier(.3, 1.6, .5, 1) .15s both; }
@keyframes lu-slam { from { opacity: 0; transform: scale(2.4) rotate(-8deg); } }
.lu-unlocks { position: relative; display: grid; gap: 8px; margin: 14px 0 6px; padding: 0; list-style: none; opacity: 0; animation: rise-move .5s var(--spring) .7s both, appear 0.3s ease .7s forwards; }
.lu-unlocks li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); font-weight: 600; }
.lu-unlocks li svg { width: 20px; height: 20px; color: var(--lu-gold); }
.lu-unlocks .face.av { width: 26px; height: 26px; }
.lu-next { position: relative; margin-top: 10px; color: var(--ink-2); opacity: 0; animation: rise-move .5s var(--spring) .7s both, appear 0.3s ease .7s forwards; }
.lvl-up .btn { position: relative; margin-top: 18px; min-width: 200px; opacity: 0; animation: rise-move .5s var(--spring) .9s both, appear 0.3s ease .9s forwards; }
/* The overlay is dark in both themes: a gold button (a black one would vanish in light mode) */
.lvl-up .btn-primary { background: var(--yellow); color: #18171a; box-shadow: 0 8px 24px rgba(243, 184, 44, .35); }
/* Right under it: keep playing without going to your avatar (it closes like a tap anywhere) */
.lvl-up .btn.lu-later { margin-top: 8px; color: var(--ink-2); }
.sw-dot { display: inline-block; width: 14px; height: 14px; margin: 0 3px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); vertical-align: -3px; }

/* New badge: a card that drops in from the top */
.badge-pop, .badge-pop[popover] { position: fixed; inset: auto 0 auto 0; top: calc(14px + var(--sat)); z-index: 170; margin: 0 auto; width: min(92vw, 380px); height: auto; border: 0; padding: 10px; display: grid; gap: 8px; border-radius: 20px; background: #18171a; color: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: badge-move .55s cubic-bezier(.3, 1.5, .5, 1) both, fade-in 0.3s ease both; cursor: pointer; }
.badge-pop.out { animation: fade-out .3s ease forwards; }
.bp-item { display: flex; align-items: center; gap: 12px; }
.bp-item span { display: grid; line-height: 1.25; }
.bp-item small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f3b82c; }

/* Medals: icon on a disc in the colour of the tier */
.bm { flex: none; position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--fill-2); color: var(--ink-3); overflow: hidden; }
.bm svg { width: 26px; height: 26px; }
.bm .bm-art { width: 100%; height: 100%; }
.bm.t0 .bm-art { filter: grayscale(1); opacity: .45; }
.bm.t1 { background: radial-gradient(circle at 35% 30%, #f2b884, #b06a2e); color: #fff; }
.bm.t2 { background: radial-gradient(circle at 35% 30%, #ffffff, #9aa5b3); color: #3b4350; }
.bm.t3 { background: radial-gradient(circle at 35% 30%, #fff1a8, #e0a400); color: #6b4a00; }
.bm.t4 { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd6e2 55%, #8d98ad); color: #2a3346; } /* platina */
.bm:not(.t0)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35), inset 0 -4px 8px rgba(0, 0, 0, .15); }
.bm.t1 .bm-art, .bm.t2 .bm-art, .bm.t3 .bm-art, .bm.t4 .bm-art { width: 74%; height: 74%; border-radius: 30%; }
.bm.t4::before { content: ""; position: absolute; inset: -40%; background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .8) 50%, transparent 60%); animation: shimmer 2.6s ease-in-out infinite; }
@keyframes shimmer { 0%, 60% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

.badge-sum { margin: 4px 2px 12px; color: var(--ink-2); font-size: 14px; }
.badge-sum b { color: var(--ink); }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.badge-card { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 14px 10px 12px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); text-align: center; }
.badge-card .bm { margin-bottom: 6px; }
.badge-card b { font-weight: 750; }
.badge-card small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.badge-card.t1 small { color: #b06a2e; }
.badge-card.t3 small { color: #c98a00; }
.badge-card.t4 small { color: #6b7891; }
.badge-card.fresh { box-shadow: 0 0 0 2px #f3b82c, var(--elev); }
.bc-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; min-height: 2.6em; }
.bc-bar { position: relative; width: 100%; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.bc-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: 3px; background: linear-gradient(90deg, #f3b82c, #ff8a1c); }
.bc-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* What a badge brings besides itself (a colour or frame for your avatar) */
.bc-reward { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 3px 9px; border-radius: 10px; text-wrap: balance; background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--ink-2); font-size: 11.5px; font-weight: 650; line-height: 1.3; }
/* Its state: a lock while still to earn, a check once it is yours */
.bc-reward svg { width: 12px; height: 12px; flex: none; stroke-width: 2.6; color: var(--ink-3); }
.bc-reward.got { background: color-mix(in srgb, var(--good) 14%, transparent); }
.bc-reward.got svg { color: var(--good); }
.badge-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--red); vertical-align: 2px; }
.btn > .badge-dot { margin-left: 0; } /* in a button its gap (8) already sets it apart: about 6px from the text, as elsewhere */

/* Jij: avatar you can tap to edit, and the level card */
.me-avatar { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.me-avatar .avatar-big { width: 64px; height: 64px; background: none; }
.me-avatar .avatar-big .face { width: 100%; height: 100%; font-size: 28px; }
.me-edit { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); box-shadow: 0 0 0 3px var(--paper); }
.me-edit svg { width: 14px; height: 14px; }
.level-card { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.lc-top { display: flex; align-items: center; gap: 12px; }
.lc-top div { display: grid; line-height: 1.25; }
.lc-top b { font-family: var(--display); font-size: 20px; font-weight: 850; }
.lc-top small { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lc-next { margin-top: 10px; font-size: 13px; color: var(--ink-2); }

/* Avatar editor */
.ave { display: grid; justify-items: center; gap: 12px; margin-top: 10px; }
.ave-grid { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: min(72vw, 270px); aspect-ratio: 1; padding: 6px; border-radius: 16px; background: var(--bg); touch-action: pan-y; box-shadow: inset 0 0 0 1px var(--line); }
/* Where you draw (the left half and the middle column): there a finger paints instead of scrolling.
   On the mirror half you can scroll the sheet as anywhere else. */
.ave-draw { position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: calc(50% + (100% - 12px) / 14); touch-action: none; }
.ave-grid i { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .22); transition: background-color .08s; }
/* Always mirrored: a line down the middle, sticking out a little above and below, shows the axis */
.ave-axis { position: absolute; z-index: 1; top: -9px; bottom: -9px; left: 50%; width: 2px; border-radius: 1px; background: rgba(255, 255, 255, .7); transform: translateX(-1px); pointer-events: none; mix-blend-mode: difference; }
/* The right half is the mirror image, a bit faded: you draw on the left (progress.js). From the axis on,
   so the middle column is half faded but can be drawn on as a whole. */
.ave-grid::before { content: ""; position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 50%; border-radius: 0 16px 16px 0;
    /* Faded, under glass: two light streaks across it, as on a mirror */
    background:
        linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, .32) 30%, transparent 40%, transparent 54%, rgba(255, 255, 255, .18) 61%, transparent 68%),
        color-mix(in srgb, var(--card) 50%, transparent);
    pointer-events: none; }
/* The tools on one row, centred */
.ave-tools { display: flex; justify-content: center; gap: 6px; }
.ave-chip { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ave-chip svg { width: 18px; height: 18px; flex: none; }
.ave-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ave-chip b { font-weight: 800; }
.ave-hint { margin: -4px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.ave-target { width: min(84vw, 340px); }
.ave-target button { font-size: 14px; }
.ave-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: min(84vw, 340px); }
.ave-palette .sw { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; transform: none !important; }
.ave-palette .sw > i { width: 100%; height: 100%; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .4); }
/* Selected: a ring around it (outline, so nothing moves) */
.ave-palette .sw[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.ave-palette .sw.locked > i { opacity: .18; }
.ave-lock { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 0; color: var(--ink-2); pointer-events: none; }
.ave-lock svg { width: 13px; height: 13px; }
.ave-lock small { font-size: 9.5px; font-weight: 800; line-height: 1; }
.ave-label { align-self: stretch; margin: 4px 0 -4px; text-align: center; }
.ave-label small { font-weight: 500; color: var(--ink-3); }
.ave-frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(84vw, 340px); }
.ave-frames .fr { position: relative; display: grid; justify-items: center; gap: 6px; padding: 14px 4px 8px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); }
.ave-frames .fr .face { width: 40px; height: 40px; }
.ave-frames .fr small { font-size: 13px; font-weight: 700; color: var(--ink); }
.ave-frames .fr[aria-pressed="true"] { outline: 2.5px solid var(--ink); outline-offset: -2.5px; }
.ave-frames .fr.locked { cursor: not-allowed; }
.ave-frames .fr.locked .face { opacity: .4; filter: grayscale(.6); }
.ave-frames .fr.locked > small { color: var(--ink-2); }
.ave-frames .fr .ave-lock { inset: 5px 5px auto auto; display: flex; gap: 3px; padding: 2px 6px; border-radius: 999px; background: var(--card); box-shadow: var(--elev); }
.ave-frames .fr .ave-lock small { font-size: 11px; }

/* Picking a duel length */
.len-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.len-pick button { display: grid; justify-items: center; gap: 1px; padding: 10px 4px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); }
.len-pick b { font-family: var(--display); font-size: 24px; font-weight: 900; line-height: 1; }
.len-pick small { font-size: 12px; color: var(--ink-3); }
.len-pick button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.len-pick button[aria-pressed="true"] small { color: inherit; opacity: .7; }

/* Round progress of a duel (pips in the yellow header) */
.duel-pips { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 14px; }
.duel-pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(24, 23, 26, .15); }
.duel-pips i.done, .duel-pips i.lost { background: rgba(24, 23, 26, .4); }
/* Played by you, the others haven't yet (or never did): not won or lost, just an outline */
.duel-pips i.open { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(24, 23, 26, .55); }
.duel-pips i.won { background: #18171a; }
.duel-pips i.now { background: #18171a; animation: blink 1.4s infinite; }
.duel-wait.big { font-size: 15px; color: var(--ink-2); text-align: center; padding: 6px 0; }

/* The end of a duel: winner, podium, rematch */
.duel-end { position: relative; margin-top: 14px; padding: 22px 18px 18px; border-radius: 24px; background: var(--card); box-shadow: var(--elev); text-align: center; overflow: hidden; }
.duel-end.victory { background: linear-gradient(170deg, #fff4cf, var(--card) 70%); }
:root[data-theme="dark"] .duel-end.victory { background: linear-gradient(170deg, #3a2e0c, var(--card) 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .duel-end.victory { background: linear-gradient(170deg, #3a2e0c, var(--card) 70%); } }
.de-rays { position: absolute; left: 50%; top: 54px; width: 1600px; height: 1600px; margin: -800px 0 0 -800px; background: repeating-conic-gradient(rgba(243, 184, 44, .14) 0 9deg, transparent 9deg 24deg); animation: spin 24s linear infinite; pointer-events: none; }
.duel-end:not(.victory) .de-rays { display: none; }
.de-cup { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #f3b82c; color: #18171a; box-shadow: 0 8px 24px rgba(243, 184, 44, .45); animation: lu-slam .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.de-cup svg { width: 34px; height: 34px; }
.duel-end h2 { position: relative; margin-top: 10px; color: var(--ink); font-family: var(--display); font-size: 26px; font-weight: 900; }
.duel-end > p { position: relative; color: var(--ink-3); font-size: 14px; }
.duel-end .btn { position: relative; margin-top: 16px; }
.de-actions { position: relative; display: grid; gap: 4px; margin-top: 16px; }
.de-actions .btn { margin-top: 0; }
.podium { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin: 18px auto 0; max-width: 340px; }
/* Two columns only with two people (not when there is no 3rd place: a shared 2nd then wrapped under the 1st) */
.podium:not(:has(> .pod:nth-child(3))) { grid-template-columns: repeat(2, 1fr); max-width: 228px; }
.pod { display: grid; justify-items: center; gap: 4px; min-width: 0; opacity: 0; animation: rise-move .5s var(--spring) both, appear .3s ease forwards; } /* (opacity 0: see appear) */
.pod.p1 { animation-delay: .35s; }
.pod.p2 { animation-delay: .15s; }
.pod.p3 { animation-delay: .25s; }
.pod .face { width: 44px; height: 44px; font-size: 18px; }
.pod.p1 .face { width: 56px; height: 56px; font-size: 22px; }
.pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pod-block {
    /* Carved: the place number is cut into the block (darker, with a light edge below and a shadow
       edge above), the block itself has a light top edge. Number at the top, at the same distance in
       every block, like a real podium; the extra height stays below. */
    --carve: color-mix(in srgb, var(--ink) 42%, var(--fill-2));
    --carve-hi: rgba(255, 255, 255, .9);
    --carve-lo: rgba(0, 0, 0, .14);
    display: grid; justify-items: center; align-content: start; row-gap: 1px; width: 100%; padding-top: 7px;
    /* Opaque (the fill is see-through): a solid block, the rays behind the winner don't shine through */
    border-radius: 12px 12px 4px 4px; background: linear-gradient(var(--fill-2), var(--fill-2)), var(--card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .05);
}
.pod-block em { font-family: var(--display); font-style: normal; font-size: 28px; font-weight: 900; line-height: 1.05; color: var(--carve); text-shadow: 0 1px 0 var(--carve-hi), 0 -1px 0 var(--carve-lo); }
.pod-block small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pod-block small strong { font-size: 16px; font-weight: 800; color: var(--ink); } /* the points are what you compare */
.pod.p1 .pod-block { --carve: #b07a0c; --carve-hi: rgba(255, 244, 205, .95); --carve-lo: rgba(110, 70, 0, .35); height: 96px; background: linear-gradient(180deg, #ffd85c, #f3b82c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(120, 80, 0, .12); }
/* Silver and bronze, in the colours of the medals in the leaderboards (.lb .medal); the same in light and dark */
.pod.p2 .pod-block { --carve: #8e8a83; --carve-hi: rgba(255, 255, 255, .9); --carve-lo: rgba(60, 55, 50, .3); height: 78px; background: linear-gradient(180deg, #ecebe7, #cfccc6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(60, 55, 50, .1); }
.pod.p3 .pod-block { --carve: #9c5f36; --carve-hi: rgba(255, 228, 206, .9); --carve-lo: rgba(90, 45, 15, .35); height: 64px; background: linear-gradient(180deg, #ecc0a0, #d69a6f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(90, 45, 15, .12); }
.pod:is(.p1, .p2, .p3) .pod-block small { color: rgba(24, 23, 26, .78); }
.pod:is(.p1, .p2, .p3) .pod-block small strong { color: #18171a; }
.pod.me b { color: var(--ink); font-weight: 800; }
/* The week-end screen (standings.js, maybeWeekRecap): a look back at last week, once at the start of
   a new one. Rhythm: 8px within a group, 14px between the cards, 28px between the parts. */
dialog.wr-sheet::before { position: relative; z-index: 1; } /* the grab handle stays above the glow */
.wr-glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; opacity: .995; background: linear-gradient(180deg, color-mix(in srgb, var(--yellow) 9%, var(--card)), var(--card) 260px); } /* (a hair short of solid: see dialog.sheet) */
.wr-glow.victory { background: linear-gradient(170deg, #fff4cf, var(--card) 340px); }
:root[data-theme="dark"] .wr-glow.victory { background: linear-gradient(170deg, #3a2e0c, var(--card) 340px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wr-glow.victory { background: linear-gradient(170deg, #3a2e0c, var(--card) 340px); } }
.wr-glow .de-rays { top: 60px; }
.week-recap { position: relative; text-align: center; }
.wr-head { display: grid; justify-items: center; gap: 8px; }
dialog.sheet .wr-head .lead { margin: 0; max-width: 34ch; text-wrap: balance; }
.wr-head h2 { line-height: 1.1; text-wrap: balance; }
.wr-cup { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 2px; border-radius: 50%; background: #f3b82c; color: #18171a; box-shadow: 0 8px 24px rgba(243, 184, 44, .45); animation: lu-slam .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.wr-cup svg { width: 30px; height: 30px; }
.wr-cup.m2, .wr-cup.m3 { font-family: var(--display); font-size: 28px; font-weight: 900; line-height: 1; animation: pop-move .6s var(--spring) both; }
.wr-cup.m2 { background: linear-gradient(180deg, #ecebe7, #cfccc6); color: #8e8a83; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(60, 55, 50, .1), 0 6px 18px rgba(60, 55, 50, .16); text-shadow: 0 1px 0 rgba(255, 255, 255, .9); }
.wr-cup.m3 { background: linear-gradient(180deg, #ecc0a0, #d69a6f); color: #9c5f36; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(90, 45, 15, .12), 0 6px 18px rgba(90, 45, 15, .16); text-shadow: 0 1px 0 rgba(255, 228, 206, .9); }
.wr-cup.calm { background: var(--streak); color: var(--red); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 60%, transparent); animation: pop-move .6s var(--spring) both; }
.wr-cup.calm svg { width: 26px; height: 26px; margin: 0; }
.wr-kicker { color: var(--ink-3); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.wr-xp { margin-top: 4px; }
.wr-frame { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.wr-frame svg { width: 16px; height: 16px; color: #c98a00; }
.wr-xp span { display: inline-grid; place-items: center; min-width: 112px; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--yellow); color: #18171a; font-family: var(--display); font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 6px 18px rgba(243, 184, 44, .35); opacity: 0; animation: pop-move .7s var(--spring) .4s both, appear .3s ease .4s forwards; }
.wr-stand { display: grid; justify-items: center; gap: 8px; margin-top: 28px; }
.wr-stand .podium { width: 100%; margin: 0 auto; }
.wr-me { padding: 6px 14px; border-radius: 999px; background: var(--me); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 50%, transparent); font-size: 14.5px; color: var(--ink-2); }
.wr-me b { color: var(--ink); }
.wr-stand .pod .face { width: 40px; height: 40px; font-size: 17px; }
.wr-stand .pod.p1 .face { width: 50px; height: 50px; font-size: 20px; }
.wr-stand .pod.p1 .pod-block { height: 86px; }
.wr-stand .pod.p2 .pod-block { height: 72px; }
.wr-stand .pod.p3 .pod-block { height: 62px; }
/* One card: the two numbers, then the week day by day */
.wr-week { margin-top: 28px; padding: 14px 16px; border-radius: var(--r-lg); background: linear-gradient(var(--fill), var(--fill)), var(--card); } /* opaque: no rays through it */
.wr-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wr-stat { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 0 8px; }
.wr-stat + .wr-stat { box-shadow: inset 1px 0 0 var(--line-2); }
.wr-stat b { display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--display); font-size: 28px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.wr-stat b small { font-size: 18px; font-weight: 800; color: var(--ink-3); } /* "15/56": the total smaller, the label below */
.wr-stat b .flame { align-self: center; width: 20px; height: 20px; margin-right: 2px; }
.wr-stat > span { font-size: 13.5px; color: var(--ink-2); }
.wr-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wr-bar { display: grid; justify-items: center; gap: 4px; }
.wr-bar i { position: relative; width: 100%; max-width: 26px; height: 40px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.wr-bar i::after { content: ""; position: absolute; inset: auto 0 0; height: calc(var(--f) * 100%); border-radius: inherit; background: color-mix(in srgb, var(--yellow) 55%, var(--card)); transform-origin: bottom; transform: scaleY(0); animation: wr-grow .6s var(--ease-out) forwards; } /* (scaleY 0: see appear) */
.wr-bar:nth-child(2) i::after { animation-delay: .05s; }
.wr-bar:nth-child(3) i::after { animation-delay: .1s; }
.wr-bar:nth-child(4) i::after { animation-delay: .15s; }
.wr-bar:nth-child(5) i::after { animation-delay: .2s; }
.wr-bar:nth-child(6) i::after { animation-delay: .25s; }
.wr-bar:nth-child(7) i::after { animation-delay: .3s; }
.wr-bar.best i::after { background: var(--yellow); }
.wr-bar small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.wr-bar.best small { color: var(--ink); }
@keyframes wr-grow { from { transform: scaleY(0); } to { transform: none; } }
.wr-best { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.wr-best b { color: var(--ink); }
dialog.sheet .week-recap .actions { margin-top: 28px; }
.duel-end-strip { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.duel-end-strip svg { width: 28px; height: 28px; flex: none; color: #e0a400; }
.duel-end-strip span { display: grid; line-height: 1.3; font-size: 14px; color: var(--ink-2); }
.duel-end-strip b { color: var(--ink); font-size: 16px; }
.duel-end-strip.victory { background: linear-gradient(100deg, #fff1bf, var(--card)); }
.recent a.duel-won .won { display: inline-flex; align-items: center; gap: 4px; color: #c98a00; font-weight: 700; }
.recent a.duel-won .won svg { width: 15px; height: 15px; }
/* Ended, not seen how yet (duelRowHtml): an invitation to look, without the result. */
.recent a.duel-unseen .unseen { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 650; }
.recent a.duel-unseen .unseen svg { width: 15px; height: 15px; color: #e0a400; }
.recent .r-score.r-chev svg { width: 18px; height: 18px; color: var(--ink-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .duel-end-strip.victory { background: linear-gradient(100deg, #3a2e0c, var(--card)); } }
:root[data-theme="dark"] .duel-end-strip.victory { background: linear-gradient(100deg, #3a2e0c, var(--card)); }
.nowrap { white-space: nowrap; }
/* Rating (Elo) next to names, in the VS intro and on the result */
.vs-id { display: grid; min-width: 0; }
.vs-half.bottom .vs-id { justify-items: end; }
.vs-id small { font-size: 14px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.rating-line { background: var(--fill); }
.rating-line svg { color: var(--ink-3); }
.rating-line.up { background: color-mix(in srgb, var(--good) 14%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent); }
.rating-line.up svg { color: var(--good); }
.rating-line.down svg { color: var(--bad); }
/* A race that counted lightly: tap for why (result.js, ratingPill) */
button.rating-line { border: 0; color: inherit; font-family: inherit; cursor: pointer; }
button.rating-line:active { transform: scale(.97); }
.rating-line .rl-why { width: 15px; height: 15px; color: var(--ink-3); margin-left: -1px; }
.rating-card { margin-top: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.rc-top { display: flex; align-items: baseline; gap: 10px; }
.rc-top b { font-family: var(--display); font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.rc-top span { font-weight: 700; }
.rc-top small { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.rc-note { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.rc-graph { display: block; width: 100%; height: 56px; margin-top: 10px; overflow: visible; }
.rc-graph path { fill: none; stroke: #e9a400; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rc-graph .area { fill: color-mix(in srgb, #f3b82c 18%, transparent); stroke: none; }
/* Rating classes (profile.js, rankEmblem / rankBarHtml): the class's gem on a disc in its colour,
   with a ring of three arcs for the step, and a bar to the next step. Mid-tones, readable in both themes;
   each its stone's own colour: grey quartz, purple amethyst, blue sapphire, green emerald, red ruby, icy diamond. */
.cls-kwarts { --cls: #7d8594; }
.cls-amethist { --cls: #8a4fc4; }
.cls-saffier { --cls: #2f62d0; }
.cls-smaragd { --cls: #109a62; }
.cls-robijn { --cls: #cf2546; }
.cls-diamant { --cls: #1ea3c8; }
.rank-em { flex: none; width: 34px; height: 34px; overflow: visible; }
.rank-em .re-disc { stroke: color-mix(in srgb, var(--cls) 70%, #000); stroke-width: .6; }
/* The light from the top left, like the badge medals (.bm) */
.rank-em .re-hi { stop-color: color-mix(in srgb, var(--cls) 62%, #fff); }
.rank-em .re-lo { stop-color: color-mix(in srgb, var(--cls) 88%, #000); }
.rank-em .re-arc { fill: none; stroke: rgba(0, 0, 0, .22); stroke-width: 2.1; stroke-linecap: round; }
.rank-em .re-arc.on { stroke: #fff; }
.rank-em .ra { fill: #fff; }
/* A gem's facets: white towards the light, a light and a deeper tint of the class colour away from it */
.rank-em .rf { fill: color-mix(in srgb, var(--cls) 30%, #fff); }
.rank-em .rg { fill: color-mix(in srgb, var(--cls) 58%, #fff); }
.rank-em .rl { fill: none; stroke: color-mix(in srgb, var(--cls) 75%, #fff); stroke-width: .6; stroke-linecap: round; stroke-linejoin: round; }
.rank-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; text-align: left; }
.rk-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rk-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; line-height: 1.2; }
.rk-line b { font-weight: 750; white-space: nowrap; }
/* Never broken inside a class name: too long next to the name, it goes under it as a whole */
.rk-line span { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.rk-bar { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.rk-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--cls); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .rk-bar i { transition: none; } }
/* On Jij and the race page: the class in its own tile (as the win/loss tiles), so it sits apart from the
   rating above it and the note below it; the bar's track a shade darker than the tile. */
:is(.rating-card, .race-hero) .rank-row { padding: 10px 12px; border-radius: 14px; background: var(--fill); } /* (as the tiles under it, .prof-kpis) */
:is(.rating-card, .race-hero) .rank-row .rk-bar { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.rating-card .rank-row + .rc-note { margin-top: 10px; }
/* On the result screen: rating and class in one strip (result.js, ratingStripHtml), as wide as a card */
.rating-strip .rs-delta { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rating-strip .rs-tri { font-style: normal; font-size: 10px; margin-right: 1px; }
.rating-strip .rs-delta.up { color: var(--good); }
.rating-strip .rs-delta.down { color: var(--bad); }
.rating-strip button.rs-delta { cursor: pointer; }
.rating-strip .rs-delta .rl-why { width: 14px; height: 14px; color: var(--ink-3); }
.rating-strip .rs-next { font-size: 12.5px; color: var(--ink-3); }
/* A step up: the emblem pops and glows in its class colour once (result.js, stepUp) */
.rating-strip.step-up .rank-em { animation: rs-step .9s var(--spring); }
@keyframes rs-step { 35% { transform: scale(1.3); filter: drop-shadow(0 0 10px var(--cls)); } }
@media (prefers-reduced-motion: reduce) { .rating-strip.step-up .rank-em { animation: none; } }
.rating-strip.edge .rs-next { color: var(--bad); }
/* On the result screen: emblem and rating in line with the content of the cards under it (.xp-card: 16px in) */
.result-top .rank-row { margin: 12px 0 0; padding: 0 16px; }
/* A class bar opens the ladder (profile.js, openLadder) */
[data-ladder] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rank-row[data-ladder]:active { transform: scale(.985); }
[data-ladder]:focus-visible { outline: 2px solid #e9a400; outline-offset: 3px; border-radius: 14px; }
.ladder { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ld-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.ld-row .rank-em { width: 38px; height: 38px; }
.ld-row.me { background: color-mix(in srgb, var(--cls) 16%, var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cls) 70%, transparent); }
.ld-main { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 2px; text-align: left; }
.ld-main b { font-weight: 800; }
.ld-main b em { font-style: normal; font-weight: 700; font-size: 12.5px; color: var(--cls); margin-left: 4px; }
.ld-main small { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ld-reward { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.ld-reward .face { width: 20px; height: 20px; flex: none; }
.ld-reward > svg { width: 14px; height: 14px; flex: none; color: var(--good); }
.ld-reward.got { color: var(--ink); }
/* In the buffer under your step (still yours, a few points left): the hint in warning colour */
.rank-row.edge .rk-line span:not(.rs-delta) { color: var(--bad); }
/* On a profile card, after the level: "Level 12 · [emblem] Smaragd II", on one line, centred on each other */
.prof-head p.prof-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; line-height: 20px; }
.prof-cls { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink-2); }
.prof-cls::before { content: "·"; margin-right: 3px; color: var(--ink-3); font-weight: 400; }
.prof-cls .rank-em { width: 16px; height: 16px; }
.prof-stars { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--ink-2); }
.prof-stars::before { content: "·"; margin-right: 5px; color: var(--ink-3); font-weight: 400; }
.prof-stars .star { width: 15px; height: 15px; }
/* The games they master (all stars on every level): their icons with a gold rim */
.prof-masters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.prof-masters > span:first-child { margin-right: 2px; }
.pm-game { display: inline-flex; border-radius: 9px; box-shadow: 0 0 0 2px #f3b82c, 0 0 6px rgba(243, 184, 44, .6); }
.pm-art { width: 24px; height: 24px; border-radius: 8px; }
/* One moment at a time (profile.js, moreInMoment): a class or a mastery reached together with a
   level joins its screen as a block under it, instead of a second screen */
.lu-extra { position: relative; display: grid; justify-items: center; gap: 6px; margin-top: 16px; padding: 12px 18px 10px; border-radius: 20px; background: color-mix(in srgb, var(--ink) 7%, transparent); animation: rise-move .5s var(--spring) both, fade-in .3s ease both; }
.lu-extra-kicker { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lu-gold); }
.lu-extra-row { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.lu-extra-row .rank-em { width: 44px; height: 44px; }
.lu-extra .lu-unlocks { margin: 4px 0 0; opacity: 1; animation: none; }
.lu-art-sm { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 2px #f3b82c; }
/* Share: under what you reached, before the main button */
.lvl-up .btn.lu-share { margin-top: 10px; min-width: 0; gap: 6px; padding: 8px 18px; color: var(--ink); }
.lu-share svg { width: 17px; height: 17px; }
.lu-extra .btn.lu-share { margin-top: 2px; opacity: 1; animation: none; }
/* Mastering a game: its tile big with a gold rim; all stars: three big stars */
.master-up .mu-mark { position: relative; animation: lu-slam .6s cubic-bezier(.3, 1.6, .5, 1) .15s both; }
.master-up .lu-art { width: clamp(110px, 32vw, 140px); height: clamp(110px, 32vw, 140px); border-radius: 30px; box-shadow: 0 0 0 5px #f3b82c, 0 10px 30px rgba(243, 184, 44, .5); }
.lu-allstars .star { width: 52px; height: 52px; }
.lu-extra .lu-allstars .star { width: 26px; height: 26px; }
/* The new class moment: the level-up overlay with the emblem instead of the number */
.rank-up .ru-em { position: relative; animation: lu-slam .6s cubic-bezier(.3, 1.6, .5, 1) .15s both; }
.rank-up .ru-em .rank-em { width: clamp(110px, 34vw, 150px); height: clamp(110px, 34vw, 150px); filter: drop-shadow(0 8px 26px color-mix(in srgb, var(--cls) 55%, transparent)); }
:is(.rank-up, .master-up) .ru-name { position: relative; margin-top: 6px; font-family: var(--display); font-size: clamp(34px, 10vw, 46px); font-weight: 900; line-height: 1; opacity: 0; animation: rise-move .5s var(--spring) .45s both, appear 0.3s ease .45s forwards; }
.duel-score small.ds-rt { margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(24, 23, 26, .12); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Profile card of a duel partner */
[data-profile] { cursor: pointer; }
.lb li[data-profile]:active, .pod[data-profile]:active, .duel-score [data-profile]:active,
.week-list li[data-profile]:active, .face-btn:active { opacity: .7; }
.face-btn { display: inline-flex; flex: none; border-radius: 50%; }
/* The rating label is wider than a small face: keep it clear of the list's edge */
/* (also in your own row, .ds-sum, or your face stood 5px left of the others) */
:is(.ds-row summary, .ds-sum) > :is(.rated, .face-btn) { margin: 0 2px 0 5px; }
/* The card before its data (profile.js skeleton): the real blocks with placeholders in them */
.sk.sk-txt { display: inline-block; vertical-align: top; color: transparent !important; border-radius: 6px; line-height: inherit; }
.prof-sk .h2h-row > span:first-of-type { overflow: visible; }
.prof-sk .prof-go:disabled { opacity: .45; }
.prof-head { display: flex; align-items: center; gap: 18px; padding-left: 4px; }
.prof-head .face { width: 64px; height: 64px; font-size: 28px; flex: none; }
.prof-head h2 { font-family: var(--display); font-size: 26px; font-weight: 900; line-height: 1.1; }
.prof-head p { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.prof-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.prof-kpis + .prof-kpis { margin-top: 8px; } /* the stats: one group with the rating row above */
.prof-kpis div { display: grid; justify-items: center; align-content: start; padding: 10px 4px; border-radius: 14px; background: var(--fill); } /* (start: next to a label on two lines, the others stay right under their number) */
.prof-kpis b { font-family: var(--display); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.prof-kpis b small { font-size: 15px; color: var(--ink-3); font-weight: 700; } /* "4 / 6" duels won, as on the Jij page */
.prof-kpis span { font-size: 12px; color: var(--ink-3); text-align: center; text-wrap: balance; } /* "puzzels opgelost" wraps on narrow screens */
.prof-h { margin-top: 18px; font-family: var(--display); font-size: 18px; font-weight: 850; }
.prof-lead { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.h2h { display: grid; gap: 6px; margin-top: 10px; }
.h2h-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.h2h-row .r-icon { width: 26px; height: 26px; }
.h2h-row:not(:has(.r-icon)) { grid-template-columns: minmax(0, 1fr) auto; }
.h2h-row span { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-row b { font-variant-numeric: tabular-nums; font-weight: 800; }
.h2h-row b i { margin: 0 4px; font-style: normal; color: var(--ink-3); }
.h2h-row.big b { font-family: var(--display); font-size: 20px; }
.h2h-bar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--red) 55%, var(--fill-2)); overflow: hidden; }
.h2h-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--good); border-radius: 3px 0 0 3px; }
/* Best badges: a tile each, like the numbers above, with the tier in its own metal colour */
.prof-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.prof-badges div { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 12px 6px 10px; border-radius: 14px; background: var(--fill); text-align: center; }
.prof-badges .bm { width: 46px; height: 46px; margin-bottom: 5px; }
.prof-badges .bm svg { width: 23px; height: 23px; }
.prof-badges b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.prof-badges small { font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.prof-badges small.t1 { color: #b06a2e; }
.prof-badges small.t2 { color: #8a94a2; }
.prof-badges small.t3 { color: #c49000; }
.prof-badges small.t4 { color: #7a86a0; }
.prof-go { margin-top: 18px; }
/* Rating as a small label under a face */
.rated { position: relative; display: inline-flex; flex: none; justify-self: center; padding-bottom: 9px; }
.face-rt { position: absolute; z-index: 3; /* above a frame's stars or sparkles */ left: 50%; bottom: 0; transform: translateX(-50%); padding: 1px 5px; border-radius: 8px; background: var(--yellow); color: #18171a; font-size: 10px; font-weight: 800; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--card); pointer-events: none; }
.face-rt.prov { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--yellow) 75%, transparent), 0 0 0 2px var(--card); }
.pod .face-rt { font-size: 11px; }
.prof-note { margin-top: 8px; font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.lu-explain { position: relative; max-width: 320px; margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.45; opacity: 0; animation: rise-move .5s var(--spring) .6s both, appear 0.3s ease .6s forwards; }
/* Opponents row on the Duels tab */
/* The rows' 8px padding (room for the pressed background) is pulled back with -8px margins, so the
   faces sit 10px under the title like any card, and the names 28px above the next part. */
/* 10px extra on top (pulled back with the margin): a scroller clips vertically too, and frames such as
   Lauwerkrans, Sterren, Zon and Kroon reach 9-12px beyond the face, more than the 8px of .rival. */
.rivals { display: flex; gap: 6px; margin: -18px -16px -8px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
/* Scrolled: the start fades too; at the end the right edge no longer does (duels.js) */
.rivals.from-start { -webkit-mask: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.rivals.from-start.to-end { -webkit-mask: linear-gradient(90deg, transparent, #000 36px); mask: linear-gradient(90deg, transparent, #000 36px); }
.rivals.to-end:not(.from-start) { -webkit-mask: none; mask: none; }
.rivals::-webkit-scrollbar { display: none; }
.rival { position: relative; flex: none; display: grid; justify-items: center; align-content: start; gap: 6px; width: 76px; padding: 8px 2px; border: 0; border-radius: 16px; background: none; color: var(--ink); }
.rival .face { width: 52px; height: 52px; font-size: 22px; }
.rival > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 1.2; }
/* Long names: two short lines at the hyphen or space ("Wilhelmina-" / "Anna"), or one smaller line */
.rival > span.wrap { white-space: normal; text-align: center; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rival > span.long { font-size: 11.5px; }
.rival:active { background: var(--fill); }
/* You, first in the row: a link (no button styling), with a thin line after it to set you apart. */
.rival.me { text-decoration: none; margin-right: 6px; }
.rival.me::after { content: ""; position: absolute; top: 14px; bottom: 28px; right: -4px; width: 1px; background: var(--line); }
.rival.me > span:last-child { font-weight: 750; }
/* Playing right now (finished something in the last minutes, or has a puzzle open) */
.rival .online { position: absolute; top: 9px; left: calc(50% + 14px); width: 13px; height: 13px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2.5px var(--paper); }
.rc-prov { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 4px; }
.h2h-bar.empty { background: var(--fill-2); }
/* Giving up (leave dialog) and the board showing the solution afterwards */
/* A choice as a row with its explanation inside: "Even weg?" (game.js, askLeave) */
.leave-actions { gap: 8px; }
.leave-opt { justify-content: flex-start; gap: 14px; min-height: 64px; padding: 12px 16px; text-align: left; white-space: normal; background: var(--fill); box-shadow: none; }
.leave-opt svg { flex: none; width: 22px; height: 22px; color: var(--ink-2); }
.leave-opt span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.leave-opt b { font-weight: 700; }
.leave-opt small { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--ink-3); }
.giveup-btn b, .giveup-btn svg { color: var(--bad); }
.game.gave-up .board-wrap { opacity: .92; pointer-events: none; } /* given up: the board is done, nothing to tap */
/* Given up (practice): on, or home: two buttons of their own (no glass bar: they are two separate
   steps), side by side and as tall as the bar was, so the board above stays where it was (under each
   other they took a row more and the board jumped up 25px). */
.game.gave-up .controls { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; padding: 5px 0; background: none; box-shadow: none; }
.game.gave-up .controls .btn { grid-column: auto; min-height: 58px; padding: 10px 14px; border-radius: var(--r); font-size: 15px; flex-direction: row; }
.game.gave-up .controls .btn:not(.btn-primary) { background: var(--card); box-shadow: var(--elev); color: var(--ink); }
.game.gave-up .controls .btn svg { width: 18px; height: 18px; color: inherit; }

/* ======================================================================
   Press feedback for what has none of its own (found by forcing :active on every button and link): text links,
   fold-outs, tabs, segmented switches and your avatar. Every tap should answer under your finger.
   ====================================================================== */
.link-btn { transition: opacity .1s; }
.link-btn:active { opacity: .55; }
summary { -webkit-tap-highlight-color: transparent; transition: opacity .1s; }
summary:active { opacity: .65; }
.tab, .seg button { transition: background-color .15s, color .15s, box-shadow .15s, transform .1s; }
.tab:active, .seg button:active { transform: scale(.96); }
.me-avatar { transition: transform .1s; }
.me-avatar:active { transform: scale(.94); }
/* Cards, rows and links that had their transition only for a mouse: on touch their press jumped */
.daily-tile, .past-link, .daily-score, .daily-share, .unplayed-btn, .lb li[data-profile], .week-list li[data-profile], .pod[data-profile], .rival { transition: transform .1s, background-color .15s, opacity .15s; }
.race-rating, .brand { transition: opacity .15s; }
.past-link:active { transform: scale(.985); }
.brand:active { opacity: .6; }
/* (no colour transition: the background faded while the text switched at once, so for a moment the
   white "21" stood on light grey and vanished: the buttons seemed to blink) */
.len-pick button { transition: transform .1s; }
.len-pick button:active { transform: scale(.95); }

/* ======================================================================
   Game pages (/spoor, /balans, ...): src/php/gamepage.php, src/js/gamepage.js
   ====================================================================== */

/* The art spots are reserved before the app fills them, so nothing jumps. */
.gamepage .tile > [data-art] { grid-row: 1 / span 3; grid-column: 2; width: 84px; height: 84px; }
.gamepage .practice-tile > [data-art] { display: block; width: 50px; height: 50px; }
.gamepage .level.loading > * { visibility: hidden; }
.gamepage .level.loading::after { left: 50%; right: auto; top: 50%; margin: -7px 0 0 -7px; }
.gp-note { margin: 12px 4px 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); text-align: center; }
.gp-intro { margin: 20px 4px 0; font-size: 16px; line-height: 1.55; color: var(--ink); }
.gp-card { padding: 16px 18px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--elev); }
.gp-card > p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.gp-card b { color: var(--ink); font-weight: 650; }
.gp-card .rule-list { margin-top: 0; }
.gp-tips { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gp-tips li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.gp-tips li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--tile); }
.gp-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.gp-actions .btn { text-decoration: none; }
.gp-more { margin-bottom: 8px; }
.gp-more .practice-tile { text-decoration: none; }

/* ======================================================================
   Invite link for the daily standings (src/js/partners.js)
   ====================================================================== */

.tile-stand { --tile: var(--red); }
/* Next to the face: on a narrow phone a long word ("dagpuzzels") breaks with a hyphen, not anywhere */
.partner-join .tile h1 { font-size: clamp(26px, 8.4vw, 40px); overflow-wrap: break-word; hyphens: auto; }
/* The inviter's avatar where a game tile has its art */
.pj-face { grid-row: 1 / span 3; grid-column: 2; align-self: start; }
.pj-face .face { width: 76px; height: 76px; font-size: 32px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .9); }
/* The explanation in the middle between the tile and what follows, measured on the letters themselves
   (the line height adds room under a line that the eye doesn't count): as the line on a puzzle's start page */
.partner-join .lead { margin-top: 20px; }
.partner-join .lead + :is(.btn, form) { margin-top: 19px; }
.partner-join .lead + form:has(> .name-form) { margin-top: 15px; } /* (its label: "Jouw naam") */
/* In the standings sheet, under the list: a real button (two links under each other would look unfinished) */
.st-invite, .st-recap { margin-top: 20px; }
.st-recap + .st-invite { margin-top: 10px; }
/* On a profile card: only for someone who came in via an invite link */
.prof-remove { display: flex; width: fit-content; margin: 12px auto 0; }
/* The week-end screen: a compact "Delen" next to the main button */
dialog.sheet .week-recap .actions { grid-template-columns: auto minmax(0, 1fr); }
/* A face without an avatar is red: white on the red tile, so it doesn't melt into it */
.pj-face .face:not(.av) { background: #fff; color: var(--red); }

/* ======================================================================
   Desktop: everything you can click answers the mouse
   ====================================================================== */
/*
 * With a mouse, every clickable thing reacts when you point at it (a finger gets the press feedback
 * from :active instead). One language: a white card turns a touch grey, like the buttons; a coloured
 * tile lights up a little; text and icons turn darker; a face grows a little.
 */
@media (hover: hover) and (pointer: fine) {
    .daily-tile:hover, .past-link:hover, .daily-score:hover, .daily-share:hover { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
    .unplayed-btn:hover { background: var(--fill-2); }
    .practice-tile:hover { filter: brightness(1.07); }
    .practice-tile { transition: transform .1s, box-shadow .1s, filter .15s; }
    /* Tab bar, logo, tabs and the segmented choices: the text comes forward */
    .tabbar a:not([aria-current="page"]):hover { color: var(--ink-2); }
    .brand:hover { opacity: .78; }
    .tab:not([aria-selected="true"]):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
    .seg button:not([aria-pressed="true"]):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
    /* Text links: darker, and the underline too */
    .link-btn:hover, .doc a:hover { color: var(--ink); text-decoration-color: currentColor; }
    /* On a fixed colour the theme colours don't fit: in dark mode they turned the text light on yellow and the
       white install button dark under its dark text */
    .duel-hero .link-btn:hover { color: #18171a; opacity: 1; }
    .ib-btn:not(:disabled):hover { background: #fff !important; filter: brightness(.94); }
    .lvl-up .btn-primary:not(:disabled):hover { background: var(--yellow) !important; filter: brightness(1.05); }
    /* People: a face grows a little; a row with someone in it greys like a card */
    .rival .face, .me-avatar .face, .pod[data-profile] .face, .duel-score [data-profile] .face, .face-btn .face { transition: transform .18s var(--spring); }
    .rival:hover .face, .me-avatar:hover .face, .pod[data-profile]:hover .face, .duel-score [data-profile]:hover .face, .face-btn:hover .face { transform: scale(1.06); }
    .lb li[data-profile]:not(.me):hover, .week-list li[data-profile]:not(.me):hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
    .race-rating:hover { opacity: .8; }
    /* Reactions and thumbs on the result page */
    .react button:not([aria-pressed="true"]):hover { transform: scale(1.08); }
    /* In the sheets: the people to invite, the number of rounds, a row of the standings */
    .who-chip:not([aria-pressed="true"]):hover, .len-pick button:not([aria-pressed="true"]):hover { background: var(--fill-2); }
    /* (no colour transition on the rounds: choosing one would blink again, see .len-pick button) */
    .ds-row:not(.ds-me) summary:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
    .rate button { transition: transform .1s, background-color .15s, color .15s; }
    .rate button:not([aria-pressed="true"]):hover { background: var(--fill); color: var(--ink); }
}
