/* ============================================================================
   Board Game — Admin panel stylesheet
   ----------------------------------------------------------------------------
   One global sheet; the pages carry no styling of their own beyond the class
   vocabulary below. Kept dependency-free on purpose: this server is deployed
   self-hosted and may run without outbound internet, so no CDN font or CSS
   framework is pulled in. Everything here is plain CSS custom properties.

   Class vocabulary the .razor pages rely on (do not rename without grepping
   Components/): admin-shell · admin-nav · admin-content · card · btn (+ -sm,
   -secondary, -danger, -success) · table · pill (+ status modifiers) · muted ·
   error · success-msg · toolbar · search-row · inline-form · detail-grid
   (.label/.value) · dash-grid/.dash-tile · login-page/.login-card · back-link.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------

   Every colour is declared exactly once, as a light/dark pair via light-dark().
   The plain declaration on the same line is the fallback for engines without
   light-dark() — they keep the light value and simply never go dark.

   Which of the pair is used comes from the `color-scheme` in effect:
     no attribute        → `light dark`  → follows the OS setting
     [data-theme=light]  → `light`       → forced light
     [data-theme=dark]   → `dark`        → forced dark
   so the explicit toggle (AD-12) and the OS default share one palette instead
   of the usual duplicated @media block that drifts the moment someone edits
   only half of it.
   ------------------------------------------------------------------------ */

:root {
    color-scheme: light dark;

    /* Surfaces */
    /* Light values are deliberately a shade off white and off black: pure white cards on a
       near-white page under ink-black text read as glare (client feedback 2026-09-12). */
    --bg: #e3e6ec;                    --bg: light-dark(#e3e6ec, #0c0e14);
    --surface: #f1f3f6;               --surface: light-dark(#f1f3f6, #141721);
    --surface-2: #e9ecf1;             --surface-2: light-dark(#e9ecf1, #1a1e29);
    --surface-sunken: #dde1e8;        --surface-sunken: light-dark(#dde1e8, #0f1219);

    /* Ink */
    --text: #22272f;                  --text: light-dark(#22272f, #eceff5);
    --text-2: #4d5565;                --text-2: light-dark(#4d5565, #b0b9c8);
    --muted: #757d8c;                 --muted: light-dark(#757d8c, #7b8595);

    /* Lines */
    --border: #d3d8e0;                --border: light-dark(#d3d8e0, #252a37);
    --border-strong: #bfc6d1;         --border-strong: light-dark(#bfc6d1, #333a4a);

    /* Brand */
    --accent: #4f46e5;                --accent: light-dark(#4f46e5, #6366f1);
    --accent-hover: #4338ca;          --accent-hover: light-dark(#4338ca, #818cf8);
    --accent-soft: #eef2ff;           --accent-soft: light-dark(#eef2ff, #221f52);
    --accent-ink: #3730a3;            --accent-ink: light-dark(#3730a3, #c7d2fe);
    --accent-wash: #e7e6fb;           --accent-wash: light-dark(#e7e6fb, #232155);

    /* INV-19: the four rarities, the game's colours, darker on the light theme so they read on it. */
    --rarity-common: #6b7588;         --rarity-common: light-dark(#6b7588, #a3aec2);
    --rarity-rare: #0b7fc0;           --rarity-rare: light-dark(#0b7fc0, #38b6ff);
    --rarity-epic: #8b3fe0;           --rarity-epic: light-dark(#8b3fe0, #b36bff);
    --rarity-legendary: #c96a00;      --rarity-legendary: light-dark(#c96a00, #ff9d2e);

    /* Semantic */
    --danger: #dc2626;                --danger: light-dark(#dc2626, #ef4444);
    --danger-soft: #fee2e2;           --danger-soft: light-dark(#fee2e2, #3a1618);
    --danger-ink: #991b1b;            --danger-ink: light-dark(#991b1b, #fca5a5);
    --danger-hover: #b91c1c;          --danger-hover: light-dark(#b91c1c, #dc2626);
    --success: #15803d;               --success: light-dark(#15803d, #22c55e);
    --success-soft: #dcfce7;          --success-soft: light-dark(#dcfce7, #0e2c1a);
    --success-ink: #14532d;           --success-ink: light-dark(#14532d, #86efac);
    --success-hover: #14682f;         --success-hover: light-dark(#14682f, #16a34a);
    --warn: #b45309;                  --warn: light-dark(#b45309, #f59e0b);
    --warn-soft: #fef3c7;             --warn-soft: light-dark(#fef3c7, #382807);
    --warn-ink: #92400e;              --warn-ink: light-dark(#92400e, #fcd34d);
    --info: #1d4ed8;                  --info: light-dark(#1d4ed8, #3b82f6);
    --info-soft: #dbeafe;             --info-soft: light-dark(#dbeafe, #122048);
    --info-ink: #1e40af;              --info-ink: light-dark(#1e40af, #93c5fd);
    --neutral-soft: #eef0f3;          --neutral-soft: light-dark(#eef0f3, #232834);
    --neutral-ink: #4b5563;           --neutral-ink: light-dark(#4b5563, #9aa4b4);

    /* Sidebar. An earlier revision pinned this dark in both themes as a style
       choice; the client reported it as a bug, and they are right — turning on
       light mode and getting a half-dark window reads as broken, not as branding.
       It now follows the theme like everything else. */
    --nav-bg: #eceef3;                --nav-bg: light-dark(#eceef3, #090b10);
    --nav-bg-2: #e0e3ea;              --nav-bg-2: light-dark(#e0e3ea, #191d27);
    --nav-active: #d9d9f4;            --nav-active: light-dark(#d9d9f4, #2b2a5e);
    --nav-text: #4d5565;              --nav-text: light-dark(#4d5565, #a3abbb);
    --nav-text-hi: #22272f;           --nav-text-hi: light-dark(#22272f, #ffffff);
    --nav-border: #d3d8e0;            --nav-border: light-dark(#d3d8e0, #262b38);

    /* The ground the game's own art sits on (Games: tab icon, matchmaking icon, label). Dark in
       dark mode like the game. Light mode keeps it light (developer, 2026-10-05: no black
       patches in light mode), a blue-grey deep enough for a white icon to read. */
    --art-ground: #c9d1e3;            --art-ground: light-dark(#c9d1e3, #1f2b48);
    --art-ground-ink: #7f8bab;        --art-ground-ink: light-dark(#7f8bab, #1f2b48);
    --art-ground-text: #22304f;       --art-ground-text: light-dark(#22304f, #dfe5f2);

    /* Depth */
    --shadow-sm: 0 1px 2px rgba(16, 19, 26, .05), 0 1px 3px rgba(16, 19, 26, .04);
    --shadow-sm: light-dark(0 1px 2px rgba(16, 19, 26, .05), 0 1px 2px rgba(0, 0, 0, .40));
    --shadow-md: 0 1px 3px rgba(16, 19, 26, .04), 0 8px 24px rgba(16, 19, 26, .07);
    --shadow-md: light-dark(0 1px 3px rgba(16, 19, 26, .04), 0 8px 24px rgba(0, 0, 0, .40));
    --shadow-lg: 0 12px 36px rgba(16, 19, 26, .16), 0 2px 8px rgba(16, 19, 26, .08);
    --shadow-lg: light-dark(0 12px 36px rgba(16, 19, 26, .16), 0 12px 36px rgba(0, 0, 0, .60));

    --radius:    10px;
    --radius-sm: 7px;
    --radius-lg: 14px;

    --nav-w: 236px;

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
                 "Liberation Mono", monospace;
}

/* AD-12 — an explicit choice overrides the OS. Set by the theme toggle and
   replayed from localStorage by the inline script in App.razor before first
   paint, so a dark-mode admin never gets a white flash on navigation. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* The game's own font for its label (Games, Lobby), shipped beside the sheet (OFL, fonts/OFL-LilitaOne.txt). */
@font-face { font-family: "Lilita One"; src: url("fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: swap; }

/* ---- Base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.011em; }

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* One consistent focus ring everywhere — the panel moves real money, so
   keyboard operability is not optional. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: var(--accent); color: #fff; }

/* ---- Layout shell ------------------------------------------------------- */

.admin-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.admin-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.25rem 4rem;
    max-width: 1320px;
}

.admin-content > h1 {
    font-size: 1.55rem;
    font-weight: 680;
    margin: 0 0 1.35rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}

/* A <p class="muted"> straight after the page title reads as a subtitle, so
   pull it back up under the heading instead of leaving it floating. */
.admin-content > h1 + p.muted {
    margin: -1rem 0 1.35rem;
    font-size: 0.88rem;
}

.admin-content h2 {
    font-size: 0.95rem;
    font-weight: 650;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-2);
}

.card > h2:first-child { margin-top: 0; }

/* ---- Sidebar ------------------------------------------------------------ */

.admin-nav {
    width: var(--nav-w);
    flex-shrink: 0;
    background: var(--nav-bg);
    color: var(--nav-text);
    display: flex;
    flex-direction: column;
    padding: 1.15rem 0.75rem 0.9rem;
    gap: 0.1rem;
    border-right: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    /* dvh tracks the address bar as it hides; the vh line above it is the fallback for
       engines that do not know dvh, which land on the old (slightly too tall) behaviour
       rather than on nothing. */
    height: 100vh;
    height: 100dvh;
    /* No overflow here: .nav-scroll inside owns the scrolling. Both having it meant two
       nested scroll containers, and the outer one painted a full-height scrollbar down the
       sidebar for a box that never actually scrolled. */
    overflow: hidden;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
}

/* ---- Mobile header + drawer --------------------------------------------- */
/* Both are inert above 860px: the sidebar is permanently on screen there, so there is no
   second navigation to keep in step — only a different way of showing the same one. */

.mobile-bar { display: none; }
.nav-backdrop { display: none; }
.admin-nav .nav-close { display: none; }

.admin-nav .brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--nav-text-hi);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    padding: 0.35rem 0.6rem 0.5rem;
    margin-bottom: 0.85rem;
}

/* The mark is a <BrandMark /> in the markup, not a pseudo-element: a background image on
   ::before renders nothing if anything about the data URI or the shorthand upsets one
   engine, and it fails silently when it does. Inline SVG either draws or shows up in the
   DOM inspector. */
.brand > svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* NOTE: this rule used to read `.admin-nav ::deep a, .admin-nav a`. `::deep`
   is Blazor scoped-CSS syntax and is invalid in a global sheet — and an
   invalid selector anywhere in a comma-separated list drops the WHOLE rule,
   so the nav links silently rendered as unstyled default-blue anchors. */
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--nav-text);
    text-decoration: none;
    padding: 0.42rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.865rem;
    font-weight: 500;
    position: relative;
    transition: background-color .13s ease, color .13s ease;
}

.admin-nav a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.65;
}

.admin-nav a:hover {
    background: var(--nav-bg-2);
    color: var(--nav-text-hi);
    text-decoration: none;
}
.admin-nav a:hover svg { opacity: 1; }

.admin-nav a.active {
    background: var(--nav-active);
    color: var(--nav-text-hi);
    font-weight: 600;
}
.admin-nav a.active svg { opacity: 1; color: var(--accent-hover); }

/* Left rail on the active item — reads faster than colour alone. */
.admin-nav a.active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-hover);
}

/* AD-12 theme switch — a segmented control, so the three states are all visible
   at once instead of hiding behind a cycling button whose next state you have to
   guess. Sits in the sidebar, which is dark in both themes, hence the fixed
   nav-* colours rather than the surface tokens. */
.theme-toggle {
    display: flex;
    gap: 2px;
    margin: 0 0.6rem 0.4rem;
    padding: 3px;
    background: var(--nav-bg-2);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
}
.theme-toggle button {
    flex: 1;
    min-height: 28px;
    padding: 0.3rem 0.2rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--nav-text);
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color .13s ease, color .13s ease;
}
.theme-toggle button:hover { color: var(--nav-text-hi); }
.theme-toggle button.active {
    background: var(--nav-active);
    color: var(--nav-text-hi);
}

/* U-24 language menu. One button behind a globe that opens the list of languages the
   panel has files for. It keeps the theme switch's frame, so the two still read as one
   "how this looks to me" group. The list opens upward: in the sidebar it sits at the very
   bottom of the screen. */
.lang-menu {
    position: relative;
    margin: 0 0.6rem 0.4rem;
}
.lang-button {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 34px;
    padding: 0.4rem 0.55rem;
    background: var(--nav-bg-2);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
    color: var(--nav-text);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: color .13s ease, border-color .13s ease;
}
.lang-button:hover,
.lang-menu.open .lang-button { color: var(--nav-text-hi); }
.lang-button svg { width: 15px; height: 15px; flex: none; }
.lang-button svg:last-child { width: 13px; height: 13px; opacity: .7; transition: transform .15s ease; }
.lang-menu.open .lang-button svg:last-child { transform: rotate(180deg); }
.lang-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-scrim { position: fixed; inset: 0; z-index: 29; }
.lang-list {
    position: absolute;
    inset-inline: 0;
    bottom: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--nav-bg-2);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.lang-list button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--nav-text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}
.lang-list button span { flex: 1; }
.lang-list button svg { width: 14px; height: 14px; flex: none; }
.lang-list button:hover { color: var(--nav-text-hi); background: var(--nav-bg); }
.lang-list button.active { background: var(--nav-active); color: var(--nav-text-hi); }

/* Display preferences also appear on the sign-in screen, which has no sidebar. There the
   group sits on the card's own surface, so it needs the page palette, not the nav one. */
.login-card .theme-toggle,
.login-card .lang-menu { margin: 0 0 0.6rem; }
.login-card .theme-toggle,
.login-card .lang-button,
.login-card .lang-list {
    background: var(--surface-sunken);
    border-color: var(--border);
}
.login-card .theme-toggle button,
.login-card .lang-button,
.login-card .lang-list button { background: transparent; color: var(--text-2); }
.login-card .lang-button:hover,
.login-card .lang-menu.open .lang-button,
.login-card .lang-list button:hover { color: var(--text); }
.login-card .lang-list { background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.login-card .theme-toggle button.active,
.login-card .lang-list button.active { background: var(--accent-soft); color: var(--accent-ink); }
.login-card .display-prefs { display: flex; gap: 0.5rem; }
.login-card .display-prefs > * { flex: 1; }

/* ---- RTL (AD-09) --------------------------------------------------------
   Arabic mirrors the layout. Only the handful of rules that encode a physical
   side need flipping — everything laid out with flex/grid mirrors itself once
   `dir="rtl"` is on the root. */

[dir="rtl"] .admin-nav {
    border-right: none;
    border-left: 1px solid var(--nav-border);
}
[dir="rtl"] .admin-nav a.active::before {
    left: auto;
    right: -0.75rem;
    border-radius: 3px 0 0 3px;
}
[dir="rtl"] th,
[dir="rtl"] td { text-align: right; }
[dir="rtl"] .back-link::before { content: "92"; }
[dir="rtl"] select {
    padding-right: 0.7rem;
    padding-left: 2rem;
    background-position: left 0.65rem center;
}
/* Identifiers, amounts and timestamps stay left-to-right inside an RTL page —
   a GUID or a balance reordered by bidi is unreadable and, worse, mis-copyable. */
[dir="rtl"] .mono,
[dir="rtl"] .id-cell { direction: ltr; text-align: right; unicode-bidi: embed; }

.who-am-i {
    padding: 0.7rem 0.6rem 0.6rem;
    border-top: 1px solid var(--nav-border);
    margin-top: 0.5rem;
}
.who-am-i .name {
    color: var(--nav-text-hi);
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.who-am-i .role {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.signout {
    margin: 0.15rem 0.6rem 0;
    background: transparent;
    border: 1px solid var(--nav-border);
    color: var(--nav-text);
    border-radius: var(--radius-sm);
    padding: 0.45rem;
    min-height: 34px;
    font-size: 0.83rem;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .13s ease, color .13s ease, border-color .13s ease;
}
.signout:hover {
    background: var(--nav-bg-2);
    border-color: var(--border-strong);
    color: var(--nav-text-hi);
}

/* ---- Cards -------------------------------------------------------------- */

.card {
    /* The users table is nine columns wide including a full GUID, so on a narrow
       window it used to spill past the card's right edge and the action buttons
       rendered outside the panel. Scrolling inside the card keeps every row's
       controls within the surface they belong to, at every width. */
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* ---- Buttons ------------------------------------------------------------ */

button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.95rem;
    font-family: inherit;
    font-size: 0.865rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background-color .13s ease, transform .06s ease, box-shadow .13s ease;
}
.btn:hover:not(:disabled) {
    background: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }

.btn:disabled,
.btn[disabled] { cursor: default; opacity: 0.5; box-shadow: none; }

.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-sunken); color: var(--text); }

.btn-danger  { background: #dc2626; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }

/* Solid buttons keep the deep shade in both themes: white on the dark theme's bright green or
   red read at barely 2:1. The bright shades stay for text and pills. */
.btn-success { background: #15803d; }
.btn-success:hover:not(:disabled) { background: #166534; }

.btn-sm { padding: 0.34rem 0.7rem; font-size: 0.8rem; border-radius: 6px; }

/* ---- Forms -------------------------------------------------------------- */

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=datetime-local], input[type=time], input[type=search],
input[type=number], select, textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: border-color .13s ease, box-shadow .13s ease;
}

input::placeholder { color: var(--muted); }

input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=url]:focus,
input[type=date]:focus, input[type=datetime-local]:focus, input[type=time]:focus, input[type=search]:focus,
input[type=number]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}
/* Read-only reads as text, not as a field waiting for typing (developer, 2026-10-05): no
   highlight, no caret. */
input[readonly]:focus, textarea[readonly]:focus { border-color: var(--border-strong); box-shadow: none; }
input[readonly], textarea[readonly] { caret-color: transparent; cursor: default; }

select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2378808f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

.toolbar,
.search-row,
.inline-form {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}
.toolbar { margin-bottom: 1rem; }
.search-row { margin-bottom: 1.1rem; }
.search-row input[type=text] { max-width: 340px; }
.inline-form input, .inline-form select { width: auto; }

/* Labelled fields stacked in a column — used where an inline row would put a password
   box and its label on the same line. */
.stacked-form { display: grid; gap: 0.75rem; max-width: 420px; margin-bottom: 1rem; }
.stacked-form label { display: block; font-size: 0.815rem; font-weight: 620; color: var(--text-2); }
.stacked-form label > * { margin-top: 0.3rem; }
/* A button made of a label (a picture's Upload, a sound's Add) stays a button inside a form (developer, 2026-10-05: System message's Upload looked broken). */
.stacked-form label.btn { display: inline-flex; align-items: center; justify-content: center; }
.stacked-form label.btn > * { margin-top: 0; }
.stacked-form label.btn:not(.btn-secondary) { color: #fff; }

.hint { font-size: 0.8rem; margin-top: -0.35rem; }

/* The identity block is now a link to /profile. */
a.who-am-i {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color .13s ease;
}
a.who-am-i:hover { background: var(--nav-bg-2); text-decoration: none; }
a.who-am-i svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
a.who-am-i .name, a.who-am-i .role { display: block; }

/* A fee cell carrying an admin override, so a changed price is visible at a glance. */
input.overridden {
    border-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

/* ---- Tables ------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    /* Balances and amounts sit in columns — line the digits up. */
    font-variant-numeric: tabular-nums;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    color: var(--muted);
    font-weight: 650;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-strong);
}

th, td {
    text-align: left;
    padding: 0.62rem 0.75rem;
    vertical-align: middle;
}

td { border-bottom: 1px solid var(--border); color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 550; }

/* Secondary identity line (email under a username) — same cell, clearly subordinate. */
td .sub { font-size: 0.78rem; font-weight: 400; margin-top: 1px; }

tbody tr { transition: background-color .1s ease; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* Uploaded picture preview in a table cell. */
.thumb {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 0.3rem;
}

/* ---- Pills -------------------------------------------------------------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: var(--neutral-soft);
    color: var(--neutral-ink);
}
.pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.pill-pending  { background: var(--warn-soft);    color: var(--warn-ink); }
.pill-approved { background: var(--info-soft);    color: var(--info-ink); }
.pill-paid     { background: var(--success-soft); color: var(--success-ink); }
.pill-resolved { background: var(--success-soft); color: var(--success-ink); }
.pill-reversed { background: var(--danger-soft);  color: var(--danger-ink); }
.pill-open     { background: var(--danger-soft);  color: var(--danger-ink); }
.pill-role     { background: var(--accent-soft);  color: var(--accent-ink); }
.pill-rejected, .pill-dismissed { background: var(--neutral-soft); color: var(--neutral-ink); }

/* Presence (AD-10) — a separate axis from the ban badge above, so it gets its own
   colours rather than reusing the approval palette and reading as a verdict. */
.pill-online  { background: var(--success-soft); color: var(--success-ink); }
.pill-inmatch { background: var(--accent-soft);  color: var(--accent-ink); }
.pill-away    { background: var(--warn-soft);    color: var(--warn-ink); }
.pill-busy    { background: var(--danger-soft);  color: var(--danger-ink); }
.pill-offline { background: var(--neutral-soft); color: var(--neutral-ink); }

/* A raw GUID is 36 characters and would otherwise set the table's column width.
   Admins need it copyable in full, so keep the text intact and let the cell
   shrink instead of truncating what they came to read. */
.id-cell {
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
    user-select: all;
}

/* ---- Dashboard tiles ---------------------------------------------------- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(238px, 100%), 1fr));
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.dash-tile {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.05rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: border-color .14s ease, background-color .14s ease,
                transform .14s ease, box-shadow .14s ease;
}
.dash-tile:hover {
    border-color: var(--accent);
    background: var(--surface);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.dash-tile strong { font-size: 0.95rem; font-weight: 650; }
.dash-tile .muted { font-size: 0.815rem; line-height: 1.45; }

.dash-tile svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0.35rem;
    color: var(--accent);
}

/* Entry-fee editor (AD-23). One column per game, one block per category, tiers as
   removable chips — the whole point is that a price can only be added or removed, never
   mistyped over. */
.fee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 1rem;
}
.fee-game h3 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    font-weight: 650;
}
.fee-block {
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.fee-block-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
/* A heading with a button beside it: the heading's own margins would push the pair apart,
   so the row owns the spacing. */
.fee-block-head > h2, .fee-block-head > h3 { margin: 0; }
.card > .fee-block-head:first-child { margin-top: 0; margin-bottom: 0.75rem; }
.fee-block .sub { margin: 0.55rem 0 0; font-size: 0.76rem; }

.tier-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.9rem;
    margin-bottom: 0.6rem;
}
.tier {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.3rem;
    padding-inline-start: 0.6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 0.8rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.tier button {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1;
    opacity: .65;
}
.tier button:hover { opacity: 1; background: var(--danger-soft); color: var(--danger-ink); }
/* Without its remove button (read, not editing) the chip is even on both sides. */
.tier:not(:has(> button)) { padding-inline-end: 0.6rem; }

/* ---- Detail grid -------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(185px, 100%), 1fr));
    gap: 0.9rem 1.4rem;
    margin: 1rem 0 1.25rem;
    padding: 1.05rem 1.15rem;
    background: var(--surface-sunken);
    border-radius: var(--radius);
}
.detail-grid .label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-weight: 650;
    margin-bottom: 0.15rem;
}
.detail-grid .value {
    font-size: 0.95rem;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

/* ---- Login / sign-up ---------------------------------------------------- */

/* Login and sign-up own the whole window, but they render through the same
   shell as every other page — so drop the content column's gutter and width
   cap when one of them is what @Body put there. Without this the dark panel
   sits inset inside the page gutter and 100vh + padding overflows into a
   scrollbar. Browsers without :has() simply keep the inset (no breakage). */
.admin-content:has(> .login-page) {
    padding: 0;
    max-width: none;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    /* Deliberately dark in both themes, unlike the app shell: this is the one screen with
       no navigation to anchor it, and a white card on a white page has nothing to sit on.
       Built from gradients rather than an image so there is no asset to ship, nothing to
       load before first paint, and no licence to track. */
    background:
        radial-gradient(900px 600px at 15% 0%, rgba(99, 102, 241, .22) 0%, transparent 55%),
        radial-gradient(800px 500px at 85% 100%, rgba(124, 58, 237, .18) 0%, transparent 55%),
        linear-gradient(150deg, #1b2030 0%, #0b0d13 100%);
}

.login-card {
    background: var(--surface);
    padding: 2.1rem 2.15rem 1.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 372px;
    box-shadow: var(--shadow-lg);
}
.login-card h1 {
    margin: 0 0 0.3rem;
    font-size: 1.4rem;
    font-weight: 700;
}
.login-card .subtitle {
    color: var(--muted);
    font-size: 0.845rem;
    margin: 0 0 1.4rem;
}
.login-card label {
    display: block;
    font-size: 0.815rem;
    font-weight: 620;
    color: var(--text-2);
    margin-bottom: 0.95rem;
}
.login-card label input { margin-top: 0.32rem; }
.login-card button[type=submit] {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    box-shadow: var(--shadow-sm);
    transition: background-color .13s ease;
}
.login-card button[type=submit]:hover:not(:disabled) { background: var(--accent-hover); }
.login-card > .subtitle:last-child { margin: 1.1rem 0 0; text-align: center; }

/* The preference toggles are a separate concern from the form's action, so they get a
   rule and real breathing room instead of sitting flush against the submit button. */
.login-card .display-prefs {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.login-card .subtitle.hint {
    margin: -0.4rem 0 0.9rem;
    font-size: 0.78rem;
}

/* Password field with a reveal button inside the input's own box. */
.password-field { position: relative; display: block; }
.password-field input { padding-inline-end: 2.5rem; }
.password-field .reveal {
    position: absolute;
    inset-inline-end: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
}
.password-field .reveal:hover { color: var(--text); background: var(--surface-sunken); }
.password-field .reveal svg { width: 16px; height: 16px; }

/* ---- States & utilities ------------------------------------------------- */

.muted { color: var(--muted); }

.error, .text-danger {
    color: var(--danger);
    font-weight: 550;
}

/* W-13 / W-15: something to look at, not a failure (a marked price, a ledger gap). */
/* AD-90: a tip behind a "?" (Help.razor). The box is fixed and placed by the script in
   App.razor, so a card that scrolls its overflow does not cut it. */
.help {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 20px; height: 20px; margin-inline-start: 0.35rem; vertical-align: middle;
    border-radius: 50%; color: var(--muted); cursor: pointer;
    font-size: 0.85rem; font-weight: 400; letter-spacing: normal; text-transform: none;
}
.help > svg { width: 16px; height: 16px; }
.help:hover, .help:focus, .help.is-open { color: var(--accent); }
.help:focus { outline: none; }
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Over the Undo bar (1900): a tip as tall as the screen reaches the top corner. Under toasts and a delete's question. */
.help-pop {
    display: none; position: fixed; z-index: 1950;
    width: max-content; max-width: min(24rem, calc(100vw - 16px));
    padding: 0.6rem 0.75rem; border-radius: var(--radius);
    background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    font-size: 0.85rem; font-weight: 400; line-height: 1.45; text-align: start; white-space: normal;
    cursor: auto;
}
/* Developer, 2026-11-13: open on a click and closed by its ×, so a picture in it can be taken (the script in App.razor). */
.help.is-open .help-pop { display: block; }
.help-pop p { margin: 0 0 0.45rem; }
.help-pop p:last-child { margin-bottom: 0; }
.help-pop strong { color: var(--text); }
/* Never taller than the screen: a long tip scrolls inside its box. */
.help-pop { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.help-body { display: block; }
/* Copy and × in the box's top corner, the words round them. The bar moves the box, a finger too. */
.help-bar {
    float: inline-end; display: flex; gap: 0.1rem; margin-block: -0.35rem 0.1rem; margin-inline: 0.5rem -0.5rem;
    cursor: move; touch-action: none; user-select: none;
}
.help-bar button {
    display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
    border: none; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.help-bar button:hover, .help-bar button:focus-visible { background: var(--neutral-soft); color: var(--text); outline: none; }
.help-bar svg { width: 15px; height: 15px; }
.help-copy .is-ready { display: inline-flex; }
.help-copy .is-done, .help-copy.copied .is-ready { display: none; }
.help-copy.copied .is-done { display: inline-grid; }
.help-copy.copied { color: var(--success-ink); }
.help-hint, .help-copy-word { display: none; }
/* A tip that shows how to draw a picture (developer, 2026-11-12: long ones ran off the screen, wide is fine): as wide as
   the screen allows, its parts set in columns so it stays short, each part whole in its column, the drawings large
   enough to read every size on them. Its bar is a row of its own over the columns, kept in sight while the box scrolls. */
.help-pop:has(.sheet-guide, .frame-guide) { width: min(22.5rem, calc(100vw - 16px)); max-width: none; }
.help-pop:has(.sheet-guide, .frame-guide) .help-bar {
    float: none; position: sticky; top: -0.6rem; z-index: 1; justify-content: flex-end;
    margin: -0.6rem -0.75rem 0.45rem; padding-block: 0.25rem; padding-inline: 0.75rem 0.35rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
    align-items: center;
}
.help-pop:has(.sheet-guide, .frame-guide) .help-hint {
    display: block; margin-inline-end: auto; padding-inline-end: 0.5rem; color: var(--muted); font-size: 0.78rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.help-pop:has(.sheet-guide, .frame-guide) .help-copy { display: inline-flex; align-items: center; gap: 0.3rem; width: auto; padding-inline: 0.45rem; font: inherit; font-size: 0.8rem; }
.help-pop:has(.sheet-guide, .frame-guide) .help-copy-word { display: inline; }
.help-pop:has(.sheet-guide, .frame-guide) .help-body { column-gap: 1.5rem; }
.help-body > * { break-inside: avoid; }
/* A part's words stay with its drawing, in one column. */
.help-pop p:has(+ .sheet-guide, + .frame-guide) { break-after: avoid; }
.help-pop p + .sheet-guide, .help-pop p + .frame-guide { break-before: avoid; }
.help-pop .frame-guide, .help-pop .sheet-guide {
    display: block; width: 100%; max-width: 21rem; height: auto; margin: 0.25rem 0 0.75rem; color: var(--text); break-inside: avoid;
}
.help-pop .guide-dim text { paint-order: stroke; stroke: var(--surface-2); stroke-width: 2.6px; stroke-linejoin: round; }
.help-pop .guide-example { opacity: 0.92; }
/* A drawing can be taken: a click offers Copy picture and Save picture (developer, 2026-11-13). */
.help-pop .frame-guide, .help-pop .sheet-guide { cursor: pointer; border-radius: 6px; }
.help-pop .frame-guide:hover, .help-pop .sheet-guide:hover { outline: 1px dashed var(--accent); outline-offset: 2px; }
.help-menu {
    position: fixed; z-index: 1970; display: flex; flex-direction: column; min-width: 9rem; padding: 0.25rem;
    border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.help-menu button {
    padding: 0.4rem 0.65rem; border: none; border-radius: 6px; background: transparent; color: var(--text);
    font: inherit; font-size: 0.85rem; text-align: start; white-space: nowrap; cursor: pointer;
}
.help-menu button:hover, .help-menu button:focus-visible { background: var(--neutral-soft); outline: none; }

/* AD-90: a line that says all is well, with a small check. An icon in text has no size of its
   own (Icon.razor sets none), so a bare one fills the card. */
.ok-line { display: flex; align-items: center; gap: 0.4rem; color: var(--success); font-size: 0.9rem; margin: 0.6rem 0 0; }
.ok-line svg { width: 16px; height: 16px; flex: none; }
.warning {
    color: var(--warn-ink);
    background: var(--warn-soft);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-weight: 550;
}

.success-msg {
    color: var(--success);
    font-weight: 550;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.9rem;
    font-size: 0.855rem;
    font-weight: 550;
    color: var(--muted);
}
.back-link::before { content: "\2190"; }
.back-link:hover { color: var(--accent); }

code, .mono { font-family: var(--font-mono); font-size: 0.86em; }

/* ---- Responsive --------------------------------------------------------- */

/* The sidebar becomes a drawer rather than folding into a row.
   The row version was the previous approach and it did not survive the nav growing: the
   list is fourteen links inside a vertical .nav-scroll with a pinned .nav-foot, so laying
   the parent out as a row turned it into two tall columns stacked above the page — every
   visit started with a screenful of navigation. A drawer keeps the page as the page. */
@media (max-width: 860px) {
    .admin-shell { flex-direction: column; }

    /* ---- Phone header ---- */

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--nav-bg);
        color: var(--nav-text-hi);
        border-bottom: 1px solid var(--nav-border);
        padding: 0.5rem 0.85rem;
        /* Clears the notch when the page paints under it (viewport-fit=cover). */
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
    .mobile-bar .brand {
        margin: 0;
        padding: 0;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 0.55rem;
        color: var(--nav-text-hi);
        font-weight: 700;
    }

    /* A hand-drawn burger: three spans, no icon font and no extra request. 44px square
       because that is the smallest target a thumb hits reliably. */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        padding: 0 10px;
        background: transparent;
        border: 0;
        border-radius: var(--radius-sm);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-toggle span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: var(--nav-text-hi);
    }
    .nav-toggle:hover { background: var(--nav-bg-2); }

    /* ---- Drawer ---- */

    .admin-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        z-index: 50;
        width: min(82vw, 292px);
        height: 100vh;
        height: 100dvh;
        padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
        border-right: 0;
        border-inline-end: 1px solid var(--nav-border);
        box-shadow: 0 0 40px rgba(0, 0, 0, .35);

        transform: translateX(-100%);
        /* Hidden rather than merely off-screen: a closed drawer must not be reachable by
           Tab or read out by a screen reader. The delay keeps it visible while it slides. */
        visibility: hidden;
        transition: transform .22s ease, visibility 0s linear .22s;
    }
    [dir="rtl"] .admin-nav { transform: translateX(100%); }

    .admin-nav.open {
        transform: none;
        visibility: visible;
        transition: transform .22s ease, visibility 0s;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, .5);
    }

    /* Thumb-sized rows. The desktop sidebar is a mouse target; this one is not. */
    .admin-nav a { padding: 0.62rem 0.7rem; font-size: 0.92rem; }
    .admin-nav a.active::before { display: none; }

    /* ---- Content ---- */

    .admin-content {
        padding: 1.25rem 1rem 3rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        max-width: none;
    }
    .admin-content > h1 { font-size: 1.3rem; }
    .card { padding: 1.05rem 1rem; }

    /* .card already scrolls horizontally at every width; on a phone the table
       just needs a floor so columns stop collapsing into unreadable slivers. */
    table { min-width: 620px; }

    /* iOS Safari zooms the whole page in when a focused field is under 16px, and never
       zooms back out. Every other fix for that breaks pinch-zoom, so: 16px. */
    input[type=text], input[type=email], input[type=password],
    input[type=number], select, textarea { font-size: 16px; }

    /* Wrapping rather than overflowing — a form row of five controls does not fit a phone
       in one line, and a horizontal scrollbar on a form is worse than a second line. */
    .inline-form { flex-wrap: wrap; }
    .search-row input[type=text] { max-width: none; }

    /* Chrome and Safari paint a grey flash over any tapped element by default, which on a
       list of nav links reads as the page stalling. */
    a, button { -webkit-tap-highlight-color: transparent; }
}

/* Small phones: the drawer takes more of the screen, because 82% of 320px is not enough
   room for a label like "Server settings" to stay on one line. */
@media (max-width: 380px) {
    .admin-nav { width: min(90vw, 292px); }
    .admin-content { padding-top: 1rem; }
}

/* Respecting the OS setting is not decoration: vestibular disorders are the reason the
   setting exists, and a sliding panel is exactly what it is about. */
@media (prefers-reduced-motion: reduce) {
    .admin-nav { transition: none; }
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* One line, cut with an ellipsis, full text on hover. For cells whose content has no upper
   bound — a ledger reason, a free-text note — where wrapping would make every row a
   different height and scrolling sideways would hide the columns that matter. */
.ellipsis {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Figures line up under each other, which is the only way a column of them can be scanned. */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fold > .page-actions { margin-top: 1rem; }

/* A count on a nav entry. Pushed to the right edge so the label still reads normally and
   the number is what the eye lands on when there is one. */
.nav-badge {
    margin-inline-start: auto;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Something new arrived since the last poll: the badge swells a few times, then sits
   still. Loud enough to catch a glance from another page, quiet enough to ignore. */
.nav-badge-new {
    animation: nav-badge-pulse 1.1s ease-in-out 6;
}

@keyframes nav-badge-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
    50%      { transform: scale(1.25); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .nav-badge-new { animation: none; outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* ---- Session ended ------------------------------------------------------- */
/* Deliberately shaped like the framework's reconnect dialog: an admin who has seen one
   already knows what a panel-wide blocking card means. This one differs in that no amount
   of waiting fixes it, so it has no spinner and one button. */

.session-ended-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, .55);
}

.session-ended {
    width: min(100%, 24rem);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.7rem 1.4rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.session-ended h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 680;
    color: var(--text);
}
.session-ended p {
    margin: 0 0 1.2rem;
    color: var(--text-2);
    font-size: 0.88rem;
}
.session-ended .btn { width: 100%; }

/* ---- Boot wait ------------------------------------------------------------ */
/* App.razor: from the first byte until Routes has brought the sign-in back (2026-10-25). */

.boot-wait {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    background: var(--bg);
}
body:has(.app-ready) .boot-wait { display: none; }
.boot-wait .brand-mark { width: 3.2rem; height: 3.2rem; }
.boot-spinner {
    width: 1.6rem;
    height: 1.6rem;
    border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: boot-spin 0.8s linear infinite;
}
/* Ten seconds with nothing: a way out that needs no words. */
.boot-reload {
    visibility: hidden;
    font-size: 1.2rem;
    animation: boot-late 0s linear 10s forwards;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-late { to { visibility: visible; } }
@media (prefers-reduced-motion: reduce) {
    .boot-spinner { animation-duration: 2.4s; }
}

/* ---- Blazor framework hooks --------------------------------------------- */

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
/* T-01a: a tournament stage whose prize is not covered by its own pot. */
tr.row-invalid td { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.validation-message { color: var(--danger); }

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 550;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ---- Catalogue / announcement frames ------------------------------------ */
/* AD-28: a prize or an announcement is a thing with a picture, not a table row, and it
   stays read-only until Edit is pressed — so the frame has to work in both states. */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
    /* Each card keeps its own height: opening one card's editor must not stretch the
       whole row to match it. */
    align-items: start;
}
.item-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.item-card h3 { margin: 0 0 0.6rem; font-size: 1rem; font-weight: 650; }
.item-card .fee-block-head { margin-bottom: 0.4rem; }
.item-card .sub { margin: 0 0 0.6rem; }
/* AD-99c: skin cards stay compact, with their artwork centred as a group. */
.skin-grid { grid-template-columns: repeat(auto-fill, min(280px, 100%)); }
.skin-grid > .item-card { min-width: 0; }
.skin-grid .art-grid { justify-content: center; }
.skin-grid .art-slot > .muted { text-align: center; }
.skin-grid .item-head input[type=text] { max-width: 100%; }
.skin-grid .item-head .mono { overflow-wrap: anywhere; }

.item-image {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 0.7rem;
}
/* A frame with no picture keeps the same footprint — the same 180px — so a grid of prizes
   does not jump around as photos are added, and cards with and without one line up. */
.item-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: var(--text-3);
    font-size: 0.78rem;
    background: var(--surface-3, var(--surface));
}

/* ---- Foldable sections --------------------------------------------------- */
/* Rewards configures three separate mechanics; open all at once it is a wall. <details>
   gives the fold for free, so the only work here is making the marker look deliberate. */
.fold > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--text-1);
    user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
    content: "▸";
    font-size: 0.85em;
    color: var(--text-3);
    transition: transform 0.15s ease;
}
.fold[open] > summary::before { transform: rotate(90deg); }
.fold[open] > summary { margin-bottom: 0.9rem; }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* A profile picture is looked at, not glanced past, so it gets more room than a
   table-cell thumbnail. */
.thumb-lg { width: 96px; height: 96px; border-radius: 50%; }

/* ---- Identity ------------------------------------------------------------ */

.identity-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.identity-head h1 { margin: 0; }
.identity-head .item-image-empty { height: 96px; }

/* The signed-in admin's own face in the nav, sized to the icon it replaces. */
.nav-face {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

/* ---- Confirmation blocks ------------------------------------------------- */
/* A confirmation is a question, not a failure. Red type on "are you sure" read as
   something having already gone wrong, so only the genuinely destructive one keeps it. */
.confirm-box {
    margin: 0.6rem 0 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.confirm-box p { margin: 0 0 0.5rem; }
.confirm-box .sub { font-size: 0.8rem; }
.confirm-danger { border-left-color: var(--danger); }

/* ---- Vertical rhythm for stacked control rows ---------------------------- */
/* .inline-form is a flex row with no margin of its own, so two of them in a row —
   a set of fields above a set of buttons — rendered flush against each other and read
   as one jumbled strip. Rows get space; the last one in a block does not, so the card's
   own padding still ends the block. */
.inline-form { margin-bottom: 0.75rem; }
.inline-form:last-child,
.stacked-form + .inline-form:last-of-type { margin-bottom: 0; }

/* Inside a table cell the row is the layout, not a block — margin there pushes the
   row's own contents off centre. */
td .inline-form,
th .inline-form { margin-bottom: 0; }

/* A control that follows a table needs to clear it rather than touch the last row. */
table + .btn,
table + .inline-form { margin-top: 0.9rem; }

/* A heading straight after a block of controls needs air above it; the default 1.5rem
   top margin is measured for prose, not for a row of buttons. */
.inline-form + h2,
table + h2 { margin-top: 1.75rem; }

/* A page-level action, outside the cards it applies to. */
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1rem;
}

/* ---- Replay (S-06) ------------------------------------------------------- */
/* The board is shown as JSON because the panel deliberately does not know one game from
   another. It is read closely, so it gets a monospace block that scrolls on its own. */
.state-dump {
    margin: 0;
    padding: 0.85rem 1rem;
    max-height: 340px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--text-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* The step the viewer is on, so the timeline and the board agree at a glance. */
tbody tr.row-current td { background: var(--accent-soft); }


/* ---- Tables whose cells appear and disappear --------------------------------- */
/* The reward tables hide a field depending on the row's type (an item id means nothing on
   a coin reward). With the default content-driven layout that made every heading slide
   sideways as rows changed. Fixed layout pins the columns to the widths declared on the
   header, so a heading means the same thing on every row. */
.fixed-cols { table-layout: fixed; }
.fixed-cols th, .fixed-cols td { overflow: hidden; text-overflow: ellipsis; }
.fixed-cols input[type=text], .fixed-cols input[type=number], .fixed-cols select { max-width: 100%; }
/* Checkbox columns read as a column when the box sits under its heading rather than at the
   left edge of a cell three times wider than it is. */
.fixed-cols td > input[type=checkbox] { display: block; margin: 0 auto; }

/* ---- Tabs ---------------------------------------------------------------- */
/* One history at a time. The bar carries the current position, so it has to read as a
   position and not as a row of buttons that all look equally pressed. */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    margin: -0.3rem 0 1.1rem;
    border-bottom: 1px solid var(--border);
}
.tab {
    appearance: none;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 0.55rem 0.85rem;
    margin-bottom: -1px;
    font-family: inherit;
    font-size: 0.845rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--accent-ink, var(--accent)); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px 4px 0 0; }
/* AD-67: the language tabs inside an editor sit closer to the fields they switch. */
.lang-tabs { margin: 0 0 0.8rem; }
.tab-dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-inline-start: 0.35rem;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: middle;
}
/* Words typed and not saved yet: hollow, so it does not read as "written". */
.tab-dot-changed { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }

/* RW-10: how many sit behind a tab. The one that waits on staff is coloured. */
.tab-count {
    display: inline-block;
    min-width: 1.2rem;
    margin-inline-start: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--neutral-soft);
    color: var(--neutral-ink);
    font-size: 0.7rem;
    line-height: 1.2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tab-count-hot { background: var(--accent); color: #fff; }

/* AD-70: a request inside a player's page, framed rather than a card of its own. */
.support-ticket {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
}

/* RW-10: the order table. Few columns and every one wraps, so it fits the card (developer,
   2026-09-24: no sideways scroll). The last column holds the note and the next step. */
.order-table { width: 100%; table-layout: auto; }
.order-table td { vertical-align: top; }
.order-table td, .order-table th { white-space: normal; overflow: visible; text-overflow: clip; }
.order-table td.nowrap { white-space: nowrap; }
.order-table .order-work { min-width: 15rem; width: 34%; }
.order-table .order-work input { width: 100%; box-sizing: border-box; }
.order-code { font-weight: 700; letter-spacing: 0.03em; }
.order-contact { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; }
.order-steps { margin: 0.4rem 0 0; flex-wrap: wrap; gap: 0.35rem; }

/* AD-70: a player's question and the answers under it, line breaks kept as typed. */
.support-text { white-space: pre-wrap; margin: 0.4rem 0 0.6rem; overflow-wrap: anywhere; }
.support-reply {
    margin: 0 0 0.6rem;
    padding: 0.45rem 0.75rem;
    border-inline-start: 3px solid var(--accent);
    background: var(--surface-2, var(--surface));
    border-radius: var(--radius-sm);
}
.support-reply .support-text { margin: 0.2rem 0 0; }
/* AD-137: the player's own further message, under the question it continues, without staff's coloured edge. */
.support-text-more {
    margin: 0 0 0.6rem;
    padding: 0.45rem 0.75rem;
    border-inline-start: 3px solid var(--border);
    border-radius: var(--radius-sm);
}
.support-text-more .support-text { margin: 0.2rem 0 0; }

/* AD-125: the screenshots a player added, small, each opening full size in a new tab. A phone screenshot stands tall. */
.attached-pictures { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0.6rem; }
.attached-pictures a, .attached-picture-missing {
    display: inline-flex; align-items: center; justify-content: center;
    width: 4.5rem; height: 8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    overflow: hidden;
}
.attached-pictures img { width: 100%; height: 100%; object-fit: cover; }
.attached-pictures a:hover { border-color: var(--accent); }
.attached-picture-missing { color: var(--muted, inherit); }

/* AD-71: the legal sections as browser tabs: the added ones carry a small x, + adds one. */
.legal-tabs { align-items: flex-end; }
.legal-tab { display: inline-flex; align-items: center; }
.legal-tab .tab { padding-inline-end: 0.5rem; }
.legal-tab-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    margin-inline-end: 0.35rem;
    border-radius: 999px;
    cursor: pointer;
}
.legal-tab-close:hover { color: var(--text); background: var(--surface-2, rgba(127, 127, 127, 0.15)); }
.legal-tab-add { font-size: 1.1rem; min-width: 2.4rem; }
.legal-actions { display: inline-flex; gap: 0.5rem; align-self: center; padding-block: 0.25rem; }
.legal-closed { margin-inline-start: 0.4rem; font-size: 0.7rem; padding: 0.05rem 0.45rem; }
.legal-add { margin: 0 0 0.6rem; }
/* The new section tab (developer, 2026-09-24): its name and address, set inside the tab. */
.legal-new { max-width: 34rem; margin: 0.4rem 0 0.2rem; }

/* CS-08: a shop row's Gives and Pays cells, a choice with its value under it. */
.stacked-cell { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
.stacked-cell select, .stacked-cell input { max-width: 100%; }
.inline-form.tight { gap: 0.3rem; }
table.shop-items td { vertical-align: top; }
/* Nothing in a shop row is text to cut short: the fields and the picture's buttons are cut
   instead, and the cut shows as stray dots. */
table.shop-items th, table.shop-items td { overflow: visible; text-overflow: clip; }
/* Visible overflow is only safe while nothing is wider than its column: a text box at its own
   default width ran under the next column and covered it (developer, 2026-09-24). Every field
   in a stacked cell fills the column and no more, and the item picker wraps inside it. */
table.shop-items .stacked-cell { width: 100%; align-items: stretch; }
table.shop-items .stacked-cell > * { max-width: 100%; min-width: 0; box-sizing: border-box; }
table.shop-items .stacked-cell input[type="text"] { width: 100%; }
table.shop-items .stacked-cell > input[type="number"], table.shop-items .stacked-cell > .money-field { align-self: flex-start; }
table.shop-items .item-picker { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* Resources (CS-09, RW-13a): Gold, Diamonds and EXP side by side, each a card with its picture,
   its name, and for a currency where its "+" goes. */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 1rem; }
.resource-card { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); text-align: center; }
.resource-name { font-size: 1.05rem; }
.resource-card .field { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; text-align: start; }
.resource-card .field select { width: 100%; }
table.shop-items .item-picker select, table.shop-items .item-picker input { max-width: 100%; }
.money-field { display: inline-flex; align-items: center; gap: 0.3rem; }
.money-field > span { font-weight: 600; }

/* Room between a block and what follows it (developer, 2026-09-24: buttons and notes sat glued to
   the table or the tiles above them). A hint pulls itself up under a field on purpose, but not
   under a table or a row of tiles. */
.scroll-y + .inline-form, .table-scroll + .inline-form, .house-totals + .inline-form { margin-top: 0.9rem; }
.house-totals { margin-bottom: 0.8rem; }
.house-totals + .hint, .house-stats + .hint, .scroll-y + .hint, .table-scroll + .hint { margin-top: 0; }

/* Pricing & Fees, In-app purchases: one column per store, its state beside its name. */
.store-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem 2.5rem; margin-bottom: 1.2rem; }
.store-column-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.store-column-head h3 { margin: 0; }

/* AD-69: the document editor. The text and what the game will show, side by side on a wide
   screen, one above the other on a narrow one. */
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.6rem; }
.doc-toolbar .btn { min-width: 2.2rem; justify-content: center; }
.doc-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; align-items: stretch; }
@media (max-width: 900px) { .doc-editor { grid-template-columns: 1fr; } }
.doc-editor textarea {
    width: 100%;
    min-height: 26rem;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
}
.doc-preview {
    min-height: 26rem;
    max-height: 40rem;
    overflow-y: auto;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.9rem;
    line-height: 1.55;
}
.doc-preview h3 { font-size: 1.15rem; margin: 0.4rem 0 0.5rem; }
.doc-preview h4 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
.doc-preview p { margin: 0 0 0.7rem; }
.doc-preview ul, .doc-preview ol { margin: 0 0 0.7rem; padding-inline-start: 1.4rem; }
.doc-preview a { color: var(--accent-ink, var(--accent)); }

/* AD-106: a rule page. Its pictures are as wide as the page, its colours and the preview's
   ground are the game's own dark sheet, so a colour picked here reads the way players see it. */
.doc-preview .doc-image { margin: 0.2rem 0 0.8rem; }
.doc-preview .doc-image img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.doc-preview .doc-image-missing {
    padding: 0.8rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}
.rules-preview { background: #16213A; color: #E6EAF2; border-color: #24314F; }
.rules-preview .muted { color: #9AA3B5; }
.rules-card .rule-tabs { margin: 0.2rem 0 0.8rem; }
/* AD-106a: the rule's picture list, between the rule tabs and the editor. */
.rule-pictures { margin: 0 0 1rem; padding: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.rule-pictures .section-head { margin-bottom: 0.5rem; align-items: center; }
.rule-pictures .section-head h3 { margin: 0; font-size: 1rem; }
.rule-pictures .hint { margin: 0; }
.rule-picture-grid { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }
.rule-picture-grid .thumb { width: 100%; max-width: 120px; height: 80px; border-radius: var(--radius-sm); }
.rule-picture-use { font-size: 0.78rem; margin-top: 0.35rem; }
.rule-picture-use.is-used { color: var(--accent-ink, var(--accent)); font-weight: 600; }
.rule-picture-ref { font-size: 0.78rem; padding: 0.05rem 0.35rem; border-radius: var(--radius-sm); background: var(--surface-sunken); max-width: 100%; overflow-wrap: anywhere; }
.doc-colours { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.3rem; }
.doc-swatch {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
    cursor: pointer;
}
.doc-swatch-own {
    position: relative;
    overflow: hidden;
    background: conic-gradient(#FF3B3B, #FFD166, #2FD07F, #3D8BFF, #B794F6, #FF3B3B);
}
.doc-swatch-own input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Group heading in the sidebar. Quiet on purpose — it is a signpost between links, not
   another thing competing to be clicked. */
.nav-group {
    margin: 0.8rem 0.75rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.nav-group:first-of-type { margin-top: 0.7rem; }

/* AD-74: a group folds on its heading, and the heading says so with a chevron. Folded, it
   carries the sum of what waits inside it, so nothing new hides behind a closed group. */
.nav-fold > summary.nav-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0;
    margin-inline: 0.75rem;
    border-radius: 6px;
}
.nav-fold > summary.nav-group::-webkit-details-marker { display: none; }
.nav-fold > summary.nav-group::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
    flex-shrink: 0;
}
[dir="rtl"] .nav-fold > summary.nav-group::before { transform: rotate(45deg); }
.nav-fold[open] > summary.nav-group::before { transform: rotate(45deg); }
[dir="rtl"] .nav-fold[open] > summary.nav-group::before { transform: rotate(-45deg); }
.nav-fold > summary.nav-group:hover { color: var(--text); }
.nav-fold > summary.nav-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-fold > summary .nav-badge { font-size: 0.65rem; letter-spacing: 0; }
.nav-fold[open] > summary .nav-badge { display: none; }


/* ---- Long lists ----------------------------------------------------------- */
/* A table with hundreds of rows should not make the page hundreds of rows tall: the
   controls above it scroll away and the only way back is the wheel. A viewport keeps the
   list in place and the header visible while it scrolls. */
.scroll-y {
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.scroll-y > table { margin: 0; }
.scroll-y thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: inset 0 -1px 0 var(--border);
}

/* A heading that sorts has to look like it does something before it is clicked. */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
.sort-arrow { margin-inline-start: 0.3rem; color: var(--accent); font-weight: 700; }
.sort-button { display: inline-flex; align-items: center; gap: 0.25rem; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; padding: 0; text-align: inherit; cursor: pointer; }
.compact-id { display: inline-flex; align-items: flex-start; gap: 0.35rem; max-width: 14rem; }
.compact-id details { min-width: 0; }
.compact-id summary { cursor: pointer; width: max-content; color: var(--text-2); }
.compact-id-full { font-size: 0.8rem; overflow-wrap: anywhere; white-space: normal; margin-top: 0.35rem; }
.compact-id .copy-btn { flex-shrink: 0; margin-inline-start: 0; }

/* Unsorted columns keep a faint marker so they still read as sortable. */
th.sortable .sort-arrow { margin-inline-start: 0.35rem; font-size: 0.72em; color: var(--text-3); opacity: .55; }
th.sortable:hover .sort-arrow { opacity: .9; }
th.sortable.sorted { color: var(--text); }
th.sortable.sorted .sort-arrow { color: var(--accent); opacity: 1; }

/* The column currently being ranked by. Tinted rather than reordered, so switching measures
   does not move the numbers around under the reader. */
.col-ranked { background: var(--accent-soft); color: var(--text); font-weight: 600; }

/* The sort marker is now a short word ("A-Z"), not a glyph, so it needs to read as a label
   rather than compete with the heading it sits beside. */
th.sortable .sort-arrow {
    margin-inline-start: 0.4rem;
    font-size: 0.66em;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

/* ---- Sidebar: scrolling sections, pinned footer -------------------------- */
/* The section list grows every time one is added; the theme switch, the language switch and
   the way out do not, and they are needed from wherever you happen to be. So the list
   scrolls and the rest stays put. */
.nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Reaching the end of the list must not start scrolling the page behind it. */
    overscroll-behavior: contain;
}

/* Scrollbars, everywhere one appears.

   The standard properties cover Firefox and current Chrome/Edge; the -webkit- rules cover
   Safari and older Chrome, which still ignore them. Both are needed, and neither is enough
   on its own. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* The sidebar is dark in both themes, so it needs its own thumb colour — the surface token
   would be invisible against it in light mode. */
.nav-scroll { scrollbar-color: var(--nav-border) transparent; }

/* The -webkit- pseudo-elements are the older way of saying the same thing, and the two are
   mutually exclusive rather than complementary: Chromium ignores every ::-webkit-scrollbar
   rule the moment `scrollbar-width` is set. Written unguarded, as they were, the whole block
   below was dead code — which is why the nav kept painting a default scrollbar with arrow
   buttons despite apparently being styled. Behind @supports they apply only where the
   standard properties do not exist. */
@supports not (scrollbar-width: thin) {
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: var(--border-strong);
        border-radius: 8px;
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--muted); }
    /* Removes the arrow buttons Windows adds at both ends. */
    ::-webkit-scrollbar-button { display: none; }

    .nav-scroll::-webkit-scrollbar-thumb { background: var(--nav-border); }
    .nav-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
}
.nav-foot {
    flex: none;
    border-top: 1px solid var(--nav-border);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
}
.nav-foot .who-am-i { border-top: 0; margin-top: 0.25rem; }

/* INV-01 items tree — game > slot > items, as <details> so the browser owns the
   disclosure state. No script, keyboard-operable, and it collapses on a phone where the
   flat grid used to be one long scroll. */
.tree > details { margin: 0; }
.tree summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    list-style: none;
    user-select: none;
}
/* The default marker is a filled triangle in Chromium and a disclosure arrow in Safari;
   drawing our own keeps the two looking like the same control. */
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
    content: "";
    flex: none;
    width: 0;
    height: 0;
    border-left: 5px solid var(--muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.12s ease;
}
.tree details[open] > summary::before { transform: rotate(90deg); }

.tree-game > summary .tree-title { font-size: 1.05rem; font-weight: 650; }
.tree-slot {
    margin: 0.2rem 0 0.2rem 0.45rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}
.tree-slot > summary .tree-title { font-weight: 600; }
.tree-count { font-size: 0.8rem; }
.tree-slot .item-grid { padding: 0.35rem 0 0.7rem; }
/* Game Skins: a slot's cards under their quality's heading (default, Common ... Legendary). */
.tab .tree-count { margin-inline-start: 0.3rem; }

/* AD-08 availability: a category line with its switch on the right, the modes as chips under it. */
.tree-slot .row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0; }
.tree-slot .chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.1rem 0 0.7rem; }
.tree-game > summary .btn { margin-inline-start: auto; }
.tree-game > summary .pill { margin-inline-start: 0.5rem; }

/* Touch targets: a summary row is the only way into a branch, so it gets a finger-sized
   height on the screens where fingers are the pointer. */
@media (max-width: 720px) {
    .tree summary { padding: 0.55rem 0; }
    .tree-slot { margin-left: 0.25rem; padding-left: 0.6rem; }
}

/* INV-07 item picker — game, slot, item. One control, so one line: .inline-form wraps, and
   inside a table cell that turned three short dropdowns into a three-storey column while the
   rest of the row stayed flat. */
.item-picker {
    display: flex;
    flex-wrap: wrap;   /* the third select drops to a second line rather than out of the cell */
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
}
.item-picker select { width: auto; min-width: 5.5rem; }
.item-picker select.item-choice { min-width: 8.5rem; }

/* On a phone there is no width to keep them on one line, and a row that overflows its cell
   is worse than one that stacks. */
@media (max-width: 720px) {
    .item-picker { flex-wrap: wrap; }
}

/* Two pictures per item, side by side and labelled: the icon a list shows and the asset the
   game draws with. Both visible at once, because an item with one of them missing is a
   normal state and has to be visibly that. */
.art-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.art-slot span { display: block; margin-bottom: 0.2rem; }
.art-slot input[type=file] { margin-top: 0.35rem; max-width: 12rem; }

/* A column holding an <ItemPicker>: three dropdowns on one line, and they must not be cut.
   .fixed-cols shares the width out equally and then hides whatever overflows, which sliced
   the third select in half and let the next column's button sit on top of it. */
.col-picker { width: 21rem; }
.fixed-cols td.col-picker, .fixed-cols td.icon-actions { overflow: visible; }

/* ---- Picture picker: a thumbnail with icon buttons over its corner ------------------ */
/* INV-24: a board item's background, board and frame in one box, the way the game lays them. */
.board-composite {
    position: relative; width: 96px; height: 96px; overflow: hidden;
    border-radius: var(--radius-sm); background: #111b31;
}
.board-composite .bc-back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.board-composite .bc-layer,
.board-composite .bc-empty {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: auto;
}
.board-composite .bc-empty { width: 60%; height: 60%; }
/* INV-33: a Domino tile skin put together the way the game lays it: two bones face up with their pips, then the back. */
.domino-composite {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 150px; height: 96px; border-radius: var(--radius-sm); background: #1f5a3c;
}
.domino-composite .dc-bone {
    position: relative; width: 38px; height: 76px;
    background-size: 200% 100%; background-repeat: no-repeat;
}
.domino-composite .dc-pip { position: absolute; width: 18%; height: auto; transform: translate(-50%, -50%); }
/* A picture in three parts (face, side, back, 2 : 1 : 2): a part is 40% of it, the side 20% in the middle. */
.domino-composite.dc-three .dc-bone { background-size: 250% 100%; }
.domino-composite .dc-side { display: none; width: 13px; height: 76px; background-size: 500% 100%; background-position: 50% 0; background-repeat: no-repeat; border-radius: 2px; }
.domino-composite.dc-three .dc-side { display: block; }
.domino-composite .dc-probe { display: none; }
.domino-composite .dc-empty { width: 60%; height: 60%; }
.picker { position: relative; display: inline-block; }
.picker .thumb { width: 96px; height: 96px; margin: 0; }
.picker-lg .thumb { width: 160px; height: 160px; }
/* The frame the game draws the picture in (developer, 2026-09-24): an event banner and a prize
   tile's picture are 16:9 and cut to fill. */
.picker-banner .thumb { width: 256px; height: 144px; object-fit: cover; }
/* AD-105b: a game's label as a picture, its own shape, whole, on the label's dark ground. */
.picker-logo .thumb { width: 220px; height: 88px; object-fit: contain; background: var(--art-ground); }
.thumb-round { border-radius: 50%; }
.thumb-empty {
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-sunken); color: var(--text-3, var(--text-2));
    border: 1px dashed var(--border-strong);
}
.thumb-empty svg { width: 28px; height: 28px; }
/* U-73e: the file's size, over the picture's corner away from the buttons. Empty until the picture has loaded. */
.picker-size {
    position: absolute; left: 4px; top: 4px; padding: 1px 6px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.68rem; line-height: 1.45; pointer-events: none;
}
.picker-size:empty { display: none; }
.picker-actions {
    position: absolute; right: -6px; bottom: -6px;
    display: flex; gap: 4px;
}
.btn-icon {
    width: 34px; height: 34px; padding: 0; min-height: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.btn-icon svg { width: 18px; height: 18px; }
.visually-hidden, input.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon-actions { display: flex; gap: 6px; align-items: center; }
/* As a table cell it must stay a table cell — display:flex on a <td> drops it out of the
   row, taking the row's border and hover colour with it. */
td.icon-actions { display: table-cell; white-space: nowrap; }
td.icon-actions > .btn, td.icon-actions > .reorder { vertical-align: middle; }
td.icon-actions > * + * { margin-inline-start: 6px; }

/* ---- Icons inside text buttons ---------------------------------------------------- */
.btn > svg { width: 15px; height: 15px; margin-inline-end: 0.4rem; vertical-align: -2px; flex: none; }
.btn-icon > svg { margin: 0; }

/* ---- Native controls in the panel's own colours --------------------------------------
   Checkboxes and date pickers drew themselves in the browser's default look, which read
   as a foreign object in a dark card. accent-color paints the check in the brand colour.
   No color-scheme on the controls themselves: it is inherited from :root, and setting it
   here overrode the forced-light toggle, so every field stayed dark in light mode. */
input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; cursor: pointer; }

/* A checkbox that is an on/off state is a switch: the knob's side says which. */
input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 36px; height: 20px; border-radius: 999px;
    background: var(--border-strong); border: 1px solid transparent;
    position: relative; vertical-align: -5px; margin-inline-end: 0.45rem; cursor: pointer;
    transition: background .15s ease;
}
input[type=checkbox]::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.35); transition: transform .15s ease;
}
input[type=checkbox]:checked { background: var(--accent); }
input[type=checkbox]:checked::after { transform: translateX(16px); }
input[type=checkbox]:disabled { opacity: 0.5; cursor: default; }
input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
[dir=rtl] input[type=checkbox]::after { left: auto; right: 2px; }
[dir=rtl] input[type=checkbox]:checked::after { transform: translateX(-16px); }
input[type=date], input[type=datetime-local], input[type=time] {
    font-family: inherit; font-variant-numeric: tabular-nums;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator { opacity: 0.7; cursor: pointer; }

/* Icons in headings and inline labels are text-sized, never the SVG's natural size. */
h1 > svg, h2 > svg, h3 > svg, .inline-form > svg, .fold > summary > svg { width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 0.4rem; }
.inline-form input[type=datetime-local], .inline-form input[type=date] { width: auto; }
.inline-form input[type=url] { width: 22rem; }
.page-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; }
/* The Edit row closing a card: 1rem under the buttons, not the row's margin on top of the card's
   own padding (developer, 2026-09-25: the gap under Edit was far too big). */
.card .page-actions:last-child { margin-bottom: -0.35rem; }

/* ---- Match lists ---------------------------------------------------------------------
   A long list scrolls inside its own box rather than pushing the next card off the page;
   the header stays put. A table opened inside a row keeps a plain header. */
.scroll-list { max-height: 28rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.scroll-list > table { min-width: 720px; }
.scroll-list table table thead th { position: static; }
.scroll-list tr.detail-row > td { background: var(--surface-2); }
.scroll-list tr.detail-row:hover > td { background: var(--surface-2); }
.filter-row select { width: auto; min-width: 10rem; }
.search-wide { width: 22rem; max-width: 100%; }
h2 > .sub { font-weight: 400; margin-inline-start: 0.35rem; }
h3 > svg { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 0.35rem; }

/* ---- Settings with a per-field reset ------------------------------------------------
   Label, then the control with its ↺ beside it, one setting per row so the reset is
   unmistakably attached to one value. */
.settings-grid {
    /* A fixed label column, not max-content: the groups on the page are separate grids
       (a hint sits between them) and must still line their controls up. */
    display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
    gap: 0.55rem 1rem; align-items: center; margin-bottom: 0.9rem;
}
.settings-grid > label { margin: 0; }
.setting { display: flex; gap: 0.5rem; align-items: center; }
.setting input[type=number] { width: 7rem; }

/* ---- AD-84: the bot name list under the Bots card's fields (chips since AD-87). */
.bot-names { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.4rem; }
.bot-names-head { display: flex; gap: 0.6rem; align-items: center; }
.bot-names-head label { margin: 0; }
.bot-names input[type=text] { max-width: 16rem; }
/* AD-84b: the two lists fold away and scroll inside, a long list no longer runs off the card. */
.bot-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.35rem 0.7rem; }
.bot-group > summary { display: flex; gap: 0.5rem; align-items: center; cursor: pointer; font-weight: 650; padding: 0.15rem 0; }
.bot-group[open] > summary { margin-bottom: 0.45rem; }
.bot-group .tier-chips { max-height: 14rem; overflow-y: auto; margin-bottom: 0.3rem; }
.tier button.tier-flip:hover { background: var(--surface-sunken); color: inherit; }
/* AD-84c: whose name it is, before the name. A woman's and a man's each in a colour of their own, "either" a quiet dot. */
.tier .tier-kind { font-size: 0.8rem; font-weight: 700; line-height: 1; opacity: 1; }
.tier .tier-kind.woman { color: #d6457f; }
.tier .tier-kind.man { color: #3b82d6; }
.tier .tier-kind.either { color: var(--muted); }
.tier span.tier-kind { margin-inline-end: 0.1rem; }
/* The pictures a bot can wear, each with who it shows under it. */
.bot-pictures { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.bot-picture { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.bot-picture img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--surface-sunken); }
/* A two-way choice inside a card, the theme switch's shape in the page's colours. */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.segmented button { padding: 0.25rem 0.6rem; border: none; border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---- An item card's head: tag / name / key, one per line, in view and in edit alike. */
.item-head { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.item-head input[type=text] { max-width: 15rem; }
.item-head strong { font-size: 1rem; }

@media (max-width: 720px) {
    .settings-grid { grid-template-columns: 1fr; gap: 0.25rem 0; }
    .settings-grid > .setting { margin-bottom: 0.55rem; }
    .filter-row select { flex: 1 1 45%; min-width: 0; }
    .search-wide { width: 100%; }
}

/* ---- Identifiers stay on one line ------------------------------------------------------
   A GUID broken across two lines reads as two values. The detail-grid cell carrying one
   spans two columns so it fits; on a phone there is one column, and wrapping is the lesser
   evil there. .nowrap is for a date cell in a fixed-column table. */
.detail-grid > .wide { grid-column: span 2; }
.detail-grid .value.id { white-space: nowrap; font-size: 0.86rem; }
/* Only the id itself selects as one piece; the copy button next to it must not. */
.detail-grid .value.id .id-text { user-select: all; }
.nowrap { white-space: nowrap; }
.fixed-cols td { white-space: nowrap; }
@media (max-width: 480px) {
    .detail-grid > .wide { grid-column: auto; }
    .detail-grid .value.id { white-space: normal; word-break: break-all; }
}

/* ---- Reorder ------------------------------------------------------------------------- */
.reorder { display: inline-flex; gap: 4px; }
.reorder .btn-icon { width: 28px; height: 28px; }
.reorder .btn-icon > svg { width: 14px; height: 14px; }

/* A label over its field, kept together when an inline row wraps — a label left on one line
   with its field on the next reads as belonging to the wrong field. */
.field { display: inline-flex; flex-direction: column; gap: 0.3rem; }
.field > label { margin: 0; }
.field-inline { align-self: flex-end; padding-bottom: 0.5rem; }

/* A wide fixed-column table scrolls sideways inside its own box; the buttons at its right
   edge are then a scroll away rather than cut off. */
.table-scroll { overflow-x: auto; }
.table-scroll > table { min-width: 0; }

/* The games side by side, each a frame of its own with its sources stacked inside, so two
   games' rows never read as one and a third game simply takes the next column. */
.xp-games { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 0.5rem; }
.xp-game {
    flex: 0 1 15rem; min-width: 12rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    padding: 0.7rem 0.9rem 0.8rem;
}
.xp-game-name { font-weight: 650; margin-bottom: 0.5rem; }
.xp-source { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.xp-source input[type=number] { width: 5.5rem; }

/* A long table (the level tournament can run to a hundred rows) scrolls inside its own box, so
   the Save under it stays within reach; the header stays put. */
.table-scroll.tall { margin-bottom: 0.9rem; max-height: 26rem; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-scroll.tall thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }

/* W-10 House (laid out again 2026-09-17): three figures side by side, each with its own line
   under it. The balance is never red. Owing is allowed (W-10a), so the gauge under "Left for
   bot stakes" says how close bots are to stopping, in amber. */
.house-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 2rem; margin-bottom: 0.6rem; }
.house-stat { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.house-balance { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.house-gauge { height: 6px; border-radius: 3px; background: var(--neutral-soft); overflow: hidden; margin-top: 0.35rem; }
.house-gauge-fill { height: 100%; background: var(--warn); border-radius: 3px; }
.negative { color: var(--danger-ink); }
.positive { color: var(--success-ink); }
.house-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; }
.house-total {
    min-width: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    padding: 0.6rem 0.9rem 0.7rem;
}
.house-total-amount { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* T-01 tournaments: one box per stage — the stage number small on top, the number of climbers
   big under it, so "stage 1, nobody" cannot be read as "10". An empty stage stays grey so the
   eye goes to where the players are. Wide enough for a row of six before it wraps; the table
   scrolls sideways on a phone instead of stacking the boxes. */
.stage-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.stage-box {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 2.6rem; padding: 0.2rem 0.4rem; border-radius: var(--radius-sm);
    background: var(--neutral-soft); color: var(--neutral-ink);
    font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stage-box.stage-busy { background: var(--accent-soft); color: var(--accent-ink); }
.stage-no { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.02em; opacity: 0.8; }
.stage-count { font-size: 1rem; font-weight: 700; }
.live-table td { vertical-align: middle; }
.tournament-grid .item-card.tournament-off { opacity: 0.6; }
/* One wide row per tournament. Past about five rows the list scrolls in its own box. */
.tournament-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 30rem; overflow-y: auto; padding-inline-end: 0.25rem; }
.tournament-row { padding: 0.75rem 1rem; }
.tournament-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.tournament-row-name { min-width: 13rem; }
.tournament-row-facts { flex: 1 1 16rem; }
.tournament-row-actions { margin-inline-start: auto; margin-bottom: 0; }
.tournament-row .confirm-box { margin-top: 0.6rem; }
.tournament-list > .item-card.tournament-editing { outline: 2px solid var(--accent); outline-offset: -2px; }
.tournament-editor { margin-top: 1rem; }
.tournament-stages { display: flex; width: 100%; margin-bottom: 0.75rem; }
.tournament-stages input { width: 100%; }

/* A copied id: a bare icon next to the id, no frame; it flips to a tick for a moment. */
.copy-btn { vertical-align: middle; margin-inline-start: 0.35rem; border: none; background: transparent; box-shadow: none; opacity: 0.7; user-select: none; }
.copy-btn:hover { opacity: 1; background: var(--neutral-soft); }
.copy-btn.copied { color: var(--success-ink); opacity: 1; }
/* "Copied" floats on the page over the button (adminClipboard.flash), so no cell's edge cuts it. */
.copy-flash { position: fixed; z-index: 1980; transform: translate(-50%, -100%); padding: 0.15rem 0.5rem; border-radius: 6px; background: var(--success-ink); color: var(--surface); font-size: 0.72rem; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-sm); animation: copy-flash-in 0.15s ease-out; transition: opacity 0.35s ease; }
.copy-flash.is-gone { opacity: 0; }
@keyframes copy-flash-in { from { opacity: 0; transform: translate(-50%, calc(-100% + 3px)); } to { opacity: 1; transform: translate(-50%, -100%); } }

/* T-01 stage chips carry their stage number, because the order is the meaning. */
.tier .tier-no {
    display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
    background: var(--surface); font-size: 0.68rem; margin-inline-end: 0.15rem;
}

/* A number that opens a detail row: reads as a link, sits like a cell value. */
.link-btn {
    background: none; border: none; padding: 0; font: inherit; color: var(--accent-ink);
    cursor: pointer; display: inline-flex; align-items: center; gap: 0.2rem; font-variant-numeric: tabular-nums;
}
.link-btn > svg { width: 0.9rem; height: 0.9rem; }
.link-btn:hover { text-decoration: underline; }
a.stage-box { text-decoration: none; }
a.stage-box:hover { filter: brightness(1.1); }
/* The champions detail is bounded: a popular tournament has hundreds, and the monitor above
   it must stay in reach. The header stays put while the list scrolls. */
.champions-scroll { max-height: 22rem; margin: 0.4rem 0; }
table.champions th { position: sticky; top: 0; z-index: 1; background: var(--surface); }

/* A tournament card in summary: the pill row wraps, the sentence under it stays one block. */
.tournament-grid .item-card .tier { background: var(--neutral-soft); color: var(--neutral-ink); font-weight: 600; }
.tournament-grid .item-card .tier .tier-no { background: var(--surface); }

/* A pill that carries an icon instead of the dot (the match result's trophy). */
.pill.pill-icon::before { display: none; }
.pill.pill-icon > svg { width: 0.85rem; height: 0.85rem; flex-shrink: 0; }

/* A calm "nothing here for you" card: icon, one line, one muted line. */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 2.2rem 1rem; text-align: center; }
.empty-state > svg { width: 2rem; height: 2rem; color: var(--text-2); opacity: 0.7; margin-bottom: 0.3rem; }

.tournament-facts { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; margin: 0.5rem 0 0.6rem; }

/* An announcement pill: a link, so it reads as one; inline with whatever heading it follows. */
a.pill { text-decoration: none; vertical-align: middle; }
.fold > summary a.pill { margin-inline-start: 0.5rem; font-weight: 600; }

/* An "add" card at the end of a grid: the new thing appears where the others already are,
   instead of behind a button somewhere above them. */
.add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 16rem;
    align-self: stretch;
    border-style: dashed;
    color: var(--text-2);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.add-tile:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.add-tile:disabled { opacity: 0.45; cursor: default; }
.add-tile > svg { width: 1.4rem; height: 1.4rem; }

/* While a tournament is being edited its row carries the editor, so the list stops scrolling
   and the whole form is reachable. */
.tournament-list-open { max-height: none; overflow: visible; }
.account-list { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.linked-logins { margin-top: 1rem; display: grid; gap: 0.55rem; }
.linked-login { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; }
.linked-login-body { display: grid; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.login-method-icon { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.login-method-icon svg { width: 1.6rem; height: 1.6rem; }
.empty-note { margin: 0.25rem 0 0; padding: 0.9rem 1rem; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }
/* A reward's value on its own line of the row (2026-09-17): a number, or the item picker with the
   quantity beside it. Wide enough for the three dropdowns and the quantity, so nothing overlaps. */
th.col-prize { width: 27rem; }
.fixed-cols td.col-prize { overflow: visible; }
/* The wheel's table has a Colour column the other two lack: its reward column gives the room back. */
.wheel-table th.col-prize { width: 26rem; }
/* The item picker's three lists share the Reward cell and never spill into Weight (developer,
   2026-10-02: "Choose an item" ran over the weight box). */
.wheel-table .prize-cell > .item-picker { flex: 1; min-width: 0; }
.wheel-table .item-picker select { flex: 1 1 0; min-width: 0; }
.wheel-table .item-picker select.item-choice { flex-grow: 1.5; min-width: 0; }
.wheel-table input[type=color] { width: 2.4rem; height: 1.9rem; padding: 0.1rem; }
.prize-cell { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; }
.prize-cell .prize-qty { width: 4.5rem; }
.prize-cell .prize-amount { width: 8rem; }
/* Goods, then its kind, then the thing: the kind reads in full (developer, 2026-10-04). */
.prize-cell .prize-goods, .grant-picker .grant-goods { min-width: 10rem; }
.prize-cell .prize-ticket { min-width: 9rem; }
/* A secret typed into a textarea shows as dots at once, the way a password field does. */
.secret-text { -webkit-text-security: disc; text-security: disc; }

/* AD-57 Analytics: one card a metric, the total big, the change as a pill, bars under it. The
   running bucket is lighter, it is not finished yet. */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); gap: 1rem; margin-top: 1rem; }
.metric-card { margin: 0; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.metric-head h2 { margin: 0; }
.metric-total { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 0.35rem; }
.metric-change { font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.metric-change.up { background: var(--success-soft); color: var(--success-ink); }
.metric-change.down { background: var(--danger-soft); color: var(--danger-ink); }
.metric-change.flat { background: var(--neutral-soft); color: var(--neutral-ink); }
.metric-chart { margin-top: 0.8rem; }
.metric-chart svg { display: block; width: 100%; height: 8.5rem; }
.metric-axis { text-align: right; margin-bottom: 0.2rem; }
.metric-bar { fill: var(--accent); }
.metric-bar.negative-bar { fill: var(--danger); }
.metric-bar.running { opacity: 0.45; }
.metric-bar:hover { opacity: 0.8; }
.metric-baseline { stroke: var(--border-strong); stroke-width: 0.3; vector-effect: non-scaling-stroke; }
.metric-labels { display: flex; justify-content: space-between; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.report-details { max-width: 22rem; white-space: normal; overflow-wrap: anywhere; }
.metric-note { margin-top: 1.1rem; }
.resolve-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.15rem 0 0.5rem; }
.resolve-row .resolve-note { min-width: min(20rem, 100%); flex: 1 1 20rem; }

/* ---- Gallery (AD-58): two shelves of pictures, one tile each ---------------------------- */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.section-head h2 { margin: 0 0 0.25rem; }
.section-head .hint { margin: 0; }
.section-head .btn > input { display: none; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: 0.75rem;
}
/* AD-89: one pack's stickers, opened under its shelf (Gallery) or its slot (Items). */
.pack-editor {
    margin-top: 1rem; padding: 0.9rem; border: 1px dashed var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.pack-editor h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.gallery-tile .tile-meta .btn-sm { margin-top: 0.2rem; }
.gallery-tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 0.7rem 0.5rem 0.6rem;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
/* Built into the game: a small mark in the tile's top left corner. */
.gallery-tile .tile-badge {
    position: absolute; top: 0.35rem; left: 0.35rem; display: inline-flex; color: var(--muted);
}
.gallery-tile .tile-badge svg { width: 16px; height: 16px; }
/* The tile being edited keeps its one column (developer, 2026-10-02: across two its stacked fields
   left empty bands on both sides). */
.gallery-tile.is-editing { border-color: var(--accent); }
.gallery-tile .picker { margin: 0 0 0.45rem; }
.gallery-tile .tile-name input { width: 100%; }
/* An empty square that takes the picture of a cosmetic made without one. */
.gallery-tile .thumb-pick { cursor: pointer; border-style: dashed; }
.gallery-tile .thumb-pick:hover { color: var(--accent); border-color: var(--accent); }
.gallery-tile .thumb { width: 104px; height: 104px; margin: 0 0 0.45rem; object-fit: contain; }
/* Transparent pictures (stickers, frames, gifts) sit on the tile itself, no checkerboard behind
   them (developer, 2026-10-01: it made the picture hard to read). The lightbox keeps one. */
.gallery-tile.is-hidden .thumb { opacity: 0.4; }

/* W-14 gifts: a hidden gift reads as set aside, and the editor sits inside the list card. */
tr.is-hidden > td { opacity: 0.55; }
/* The gift cards (developer, 2026-09-24: a grid like Prizes). A gift is a transparent PNG, so it
   is shown whole rather than cropped to the frame. */
.gift-card .gift-image { object-fit: contain; }
.gift-card.is-hidden .gift-image { opacity: 0.4; }

/* Cards show a picture in the game's own frame, not stretched across the card (developer,
   2026-09-24: "what does it look like in the game?"). A gift is square, an event banner and a
   prize tile's picture 16:9 and cut to fill. */
.item-image.gift-image, .item-image-empty.gift-image { width: 100%; max-width: 180px; height: auto; aspect-ratio: 1 / 1; }
.item-image.banner-image, .item-image-empty.banner-image { width: 100%; max-width: 420px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
/* F-12: a badge's bronze, silver and gold side by side, each a third of the card (an honor's one picture stays alone). */
.badge-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: center; gap: 0.4rem; width: 100%; max-width: 240px; }
.badge-tiers.badge-one { grid-template-columns: minmax(0, 80px); }
.badge-tiers .item-image.gift-image, .badge-tiers .item-image-empty.gift-image { max-width: none; font-size: 0.7rem; }
.card.inset { margin: 0.5rem 0 1rem; background: var(--surface-sunken); box-shadow: none; }
.gallery-tile .tile-name { display: flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 1.6rem; max-width: 100%; }
.gallery-tile .tile-name .name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-tile .tile-name.inline-form { margin: 0; }
.gallery-tile .tile-name.inline-form input { width: 7rem; }
.gallery-tile .tile-meta { display: flex; gap: 0.4rem; align-items: center; min-height: 1.2rem; margin-top: 0.15rem; }
.gallery-tile .tile-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 0.5rem; }
.gallery-tile .tile-actions .btn-icon { width: 30px; height: 30px; box-shadow: none; }
.gallery-tile .tile-actions .btn-icon svg { width: 16px; height: 16px; }

/* ---- AD-75 toasts -------------------------------------------------------------------------
   The panel's answers in a corner (developer, 2026-09-24): bottom right, bottom left in a
   right-to-left language (inset-inline-end follows the page direction). A success fades by itself,
   a warning stays longer, an error stays until closed and can be copied. */
.toast-host {
    position: fixed;
    bottom: 1rem;
    inset-inline-end: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(26rem, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem 0.7rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-inline-start-width: 4px;
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    animation: toast-in 0.18s ease-out;
}
.toast > svg { flex-shrink: 0; width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; }
.toast-text { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast-actions { display: flex; gap: 0.2rem; flex-shrink: 0; }
.toast-btn {
    appearance: none; border: 0; background: transparent; color: var(--text-3);
    padding: 0.15rem; border-radius: 6px; cursor: pointer; line-height: 0;
}
.toast-btn:hover { color: var(--text); background: var(--surface-3, var(--surface)); }
.toast-btn svg { width: 1rem; height: 1rem; }
.toast-success { border-inline-start-color: var(--success-ink); }
.toast-success > svg { color: var(--success-ink); }
.toast-warning { border-inline-start-color: var(--warn-ink); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface-2)); }
.toast-warning > svg { color: var(--warn-ink); }
.toast-error { border-inline-start-color: var(--danger-ink); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface-2)); }
.toast-error > svg { color: var(--danger-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Announcements as a grid of cards about as wide as the game's banner (developer, 2026-09-24), the
   one being edited across the whole row, since its editor holds the schedule and the target. */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
    gap: 1rem;
    align-items: start;
}
.event-grid > .card { margin: 0; }

/* F-106: the Events Calendar, a month of days with a bar per time an event runs. */
.event-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-top: .75rem;
}
.event-calendar-head { text-align: center; padding: 2px 0; }
.event-calendar-day {
    min-height: 84px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.event-calendar-out { opacity: .45; }
/* Q84: the task calendar, a week's column first. */
.task-calendar { grid-template-columns: minmax(0, 1.2fr) repeat(7, minmax(0, 1fr)); }
.task-calendar .event-bar { cursor: default; }
.task-table td.task-days { overflow: visible; }
.chip-row.task-marks { margin: 0; gap: 0.2rem; flex-wrap: nowrap; }
.chip-row.task-marks .chip { padding: 0.1rem 0.25rem; font-size: 0.72rem; min-width: 1.45rem; justify-content: center; }
.event-calendar-today { border-color: var(--accent); }
.event-bar {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 5px;
    padding: 2px 5px;
    background: var(--bar);
    color: #fff;
    font-size: .72rem;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.event-bar:disabled { cursor: default; }
.event-bar-skipped { opacity: .45; text-decoration: line-through; }
.event-bar-off { filter: grayscale(1); }
@media (max-width: 640px) {
    .event-calendar-day { min-height: 56px; padding: 2px; }
    .event-bar { font-size: .62rem; padding: 1px 3px; }
}
.event-card .item-image.banner-image { max-width: 100%; }

/* AD-76: a compact toolbar at the page's top corner, inside the header on a phone. */
.undo-bar {
    position: fixed;
    top: 0.85rem;
    inset-inline-end: 1.25rem;
    z-index: 1900;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: 2px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: none;
}

.undo-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.undo-btn svg { width: 1rem; height: 1rem; }
[dir="rtl"] .undo-btn svg { transform: scaleX(-1); }
.undo-btn:hover:not(:disabled) { background: var(--surface); }
.undo-btn:disabled { color: var(--text-3); cursor: default; }
.undo-sep { width: 1px; height: 1.1rem; background: var(--border); }
@keyframes undo-in { from { opacity: 0; transform: translate(-50%, 0.6rem) scale(0.96); } to { opacity: 1; transform: translateX(-50%); } }
@media (max-width: 860px) {
    .undo-bar, [dir="rtl"] .undo-bar {
        top: max(0.45rem, env(safe-area-inset-top));
        bottom: auto;
        left: auto;
        inset-inline-end: 0.6rem;
        transform: none;
        z-index: 40;
        animation: none;
    }
    .undo-btn span { display: none; }
    .undo-btn { width: 32px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .undo-bar { animation: none; } }

/* ---- AD-77 the question a delete asks ------------------------------------------------------ */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, .45);
    animation: confirm-fade 0.15s ease-out;
}
.confirm-card {
    width: min(100%, 25rem);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: confirm-pop 0.2s cubic-bezier(.2, .9, .3, 1.15);
}
.confirm-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--danger-soft);
    color: var(--danger-ink);
}
.confirm-icon svg { width: 1.35rem; height: 1.35rem; }
.confirm-card h2 { margin: 0 0 0.45rem; font-size: 1.05rem; font-weight: 680; color: var(--text); }
.confirm-text { margin: 0 0 0.4rem; font-weight: 600; overflow-wrap: anywhere; }
.confirm-note { margin: 0 0 0.2rem; color: var(--text-2); font-size: 0.84rem; }
.confirm-actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.confirm-actions .btn { flex: 1; justify-content: center; }
.confirm-actions .btn-icon { flex: 0 0 auto; }
@keyframes confirm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirm-pop { from { opacity: 0; transform: scale(0.94) translateY(0.4rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .confirm-backdrop, .confirm-card { animation: none; } }
/* AD-107: what each role can do, read rather than answered, so wider and left aligned. */
.roles-card { width: min(100%, 38rem); max-height: calc(100dvh - 2.5rem); overflow-y: auto; text-align: start; }
.roles-head { display: flex; align-items: center; gap: 0.5rem; }
.roles-card .tabs { margin-top: 0.8rem; }
.roles-card .tab .pill { margin-inline-start: 0.35rem; }
.roles-who { margin: 0.9rem 0 0.2rem; color: var(--text-2); font-weight: 600; }
/* Each kind of right is its own tinted block, every line behind a round mark: a tick for what the
   role does, a send arrow for what it asks for, an eye for what it only reads, a cross for what it cannot. */
.roles-section { --tone: var(--success); --tone-soft: var(--success-soft); --tone-ink: var(--success-ink);
    margin-top: 0.75rem; padding: 0.7rem 0.8rem 0.8rem; border-radius: 0.7rem; border: 1px solid var(--border);
    border-inline-start: 3px solid var(--tone); background: var(--surface-2); }
.roles-ask { --tone: var(--info); --tone-soft: var(--info-soft); --tone-ink: var(--info-ink); }
.roles-read { --tone: var(--muted); --tone-soft: var(--neutral-soft); --tone-ink: var(--neutral-ink); }
.roles-no { --tone: var(--danger); --tone-soft: var(--danger-soft); --tone-ink: var(--danger-ink); }
.roles-group { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tone-ink); }
.roles-count { min-width: 1.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--tone-soft); color: var(--tone-ink); font-size: 0.72rem; line-height: 1.25rem; text-align: center; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.roles-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; font-size: 0.88rem; line-height: 1.45; }
.roles-list li { display: flex; align-items: flex-start; gap: 0.55rem; min-width: 0; }
.roles-mark { flex-shrink: 0; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; margin-top: 0.05rem; border-radius: 50%; background: var(--tone-soft); color: var(--tone); }
.roles-mark svg { width: 0.8rem; height: 0.8rem; stroke-width: 3; }
/* The role below, whose rights this one carries too. A button, it opens that role's tab. */
.roles-includes { --tone: var(--accent); --tone-soft: var(--accent-soft);
    display: flex; align-items: center; gap: 0.55rem; width: 100%; margin-top: 0.75rem; padding: 0.6rem 0.8rem;
    border: 1px dashed var(--accent); border-radius: 0.7rem; background: var(--accent-wash); color: var(--accent-ink);
    font: inherit; font-size: 0.88rem; font-weight: 600; text-align: start; cursor: pointer; }
.roles-includes:hover { background: var(--accent-soft); }
.roles-includes:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.roles-includes > span:nth-child(2) { flex: 1; min-width: 0; }
.roles-go { display: inline-flex; }
.roles-go svg { width: 1rem; height: 1rem; }
[dir="rtl"] .roles-go svg { transform: scaleX(-1); }
/* B18: the two store pages side by side, one under the other on a phone. Addresses read left to right. */
.store-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 0.6rem; align-items: end; }
.store-links label { display: grid; gap: 0.25rem; min-width: 0; }
.store-links input { width: 100%; min-width: 0; }
@media (max-width: 640px) { .store-links { grid-template-columns: minmax(0, 1fr); } .store-links .btn { justify-self: start; } }

/* AD-109: Getting started, the dashboard's card and the window. Steps sit in columns on the card,
   one under the other in the window. A done step keeps its place, greyed, with a green tick. */
.start-head { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.start-flag { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.start-flag svg { width: 1.15rem; height: 1.15rem; }
.start-heading { flex: 1; min-width: 12rem; }
.start-heading h2 { margin: 0; }
.start-heading p { margin: 0.2rem 0 0; }
.start-progress { display: flex; align-items: center; gap: 0.75rem; margin: 0.8rem 0 0.4rem; }
.start-bar { flex: 1; height: 0.5rem; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.start-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.start-count { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.start-all { display: flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0; color: var(--success-ink); font-weight: 600; }
.start-all svg { width: 1rem; height: 1rem; }
.start-steps { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.start-card .start-steps { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.start-step { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); }
.start-step.done { opacity: 0.62; }
.start-mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border-strong); color: var(--muted); font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.start-mark svg { width: 0.9rem; height: 0.9rem; }
.start-step.done .start-mark { background: var(--success); border-color: var(--success); color: var(--surface); }
.start-body { flex: 1; min-width: 0; }
.start-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.start-body p { margin: 0.15rem 0 0; font-size: 0.85rem; line-height: 1.4; }
.start-go { align-self: center; flex-shrink: 0; }
.start-dialog { width: min(100%, 44rem); }
.start-guide-title { margin: 1.3rem 0 0.5rem; }
.start-rules { padding: 0.7rem 0.85rem; border-radius: 0.6rem; background: var(--accent-wash); }
.start-rules p { margin: 0 0 0.3rem; font-size: 0.88rem; line-height: 1.45; }
.start-rules p:last-child { margin: 0; }
.start-guide { display: grid; gap: 0.9rem; margin-top: 0.9rem; }
.start-group h4 { margin: 0 0 0.15rem; font-size: 0.92rem; }
.start-group p { margin: 0 0 0.4rem; font-size: 0.85rem; line-height: 1.4; }
.start-group .chip-row { margin-bottom: 0; }
.start-group a.chip { text-decoration: none; }
.start-group a.chip:hover { border-color: var(--accent); color: var(--accent); }
.start-show { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; font-size: 0.88rem; }

/* AD-76: a section being edited stands out from the ones being read, and its last button (Delete)
   goes to the far end of its row, away from Save. */
.card-editing { border-color: var(--accent, #5b5bd6); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5b5bd6) 18%, transparent); }
.push-end { margin-inline-start: auto; }

/* A picture in a table cell is never cut to "…" (developer, 2026-09-24: dots beside the Lucky
   Wheel's pictures): .fixed-cols ends an overflowing cell with an ellipsis, and a picker's corner
   buttons stick out of its frame by design. */
.fixed-cols td:has(> .picker) { overflow: visible; text-overflow: clip; }

/* Catalog (developer, 2026-09-25): Prizes and Gifts are two tabs under one heading. The tabs are
   links, so they sit right under the title the way the page's own tabs would. */
.catalog-tabs { margin: -0.6rem 0 1.1rem; }
.catalog-tabs .tab { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.catalog-tabs .tab svg { width: 1rem; height: 1rem; margin: 0; }

/* AD-76a: an audit row the panel's Undo or Redo made. */
.pill-replay { margin-inline-start: 0.4rem; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; }
.confirm-icon-calm { background: var(--accent-soft); color: var(--accent); }

/* AD-78: the players a search found, one button each, and a sent message that keeps its lines. */
.pick-list { display: flex; flex-direction: column; gap: 0.3rem; max-width: 34rem; }
.pick-row {
    appearance: none; text-align: start; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; gap: 0.1rem;
    padding: 0.5rem 0.7rem; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
}
.pick-row:hover { background: var(--surface-2); }
.message-cell { overflow-wrap: anywhere; }
.message-text { white-space: pre-wrap; }

/* A tab's icon is text-sized (the System messages "To" choice drew them at full size, 2026-09-25). */
.tab > svg { width: 1rem; height: 1rem; flex: none; vertical-align: -2px; margin-inline-end: 0.35rem; }
/* AD-80: an archived System message stays in the list, faded. */
.row-archived td { opacity: 0.55; }

/* ---- A picture opened large (developer, 2026-09-26): zoom and drag, one step to leave. ---- */
img.thumb, img.item-image { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 3000; display: none; flex-direction: column; background: rgba(8, 11, 18, 0.92); }
.lightbox.open { display: flex; }
.lightbox-bar {
    display: flex; justify-content: flex-end; gap: 0.4rem;
    padding: calc(0.6rem + env(safe-area-inset-top, 0px)) calc(0.6rem + env(safe-area-inset-right, 0px)) 0.6rem calc(0.6rem + env(safe-area-inset-left, 0px));
}
.lightbox-bar button {
    min-width: 44px; height: 44px; padding: 0 0.7rem; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
    background: rgba(255, 255, 255, 0.1); color: #fff; font: 600 1.25rem/1 system-ui, sans-serif; cursor: pointer;
}
.lightbox-bar button:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-bar .lightbox-zoom { font-size: 0.85rem; font-variant-numeric: tabular-nums; min-width: 64px; }
.lightbox-bar .lightbox-close { font-size: 1.6rem; background: rgba(255, 255, 255, 0.18); }
.lightbox-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: zoom-in; margin-bottom: env(safe-area-inset-bottom, 0px); }
.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-zoomed:active { cursor: grabbing; }
.lightbox-stage img {
    position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center;
    user-select: none; -webkit-user-drag: none;
    /* A transparent picture shows where it ends. */
    background: repeating-conic-gradient(#2a3040 0 25%, #353c4f 0 50%) 50% / 16px 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
/* Developer, 2026-11-12: over the picture, dashed, the part the game shows, the cut parts darkened and hatched. It follows
   the picture's zoom and drag (lightbox.js gives it the same size and transform), its lines one screen pixel whatever the zoom. */
.lightbox-stage .lightbox-shows {
    position: absolute; left: 50%; top: 50%; transform-origin: center; overflow: visible; pointer-events: none; display: none;
}
.lightbox-say {
    position: absolute; left: 50%; bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    width: max-content; max-width: min(46rem, calc(100vw - 24px)); display: none;
    padding: 0.55rem 0.85rem; border-radius: 10px; background: rgba(8, 11, 18, 0.88); border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0; font: 400 0.9rem/1.45 system-ui, sans-serif; text-align: start; pointer-events: none;
}
.lightbox-say p { margin: 0; }
.lightbox-say p + p { margin-top: 0.2rem; }
.lightbox-say .is-bad { color: #fca5a5; font-weight: 600; }
.lightbox-say .is-quiet { color: #94a3b8; font-size: 0.8rem; }

/* ---- AD-97: Server usage. The server's load now, a month of it, and the banner while it is high. ---- */
.load-banner {
    display: flex; align-items: center; gap: 0.55rem; margin-bottom: 1rem; padding: 0.65rem 0.9rem;
    border-radius: var(--radius); background: var(--danger-soft); color: var(--danger-ink); font-weight: 600; text-decoration: none;
}
.load-banner svg { width: 1.05rem; height: 1.05rem; flex: none; }
.load-banner:hover { text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: 0.75rem; margin-top: 0.6rem; }
.stat-tile { padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.stat-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 0.2rem; overflow-wrap: anywhere; }
.stat-sub { font-size: 0.8rem; margin-top: 0.15rem; }
.section-title { margin: 1.5rem 0 0; }
.month-card { margin-top: 1rem; }
.month-card h3 { margin: 1.3rem 0 0.2rem; font-size: 1rem; }
.month-nav { display: flex; gap: 0.4rem; }
.month-days { margin-top: 1rem; }
.month-days > summary { cursor: pointer; font-weight: 600; margin-bottom: 0.5rem; }

/* Stats (developer, 2026-10-01): ranked lists, what players use most. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: 1rem; align-items: start; }
.stat-grid > .card { margin: 0; }
.stat-list { list-style: none; margin: 0.4rem 0 0.3rem; padding: 0; display: grid; gap: 0.35rem; }
.stat-row {
    display: grid; grid-template-columns: 1.6rem minmax(6rem, 1fr) minmax(4rem, 1.2fr) auto 2.8rem auto;
    align-items: center; gap: 0.5rem; font-size: 0.92rem;
}
.stat-row.is-hidden { opacity: 0.55; }
.stat-rank { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.stat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar { height: 0.5rem; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.stat-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.stat-row:first-child .stat-bar > span { background: var(--accent-hover); }
.stat-count { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stat-share { text-align: right; font-variant-numeric: tabular-nums; }
.stat-players { display: inline-flex; align-items: center; gap: 0.2rem; font-variant-numeric: tabular-nums; }
.stat-players svg { width: 14px; height: 14px; }

/* Dashboard (developer, 2026-10-01): what each account chose to watch. */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.8rem; }
.chip {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.7rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: inherit; cursor: pointer; font-size: 0.88rem;
}
.chip svg { width: 14px; height: 14px; }
.chip.chip-on { border-color: var(--accent); color: var(--accent); }
.dash-widget { position: relative; }
.dash-widget > .card { margin: 0; height: 100%; }
.dash-widget-tools { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1; display: flex; gap: 0.3rem; }
.dash-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.6rem; }
.dash-counts a { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem; border-radius: var(--radius); background: var(--surface-2); color: inherit; text-decoration: none; }
.dash-counts strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* CS-16: an expression's On Impact picture beside its price on the card. */
.impact-thumb { width: 2rem; height: 2rem; object-fit: contain; border-radius: 6px; vertical-align: middle; }

/* CS-17 (developer, 2026-10-01): Gold, Diamonds and EXP take less room, the packs sit under them. */
.resource-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); gap: 0.75rem; }
.resource-grid-compact .resource-card { padding: 0.6rem 0.75rem; gap: 0.3rem; }
.resource-grid-compact .resource-card .sub { font-size: 0.78rem; }
/* A long list of packs scrolls inside its card. */
.pack-shelf { max-height: 34rem; overflow-y: auto; padding-right: 0.25rem; }
.pack-shelf .item-card .sub { margin: 0; }
/* CS-26: the VIP tiers are the whole page and their editor is long, so the shelf grows with it. */
.pack-shelf.shelf-open { max-height: none; overflow-y: visible; padding-right: 0; }

/* CS-18: a shop row shows what it sells (its picture and name), read from Content. */
.shop-sells { display: flex; align-items: center; gap: 0.5rem; }
.shop-sells .thumb { width: 3rem; height: 3rem; flex: none; }

/* Developer, 2026-10-01: one language button on a card or in an editor, no tabs and no window.
   On a card it changes what is read, in edit mode what is written. */
.lang-switch { white-space: nowrap; }
.lang-switch .lang-code + svg { width: 0.8rem; height: 0.8rem; opacity: 0.7; }
.lang-switch .lang-code { display: none; }
/* On a phone every language button reads its code, EN, without the arrow (developer, 2026-10-04). */
@media (max-width: 860px) {
    .lang-switch .lang-name, .lang-switch .lang-code + svg { display: none; }
    .lang-switch .lang-code { display: inline; }
}
/* The language dropdown (developer, 2026-10-02): a list placed against the window by adminPlaceMenu
   (App.razor), so a card that scrolls its overflow cannot cut it off. Closed by a click outside. */
.lang-pick { display: inline-flex; align-items: center; gap: 0.25rem; }
.lang-backdrop { position: fixed; inset: 0; z-index: 900; }
.lang-pick-menu {
    position: fixed; top: 0; left: 0; z-index: 901; min-width: 9rem; visibility: hidden;
    display: flex; flex-direction: column; gap: 2px; padding: 4px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.lang-pick-menu button {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.45rem 0.7rem; border: 0; border-radius: 6px; background: none; color: inherit;
    text-align: start; white-space: nowrap; cursor: pointer; font: inherit; font-size: 0.85rem;
}
.lang-pick-menu button:hover { background: var(--surface-2); }
.lang-pick-menu button.is-current { color: var(--accent); font-weight: 600; }
.lang-pick-menu button svg { width: 0.9rem; height: 0.9rem; }
.editor-lang { margin: 0 0 0.6rem; }
/* A tile in edit mode: its language button, name and words stacked, as wide as the tile. */
.tile-edit { display: flex; flex-direction: column; gap: 0.35rem; width: 100%; align-items: stretch; }
.tile-edit .lang-pick { align-self: center; }
/* F-27: whether a frame counts, a small checkbox on one line, and its looks one under another (a frame picker is as wide
   as the tile), each with the count it starts at. */
.frame-counts { display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.tile-edit .frame-counts input[type="checkbox"] { flex: none; width: 36px; }
.frame-tiers { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.frame-tier { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
/* F-13: a league on the Rewards League tab, its emblem beside its name, and the Legend Star marks in a row. */
.league-block { margin-top: 1.25rem; }
.league-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.league-title { display: flex; flex-direction: column; gap: 0.25rem; min-width: 12rem; }
.league-title h3 { margin: 0; }
.star-tiers { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.tile-edit input { width: 100%; }
/* A one-column tile is narrow: Move to Default wraps rather than sticking out of it. */
.tile-edit .btn { white-space: normal; justify-content: center; text-align: center; }
/* U-75: a sticker's sound, as wide as the tile. */
.tile-edit .sound-pick { width: 100%; }
.gallery-tile .tile-meta:has(.sound-preview) { align-self: stretch; }
.gallery-tile .tile-meta .sound-preview { flex: 1; }
.item-head .tile-edit { align-items: flex-start; }
/* CS-21: a sound under its picture (developer, 2026-10-02: the browser's own player looked out of
   place). As wide as the picture: a round play button, how far it has played, the time, then Add
   sound or Replace and the bin. */
.sound-pick { display: flex; flex-direction: column; gap: 0.45rem; width: 160px; }
.sound-player, .sound-none {
    display: flex; align-items: center; gap: 0.55rem; height: 2.5rem; padding: 0 0.55rem 0 0.35rem;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface-sunken);
}
.sound-none { justify-content: center; padding: 0 0.6rem; color: var(--muted); font-size: 0.8rem; border-style: dashed; }
.sound-none svg { width: 1rem; height: 1rem; }
.sound-play {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 1.85rem; height: 1.85rem; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease;
}
.sound-play:hover { transform: scale(1.06); }
.sound-play svg { width: 0.8rem; height: 0.8rem; }
.sound-icon-play { display: inline-flex; margin-inline-start: 2px; }
.sound-icon-pause { display: none; }
.sound-player.is-playing .sound-icon-play { display: none; }
.sound-player.is-playing .sound-icon-pause { display: inline-flex; }
.sound-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.sound-bar { position: relative; height: 4px; border-radius: 2px; background: var(--border); cursor: pointer; overflow: hidden; }
.sound-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--accent); border-radius: 2px; }
.sound-time { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.sound-player audio { display: none; }
/* AD-110: a System message's style buttons, how its words will look, and its picture in the list. */
.rich-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-bottom: 0.35rem; }
.rich-tools .btn { min-width: 2rem; justify-content: center; }
.rich-swatches { display: inline-flex; gap: 0.3rem; margin-inline-start: 0.3rem; }
.rich-swatch { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.rich-swatch:hover { transform: scale(1.12); }
.rich-preview { margin-top: 0.4rem; padding: 0.55rem 0.75rem; border-radius: 0.6rem; background: var(--surface-sunken); line-height: 1.45; overflow-wrap: anywhere; }
.rich-preview > .muted { display: block; margin-bottom: 0.2rem; }
.message-image { display: block; max-width: 12rem; max-height: 7rem; border-radius: 0.4rem; margin-bottom: 0.35rem; object-fit: cover; }
.message-cell .muted svg { width: 0.85rem; height: 0.85rem; vertical-align: -0.1rem; margin-inline-end: 0.25rem; }

/* Developer, 2026-10-05: a card's sounds, played without opening Edit (SoundPreview). */
.sound-previews { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.45rem 0 0.7rem; }
.sound-preview { flex: 1 1 9rem; min-width: 0; }
.sound-preview .sound-player { height: 2.3rem; }
.sound-label { font-size: 0.72rem; line-height: 1.1; display: flex; gap: 0.3rem; min-width: 0; white-space: nowrap; }
/* The file's name after the label on a card, alone on the editor's player, cut with an ellipsis. */
.sound-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-file::before { content: "·"; margin-inline-end: 0.3rem; }
.sound-name { display: flex; align-items: flex-start; gap: 0.3rem; margin-top: -0.15rem; font-size: 0.72rem; line-height: 1.3; color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }
.sound-name svg { flex: none; width: 0.8rem; height: 0.8rem; margin-top: 0.1rem; color: var(--muted); }
.sound-name span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sound-actions { display: flex; gap: 0.35rem; align-items: center; }
.sound-actions .sound-upload { flex: 1; min-width: 0; justify-content: center; }
.sound-upload-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-actions .sound-upload.disabled { opacity: 0.5; pointer-events: none; }
.sound-remove { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin-inline-start: -0.2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.sound-remove:hover { color: var(--danger); background: var(--neutral-soft); }
.sound-remove:disabled { opacity: 0.5; pointer-events: none; }
.sound-remove svg { width: 0.85rem; height: 0.85rem; }

/* Developer, 2026-10-05: how much of a sound the game plays (SoundWindow), drawn right under it.
   The game's time on top, the file under it on the same scale, what the game cuts striped. */
.sound-window { --sw-game: 100%; --sw-heard: 0%; --sw-cut: 0%; display: flex; flex-direction: column; gap: 0.45rem; width: 17rem; max-width: 100%; font-size: 0.78rem; color: var(--text-2); }
.sound-window-head { font-weight: 600; color: var(--text); line-height: 1.3; }
.sw-explain { margin: 0; padding-top: 0.4rem; border-top: 1px solid var(--border); line-height: 1.4; }
.sw-heard-dot { background: var(--success-ink); }
.sw-cut-dot { background: repeating-linear-gradient(135deg, var(--danger) 0 2px, transparent 2px 4px); outline: 1px solid var(--danger); }
.sw-legend-heard, .sw-legend-cut { display: none !important; }
.sound-window.has-sound .sw-legend-heard, .sound-window.is-over .sw-legend-cut { display: inline-flex !important; }
.sound-window:not([data-cuts="yes"]) .sw-cut-dot { background: var(--warn); outline: none; }

/* The "?" beside a sound, after its Replace button. It turns into a yellow "!" when the game does not
   play all of the file (App.razor measures it). */
.sound-meta { display: flex; align-items: center; gap: 0.3rem; min-height: 24px; }
.sound-meta .sound-name { flex: 1; min-width: 0; margin-top: 0; align-items: center; }
.sound-meta .sound-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-meta .sound-name svg { margin-top: 0; }
.sound-meta .sound-help { width: 24px; height: 24px; margin: 0; flex: none; border-radius: 50%; }
.sound-help .help-bang { display: none; }
.sound-help .help-bang svg { width: 16px; height: 16px; }
.sound-help.is-warn, .sound-help.is-warn:hover, .sound-help.is-warn:focus { color: var(--warn); }
.sound-help.is-warn .help-q { display: none; }
.sound-help.is-warn .help-bang { display: inline; }
.sound-help .help-q { display: inline-flex; }
.sound-help .help-q svg { width: 16px; height: 16px; }
.sound-name.is-empty > * { visibility: hidden; }
.sound-window-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.3rem 0.4rem; }
.sw-label { font-size: 0.66rem; color: var(--muted); }
.sw-track { position: relative; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.sw-game { display: flex; height: 100%; width: var(--sw-game); gap: 1px; }
.sw-part { display: block; height: 100%; }
.sw-fly, .sw-best { background: var(--accent); }
.sw-pop { background: var(--warn); }
.sw-stay { background: var(--accent); }
.sw-fade { background: linear-gradient(to right, var(--accent), transparent); }
[dir="rtl"] .sw-fade { background: linear-gradient(to left, var(--accent), transparent); }
.sw-best { opacity: 0.55; }
.sw-file-label, .sw-file-track { display: none; }
.sound-window.has-sound .sw-file-label, .sound-window.has-sound .sw-file-track { display: block; }
.sw-heard, .sw-cut { position: absolute; inset-block: 0; }
/* A sliver still shows when a long file leaves the game only a moment of it. */
.sw-heard { inset-inline-start: 0; width: var(--sw-heard); min-width: 6px; z-index: 1; background: var(--success-ink); }
.sw-cut { inset-inline-start: var(--sw-heard); width: var(--sw-cut); background: repeating-linear-gradient(135deg, var(--danger, #ef4444) 0 3px, transparent 3px 6px); }
.sound-window:not([data-cuts="yes"]) .sw-cut { background: var(--warn); }
.sw-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; font-size: 0.66rem; }
.sw-legend span { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.sw-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 2px; }
.sw-note { margin: 0; line-height: 1.3; }
.sw-note:empty { display: none; }
.sound-window.is-over .sw-note { color: var(--warn-ink); font-weight: 600; }

/* Developer, 2026-10-05: who a System message goes to and its language on one line, the message right under. */
.compose-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.compose-head .tabs { border-bottom: 0; margin: 0; }
.compose-head .lang-pick { margin-bottom: 0.35rem; }
.cat-select { max-width: 20rem; }

/* AD-113: the message and its categories side by side, one under the other on a narrow screen. */
.system-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
/* The message box grows downwards only, never wider than its card (developer, 2026-10-05). */
#system-text { width: 100%; max-width: 100%; resize: vertical; }
.system-top > .card { margin: 0; min-width: 0; }
.system-top + .card { margin-top: 1rem; }
@media (max-width: 1100px) { .system-top { grid-template-columns: minmax(0, 1fr); } }
.system-categories .cat-list { grid-template-columns: minmax(0, 1fr); }
.cat-default { margin-inline-start: 0.4rem; font-size: 0.7rem; vertical-align: middle; }

/* AD-113: the categories, each a thread of its own in the game. */
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.card-head-row h2 { margin: 0; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.6rem; }
.cat-list + .cat-list { margin-top: 0.6rem; }
.cat-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); min-width: 0; }
.cat-card.cat-editing { align-items: flex-start; outline: 2px solid var(--accent); outline-offset: -2px; }
.cat-face { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--surface-2); color: var(--muted); }
.cat-face img { width: 100%; height: 100%; object-fit: cover; }
.cat-words { display: flex; flex-direction: column; gap: 0; min-width: 0; flex: 1; }
.cat-words strong { overflow-wrap: anywhere; }
.cat-actions { display: flex; gap: 0.25rem; flex: none; }
.cat-actions .btn-icon { width: 30px; height: 30px; }
.cat-editing .picker .thumb { width: 72px; height: 72px; }
.cat-editing .cat-words { gap: 0.4rem; }
.cat-pill { margin-bottom: 0.3rem; }

/* Developer, 2026-10-05: a long sent message shows its first lines until opened, and the list scrolls. */
.message-fold.is-folded { max-height: 4.6em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.table-scroll.sent-scroll { max-height: 34rem; }
.table-scroll.sent-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.logo-word { white-space: nowrap; }

/* AD-110: a System message's picture keeps its own width, so the upload button sits on its corner. */
.picture-fit { display: flex; }
.picture-fit .picker-banner .thumb { max-width: 100%; }
/* The gift, expression and ticket cards (developer, 2026-10-02): one width whether read or
   edited, so opening an editor never moves the other cards. 290px holds Save, Cancel and Delete on
   one line and an expression's two pictures side by side. */
.gift-grid { grid-template-columns: repeat(auto-fill, min(290px, 100%)); }
/* AD-99b: packs fill the shelf's width and keep their place when an editor opens. */
.gift-grid.pack-shelf { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.gift-grid > .gift-editing, .event-grid > .event-editing { border-color: var(--accent); }
.gift-grid > .gift-card:not(.gift-editing) { text-align: center; }
.gift-grid > .gift-card:not(.gift-editing) .gift-image { margin-inline: auto; }
.gift-grid > .gift-card:not(.gift-editing) :is(.fee-block-head, .inline-form, .card-actions) { justify-content: center; }
/* A narrow card needs wrapping actions even on a wide desktop page. */
.edit-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }

/* RW-15 (developer, 2026-10-01): every reward of a day or a level is the same line, its kind then
   how much or which item, the first one included. Read, they are a short list of chips. */
th.col-rewards { width: 30rem; }
.fixed-cols td.col-rewards { overflow: visible; white-space: normal; }
.reward-lines { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.reward-line { display: grid; grid-template-columns: 8.5rem auto auto; align-items: center; gap: 0.4rem; }
.reward-line > .btn-icon { width: 28px; height: 28px; }
.reward-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.reward-chip { padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.9rem; white-space: nowrap; }
.reward-part-add { display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.1rem; }
.reward-part-add svg { width: 0.9rem; height: 0.9rem; }
.reward-tab-panel td.reward-picture-read .picker .thumb { width: 56px; height: 56px; }
.reward-tab-panel td.col-rewards .reward-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.shop-card-field > .muted, .metric-axis, .metric-labels { color: var(--text-2); }

/* A content card's buttons (developer, 2026-10-01): Edit, the language button, then the move
   arrows right beside them, wrapping to a second line rather than pushed to the far side. */
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* CS-19: a shop section's cards. Editing, one narrow width for every card (developer, 2026-10-04),
   as many to a line as fit and never sideways. Read, the game's count to a line (.is-reading). */
/* One line of cards in view, the rest scrolls inside the section (developer, 2026-10-01). */
.shop-grid-scroll { overflow: auto; max-height: 33rem; padding-bottom: 0.25rem; }
.card-editing .shop-grid-scroll { max-height: 38rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, min(100%, 15rem)); gap: 0.75rem; margin-top: 0.75rem; }
/* Read, the game's own layout (developer, 2026-10-04): --cols to a line at every width, 4 still fit a
   320 px phone, so each card is only its picture, name and price. Capped so a wide screen does not
   blow the pictures up. */
/* Editing, never more to a line than the section shows (developer, 2026-10-04: 3 showed as 4). */
.shop-grid:not(.is-reading) { max-width: calc(var(--cols, 3) * 15rem + (var(--cols, 3) - 1) * 0.75rem); }
.shop-grid.is-reading { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0.5rem; max-width: calc(var(--cols, 3) * 10rem); }
.shop-grid.is-reading .shop-card { gap: 0.3rem; padding: 0.5rem; align-items: center; text-align: center; }
.shop-grid.is-reading .shop-card-art { height: auto; width: 100%; aspect-ratio: 1; }
.shop-grid.is-reading .shop-card-art img { max-height: 100%; }
.shop-grid.is-reading .shop-card-name { font-size: 0.8rem; line-height: 1.2; overflow-wrap: normal; }
.shop-grid.is-reading .shop-card-foot { justify-content: center; margin-top: 0; }
.shop-grid.is-reading .shop-card-foot:empty { display: none; }
.shop-grid.is-reading .pill { font-size: 0.68rem; }
.shop-card-price { font-size: 0.78rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* F-87: the ways to rent under the price, each on its own line. */
.shop-rent { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.shop-rent .inline-form { flex-wrap: wrap; }
/* A phone with 4 to a line: smaller words and room, so 150,000 stays whole. */
@container (max-width: 24rem) {
    .shop-grid.is-reading { gap: 0.3rem; }
    .shop-grid.is-reading .shop-card { padding: 0.3rem 0.15rem; border-radius: 8px; }
    .shop-grid.is-reading .shop-card-name, .shop-grid.is-reading .shop-card-price { font-size: 0.66rem; }
}
.shop-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.shop-card.is-hidden { opacity: 0.6; }
.shop-card-art { display: flex; justify-content: center; align-items: center; height: 6rem; }
.shop-card-art img { max-width: 100%; max-height: 6rem; object-fit: contain; cursor: zoom-in; }
/* Delete section, a little below the cards and off the card edge (developer, 2026-10-01). */
.shop-section-foot { display: flex; justify-content: flex-end; margin: 1rem 0 0.25rem; }
.shop-card-name { text-align: center; overflow-wrap: anywhere; }
.shop-section-name { max-width: 18rem; overflow-wrap: anywhere; }
.shop-section-meta { color: var(--text-2); font-size: 0.78rem; }
.shop-card-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 0.6rem; margin: 0.25rem 0; }
.shop-card-summary dt { color: var(--text-2); font-size: 0.75rem; }
.shop-card-summary dd { margin: 0; text-align: end; font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.shop-card-note { display: block; margin-top: 0.2rem; color: var(--text-2); font-size: 0.73rem; font-weight: 400; }
.shop-card-field { display: flex; flex-direction: column; gap: 0.35rem; }
.shop-card-field select, .shop-card-field input[type=number] { width: 100%; }
.shop-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; }
/* Shown and the item's buttons keep one line (developer, 2026-10-04). */
.shop-card-foot > label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; white-space: nowrap; }
.shop-card-foot > .icon-actions { flex-wrap: nowrap; }

/* A section's header, laid out by the section's own width, not the window's (developer, 2026-10-04:
   tried at every browser width). Widest: fold, name, Shown and Cards on a line, buttons, one line.
   Then Shown and Cards on a line under the name, then the buttons under those too. Narrow:
   everything under the fold, full width.
   Reading, Edit stays at the end of the first line and the name's line wraps on its own. */
.shop-section { container-type: inline-size; }
.shop-section-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.6rem 0.75rem;
    grid-template-areas: "fold fields actions" ". options options"; margin-bottom: 0.9rem;
}
.shop-section-head > .btn-icon { grid-area: fold; align-self: start; }
.shop-section-fields { grid-area: fields; display: flex; align-items: center; gap: 0.6rem 0.75rem; flex-wrap: wrap; min-width: 0; }
.shop-section-fields > label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.shop-section-fields > :is(input, strong) { max-width: 100%; min-width: 0; }
.shop-section-head select { width: auto; max-width: 100%; min-width: 0; }
.shop-section-head > .push-end { grid-area: actions; align-self: start; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0; }
.shop-section-options { grid-area: options; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; min-width: 0; }
.shop-section-options > label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; max-width: 100%; }
/* A small count box (developer, 2026-10-04), not a field-wide one. */
.shop-section-options select { width: auto; font-size: 0.8rem; padding: 0.3rem 1.5rem 0.3rem 0.5rem; background-position: right 0.4rem center; }
[dir="rtl"] .shop-section-options select { padding: 0.3rem 0.5rem 0.3rem 1.5rem; background-position: left 0.4rem center; }
.shop-section-head.is-editing { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "fold fields options actions"; }
@container (max-width: 70.5rem) {
    .shop-section-head.is-editing { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "fold fields actions" ". options options"; }
}
@container (max-width: 50rem) {
    .shop-section-head.is-editing { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "fold fields" ". options" ". actions"; }
    .shop-section-head.is-editing > .push-end { justify-content: flex-start; }
}
@container (max-width: 30rem) {
    .shop-section-head.is-editing { grid-template-areas: "fold fields" "options options" "actions actions"; }
    .shop-section-fields > input { flex: 1 1 8rem; }
    .shop-section-options > label { flex-wrap: wrap; white-space: normal; }
    /* The word Section gives its room to the name (the input still says it, aria-label). */
    .shop-section-fields > label.muted { display: none; }
    /* The order arrows keep the line's end, on the buttons' line or alone under it. */
    .shop-section-head.is-editing > .push-end > .reorder { margin-inline-start: auto; }
}
@container (max-width: 22rem) {
    .shop-section-head.is-editing > .push-end > .btn > svg { display: none; }
}

/* AD-99b: provider forms use their cards, two beside each other when there is room. */
/* Sign-in: one provider under the other (developer, 2026-10-04), each still as wide as when they sat
   side by side, half the row, and the whole row once two would not fit. */
.integration-stack { container-type: inline-size; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.integration-stack > .card { width: calc((100% - 1rem) / 2); min-width: 0; margin: 0; box-sizing: border-box; }
@container (max-width: 47rem) { .integration-stack > .card { width: 100%; } }
.integration-stack .stacked-form { max-width: none; margin-bottom: 0; }
.integration-single { max-width: 40rem; }
.integration-single .stacked-form, .store-column .stacked-form { max-width: none; }
/* W-24: a region of the website's payments and its ways to pay, each a block of its own. */
.payment-region { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.payment-method { border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.9rem 0.25rem; margin: 0 0 0.75rem; }
.payment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.payment-head > .btn { margin-inline-start: auto; }
.payment-region .check-line { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; }
.integration-single code.mono { overflow-wrap: anywhere; }
.payment-rate { display: grid; gap: 0.6rem; }
.payment-rate .tabs { margin: 0; }
.payment-rate-title { font-weight: 600; }
.payment-source { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.9rem; margin: 0; }
.payment-source dt { color: var(--muted); }
.payment-source dd { margin: 0; overflow-wrap: anywhere; }

/* A reason shown at once on hover (developer, 2026-10-01: the browser's own title came too late).
   On a wrapper, since a disabled button gets no mouse events. Empty data-tip shows nothing. */
.tip { position: relative; display: inline-flex; }
/* Drawn by App.razor's script on the page itself, so a scrolling card never cuts it off. */
.tip-float {
    position: fixed; z-index: 1000; max-width: 16rem; pointer-events: none;
    padding: 0.35rem 0.6rem; border-radius: 8px; font-size: 0.85rem; line-height: 1.35;
    background: var(--surface, #1b1e2b); color: var(--text, #fff); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
/* Trash (developer, 2026-10-01): a card reads name, what it was, when and by whom, a line each. */
.trash-name, .trash-line { display: block; }
.card-actions > .push-end { margin-inline-start: auto; }
/* Compact action padding leaves more room before a narrow editor needs to wrap. */
.edit-actions .btn-sm { padding-inline: 0.55rem; gap: 0.3rem; }
.edit-actions .tip { display: inline-flex; }
/* Delete is an icon at the line's end, as tall as Save, so the three keep one line on a narrow card (developer, 2026-10-04). */
.edit-actions .btn-icon { width: 2.1rem; height: auto; align-self: stretch; padding: 0; }
.edit-actions > .tip.push-end { align-self: stretch; }
.edit-actions .btn-icon > svg { width: 15px; height: 15px; }

/* A field's label with something of its own beside it (the language dropdown), on one line. */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.3rem; }
/* A System message's other languages under the English, in the Sent list. */
.message-lang { margin-top: 0.45rem; }
.message-lang .pill { font-size: 0.7rem; margin-inline-end: 0.4rem; }

/* CS-22: a discount ticket card, its share off over the corner of its picture. */
.ticket-art { position: relative; width: 180px; max-width: 100%; margin: 0 auto 0.6rem; }
.ticket-art .item-image { margin: 0; }
.ticket-art .item-image-empty svg { width: 2.2rem; height: 2.2rem; opacity: 0.5; }
.ticket-off {
    position: absolute; top: 0.45rem; inset-inline-end: 0.45rem; padding: 0.2rem 0.55rem; border-radius: 999px;
    background: var(--danger, #e5484d); color: #fff; font-weight: 700; font-size: 0.85rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.ticket-for { display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
.ticket-for svg { width: 0.95rem; height: 0.95rem; flex: none; }
.input-suffix { display: inline-flex; align-items: center; gap: 0.35rem; }

/* A field standing on its own in a card or an editor (not in a row of fields) takes the full line
   and keeps the same gap below as a row does: two of them stacked never touch (developer, 2026-10-02). */
.card > .field, .card.inset > .field, .item-card > .field { display: flex; margin-bottom: 0.75rem; }
.card > .field > select, .card.inset > .field > select { max-width: 100%; }
.edit-actions + .hint { margin-top: 0.5rem; }
/* A tile's meta line takes no room when it holds nothing (developer, 2026-10-02: a gap under the
   name), and the buttons sit at the bottom so every tile in a row lines them up. */
.gallery-tile .tile-meta { min-height: 0; }
.gallery-tile .tile-meta:not(:has(*)) { display: none; }
.gallery-tile .tile-actions { margin-top: auto; padding-top: 0.55rem; }
.gallery-tile .tile-name { margin-bottom: 0.1rem; }
/* An editor opened inside a card is not a second full card: less padding, no extra margin, so a
   narrow card keeps its width for the fields (developer, 2026-10-02). */
.item-card > .card.inset { margin: 0; padding: 0.9rem; }
/* The Sent list's message gets the room, the other columns only what they need (developer, 2026-10-02:
   a message wrapped a letter to a line). */
td.message-cell { min-width: 18rem; }
/* Legals: the title with the language dropdown on its label's line, as wide as the editor below. */
.legal-title { margin: 0.4rem 0 0.9rem; }
.legal-title > input { width: 100%; }
.legal-title .field-head .inline-form { margin: 0; }
.item-head .tile-edit .lang-pick { align-self: flex-start; }
/* The Undo and Redo toolbar sits fixed in the top corner: the page starts under it, so a button at the
   right end of a page's first line (Customize, Add) is never covered (developer, 2026-10-02). */
@media (min-width: 861px) {
    .admin-content { padding-top: 3.9rem; }
}
/* Without a subtitle under it the card's title keeps a real gap above the first field. */
.login-card h1:not(:has(+ .subtitle)) { margin-bottom: 1.25rem; }
/* A player's name stays on one line, the long id gives way and ends in "..." (developer, 2026-10-02:
   names broke over two lines beside a wide id). A default button is as tall as the box beside it. */
td .user-name { white-space: nowrap; }
td.id-cell { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn:not(.btn-sm):not(.btn-icon) { min-height: 2.35rem; }
/* In a row of boxes to type in, the row's buttons are as tall as the boxes (developer, 2026-10-02:
   a short Save beside a tall box read as misaligned). */
.inline-form:has(input:not([type=checkbox]):not([type=color]):not([type=file]), select) > .btn-sm,
.inline-form:has(input:not([type=checkbox]):not([type=color]):not([type=file]), select) > .tip > .btn-sm { min-height: 2.35rem; }

/* ---- An editor inside a card (developer, 2026-10-02) --------------------------------------------
   Gifts, expressions, tickets, packs, prizes and announcements are edited in the card they are read
   in, at the card's width. The picture where the card shows it, then every field on its own line at
   the card's full width, two short ones side by side, every label alike, the language button on the
   name's line. */
.card-editor { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; text-align: start; }
.card-editor .field { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; min-width: 0; }
.card-editor input:not([type=checkbox]):not([type=color]):not([type=file]), .card-editor select, .card-editor textarea { width: 100%; max-width: 100%; min-width: 0; }
.card-editor label.muted.sub, .card-editor .field-head > .muted {
    display: inline-flex; align-items: center; gap: 0.25rem; margin: 0;
    font-size: 0.8rem; font-weight: 600; color: var(--text-2);
}
.card-editor .field-head { margin: 0; }
.card-editor p.sub { margin: 0; }
.card-editor .field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; align-items: end; }
.card-editor .check-line { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; align-self: flex-start; }
.card-editor .field-pair > .check-line { align-self: end; padding-bottom: 0.55rem; }
.card-editor .input-suffix { display: flex; }
.card-editor .input-suffix input { flex: 1; }
.card-editor .edit-actions { margin-top: 0.15rem; }
.card-editor .edit-actions + .hint { margin: 0; }
/* The picture on top, centred like the card's own. A banner takes the card's width at 16:9. */
.card-editor-art > .picker { align-self: center; margin: 0; }
.card-editor .picker-banner { align-self: stretch; }
.card-editor .picker-banner .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
/* A gift's picture with its sound under it, an expression's two side by side. */
.card-editor .gift-pictures { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; margin: 0; }
.card-editor .gift-pictures.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1rem; }
.card-editor .gift-pictures .picker, .card-editor .gift-pictures .sound-pick { align-self: center; margin: 0; }
/* The picture's upload button hangs over its corner: the sound under it keeps clear of it. */
.card-editor .gift-pictures .picker + .sound-pick { margin-top: 0.75rem; }
.card-editor .gift-pictures.two .picker, .card-editor .gift-pictures.two .sound-pick { align-self: stretch; width: 100%; }
.card-editor .gift-pictures.two .picker .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; }

/* Phone controls stay inside their card while wide tables and game grids keep their own scroll. */
@media (max-width: 860px) {
    .admin-nav .nav-close {
        display: inline-flex; align-items: center; justify-content: center;
        width: 32px; height: 32px; flex: none; margin-inline-start: auto; padding: 0;
        border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--nav-text);
    }
    .admin-nav .nav-close svg { width: 18px; height: 18px; }
    .admin-nav .nav-close:hover { background: var(--nav-bg-2); color: var(--nav-text-hi); }

    input[type=url], input[type=date], input[type=datetime-local], input[type=time], input[type=search] { font-size: 16px; }
    .inline-form > :is(input, select, textarea, .field, .input-suffix) { max-width: 100%; min-width: 0; }
    .field > :is(input, select, textarea) { max-width: 100%; }
    .setting, .bot-names-head, .icon-actions:not(td), .edit-actions { flex-wrap: wrap; }
    .shop-grid-scroll, .card-editing .shop-grid-scroll { max-height: min(33rem, 60dvh); }
    .table-scroll.tall { max-height: min(26rem, 60dvh); }
    .scroll-list { max-height: min(28rem, 60dvh); }
    .pack-shelf { max-height: min(34rem, 60dvh); }
}

@media (max-width: 860px) and (max-height: 500px) {
    .admin-nav { overflow-y: auto; }
    .admin-nav > .brand { position: sticky; top: 0; z-index: 1; background: var(--nav-bg); }
    .admin-nav .nav-scroll { flex: none; overflow: visible; }
    .admin-nav .nav-foot { flex: none; margin-top: 0; }
}

@media (max-width: 560px) {
    .metric-head { flex-wrap: wrap; }
    .stat-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto auto; row-gap: 0.25rem; padding-block: 0.2rem; }
    .stat-rank { grid-column: 1; grid-row: 1 / 3; }
    .stat-name { grid-column: 2 / 4; grid-row: 1; }
    .stat-players { grid-column: 4; grid-row: 1; justify-self: end; }
    .stat-bar { grid-column: 2; grid-row: 2; }
    .stat-count { grid-column: 3; grid-row: 2; }
    .stat-share { grid-column: 4; grid-row: 2; }
}

@media (max-width: 380px) {
    .card-editor .gift-pictures.two { grid-template-columns: minmax(0, 1fr); }
    .card-editor .gift-pictures.two .picker, .card-editor .gift-pictures.two .sound-pick { width: min(100%, 10rem); align-self: center; }
}

/* ---- AD-105: Games, one game at a time -------------------------------------------------- */
.games-picker { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.games-pick { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.8rem 0.45rem 0.45rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: start; }
.games-pick:hover { border-color: var(--border-strong); }
.games-pick.is-current { border-color: var(--accent); background: var(--accent-soft); }
.games-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.games-pick-icon { width: 2.2rem; height: 2.2rem; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--art-ground-ink); color: #fff; }
.games-pick-gear { background: var(--art-ground); color: var(--art-ground-text); }
.games-pick-icon img { width: 1.6rem; height: 1.6rem; object-fit: contain; }
.games-pick-icon svg { width: 1.4rem; height: 1.4rem; }
.games-pick-name { display: grid; gap: 0.2rem; justify-items: start; }
.games-pick-name .pill { font-size: 0.7rem; }
.games-picker-sep { width: 1px; background: var(--border); margin-inline: 0.2rem; }
.tab-links { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding-bottom: 0.3rem; }
.tab-links a { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8rem; padding: 0.2rem 0.55rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.tab-links a svg { width: 0.8rem; height: 0.8rem; }
.games-view-title { display: flex; align-items: center; gap: 0.4rem; font-size: 1.05rem; margin: 0 0 0.8rem; }

.state-switch button.active.state-open { background: var(--success-soft); color: var(--success-ink); }
.state-switch button.active.state-closed { background: var(--warn-soft); color: var(--warn-ink); }
.state-switch button.active.state-hidden { background: var(--neutral-soft); color: var(--text); }
.state-switch button:disabled { cursor: default; }
.state-switch button:disabled:not(.active) { opacity: 0.55; }

/* AD-105a: one card. The head (name, state, language, Edit) sticks while editing, so Save is at
   hand however far down the buttons the edit went. */
.lobby-card { overflow: visible; }
.lobby-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; }
.lobby-head > h2 { margin: 0; }
.lobby-head-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
@media (min-width: 861px) {
    /* Below the Undo and Redo bar, which stays fixed at the top right. */
    .lobby-card.card-editing > .lobby-head { position: sticky; top: 3.6rem; z-index: 3; background: var(--surface); margin: -0.5rem -0.25rem 0; padding: 0.5rem 0.25rem; }
}
.lobby-ident { display: grid; grid-template-columns: auto auto minmax(0, max-content) minmax(0, 1fr); gap: 1rem 2rem; align-items: start; margin: 0.9rem 0 0.4rem; }
.lobby-tab-icon { display: grid; justify-items: center; gap: 0.35rem; }
.lobby-tab-icon .thumb { width: 72px; height: 72px; background: var(--art-ground-ink); object-fit: contain; padding: 0.6rem; }
.lobby-mark .thumb { padding: 0.3rem; }
.lobby-logo { display: grid; gap: 0.35rem; min-width: 0; justify-items: center; }
/* The label in the game's own font, with the dark edge the game draws under it, so the letter
   colours read on either ground. */
.logo-preview { display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 0.2rem 1rem; border-radius: var(--radius-sm); background: var(--art-ground); font: 400 2.6rem/1 "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; letter-spacing: 0.02em; color: #fff; text-shadow: 0 3px 0 rgba(10, 16, 34, .55), 0 0 2px rgba(10, 16, 34, .7); white-space: nowrap; max-width: 100%; overflow-x: auto; }
.logo-colours { display: inline-flex; align-items: center; gap: 0.25rem; }
.logo-colours input[type="color"], .lobby-colour input[type="color"] { width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.logo-colours input[type="color"]:disabled, .lobby-colour input[type="color"]:disabled { cursor: default; }
.logo-rich { flex: 1 1 18rem; min-width: 0; max-width: 34rem; font-size: 0.78rem; }
.lobby-label-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0.2rem 0 0.5rem; }
.lobby-label-edit > .inline-form { flex: 1 1 auto; margin: 0; }
.lobby-numbers { display: flex; flex-wrap: wrap; gap: 0.7rem 1.1rem; align-items: flex-start; min-width: 0; }
.lobby-numbers > .field { margin: 0; display: grid; gap: 0.3rem; justify-items: start; }
.lobby-turn { display: inline-flex; align-items: center; gap: 0.5rem; }
.lobby-join { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0.2rem 0 0.4rem; font-size: 0.85rem; }
.lobby-section-head { display: flex; align-items: center; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.9rem; margin: 0.9rem 0 0.7rem; }
.lobby-section-head > h3 { margin: 0; }

.lobby-buttons { display: grid; gap: 0.7rem; }
.lobby-button { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0.8rem; align-items: start; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.lobby-button > .reorder { align-self: start; }
.lobby-button.is-hidden { opacity: 0.6; }
.lobby-button-picture { border-radius: var(--radius); padding: 0.4rem; justify-self: start; }
.lobby-button-picture .picker .thumb { width: 72px; height: 72px; object-fit: contain; background: transparent; border: none; }
.lobby-button-main { display: grid; gap: 0.5rem; min-width: 0; }
.lobby-button-words { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto; gap: 0.5rem; align-items: center; }
.lobby-button-words input[type="text"] { width: 100%; min-width: 0; }
.lobby-colour { display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; margin: 0; }
.lobby-line-label { min-width: 5.2rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.mode-chip { padding: 0.25rem 0.65rem; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.mode-chip.mode-open { background: var(--success-soft); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.mode-chip.mode-closed { background: var(--warn-soft); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.mode-chip.mode-hidden { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); text-decoration: line-through; }
.mode-chip:disabled { cursor: default; }
span.mode-chip { display: inline-block; cursor: default; }
.lobby-button .tier-chips { margin-bottom: 0; min-height: 0; }
.tournaments-head { margin-bottom: 0.45rem; }

@media (max-width: 1100px) {
    .lobby-ident { grid-template-columns: auto auto minmax(0, 1fr); }
    .lobby-numbers { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .lobby-ident { grid-template-columns: auto auto; justify-content: start; }
    .lobby-logo { grid-column: 1 / -1; }
    .lobby-tab-icon { justify-items: start; }
    .lobby-button { grid-template-columns: auto minmax(0, 1fr); }
    .lobby-button > .reorder { grid-row: 1 / 3; }
    .lobby-button-main { grid-column: 1 / -1; }
    .lobby-button-words { grid-template-columns: minmax(0, 1fr) auto auto; }
    .lobby-button-words input[type="text"]:first-child { grid-column: 1 / -1; }
}

/* ---- Users: the staff and player tables share their columns ---------------------- */
.users-table { min-width: 46rem; }
.users-table .col-user { width: 30%; }
.users-table .col-id { width: 17%; }
.users-table .col-third { width: 15%; }
.users-table .col-account { width: 13%; }
.users-table .col-online { width: 13%; }
.users-table .col-actions { width: 12%; }
.users-table td:last-child { text-align: end; }

/* AD-124: Users, Deleted accounts. One table for players and staff, the reason allowed to wrap. */
/* Wider than the window: the table scrolls sideways rather than cut the date and the status. */
.table-scroll > .deleted-table { min-width: 58rem; }
.deleted-table .col-user { width: 17%; }
.deleted-table .col-by { width: 12%; }
.deleted-table .col-reason { width: 14%; }
.deleted-table .col-date { width: 11%; }
.deleted-table .col-status { width: 17%; }
.deleted-table .col-money { width: 8%; }
.deleted-table .col-actions { width: 13%; }
/* The date and the status pill are read whole, never cut: the reason is the column that gives way. */
.deleted-table td .pill { white-space: nowrap; }
.deleted-table .deleted-id { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.deleted-table .deleted-id .copy-btn { margin-inline-start: 0; }
.deleted-table .deleted-reason { overflow-wrap: anywhere; }
.deleted-table td:last-child .card-actions { justify-content: flex-end; }
.deleted-table .confirm-box { margin: 0.5rem 0 0; text-align: start; }
/* Restore and its ask, the same on the list and on the account's page. The reason takes what room there is. */
.deleted-ask .inline-form { margin-bottom: 0; }
.deleted-ask input[type="text"] { flex: 1 1 12rem; min-width: 0; }
/* AD-124: the top of a deleted account's page while it waits. A notice, not an error. */
.deletion-banner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.6rem 0.9rem; margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn-ink); }
.deletion-banner > svg { width: 1.2rem; height: 1.2rem; flex: none; margin-top: 0.15rem; }
.deletion-banner-body { flex: 1 1 16rem; min-width: 0; display: grid; gap: 0.2rem; }
.deletion-banner-body .muted { color: inherit; opacity: 0.85; }
.deletion-banner-reason { overflow-wrap: anywhere; }
.deletion-banner-actions { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.deletion-banner-actions .confirm-box { margin: 0.5rem 0 0; color: var(--text); }
/* Deleted for good: the few facts that stay, under the notice. */
.tombstone .tombstone-grid { width: min(100%, 40rem); margin-top: 0.8rem; text-align: start; }

/* ---- Games, Settings: two columns (developer, 2026-10-05) ------------------------- */
.settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; align-items: start; }
.settings-column { display: grid; min-width: 0; }
.settings-columns .settings-grid { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); }
@media (max-width: 1180px) {
    .settings-columns { grid-template-columns: minmax(0, 1fr); }
}
.settings-columns .setting input[type=number] { width: 5.5rem; }
.settings-columns .setting input[type=number].wide { width: 8.5rem; }
.settings-columns .setting input[type=text] { flex: 1; min-width: 0; }
.rule-picture-ref-row { display: flex; align-items: center; justify-content: center; gap: 0.25rem; max-width: 100%; }
.rule-picture-ref-row .copy-btn { width: 26px; height: 26px; margin: 0; }
.rule-picture-ref-row .rule-picture-ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 0.72rem; }
.users-table .compact-id { align-items: center; }

/* AD-114: a match drawn as its board (MatchBoard, LudoBoard, DominoTable), on the live page and the replay. */
.match-board { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 0.75rem; }
@media (max-width: 900px) { .match-board { grid-template-columns: minmax(0, 1fr); } }
.ludo-board { width: 100%; max-width: 30rem; height: auto; display: block; }
.lb-frame { fill: var(--surface-2); }
.lb-cell { fill: #f7f7f4; stroke: #2a2d36; stroke-width: 0.04; }
.lb-yard { fill: #f7f7f4; }
.lb-corner.is-empty { opacity: 0.35; }
.lb-safe { fill: #8a8f9c; font-size: 0.62px; text-anchor: middle; }
.lb-pawn circle { stroke: #fff; stroke-width: 0.08; filter: drop-shadow(0 0.04px 0.05px rgba(0, 0, 0, 0.5)); }
.lb-pawn text { fill: #fff; font-weight: 700; text-anchor: middle; }
.lb-pawn.is-moved circle { stroke: #111; stroke-width: 0.12; }
.board-seats { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.board-seat { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); min-width: 0; }
.board-seat.is-turn { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.board-seat.is-out { opacity: 0.5; }
.seat-swatch { flex: none; width: 14px; height: 14px; margin-top: 0.2rem; border-radius: 50%; }
.seat-words { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.seat-words strong { overflow-wrap: anywhere; }
.seat-pills { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.seat-pills:empty { display: none; }
.seat-dice { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.die { width: 26px; height: 26px; }
.die rect { fill: #f7f7f4; stroke: #2a2d36; stroke-width: 0.05; }
.die circle { fill: #1c1f27; }
.domino-board { grid-template-columns: minmax(0, 1fr); }
.domino-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; color: var(--text-2); font-size: 0.85rem; }
.domino-facts strong { color: var(--text); font-variant-numeric: tabular-nums; }
.domino-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0.75rem; border-radius: var(--radius); background: #1d5c3a; min-height: 4.5rem; }
.domino-line .muted { color: #cfe3d6; }
.bone { width: 64px; height: 32px; flex: none; }
.bone.is-double { width: 32px; height: 64px; }
.bone.is-small { width: 40px; height: 20px; }
.bone-face { fill: #f7f5ee; stroke: #2a2d36; stroke-width: 0.05; }
.bone-split { stroke: #2a2d36; stroke-width: 0.05; }
.bone-pip { fill: #1c1f27; }
.bone.is-moved .bone-face { stroke: #f2b705; stroke-width: 0.12; }
.domino-hand { display: flex; flex-wrap: wrap; gap: 3px; }
.bone-back { width: 12px; height: 22px; border-radius: 3px; background: var(--muted); opacity: 0.6; }
/* G-27: chess (ChessBoard), white at the bottom, the shipped board's two woods. */
.chess-board { width: 100%; max-width: 30rem; height: auto; display: block; }
.cb-light { fill: #eedcb8; }
.cb-dark { fill: #9c6b45; }
.cb-last.cb-light { fill: #f3e08a; }
.cb-last.cb-dark { fill: #c9a640; }
.cb-check { fill: none; stroke: #e5484d; stroke-width: 0.08; }
.cb-piece { font-size: 0.82px; text-anchor: middle; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; }
.cb-piece.is-white { fill: #fffdf5; stroke: #3b2f22; stroke-width: 0.03; paint-order: stroke; }
.cb-piece.is-black { fill: #1c1f26; }
.cb-coord { fill: var(--text-2); font-size: 0.26px; text-anchor: middle; }
.cb-swatch-white { background: #fffdf5; border: 1px solid #3b2f22; }
.cb-swatch-black { background: #1c1f26; }
.chess-moves { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; max-height: 12rem; overflow-y: auto; }
.chess-move { white-space: nowrap; }
/* G-28: pool (PoolBoard), the table on its side, kitchen left, the shipped table's wood and cloth. */
.pool-board { grid-template-columns: minmax(0, 1fr); }
.pool-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; color: var(--text-2); font-size: 0.85rem; }
.pool-facts strong { color: var(--text); font-variant-numeric: tabular-nums; }
.pool-table { width: 100%; max-width: 56rem; height: auto; display: block; }
.pt-rail { fill: #8f5a2e; }
.pt-cushion { fill: #156b3a; }
.pt-felt { fill: #1f8a4c; }
.pt-nose { stroke: #0f4f2a; stroke-width: 0.5; stroke-linecap: round; }
.pt-pocket { fill: #050505; }
.pt-string { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.35; stroke-dasharray: 1.5 1.5; }
.pt-spot { fill: rgba(255, 255, 255, 0.55); }
/* Where the cue ball may be placed (ball in hand): orange, its own colour, named in the note above the table. */
.pt-zone { fill: rgba(251, 191, 36, 0.12); stroke: #fbbf24; stroke-width: 0.6; stroke-dasharray: 2.4 1.4; }
.pt-ghost { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 0.3; stroke-dasharray: 0.8 0.6; }
.pt-target { fill: none; stroke: #f2b705; stroke-width: 0.6; }
.pt-ball-edge { fill: none; stroke: rgba(0, 0, 0, 0.45); stroke-width: 0.08; }
.pt-number { fill: #1c1f27; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: system-ui, sans-serif; }
.pool-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; }
.pool-chip { width: 1.35rem; height: 1.35rem; flex: none; }
.pool-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; color: var(--text-2); font-size: 0.85rem; }
.pool-notes li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.pool-notes strong { color: var(--text); }
.pool-key { width: 2.2rem; height: 1.3rem; flex: none; }
.replay-controls .replay-speed { width: auto; min-width: 4.5rem; }

/* INV-19: an item's rarity. Its shape and colour together (a circle, a diamond, a hexagon, a star). */
.rarity-common { --rarity: var(--rarity-common); }
.rarity-rare { --rarity: var(--rarity-rare); }
.rarity-epic { --rarity: var(--rarity-epic); }
.rarity-legendary { --rarity: var(--rarity-legendary); }
/* INV-20: the cut gems carry their own colours and a dark outline, a little bigger so their facets read. */
.rarity-gem { width: 1.05rem; height: 1.05rem; flex: none; }
.pill-rarity { background: color-mix(in srgb, var(--rarity) 15%, transparent); color: var(--rarity); }
.pill-rarity::before { display: none; }
.pill-rarity .rarity-gem { width: 0.9rem; height: 0.9rem; }
.rarity-picker { display: grid; gap: 0.3rem; width: 100%; align-self: stretch; }
/* A narrow tile (a Gallery picture) keeps the marks and names them on hover. */
.rarity-picker { container-type: inline-size; }
@container (max-width: 210px) { .rarity-picker .rarity-word { display: none; } .rarity-picker .segmented button { padding-block: 0.4rem; } .rarity-picker .segmented button .rarity-gem { width: 1rem; height: 1rem; } }
.rarity-picker .segmented { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
/* The mark over the word, so four fit a narrow card (a skin card is 280 px) without cutting Legendary. */
.rarity-picker .segmented button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 0.3rem 0.15rem; font-size: 0.72rem; line-height: 1.1; white-space: nowrap; min-width: 0; }
.rarity-picker .segmented button.active { color: var(--text); box-shadow: inset 0 -2px 0 currentColor, 0 1px 2px rgba(0,0,0,.12); }
.rarity-picker .segmented button.active:has(.rarity-common) { color: var(--rarity-common); }
.rarity-picker .segmented button.active:has(.rarity-rare) { color: var(--rarity-rare); }
.rarity-picker .segmented button.active:has(.rarity-epic) { color: var(--rarity-epic); }
.rarity-picker .segmented button.active:has(.rarity-legendary) { color: var(--rarity-legendary); }
/* Tabs with something at their end (a filter, a "?"): the line runs under both. INV-19: the rarity
   dropdown sits at the right of the tabs it filters (developer, 2026-10-21). */
.tabs-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: -0.3rem 0 1.1rem; border-bottom: 1px solid var(--border); }
.tabs-bar > .tabs { flex: 1 1 auto; margin: 0; border-bottom: 0; }
.slot-bar { margin: -0.35rem 0 0.9rem; }
/* A slot tab and its "?" are one tab (developer, 2026-10-21): one underline, one hover, the "?" inside its right edge. */
.slot-tab { display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: border-color .12s ease; }
.slot-tab:has(.tab-active) { border-bottom-color: var(--accent); }
.slot-tab > .tab { border-bottom: 0; margin-bottom: 0; padding-inline-end: 0.2rem; }
.slot-tab > .help { margin-inline: 0 0.55rem; width: 18px; height: 18px; }
.slot-tab > .help > svg { width: 14px; height: 14px; }
.slot-tab:hover > .tab { color: var(--text); }
.slot-tab:has(.tab-active) > .help { color: var(--accent-ink, var(--accent)); }
/* A compact button that opens a short list, each row with its mark and count (developer, 2026-10-21:
   the plain select was too wide and showed no marks). */
.rarity-filter { position: relative; margin-block: 0 0.3rem; margin-inline-start: auto; }
.rarity-pick, .rarity-option {
    display: flex; align-items: center; gap: 0.45rem; font: inherit; color: var(--text); cursor: pointer;
}
.rarity-pick {
    padding: 0.32rem 0.55rem 0.32rem 0.6rem; border-radius: 999px; font-size: 0.84rem; font-weight: 600;
    background: var(--surface); border: 1px solid var(--border); transition: border-color .12s ease, background .12s ease;
}
.rarity-pick:hover, .rarity-pick[aria-expanded=true] { border-color: var(--border-strong); background: var(--surface-2); }
.rarity-pick:focus-visible, .rarity-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rarity-pick > svg:last-child { width: 0.9rem; height: 0.9rem; color: var(--muted); transition: transform .15s ease; }
.rarity-pick[aria-expanded=true] > svg:last-child { transform: rotate(180deg); }
.rarity-count { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--muted); font-size: 0.78rem; }
.rarity-pick .rarity-count { padding: 0 0.4rem; border-radius: 999px; background: var(--surface-sunken); }
.rarity-backdrop { position: fixed; inset: 0; z-index: 900; }
.rarity-menu {
    position: absolute; z-index: 901; inset-inline-end: 0; top: calc(100% + 0.35rem); min-width: 12rem; padding: 0.3rem;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.rarity-option {
    width: 100%; padding: 0.42rem 0.55rem; border: 0; border-radius: calc(var(--radius) - 2px);
    background: transparent; font-size: 0.86rem; text-align: start;
}
.rarity-option:hover { background: var(--surface-sunken); }
.rarity-option.rarity-on { background: var(--accent-wash); }
.rarity-option .rarity-name { flex: 1 1 auto; }
.rarity-tick { display: inline-flex; width: 1rem; color: var(--accent); }
.rarity-tick svg { width: 1rem; height: 1rem; }
/* All: the four marks together in one square, the size of one gem. */
.rarity-all { display: inline-grid; grid-template-columns: repeat(2, 0.55rem); gap: 0.04rem; flex: none; }
.rarity-all .rarity-gem { width: 0.55rem; height: 0.55rem; }

/* ---- AD-115 Audio: a row per sound slot, what it is, its file, and in Edit its buttons ---- */
.audio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.audio-head .hint { margin: 0; flex: 1 1 18rem; }
.audio-head-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; align-items: center; margin-inline-start: auto; }
.audio-list { display: flex; flex-direction: column; }
.audio-row {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem) auto; gap: 0.5rem 1rem; align-items: center;
    padding: 0.6rem 0.2rem; border-top: 1px solid var(--border);
}
.audio-row:first-child { border-top: 0; }
.audio-row.is-changed { background: var(--accent-soft); border-radius: 0.5rem; padding-inline: 0.6rem; }
.audio-what { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.audio-what strong { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.audio-what .sub { font-size: 0.8rem; }
.audio-scope { font-weight: 600; }
.audio-scope::before { display: none; }
.audio-file { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.audio-file .sound-player { height: 2.3rem; }
.audio-file .sound-preview { flex: none; }
.audio-size { font-size: 0.72rem; font-variant-numeric: tabular-nums; padding-inline-start: 0.6rem; }
.sound-file-new { font-weight: 650; color: var(--accent-ink, var(--accent)); }
.audio-actions { display: flex; align-items: center; gap: 0.35rem; justify-content: flex-end; flex-wrap: wrap; }
.audio-actions .sound-upload { white-space: nowrap; }
.audio-actions .sound-upload.disabled { opacity: 0.5; pointer-events: none; }
.audio-keep:hover { color: var(--accent); }
/* AD-127: a theme's tracks in the order they play, a wider column for the buttons each one has in Edit. */
.audio-row-theme { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem) auto; align-items: start; }
.audio-row-theme .audio-file { gap: 0.5rem; }
.audio-track { display: flex; align-items: flex-start; gap: 0.4rem; min-width: 0; }
.audio-track-no { flex: none; width: 1.1rem; line-height: 2.3rem; text-align: center; font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.audio-track-file { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.audio-track-actions { flex: none; display: inline-flex; align-items: center; height: 2.3rem; }
.audio-track-actions .sound-remove { margin-inline-start: 0; }
.audio-track-actions .sound-remove:disabled { opacity: 0.3; }
@media (max-width: 720px) {
    .audio-row, .audio-row-theme { grid-template-columns: minmax(0, 1fr); }
    .audio-actions { justify-content: flex-start; }
}

/* AD-116: the Tips page, one row per tip under the Audio page's head. */
.tips-list { display: flex; flex-direction: column; }
.tips-row {
    display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.4rem 0.9rem; align-items: center;
    padding: 0.55rem 0.2rem; border-top: 1px solid var(--border);
}
.tips-row:first-child { border-top: 0; }
.tips-row.is-changed { background: var(--accent-soft); border-radius: 0.5rem; padding-inline: 0.6rem; }
.tips-row.is-off .tips-text > span:first-child { opacity: 0.55; }
.tips-number { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.8rem; text-align: end; }
.tips-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.tips-text input { width: 100%; }
.tips-count { font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.tips-under { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tips-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.tips-actions .check-line { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; white-space: nowrap; }
@media (max-width: 720px) {
    .tips-row { grid-template-columns: 1.6rem minmax(0, 1fr); }
    .tips-actions { grid-column: 2; justify-content: flex-start; }
}

/* V-09, AD-130: the Chat filter page, a chip a word, the remove inside it. */
.filter-words { margin-top: 0.4rem; }
.filter-word { cursor: default; padding-inline-end: 0.45rem; }
.filter-remove {
    display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; padding: 0;
    border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.filter-remove:hover { background: var(--danger-soft); color: var(--danger-ink); }
.filter-remove svg { width: 12px; height: 12px; }
.filter-add { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.filter-add input { flex: 1 1 16rem; min-width: 0; }
.filter-try-input { width: 100%; }
.filter-try { margin: 0.6rem 0 0.2rem; padding: 0.55rem 0.75rem; border-radius: 0.5rem; background: var(--surface-2, var(--accent-soft)); overflow-wrap: anywhere; }

/* AD-131: a report's chat. The reported player's lines marked, a starred line opens to the words as typed. */
.report-chat { margin: 0.3rem 0 0.8rem; }
.report-chat h3 { font-size: 0.9rem; margin: 0.4rem 0; }
.report-chat h3 .mono { margin-inline-start: 0.45rem; }
/* Who was in it, once on top: name and ID. */
.report-chat-members { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.9rem; margin: 0 0 0.5rem; padding-bottom: 0.45rem; border-bottom: 1px solid var(--border); }
.report-chat-member { white-space: nowrap; }
.report-chat-member .mono { font-size: 0.78rem; margin-inline-start: 0.2rem; }
.report-chat-member.is-reported bdi { color: var(--danger-ink); font-weight: 600; }
.report-chat-day { font-size: 0.75rem; text-align: center; margin: 0.6rem 0 0.2rem; }
/* A name only where the writer changes, their lines under it with the time after each. */
.report-chat-name { margin: 0.55rem 0 0.1rem; padding-inline-start: 0.5rem; font-weight: 600; font-size: 0.86rem; }
.report-chat-name.is-reported { color: var(--danger-ink); }
.report-chat-line {
    display: flex; align-items: baseline; gap: 0.6rem; padding: 0.15rem 0.5rem; border-inline-start: 3px solid transparent;
}
/* A side mark, not a red ground: the starred words shown in red must stand out on it. */
.report-chat-line.is-reported { border-inline-start-color: var(--danger); }
.report-chat-time { font-size: 0.72rem; white-space: nowrap; font-variant-numeric: tabular-nums; margin-inline-start: auto; }
.report-chat-text { overflow-wrap: anywhere; text-align: start; min-width: 0; }
button.report-chat-text {
    border: 1px dashed var(--border); border-radius: 0.35rem; background: transparent; color: inherit; font: inherit;
    padding: 0.05rem 0.4rem; cursor: pointer;
}
button.report-chat-text:hover { border-color: var(--danger); }
.report-chat-word { color: var(--danger); font-weight: 700; }

/* ---- AD-121: give and take on an account ------------------------------------- */

.account-change { display: flex; flex-direction: column; gap: 0.6rem; }
.account-dir { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.account-dir button { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.8rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.account-dir button.on.give { background: var(--success-soft); color: var(--success-ink); }
.account-dir button.on.take { background: var(--danger-soft); color: var(--danger-ink); }
.account-lines { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.account-line { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.22rem 0.4rem 0.22rem 0.65rem; border-radius: 999px; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.account-line.give { background: var(--success-soft); color: var(--success-ink); }
.account-line.take { background: var(--danger-soft); color: var(--danger-ink); }
.account-line .sign { font-family: var(--mono, monospace); font-weight: 800; }
.account-line-x { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: 0.7; }
.account-line-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.account-line-x svg { width: 0.8rem; height: 0.8rem; }
.account-mood { display: flex; align-items: center; gap: 0.4rem; margin: 0; }

/* AD-122: the Notifications page. A four-step editor like Unity's, a phone as the preview, a month calendar. */
.short-input { width: 5rem; }
.notice-card p { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
.notice-card svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--warn-ink); }
.push-editor { padding: 0; overflow: hidden; }
.push-editor-head { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.push-editor-head h2 { margin: 0; }
.push-editor-body { display: flex; min-height: 26rem; }
.push-steps { list-style: none; margin: 0; padding: 1.2rem 1rem; flex: 0 0 13rem; border-inline-end: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 0.4rem; }
.push-steps button { display: flex; align-items: center; gap: 0.6rem; width: 100%; background: none; border: 0; padding: 0.5rem 0.4rem;
    color: var(--muted); font: inherit; cursor: pointer; border-radius: 0.5rem; text-align: start; }
.push-steps button:hover { background: var(--surface-2); }
.push-steps .is-current button { color: inherit; font-weight: 600; }
.push-steps .is-done button { color: inherit; }
.push-step-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; flex: none;
    background: var(--surface-sunken); color: var(--muted); }
.is-current .push-step-dot { background: var(--accent); color: #fff; }
.is-done .push-step-dot { background: var(--success-soft); color: var(--success-ink); }
.push-step { flex: 1 1 auto; min-width: 0; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.push-step h3 { margin: 0; }
.push-editor-actions { padding: 0.8rem 1.2rem; margin: 0; border-top: 1px solid var(--border); }
.push-editor-gap { flex: 1 1 auto; }
.push-targets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.push-target { display: inline-flex; align-items: center; gap: 0.3rem; }
.push-segments { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; }
.push-segment { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
    border-radius: 0.6rem; cursor: pointer; }
.push-segment.is-on { border-color: var(--accent); background: var(--accent-soft); }
.push-segment > span { display: flex; flex-direction: column; gap: 0.1rem; }
.push-content { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.push-content > .stacked-form { flex: 1 1 22rem; min-width: 0; }
.push-test { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border: 1px dashed var(--border); border-radius: 0.6rem; }
.push-preview { flex: 0 1 18rem; display: flex; justify-content: center; }
.push-screen { width: 17rem; min-height: 24rem; border-radius: 2rem; padding: 2.4rem 0.7rem 1rem; border: 0.45rem solid var(--surface-sunken);
    background: linear-gradient(160deg, #6d8fd9, #2f4fb8 60%, #1d2f7a); }
.push-phone { background: rgba(255, 255, 255, 0.86); color: #1a1d24; border-radius: 1rem; padding: 0.7rem 0.8rem;
    display: flex; flex-direction: column; gap: 0.2rem; overflow-wrap: anywhere; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.push-phone img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 0.6rem; margin-top: 0.4rem; }
.push-head { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: #555b66; }
.push-head svg { width: 0.95rem; height: 0.95rem; }
.push-head .muted { margin-inline-start: auto; color: #6b7280; }
.push-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem; }
.push-kind { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 0.7rem;
    background: var(--surface-2); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.push-kind.is-on { border-color: var(--accent); background: var(--accent-soft); }
.push-kind:disabled { cursor: default; opacity: 0.7; }
.push-kind svg { width: 1.1rem; height: 1.1rem; }
.push-when { align-items: flex-end; }
.push-when label { display: flex; flex-direction: column; gap: 0.25rem; }
.push-warning { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: 0.6rem;
    background: var(--warn-soft); color: var(--warn-ink); }
.push-warning svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.15rem; }
.row-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.push-cal-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.push-cal-head h2 { margin: 0 0.6rem 0 0; min-width: 11rem; }
.push-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border);
    border-radius: 0.6rem; overflow: hidden; }
.push-cal-dow { background: var(--surface-2); padding: 0.35rem 0.5rem; font-size: 0.8rem; color: var(--muted); }
.push-cal-day { background: var(--surface); min-height: 6.2rem; padding: 0.35rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.push-cal-day.is-empty { background: var(--surface-2); }
.push-cal-day.is-today .push-cal-num { background: var(--accent); color: #fff; }
.push-cal-num { align-self: flex-start; font-size: 0.8rem; padding: 0 0.35rem; border-radius: 0.6rem; }
.push-cal-chip { display: block; width: 100%; text-align: start; border: 0; border-radius: 0.35rem; padding: 0.15rem 0.4rem; font: inherit;
    font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    background: var(--info-soft); color: var(--info-ink); }
.push-status-draft { background: var(--neutral-soft); color: var(--neutral-ink); }
.push-status-running { background: var(--success-soft); color: var(--success-ink); }
.push-status-finished { background: var(--surface-2); color: var(--muted); }
.push-status-stopped { background: var(--neutral-soft); color: var(--neutral-ink); text-decoration: line-through; }
.push-texts { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.8rem; }
.push-text-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }
.push-text-row:last-child { border-bottom: none; padding-bottom: 0; }
.push-text-name { flex: 0 1 15rem; min-width: 12rem; display: flex; flex-direction: column; gap: 0.25rem; }
.push-text-words { flex: 1 1 22rem; display: flex; flex-direction: column; gap: 0.4rem; }
@media (max-width: 760px) {
    .push-editor-body { flex-direction: column; }
    .push-steps { flex: none; flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 0.6rem; }
    .push-steps button { white-space: nowrap; }
    .push-cal-day { min-height: 4.5rem; }
}

/* W-21b: the menu's background, a square picture with what it is under it. */
.menu-background { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; margin-bottom: 0.4rem; }
.menu-background .picker-lg .thumb { width: 220px; height: 220px; object-fit: cover; }

/* AD-128: the Web page. */
.web-actions { justify-content: flex-end; margin-bottom: 0.75rem; }
.web-rows { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.web-row { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem; border-radius: 12px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.web-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.web-words { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0.6rem; margin-top: 0.5rem; }
.web-words .field { display: flex; min-width: 0; }
.web-words input, .web-words textarea { width: 100%; resize: vertical; }
.web-feature { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
.web-feature-words { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.web-feature-words .web-words { margin-top: 0; }
.web-feature-tools { display: flex; align-items: center; gap: 4px; }
/* W-21i: the Web page's links, the game's pictures (tall like a phone), the trailer and the top players. */
.web-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0.6rem; margin-top: 0.5rem; }
.web-links .field { display: flex; min-width: 0; }
.web-links input { width: 100%; }
.web-social .sub { display: inline-flex; align-items: center; gap: 6px; }
.web-social-icon { display: inline-flex; width: 18px; height: 18px; color: var(--accent, #d6ad60); }
.web-social-icon svg { width: 100%; height: 100%; }
.web-shots { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; align-items: flex-start; }
.web-shot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.picker-phone .thumb { width: 108px; height: 234px; object-fit: cover; border-radius: 14px; }
.web-shot-add { width: 108px; height: 234px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, currentColor 35%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-align: center; font-size: 0.85rem; padding: 0 8px; }
.web-shot-add:hover { border-color: var(--accent, #d6ad60); }
.web-video { display: flex; margin-top: 0.9rem; max-width: 640px; }
.web-video input { width: 100%; }
.web-period { display: inline-flex; flex-direction: column; min-width: 180px; }
.web-visits { margin-top: 1rem; }

/* F-17 (ADR 230): a player's album on User detail, and a photo in a request. */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.75rem; }
.album-photo { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-sunken); border: 1px solid var(--border); }
.album-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-photo .btn-icon { position: absolute; top: 0.375rem; inset-inline-end: 0.375rem; }
.request-photo { width: 6rem; height: 6rem; object-fit: cover; border-radius: var(--radius-sm); display: block; }
