/* Union UI -- wayfinding-inspired design system for FunAnanas's non-game
 * routes: the sign-in door (`/`, views/index.hbs) and the lobby concourse
 * (`/m`, `/m/industry`, `/m/wiggle` -- views/m.hbs, *-lobby.hbs). Named
 * after, and modelled on, Toronto Union Station's own wayfinding: light
 * theme is the Great Hall by day (limestone, brass), dark is the Concourse
 * at night (ink, glowing amber) -- same tokens, same meanings, different
 * light, the way the real building reads under two different exposures.
 *
 * Scope is enforced by `[data-shell="union"]`, on <body> (set from `shell`
 * in the page props -- see src/index.ts's pageProperties()) or on the <div>
 * that views/layouts/main.hbs wraps its header and drawers in. Every
 * selector below is scoped under that attribute, so this file loads
 * globally (same as phosphor-terminal.css and friends). A match page
 * (views/industry.hbs, wiggle.hbs) sets no shell on <body>: there only the
 * header and the two drawers are Union's, and the page under them keeps its
 * own look.
 *
 * Component classes use a `uu-` prefix, mirroring industry-terminal.css's
 * `ic-` convention. Structural spacing (flex/grid/gap) on the pages that use
 * these still comes from Tailwind utilities where available; this file
 * otherwise sets color, typography and border/shape. The public pages
 * (views/layouts/public.hbs) are laid out by their own `.uu-public-*`
 * classes below.
 */

/* Cinzel (display) and Overpass (body/UI) are self-hosted variable fonts,
 * converted to .woff the same way IBM Plex Mono/Sans already are (see
 * industry-terminal.css's header comment) -- one file covers the whole weight
 * range via `font-weight: <min> <max>` instead of one file per static
 * weight, since both ship as a single variable-font source. IBM Plex Mono
 * itself needs no new @font-face here -- fonts.css declares it and both
 * layouts load that, so it's simply reused for Union UI's tabular data
 * (lobby codes, player counts, timestamps).
 */
@font-face {
    font-family: Cinzel;
    src: url('/assets/fonts/Cinzel/Cinzel-Variable.woff') format('woff');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Overpass;
    src: url('/assets/fonts/Overpass/Overpass-Variable.woff') format('woff');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:is(body, div)[data-shell="union"] {
    --uu-surface: #f3ecdc;
    --uu-surface-raised: #faf5e9;
    --uu-surface-sunken: #e9e0cb;
    --uu-ink: #2a2018;
    --uu-ink-muted: #6d5f4c;
    --uu-brass: #a9793a;
    --uu-brass-strong: #8a5f28;
    --uu-brass-hover: #7a5322;
    --uu-line: #d9cbab;

    /* Industry's and Wiggle's lobby status is only ever "lobby" (waiting
     * for players) or "play" (already under way) -- see
     * packages/core/src/lobby.ts's list(), which echoes BaseGame._status
     * verbatim. "Boarding" and "Underway" below are that pair's wayfinding
     * names; views/lobby.hbs's statusLabel() maps the other kinds' own
     * statuses onto the same two colours. */
    --uu-status-boarding: #8f5a14;
    --uu-status-underway: #5a6b73;

    /* One accent per game, the way GO/UP/TTC/VIA share one hall but keep
     * distinct signage colours: --uu-line-<kind>, in both schemes, comes
     * from each game's manifest.json by way of /lines.css (src/signs.ts),
     * which also sets --uu-mark to it on anything classed uu-line-<kind>.
     * So this file names no game. */

    /* Four in a Row's two discs: the first seat's and the second's. */
    --uu-disc-a: #b0452f;
    --uu-disc-b: #2b5a70;

    /* Minesweeper's numbers, 1 to 6. Each clears AA on a raised surface. */
    --uu-mines-n1: #3a6b86;
    --uu-mines-n2: #4f6e45;
    --uu-mines-n3: #9c4630;
    --uu-mines-n4: #6b4a7a;
    --uu-mines-n5: #8a5f28;
    --uu-mines-n6: #2f6f68;

    --uu-font-display: 'Cinzel', 'Times New Roman', georgia, serif;
    --uu-font-body: 'Overpass', 'Helvetica Neue', arial, sans-serif;
    --uu-font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
}

@media (prefers-color-scheme: dark) {
    :is(body, div)[data-shell="union"] {
        --uu-surface: #17130e;
        --uu-surface-raised: #221c14;
        --uu-surface-sunken: #0f0c08;
        --uu-ink: #ede2ca;
        --uu-ink-muted: #ac9c81;
        --uu-brass: #cc9a4f;
        --uu-brass-strong: #e3b564;
        --uu-brass-hover: #cc9a4f;
        --uu-line: #3a3225;

        --uu-status-boarding: #dfa03c;
        --uu-status-underway: #8fa3ab;

        --uu-disc-a: #e0705a;
        --uu-disc-b: #6fb3cf;

        --uu-mines-n1: #7fa4b7;
        --uu-mines-n2: #86ab77;
        --uu-mines-n3: #e08a72;
        --uu-mines-n4: #b497c4;
        --uu-mines-n5: #e3b564;
        --uu-mines-n6: #6fbfb3;
    }
}

/* ---------- base ---------- */

:is(body, div)[data-shell="union"] {
    background: var(--uu-surface);
    color: var(--uu-ink);
    font-family: var(--uu-font-body);
}

:is(body, div)[data-shell="union"] a {
    color: inherit;
}

:is(body, div)[data-shell="union"] code {
    font-family: var(--uu-font-mono);
    background: var(--uu-surface-sunken);
    padding: 0.1em 0.4em;
    font-size: 0.9em;
}

/* ---------- typography ---------- */

:is(body, div)[data-shell="union"] .uu-wordmark {
    font-family: var(--uu-font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--uu-ink);
}

:is(body, div)[data-shell="union"] .uu-user-line {
    font-family: var(--uu-font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--uu-ink-muted);
    text-transform: uppercase;
}

:is(body, div)[data-shell="union"] .uu-icon-btn {
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-icon-btn:hover {
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-eyebrow {
    font-family: var(--uu-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--uu-brass-strong);
    margin: 0 0 8px;
}

:is(body, div)[data-shell="union"] .uu-lede {
    color: var(--uu-ink-muted);
    max-width: 58ch;
}

/* ---------- panels ---------- */

:is(body, div)[data-shell="union"] .uu-panel {
    background: var(--uu-surface-raised);
    border: 1px solid var(--uu-line);
    border-top: 3px solid var(--uu-brass);
}

:is(body, div)[data-shell="union"] .uu-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--uu-line);
    font-family: var(--uu-font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--uu-brass-strong);
}

/* ---------- buttons ---------- */

:is(body, div)[data-shell="union"] .uu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    font-family: var(--uu-font-body);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.7em 1.2em;
    border: none;
    border-radius: 0;
    cursor: pointer;
    background: transparent;
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

:is(body, div)[data-shell="union"] .uu-btn-primary {
    /* brass-strong, not brass, as the resting fill -- light text on plain
     * brass only clears 3.52:1 (WCAG's large-text floor, not normal-text
     * AA); brass-strong clears 5.15:1. Hover is --uu-brass-hover, which
     * keeps the label at AA in both schemes: a pointer resting on a button
     * is when its label is being read. */
    background: var(--uu-brass-strong);
    color: var(--uu-surface-raised);
}

:is(body, div)[data-shell="union"] .uu-btn-primary:hover:not(:disabled) {
    background: var(--uu-brass-hover);
}

:is(body, div)[data-shell="union"] .uu-btn-secondary {
    background: transparent;
    color: var(--uu-ink);
    border: 1.5px solid var(--uu-ink);
}

:is(body, div)[data-shell="union"] .uu-btn-secondary:hover:not(:disabled) {
    background: var(--uu-surface-sunken);
}

:is(body, div)[data-shell="union"] .uu-btn-discord {
    width: 100%;
    background: var(--uu-ink);
    color: var(--uu-surface);
}

:is(body, div)[data-shell="union"] .uu-btn-discord:hover:not(:disabled) {
    background: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-btn-signin-next {
    margin-top: 0.5rem;
}

:is(body, div)[data-shell="union"] .uu-btn:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: 2px;
}

/* ---------- form fields ---------- */

:is(body, div)[data-shell="union"] .uu-input {
    font-family: var(--uu-font-body);
    font-size: 0.95rem;
    background: var(--uu-surface);
    color: var(--uu-ink);
    border: 1px solid var(--uu-line);
    border-radius: 0;
    padding: 0.6em 0.8em;
}

:is(body, div)[data-shell="union"] .uu-input:focus-visible {
    outline: none;
    border-color: var(--uu-brass);
    box-shadow: 0 0 0 1px var(--uu-brass);
}

:is(body, div)[data-shell="union"] .uu-input::placeholder {
    color: var(--uu-ink-muted);
}

/* ---------- status tags ---------- */

:is(body, div)[data-shell="union"] .uu-status-tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--uu-font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3em 0.6em;
    border: 1px solid var(--uu-line);
    border-left-width: 4px;
    background: var(--uu-surface);
    animation: uu-flap 0.25s ease both;
}

:is(body, div)[data-shell="union"] .uu-status-tag.uu-status-boarding {
    border-left-color: var(--uu-status-boarding);
    color: var(--uu-status-boarding);
}

:is(body, div)[data-shell="union"] .uu-status-tag.uu-status-underway {
    border-left-color: var(--uu-status-underway);
    color: var(--uu-status-underway);
}

@keyframes uu-flap {
    0% {
        opacity: 0;
        transform: translateY(-3px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- drawers (the menu and the settings, layouts/main.hbs) ---------- */

:is(body, div)[data-shell="union"] .uu-drawer {
    background: var(--uu-surface-raised);
    color: var(--uu-ink);
    border-top: 3px solid var(--uu-brass);
}

/* Flowbite slides a closed drawer off screen and marks it aria-hidden, which
 * leaves its links and switches in the tab order. Hidden, they are out of
 * it; the delay lets the slide finish first. */
:is(body, div)[data-shell="union"] .uu-drawer {
    transition: transform 0.3s, visibility 0s;
}

:is(body, div)[data-shell="union"] .uu-drawer[aria-hidden="true"] {
    visibility: hidden;
    transition: transform 0.3s, visibility 0s 0.3s;
}

:is(body, div)[data-shell="union"] .uu-drawer-start {
    border-right: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-drawer-end {
    border-left: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-drawer-title {
    font-family: var(--uu-font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-drawer-close {
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-drawer-close:hover {
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-drawer-link,
:is(body, div)[data-shell="union"] .uu-drawer-row {
    border-bottom: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-drawer-link:hover {
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-drawer-link:focus-visible {
    outline: 2px solid var(--uu-brass);
    outline-offset: 2px;
}

:is(body, div)[data-shell="union"] .uu-drawer-meta {
    font-family: var(--uu-font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-drawer .uu-input {
    padding: 0.3em 0.5em;
}

/* Flowbite fills a ticked box with its text colour. */
:is(body, div)[data-shell="union"] .uu-drawer input[type="checkbox"] {
    color: var(--uu-brass-strong);
    border-color: var(--uu-ink-muted);
    border-radius: 0;
}

:is(body, div)[data-shell="union"] .uu-drawer input[type="checkbox"]:disabled {
    opacity: 0.4;
}

/* ---------- line marks (one per game) ---------- */

:is(body, div)[data-shell="union"] .uu-line-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    font-family: var(--uu-font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--uu-surface-raised);
    /* A game's line colour (/lines.css); the muted ink for a mark that
     * isn't a game's, such as the menu's Concourse. */
    background: var(--uu-mark, var(--uu-ink-muted));
}

/* A mark that is a drawing (line-mark.hbs), in the mark's ink. */
:is(body, div)[data-shell="union"] .uu-line-mark svg {
    display: block;
    width: 66%;
    height: 66%;
}

/* ---------- lobby board (departure-board lobby rows) ---------- */

/* Flex + wrap rather than a fixed grid, so a row reflows to two lines at
 * phone width instead of forcing the whole board into horizontal scroll
 * (see feedback_no_horizontal_scroll_panels -- Industry's panels must not
 * need horizontal scroll except when truly unavoidable, and a lobby row
 * isn't tabular/code content that would earn an exception). */
:is(body, div)[data-shell="union"] .uu-lobby-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-lobby-row:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: -2px;
}

:is(body, div)[data-shell="union"] .uu-lobby-row:last-child {
    border-bottom: none;
}

:is(body, div)[data-shell="union"] .uu-lobby-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 220px;
}

:is(body, div)[data-shell="union"] .uu-lobby-secondary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

:is(body, div)[data-shell="union"] .uu-lobby-text {
    min-width: 0;
}

:is(body, div)[data-shell="union"] .uu-lobby-name {
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(body, div)[data-shell="union"] .uu-lobby-meta {
    display: block;
    font-size: 0.72rem;
    color: var(--uu-ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(body, div)[data-shell="union"] .uu-lobby-players {
    font-family: var(--uu-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--uu-ink-muted);
    white-space: nowrap;
}

/* Chat: a fixed-height log that scrolls, one line per message. */
:is(body, div)[data-shell="union"] .uu-chat-log {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 18rem;
    padding: 0.5rem;
    overflow-y: auto;
    border: 1px solid var(--uu-line);
    background: var(--uu-surface-sunken);
}

:is(body, div)[data-shell="union"] .uu-chat-line {
    overflow-wrap: anywhere;
}

:is(body, div)[data-shell="union"] .uu-chat-sender {
    font-weight: 600;
}

:is(body, div)[data-shell="union"] .uu-chat-note,
:is(body, div)[data-shell="union"] .uu-chat-whisper {
    color: var(--uu-ink-muted);
    font-style: italic;
}

:is(body, div)[data-shell="union"] .uu-empty {
    padding: 20px;
    color: var(--uu-ink-muted);
    font-size: 0.9rem;
}

/* ---------- tic-tac-toe board (views/ttt.hbs) ---------- */

/* Its own class rather than .uu-btn plus Tailwind size utilities: this
 * sheet is unlayered, so .uu-btn's font-size and padding would win over
 * any utility put beside it. No :disabled dimming either -- a square is
 * disabled whenever it isn't this player's turn, and the marks already on
 * the board have to stay readable then. */
:is(body, div)[data-shell="union"] .uu-ttt-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    font-family: var(--uu-font-mono);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--uu-ink);
    background: var(--uu-surface);
    border: 1px solid var(--uu-line);
}

/* The three squares of a completed line. Their marks swell once as the
 * line is made (below). */
:is(body, div)[data-shell="union"] .uu-ttt-cell-win {
    border-color: var(--uu-brass-strong);
    background: var(--uu-surface-sunken);
    box-shadow: inset 0 0 0 2px var(--uu-brass);
}

/* A mark, in its own box so it can be scaled without moving the square. */
:is(body, div)[data-shell="union"] .uu-ttt-mark {
    display: block;
}

/* The mark just played stamps in. */
:is(body, div)[data-shell="union"] .uu-ttt-mark-placed {
    animation: uu-ttt-place 0.2s ease-out;
}

/* The winning move's own mark swells with the others instead. */
:is(body, div)[data-shell="union"] .uu-ttt-cell-win .uu-ttt-mark {
    animation: uu-ttt-win 0.5s ease-in-out 0.15s;
}

@keyframes uu-ttt-place {
    from {
        opacity: 0;
        transform: scale(1.6);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes uu-ttt-win {
    50% {
        transform: scale(1.25);
    }
}

:is(body, div)[data-shell="union"] .uu-ttt-cell:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: 2px;
}

:is(body, div)[data-shell="union"] .uu-ttt-cell:hover:not(:disabled) {
    cursor: pointer;
    border-color: var(--uu-brass);
    background: var(--uu-surface-sunken);
}

/* ---------- Four in a Row board (views/four.hbs) ---------- */

/* Seven column buttons, each a stack of six square slots. It takes the
 * panel's width, so it narrows with a phone instead of scrolling. */
:is(body, div)[data-shell="union"] .uu-four-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    max-width: 26rem;
    background: var(--uu-surface);
    border: 1px solid var(--uu-line);
}

/* A column clips its falling disc, which starts above the top slot. No
 * :disabled dimming, for .uu-ttt-cell's reason: a column is disabled
 * whenever it isn't this player's turn. */
:is(body, div)[data-shell="union"] .uu-four-column {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
}

:is(body, div)[data-shell="union"] .uu-four-column:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: -2px;
}

:is(body, div)[data-shell="union"] .uu-four-column:hover:not(:disabled) {
    cursor: pointer;
    background: var(--uu-surface-sunken);
}

/* A slot is the hole a disc sits in. */
:is(body, div)[data-shell="union"] .uu-four-slot {
    position: relative;
    display: block;
    aspect-ratio: 1;
}

:is(body, div)[data-shell="union"] .uu-four-slot::before {
    content: "";
    position: absolute;
    inset: 10%;
    border: 1px solid var(--uu-line);
    border-radius: 50%;
    background: var(--uu-surface-sunken);
}

:is(body, div)[data-shell="union"] .uu-four-disc {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    animation: uu-four-drop 0.3s ease-in;
}

:is(body, div)[data-shell="union"] .uu-four-disc-a {
    background: var(--uu-disc-a);
}

/* The second seat's disc carries a ring, so the two differ without colour. */
:is(body, div)[data-shell="union"] .uu-four-disc-b {
    background: var(--uu-disc-b);
    box-shadow:
        inset 0 0 0 3px var(--uu-disc-b),
        inset 0 0 0 5px var(--uu-surface-raised);
}

/* The discs of a completed line. */
:is(body, div)[data-shell="union"] .uu-four-disc-win {
    outline: 3px solid var(--uu-brass-strong);
    outline-offset: 1px;
}

/* The newest disc. */
:is(body, div)[data-shell="union"] .uu-four-disc-last::after {
    content: "";
    position: absolute;
    inset: 38%;
    border-radius: 50%;
    background: var(--uu-surface-raised);
}

/* A disc beside a player's name or score: no slot, no fall. */
:is(body, div)[data-shell="union"] .uu-four-key {
    position: static;
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    vertical-align: -0.05em;
    animation: none;
}

:is(body, div)[data-shell="union"] .uu-four-key.uu-four-disc-b {
    box-shadow:
        inset 0 0 0 2px var(--uu-disc-b),
        inset 0 0 0 3px var(--uu-surface-raised);
}

/* Only the newest disc falls: one that was already on the board when the
 * page loaded appears in place. */
:is(body, div)[data-shell="union"] .uu-four-disc:not(.uu-four-disc-last) {
    animation: none;
}

@keyframes uu-four-drop {
    from {
        transform: translateY(calc(var(--uu-drop-rows, 1) * -125%));
    }

    to {
        transform: none;
    }
}

/* ---------- Mancala board (views/mancala.hbs) ---------- */

/* A store at each end and two rows of six pits between them: eight equal
 * columns that take the panel's width, so the board narrows with a phone
 * instead of scrolling. The far row is drawn first and the near row, the
 * viewer's own, second. */
:is(body, div)[data-shell="union"] .uu-mancala-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: var(--uu-surface);
    border: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-mancala-pit,
:is(body, div)[data-shell="union"] .uu-mancala-store {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    padding: 6px 2px 4px;
    color: var(--uu-ink);
    background: var(--uu-surface-sunken);
    border: 1px solid var(--uu-line);
    border-radius: 14px;
}

:is(body, div)[data-shell="union"] .uu-mancala-pit {
    aspect-ratio: 3 / 4;
}

:is(body, div)[data-shell="union"] .uu-mancala-far {
    grid-row: 1;
}

:is(body, div)[data-shell="union"] .uu-mancala-near {
    grid-row: 2;
}

/* A store stands the height of both rows. */
:is(body, div)[data-shell="union"] .uu-mancala-store {
    grid-row: 1 / span 2;
    justify-content: center;
}

:is(body, div)[data-shell="union"] .uu-mancala-store-far {
    grid-column: 1;
}

:is(body, div)[data-shell="union"] .uu-mancala-store-near {
    grid-column: 8;
}

:is(body, div)[data-shell="union"] .uu-mancala-near:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: 2px;
}

/* A pit the viewer can play. No :disabled dimming, for .uu-ttt-cell's
 * reason: a pit is disabled whenever it isn't this player's turn. */
:is(body, div)[data-shell="union"] .uu-mancala-near:not(:disabled) {
    cursor: pointer;
    border-color: var(--uu-brass);
}

:is(body, div)[data-shell="union"] .uu-mancala-near:hover:not(:disabled) {
    background: var(--uu-surface-raised);
}

/* The pit the last move was sown from, and the square its last seed
 * reached. */
:is(body, div)[data-shell="union"] .uu-mancala-played {
    border-style: dashed;
    border-color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-mancala-landed {
    border-color: var(--uu-brass-strong);
    box-shadow: inset 0 0 0 2px var(--uu-brass);
}

:is(body, div)[data-shell="union"] .uu-mancala-seeds {
    display: flex;
    flex-wrap: wrap;
    place-content: center;
    gap: 2px;
    flex: 1;
    max-width: 2rem;
}

:is(body, div)[data-shell="union"] .uu-mancala-seed {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-mancala-count {
    font-family: var(--uu-font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

:is(body, div)[data-shell="union"] .uu-mancala-store .uu-mancala-count {
    font-size: 1.25rem;
}

/* The seeds-a-pit choices: the chosen one is filled. */
:is(body, div)[data-shell="union"] .uu-mancala-setup {
    min-height: 2.2rem;
    display: flex;
    align-items: center;
}

:is(body, div)[data-shell="union"] .uu-mancala-choice {
    min-width: 2.4em;
    padding: 0.4em 0.6em;
    border: 1.5px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-mancala-choice[aria-pressed="true"] {
    color: var(--uu-surface-raised);
    background: var(--uu-ink);
    border-color: var(--uu-ink);
}

/* ---------- Checkers board (views/checkers.hbs) ---------- */

/* An N by N grid, N set by the page as --uu-checkers-size, so the same rules
 * draw an 8, 10 or 12 square board. It takes the panel's width and shares it
 * out in fractions, so even the biggest narrows with a phone instead of
 * scrolling. A light square is the board's ground, a playable one is a
 * button. */
:is(body, div)[data-shell="union"] .uu-checkers-board {
    display: grid;
    grid-template-columns: repeat(var(--uu-checkers-size, 8), minmax(0, 1fr));
    width: 100%;
    max-width: 30rem;
    background: var(--uu-surface);
    border: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-checkers-light {
    aspect-ratio: 1;
}

/* No :disabled dimming, for .uu-ttt-cell's reason: a square is disabled
 * whenever there is nothing to do with it now. */
:is(body, div)[data-shell="union"] .uu-checkers-square {
    position: relative;
    display: block;
    aspect-ratio: 1;
    padding: 0;
    background: var(--uu-line);
    border: 0;
    border-radius: 0;
}

:is(body, div)[data-shell="union"] .uu-checkers-square:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: -2px;
    z-index: 1;
}

:is(body, div)[data-shell="union"] .uu-checkers-square:hover:not(:disabled) {
    cursor: pointer;
    background: var(--uu-surface-sunken);
}

/* The piece about to move, and the squares it can go to. */
:is(body, div)[data-shell="union"] .uu-checkers-selected {
    box-shadow: inset 0 0 0 3px var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-checkers-target::after {
    content: "";
    position: absolute;
    inset: 36%;
    border-radius: 50%;
    background: var(--uu-brass-strong);
}

/* The squares the newest hop went from and to. */
:is(body, div)[data-shell="union"] .uu-checkers-last {
    box-shadow: inset 0 0 0 2px var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-checkers-piece {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
}

:is(body, div)[data-shell="union"] .uu-checkers-piece-a {
    background: var(--uu-disc-a);
}

/* The second side's piece carries a ring, so the two differ without colour. */
:is(body, div)[data-shell="union"] .uu-checkers-piece-b {
    background: var(--uu-disc-b);
    box-shadow:
        inset 0 0 0 3px var(--uu-disc-b),
        inset 0 0 0 5px var(--uu-surface-raised);
}

/* A king wears a crown, so rank doesn't depend on colour either. */
:is(body, div)[data-shell="union"] .uu-checkers-crown {
    position: absolute;
    inset: 27% 25% 30%;
    background: var(--uu-surface-raised);
    clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%);
}

/* Jumped in the move being played: still there, but on its way off. */
:is(body, div)[data-shell="union"] .uu-checkers-taken {
    opacity: 0.35;
}

/* The piece that has just moved slides in from where it was. --uu-checkers-dx and
 * --uu-checkers-dy are the squares it travelled, in the board as drawn; a piece fills 80% of
 * its square, so one square is 125% of the piece. */
:is(body, div)[data-shell="union"] .uu-checkers-moved {
    z-index: 2;
    animation: uu-checkers-slide 0.22s ease-out;
}

@keyframes uu-checkers-slide {
    from {
        transform: translate(calc(var(--uu-checkers-dx, 0) * 125%), calc(var(--uu-checkers-dy, 0) * 125%));
    }
}

:is(body, div)[data-shell="union"] .uu-checkers-choice {
    padding: 0.4em 0.6em;
    border: 1.5px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-checkers-choice[aria-pressed="true"] {
    color: var(--uu-surface-raised);
    background: var(--uu-ink);
    border-color: var(--uu-ink);
}

/* ---------- Minesweeper board (views/minesweeper.hbs) ---------- */

/* As wide as its board, up to the page: an expert field is thirty squares
 * across, so on a narrow screen the board scrolls inside .uu-mines-scroll
 * and the panel around it stays put. */
:is(body, div)[data-shell="union"] .uu-mines-panel {
    width: fit-content;
    min-width: min(100%, 24rem);
    max-width: 100%;
}

:is(body, div)[data-shell="union"] .uu-mines-scroll {
    max-width: 100%;
    overflow-x: auto;
    /* Room for a square's focus ring, which the scroll box would clip. */
    padding: 4px;
}

:is(body, div)[data-shell="union"] .uu-mines-board {
    display: grid;
    grid-template-columns: repeat(var(--uu-mines-cols, 9), 30px);
    width: max-content;
    border: 1px solid var(--uu-line);
}

/* Its own class for .uu-ttt-cell's reason. A square is never disabled:
 * the arrow keys have to be able to rest on an open one. */
:is(body, div)[data-shell="union"] .uu-mines-square {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
    font-family: var(--uu-font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    color: var(--uu-ink);
    background: var(--uu-surface-raised);
    border: 1px solid var(--uu-line);
    border-radius: 0;
    cursor: default;
    user-select: none;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Still to dig: sunken, with a brass frame to say it can be pressed. */
:is(body, div)[data-shell="union"] .uu-mines-hidden,
:is(body, div)[data-shell="union"] .uu-mines-flag,
:is(body, div)[data-shell="union"] .uu-mines-wrong,
:is(body, div)[data-shell="union"] .uu-mines-mine {
    background: var(--uu-surface-sunken);
    box-shadow: inset 0 0 0 2px var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-mines-hidden,
:is(body, div)[data-shell="union"] .uu-mines-flag {
    cursor: pointer;
}

:is(body, div)[data-shell="union"] .uu-mines-hidden:hover {
    box-shadow: inset 0 0 0 2px var(--uu-brass);
}

:is(body, div)[data-shell="union"] .uu-mines-struck {
    background: var(--uu-disc-a);
}

/* The numbers, in --uu-mines-n<count>. */
:is(body, div)[data-shell="union"] .uu-mines-n1 {
    color: var(--uu-mines-n1);
}

:is(body, div)[data-shell="union"] .uu-mines-n2 {
    color: var(--uu-mines-n2);
}

:is(body, div)[data-shell="union"] .uu-mines-n3 {
    color: var(--uu-mines-n3);
}

:is(body, div)[data-shell="union"] .uu-mines-n4 {
    color: var(--uu-mines-n4);
}

:is(body, div)[data-shell="union"] .uu-mines-n5 {
    color: var(--uu-mines-n5);
}

:is(body, div)[data-shell="union"] .uu-mines-n6 {
    color: var(--uu-mines-n6);
}

/* The flag and the mine are drawn, not typed: no font here has either,
 * and an emoji would bring its own colours. A mask takes the ink's. */
:is(body, div)[data-shell="union"] .uu-mines-flag::before,
:is(body, div)[data-shell="union"] .uu-mines-wrong::before,
:is(body, div)[data-shell="union"] .uu-mines-mine::before,
:is(body, div)[data-shell="union"] .uu-mines-struck::before,
:is(body, div)[data-shell="union"] .uu-mines-pictogram::before {
    content: "";
    position: absolute;
    inset: 5px;
    background: currentcolor;
    mask: var(--uu-mines-shape) center / contain no-repeat;
}

:is(body, div)[data-shell="union"] .uu-mines-flag,
:is(body, div)[data-shell="union"] .uu-mines-wrong {
    --uu-mines-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 1h2.6v1.2L21 8 7.6 13.8V23H5z'/%3E%3C/svg%3E");

    color: var(--uu-disc-a);
}

:is(body, div)[data-shell="union"] .uu-mines-mine,
:is(body, div)[data-shell="union"] .uu-mines-struck,
:is(body, div)[data-shell="union"] .uu-mines-pictogram-mine {
    --uu-mines-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='6.5'/%3E%3Cpath d='M12 1v22M1 12h22M4.2 4.2l15.6 15.6M19.8 4.2 4.2 19.8' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

:is(body, div)[data-shell="union"] .uu-mines-struck {
    color: var(--uu-surface-raised);
}

/* A flag that had no mine under it: struck through. */
:is(body, div)[data-shell="union"] .uu-mines-wrong::after {
    content: "";
    position: absolute;
    inset: 13px 3px auto;
    height: 2px;
    background: var(--uu-ink);
    transform: rotate(-45deg);
}

:is(body, div)[data-shell="union"] .uu-mines-square:focus-visible {
    z-index: 1;
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: 1px;
}

/* A square just dug turns over from the hidden look; its --uu-mines-delay
 * (set by the page, by its distance from the square that was dug) makes a
 * patch open as a ripple. `backwards` holds the hidden look until then. */
:is(body, div)[data-shell="union"] .uu-mines-pop {
    animation: uu-mines-pop 0.16s ease-out var(--uu-mines-delay, 0ms) backwards;
}

@keyframes uu-mines-pop {
    from {
        color: transparent;
        background: var(--uu-surface-sunken);
        box-shadow: inset 0 0 0 2px var(--uu-line);
        transform: scale(0.86);
    }
}

/* A flag stamps in, as a Tic-tac-toe mark does. */
:is(body, div)[data-shell="union"] .uu-mines-stamp::before {
    animation: uu-mines-stamp 0.18s ease-out var(--uu-mines-delay, 0ms) backwards;
}

@keyframes uu-mines-stamp {
    from {
        opacity: 0;
        transform: scale(1.8);
    }
}

/* The mine that ended the round, then the rest surfacing outward from it. */
:is(body, div)[data-shell="union"] .uu-mines-blast {
    z-index: 1;
    animation: uu-mines-blast 0.45s ease-out;
}

@keyframes uu-mines-blast {
    from {
        box-shadow: 0 0 0 0 var(--uu-disc-a);
        transform: scale(1.25);
    }

    to {
        box-shadow: 0 0 0 16px transparent;
    }
}

:is(body, div)[data-shell="union"] .uu-mines-surface::before {
    animation: uu-mines-surface 0.2s ease-out var(--uu-mines-delay, 0ms) backwards;
}

@keyframes uu-mines-surface {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
}

/* Mines left, the clock and the flag switch, above the board. */
:is(body, div)[data-shell="union"] .uu-mines-gauges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
}

:is(body, div)[data-shell="union"] .uu-mines-gauges > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

:is(body, div)[data-shell="union"] .uu-mines-pictogram {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-mines-pictogram::before {
    inset: 0;
}

/* A size or the flag switch: the chosen one is filled, as Mancala's are. */
:is(body, div)[data-shell="union"] .uu-mines-choice {
    padding: 0.4em 0.8em;
    border: 1.5px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-mines-choice[aria-pressed="true"] {
    color: var(--uu-surface-raised);
    background: var(--uu-ink);
    border-color: var(--uu-ink);
}

:is(body, div)[data-shell="union"] .uu-mines-help {
    max-width: 44ch;
    text-align: center;
    white-space: normal;
}

:is(body, div)[data-shell="union"] .uu-mines-players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- arrivals (sign-in panel, views/index.hbs) ---------- */

:is(body, div)[data-shell="union"] .uu-arrivals {
    max-width: 380px;
    margin-inline: auto;
    padding: 32px 28px;
    text-align: center;
}

:is(body, div)[data-shell="union"] .uu-arrivals .uu-wordmark {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 22px;
}

:is(body, div)[data-shell="union"] .uu-turnstile-wrap {
    display: flex;
    justify-content: center;

    /* The widget's own height, held before it loads so the page below
     * doesn't jump. */
    min-height: 65px;
    margin-bottom: 18px;
}

/* ---------- signs (one per game on the concourse, views/m.hbs) ---------- */

/* A platform sign each: the line's colour across the top, the name, then a
 * strip of pictograms (players, what it plays on, how many are open). The
 * grid drops to one column at phone width. Auto-fill, not auto-fit: a group
 * with two signs keeps them the width of the others' instead of stretching
 * them across the row. */
:is(body, div)[data-shell="union"] .uu-signs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 14px;
    width: 100%;
    max-width: 68rem;
}

:is(body, div)[data-shell="union"] .uu-sign {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--uu-ink);
    background: var(--uu-surface-raised);
    border: 1px solid var(--uu-line);
    border-top: 4px solid var(--uu-mark, var(--uu-ink-muted));
}

:is(body, div)[data-shell="union"] .uu-sign {
    transition: border-color 0.15s ease, transform 0.15s ease;
}

/* A sign under the pointer or the focus lifts a little and its mark grows,
 * so it reads as something to press. */
:is(body, div)[data-shell="union"] .uu-sign:hover,
:is(body, div)[data-shell="union"] .uu-sign:focus-visible {
    border-color: var(--uu-brass);
    transform: translateY(-2px);
}

/* The concourse's signs under a heading per group (views/m.hbs). Three
 * columns at most, so a group of five wraps as 3 + 2 and not 4 + 1. */
:is(body, div)[data-shell="union"] .uu-sign-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    max-width: 52rem;
}

/* A heading is a platform's name board: small capitals and a rule running
 * out to the edge. */
:is(body, div)[data-shell="union"] .uu-sign-group-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 12px;
    font-family: var(--uu-font-mono);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] .uu-sign-group-title::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--uu-line);
}

/* A name that travels between pages (view-transition.hbs) is captured as
 * one box, which an inline box that wraps is not. */
:is(body, div)[data-shell="union"] .uu-travel {
    display: inline-block;
}

/* A lobby browser's title (lobby-title.hbs): the game's mark, as on its
 * sign, then the wording. */
:is(body, div)[data-shell="union"] .uu-lobby-title .uu-line-mark {
    margin-right: 0.6em;
    vertical-align: middle;
    letter-spacing: 0;
}

:is(body, div)[data-shell="union"] .uu-sign:focus-visible {
    outline: 2px solid var(--uu-brass-strong);
    outline-offset: 2px;
}

/* Tall enough for a name with a chip under it, so every sign's blurb
 * starts on the same line. */
:is(body, div)[data-shell="union"] .uu-sign-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
}

:is(body, div)[data-shell="union"] .uu-sign-head .uu-line-mark {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    transition: transform 0.15s ease;
}

:is(body, div)[data-shell="union"] .uu-sign:hover .uu-line-mark,
:is(body, div)[data-shell="union"] .uu-sign:focus-visible .uu-line-mark {
    transform: scale(1.08);
}

:is(body, div)[data-shell="union"] .uu-sign-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* A posted notice, not a pictogram: only an unfinished game carries one. */
:is(body, div)[data-shell="union"] .uu-sign-chip {
    padding: 1px 6px;
    font-family: var(--uu-font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    /* Not --uu-status-boarding: at this size that is 4.2:1 on a sign and
     * 3.8:1 on the page in the light theme. */
    color: var(--uu-brass-strong);
    border: 1px solid currentcolor;
}

:is(body, div)[data-shell="union"] .uu-sign-name {
    font-family: var(--uu-font-display);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.15;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Grows, so the pictogram strips line up along the row of signs. */
:is(body, div)[data-shell="union"] .uu-sign-blurb {
    flex: 1;
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-sign-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding-top: 12px;
    border-top: 1px solid var(--uu-line);
}

/* One symbol, with at most a number beside it. */
:is(body, div)[data-shell="union"] .uu-pictogram {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--uu-font-mono);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--uu-ink);
}

:is(body, div)[data-shell="union"] .uu-pictogram svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

/* The open count sits at the far end, like a platform number. */
:is(body, div)[data-shell="union"] .uu-sign-open {
    margin-left: auto;
    color: var(--uu-ink-muted);
}

:is(body, div)[data-shell="union"] .uu-sign-lamp {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid currentcolor;
}

:is(body, div)[data-shell="union"] .uu-sign-open-lit {
    color: var(--uu-status-boarding);
}

:is(body, div)[data-shell="union"] .uu-sign-open-lit .uu-sign-lamp {
    background: currentcolor;
    animation: uu-lamp 2.4s ease-out infinite;
}

/* A lit lamp is a lobby open right now: a slow ring going out from it. */
@keyframes uu-lamp {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, currentcolor 55%, transparent);
    }

    60%,
    100% {
        box-shadow: 0 0 0 7px transparent;
    }
}

/* One sign to a row on a phone, so the page is as short as it can be: less
 * padding, and no minimum height on the head, which only keeps the blurbs
 * of signs side by side level. */
@media (width <= 30rem) {
    :is(body, div)[data-shell="union"] .uu-signs {
        gap: 10px;
    }

    :is(body, div)[data-shell="union"] .uu-sign {
        gap: 8px;
        padding: 12px;
    }

    :is(body, div)[data-shell="union"] .uu-sign-head {
        min-height: 0;
    }

    :is(body, div)[data-shell="union"] .uu-sign-strip {
        padding-top: 8px;
    }
}

/* ---------- public pages (views/layouts/public.hbs) ---------- */

/* The pages read without signing in: the home page and one per game
 * (views/index.hbs, views/games/). One centred column, no Tailwind utility
 * needed for the layout. */
:is(body, div)[data-shell="union"] .uu-public-head {
    padding: 12px 16px;
    border-bottom: 3px solid var(--uu-brass);
    background: var(--uu-surface-raised);
}

:is(body, div)[data-shell="union"] .uu-public-head .uu-wordmark {
    font-size: 1.4rem;
    text-decoration: none;
}

:is(body, div)[data-shell="union"] .uu-public-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 40px 16px;
}

:is(body, div)[data-shell="union"] .uu-public-intro {
    max-width: 44rem;
    text-align: center;
}

:is(body, div)[data-shell="union"] .uu-public-intro .uu-wordmark {
    margin: 0 0 12px;
    font-size: 1.5rem;
    line-height: 1.25;
}

:is(body, div)[data-shell="union"] .uu-public-intro .uu-lede {
    max-width: none;
    line-height: 1.6;
}

:is(body, div)[data-shell="union"] .uu-public-foot {
    padding: 20px 16px 32px;
    border-top: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-public-foot nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    font-family: var(--uu-font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--uu-ink-muted);
}

/* The top of a game's page: the sign's facts, set larger. */
:is(body, div)[data-shell="union"] .uu-game-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    max-width: 44rem;
}

:is(body, div)[data-shell="union"] .uu-game-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

:is(body, div)[data-shell="union"] .uu-game-title .uu-wordmark {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
}

:is(body, div)[data-shell="union"] .uu-game-head .uu-lede {
    margin: 0;
    font-size: 1.1rem;
}

:is(body, div)[data-shell="union"] .uu-game-head .uu-sign-strip {
    width: 100%;
}

/* Running text: what a game is and how it plays. */
:is(body, div)[data-shell="union"] .uu-prose {
    width: 100%;
    max-width: 44rem;
    line-height: 1.65;
}

:is(body, div)[data-shell="union"] .uu-prose h2 {
    margin: 28px 0 10px;
    font-family: var(--uu-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

:is(body, div)[data-shell="union"] .uu-prose p {
    margin: 0 0 14px;
}

:is(body, div)[data-shell="union"] .uu-prose ul {
    margin: 0 0 14px;
    padding-left: 1.2em;
    list-style: square;
}

:is(body, div)[data-shell="union"] .uu-prose li {
    margin-bottom: 8px;
}

:is(body, div)[data-shell="union"] .uu-prose li::marker {
    color: var(--uu-brass);
}

/* A screenshot. The width and height attributes reserve its space; the
 * image then scales down with the column. */
:is(body, div)[data-shell="union"] .uu-shot {
    margin: 20px 0;
}

:is(body, div)[data-shell="union"] .uu-shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] .uu-shot-narrow {
    max-width: 22rem;
    margin-inline: auto;
}

:is(body, div)[data-shell="union"] .uu-shot figcaption {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--uu-ink-muted);
}

/* ---------- shared chrome (header + drawers, main.hbs) ---------- */
/* Kept last: the #drawer-navigation/#drawer-settings id selectors below
 * are the highest-specificity rules in this file, so every lower-
 * specificity component class above needs to stay textually before them
 * (stylelint's no-descending-specificity). */

:is(body, div)[data-shell="union"] > header {
    border-bottom: 3px solid var(--uu-brass);
    background: var(--uu-surface-raised);
}

:is(body, div)[data-shell="union"] > hr {
    border: none;
    border-top: 1px solid var(--uu-line);
    margin: 0;
}

:is(body, div)[data-shell="union"] div#drawer-navigation {
    background: var(--uu-surface-raised);
    color: var(--uu-ink);
    border-left: 1px solid var(--uu-line);
    border-right: 1px solid var(--uu-line);
}

:is(body, div)[data-shell="union"] #drawer-navigation h2,
:is(body, div)[data-shell="union"] #drawer-navigation h5,
:is(body, div)[data-shell="union"] #drawer-settings h5 {
    font-family: var(--uu-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--uu-brass-strong);
}

:is(body, div)[data-shell="union"] #drawer-navigation menu a {
    text-decoration: none;
    font-weight: 600;
    position: relative;
}

:is(body, div)[data-shell="union"] #drawer-navigation menu a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--uu-brass);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.18s ease;
}

:is(body, div)[data-shell="union"] #drawer-navigation menu a:hover::after,
:is(body, div)[data-shell="union"] #drawer-navigation menu a:focus-visible::after {
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
    :is(body, div)[data-shell="union"] .uu-status-tag,
    :is(body, div)[data-shell="union"] .uu-ttt-mark,
    :is(body, div)[data-shell="union"] .uu-ttt-cell-win .uu-ttt-mark,
    :is(body, div)[data-shell="union"] .uu-four-disc,
    :is(body, div)[data-shell="union"] .uu-checkers-moved,
    :is(body, div)[data-shell="union"] .uu-mines-pop,
    :is(body, div)[data-shell="union"] .uu-mines-blast,
    :is(body, div)[data-shell="union"] .uu-mines-stamp::before,
    :is(body, div)[data-shell="union"] .uu-mines-surface::before,
    :is(body, div)[data-shell="union"] .uu-sign-open-lit .uu-sign-lamp {
        animation: none;
    }

    :is(body, div)[data-shell="union"] .uu-sign,
    :is(body, div)[data-shell="union"] .uu-sign-head .uu-line-mark {
        transition: none;
    }

    :is(body, div)[data-shell="union"] .uu-sign:hover,
    :is(body, div)[data-shell="union"] .uu-sign:focus-visible,
    :is(body, div)[data-shell="union"] .uu-sign:hover .uu-line-mark,
    :is(body, div)[data-shell="union"] .uu-sign:focus-visible .uu-line-mark {
        transform: none;
    }

    :is(body, div)[data-shell="union"] #drawer-navigation menu a::after {
        transition: none;
    }
}
