:root {
    color-scheme: light;
    --bg: #f1eef6;
    --bg-2: #eef8ff;
    --surface: #ffffff;
    --surface-2: #fff0f7;
    --surface-3: #eff8ff;
    --text: #25233a;
    --muted: #6a7285;
    --line: #25233a;
    --ink: #25233a;
    --pink: #ff8fab;
    --coral: #ff6b6b;
    --yellow: #ffd6e7;
    --sky: #8bdcff;
    --mint: #a2f2ac;
    --violet: #b197fc;
    --orange: #ffb86b;
    --boo-primary: #3a208a;
    --boo-gray: #626263;
    --boo-light-primary: #dfd8f3;
    --accent-strong: #2563eb;
    --accent-strong-text: #12306f;
    --palette-primary: var(--pink);
    --palette-secondary: var(--sky);
    --palette-tertiary: var(--violet);
    --danger: #ff4d6d;
    --danger-bg: #fff0f7;
    --danger-text: #7f1d35;
    --draw-bg: #fff7cc;
    --draw-text: #5b3b00;
    --input-bg: #f1eef6;
    --panel-sunny: #ffeaf3;
    --panel-pink: #ffe4f1;
    --panel-sky: #e8fbff;
    --paper-surface: #fffdf8;
    --paper-warm: #fffaf0;
    --status-bg: rgba(255, 250, 240, .90);
    --status-text: #25314a;
    --status-turn-you-bg: color-mix(in srgb, var(--surface) 72%, var(--palette-secondary));
    --status-turn-opponent-bg: #fff0f7;
    --toast-bg: rgba(37, 35, 58, .94);
    --toast-text: #fff8ff;
    --nav-bg: #fdfcff;
    --nav-shadow: 0 0 3px .05rem #e1e0e4;
    --page: var(--bg);
    --page-bg: var(--bg);
    --panel: color-mix(in srgb, var(--surface) 92%, transparent);
    --panel-accent: color-mix(in srgb, var(--surface-2) 88%, transparent);
    --card: var(--surface);
    --accent: var(--palette-primary);
    --button-text: var(--status-text);
    --surface-gradient:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--surface) 92%, transparent),
            color-mix(in srgb, var(--surface-2) 88%, transparent)
        );
    --shadow: 0 0 transparent;
    --soft-shadow: 0 16px 34px rgba(37, 35, 58, .12);
    --feature-gradient:
        radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--sky) 34%, transparent), transparent 34%),
        radial-gradient(circle at 8% 100%, color-mix(in srgb, var(--pink) 24%, transparent), transparent 42%),
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, var(--sky)), color-mix(in srgb, var(--surface-2) 82%, var(--violet)));
}

/* Basic Rummy */
.rummy-page {
    min-height: 100vh;
    background-color: var(--page);
    background-size: cover;
}

.rummy-table {
    width: min(1000px, calc(100% - 24px));
    margin: 12px auto 80px;
    overflow: hidden;
    border: 3px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--panel) 91%, var(--mint)),
        var(--panel)
    );
    box-shadow: 0 8px 0 var(--shadow);
}

.rummy-table > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-bottom: 2px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.rummy-table > header > div:last-child {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 2px 10px;
}

.rummy-table > header > div:last-child img {
    width: 58px;
    aspect-ratio: 1;
    grid-row: 1 / 3;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 8px;
}

.rummy-table > header small {
    color: var(--muted);
}

.rummy-piles {
    display: flex;
    gap: 12px;
}

.rummy-piles button {
    width: 106px;
    min-height: 146px;
    padding: 8px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 92%, var(--sky));
    box-shadow: 0 4px 0 var(--shadow);
    cursor: pointer;
}

.rummy-piles button:not(:disabled):hover {
    transform: translateY(-2px);
}

.rummy-piles button:disabled {
    cursor: default;
    opacity: .58;
}

.rummy-piles .playing-card {
    width: 58px;
}

.rummy-piles small {
    min-height: 1em;
}

.rummy-melds {
    min-height: 160px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
    gap: 12px;
    color: var(--muted);
}

.rummy-melds article {
    padding: 10px;
    display: grid;
    gap: 8px;
    border: 2px solid color-mix(in srgb, var(--line) 62%, transparent);
    border-radius: 8px;
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 92%, var(--yellow));
}

.rummy-meld-cards,
.rummy-hand {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 8px 4px 14px;
}

.rummy-meld-cards .playing-card {
    width: 68px;
}

.rummy-meld-cards .playing-card + .playing-card {
    margin-inline-start: -34px;
}

.rummy-last-move {
    padding: 9px 14px;
    border-block: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    color: var(--muted);
    text-align: center;
}

.rummy-own {
    padding: 14px;
}

.rummy-own > header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.rummy-hand {
    min-height: 166px;
}

.rummy-hand .playing-card {
    flex: 0 0 86px;
}

.rummy-hand .playing-card + .playing-card {
    margin-inline-start: -31px;
}

.rummy-hand .playing-card.selected {
    z-index: 2;
    transform: translateY(-12px);
}

.rummy-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
}

.rummy-actions > span {
    min-width: 0;
    color: var(--muted);
    font-weight: 750;
}

@media (max-width: 700px) {
    .rummy-table {
        width: calc(100% - 10px);
    }

    .rummy-table > header {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .rummy-table > header > div:last-child {
        grid-template-columns: 46px 1fr;
    }

    .rummy-table > header > div:last-child img {
        width: 46px;
    }

    .rummy-piles button {
        width: 50%;
        min-height: 124px;
    }

    .rummy-piles .playing-card {
        width: 48px;
    }

    .rummy-hand .playing-card {
        flex-basis: 76px;
    }

    .rummy-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .rummy-actions > span {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* Shared audio and candidate games 21-25 */
.app-audio-button {
    font-size: 20px;
    line-height: 1;
}

.app-audio-floating {
    inset-inline-end: 12px;
    position: fixed;
    top: 12px;
    z-index: 90;
}

.legal-page .app-audio-floating {
    display: none;
}

.legal-page .brand > div {
    min-width: 0;
}

.legal-page .top-bar > .btn {
    flex: 0 0 auto;
}

.app-audio-panel {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 9px 0 rgba(37, 49, 74, .22);
    color: var(--text);
    display: grid;
    gap: 12px;
    inset-inline-end: 12px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 14px;
    position: fixed;
    top: 74px;
    width: min(330px, calc(100vw - 24px));
    z-index: 1600;
}

.app-audio-panel[hidden] {
    display: none;
}

.app-audio-panel-head,
.app-audio-volume > span {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.app-audio-panel-head strong {
    font-size: 18px;
}

.app-audio-panel-head button {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    height: 34px;
    line-height: 1;
    width: 34px;
}

.app-audio-music-toggle {
    background: var(--palette-secondary);
    border: 2px solid var(--line);
    border-radius: 12px;
    color: var(--status-text);
    cursor: pointer;
    font-weight: 900;
    min-height: 44px;
    padding: 8px 12px;
}

.app-audio-volume {
    display: grid;
    font-size: 13px;
    font-weight: 900;
    gap: 8px;
}

.app-audio-volume output {
    color: var(--muted);
}

.app-audio-volume input {
    accent-color: var(--boo-primary);
    cursor: pointer;
    width: 100%;
}

.app-audio-stations {
    border: 0;
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.app-audio-stations legend {
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 7px;
}

.app-audio-stations label {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    gap: 9px;
    grid-template-columns: 20px 1fr;
    padding: 8px 10px;
}

.app-audio-stations label:has(input:checked) {
    background: var(--boo-light-primary);
    border-color: var(--boo-primary);
}

.app-audio-stations input {
    accent-color: var(--boo-primary);
    margin: 0;
}

.app-audio-stations span {
    display: grid;
    gap: 2px;
}

.app-audio-stations b {
    font-size: 13px;
}

.app-audio-stations small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.fan-tan-table,
.yacht-table,
.pig-table,
.farkle-table,
.domino-table {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 3px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .16);
    margin: 0 auto;
    max-width: 1080px;
    padding: 14px;
}

.fan-tan-table > header,
.yacht-roll-panel > header,
.yacht-sheet > header,
.pig-table > header,
.farkle-table > header,
.domino-table > header,
.fan-tan-hand-panel > header,
.domino-hand-panel > header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fan-tan-rows {
    display: grid;
    gap: 8px;
}

.fan-tan-rows > article {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 32px minmax(0, 1fr);
}

.fan-tan-rows > article > strong {
    font-size: 25px;
    text-align: center;
}

.fan-tan-rows > article > strong.red {
    color: #d53f57;
}

.fan-tan-row-cards {
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(13, minmax(42px, 1fr));
    overflow-x: auto;
    padding: 5px 3px 9px;
}

.fan-tan-slot {
    aspect-ratio: 5 / 7;
    background: color-mix(in srgb, var(--sky) 16%, transparent);
    border: 1px dashed var(--muted);
    border-radius: 6px;
    min-width: 42px;
}

.fan-tan-slot .playing-card {
    height: 100%;
    width: 100%;
}

.fan-tan-hand-panel,
.domino-hand-panel {
    border-top: 2px dashed var(--muted);
    margin-top: 14px;
    padding-top: 12px;
}

.fan-tan-hand {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(58px, 76px));
    justify-content: center;
}

.fan-tan-hand .playing-card.legal {
    box-shadow: 0 5px 0 rgba(21, 28, 45, .22), 0 0 0 3px var(--mint);
}

.yacht-table {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
}

.yacht-roll-panel,
.yacht-sheet {
    background: color-mix(in srgb, var(--paper-warm) 82%, transparent);
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.yacht-dice,
.farkle-dice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 18px 0;
}

.yacht-die,
.farkle-die {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 14px;
    box-sizing: border-box;
    box-shadow: 0 5px 0 rgba(37, 49, 74, .18);
    cursor: pointer;
    display: flex;
    height: 62px;
    justify-content: center;
    padding: 1px;
    width: 62px;
}

.yacht-die > span,
.farkle-die > span,
.pig-die > span {
    display: block;
    font-size: 62px;
    height: 68px;
    width: 68px;
}

.dice-roll-ready {
    cursor: pointer;
}

.shared-die-visual,
.shared-single-die-target {
    border-radius: 14px !important;
    box-sizing: border-box;
    flex-shrink: 0;
    height: var(--shared-die-size, 56px) !important;
    width: var(--shared-die-size, 56px) !important;
}

.shared-die-visual > .GameGlee-die-canvas {
    height: 100% !important;
    width: 100% !important;
}

.shared-single-die-surface {
    min-height: 82px;
}

.dice-roll-ready:where(.shared-die-visual),
.dice-roll-ready .shared-die-visual {
    animation: dice-roll-ready-pulse .85s ease-in-out infinite;
    background: color-mix(in srgb, var(--yellow) 28%, var(--surface));
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--coral) 58%, transparent),
        0 0 0 9px color-mix(in srgb, var(--sky) 28%, transparent),
        0 12px 24px rgba(37, 49, 74, .22);
    filter: saturate(1.35) brightness(1.08);
    outline: 3px solid color-mix(in srgb, var(--yellow) 84%, white);
    outline-offset: 2px;
}

.yacht-die.held,
.farkle-die.selected {
    background: var(--mint);
    box-shadow: 0 8px 0 rgba(37, 49, 74, .18), 0 0 0 4px var(--sky);
    transform: translateY(-5px);
}

.yacht-roll-panel > .btn {
    width: 100%;
}

.yacht-categories {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.yacht-categories button {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: space-between;
    padding: 9px;
}

.yacht-categories button:not(.used):hover {
    background: var(--sky);
}

.yacht-categories button.used {
    background: color-mix(in srgb, var(--mint) 40%, var(--surface));
    cursor: default;
}

.yacht-categories button span {
    font-size: 18px;
    font-weight: 900;
}

.pig-table {
    max-width: 680px;
    text-align: center;
}

.pig-roll-card {
    align-items: center;
    background: color-mix(in srgb, var(--coral) 18%, var(--surface));
    border: 3px solid var(--line);
    border-radius: 18px;
    display: flex;
    gap: 24px;
    justify-content: center;
    margin: 18px auto;
    max-width: 390px;
    padding: 22px;
}

.pig-roll-card > div:last-child {
    display: grid;
    gap: 3px;
}

.pig-roll-card > div:last-child strong {
    font-size: 50px;
}

.pig-die {
    flex: 0 0 auto;
}

.pig-die > span {
    font-size: 50px;
}

.pig-die.bust {
    animation: shake .35s ease-in-out;
    filter: saturate(1.4);
}

@keyframes dice-roll-ready-pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 0 color-mix(in srgb, var(--coral) 52%, transparent),
            0 0 0 0 color-mix(in srgb, var(--yellow) 48%, transparent);
        transform: translateY(0);
    }
    50% {
        box-shadow:
            0 0 0 7px color-mix(in srgb, var(--coral) 22%, transparent),
            0 0 0 13px color-mix(in srgb, var(--yellow) 18%, transparent);
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dice-roll-ready:where(.shared-die-visual),
    .dice-roll-ready .shared-die-visual {
        animation: none;
        box-shadow:
            0 0 0 4px color-mix(in srgb, var(--coral) 34%, transparent),
            0 0 0 8px color-mix(in srgb, var(--yellow) 24%, transparent);
    }
}

/* The first Play release is consumption-only. Bubblewrap marks its browsing
   session explicitly; normal Chrome/PWA sessions never receive this selector. */
html[data-client-platform="android-play"] [data-web-commerce] {
    display: none !important;
}

[data-android-client-only] {
    display: none !important;
}

html[data-client-platform="android-play"] [data-android-client-only] {
    display: revert !important;
}

.pig-controls,
.farkle-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.pig-controls .btn,
.farkle-controls .btn {
    min-width: 150px;
}

.farkle-table {
    max-width: 800px;
    text-align: center;
}

.farkle-score-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
    margin: 14px auto;
    max-width: 500px;
}

.farkle-score-strip article {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 3px;
    padding: 10px;
}

.farkle-score-strip strong {
    font-size: 30px;
}

.domino-chain-wrap {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.domino-chain {
    align-items: center;
    background: color-mix(in srgb, var(--mint) 16%, var(--surface));
    border: 2px dashed var(--line);
    border-radius: 12px;
    display: flex;
    gap: 5px;
    min-height: 112px;
    overflow-x: auto;
    padding: 14px;
}

.domino-end {
    background: var(--sky);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--accent-strong-text);
    cursor: pointer;
    font-weight: 900;
    min-height: 48px;
    padding: 7px;
}

.domino-empty-chain {
    color: var(--muted);
    font-weight: 800;
    margin: auto;
}

.domino-hand {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
}

.domino-tile {
    align-items: center;
    background: #fff7dc;
    border: 3px solid #24243d;
    border-radius: 9px;
    box-shadow: 0 5px 0 rgba(37, 49, 74, .2);
    color: #24243d;
    display: flex;
    flex: 0 0 auto;
    font: inherit;
    height: 54px;
    justify-content: center;
    padding: 4px;
    width: 98px;
}

button.domino-tile {
    cursor: pointer;
}

.domino-tile b {
    font-size: 23px;
    width: 38px;
}

.domino-tile i {
    background: currentColor;
    height: 38px;
    opacity: .55;
    width: 2px;
}

.domino-tile.candy {
    background: #ffd8e8;
}

.domino-tile.wood {
    background: #bf8855;
    color: #26150c;
}

.domino-tile.glass {
    background: #aeeaff;
}

.domino-tile.legal {
    box-shadow: 0 5px 0 rgba(37, 49, 74, .2), 0 0 0 3px var(--mint);
}

.domino-tile.selected {
    box-shadow: 0 8px 0 rgba(37, 49, 74, .2), 0 0 0 4px var(--coral);
    transform: translateY(-4px);
}

@media (max-width: 720px) {
    .yacht-table {
        grid-template-columns: 1fr;
    }

    .fan-tan-table,
    .yacht-table,
    .pig-table,
    .farkle-table,
    .domino-table {
        padding: 10px;
    }

    .fan-tan-row-cards {
        grid-template-columns: repeat(13, 46px);
    }

    .yacht-die,
    .farkle-die {
        height: 62px;
        width: 62px;
    }

    .yacht-die > span,
    .farkle-die > span {
        font-size: 49px;
        height: 52px;
        width: 52px;
    }

    .domino-chain-wrap {
        grid-template-columns: 1fr 1fr;
    }

    .domino-chain {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .domino-end {
        grid-row: 2;
    }
}

/* Dots and Boxes */
.dots-boxes-page {
    --dots-ink: #263047;
}

.dots-boxes-scoreboard {
    align-items: center;
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    grid-template-columns: 72px auto 1fr;
    margin: 12px auto;
    max-width: 620px;
    padding: 10px 16px;
    width: calc(100% - 24px);
}

.dots-boxes-scoreboard img {
    height: 66px;
    object-fit: contain;
    width: 66px;
}

.dots-boxes-scoreboard span,
.dots-boxes-scoreboard p {
    color: var(--muted);
    margin: 0;
}

.dots-boxes-scoreboard strong {
    display: block;
    font-size: 18px;
}

.dots-boxes-scoreboard p {
    justify-self: end;
    text-align: end;
}

.dots-boxes-paper {
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 590px;
    padding: 14px;
    width: calc(100% - 24px);
}

.dots-boxes-board {
    display: block;
    margin: auto;
    max-height: min(62vh, 560px);
    touch-action: manipulation;
    width: min(100%, 560px);
}

.dots-boxes-box {
    fill: transparent;
    rx: 7px;
    transition: fill .25s ease, transform .25s ease;
}

.dots-boxes-box.claimed {
    fill: color-mix(in srgb, var(--box-color) 32%, transparent);
    transform-box: fill-box;
    transform-origin: center;
    animation: dotsBoxClaim .42s ease-out;
}

.dots-boxes-edge {
    cursor: pointer;
    stroke: transparent;
    stroke-linecap: round;
    stroke-width: 18px;
    transition: stroke .18s ease;
}

.dots-boxes-edge.available:hover {
    stroke: color-mix(in srgb, var(--edge-color) 32%, transparent);
}

.dots-boxes-edge.drawn {
    cursor: default;
    stroke: var(--edge-color);
    stroke-width: 7px;
}

.dots-boxes-edge.just-drawn {
    animation: dotsLineDraw .38s ease-out;
}

.dots-boxes-dot {
    fill: var(--dots-ink);
    pointer-events: none;
    stroke: var(--paper);
    stroke-width: 2px;
}

@keyframes dotsLineDraw {
    from { opacity: .2; stroke-dasharray: 1 90; }
    to { opacity: 1; stroke-dasharray: 90 0; }
}

@keyframes dotsBoxClaim {
    0% { opacity: 0; transform: scale(.65) rotate(-3deg); }
    70% { transform: scale(1.08) rotate(1deg); }
    100% { opacity: 1; transform: scale(1); }
}

/* Paper Soccer */
.paper-soccer-banner {
    align-items: center;
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    margin: 12px auto;
    max-width: 660px;
    padding: 10px 14px;
    position: relative;
    width: calc(100% - 24px);
}

.paper-soccer-banner img {
    border-radius: 8px;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.paper-soccer-banner span {
    color: var(--muted);
    display: block;
}

.paper-soccer-bounce {
    animation: soccerBounce .55s ease-out;
    background: var(--accent);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--ink) !important;
    font-weight: 800;
    margin-inline-start: auto;
    padding: 8px 12px;
}

.paper-soccer-sheet {
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: auto;
    max-width: 620px;
    padding: 8px;
    width: calc(100% - 24px);
}

.paper-soccer-board {
    display: block;
    margin: auto;
    max-height: min(67vh, 660px);
    touch-action: manipulation;
    width: min(100%, 590px);
}

.paper-soccer-outline {
    fill: color-mix(in srgb, var(--mint) 10%, transparent);
    stroke: var(--line);
    stroke-linejoin: round;
    stroke-width: 3px;
}

.paper-soccer-point {
    fill: color-mix(in srgb, var(--line) 70%, var(--paper));
    stroke: var(--paper);
    stroke-width: 2px;
}

.paper-soccer-point.goal {
    fill: var(--coral);
}

.paper-soccer-point.available {
    cursor: pointer;
    fill: color-mix(in srgb, var(--paper) 86%, var(--sky));
    r: 7px;
    stroke: var(--sky);
    stroke-width: 3px;
}

.paper-soccer-point.available:hover,
.paper-soccer-point.available:focus-visible {
    fill: var(--sky);
    outline: none;
    stroke: var(--paper);
}

.paper-soccer-trail {
    stroke: var(--ink);
    stroke-linecap: round;
    stroke-width: 5px;
}

.paper-soccer-trail.just-kicked {
    animation: soccerInkDraw .52s ease-out;
}

.paper-soccer-ball {
    dominant-baseline: middle;
    font-size: 25px;
    pointer-events: none;
    text-anchor: middle;
}

.paper-soccer-ball-halo {
    animation: soccerBallPulse 1s ease-in-out infinite;
    fill: color-mix(in srgb, var(--accent) 38%, transparent);
    pointer-events: none;
}

@keyframes soccerInkDraw {
    from { opacity: .1; stroke-dasharray: 1 80; }
    to { opacity: 1; stroke-dasharray: 80 0; }
}

@keyframes soccerBallPulse {
    50% { opacity: .35; transform: scale(1.2); transform-origin: center; }
}

@keyframes soccerBounce {
    0% { opacity: 0; transform: translateY(12px) scale(.8); }
    70% { transform: translateY(-3px) scale(1.06); }
    100% { opacity: 1; transform: none; }
}

/* Bulls and Cows */
.bulls-cows-console,
.bulls-cows-history {
    margin: 12px auto;
    max-width: 760px;
    width: calc(100% - 24px);
}

.bulls-cows-console {
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.bulls-cows-secret {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 64px 1fr auto;
}

.bulls-cows-secret img {
    border-radius: 8px;
    height: 60px;
    object-fit: cover;
    width: 60px;
}

.bulls-cows-secret span {
    color: var(--muted);
    display: block;
}

.bulls-cows-code {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, 42px);
}

.bulls-cows-code span {
    align-items: center;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    display: flex;
    font-size: 24px;
    font-weight: 900;
    height: 48px;
    justify-content: center;
}

.bulls-cows-code span.filled {
    border-color: var(--accent);
    color: var(--ink);
    transform: translateY(-2px);
}

.bulls-cows-keypad {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(6, minmax(42px, 1fr));
    margin-top: 14px;
}

.bulls-cows-keypad button {
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    min-height: 44px;
}

.bulls-cows-keypad button.used {
    background: color-mix(in srgb, var(--coral) 28%, var(--panel));
    opacity: .55;
}

.bulls-cows-keypad .submit {
    background: var(--accent);
    grid-column: span 2;
}

.bulls-cows-history {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bulls-cows-history > section {
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 170px;
    padding: 12px;
}

.bulls-cows-history h2 {
    font-size: 17px;
    margin: 0 0 10px;
}

.bulls-cows-clue {
    align-items: center;
    animation: clueSlide .3s ease-out;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 45%, transparent);
    display: grid;
    gap: 8px;
    grid-template-columns: 70px 1fr 1fr;
    padding: 8px 2px;
}

.bulls-cows-clue strong {
    font-size: 19px;
    letter-spacing: 2px;
}

.bulls-cows-clue span {
    color: var(--muted);
    font-size: 12px;
}

@keyframes clueSlide {
    from { opacity: 0; transform: translateY(-8px); }
}

/* Sprouts */
.sprouts-mission,
.sprouts-route-dock,
.sprouts-paper {
    margin: 12px auto;
    max-width: 720px;
    width: calc(100% - 24px);
}

.sprouts-mission {
    align-items: center;
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: 62px 1fr auto;
    padding: 10px 14px;
}

.sprouts-mission img {
    border-radius: 8px;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.sprouts-mission span {
    color: var(--muted);
}

.sprouts-route-dock {
    align-items: center;
    background: var(--panel);
    border: 3px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 9px;
}

.sprouts-route-dock > div {
    display: flex;
    flex: 1;
    gap: 6px;
    overflow-x: auto;
}

.sprouts-route-dock [data-bend] {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    font-weight: 700;
    min-height: 38px;
    min-width: 92px;
}

.sprouts-paper {
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.sprouts-board {
    display: block;
    margin: auto;
    max-height: min(66vh, 680px);
    min-height: 420px;
    touch-action: manipulation;
    width: min(100%, 680px);
}

.sprouts-curve {
    fill: none;
    pointer-events: none;
    stroke: var(--vine-color);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25px;
}

.sprouts-curve.just-grown {
    animation: sproutsGrow .65s ease-out;
}

.sprouts-spot {
    cursor: default;
}

.sprouts-spot circle {
    fill: var(--paper);
    stroke: var(--line);
    stroke-width: 1px;
}

.sprouts-spot text {
    fill: var(--ink);
    font-size: 3px;
    font-weight: 900;
    pointer-events: none;
    text-anchor: middle;
}

.sprouts-spot.available {
    cursor: pointer;
}

.sprouts-spot.available circle {
    animation: sproutPulse 1.1s ease-in-out infinite;
    fill: color-mix(in srgb, var(--mint) 50%, var(--paper));
}

.sprouts-spot.selected circle {
    fill: var(--accent);
    filter: drop-shadow(0 0 2px var(--accent));
    r: 4.3px;
}

@keyframes sproutsGrow {
    from { opacity: .15; stroke-dasharray: 1 200; }
    to { opacity: 1; stroke-dasharray: 200 0; }
}

@keyframes sproutPulse {
    50% { filter: drop-shadow(0 0 2px var(--mint)); transform: scale(1.15); transform-origin: center; }
}

/* SOS */
.sos-toolbar,
.sos-paper {
    margin: 12px auto;
    max-width: 650px;
    width: calc(100% - 24px);
}

.sos-toolbar {
    align-items: center;
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: 60px 1fr auto;
    padding: 10px 14px;
}

.sos-toolbar img {
    border-radius: 8px;
    height: 56px;
    object-fit: cover;
    width: 56px;
}

.sos-toolbar span {
    color: var(--muted);
    display: block;
}

.sos-symbols {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, 58px);
}

.sos-symbols button {
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 900;
    height: 52px;
}

.sos-symbols button.selected {
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
    transform: translateY(-2px);
}

.sos-paper {
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.sos-board {
    aspect-ratio: 1;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(6, 1fr);
    position: relative;
}

.sos-cell {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 2px solid color-mix(in srgb, var(--line) 75%, transparent);
    border-radius: 6px;
    color: var(--ink);
    font-size: clamp(22px, 6vw, 46px);
    font-weight: 900;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.sos-cell:not(:disabled):hover {
    background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

.sos-cell.just-played {
    animation: sosStamp .38s ease-out;
}

.sos-lines {
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 2;
}

.sos-score-line {
    opacity: .78;
    stroke: var(--sos-line-color);
    stroke-linecap: round;
    stroke-width: 13px;
}

.sos-score-line.just-scored {
    animation: sosSignal .65s ease-out;
}

@keyframes sosStamp {
    0% { opacity: 0; transform: scale(1.65) rotate(-8deg); }
    70% { transform: scale(.9) rotate(2deg); }
    100% { opacity: 1; transform: none; }
}

@keyframes sosSignal {
    from { opacity: 0; stroke-dasharray: 1 600; }
    to { opacity: .78; stroke-dasharray: 600 0; }
}

@media (max-width: 600px) {
    .sos-toolbar {
        grid-template-columns: 48px 1fr;
    }

    .sos-toolbar img {
        height: 46px;
        width: 46px;
    }

    .sos-symbols {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .sos-board {
        gap: 3px;
    }
}

@media (max-width: 600px) {
    .sprouts-route-dock {
        align-items: stretch;
        flex-direction: column;
    }

    .sprouts-board {
        min-height: 340px;
    }
}

@media (max-width: 600px) {
    .bulls-cows-secret {
        grid-template-columns: 50px 1fr;
    }

    .bulls-cows-code {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .bulls-cows-keypad {
        grid-template-columns: repeat(4, 1fr);
    }

    .bulls-cows-history {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dots-boxes-scoreboard {
        grid-template-columns: 54px 1fr;
    }

    .dots-boxes-scoreboard img {
        height: 50px;
        width: 50px;
    }

    .dots-boxes-scoreboard p {
        grid-column: 1 / -1;
        justify-self: start;
        text-align: start;
    }
}

.hundred-hop-game {
    display: grid;
    gap: 12px;
    margin: 0 auto;
    max-width: 980px;
}

.hundred-hop-row {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 13px 0;
}

.hundred-hop-cell {
    align-content: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .68);
    border: 2px dashed rgba(37, 49, 74, .35);
    border-radius: 7px;
    color: rgba(37, 49, 74, .38);
    display: grid;
    font-size: 11px;
    justify-items: center;
    min-width: 0;
    position: relative;
}

.hundred-hop-cell.filled {
    background: #fffdf8;
    border-color: #25314a;
    border-style: solid;
    color: #25314a;
}

.hundred-hop-cell.filled.just-filled {
    animation: hundred-hop-write .26s cubic-bezier(.18, .8, .2, 1.15) both;
}

.hundred-hop-cell.next {
    animation: hundred-hop-next 1.2s ease-in-out infinite;
    border-color: var(--player-color);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--player-color) 20%, transparent);
}

.hundred-hop-cell strong {
    font-size: clamp(14px, 2.5vw, 21px);
    line-height: 1;
}

.hundred-hop-cell small {
    color: #64708a;
    font-size: 9px;
    font-weight: 800;
    margin-top: 3px;
}

.hundred-hop-console {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 3px solid var(--status-text);
    border-radius: 8px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .18);
    overflow: hidden;
    position: relative;
}

.hundred-hop-control-panel {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 7px;
    position: relative;
}

.hundred-hop-die-stage {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    min-width: 0;
}

.hundred-hop-die {
    align-items: center;
    background: #fff8df;
    border: 3px solid #25314a;
    border-radius: 14px;
    box-shadow: 0 7px 0 rgba(37, 49, 74, .24);
    color: #25314a;
    display: flex;
    font-size: 34px;
    font-weight: 900;
    justify-content: center;
    position: relative;
}

.hundred-hop-die.is-3d:not(.dice-roll-ready) {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.hundred-hop-die.rolling:not(.is-3d) {
    animation: ww-die-tumble .72s cubic-bezier(.35, .05, .55, .95) infinite;
}

.hundred-hop-roll {
    grid-column: 2;
    grid-row: 1;
    min-width: 108px;
}

.hundred-hop-choices {
    display: grid;
    gap: 9px;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hundred-hop-choice {
    background: var(--surface);
    border: 3px solid var(--status-text);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 2px;
    grid-template-rows: auto auto;
    min-height: 54px;
    padding: 4px 6px;
    text-align: center;
}

.hundred-hop-choice.tiny {
    border-color: var(--accent-strong);
}

.hundred-hop-choice.tenfold {
    border-color: var(--warning);
}

.hundred-hop-choice:hover:not(:disabled) {
    transform: translateY(-2px);
}

.hundred-hop-choice:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.hundred-hop-choice.will-bust {
    border-color: var(--danger);
}

.hundred-hop-choice small,
.hundred-hop-choice span {
    font-size: 10px;
    font-weight: 800;
}

.hundred-hop-choice strong {
    color: var(--text);
    font-size: 20px;
}

.hundred-hop-choice-result {
    align-items: baseline;
    display: flex;
    gap: 7px;
    justify-content: center;
    min-width: 0;
}

.hundred-hop-paper-wrap {
    min-width: 0;
}

.hundred-hop-paper {
    background:
        repeating-linear-gradient(#fffaf0 0 37px, #bbd9ee 38px, #fffaf0 39px);
    border: 3px solid #25314a;
    border-radius: 8px;
    box-shadow: 0 9px 0 rgba(37, 49, 74, .2);
    color: #202942;
    overflow: hidden;
    padding: 12px;
}

.hundred-hop-paper-header {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(var(--player-count, 2), minmax(0, 1fr));
    margin-bottom: 8px;
    text-align: center;
}

.hundred-hop-paper-header strong {
    color: var(--player-color);
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hundred-hop-paper-row {
    border-top: 2px solid rgba(37, 49, 74, .28);
    padding: 10px 0;
    transition: filter .2s ease, opacity .2s ease;
}

.hundred-hop-row-lanes {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(var(--player-count, 2), minmax(0, 1fr));
}

.hundred-hop-paper-row.complete {
    background: rgba(91, 99, 116, .12);
}

.hundred-hop-paper-row.complete .hundred-hop-player-lane:not(.winner) {
    filter: grayscale(.78);
    opacity: .68;
}

.hundred-hop-paper-row.future {
    opacity: .48;
}

.hundred-hop-player-lane {
    align-content: center;
    border: 2px solid transparent;
    border-radius: 7px;
    display: grid;
    min-width: 0;
    padding: 6px;
}

.hundred-hop-player-lane + .hundred-hop-player-lane {
    border-left-color: rgba(239, 71, 111, .42);
    border-left-style: solid;
}

.hundred-hop-player-lane.active {
    border-color: var(--player-color);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--player-color) 16%, transparent);
}

.hundred-hop-player-lane.winner {
    background: color-mix(in srgb, var(--player-color) 15%, #fffdf8);
    border-color: var(--player-color);
}

.hundred-hop-player-lane.busted {
    background: rgba(239, 71, 111, .10);
}

.hundred-hop-row-result {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 27px;
    padding: 0 4px 5px;
    text-align: center;
}

.hundred-hop-row-result strong {
    color: #56617a;
    font-size: 11px;
    line-height: 1.15;
}

.hundred-hop-row-result strong.winner {
    background: color-mix(in srgb, var(--winner-color) 22%, #fffdf8);
    border: 2px solid var(--winner-color);
    border-radius: 999px;
    color: #202942;
    padding: 5px 7px;
}

.hundred-hop-lane-total {
    color: #56617a;
    font-size: 10px;
    font-weight: 900;
    margin-top: 5px;
    text-align: center;
}

@keyframes hundred-hop-write {
    from { opacity: .3; transform: rotate(-5deg) scale(.72); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes hundred-hop-next {
    50% { background: color-mix(in srgb, var(--player-color) 15%, #fffdf8); }
}

@media (max-width: 720px) {
    .hundred-hop-control-panel {
        grid-template-columns: 58px minmax(0, 1fr);
    }
}

@media (max-width: 440px) {
    .hundred-hop-page {
        padding: 10px;
    }

    .hundred-hop-paper {
        padding: 8px;
    }

    .hundred-hop-paper-row {
        gap: 4px;
        padding: 7px 0;
    }

    .hundred-hop-row-lanes {
        gap: 3px;
    }

    .hundred-hop-player-lane {
        padding: 3px;
    }

    .hundred-hop-row {
        gap: 2px;
    }

    .hundred-hop-cell strong {
        font-size: 11px;
    }

    .hundred-hop-cell small {
        font-size: 7px;
    }

    .hundred-hop-row-result strong {
        font-size: 9px;
    }

}

.flip-nine-game {
    display: grid;
    gap: 12px;
    margin: 0 auto;
    max-width: 980px;
}

.flip-nine-page .game-player-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flip-nine-page .game-player-strip.three-player {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flip-nine-deck-banner {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 3px solid var(--status-text);
    border-radius: 8px;
    box-shadow: 0 7px 0 rgba(37, 49, 74, .18);
    color: var(--text);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 13px;
}

.flip-nine-deck-banner span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.flip-nine-deck-banner strong {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 9px;
}

.flip-nine-boards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flip-nine-boards.three-player {
    align-items: start;
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr);
}

.flip-nine-boards.three-player .flip-nine-board.self {
    grid-row: span 2;
}

.flip-nine-board {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--player-color) 20%, transparent), transparent 32%),
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--player-color)), var(--surface));
    border: 3px solid color-mix(in srgb, var(--line) 64%, var(--player-color));
    border-radius: 8px;
    box-shadow: 0 9px 0 rgba(37, 49, 74, .18);
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    position: relative;
}

.flip-nine-board.self {
    border-color: var(--player-color);
    box-shadow:
        0 9px 0 color-mix(in srgb, var(--player-color) 18%, rgba(37, 49, 74, .18)),
        0 0 0 3px color-mix(in srgb, var(--player-color) 18%, transparent);
}

.flip-nine-board.waiting .flip-nine-grid,
.flip-nine-board.complete .flip-nine-grid {
    filter: saturate(.72);
    opacity: .82;
}

.flip-nine-board > header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    min-height: 52px;
}

.flip-nine-expand {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 17px;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.flip-nine-board.compact {
    gap: 6px;
    padding: 9px;
}

.flip-nine-board.compact > header {
    justify-content: space-between;
    min-height: 36px;
}

.flip-nine-board.compact > header > strong {
    font-size: 14px;
}

.flip-nine-board.compact .flip-nine-play-area {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 44px;
}

.flip-nine-board.compact .flip-nine-deck-pile .playing-card {
    height: 58px;
    width: 42px;
}

.flip-nine-board.compact .flip-nine-grid {
    gap: 4px;
    padding: 6px;
}

.flip-nine-board.compact > footer {
    min-height: 22px;
}

.flip-nine-board.compact.expanded {
    left: 50%;
    max-height: calc(100vh - 32px);
    max-width: 560px;
    overflow: auto;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    z-index: 90;
    box-shadow: 0 0 0 100vmax rgba(8, 12, 34, .72), 0 12px 28px rgba(8, 12, 34, .38);
}

.flip-nine-board.compact.expanded .flip-nine-play-area {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 54px;
}

.flip-nine-board.compact.expanded .flip-nine-deck-pile .playing-card {
    height: 72px;
    width: 51px;
}

.flip-nine-board.compact.expanded .flip-nine-grid {
    gap: 8px;
    padding: 11px;
}

.flip-nine-play-area {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 54px minmax(0, 1fr);
}

.flip-nine-board:not(.self) .flip-nine-play-area {
    grid-template-columns: minmax(0, 1fr) 54px;
}

.flip-nine-board:not(.self) .flip-nine-deck-pile {
    grid-column: 2;
    grid-row: 1;
}

.flip-nine-board:not(.self) .flip-nine-grid {
    grid-column: 1;
    grid-row: 1;
}

.flip-nine-board.compact:not(.self) .flip-nine-play-area {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.flip-nine-board > header > strong {
    color: var(--text);
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flip-nine-grid {
    background:
        linear-gradient(125deg, rgba(255, 255, 255, .11), transparent 30%),
        color-mix(in srgb, var(--player-color) 16%, #1e614d);
    border: 3px solid color-mix(in srgb, var(--line) 70%, #1e614d);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 11px;
    position: relative;
}

.flip-nine-board > footer {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 48px;
}

.flip-nine-board > footer > strong {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.playing-card {
    --card-red: #d53f57;
    --card-ink: #25233a;
    align-items: center;
    aspect-ratio: 5 / 7;
    background: #fffdf8;
    border: 2px solid #25233a;
    border-radius: 8px;
    box-shadow: 0 5px 0 rgba(21, 28, 45, .26);
    color: var(--card-ink);
    display: grid;
    font: inherit;
    justify-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 4px;
    position: relative;
    transform-style: preserve-3d;
    transition: box-shadow .16s ease, transform .16s ease;
}

.playing-card-face {
    display: block;
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

button.playing-card {
    cursor: pointer;
    width: 100%;
}

.playing-card.selected {
    box-shadow: 0 9px 0 rgba(21, 28, 45, .26), 0 0 0 3px var(--sky);
    transform: translateY(-5px) rotate(-1deg);
}

@media (hover: hover) and (pointer: fine) {
    button.playing-card:hover:not(:disabled) {
        box-shadow: 0 9px 0 rgba(21, 28, 45, .26), 0 0 0 3px var(--sky);
        transform: translateY(-5px) rotate(-1deg);
    }
}

.playing-card:disabled {
    cursor: default;
}

.playing-card.red {
    color: var(--card-red);
}

.playing-card-corner {
    display: grid;
    font-style: normal;
    justify-items: center;
    line-height: .9;
    position: absolute;
    z-index: 2;
}

.playing-card-corner b {
    font-size: clamp(11px, 1.8vw, 18px);
}

.playing-card-corner i {
    font-size: clamp(10px, 1.6vw, 16px);
    font-style: normal;
}

.playing-card-corner.top {
    left: 5px;
    top: 5px;
}

.playing-card-corner.bottom {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
}

.playing-card-center {
    display: block;
    inset: 15% 13%;
    position: absolute;
}

.playing-card-center.pip-layout i {
    font-size: clamp(11px, 2.2vw, 24px);
    font-style: normal;
    line-height: 1;
    position: absolute;
    text-shadow: 0 1px 0 rgba(37, 35, 58, .14);
    transform: translate(-50%, -50%);
}

.playing-card-center.pip-layout i.inverted {
    transform: translate(-50%, -50%) rotate(180deg);
}

.playing-card-center.ace-layout {
    align-items: center;
    display: flex;
    font-size: clamp(31px, 6vw, 64px);
    justify-content: center;
    text-shadow: 0 3px 0 rgba(37, 35, 58, .12);
}

.playing-card-center.court-layout {
    background: #f7efd9;
    border: 2px solid currentColor;
    border-radius: 5px;
    inset: 11% 15%;
    overflow: hidden;
}

.playing-card-center.court-layout:after {
    background: currentColor;
    content: "";
    height: 2px;
    left: 7%;
    opacity: .72;
    position: absolute;
    right: 7%;
    top: calc(50% - 1px);
    z-index: 2;
}

.court-portrait {
    height: 50%;
    left: 0;
    object-fit: contain;
    position: absolute;
    width: 100%;
}

.court-portrait.top {
    top: 0;
}

.court-portrait.bottom {
    bottom: 0;
    transform: rotate(180deg);
}

.court-suit {
    align-items: center;
    background: #fffdf8;
    border: 1px solid currentColor;
    border-radius: 999px;
    display: flex;
    font-size: clamp(8px, 1.4vw, 13px);
    font-style: normal;
    height: 18px;
    justify-content: center;
    position: absolute;
    width: 18px;
    z-index: 3;
}

.court-suit.top {
    right: 4px;
    top: calc(50% - 20px);
}

.court-suit.bottom {
    bottom: calc(50% - 20px);
    left: 4px;
    transform: rotate(180deg);
}

.playing-card.deck-candy:not(.face-down) {
    background: linear-gradient(145deg, #fffdf8, #fff0f6);
    border-color: #a83f72;
}

.playing-card.deck-candy .playing-card-center.court-layout {
    background-color: #fff0d8;
    border-radius: 7px;
}

.playing-card.deck-midnight:not(.face-down) {
    --card-ink: #f7cf6b;
    --card-red: #ff879f;
    background: linear-gradient(145deg, #232443, #111426);
    border-color: #f7cf6b;
}

.playing-card.deck-midnight .playing-card-center.court-layout {
    background-color: #f6e8c7;
    border-color: #f7cf6b;
}

.playing-card.deck-pocket-parade:not(.face-down) {
    --card-ink: #25233a;
    --card-red: #d94b5f;
    background: linear-gradient(145deg, #fffdf8, #fff2e2);
    border-color: #3b315f;
}

.playing-card.deck-pocket-parade .playing-card-center.court-layout {
    background: linear-gradient(145deg, #fff7e8, #f5e6ff);
    border-radius: 7px;
}

.playing-card.face-down {
    background: #f7f2e7;
    padding: 5px;
}

.playing-card-back {
    background:
        radial-gradient(circle, #fff 0 2px, transparent 3px) 0 0 / 12px 12px,
        linear-gradient(135deg, transparent 38%, rgba(255, 255, 255, .46) 40% 46%, transparent 48%),
        #315b9f;
    border: 2px solid #fffdf8;
    border-radius: 5px;
    box-shadow: inset 0 0 0 2px #25314a;
    height: 100%;
    width: 100%;
}

.playing-card.deck-candy .playing-card-back {
    background:
        radial-gradient(circle at 25% 25%, #fff2a8 0 4px, transparent 5px) 0 0 / 22px 22px,
        radial-gradient(circle at 75% 75%, #85e0d2 0 4px, transparent 5px) 0 0 / 22px 22px,
        #ef7fa5;
}

.playing-card.deck-midnight .playing-card-back {
    background:
        radial-gradient(circle, #f7cf6b 0 2px, transparent 3px) 0 0 / 14px 14px,
        linear-gradient(135deg, transparent 42%, rgba(247, 207, 107, .42) 44% 48%, transparent 50%),
        #191938;
}

.playing-card.deck-pocket-parade .playing-card-back {
    background: #f8e8ca url("../images/games/cards/pocket-parade/back.webp") center / contain no-repeat;
    border: 0;
    box-shadow: none;
}

.playing-card.deck-storybook:not(.face-down) {
    --card-ink: #173c42;
    --card-red: #c34d62;
    background: linear-gradient(145deg, #fff9e8, #eef8f0);
    border-color: #9b6b31;
}

.playing-card.deck-storybook .playing-card-center.court-layout {
    background: linear-gradient(145deg, #f7edd1, #d9f0e6);
    border-color: #9b6b31;
}

.playing-card.deck-storybook .playing-card-back {
    background:
        radial-gradient(ellipse at 50% 37%, #ffe29b 0 4%, transparent 5%),
        linear-gradient(90deg, transparent 44%, #c8994f 45% 55%, transparent 56%),
        radial-gradient(ellipse at 50% 108%, #173f46 0 47%, transparent 48%),
        linear-gradient(145deg, #153b43, #295c55);
    border: 3px double #e8ba68;
    box-shadow: inset 0 0 0 3px #13333c;
}

.playing-card.deck-persian-miniature:not(.face-down) {
    --card-ink: #153a50;
    --card-red: #c84d5c;
    background: linear-gradient(145deg, #fff9e9, #e8f5ef);
    border-color: #c4973e;
}

.playing-card.deck-persian-miniature .playing-card-center.court-layout {
    background: linear-gradient(145deg, #fff4d7, #dcefe6);
    border-color: #2d827d;
}

.playing-card.deck-persian-miniature .playing-card-back {
    background: transparent url("../images/games/cards/persian-miniature/back.webp") center / cover no-repeat;
    border: 0;
    box-shadow: none;
}

.playing-card.deck-retro-pc {
    background: transparent;
    border: 0;
    border-radius: 7px;
    box-shadow: none;
    padding: 0;
}

.playing-card.deck-retro-pc.face-down {
    background: transparent;
    padding: 0;
}

.playing-card-retro-sprite {
    background-image: url("../images/games/cards/retro-pc/deck-classic.webp");
    background-repeat: no-repeat;
    background-size: 1400% 400%;
    display: block;
    filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .24));
    height: 100%;
    width: 100%;
}

.playing-card.deck-retro-pc .playing-card-back {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.playing-card.lost-card {
    filter: grayscale(.25);
}

.flip-nine-choices {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.flip-nine-guess {
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: #25233a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    min-height: 42px;
}

.flip-nine-guess.higher {
    background: #9ee6c0;
}

.flip-nine-guess.lower {
    background: #ffc0d2;
}

.flip-nine-guess:disabled {
    cursor: not-allowed;
    filter: grayscale(.7);
    opacity: .5;
}

.flip-nine-deck-pile {
    align-items: center;
    display: grid;
    gap: 7px;
    justify-items: center;
}

.flip-nine-deck-pile .playing-card {
    aspect-ratio: 5 / 7;
    box-shadow: 3px 3px 0 #fffdf8, 6px 6px 0 rgba(37, 35, 58, .3);
    height: 72px;
    width: 51px;
}

.flip-nine-deck-pile > strong {
    color: var(--text);
    font-size: 11px;
    max-width: 54px;
    text-align: center;
}

.flip-nine-deck-pile > span {
    background: color-mix(in srgb, var(--sky) 24%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
    border-radius: 999px;
    color: var(--text);
    font-size: 9px;
    font-weight: 900;
    line-height: 1.2;
    padding: 3px 5px;
    text-align: center;
    white-space: nowrap;
}

.flip-nine-flying-card {
    margin: 0;
    overflow: visible;
    pointer-events: none;
    position: fixed;
    z-index: 100;
}

.flip-nine-flying-card.landed {
    transition: box-shadow .2s ease, filter .2s ease;
}

.flip-nine-flying-card.correct.landed {
    box-shadow: 0 0 0 4px #72d5a2, 0 10px 20px rgba(21, 28, 45, .3);
}

.flip-nine-flying-card.wrong.landed,
.flip-nine-flying-card.equal.landed {
    box-shadow: 0 0 0 4px #ef6d88, 0 10px 20px rgba(21, 28, 45, .3);
}

.flip-nine-flying-card.leaving {
    filter: saturate(.4);
    opacity: 0;
    transition: filter .2s ease, opacity .24s ease, transform .24s ease;
}

.playing-card.rejecting {
    animation: flip-nine-slot-out .28s ease-in forwards;
}

.playing-card.flipped-down {
    animation: flip-nine-slot-in .38s ease-out both;
}

.playing-card.accepted {
    animation: flip-nine-card-stick .34s cubic-bezier(.18, .82, .25, 1.2) both;
}

.flip-nine-reveal-note {
    background: #25233a;
    border: 2px solid #fff;
    border-radius: 999px;
    bottom: -15px;
    color: #fff;
    font-size: 9px;
    left: 50%;
    padding: 4px 7px;
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

@keyframes flip-nine-slot-out {
    to { filter: saturate(.3); transform: rotateY(90deg) scale(.92); }
}

@keyframes flip-nine-slot-in {
    from { transform: rotateY(-90deg) scale(.92); }
    to { transform: rotateY(0) scale(1); }
}

@keyframes flip-nine-card-stick {
    from { transform: translateY(-8px) scale(1.08); }
    to { transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
    .collection-page .brand-subtitle {
        display: none;
    }

    .flip-nine-boards {
        grid-template-columns: 1fr;
    }

    .flip-nine-boards.three-player {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flip-nine-boards.three-player .flip-nine-board.self {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .flip-nine-page .game-player-strip.three-player {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow-x: visible;
        padding-bottom: 0;
    }

    .flip-nine-page .game-player-strip.three-player .game-player-card:first-child {
        grid-column: auto;
    }

    .flip-nine-board:not(.self) footer {
        min-height: 24px;
    }
}

@media (max-width: 440px) {
    .flip-nine-page {
        padding: 10px;
    }

    .flip-nine-deck-banner {
        justify-content: flex-end;
        padding: 8px;
    }

    .flip-nine-deck-banner span {
        display: none;
    }

    .flip-nine-grid {
        gap: 6px;
        padding: 8px;
    }

    .flip-nine-play-area,
    .flip-nine-board:not(.self) .flip-nine-play-area {
        gap: 7px;
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .flip-nine-board:not(.self) .flip-nine-deck-pile {
        grid-column: 1;
    }

    .flip-nine-board:not(.self) .flip-nine-grid {
        grid-column: 2;
    }

    .flip-nine-deck-pile .playing-card {
        height: 56px;
        width: 40px;
    }

    .flip-nine-board.self .flip-nine-grid {
        justify-self: center;
        width: min(100%, 300px);
    }

    .flip-nine-board.compact {
        padding: 6px;
    }

    .flip-nine-board.compact .flip-nine-play-area {
        display: block;
    }

    .flip-nine-board.compact .flip-nine-deck-pile {
        display: none;
    }

    .flip-nine-board.compact.expanded .flip-nine-play-area {
        display: grid;
    }

    .flip-nine-board.compact.expanded .flip-nine-deck-pile {
        display: grid;
    }

    .flip-nine-page .game-status-actions {
        justify-content: flex-end;
    }

    .flip-nine-page .move-timer {
        flex: 0 0 54px;
    }

    .flip-nine-page .game-player-card,
    .flip-nine-page .game-player-card.bot-player-card {
        gap: 6px;
        grid-template-columns: 42px minmax(0, 1fr) 32px;
        padding: 6px;
    }

    .flip-nine-page .game-player-strip.three-player .game-player-card,
    .flip-nine-page .game-player-strip.three-player .game-player-card.bot-player-card {
        gap: 3px;
        grid-template-columns: 32px minmax(0, 1fr) 24px;
        padding: 4px;
    }

    .flip-nine-page .game-player-strip.three-player .game-player-avatar,
    .flip-nine-page .game-player-strip.three-player .game-player-card img,
    .flip-nine-page .game-player-strip.three-player .game-player-card .bot-player-image {
        width: 32px;
    }

    .flip-nine-page .game-player-strip.three-player .game-player-marker {
        font-size: 10px;
        height: 24px;
        width: 24px;
    }

    .flip-nine-page .game-player-avatar,
    .flip-nine-page .game-player-card.bot-player-card .game-player-avatar,
    .flip-nine-page .game-player-card img,
    .flip-nine-page .game-player-card .bot-player-image {
        width: 42px;
    }

    .flip-nine-page .game-player-card strong {
        font-size: 11px;
    }

    .flip-nine-page .game-player-marker {
        font-size: 13px;
        height: 32px;
        width: 32px;
    }

    .playing-card-corner.top {
        left: 3px;
        top: 4px;
    }

    .playing-card-corner.bottom {
        bottom: 4px;
        right: 3px;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #00092d;
    --bg-2: #16205a;
    --surface: #2c2f39;
    --surface-2: #362b54;
    --surface-3: #263e64;
    --text: #fff8ff;
    --muted: #d6cde7;
    --line: #f4e9ff;
    --ink: #fff8ff;
    --pink: #ff8fab;
    --coral: #ff8577;
    --yellow: #ff8fab;
    --sky: #8bdcff;
    --mint: #a2f2ac;
    --violet: #c4b5fd;
    --orange: #ffc078;
    --boo-primary: #ffffff;
    --boo-gray: #ffffff;
    --boo-light-primary: #4d4b54;
    --accent-strong: #7dd3fc;
    --accent-strong-text: #0b1730;
    --danger: #ff8fab;
    --danger-bg: #4a2639;
    --danger-text: #fff0f7;
    --draw-bg: #524416;
    --draw-text: #fff7cc;
    --input-bg: #17142c;
    --panel-sunny: #3c2c5e;
    --panel-pink: #4a294c;
    --panel-sky: #203a5a;
    --paper-surface: #fffdf8;
    --paper-warm: #fffaf0;
    --status-bg: rgba(255, 250, 240, .90);
    --status-text: #25314a;
    --status-turn-you-bg: color-mix(in srgb, var(--surface) 72%, var(--palette-primary));
    --status-turn-opponent-bg: #4a2639;
    --toast-bg: rgba(37, 35, 58, .94);
    --toast-text: #fff8ff;
    --nav-bg: #2c2f39;
    --nav-shadow: 0 0 3px .05rem rgba(255, 255, 255, .16);
    --shadow: 0 0 transparent;
    --soft-shadow: 0 18px 40px rgba(0, 0, 0, .38);
}

html[data-palette="dice-pop"] {
    --bg: #f0f7ff;
    --bg-2: #fff7df;
    --surface-2: #fff2cc;
    --surface-3: #e7fbff;
    --pink: #ff7aa2;
    --coral: #ff6b4a;
    --yellow: #ffd866;
    --sky: #5ecbff;
    --mint: #8cf0c2;
    --violet: #8b7cff;
    --orange: #ffad57;
    --accent-strong: #1f6feb;
    --accent-strong-text: #10346f;
    --palette-primary: var(--coral);
    --palette-secondary: var(--sky);
    --input-bg: #f0f7ff;
    --panel-sunny: #fff0c7;
    --panel-pink: #ffe2ee;
    --panel-sky: #ddf8ff;
    --nav-bg: #fffdf8;
}

html[data-palette="mint-board"] {
    --bg: #eef8f2;
    --bg-2: #eef4ff;
    --surface-2: #e5fff0;
    --surface-3: #e9f6ff;
    --pink: #ff8a7a;
    --coral: #ff766d;
    --yellow: #ffe08a;
    --sky: #7aa7ff;
    --mint: #48d597;
    --violet: #a691ff;
    --orange: #ffb36b;
    --accent-strong: #2f7dff;
    --accent-strong-text: #17345c;
    --palette-primary: var(--mint);
    --palette-secondary: var(--sky);
    --input-bg: #eef8f2;
    --panel-sunny: #fff6d9;
    --panel-pink: #ffe5e2;
    --panel-sky: #e0f9ec;
    --nav-bg: #fbfffc;
}

html[data-palette="arcade-night"] {
    --bg: #eef2ff;
    --bg-2: #f3ecff;
    --surface-2: #f1e8ff;
    --surface-3: #e2fbff;
    --pink: #ff6fb1;
    --coral: #ff6b7f;
    --yellow: #ffe66d;
    --sky: #4ed7ff;
    --mint: #6dffb5;
    --violet: #8b5cf6;
    --orange: #ffae57;
    --accent-strong: #6f46ff;
    --accent-strong-text: #24135c;
    --palette-primary: var(--pink);
    --palette-secondary: var(--sky);
    --input-bg: #eef2ff;
    --panel-sunny: #fff5c2;
    --panel-pink: #ffe0f0;
    --panel-sky: #def8ff;
    --nav-bg: #fffaff;
}

html[data-moonlit-owned="yes"][data-palette="moonlit-clubhouse"] {
    --bg: #e9edff;
    --bg-2: #dff8f5;
    --surface-2: #ece8ff;
    --surface-3: #dcf7f3;
    --pink: #c49bf5;
    --coral: #ef7f9b;
    --yellow: #f8ca78;
    --sky: #8aa8ff;
    --mint: #68e0cf;
    --violet: #8573d8;
    --orange: #f2a86f;
    --accent-strong: #5a63d8;
    --accent-strong-text: #171a38;
    --palette-primary: var(--sky);
    --palette-secondary: var(--mint);
    --input-bg: #eef0ff;
    --panel-sunny: #fff0c9;
    --panel-pink: #eee5ff;
    --panel-sky: #dff8f5;
    --nav-bg: #f8f7ff;
}

html[data-theme="dark"][data-palette="dice-pop"] {
    --bg: #111827;
    --bg-2: #26324c;
    --surface: #2b3140;
    --surface-2: #4d3a23;
    --surface-3: #24415a;
    --text: #fff8f0;
    --muted: #e8dccc;
    --line: #fff4e8;
    --ink: #fff8f0;
    --pink: #ff7aa2;
    --coral: #ff7c5c;
    --yellow: #ffd866;
    --sky: #5ecbff;
    --mint: #8cf0c2;
    --violet: #a39bff;
    --orange: #ffba73;
    --accent-strong: #5ecbff;
    --accent-strong-text: #071e30;
    --danger: #ff7aa2;
    --danger-bg: #593144;
    --danger-text: #ffe6ef;
    --input-bg: #1e2535;
    --panel-sunny: #4d3a23;
    --panel-pink: #563145;
    --panel-sky: #24415a;
    --nav-bg: #2b3140;
}

html[data-theme="dark"][data-palette="mint-board"] {
    --bg: #071f1b;
    --bg-2: #123b35;
    --surface: #24342f;
    --surface-2: #24423a;
    --surface-3: #1f3c4b;
    --text: #f4fff8;
    --muted: #cde7db;
    --line: #f3fff7;
    --ink: #f4fff8;
    --pink: #ff988c;
    --coral: #ff8378;
    --yellow: #ffe08a;
    --sky: #8fb5ff;
    --mint: #64e0a7;
    --violet: #b5a7ff;
    --orange: #ffc07d;
    --accent-strong: #64e0a7;
    --accent-strong-text: #07251b;
    --danger: #ff988c;
    --danger-bg: #55312d;
    --danger-text: #ffe9e6;
    --input-bg: #132720;
    --panel-sunny: #4a3f24;
    --panel-pink: #4b302f;
    --panel-sky: #1f3d35;
    --nav-bg: #24342f;
}

html[data-theme="dark"][data-palette="arcade-night"] {
    --bg: #090a2a;
    --bg-2: #16134b;
    --surface: #222338;
    --surface-2: #30224a;
    --surface-3: #193c55;
    --text: #fff8ff;
    --muted: #d9d4ff;
    --line: #f5efff;
    --ink: #fff8ff;
    --pink: #ff6fb1;
    --coral: #ff6b7f;
    --yellow: #ffe66d;
    --sky: #4ed7ff;
    --mint: #6dffb5;
    --violet: #a78bfa;
    --orange: #ffb46b;
    --accent-strong: #4ed7ff;
    --accent-strong-text: #07192d;
    --danger: #ff6fb1;
    --danger-bg: #542144;
    --danger-text: #ffe8f5;
    --input-bg: #151634;
    --panel-sunny: #443718;
    --panel-pink: #4e2448;
    --panel-sky: #193c55;
    --nav-bg: #222338;
}

html[data-moonlit-owned="yes"][data-theme="dark"][data-palette="moonlit-clubhouse"] {
    --bg: #10132d;
    --bg-2: #172c3f;
    --surface: #202641;
    --surface-2: #30254c;
    --surface-3: #153f48;
    --text: #f7f4ff;
    --muted: #d8daf2;
    --line: #f5efff;
    --ink: #f7f4ff;
    --pink: #d3a4ff;
    --coral: #ff8ca7;
    --yellow: #f8ca78;
    --sky: #9db6ff;
    --mint: #73e5d4;
    --violet: #ad9af7;
    --orange: #f6b477;
    --accent-strong: #73e5d4;
    --accent-strong-text: #091d28;
    --input-bg: #171b36;
    --panel-sunny: #44391f;
    --panel-pink: #382747;
    --panel-sky: #173b44;
    --nav-bg: #202641;
}

* {
    box-sizing: border-box;
}

/* Keep centered page shells still when navigation changes scrollbar visibility. */
html {
    scrollbar-gutter: stable;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Quicksand", "Open Sans", Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
}

html[data-theme="dark"] body {
    background: var(--bg);
}

body.theme-dark {
    background-color: var(--bg);
}

html.app-frame-document,
html.app-frame-document body {
    height: 100%;
    overflow: hidden;
}

html.app-frame-document {
    scrollbar-gutter: auto;
}

.app-frame-host {
    display: flex;
    flex-direction: column;
    margin: 0;
    /* The shared 100vh body minimum can outlive Android's visible viewport after a return. */
    min-height: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-frame {
    border: 0;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.app-frame-host > .bottom-nav {
    flex: 0 0 auto;
    position: static;
}

html.app-embedded .bottom-nav {
    display: none;
}

.app-frame-host > .app-audio-floating {
    display: none;
}

.pull-refresh-indicator {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 25%, transparent);
    color: var(--text);
    display: flex;
    font-size: 12px;
    gap: 7px;
    left: 50%;
    opacity: 0;
    padding: 7px 11px;
    pointer-events: none;
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    transform: translate(-50%, -140%);
    transition: opacity .16s ease, transform .16s ease;
    white-space: nowrap;
    z-index: 2300;
}

.pull-refresh-indicator.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pull-refresh-icon {
    color: var(--boo-primary);
    display: inline-block;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
    transition: transform .16s ease;
}

.pull-refresh-indicator.ready .pull-refresh-icon {
    transform: rotate(180deg);
}

.pull-refresh-indicator.loading .pull-refresh-icon {
    animation: pull-refresh-spin .7s linear infinite;
}

@keyframes pull-refresh-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pull-refresh-indicator,
    .pull-refresh-icon {
        transition: none;
    }

    .pull-refresh-indicator.loading .pull-refresh-icon {
        animation: none;
    }
}

.daily-login-reward-overlay {
    align-items: start;
    animation: daily-login-reward-visibility 4.6s ease both;
    display: grid;
    inset: 0;
    justify-items: center;
    padding: max(18px, env(safe-area-inset-top)) 16px 0;
    pointer-events: none;
    position: fixed;
    z-index: 2200;
}

.daily-login-reward-overlay.is-dismissing {
    animation: none;
    opacity: 0;
    transition: opacity .2s ease;
    visibility: hidden;
}

.daily-login-reward-card {
    align-items: center;
    animation: daily-login-reward-pop 4.6s cubic-bezier(.2, 1.35, .35, 1) both;
    background: linear-gradient(135deg, var(--palette-secondary), var(--surface));
    border: 3px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 0 color-mix(in srgb, var(--line) 28%, transparent),
        0 18px 38px rgba(17, 24, 47, .2);
    display: grid;
    gap: 10px;
    grid-template-columns: 62px minmax(0, 1fr);
    max-width: min(390px, calc(100vw - 32px));
    min-width: min(330px, calc(100vw - 32px));
    padding: 12px 18px 12px 12px;
    pointer-events: auto;
    position: relative;
}

[dir="rtl"] .daily-login-reward-card {
    padding: 12px 12px 12px 18px;
}

.daily-login-reward-dismiss {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 68%, transparent);
    border: 0;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: 800 22px/1 system-ui, sans-serif;
    height: 30px;
    inset-inline-end: 5px;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: 5px;
    width: 30px;
}

.daily-login-reward-dismiss:hover,
.daily-login-reward-dismiss:focus-visible {
    background: color-mix(in srgb, var(--text) 12%, var(--surface));
    outline: 2px solid var(--text);
    outline-offset: -2px;
}

.daily-login-reward-card > img {
    filter: drop-shadow(0 5px 0 rgba(37, 49, 74, .16));
    height: 62px;
    object-fit: contain;
    width: 62px;
}

.daily-login-reward-copy {
    color: var(--text);
    display: grid;
    gap: 3px;
    line-height: 1.15;
}

.daily-login-reward-copy > strong {
    color: var(--boo-primary);
    font-size: 19px;
    font-weight: 900;
}

.daily-login-reward-copy > span {
    font-size: 14px;
    font-weight: 800;
}

.daily-login-reward-copy b {
    color: var(--accent-strong-text);
    font-size: 18px;
    font-weight: 1000;
}

.daily-login-spark {
    animation: daily-login-sparkle .75s ease-in-out 3;
    color: var(--accent-strong-text);
    font-size: 23px;
    line-height: 1;
    position: absolute;
}

.daily-login-spark-one {
    inset-inline-start: -11px;
    top: 4px;
}

.daily-login-spark-two {
    animation-delay: .2s;
    bottom: -8px;
    inset-inline-end: 17px;
}

@keyframes daily-login-reward-visibility {
    0%, 92% { visibility: visible; }
    100% { visibility: hidden; }
}

@keyframes daily-login-reward-pop {
    0% { opacity: 0; transform: translateY(-24px) scale(.8) rotate(-2deg); }
    10% { opacity: 1; transform: translateY(0) scale(1.04) rotate(1deg); }
    16%, 78% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
    100% { opacity: 0; transform: translateY(-16px) scale(.96); }
}

@keyframes daily-login-sparkle {
    0%, 100% { opacity: .35; transform: scale(.65) rotate(0); }
    50% { opacity: 1; transform: scale(1.25) rotate(22deg); }
}

@media (prefers-reduced-motion: reduce) {
    .daily-login-reward-card {
        animation-name: daily-login-reward-fade;
        animation-timing-function: ease;
    }

    .daily-login-spark {
        animation: none;
    }
}

.store-page {
    align-content: start;
    display: grid;
    gap: 18px;
    margin: 0 auto;
    max-width: 760px;
    padding: 14px 14px 96px;
    width: 100%;
}

.store-hero {
    align-items: center;
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 223, 119, .3), transparent 30%),
        linear-gradient(135deg, rgba(229, 249, 241, .96), rgba(241, 235, 255, .96));
    color: #1f2940;
    display: grid;
    gap: 16px;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    overflow: hidden;
}

.store-hero > img {
    filter: drop-shadow(0 10px 13px rgba(28, 39, 67, .22));
    height: 106px;
    object-fit: contain;
    width: 106px;
}

.store-hero h1,
.store-section h2,
.store-pack-card h3,
.store-cosmetic-card h3 {
    margin: 0;
}

.store-hero p,
.store-section-heading p,
.store-cosmetic-card p {
    margin: 5px 0 0;
}

.store-hero p {
    color: #36445d;
}

.store-section-heading p,
.store-cosmetic-card p {
    color: var(--muted);
}

.store-state {
    background: #e8fff4;
    border: 2px solid #4ca67f;
    border-radius: 14px;
    color: #173d33;
    font-weight: 800;
    padding: 11px 14px;
}

.store-tabs {
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    border: 2px solid var(--line);
    border-radius: 16px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    padding: 6px;
}

.store-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 11px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 900;
    justify-content: center;
    min-height: 48px;
    padding: 9px 14px;
    text-align: center;
    text-decoration: none;
}

.store-tab.active {
    background: var(--sky);
    box-shadow: none;
    color: #10243a;
}

.store-tab:hover,
.store-tab:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--sky) 66%, transparent);
    outline-offset: 2px;
}

.store-world-assets-empty {
    background:
        radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--sky) 24%, transparent), transparent 34%),
        var(--surface);
    display: grid;
    gap: 7px;
    min-height: 180px;
    place-content: center;
    text-align: center;
}

.store-world-assets-empty h2,
.store-world-assets-empty p {
    margin: 0;
}

.store-world-assets-empty p {
    color: var(--muted);
    max-width: 480px;
}

.store-page [data-store-tab-panel][hidden] {
    display: none;
}

.store-app-assets {
    display: grid;
    gap: 16px;
}

.store-section {
    display: grid;
    gap: 12px;
}

.store-section-disclosure,
.store-product-disclosure,
.store-group-disclosure {
    min-width: 0;
}

.store-section-summary,
.store-product-summary,
.store-group-summary {
    cursor: pointer;
    list-style: none;
}

.store-section-summary::before,
.store-product-summary::before,
.store-group-summary::before {
    color: var(--ink);
    content: "\25B6";
    font-size: .78rem;
    line-height: 1;
    transition: transform .18s ease;
}

.store-section-disclosure[open] > .store-section-summary::before,
.store-product-disclosure[open] > .store-product-summary::before,
.store-group-disclosure[open] > .store-group-summary::before {
    transform: rotate(90deg);
}

.store-section-summary::-webkit-details-marker,
.store-product-summary::-webkit-details-marker,
.store-group-summary::-webkit-details-marker {
    display: none;
}

.store-section-summary::marker,
.store-product-summary::marker,
.store-group-summary::marker {
    content: "";
}

.store-section-summary {
    align-items: center;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 90%, var(--mint)), color-mix(in srgb, var(--surface) 92%, var(--sky)));
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 88px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.store-section-disclosure[open] > .store-section-summary {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 76%, var(--mint)), color-mix(in srgb, var(--surface) 82%, var(--sky)));
    border-color: color-mix(in srgb, var(--palette-secondary) 62%, var(--line));
    box-shadow: none;
}

.store-section-summary:hover,
.store-section-summary:focus-visible {
    border-color: var(--palette-secondary);
    box-shadow: none;
    outline: none;
    transform: translateY(-2px);
}

.store-section-summary-copy,
.store-product-summary-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.store-section-summary-copy > h2 {
    font-size: 1.35rem;
    overflow-wrap: anywhere;
}

.store-section-summary-copy > small,
.store-group-summary > small {
    color: var(--muted);
    font-weight: 750;
}

.store-disclosure-action {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 900;
    gap: 8px;
}

.store-disclosure-open {
    display: none;
}

.store-section-disclosure[open] > .store-section-summary .store-disclosure-closed {
    display: none;
}

.store-section-disclosure[open] > .store-section-summary .store-disclosure-open {
    display: inline;
}

.store-section-content {
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.store-section-intro {
    color: var(--muted);
    margin: 0 2px;
}

.store-product-disclosure {
    display: block;
}

.store-product-disclosure.panel {
    display: block;
    border-color: color-mix(in srgb, var(--line) 80%, var(--muted));
    border-radius: 14px;
    border-width: 1px;
    box-shadow: none;
    margin: 0;
    padding: 0;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.store-product-disclosure[open].panel {
    background: color-mix(in srgb, var(--surface) 86%, var(--mint));
    border-color: color-mix(in srgb, var(--palette-secondary) 48%, var(--line));
    box-shadow: none;
}

.store-product-summary {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 8px 10px;
}

.store-product-summary::before,
.store-group-summary::before {
    color: var(--muted);
    font-size: .62rem;
}

.store-product-summary-copy > strong {
    font-size: .9rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.store-product-summary:hover .store-product-summary-copy > strong,
.store-product-summary:focus-visible .store-product-summary-copy > strong {
    color: var(--palette-primary);
}

.store-product-summary:focus-visible,
.store-group-summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--sky) 62%, transparent);
    outline-offset: 4px;
}

.store-product-content {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    margin: 0 12px 12px;
    padding-top: 12px;
}

.store-product-description {
    color: var(--muted);
    margin: 0;
}

.store-group-disclosure {
    background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 0;
    padding: 0;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.store-group-disclosure[open] {
    background: color-mix(in srgb, var(--surface) 86%, var(--sky));
    border-color: color-mix(in srgb, var(--palette-secondary) 42%, var(--line));
    box-shadow: none;
}

.store-group-summary {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 8px 10px;
}

.store-group-summary > strong {
    font-size: .9rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.store-group-summary > small {
    font-size: .72rem;
}

.store-group-disclosure > .store-cosmetic-grid {
    border-top: 1px solid var(--line);
    margin: 0 12px 12px;
    padding-top: 12px;
}

.store-section-heading {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.store-section-heading > p {
    max-width: 530px;
    text-align: end;
}

.store-pack-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.store-stamp-pack-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.store-stamp-pack-card {
    background: var(--surface);
    color: var(--text);
    display: grid;
    gap: 14px;
}

.store-stamp-pack-card p {
    color: var(--muted);
    margin: 4px 0 0;
}

.store-stamp-grid {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(10, minmax(0, 1fr));
}

.store-stamp-detail {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: zoom-in;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0;
}

.store-stamp-detail img {
    aspect-ratio: 297 / 334;
    filter: drop-shadow(0 3px 2px rgba(45, 34, 24, .2));
    object-fit: contain;
    transition: transform .18s ease;
    width: 100%;
}

.store-stamp-detail:hover img,
.store-stamp-detail:focus-visible img {
    transform: translateY(-3px) rotate(-1deg);
}

.store-stamp-detail:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 3px;
}

.store-stamp-detail span {
    font-size: .62rem;
    font-weight: 800;
    overflow-wrap: anywhere;
    text-align: center;
}

.store-stamp-pack-footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.store-stamp-pack-footer form {
    margin: 0;
}

.store-pack-card {
    align-content: start;
    background: var(--surface);
    color: var(--text);
    display: grid;
    gap: 12px;
    min-width: 0;
}

.store-pack-card.is-unreleased {
    border-style: dashed;
}

.store-pack-heading {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.store-pack-heading h3 {
    overflow-wrap: anywhere;
}

.store-price,
.store-badge {
    background: #fff4c5;
    border: 1px solid #9a7131;
    border-radius: 999px;
    color: #493418;
    flex: 0 0 auto;
    font-size: .76rem;
    font-weight: 900;
    padding: 5px 9px;
}

.store-product-status {
    align-items: flex-end;
    display: grid;
    gap: 0.35rem;
    justify-items: end;
}

[dir="rtl"] .store-product-status {
    justify-items: start;
}

.store-badge.owned {
    background: #d9faec;
    border-color: #3d9671;
    color: #174f3d;
}

.store-object-row {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(4.8rem, 1fr));
}

.store-crest-detail {
    background: color-mix(in srgb, var(--surface-2) 84%, #fff0b7);
    border-color: #d59b3c;
}

.store-object-detail {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 5px;
}

.store-object-detail:hover,
.store-object-detail:focus-visible {
    border-color: var(--sky);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sky) 28%, transparent);
    outline: none;
}

.store-object-detail img {
    aspect-ratio: 1;
    object-fit: contain;
    width: 100%;
}

.store-object-detail span {
    font-size: .66rem;
    font-weight: 750;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: center;
}

.store-theme-gallery {
    display: grid;
    gap: 7px;
}

.store-theme-gallery-heading {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.store-theme-gallery-heading span {
    color: var(--muted);
    font-size: .75rem;
}

.store-theme-preview-grid {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.store-theme-preview {
    background: #182238;
    border: 2px solid var(--line);
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    display: grid;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.store-theme-preview img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

.store-theme-preview span {
    background: rgba(15, 20, 38, .82);
    bottom: 4px;
    font-size: .75rem;
    font-weight: 900;
    inset-inline: 4px;
    line-height: 1.15;
    padding: 3px 5px;
    position: absolute;
    text-align: center;
}

.store-pack-offers {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.store-pack-offers > div {
    align-items: stretch;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 8px;
}

.store-pack-offers > div.featured {
    background: #fff4c5;
    border-color: #c58d32;
    color: #33240f;
}

.store-pack-offers strong,
.store-pack-offers span {
    overflow-wrap: anywhere;
}

.store-pack-offers span {
    font-size: .78rem;
}

.store-pack-offers small {
    color: inherit;
    font-size: .7rem;
    line-height: 1.25;
}

.store-pack-offers .btn,
.store-pack-offers form {
    margin-top: auto;
    width: 100%;
}

.store-release-calendar {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.store-calendar-disclosure > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
}

.store-calendar-disclosure > summary::-webkit-details-marker {
    display: none;
}

.store-calendar-disclosure > summary > span:first-child {
    display: grid;
    gap: 2px;
}

.store-calendar-disclosure > summary strong {
    font-size: 1.25rem;
}

.store-calendar-disclosure > summary > span:last-child {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 850;
    padding: 6px 10px;
}

.store-calendar-disclosure[open] > summary {
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.store-calendar-disclosure > p {
    margin-bottom: 10px;
}

.store-release-month {
    align-items: start;
    display: grid;
    gap: 9px;
    grid-template-columns: 7rem minmax(0, 1fr);
    padding: 10px 12px;
}

.store-release-month > div {
    display: grid;
    gap: 6px;
}

.store-release-entry {
    background: color-mix(in srgb, var(--mint) 22%, var(--surface));
    border-radius: 9px;
    display: grid;
    font-size: .76rem;
    font-weight: 800;
    gap: 2px;
    padding: 6px 8px;
}

.store-release-entry.is-planned {
    background: var(--surface-2);
    border: 1px dashed var(--line);
}

.store-release-entry small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 650;
}

.store-offer-plan {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.store-offer-plan > span {
    background: color-mix(in srgb, var(--mint) 18%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    font-size: .72rem;
    gap: 2px;
    padding: 7px;
}

.store-offer-plan > .is-planned {
    background: var(--surface-2);
    border-style: dashed;
    color: var(--muted);
}

.store-cosmetic-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.store-cosmetic-card {
    align-content: start;
    background: var(--surface);
    color: var(--text);
    display: grid;
    gap: 10px;
    min-width: 0;
}

.store-cosmetic-card-wide {
    grid-column: 1 / -1;
}

.store-cosmetic-preview {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: inherit;
    cursor: zoom-in;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.store-cosmetic-preview > img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: contain;
    width: 100%;
}

.store-cosmetic-preview > span {
    background: rgba(9, 15, 34, .78);
    border-radius: 999px;
    bottom: 8px;
    color: white;
    font-size: .72rem;
    font-weight: 850;
    inset-inline-end: 8px;
    padding: 5px 9px;
    position: absolute;
}

.store-cosmetic-preview:hover,
.store-cosmetic-preview:focus-visible {
    box-shadow: 0 0 0 3px var(--sky);
    outline: none;
}

.store-cosmetic-copy {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.store-cosmetic-copy h3,
.store-cosmetic-copy p {
    overflow-wrap: anywhere;
}

[data-theme="dark"] .store-hero {
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 210, 101, .2), transparent 30%),
        linear-gradient(135deg, rgba(27, 70, 69, .98), rgba(55, 42, 82, .98));
    color: #fff9ec;
}

[data-theme="dark"] .store-hero p {
    color: #e8edf7;
}

.collectible-cabinet-title form {
    align-items: center;
    display: flex;
    flex-basis: 100%;
    gap: 5px;
    width: 100%;
}

.compact-select {
    flex: 1;
    max-width: none;
    min-height: 34px;
    min-width: 0;
    padding: 5px 8px;
}

.compact-btn {
    min-height: 34px;
    padding: 5px 10px;
}

@media (max-width: 760px) {
    .store-page {
        padding-inline: 9px;
    }

    .store-hero {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .store-hero > img {
        height: 72px;
        width: 72px;
    }

    .store-hero > .btn {
        grid-column: 1 / -1;
    }

    .store-section-heading {
        align-items: start;
        display: grid;
    }

    .store-section-heading > p {
        text-align: start;
    }

    .store-pack-grid,
    .store-cosmetic-grid,
    .store-release-calendar {
        grid-template-columns: 1fr;
    }

    .store-object-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .store-theme-gallery-heading {
        align-items: start;
        display: grid;
        gap: 2px;
    }

    .store-theme-preview-grid {
        grid-auto-columns: minmax(108px, 34%);
        grid-auto-flow: column;
        grid-template-columns: none;
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: inline mandatory;
    }

    .store-theme-preview {
        scroll-snap-align: start;
    }

    .store-pack-offers {
        grid-template-columns: 1fr;
    }

    .store-offer-plan {
        grid-template-columns: 1fr;
    }

    .collectible-cabinet-title {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .collectible-cabinet-title form {
        flex-basis: 100%;
        margin-inline-start: 0;
    }

    .compact-select {
        max-width: none;
        width: 100%;
    }
}

@keyframes daily-login-reward-fade {
    0%, 100% { opacity: 0; }
    10%, 78% { opacity: 1; }
}

.birthday-page {
    background:
        radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--sky) 30%, transparent), transparent 34%),
        radial-gradient(circle at 85% 8%, color-mix(in srgb, var(--coral) 28%, transparent), transparent 30%),
        linear-gradient(145deg, color-mix(in srgb, var(--bg) 78%, #34266b), var(--bg));
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.birthday-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: clamp(12px, 3vw, 32px);
    position: relative;
    z-index: 2;
}

.birthday-brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 18px;
    font-weight: 950;
    gap: 8px;
    margin-bottom: 12px;
}

.birthday-brand img {
    filter: drop-shadow(0 5px 0 rgba(25, 23, 58, .2));
    height: 46px;
    object-fit: contain;
    width: 46px;
}

.birthday-card {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: clamp(18px, 3vw, 30px);
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
    overflow: hidden;
}

.birthday-art-frame {
    background: #202260;
    display: grid;
    min-height: 100%;
    place-items: center;
}

.birthday-art-frame img {
    display: block;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
}

.birthday-copy {
    align-content: center;
    background: var(--feature-gradient);
    display: grid;
    gap: 12px;
    padding: clamp(22px, 4vw, 44px);
}

.birthday-copy h1 {
    font-size: clamp(31px, 5vw, 54px);
    letter-spacing: -.045em;
    line-height: .98;
    margin: 0;
}

.birthday-copy > p {
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.5;
    margin: 0;
}

.birthday-reward-badge {
    background: color-mix(in srgb, var(--yellow) 58%, var(--surface));
    border: 2px solid color-mix(in srgb, var(--line) 60%, var(--yellow));
    border-radius: 14px;
    display: grid;
    gap: 2px;
    padding: 11px 14px;
}

.birthday-reward-badge span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.birthday-reward-badge strong {
    color: var(--accent-strong);
    font-size: clamp(20px, 3vw, 27px);
}

.birthday-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.birthday-actions .btn {
    flex: 1 1 145px;
}

.birthday-fireworks-field {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 5;
}

.birthday-firework {
    --burst-delay: 0s;
    height: 8px;
    position: absolute;
    width: 8px;
}

.birthday-firework::after {
    background: #fff7c2;
    border-radius: 50%;
    box-shadow: 0 0 12px 5px color-mix(in srgb, var(--yellow) 78%, transparent);
    content: "";
    height: 8px;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 8px;
}

.birthday-firework::before {
    background: linear-gradient(to bottom, #fff, var(--yellow) 38%, transparent);
    border-radius: 999px;
    box-shadow: 0 0 10px 2px color-mix(in srgb, var(--yellow) 72%, transparent);
    content: "";
    height: clamp(36px, 5vw, 62px);
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, clamp(78px, 11vw, 150px)) scaleY(.35);
    transform-origin: top;
    width: clamp(3px, .35vw, 5px);
}

.birthday-firework-spark {
    --spark-angle: 0deg;
    background: linear-gradient(to bottom, #fff, currentColor 34%, transparent);
    border-radius: 999px;
    color: var(--yellow);
    filter: drop-shadow(0 0 5px currentColor);
    height: clamp(22px, 2.4vw, 34px);
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(var(--spark-angle)) translateY(0) scaleY(.25);
    transform-origin: center;
    width: clamp(3px, .35vw, 5px);
}

.birthday-firework-spark:nth-child(1) { --spark-angle: 0deg; }
.birthday-firework-spark:nth-child(2) { --spark-angle: 22.5deg; color: var(--coral); }
.birthday-firework-spark:nth-child(3) { --spark-angle: 45deg; color: var(--mint); }
.birthday-firework-spark:nth-child(4) { --spark-angle: 67.5deg; color: var(--sky); }
.birthday-firework-spark:nth-child(5) { --spark-angle: 90deg; }
.birthday-firework-spark:nth-child(6) { --spark-angle: 112.5deg; color: #c39bff; }
.birthday-firework-spark:nth-child(7) { --spark-angle: 135deg; color: var(--coral); }
.birthday-firework-spark:nth-child(8) { --spark-angle: 157.5deg; color: var(--mint); }
.birthday-firework-spark:nth-child(9) { --spark-angle: 180deg; }
.birthday-firework-spark:nth-child(10) { --spark-angle: 202.5deg; color: var(--sky); }
.birthday-firework-spark:nth-child(11) { --spark-angle: 225deg; color: #c39bff; }
.birthday-firework-spark:nth-child(12) { --spark-angle: 247.5deg; color: var(--coral); }
.birthday-firework-spark:nth-child(13) { --spark-angle: 270deg; }
.birthday-firework-spark:nth-child(14) { --spark-angle: 292.5deg; color: var(--mint); }
.birthday-firework-spark:nth-child(15) { --spark-angle: 315deg; color: var(--sky); }
.birthday-firework-spark:nth-child(16) { --spark-angle: 337.5deg; color: #c39bff; }

.birthday-firework-0 { --burst-delay: .1s; left: 11%; top: 24%; }
.birthday-firework-1 { --burst-delay: .65s; left: 35%; top: 13%; }
.birthday-firework-2 { --burst-delay: 1.2s; left: 61%; top: 24%; }
.birthday-firework-3 { --burst-delay: 1.8s; left: 84%; top: 14%; }
.birthday-firework-4 { --burst-delay: 2.45s; left: 22%; top: 53%; }
.birthday-firework-5 { --burst-delay: 3.05s; left: 76%; top: 52%; }
.birthday-firework-6 { --burst-delay: 3.7s; left: 50%; top: 9%; }

.celebrating .birthday-firework::after {
    animation: birthday-firework-core 1.25s ease-out both;
    animation-delay: calc(var(--burst-delay) + .24s);
}

.celebrating .birthday-firework::before {
    animation: birthday-firework-launch .34s ease-out both;
    animation-delay: var(--burst-delay);
}

.celebrating .birthday-firework-spark {
    animation: birthday-firework-spark 1.25s cubic-bezier(.14, .7, .28, 1) both;
    animation-delay: calc(var(--burst-delay) + .24s);
}

@keyframes birthday-firework-launch {
    0% { opacity: 0; transform: translate(-50%, clamp(78px, 11vw, 150px)) scaleY(.35); }
    18% { opacity: 1; }
    82% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 0) scaleY(1); }
}

@keyframes birthday-firework-core {
    0%, 8% { opacity: 0; transform: scale(.2); }
    14% { opacity: 1; transform: scale(1); }
    42% { opacity: .8; transform: scale(2.8); }
    100% { opacity: 0; transform: scale(4.5); }
}

@keyframes birthday-firework-spark {
    0%, 8% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--spark-angle)) translateY(0) scaleY(.25); }
    14% { opacity: 1; }
    74% { opacity: .92; }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--spark-angle)) translateY(calc(clamp(52px, 8vw, 118px) * -1)) scaleY(.8); }
}

@media (min-width: 821px) {
    .birthday-card {
        grid-template-columns: minmax(0, 1.55fr) minmax(330px, .7fr);
    }

    .birthday-copy {
        gap: 9px;
        padding: 22px 26px;
    }

    .birthday-copy h1 {
        font-size: clamp(38px, 4vw, 50px);
    }

    .birthday-copy > p {
        font-size: 16px;
        line-height: 1.42;
    }

    .birthday-reward-badge {
        padding: 9px 12px;
    }
}

@media (max-width: 820px) {
    .birthday-card {
        grid-template-columns: 1fr;
    }

    .birthday-art-frame {
        aspect-ratio: 3 / 2;
        min-height: 0;
    }

    .birthday-copy {
        padding: 20px;
    }
}

@media (max-width: 430px) {
    .birthday-shell {
        padding: 9px;
    }

    .birthday-brand {
        margin: 0 0 7px 5px;
    }

    .birthday-card {
        border-radius: 18px;
    }

    .birthday-copy {
        gap: 9px;
        padding: 17px 15px 18px;
    }

    .birthday-copy h1 {
        font-size: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .birthday-fireworks-field {
        display: none;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.app-shell {
    margin: 0 auto;
    max-width: 760px;
    min-height: 100vh;
    padding: 16px 16px 96px;
}

.top-bar,
.bottom-nav,
.brand,
.inline-center,
.btn-row {
    align-items: center;
    display: flex;
}

.top-bar {
    gap: 12px;
    justify-content: space-between;
    padding: 8px 0 18px;
}

.header-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
}

.brand {
    gap: 10px;
    min-width: 0;
}

.brand img {
    filter: drop-shadow(0 6px 0 rgba(37, 49, 74, .14));
    height: 48px;
    width: 48px;
}

.brand-title {
    font-size: 19px;
    font-weight: 900;
    line-height: 1.05;
}

.brand-subtitle,
.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.header-user {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    display: inline-flex;
    gap: 7px;
    min-height: 46px;
    min-width: 0;
    padding: 4px 10px 4px 5px;
}

[dir="rtl"] .header-user {
    padding: 4px 5px 4px 10px;
}

.header-user img {
    border: 2px solid var(--boo-light-primary);
    border-radius: 999px;
    height: 34px;
    object-fit: cover;
    width: 34px;
}

.header-user > span:last-child {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar-frame {
    display: inline-grid;
    line-height: 0;
    position: relative;
}

.profile-image-carousel > .profile-carousel-image {
    grid-area: 1 / 1;
}

.profile-image-carousel > .profile-carousel-image[hidden] {
    display: none;
}

.profile-carousel-dots {
    bottom: 4px;
    display: flex;
    gap: 3px;
    inset-inline-start: 50%;
    pointer-events: none;
    position: absolute;
    transform: translateX(-50%);
    z-index: 9;
}

[dir="rtl"] .profile-carousel-dots {
    transform: translateX(50%);
}

.profile-carousel-dots i {
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(20, 24, 48, .65);
    border-radius: 999px;
    height: 5px;
    width: 5px;
}

.profile-carousel-dots i.active {
    background: var(--gold);
    width: 11px;
}

.profile-photo-dialog-actions .btn.disabled {
    cursor: not-allowed;
    filter: grayscale(.6);
    opacity: .5;
    pointer-events: none;
}

[data-profile-image-preview] {
    cursor: zoom-in;
}

a [data-profile-image-preview],
button [data-profile-image-preview],
label [data-profile-image-preview] {
    cursor: pointer;
}

[data-profile-image-preview]:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 3px;
}

.profile-image-viewer-dialog {
    background: transparent;
    border: 0;
    max-height: none;
    max-width: none;
    overflow: visible;
    padding: 0;
    width: fit-content;
}

.profile-image-viewer-dialog::backdrop {
    background: rgba(10, 12, 30, .78);
    backdrop-filter: blur(5px);
}

.profile-image-viewer-card {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 18px;
    box-sizing: border-box;
    box-shadow: 0 24px 70px rgba(8, 11, 28, .42);
    color: var(--text);
    display: grid;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    max-width: calc(100vw - 32px);
    max-width: calc(100dvw - 32px);
    overflow: visible;
    padding: 12px;
    position: relative;
}

.profile-image-viewer-image {
    background: var(--surface-2);
    border-radius: 10px;
    display: block;
    height: min(calc(100vh - 62px), calc(100vw - 62px), 820px);
    height: min(calc(100dvh - 62px), calc(100dvw - 62px), 820px);
    object-fit: contain;
    transition: opacity .15s ease;
    width: min(calc(100vh - 62px), calc(100vw - 62px), 820px);
    width: min(calc(100dvh - 62px), calc(100dvw - 62px), 820px);
}

.profile-image-viewer-dialog.is-loading .profile-image-viewer-image {
    opacity: .72;
}

.profile-image-viewer-dialog.is-loading .profile-image-viewer-nav {
    cursor: wait;
    opacity: .55;
    pointer-events: none;
}

.profile-image-viewer-status {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 2px solid var(--line);
    border-radius: 10px;
    bottom: 24px;
    font-size: 13px;
    font-weight: 800;
    inset-inline: 24px;
    line-height: 1.35;
    margin: 0;
    padding: 8px 10px;
    position: absolute;
    text-align: center;
}

.profile-image-viewer-nav {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    display: none;
    font-size: 24px;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: calc(50% - 22px);
    width: 44px;
    z-index: 3;
}

.profile-image-viewer-dialog.has-multiple .profile-image-viewer-nav {
    display: flex;
}

.profile-image-viewer-prev { left: -20px; }
.profile-image-viewer-next { right: -20px; }

.profile-image-viewer-close {
    align-items: center;
    background: var(--pink);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 22px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: -10px;
    top: -10px;
    width: 38px;
    z-index: 2;
}

.profile-image-viewer-close:hover {
    transform: translateY(-1px);
}

html.profile-image-viewer-open,
html.profile-image-viewer-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

.user-gender-marker {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    bottom: -6px;
    color: var(--text);
    display: inline-flex;
    font-size: 15px;
    font-weight: 900;
    height: 26px;
    inset-inline-start: -6px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    width: 26px;
    z-index: 4;
}

.user-gender-marker.male {
    background: color-mix(in srgb, var(--sky) 68%, var(--surface));
}

.user-gender-marker.female {
    background: color-mix(in srgb, var(--coral) 52%, var(--surface));
}

.header-user-avatar .user-gender-marker {
    bottom: -4px;
    font-size: 10px;
    height: 17px;
    inset-inline-start: -4px;
    width: 17px;
}

@media (max-width: 520px) {
    .top-bar {
        gap: 8px;
    }

    .header-user {
        gap: 0;
        padding: 4px;
    }

    .header-user > span:last-child {
        display: none;
    }
}

.panel,
.game-card,
.chat-item,
.letter-item,
.leader-row,
.bottom-nav {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.game-card,
.chat-item,
.letter-item {
    box-shadow: none;
}

.panel {
    margin: 12px 0;
    padding: 16px;
    position: relative;
}

.panel.hero,
.panel.mini-hero,
.panel.waiting-visual,
.leader-board-panel,
.stats-master-card,
.bot-companion-card {
    background: var(--feature-gradient);
}

.paper-panel {
    background-color: var(--surface);
    background-image:
        linear-gradient(rgba(125, 211, 252, .28) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 107, 107, .30) 1px, transparent 1px);
    background-size: 100% 28px, 44px 100%;
}

.sunny-panel {
    background: var(--panel-sunny);
}

.pink-panel {
    background: var(--panel-pink);
}

.sky-panel {
    background: var(--panel-sky);
}

.app-shell.onboarding-shell {
    padding-top: 72px;
}

.onboarding-panel {
    background: var(--feature-gradient);
}

.onboarding-panel .btn,
.onboarding-page .app-audio-floating {
    background: var(--palette-primary);
    color: var(--accent-strong-text);
}

.hero,
.mini-hero {
    align-items: center;
    display: grid;
    gap: 16px;
}

.hero {
    grid-template-columns: 92px 1fr;
}

.mini-hero {
    grid-template-columns: 76px 1fr;
}

.hero img,
.mini-hero img {
    filter: drop-shadow(0 7px 0 rgba(37, 49, 74, .16));
    width: 100%;
}

.hero h1 {
    font-size: 31px;
    letter-spacing: 0;
    line-height: 1;
    margin-bottom: 8px;
}

.mini-hero h1,
.mini-hero h2 {
    font-size: 24px;
    letter-spacing: 0;
    line-height: 1.1;
    margin-bottom: 6px;
}

.asset-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0;
}

.asset-card {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .16);
    height: 132px;
    overflow: hidden;
    position: relative;
}

.asset-card img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

/* Keep card copy in HTML so one text-free illustration works in both languages. */
.asset-card strong {
    background: linear-gradient(transparent, rgba(7, 17, 48, .9));
    bottom: 0;
    color: #fff8ec;
    font-size: 14px;
    inset-inline: 0;
    line-height: 1.15;
    padding: 24px 8px 8px;
    position: absolute;
    text-shadow: 0 1px 2px rgba(7, 17, 48, .8);
}

.form-stack {
    display: grid;
    gap: 12px;
}

.palette-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.palette-option {
    align-items: center;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, var(--palette-card-a, var(--pink)), var(--palette-card-b, var(--sky)), var(--palette-card-c, var(--yellow))) border-box;
    border: 3px solid transparent;
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 8px;
    justify-items: start;
    min-height: 84px;
    overflow: hidden;
    padding: 10px;
    position: relative;
    text-align: start;
    transition: transform .16s ease, box-shadow .16s ease;
}

.palette-option:before {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--palette-card-a, var(--pink)) 46%, transparent), transparent 58%),
        linear-gradient(315deg, color-mix(in srgb, var(--palette-card-b, var(--sky)) 40%, transparent), transparent 56%),
        linear-gradient(90deg, color-mix(in srgb, var(--palette-card-c, var(--yellow)) 28%, transparent), transparent 70%);
    content: "";
    inset: 0;
    opacity: .58;
    pointer-events: none;
    position: absolute;
}

.palette-option > * {
    position: relative;
    z-index: 1;
}

.palette-option strong {
    text-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 72%, transparent);
}

.palette-option:hover {
    transform: translateY(-2px);
}

.palette-option.active {
    background:
        linear-gradient(color-mix(in srgb, var(--surface-3) 88%, transparent), color-mix(in srgb, var(--surface-3) 88%, transparent)) padding-box,
        linear-gradient(135deg, var(--palette-card-a, var(--pink)), var(--palette-card-b, var(--sky)), var(--palette-card-c, var(--yellow))) border-box;
    box-shadow: 0 0 0 4px var(--sky);
}

.palette-option.active:before {
    opacity: .82;
}

.palette-swatches {
    display: flex;
    gap: 5px;
}

.palette-swatches span {
    background: var(--swatch-color);
    border: 2px solid var(--line);
    border-radius: 999px;
    height: 22px;
    width: 22px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label,
.field span,
.field > label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.input,
.select,
.textarea {
    background: var(--input-bg);
    border: 3px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    min-height: 48px;
    padding: 10px 12px;
    width: 100%;
}

.textarea {
    min-height: 180px;
    resize: vertical;
}

.btn-row {
    flex-wrap: wrap;
    gap: 10px;
}

.btn-row.header-actions {
    flex-wrap: nowrap;
    gap: 6px;
}

.btn {
    align-items: center;
    background: var(--ink);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--bg);
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    min-height: 44px;
    padding: 9px 14px;
    transition: transform .16s ease, box-shadow .16s ease;
}

.btn:hover,
.icon-btn:hover,
.game-card:hover {
    transform: translateY(-2px);
}

.btn:active,
.icon-btn:active {
    box-shadow: none;
    transform: translateY(2px);
}

.btn.secondary {
    background: var(--surface);
    color: var(--text);
}

.btn.mint {
    background: var(--mint);
    color: var(--accent-strong-text);
}

.btn.coral {
    background: var(--coral);
    color: var(--status-text);
}

.btn.yellow {
    background: var(--yellow);
    color: var(--status-text);
}

.btn.sky {
    background: var(--sky);
    color: var(--accent-strong-text);
}

.btn.palette-secondary {
    background: var(--palette-secondary);
    color: var(--accent-strong-text);
}

.btn.google {
    background: var(--surface);
    color: var(--text);
}

.btn.google::before {
    color: #4285f4;
    content: "G";
    font-weight: 900;
    margin-inline-end: 8px;
}

.game-card .btn {
    min-height: 38px;
    padding: 7px 11px;
}

.game-card .input {
    min-height: 40px;
    padding: 8px 10px;
}

.icon-btn {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    padding: 4px;
    transition: transform .16s ease, box-shadow .16s ease;
    width: 46px;
}

.icon-btn img {
    height: 32px;
    width: 32px;
}

.header-back {
    font: 900 32px/1 system-ui, sans-serif;
    text-decoration: none;
}

.segmented {
    background: var(--surface-2);
    border: 3px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
}

.segmented button,
.segmented a {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: 8px 10px;
}

.segmented .active,
.segmented button:hover,
.segmented a:hover {
    background: var(--surface);
}

.shelf-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 8px 2px 12px;
}

.shelf-heading h2 {
    font-size: 21px;
    margin: 0;
}

.game-progress-summary {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 4px 14px;
    margin: 3px 0 0;
}

.game-progress-summary strong {
    color: var(--text);
}

.progression-info-button {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    height: 17px;
    justify-content: center;
    margin-inline-start: 3px;
    padding: 0;
    vertical-align: middle;
    width: 17px;
}

.progression-info-button:hover,
.progression-info-button:focus-visible {
    background: var(--yellow);
}

.progression-rules-card p {
    margin: 0;
}

.shelf-controls {
    align-items: center;
    display: flex;
    gap: 8px;
}

.player-count-summary {
    font-size: 16px;
    font-weight: 900;
}

.player-count-options {
    grid-template-columns: repeat(2, minmax(54px, 1fr));
    width: 150px;
}

.badge-visibility-summary {
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.grid-menu-options.badge-visibility-options {
    grid-template-columns: 1fr;
    width: 190px;
}

.grid-menu {
    position: relative;
}

.grid-menu summary {
    list-style: none;
}

.grid-menu summary::-webkit-details-marker {
    display: none;
}

.grid-menu-options {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(58px, 1fr));
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 172px;
    z-index: 30;
}

.grid-menu-options.grid-layout-options {
    grid-template-columns: repeat(3, minmax(42px, 1fr));
    width: 190px;
}

.grid-layout-options [data-grid-option="auto"] {
    grid-column: 1 / -1;
}

.shelf-menu-options {
    width: 206px;
}

.shelf-menu-options [data-category-option] {
    align-items: center;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.shelf-menu-options [data-category-option] img {
    height: 24px;
    object-fit: contain;
    width: 24px;
}

.grid-menu-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    grid-column: 1 / -1;
    padding: 2px 2px 0;
}

.grid-menu:not([open]) .grid-menu-options {
    display: none;
}

.grid-menu-options[hidden] {
    display: none;
}

.grid-menu-options button {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    min-height: 34px;
}

.grid-menu-options button.active {
    background: var(--pink);
    color: #fff;
}

@media (hover: hover) {
    .grid-menu-options button:hover {
        background: var(--pink);
        color: #fff;
    }
}

.badge-visibility-options button {
    padding: 7px 9px;
    text-align: start;
}

.badge-visibility-options button.active::before {
    content: "✓";
    margin-inline-end: 6px;
}

.badge-visibility-options .badge-visibility-done {
    background: var(--mint);
    color: var(--status-text);
    grid-column: 1 / -1;
    margin-top: 2px;
    text-align: center;
}

.game-grid {
    display: grid;
    gap: 12px;
}

.grid-2x2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3x3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-card {
    align-content: start;
    container-type: inline-size;
    display: grid;
    gap: 0;
    grid-template-rows: auto auto;
    min-height: 214px;
    overflow: hidden;
    position: relative;
}

.game-card-play-surface {
    display: contents;
}

.game-card.is-progression-locked {
    display: block;
}

.game-card.is-progression-locked .game-card-play-surface {
    display: grid;
    grid-template-rows: auto auto;
    inset: 0;
    position: absolute;
}

.game-card-play-surface > * {
    transition: filter .45s ease, opacity .45s ease, transform .45s ease;
}

.game-card.is-progression-locked .game-card-play-surface > * {
    filter: grayscale(1) contrast(.78);
    opacity: .3;
    transform: scale(.985);
}

.game-lock-layer {
    align-items: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(73, 235, 204, .16), transparent 34%),
        linear-gradient(145deg, rgba(14, 19, 48, .96), rgba(34, 30, 68, .97));
    color: #fff8df;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(96px, .8fr) minmax(130px, 1.25fr);
    height: 100%;
    isolation: isolate;
    min-height: 214px;
    overflow: hidden;
    padding: 30px 20px 22px;
    position: relative;
    z-index: 8;
}

.game-card.is-progression-milestone .game-lock-layer {
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 224, 120, .25), transparent 28%),
        radial-gradient(circle at 78% 72%, rgba(93, 235, 211, .2), transparent 34%),
        linear-gradient(145deg, rgba(28, 19, 59, .98), rgba(65, 42, 84, .98));
    box-shadow:
        inset 0 0 0 4px rgba(255, 222, 126, .9),
        inset 0 0 44px rgba(255, 218, 112, .2),
        0 0 24px rgba(126, 223, 208, .2);
}

.game-milestone-banner {
    background: linear-gradient(180deg, #fff8ca 0%, #ffd469 48%, #eaa23b 100%);
    border: 3px solid #5e3218;
    border-radius: 4px 4px 14px 14px;
    box-shadow:
        0 5px 0 rgba(35, 19, 18, .58),
        0 0 0 2px rgba(255, 239, 166, .68),
        0 0 28px rgba(255, 223, 117, .48);
    color: #2f163e;
    font-size: 12px;
    font-weight: 1000;
    left: 50%;
    letter-spacing: .08em;
    line-height: 1;
    min-width: min(72%, 210px);
    padding: 9px 26px 8px;
    position: absolute;
    text-align: center;
    text-shadow: 0 1px rgba(255, 255, 255, .65);
    text-transform: uppercase;
    top: 4px;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
}

.game-milestone-banner::before,
.game-milestone-banner::after {
    background: #fff8c9;
    clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
    content: "";
    height: 13px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
}

.game-milestone-banner::before {
    left: 8px;
}

.game-milestone-banner::after {
    right: 8px;
}

[dir="rtl"] .game-milestone-banner {
    letter-spacing: 0;
    text-transform: none;
}

.game-card.is-progression-milestone .game-lock-preview {
    border-color: rgba(255, 229, 137, .92);
    box-shadow: 0 7px 0 rgba(0, 0, 0, .3), 0 0 20px rgba(255, 220, 112, .13);
}

.game-card.is-progression-milestone.is-progression-ready .game-milestone-banner {
    animation: game-milestone-ready 1.45s ease-in-out infinite;
}

.game-lock-preview {
    align-self: stretch;
    background: rgba(9, 13, 35, .72);
    border: 2px solid rgba(255, 244, 186, .55);
    border-radius: 13px;
    box-shadow: 0 7px 0 rgba(0, 0, 0, .24);
    display: grid;
    grid-template-rows: minmax(86px, 1fr) auto;
    min-height: 150px;
    min-width: 0;
    position: relative;
}

.game-lock-preview-artwork {
    min-height: 86px;
    position: relative;
}

.game-lock-preview-image {
    border-radius: 10px 10px 0 0;
    filter: grayscale(1) brightness(.58) contrast(.9);
    height: 100%;
    inset: 0;
    object-fit: cover;
    opacity: .78;
    position: absolute;
    width: 100%;
}

.game-lock-crest-anchor {
    display: grid;
    inset: 0;
    place-items: center;
    position: absolute;
}

.game-lock-preview-name {
    background: rgba(12, 16, 39, .88);
    border-radius: 0 0 10px 10px;
    color: rgba(255, 255, 255, .75);
    font-family: Georgia, serif;
    font-size: 14px;
    line-height: 1.1;
    padding: 7px 6px 8px;
    text-align: center;
}

.game-lock-chain-frame {
    inset: 8px;
    pointer-events: none;
    position: absolute;
    z-index: 4;
}

.game-lock-chain-frame span {
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5));
    position: absolute;
    transition: transform .7s cubic-bezier(.2, .85, .3, 1.2), opacity .5s ease;
}

.game-lock-chain-frame span:nth-child(1),
.game-lock-chain-frame span:nth-child(2) {
    background: repeating-radial-gradient(ellipse at center, #ffe792 0 3px, #8b5517 4px 6px, transparent 7px 13px);
    background-position: center;
    background-repeat: repeat-x;
    background-size: 26px 16px;
    height: 16px;
    left: 8px;
    right: 8px;
}

.game-lock-chain-frame span:nth-child(1) { top: 0; }
.game-lock-chain-frame span:nth-child(2) { bottom: 0; }

.game-lock-chain-frame span:nth-child(1)::before,
.game-lock-chain-frame span:nth-child(1)::after,
.game-lock-chain-frame span:nth-child(2)::before,
.game-lock-chain-frame span:nth-child(2)::after {
    background:
        radial-gradient(circle at 36% 30%, #fff7ba 0 11%, transparent 12%),
        radial-gradient(circle, #efc761 0 39%, #9b5e19 40% 60%, #f4cc66 61% 72%, #58320f 73% 100%);
    border: 1px solid #4c2b0e;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 232, 145, .35), 0 2px 2px rgba(0, 0, 0, .45);
    content: "";
    height: 20px;
    position: absolute;
    top: -2px;
    width: 20px;
    z-index: 2;
}

.game-lock-chain-frame span:nth-child(1)::before,
.game-lock-chain-frame span:nth-child(2)::before { left: -10px; }

.game-lock-chain-frame span:nth-child(1)::after,
.game-lock-chain-frame span:nth-child(2)::after { right: -10px; }

.game-lock-chain-frame span:nth-child(3),
.game-lock-chain-frame span:nth-child(4) {
    background: repeating-radial-gradient(ellipse at center, #ffe792 0 3px, #8b5517 4px 6px, transparent 7px 13px);
    background-position: center;
    background-repeat: repeat-y;
    background-size: 16px 26px;
    bottom: 8px;
    top: 8px;
    width: 16px;
}

.game-lock-chain-frame span:nth-child(3) { left: 0; }
.game-lock-chain-frame span:nth-child(4) { right: 0; }

.game-card.is-progression-milestone .game-lock-chain-frame {
    border: 3px solid #f4bd50;
    border-radius: 15px;
    box-shadow:
        inset 0 0 0 2px #5e2f73,
        inset 0 0 18px rgba(255, 235, 151, .26),
        0 0 14px rgba(255, 220, 105, .32);
    inset: 5px;
}

.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(1),
.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(2) {
    background: linear-gradient(90deg, #6d367e, #f7ca62 16%, #fff2a6 50%, #f7ca62 84%, #6d367e);
    background-size: auto;
    border: 1px solid #5e3218;
    border-radius: 999px;
    height: 8px;
    left: 18px;
    right: 18px;
}

.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(3),
.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(4) {
    background: linear-gradient(180deg, #6d367e, #f7ca62 16%, #fff2a6 50%, #f7ca62 84%, #6d367e);
    background-size: auto;
    border: 1px solid #5e3218;
    border-radius: 999px;
    bottom: 18px;
    top: 18px;
    width: 8px;
}

.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(1)::before,
.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(1)::after,
.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(2)::before,
.game-card.is-progression-milestone .game-lock-chain-frame span:nth-child(2)::after {
    background: linear-gradient(135deg, #fff4ae, #e5a83b 55%, #6c337d);
    border: 0;
    border-radius: 0;
    box-shadow: 0 2px 3px rgba(0, 0, 0, .52), 0 0 9px rgba(255, 230, 130, .45);
    clip-path: polygon(50% 0, 61% 34%, 100% 50%, 61% 66%, 50% 100%, 39% 66%, 0 50%, 39% 34%);
    height: 25px;
    top: -9px;
    width: 25px;
}

.game-lock-crest {
    aspect-ratio: 1;
    justify-self: center;
    max-width: 112px;
    position: relative;
    width: 100%;
}

.game-lock-crest img {
    height: 100%;
    inset: 0;
    object-fit: contain;
    position: absolute;
    width: 100%;
}

.game-card.is-progression-milestone .game-lock-crest {
    filter: drop-shadow(0 5px 5px rgba(14, 7, 24, .72)) drop-shadow(0 0 11px rgba(255, 221, 104, .45));
    max-width: 126px;
    transform: scale(1.04);
}

.game-milestone-reveal {
    height: 1px;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 43%;
    width: 1px;
    z-index: 9;
}

.game-milestone-reveal::before {
    background: repeating-conic-gradient(from 0deg, rgba(255, 246, 173, .95) 0 5deg, transparent 5deg 16deg);
    clip-path: circle(50%);
    content: "";
    height: 210px;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(.2);
    width: 210px;
}

.game-milestone-reveal span {
    --milestone-star-x: 0px;
    --milestone-star-y: -130px;
    background: linear-gradient(135deg, #fff8bf, #f1ae3f 60%, #6f347e);
    clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
    height: 25px;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(.2) rotate(0deg);
    width: 25px;
}

.game-milestone-reveal span:nth-child(1) { --milestone-star-x: -112px; --milestone-star-y: -62px; }
.game-milestone-reveal span:nth-child(2) { --milestone-star-x: -66px; --milestone-star-y: -118px; }
.game-milestone-reveal span:nth-child(3) { --milestone-star-x: 0px; --milestone-star-y: -138px; }
.game-milestone-reveal span:nth-child(4) { --milestone-star-x: 66px; --milestone-star-y: -118px; }
.game-milestone-reveal span:nth-child(5) { --milestone-star-x: 112px; --milestone-star-y: -62px; }

.game-lock-shard {
    display: none;
}

.is-progression-ready .game-lock-crest::after,
.game-card.is-progression-milestone.is-unlocking .game-lock-crest::after {
    background: #fff4ba;
    box-shadow: 0 0 7px #fff, 0 0 18px #66f5d4;
    clip-path: polygon(45% 0, 62% 0, 52% 24%, 67% 30%, 47% 52%, 59% 61%, 39% 100%, 31% 100%, 43% 64%, 30% 54%, 50% 31%, 38% 24%);
    content: "";
    inset: 18% 27% 12%;
    opacity: .9;
    position: absolute;
    transform: rotate(-7deg);
    z-index: 3;
}

.is-progression-ready .game-lock-crest {
    animation: game-lock-ready 1.7s ease-in-out infinite;
    cursor: pointer;
}

.game-card.is-progression-milestone.is-progression-ready .game-lock-crest {
    animation: game-milestone-lock-ready 1.45s ease-in-out infinite;
}

.game-lock-copy {
    align-content: center;
    display: grid;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.game-lock-copy > strong {
    color: #fff4ba;
    font-family: Georgia, serif;
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1;
}

.game-lock-copy > span {
    font-size: 13px;
    opacity: .82;
}

.game-unlock-progress {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.game-unlock-progress span {
    background: linear-gradient(90deg, #7edfd0, #ffe17c);
    display: block;
    height: 100%;
}

.game-unlock-primary,
.game-score-unlock,
.game-score-confirm button {
    border: 2px solid #fff5d2;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    min-height: 36px;
    padding: 7px 10px;
}

.game-unlock-primary {
    background: #ffe17c;
    box-shadow: none;
    color: #201a32;
}

.game-score-unlock {
    background: #79dfd0;
    color: #15233d;
}

.game-score-unlock:disabled {
    background: #6d7181;
    border-color: #aeb2bf;
    color: #e3e3e8;
    cursor: not-allowed;
    opacity: .72;
}

.game-score-confirm {
    align-items: center;
    background: rgba(0, 0, 0, .24);
    border-radius: 10px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, 1fr);
    padding: 7px;
}

.game-score-confirm[hidden] {
    display: none;
}

.game-score-confirm span {
    font-size: 12px;
    grid-column: 1 / -1;
}

.game-score-confirm button:first-of-type {
    background: #ffe17c;
    color: #201a32;
}

.game-score-confirm button:last-of-type {
    background: transparent;
    color: #fff8df;
}

.game-unlock-status {
    color: #fff4ba;
    font-size: 11px;
    line-height: 1.25;
    margin: 0;
    min-height: 14px;
}

.game-card.is-unlocking .game-lock-base {
    opacity: 0;
}

.game-card.is-unlocking .game-lock-shard {
    display: block;
}

.game-card.is-unlocking .game-lock-shard-left {
    animation: game-lock-left 1.05s cubic-bezier(.35, .05, .8, .25) forwards;
    clip-path: polygon(0 0, 58% 0, 46% 26%, 60% 40%, 43% 58%, 55% 68%, 43% 100%, 0 100%);
}

.game-card.is-unlocking .game-lock-shard-right {
    animation: game-lock-right 1.05s cubic-bezier(.35, .05, .8, .25) forwards;
    clip-path: polygon(58% 0, 100% 0, 100% 100%, 43% 100%, 55% 68%, 43% 58%, 60% 40%, 46% 26%);
}

.game-card.is-unlocking .game-lock-chain-frame span:nth-child(1) { transform: translateY(-40px) rotate(-5deg); }
.game-card.is-unlocking .game-lock-chain-frame span:nth-child(2) { transform: translateY(40px) rotate(5deg); }
.game-card.is-unlocking .game-lock-chain-frame span:nth-child(3) { transform: translateX(-40px) rotate(5deg); }
.game-card.is-unlocking .game-lock-chain-frame span:nth-child(4) { transform: translateX(40px) rotate(-5deg); }

.game-card.is-progression-milestone.is-unlocking .game-lock-base {
    animation: game-milestone-lock-impact .42s ease-out forwards;
    opacity: 1;
}

.game-card.is-progression-milestone.is-unlocking .game-lock-shard {
    display: block;
    filter: drop-shadow(0 7px 5px rgba(14, 7, 24, .72)) drop-shadow(0 0 12px rgba(255, 221, 104, .56));
}

.game-card.is-progression-milestone.is-unlocking .game-lock-shard-left {
    animation: game-milestone-shard-left 1.25s cubic-bezier(.2, .72, .25, 1) forwards;
    clip-path: polygon(0 34%, 31% 34%, 42% 42%, 50% 55%, 42% 59%, 31% 66%, 0 66%);
}

.game-card.is-progression-milestone.is-unlocking .game-lock-shard-right {
    animation: game-milestone-shard-right 1.25s cubic-bezier(.2, .72, .25, 1) forwards;
    clip-path: polygon(100% 34%, 69% 34%, 58% 42%, 50% 55%, 58% 59%, 69% 66%, 100% 66%);
}

.game-card.is-progression-milestone.is-unlocking .game-lock-shard-top {
    animation: game-milestone-shard-top 1.25s cubic-bezier(.2, .72, .25, 1) forwards;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 72% 49%, 58% 42%, 50% 55%, 42% 42%, 28% 49%, 0 45%);
}

.game-card.is-progression-milestone.is-unlocking .game-lock-shard-bottom {
    animation: game-milestone-shard-bottom 1.25s cubic-bezier(.2, .72, .25, 1) forwards;
    clip-path: polygon(0 55%, 28% 51%, 42% 59%, 50% 45%, 58% 59%, 72% 51%, 100% 55%, 100% 100%, 0 100%);
}

.game-card.is-progression-milestone.is-unlocking .game-lock-crest::after {
    animation: game-milestone-crack-flash .42s ease-out forwards;
}

.game-card.is-progression-milestone.is-unlocking .game-lock-chain-frame {
    animation: game-milestone-frame-open 1.45s ease forwards;
}

.game-card.is-progression-milestone.is-unlocking .game-milestone-banner {
    animation: game-milestone-banner-lift .95s ease forwards;
}

.game-card.is-progression-milestone.is-unlocking .game-milestone-reveal::before {
    animation: game-milestone-sunburst 1.15s ease-out forwards;
    animation-delay: .34s;
}

.game-card.is-progression-milestone.is-unlocking .game-milestone-reveal span {
    animation: game-milestone-star-flight 1.15s cubic-bezier(.16, .78, .3, 1) forwards;
    animation-delay: .4s;
}

.game-card.is-progression-milestone.is-unlocking .game-milestone-reveal span:nth-child(2),
.game-card.is-progression-milestone.is-unlocking .game-milestone-reveal span:nth-child(4) {
    animation-delay: .46s;
}

.game-card.is-progression-milestone.is-unlocking .game-milestone-reveal span:nth-child(3) {
    animation-delay: .52s;
}

.game-card.is-unlocking .game-lock-layer {
    animation: game-lock-layer-away 1.2s ease forwards;
    pointer-events: none;
}

.game-card.is-progression-milestone.is-unlocking .game-lock-layer {
    animation: game-milestone-layer-away 1.75s ease forwards;
}

.game-card.just-unlocked {
    animation: game-card-unlocked .8s ease both;
}

.game-card.is-progression-milestone.just-unlocked {
    animation: game-milestone-unlocked 1.3s ease both;
}

@keyframes game-lock-ready {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(255, 225, 124, .2)); transform: rotate(-1deg) scale(1); }
    50% { filter: drop-shadow(0 0 17px rgba(126, 223, 208, .8)); transform: rotate(1deg) scale(1.04); }
}

@keyframes game-lock-left {
    to { opacity: 0; transform: translate(-65px, 65px) rotate(-28deg); }
}

@keyframes game-lock-right {
    to { opacity: 0; transform: translate(65px, 65px) rotate(28deg); }
}

@keyframes game-lock-layer-away {
    60% { opacity: 1; }
    to { opacity: 0; }
}

@keyframes game-card-unlocked {
    45% { box-shadow: 0 0 0 5px #ffe17c, 0 0 28px rgba(126, 223, 208, .8); transform: translateY(-4px); }
}

@keyframes game-milestone-ready {
    0%, 100% { box-shadow: 0 5px 0 rgba(35, 19, 18, .58), 0 0 0 2px rgba(255, 239, 166, .68), 0 0 18px rgba(255, 223, 117, .3); transform: translateX(-50%) translateY(0); }
    50% { box-shadow: 0 5px 0 rgba(35, 19, 18, .58), 0 0 0 3px rgba(255, 248, 204, .9), 0 0 38px rgba(255, 235, 161, .9); transform: translateX(-50%) translateY(2px); }
}

@keyframes game-milestone-lock-ready {
    0%, 100% { filter: drop-shadow(0 5px 5px rgba(14, 7, 24, .72)) drop-shadow(0 0 8px rgba(255, 221, 104, .35)); transform: rotate(-2deg) scale(1.02); }
    50% { filter: drop-shadow(0 7px 7px rgba(14, 7, 24, .68)) drop-shadow(0 0 24px rgba(130, 240, 220, .9)); transform: translateY(-4px) rotate(2deg) scale(1.1); }
}

@keyframes game-milestone-lock-impact {
    0% { filter: brightness(1) drop-shadow(0 5px 5px rgba(14, 7, 24, .72)); opacity: 1; transform: translateX(0) scale(1.04); }
    24% { transform: translateX(-3px) rotate(-2deg) scale(1.05); }
    48% { transform: translateX(4px) rotate(2deg) scale(1.07); }
    72% { filter: brightness(2.35) drop-shadow(0 0 30px rgba(255, 242, 166, 1)); opacity: 1; transform: translateX(-2px) rotate(-1deg) scale(1.1); }
    100% { filter: brightness(2.8) drop-shadow(0 0 42px rgba(130, 240, 220, .95)); opacity: 0; transform: scale(1.12); }
}

@keyframes game-milestone-crack-flash {
    0%, 38% { filter: brightness(1); opacity: 0; transform: rotate(-7deg) scale(.7); }
    62% { filter: brightness(2.4); opacity: 1; transform: rotate(-7deg) scale(1.16); }
    100% { filter: brightness(3); opacity: 0; transform: rotate(-7deg) scale(1.38); }
}

@keyframes game-milestone-shard-left {
    0%, 30% { opacity: 1; transform: scale(1.04) rotate(0deg); }
    42% { opacity: 1; transform: translate(-8px, -2px) scale(1.05) rotate(-5deg); }
    100% { opacity: 0; transform: translate(-105px, -58px) scale(.68) rotate(-52deg); }
}

@keyframes game-milestone-shard-right {
    0%, 30% { opacity: 1; transform: scale(1.04) rotate(0deg); }
    42% { opacity: 1; transform: translate(8px, -2px) scale(1.05) rotate(5deg); }
    100% { opacity: 0; transform: translate(105px, -58px) scale(.68) rotate(52deg); }
}

@keyframes game-milestone-shard-top {
    0%, 30% { opacity: 1; transform: scale(1.04) rotate(0deg); }
    42% { opacity: 1; transform: translateY(-9px) scale(1.05) rotate(-2deg); }
    100% { opacity: 0; transform: translate(-22px, -122px) scale(.7) rotate(-28deg); }
}

@keyframes game-milestone-shard-bottom {
    0%, 30% { opacity: 1; transform: scale(1.04) rotate(0deg); }
    42% { opacity: 1; transform: translateY(8px) scale(1.05) rotate(2deg); }
    100% { opacity: 0; transform: translate(24px, 112px) scale(.62) rotate(35deg); }
}

@keyframes game-milestone-frame-open {
    0%, 28% { filter: brightness(1); opacity: 1; transform: scale(1); }
    55% { filter: brightness(1.8); opacity: 1; transform: scale(1.025); }
    100% { filter: brightness(2); opacity: 0; transform: scale(1.16); }
}

@keyframes game-milestone-banner-lift {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    45% { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.08); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-34px) scale(.86); }
}

@keyframes game-milestone-sunburst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
    28% { opacity: .95; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35) rotate(28deg); }
}

@keyframes game-milestone-star-flight {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
    22% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--milestone-star-x)), calc(-50% + var(--milestone-star-y))) scale(1.15) rotate(155deg); }
}

@keyframes game-milestone-layer-away {
    0%, 76% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes game-milestone-unlocked {
    45% {
        box-shadow: 0 0 0 7px #ffe17c, 0 0 42px rgba(126, 223, 208, .9);
        transform: translateY(-6px) scale(1.015);
    }
}

@media (max-width: 520px) {
    .game-lock-layer {
        gap: 6px;
        grid-template-columns: 104px minmax(0, 1fr);
        padding: 26px 16px 20px;
    }

    .game-lock-crest {
        max-width: 76px;
    }

    .game-card.is-progression-milestone .game-lock-crest {
        max-width: 90px;
    }

    .game-milestone-banner {
        font-size: 11px;
        min-width: min(76%, 190px);
        padding: 8px 24px 7px;
    }

    .game-lock-preview {
        min-height: 132px;
    }

    .game-lock-preview-name {
        font-size: 12px;
        padding-inline: 3px;
    }

    .game-lock-copy {
        gap: 6px;
    }

    .game-lock-copy > strong {
        font-size: 18px;
    }

    .game-unlock-primary,
    .game-score-unlock,
    .game-score-confirm button {
        min-height: 34px;
        padding: 6px 8px;
    }
}

@container (max-width: 285px) {
    .game-lock-layer {
        align-content: center;
        gap: 8px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(142px, .8fr) auto;
        padding: 28px 18px 24px;
    }

    .game-lock-crest {
        max-width: 104px;
    }

    .game-card.is-progression-milestone .game-lock-crest {
        max-width: 116px;
    }

    .game-lock-preview {
        min-height: 142px;
    }

    .game-lock-preview-name {
        font-size: 15px;
    }

    .game-lock-copy {
        justify-self: stretch;
    }

    .game-lock-copy > strong {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-progression-ready .game-lock-crest,
    .game-card.is-progression-milestone.is-progression-ready .game-milestone-banner,
    .game-card.is-unlocking .game-lock-shard,
    .game-card.is-progression-milestone.is-unlocking .game-lock-base,
    .game-card.is-progression-milestone.is-unlocking .game-lock-chain-frame,
    .game-card.is-progression-milestone.is-unlocking .game-milestone-banner,
    .game-card.is-progression-milestone.is-unlocking .game-milestone-reveal::before,
    .game-card.is-progression-milestone.is-unlocking .game-milestone-reveal span,
    .game-card.is-unlocking .game-lock-layer,
    .game-card.just-unlocked {
        animation: none;
    }
}

.game-card.is-hidden {
    display: none;
}

.game-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
    left: 54px;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
}

.game-favourite-button {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    left: 10px;
    padding: 7px;
    position: absolute;
    top: 10px;
    transition: background .16s ease, transform .16s ease;
    width: 36px;
    z-index: 3;
}

.game-favourite-button svg {
    height: 20px;
    width: 20px;
}

.game-favourite-button path {
    fill: transparent;
    stroke: currentColor;
    stroke-linejoin: round;
    stroke-width: 2;
}

.game-favourite-button.active {
    background: var(--yellow);
    transform: translateY(-1px);
}

.game-favourite-button.active path {
    fill: currentColor;
}

.game-favourite-button:disabled {
    cursor: wait;
    opacity: .65;
}

.game-world-page :is(button, summary, .btn, .icon-btn, .header-user, .player-option, .game-variant-switch, .game-badge, .pw-view-switch [aria-current]) {
    box-shadow: none;
}

.game-world-page :is(button, summary, .btn, .icon-btn) img,
.game-world-page .hero > img,
.game-world-page .brand > img {
    filter: none;
}

.game-shelf-empty {
    font-weight: 800;
    margin-top: 14px;
    padding: 20px;
    text-align: center;
}

.game-badge {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--text);
    font-size: 11px;
    font-family: inherit;
    font-weight: 900;
    line-height: 1;
    padding: 6px 8px;
}

.game-badge.is-hidden {
    display: none;
}

.game-badge.factor {
    background: var(--pink);
    color: var(--paper-warm);
}

.game-badge.waiting {
    background: var(--sky);
    color: var(--accent-strong-text);
}

.game-badge.played {
    background: var(--surface-2);
}

.game-badge.rating {
    background: var(--draw-bg);
    color: var(--draw-text);
}

.rating-badge-button {
    cursor: pointer;
}

.rating-badge-button:hover {
    transform: translateY(-1px);
}

.game-variant-switch {
    align-items: center;
    background: rgba(255, 255, 255, .78);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    display: inline-flex;
    gap: 3px;
    left: 10px;
    bottom: 10px;
    padding: 3px;
    position: absolute;
    top: auto;
    z-index: 3;
}

.game-variant-switch button {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--status-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    padding: 7px 8px;
}

.game-variant-switch button.active {
    background: var(--accent-strong);
    color: var(--accent-strong-text);
}

.game-variant-switch button.is-hidden {
    display: none;
}

.game-card-flip {
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    min-height: 0;
    overflow: hidden;
    perspective: 800px;
    position: relative;
    width: 100%;
}

.game-card-flip .game-card-media {
    height: 100%;
}

.game-card-face {
    backface-visibility: hidden;
    inset: 0;
    opacity: 0;
    position: absolute;
    transform: rotateY(180deg) scale(.98);
    transition: opacity .18s ease, transform .46s cubic-bezier(.2, .8, .2, 1);
}

.game-card-face.active {
    opacity: 1;
    transform: rotateY(0) scale(1);
}

.variant-flipping .game-card-face.active {
    animation: card-face-pop .42s ease both;
}

.game-card-media {
    background: var(--surface-2);
    display: block;
    aspect-ratio: 16 / 10;
    min-height: 0;
    object-fit: contain;
    padding: 8px;
    width: 100%;
}

.game-card-body {
    align-content: start;
    container-type: inline-size;
    display: grid;
    gap: 8px;
    /* Wrapped room buttons must determine their row height. */
    grid-template-rows: auto auto;
    padding: 12px 12px 8px;
}

.game-card .invite-status:empty {
    display: none;
}

@media (min-width: 521px) {
    .grid-3x3 .game-card-flip,
    .grid-3x3 .game-card-media {
        aspect-ratio: 4 / 3;
    }
}

.game-card h3 {
    display: -webkit-box;
    font-size: 18px;
    line-height: 1.15;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.game-card-title {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    min-height: 42px;
}

.game-card-title img {
    height: 34px;
    object-fit: contain;
    width: 34px;
}

.game-rating {
    display: grid;
    gap: 5px;
}

.rating-summary {
    align-items: center;
    display: flex;
    gap: 7px;
}

.rating-summary strong {
    color: var(--text);
    font-size: 13px;
}

.rating-warning {
    background: var(--surface-3);
    border: 2px solid rgba(37, 35, 58, .18);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    padding: 8px 10px;
}

html[data-theme="dark"] .rating-warning {
    border-color: rgba(244, 233, 255, .22);
}

.rating-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.rating-star,
.rating-zero {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 7px;
    box-shadow: none;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    height: 25px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 24px;
}

.rating-star.active,
.rating-zero.active,
.rating-star:hover,
.rating-zero:hover {
    background: var(--draw-bg);
    color: var(--draw-text);
}

.rating-star:disabled,
.rating-zero:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.rating-star:disabled:hover,
.rating-zero:disabled:hover {
    background: var(--surface);
    color: var(--muted);
}

.rating-status {
    font-size: 13px;
    margin: 0;
}

.rules-button {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 34px;
}

.rules-button:hover {
    background: var(--yellow);
    transform: translateY(-1px);
}

.rules-dialog {
    background: transparent;
    border: 0;
    max-width: min(92vw, 430px);
    padding: 0;
}

.rules-dialog::backdrop {
    background: rgba(10, 12, 30, .44);
}

.rules-card {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 18px;
    position: relative;
    width: min(92vw, 430px);
}

.rules-card img {
    height: 58px;
    object-fit: contain;
    width: 58px;
}

.rules-card h2 {
    font-size: 23px;
    margin: 0;
}

.rules-card ul {
    display: grid;
    gap: 8px;
    line-height: 1.45;
    margin: 0;
    padding-inline-start: 20px;
}

.game-rules-top {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 58px;
    padding-inline-end: 40px;
}

.game-video-guide-links {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.game-video-guide {
    align-items: center;
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    height: 58px;
    justify-content: center;
    position: relative;
    width: 58px;
}

.rules-card .game-video-guide img {
    height: 52px;
    object-fit: contain;
    width: 52px;
}

.game-video-guide small {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    bottom: -4px;
    color: var(--text);
    font-size: 8px;
    font-weight: 800;
    inset-inline: -3px;
    line-height: 1.15;
    padding: 2px 3px;
    position: absolute;
    text-align: center;
    white-space: nowrap;
}

a.game-video-guide:hover {
    background: color-mix(in srgb, var(--surface-2) 72%, var(--yellow));
    transform: translateY(-1px);
}

.game-video-guide.coming-soon {
    opacity: .68;
}

.rules-close {
    align-items: center;
    background: var(--pink);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--status-text);
    cursor: pointer;
    display: flex;
    font-size: 18px;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 32px;
}

.player-options {
    --shelf-action-height: 48px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 521px) {
    @container (max-width: 199px) {
        .player-options {
            grid-template-columns: minmax(0, 1fr);
        }
    }
}

.player-option {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 9px;
    box-shadow: none;
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    min-height: var(--shelf-action-height);
    overflow: hidden;
}

.player-option.is-hidden,
.computer-options button.is-hidden {
    display: none;
}

.player-play-btn,
.player-link-btn {
    align-items: center;
    color: var(--text);
    display: flex;
    font-weight: 900;
    justify-content: center;
}

.player-play-btn {
    gap: 5px;
    min-width: 0;
    padding: 0 11px;
}

.room-score-factor {
    align-items: center;
    background: color-mix(in srgb, var(--yellow) 72%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .56rem;
    font-weight: 950;
    height: 1.12rem;
    justify-content: center;
    line-height: 1;
    min-width: 1.75rem;
    overflow: hidden;
    padding: 0 3px;
    white-space: nowrap;
}

.room-score-factor[hidden],
.room-score-factor.is-hidden {
    display: none;
}

.player-option:has(:where(.room-score-factor:not([hidden]):not(.is-hidden))) .player-play-btn {
    gap: 2px;
    padding-inline: 1px;
}

.player-options .room-score-factor {
    font-size: .5rem;
    height: 1rem;
    min-width: 1.4rem;
    padding-inline: 2px;
}

.player-link-btn {
    background: var(--sky);
    border: 0;
    border-inline-start: 2px solid var(--line);
    cursor: pointer;
    min-width: 36px;
    padding: 0;
    position: relative;
}

.player-link-btn.coral {
    background: var(--coral);
}

.player-link-btn.yellow {
    background: var(--yellow);
}

.player-link-btn.sky {
    background: var(--sky);
}

.player-link-btn.category-paper {
    background: var(--coral);
}

.player-link-btn.category-dice {
    background: var(--yellow);
}

.player-link-btn.category-board {
    background: var(--mint);
}

.player-link-btn.category-drawing {
    background: var(--sky);
}

.player-link-btn.category-card {
    background: var(--violet);
}

.player-link-btn.category-puzzle {
    background: var(--orange);
}

.player-link-btn.category-word {
    background: var(--pink);
}

.player-link-btn img {
    height: 23px;
    object-fit: contain;
    width: 23px;
}

.computer-open-button {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 9px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    gap: 7px;
    justify-content: center;
    min-height: var(--shelf-action-height);
    min-width: 0;
    padding: 0 12px;
}

.computer-open-button img {
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.computer-open-button:hover {
    background: var(--mint);
    transform: translateY(-1px);
}

.computer-card {
    max-width: 460px;
}

.computer-adult-warning {
    background: color-mix(in srgb, var(--coral) 16%, var(--surface));
    border: 2px solid color-mix(in srgb, var(--coral) 62%, var(--line));
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    margin: 0;
    padding: 8px 10px;
}

.rules-card .computer-card-image {
    filter: drop-shadow(0 7px 0 rgba(37, 49, 74, .16));
    height: 116px;
    justify-self: center;
    object-fit: contain;
    width: 116px;
}

.computer-options {
    display: grid;
    gap: 8px;
}

.computer-options button {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-weight: 900;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
}

.computer-room-label {
    flex: 1 1 auto;
    text-align: center;
}

.computer-options .room-score-factor {
    margin-inline-start: 8px;
}

.computer-options button:hover {
    background: var(--sky);
}

.player-link-btn.copied img {
    opacity: 0;
}

.player-link-btn.copied::after {
    color: var(--text);
    content: "✓";
    font-size: 22px;
    font-weight: 900;
    inset: 0;
    position: absolute;
    display: grid;
    place-items: center;
}

.invite-status {
    font-size: 12px;
    min-height: 16px;
}

.bottom-nav {
    background: var(--nav-bg);
    border: 0;
    border-top: 2px solid rgba(58, 32, 138, .16);
    border-radius: 0;
    bottom: 0;
    box-shadow: var(--nav-shadow);
    gap: 10px;
    justify-content: space-between;
    left: 0;
    max-width: none;
    padding: 9px max(12px, calc((100vw - 720px) / 2 + 12px));
    position: fixed;
    transform: none;
    width: 100%;
    z-index: 1000;
}

.bottom-nav a {
    align-items: center;
    border-radius: 999px;
    color: var(--boo-gray);
    display: flex;
    flex: 0 0 58px;
    font-size: 12px;
    font-weight: 900;
    gap: 6px;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    text-align: center;
}

.bottom-nav a.active {
    background: var(--boo-light-primary);
    border: 0;
    color: var(--boo-primary);
    flex: 1 1 170px;
    max-width: 198px;
}

.bottom-nav a:not(.active) .nav-label {
    display: none;
}

.nav-icon {
    display: grid;
    height: 34px;
    place-items: center;
    width: 34px;
}

.nav-icon img {
    filter: grayscale(1) saturate(.35);
    height: 100%;
    object-fit: contain;
    opacity: .72;
    width: 100%;
}

.bottom-nav a.active .nav-icon img {
    filter: none;
    opacity: 1;
}

.nav-emoji {
    filter: grayscale(1) saturate(.35);
    font-size: 25px;
    line-height: 1;
    opacity: .78;
}

.bottom-nav a.active .nav-emoji {
    filter: none;
    opacity: 1;
}

.letter-paper {
    background:
        repeating-linear-gradient(#fffdf8, #fffdf8 27px, #b7d4ff 28px),
        linear-gradient(90deg, transparent 36px, rgba(255, 107, 107, .35) 37px, transparent 38px);
    border: 3px solid #25314a;
    border-radius: 8px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .14);
    color: #25314a;
    min-height: 230px;
    padding: 34px 18px 18px 48px;
}

.stamp-row,
.letter-list,
.chat-list {
    display: grid;
    gap: 10px;
}

.stamp-row {
    grid-template-columns: repeat(4, 1fr);
}

.stamp-row img {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    width: 100%;
}

.chat-item,
.letter-item,
.leader-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 58px 1fr auto;
    padding: 10px;
    position: relative;
}

.letter-item {
    align-items: start;
    background: #fffaf0;
    color: #25314a;
}

.avatar {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.profile-photo {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 112px 1fr;
}

.profile-photo img {
    aspect-ratio: 1;
    background: var(--surface-2);
    border: 3px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    width: 112px;
}

.profile-page {
    --profile-gradient:
        radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--sky) 22%, transparent), transparent 32%),
        radial-gradient(circle at 8% 100%, color-mix(in srgb, var(--pink) 14%, transparent), transparent 42%),
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--sky)), color-mix(in srgb, var(--surface-2) 90%, var(--violet)));
}

.profile-page .app-shell {
    padding-bottom: 78px;
}

.profile-page .top-bar {
    padding-bottom: 12px;
}

.profile-page .panel {
    margin: 9px 0;
}

.profile-hero-panel {
    align-items: center;
    background: var(--profile-gradient);
    display: grid;
    gap: 20px;
    grid-template-columns: 104px minmax(0, 1fr);
    overflow: visible;
    padding: 14px;
}

.profile-hero-avatar {
    aspect-ratio: 1;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .16);
    object-fit: cover;
    width: 104px;
}

.profile-hero-avatar-frame {
    width: 104px;
}

.profile-photo-launcher {
    align-self: center;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    display: block;
    line-height: 0;
    padding: 0;
    position: relative;
    width: fit-content;
}

.profile-photo-launcher:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 5px;
}

.profile-photo-edit-label {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--boo-primary);
    font-size: 10px;
    font-weight: 900;
    inset-inline-end: -5px;
    line-height: 1;
    padding: 5px 7px;
    position: absolute;
    top: -7px;
    z-index: 10;
}

.profile-hero-copy h1 {
    color: var(--boo-primary);
    font-size: 30px;
    line-height: 1;
    margin: 2px 0 5px;
}

.profile-hero-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 6px 0 8px;
}

.profile-stats-link {
    align-items: center;
    background: color-mix(in srgb, var(--sky) 55%, var(--surface));
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--boo-primary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    min-height: 30px;
    padding: 5px 10px;
    text-decoration: none;
}

.profile-stats-link:focus-visible,
.profile-stats-link:hover {
    background: var(--sky);
    transform: translateY(-1px);
}

.public-profile-location {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    margin: 0 0 4px;
}

.profile-photo-dialog {
    max-width: min(92vw, 400px);
    overflow: visible;
}

.profile-photo-dialog-card {
    gap: 8px;
    max-width: 400px;
    padding: 16px;
    text-align: start;
    width: min(92vw, 400px);
}

.profile-photo-dialog-card > h2 {
    margin-bottom: 2px;
}

.profile-photo-dialog-stage {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 34px minmax(0, 210px) 34px;
    justify-content: center;
    margin: 42px 0;
}

.profile-photo-dialog-stage .profile-photo-step {
    position: relative;
    z-index: 7;
}

.profile-photo-dialog-avatar-frame,
.profile-photo-dialog-avatar {
    width: min(54vw, 210px);
}

.rules-card .profile-photo-dialog-avatar {
    aspect-ratio: 1;
    background: var(--surface-2);
    border: 3px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .16);
    height: auto;
    object-fit: cover;
    width: 100%;
}

.profile-photo-selector {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 2px;
}

.profile-photo-selector > strong {
    color: var(--boo-primary);
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

.profile-photo-selector > .muted {
    font-size: 11px;
    text-align: center;
}

.profile-photo-step {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--boo-primary);
    cursor: pointer;
    display: inline-flex;
    font-size: 19px;
    font-weight: 950;
    height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 30px;
}

.profile-photo-step:disabled {
    cursor: default;
    opacity: .35;
}

.profile-photo-single,
.profile-photo-dialog-card .profile-status,
.profile-photo-dialog-card .profile-photo-limit {
    font-size: 11px;
    margin: 0;
    text-align: center;
}

.profile-photo-dialog-card .profile-status {
    min-height: 16px;
}

.profile-photo-dialog-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
}

.profile-photo-dialog-actions-moonlit {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-photo-dialog-actions > *,
.profile-photo-dialog-actions .btn {
    min-width: 0;
    width: 100%;
}

.profile-photo-dialog-actions .btn {
    font-size: 12px;
    min-height: 34px;
    padding: 5px 7px;
}

.profile-photo-dialog-actions .profile-picture-change-control {
    display: flex;
}

.profile-photo-dialog-actions .profile-picture-change-control .btn {
    padding-inline-end: 32px;
}

.profile-photo-dialog-actions .profile-picture-change-control .profile-help-button {
    inset-inline-end: 5px;
}

.profile-hero-about {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 8px;
    padding: 7px 8px;
}

.profile-hero-about-title {
    color: var(--boo-primary);
    display: block;
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 2px;
}

.profile-picture-change-control {
    display: inline-flex;
    position: relative;
}

.profile-picture-change-control .btn {
    padding-inline-end: 42px;
}

.profile-picture-change-control .profile-help-button {
    inset-inline-end: 8px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.profile-file-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.profile-status {
    margin: 5px 0 0;
    min-height: 16px;
}

.profile-status:empty {
    display: none;
}

.profile-crop-card {
    max-width: 520px;
}

.profile-crop-stage {
    aspect-ratio: 1;
    background: #14182a;
    border: 3px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.profile-crop-stage::after {
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(12, 16, 30, .55);
    content: "";
    inset: 4%;
    pointer-events: none;
    position: absolute;
}

.profile-crop-stage canvas {
    cursor: grab;
    display: block;
    height: 100%;
    touch-action: none;
    width: 100%;
}

.profile-crop-stage canvas:active {
    cursor: grabbing;
}

.profile-crop-zoom input {
    width: 100%;
}

.profile-crop-card .btn-row form {
    margin: 0;
}

.profile-account-panel {
    margin-top: 10px;
}

.account-choice-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-choice-card {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 82%, var(--boo-light-primary));
    border: 2px solid var(--line);
    border-radius: 10px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 12px;
}

.account-choice-card h3 {
    color: var(--boo-primary);
    margin: 0;
}

.account-choice-card form {
    margin: 0;
}

.account-choice-wide {
    grid-column: 1 / -1;
}

.account-choice-danger {
    background: color-mix(in srgb, var(--surface) 84%, var(--coral));
    border-color: color-mix(in srgb, var(--line) 55%, var(--coral));
}

.account-delete-confirmation {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .12em;
}

.account-delete-dialog .rules-card {
    max-width: 560px;
}

.account-delete-dialog .btn:disabled {
    cursor: not-allowed;
    filter: grayscale(.8);
    opacity: .5;
}

.profile-panel-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 10px 0;
}

@media (max-width: 620px) {
    .account-choice-grid {
        grid-template-columns: 1fr;
    }

}

.profile-panel-grid .panel {
    background: var(--profile-gradient);
    margin: 0;
    padding: 14px;
}

.profile-card-head {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px minmax(0, 1fr);
}

.profile-card-head img {
    filter: drop-shadow(0 6px 0 rgba(37, 49, 74, .14));
    width: 48px;
}

.profile-card-head h2 {
    color: var(--boo-primary);
    font-size: 20px;
    line-height: 1.1;
    margin: 0 0 2px;
}

.profile-card-head p {
    margin: 0;
}

.profile-link-box {
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    grid-template-columns: 1fr;
    padding: 8px;
}

.profile-link-box.compact {
    align-content: start;
    align-self: start;
    background: transparent;
    border: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    justify-items: stretch;
    padding: 0;
}

.profile-copy-control {
    align-self: start;
    background: var(--yellow);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    justify-self: start;
    min-height: 46px;
    min-width: 0;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
    width: 100%;
}

.profile-copy-control:hover {
    transform: translateY(-2px);
}

.profile-copy-control:active {
    box-shadow: none;
    transform: translateY(2px);
}

.profile-copy-link,
.profile-paste-link,
.profile-refresh-link {
    background: transparent;
    border: 0;
    color: var(--status-text);
    cursor: pointer;
    font-weight: 900;
    min-width: 0;
}

.profile-copy-link {
    padding: 9px 10px;
}

.profile-paste-link,
.profile-refresh-link {
    align-items: center;
    border-inline-start: 3px solid var(--status-text);
    display: inline-flex;
    font-size: 22px;
    justify-content: center;
    padding: 0;
}

.profile-paste-link {
    font-size: 10px;
    letter-spacing: -.02em;
    padding: 0 4px;
}

.profile-paste-link:hover,
.profile-paste-link:focus-visible,
.profile-refresh-link:hover,
.profile-refresh-link:focus-visible {
    background: color-mix(in srgb, var(--surface) 24%, transparent);
}

.profile-paste-link:focus-visible,
.profile-refresh-link:focus-visible {
    box-shadow: inset 0 0 0 2px var(--paper-warm);
    outline: 2px solid var(--status-text);
    outline-offset: -4px;
}

.profile-refresh-link span {
    display: block;
}

.profile-refresh-link.is-refreshing span {
    animation: profile-link-refresh-spin .55s linear infinite;
}

@keyframes profile-link-refresh-spin {
    to { transform: rotate(360deg); }
}

.profile-link-box.compact .btn {
    min-height: 46px;
    min-width: 0;
    width: 100%;
}

.profile-share-panel {
    display: grid;
    gap: 8px;
    grid-template-rows: auto 1fr;
}

.profile-share-card-head {
    grid-template-columns: 40px minmax(0, 1fr);
}

.profile-share-card-head img {
    width: 40px;
}

.profile-share-rows {
    display: grid;
    gap: 8px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.profile-share-row {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 34%, transparent);
    border: 2px solid color-mix(in srgb, var(--line) 42%, transparent);
    border-radius: 9px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, .8fr) minmax(145px, 1.2fr);
    min-width: 0;
    padding: 7px;
}

.profile-share-row-label {
    min-width: 0;
}

.profile-share-row h3 {
    color: var(--boo-primary);
    font-size: 15px;
    line-height: 1.1;
    margin: 0 0 4px;
}

.profile-share-copy {
    min-height: 42px;
    min-width: 0;
    padding-inline: 6px;
    width: 100%;
}

.profile-share-row .profile-copy-control {
    grid-template-columns: minmax(0, 1fr) 36px;
    min-height: 50px;
}

.profile-share-row .profile-friend-link-control {
    grid-template-columns: minmax(0, 1fr) 48px 44px;
}

.profile-share-row .profile-copy-link {
    font-size: 13px;
    line-height: 1.1;
    padding: 6px;
}

.profile-share-row .profile-refresh-link {
    font-size: 20px;
}

.profile-friend-link-entry {
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
}

.profile-friend-link-entry[hidden] {
    display: none;
}

.profile-friend-link-entry .input,
.profile-friend-link-entry .btn {
    font-size: 12px;
    min-height: 44px;
}

.profile-friend-link-entry .input {
    min-width: 0;
    padding: 8px 9px;
}

.profile-friend-link-entry .btn {
    padding: 7px 10px;
}

.profile-friend-link-status {
    font-size: 11px;
    grid-column: 1 / -1;
    margin: 0;
    min-height: 15px;
}

.profile-share-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.profile-share-meta strong {
    color: var(--boo-primary);
    font-size: 13px;
}

.profile-share-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.profile-share-links a {
    color: var(--boo-primary);
    font-size: 11px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.profile-palette-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-palette-grid .palette-option {
    min-height: 64px;
    padding: 8px;
}

.profile-settings-panel {
    background: var(--profile-gradient);
    gap: 12px;
    padding: 14px;
}

.profile-settings-tabs {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border: 2px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
}

.profile-settings-tabs button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    min-height: 36px;
}

.profile-settings-tabs button.active {
    background: var(--accent-strong);
    color: var(--accent-strong-text);
}

.profile-control-grid {
    align-content: start;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    perspective: 900px;
    transform: rotateY(0);
    transition: opacity .18s ease, transform .18s ease;
}

.profile-control-grid.is-measuring {
    transition: none;
}

.profile-control-grid[data-active-face="general"] [data-profile-settings-face="game"],
.profile-control-grid[data-active-face="game"] [data-profile-settings-face="general"] {
    display: none;
}

.profile-control-grid.is-flipping-out {
    opacity: .25;
    transform: rotateY(90deg);
}

.profile-control-grid.is-flipping-in {
    opacity: .25;
    transform: rotateY(-90deg);
    transition: none;
}

.profile-control {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    padding: 8px;
}

.profile-control span {
    color: var(--boo-primary);
    font-size: 12px;
    font-weight: 900;
}

.profile-control :disabled {
    cursor: not-allowed;
    opacity: .66;
}

.profile-control-title {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    min-height: 22px;
}

.profile-control-title small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.profile-help-button {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 78%, var(--palette-secondary));
    border: 2px solid var(--line);
    border-radius: 50%;
    color: var(--boo-primary);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 12px;
    font-weight: 900;
    height: 22px;
    justify-content: center;
    padding: 0;
    width: 22px;
}

.profile-help-button[aria-expanded="true"] {
    background: var(--palette-secondary);
}

.profile-control .input,
.profile-control .select {
    background: var(--surface);
    border-width: 2px;
    min-height: 40px;
}

.profile-birthday-control,
.profile-birthday-control .input {
    min-width: 0;
}

/* Native date controls must fit the card at every profile grid breakpoint. */
.profile-birthday-control .input {
    display: block;
    max-width: 100%;
    padding-inline: 4px;
    width: 100%;
}

.profile-birthday-control .input::-webkit-date-and-time-value {
    min-width: 0;
}

.profile-birthday-control .input::-webkit-datetime-edit {
    padding: 0;
}

.profile-birthday-control .input::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
}

.profile-control select.profile-compact-select {
    font-size: 13px;
}

.profile-control select.profile-tight-select {
    font-size: 11px;
    padding-inline-end: 24px;
}

.age-range-label {
    color: var(--palette-primary);
    font-size: 12px;
    margin-inline-start: auto;
}

.profile-age-control {
    display: grid;
    gap: 6px;
}

.profile-age-range-open {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: space-between;
    min-height: 40px;
    padding: 7px 10px;
    width: 100%;
}

.profile-age-range-open .age-range-label {
    color: var(--palette-primary);
    font-size: 17px;
    margin: 0;
}

.profile-age-range-open:hover,
.profile-age-range-open:focus-visible {
    border-color: var(--palette-primary);
}

.profile-age-range-open:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--palette-secondary) 65%, transparent);
    outline-offset: 2px;
}

.age-range-slider {
    direction: ltr;
    height: 40px;
    position: relative;
}

.age-range-dialog {
    max-width: min(96vw, 660px);
}

.age-range-card {
    gap: 16px;
    max-width: 640px;
    text-align: start;
    width: min(94vw, 640px);
}

.age-range-card > h2,
.age-range-card > p {
    margin: 0;
}

.age-range-number-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.age-range-number-grid .input {
    font-size: 22px;
    font-weight: 900;
    min-height: 52px;
    text-align: center;
}

.age-range-slider-large {
    height: 76px;
    margin: 2px 4px;
}

.age-range-slider-large .age-range-track {
    height: 14px;
    left: 14px;
    right: 14px;
    top: 31px;
}

.age-range-slider-large .age-range-input {
    height: 76px;
}

.age-range-slider-large .age-range-input::-webkit-slider-thumb {
    height: 30px;
    width: 30px;
}

.age-range-slider-large .age-range-input::-moz-range-thumb {
    height: 30px;
    width: 30px;
}

.age-range-error {
    color: var(--danger-text);
    font-size: 12px;
    font-weight: 850;
    min-height: 18px;
}

.profile-distance-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 28px;
}

.profile-distance-control,
.profile-location-visibility-control,
.profile-save-row {
    grid-column: 1 / -1;
}

.profile-distance-control {
    grid-row: 6;
    min-height: 122px;
}

.profile-past-opponents-control {
    align-self: start;
}

.profile-control-grid[data-active-face="general"] .profile-location-visibility-control {
    grid-row: 7;
}

.profile-save-row {
    grid-row: 7;
}

.profile-control-grid[data-active-face="general"] .profile-save-row {
    grid-row: 8;
}

.profile-about-preview {
    color: var(--muted);
    display: -webkit-box;
    line-height: 1.45;
    margin: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.profile-about-edit {
    justify-self: end;
    min-height: 36px;
    padding: 7px 12px;
}

.about-me-dialog {
    max-width: min(94vw, 580px);
}

.about-me-edit-card,
.about-me-view-card {
    max-width: 580px;
    text-align: start;
    width: min(94vw, 580px);
}

.about-me-input {
    line-height: 1.6;
    min-height: 250px;
    resize: none;
}

.about-me-counter {
    color: var(--muted);
    margin: 0;
    text-align: end;
}

.about-me-counter strong {
    color: var(--palette-primary);
}

.about-me-view-text {
    line-height: 1.65;
    margin: 0;
    max-height: min(55vh, 420px);
    overflow-y: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.about-me-link {
    background: transparent;
    border: 0;
    color: var(--boo-primary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 2px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-control-grid[data-active-face="general"]::before {
    content: none !important;
    display: none !important;
}

.profile-switch {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
}

.profile-switch input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.profile-switch-track {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    height: 22px;
    padding: 2px;
    transition: background .18s ease;
    width: 38px;
}

.profile-switch-track span {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    height: 14px;
    transform: translateX(0);
    transition: transform .18s ease;
    width: 14px;
}

.profile-switch input:checked + .profile-switch-track {
    background: var(--palette-primary);
}

.profile-switch input:checked + .profile-switch-track span {
    transform: translateX(16px);
}

[dir="rtl"] .profile-switch input:checked + .profile-switch-track span {
    transform: translateX(-16px);
}

.profile-switch input:focus-visible + .profile-switch-track {
    outline: 3px solid color-mix(in srgb, var(--palette-secondary) 65%, transparent);
    outline-offset: 2px;
}

.profile-switch input:disabled + .profile-switch-track {
    cursor: not-allowed;
    opacity: 0.45;
}

.profile-location-link {
    color: var(--boo-primary);
    font-size: 11px;
    font-weight: 900;
    text-decoration: underline;
}

.profile-control.is-distance-off [data-distance-range] {
    opacity: 0.42;
    pointer-events: none;
}

.age-range-track {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    height: 10px;
    left: 7px;
    overflow: hidden;
    position: absolute;
    right: 7px;
    top: 15px;
}

.age-range-track span {
    background: linear-gradient(90deg, var(--palette-primary), var(--palette-secondary));
    bottom: 0;
    position: absolute;
    top: 0;
}

.age-range-input {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    direction: ltr;
    height: 40px;
    left: 0;
    margin: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 100%;
}

.age-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--palette-primary);
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--line);
    cursor: grab;
    height: 18px;
    pointer-events: auto;
    width: 18px;
}

.age-range-input::-moz-range-thumb {
    background: var(--palette-primary);
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--line);
    cursor: grab;
    height: 18px;
    pointer-events: auto;
    width: 18px;
}

.profile-bot-card {
    grid-template-columns: 96px minmax(0, 1fr);
    margin-top: 2px;
    padding: 10px;
}

.profile-bot-card img {
    width: 96px;
}

.profile-bot-card h2 {
    font-size: 22px;
}

.profile-save-row {
    align-items: flex-end;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
}

.profile-save-row .btn {
    min-height: 42px;
    min-width: 160px;
}

.profile-save-button:disabled {
    background: color-mix(in srgb, var(--surface-2) 88%, var(--muted));
    border-color: color-mix(in srgb, var(--line) 72%, var(--muted));
    box-shadow: none;
    color: var(--muted);
    cursor: default;
}

.profile-help-card p {
    line-height: 1.5;
    margin: 0;
}

@media (min-width: 760px) {
    .profile-page .app-shell {
        padding-top: 16px;
        padding-bottom: 72px;
    }

    .profile-page .top-bar {
        padding: 8px 0 18px;
    }

    .profile-hero-panel {
        gap: 20px;
        grid-template-columns: 128px minmax(0, 1fr);
        padding: 10px;
    }

    .profile-page .profile-hero-panel {
        margin-top: 12px;
    }

    .profile-hero-avatar,
    .profile-hero-avatar-frame {
        width: 128px;
    }

    .profile-hero-copy h1 {
        font-size: 26px;
    }

    .profile-photo-actions .btn {
        min-height: 38px;
        padding: 7px 12px;
    }

    .profile-picture-change-control .btn {
        padding-inline-end: 40px;
    }

    .profile-photo-actions {
        margin-top: 6px;
    }

    .profile-panel-grid {
        gap: 8px;
        margin: 7px 0;
    }

    .profile-panel-grid .panel {
        padding: 10px;
    }

    .profile-settings-panel {
        padding: 12px;
    }

    .profile-card-head {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .profile-card-head img {
        width: 40px;
    }

    .profile-card-head h2 {
        font-size: 19px;
    }

    .profile-palette-grid .palette-option {
        gap: 6px;
        min-height: 50px;
        padding: 6px;
    }

    .profile-palette-grid .palette-swatches span {
        height: 18px;
        width: 18px;
    }

    .profile-settings-panel {
        gap: 10px;
    }

    .profile-control-grid {
        gap: 7px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .profile-distance-control {
        grid-column: 1 / span 2;
        grid-row: 3;
    }

    .profile-control-grid.has-moonlit-controls .profile-past-opponents-control {
        grid-column: 3;
        grid-row: 3;
    }

    .profile-save-row {
        align-items: flex-end;
        flex-direction: row;
        grid-column: 3 / -1;
        grid-row: 4;
    }

    .profile-save-row .btn {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    .profile-control-grid[data-active-face="general"] .profile-location-visibility-control {
        grid-column: 1 / span 2;
        grid-row: 4;
    }

    .profile-control-grid[data-active-face="general"] .profile-save-row {
        align-items: flex-end;
        flex-direction: row;
        grid-column: 3 / -1;
        grid-row: 4;
    }

    .profile-control-grid[data-active-face="general"]::before {
        grid-column: 1 / span 2;
        grid-row: 3;
    }

    .profile-control {
        padding: 7px;
    }

    .profile-control span {
        font-size: 11px;
    }

    .profile-control .input,
    .profile-control .select {
        font-size: 14px;
        min-height: 36px;
        padding: 7px 9px;
    }

    .profile-bot-card {
        gap: 10px;
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 8px;
    }

    .profile-bot-card img {
        width: 64px;
    }

    .profile-bot-card h2 {
        font-size: 20px;
    }

    .profile-save-row .btn {
        min-height: 38px;
        padding: 7px 12px;
    }
}

.bot-companion-card {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .12);
    display: grid;
    gap: 14px;
    grid-template-columns: 122px minmax(0, 1fr);
    padding: 12px;
}

.bot-companion-card img {
    filter: drop-shadow(0 7px 0 rgba(37, 49, 74, .16));
    justify-self: center;
    object-fit: contain;
    width: 122px;
}

.bot-companion-card h2 {
    font-size: 24px;
    line-height: 1.1;
    margin: 2px 0 4px;
}

.tiny-label {
    color: var(--boo-primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

.friend-link-box {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
}

.badge {
    background: var(--coral);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: #fffaf0;
    font-size: 12px;
    font-weight: 900;
    min-width: 28px;
    padding: 4px 8px;
    text-align: center;
}

.simple-title-bar {
    align-items: center;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(37, 35, 58, .08);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: -16px -16px 16px;
    padding: 14px 16px;
}

.simple-title-bar h1 {
    color: var(--boo-primary);
    font-size: 18px;
    margin: 0;
    text-align: center;
}

.leaderboard-page {
    background:
        linear-gradient(180deg, rgba(223, 216, 243, .45), rgba(255, 255, 255, 0) 42%),
        var(--bg);
}

.leader-hero {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 116px 1fr;
    margin: 12px 0 4px;
}

.leader-hero img {
    width: 100%;
}

.leader-picker {
    align-items: end;
    display: grid;
    gap: 6px;
    margin: 8px 0 16px;
}

.leader-tools {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 10px;
}

.leader-tools .btn {
    min-height: 40px;
    padding: 8px 14px;
}

.leader-picker label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.leader-picker select {
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 12px;
    color: var(--text);
    font-weight: 900;
    min-height: 46px;
    padding: 8px 12px;
    width: 100%;
}

.leader-board-panel {
    margin-top: 2px;
}

.leader-board-panel h2 {
    color: var(--boo-primary);
    font-size: 22px;
    margin-bottom: 12px;
    text-align: center;
}

.leader-board-description {
    margin: -6px 0 10px;
    text-align: center;
}

.leader-champion-reward {
    align-items: center;
    background: color-mix(in srgb, var(--surface-2) 86%, #fff1ae);
    border: 2px solid color-mix(in srgb, var(--boo-light-primary) 72%, #d5a13e);
    border-radius: 16px;
    display: grid;
    gap: 10px;
    grid-template-columns: 74px minmax(0, 1fr);
    margin: 0 auto 12px;
    max-width: 620px;
    padding: 8px 12px;
    text-align: start;
}

.leader-champion-reward img {
    aspect-ratio: 1;
    filter: drop-shadow(0 7px 8px rgba(31, 28, 61, .22));
    object-fit: contain;
    width: 74px;
}

.leader-champion-reward div {
    display: grid;
    gap: 2px;
}

.leader-champion-reward span,
.leader-champion-reward small {
    color: var(--muted);
    font-size: 11px;
}

.leader-champion-reward strong {
    color: var(--text);
    font-size: 14px;
}

.leader-bot-benchmarks {
    background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
    border: 2px solid var(--boo-light-primary);
    border-radius: 12px;
    margin: 0 auto 12px;
    max-width: 620px;
    overflow: hidden;
    text-align: start;
}

.leader-bot-benchmarks summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 3px 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    list-style: none;
    padding: 9px 11px;
}

.leader-bot-benchmarks summary::-webkit-details-marker {
    display: none;
}

.leader-bot-benchmarks summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    grid-column: 3;
    grid-row: 1;
    height: 7px;
    margin-inline: 3px;
    transform: rotate(45deg);
    transition: transform .18s ease;
    width: 7px;
}

.leader-bot-benchmarks[open] summary::after {
    transform: rotate(225deg);
}

.leader-bot-benchmarks summary > span:first-child > strong {
    color: var(--text);
    display: block;
    font-size: 13px;
}

.leader-bot-benchmarks summary small {
    color: var(--muted);
    display: block;
    font-size: 10px;
    margin-top: 1px;
}

.leader-bot-count {
    background: var(--surface-2);
    border: 1px solid var(--boo-light-primary);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    padding: 4px 8px;
    white-space: nowrap;
}

.leader-bot-benchmark-grid {
    border-top: 2px solid var(--boo-light-primary);
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px;
}

.leader-bot-benchmark-grid article {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--boo-light-primary);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 7px;
}

.leader-bot-benchmark-grid article > img {
    background: var(--surface-2);
    border-radius: 8px;
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.leader-bot-name > strong {
    color: var(--text);
    display: block;
    font-size: 12px;
}

.leader-bot-name > small {
    color: var(--muted);
    display: block;
    font-size: 10px;
}

.leader-bot-rank {
    background: color-mix(in srgb, var(--sky) 16%, var(--surface-2));
    border: 1px solid color-mix(in srgb, var(--sky) 44%, var(--boo-light-primary));
    border-radius: 999px;
    color: var(--text);
    font-size: 10px;
    padding: 4px 7px;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .leader-bot-benchmark-grid {
        grid-template-columns: 1fr;
    }
}

.leader-board-prestige {
    background:
        radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--sky) 34%, transparent), transparent 30%),
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 82%, var(--palette-secondary)), var(--surface));
}

.rulebook-card {
    display: grid;
    gap: 12px;
}

.rulebook-card h2,
.rulebook-card h3 {
    color: var(--boo-primary);
    margin: 0;
}

.rulebook-card h2 {
    font-size: 24px;
}

.rulebook-card h3 {
    font-size: 17px;
}

.rulebook-table {
    display: grid;
    gap: 8px;
}

.rulebook-table div {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
}

.rulebook-table span {
    color: var(--muted);
    font-weight: 800;
}

.rulebook-table strong {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--boo-primary);
    font-weight: 900;
    min-width: 64px;
    padding: 5px 10px;
    text-align: center;
}

.rulebook-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rulebook-chip-row span {
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    padding: 7px 10px;
}

.rulebook-list {
    color: var(--text);
    display: grid;
    gap: 8px;
    line-height: 1.45;
    margin: 0;
    padding-left: 22px;
}

[dir="rtl"] .rulebook-list {
    padding-left: 0;
    padding-right: 22px;
}

.leader-shelf {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 230px;
    padding: 24px 0 14px;
}

.podium-card {
    align-content: start;
    align-self: end;
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 18px;
    display: grid;
    justify-items: center;
    min-height: 158px;
    padding: 0 8px 12px;
    text-align: center;
}

.podium-winner {
    margin: 0 -8px 20px;
    min-height: 190px;
    position: relative;
    z-index: 2;
}

.podium-side {
    margin-top: 30px;
}

.podium-card.current-user,
.leader-row.current-user {
    background:
        radial-gradient(circle at 95% 12%, color-mix(in srgb, var(--yellow) 58%, transparent), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--sky) 38%, var(--surface)), color-mix(in srgb, var(--pink) 28%, var(--surface)));
    border-color: var(--yellow);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--yellow) 44%, transparent),
        0 12px 0 rgba(37, 35, 58, .16),
        0 0 28px color-mix(in srgb, var(--sky) 36%, transparent);
    position: relative;
    z-index: 1;
}

.podium-card.current-user::before {
    border: 2px dashed color-mix(in srgb, var(--yellow) 72%, var(--line));
    border-radius: 14px;
    content: "";
    inset: 8px;
    pointer-events: none;
    position: absolute;
}

.leader-row.current-user {
    transform: translateX(2px);
}

[dir="rtl"] .leader-row.current-user {
    transform: translateX(-2px);
}

.podium-card.current-user::after {
    background: var(--yellow);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .14);
    color: var(--status-text);
    content: "You";
    font-size: 12px;
    font-weight: 900;
    padding: 5px 9px;
    position: absolute;
    right: 10px;
    top: 8px;
}

.leader-row.current-user::after {
    background: var(--yellow);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .14);
    color: var(--status-text);
    content: "You";
    font-size: 12px;
    font-weight: 900;
    left: 76px;
    padding: 5px 9px;
    position: absolute;
    top: -13px;
}

[dir="rtl"] .podium-card.current-user::after {
    content: "شما";
    left: 10px;
    right: auto;
}

[dir="rtl"] .leader-row.current-user::after {
    content: "شما";
    left: auto;
    right: 76px;
}

.leader-row.current-user .leader-score {
    background: var(--yellow);
    color: var(--status-text);
}

.podium-card.current-user .podium-avatar,
.leader-row.current-user .avatar {
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 42%, transparent);
}

.podium-ribbon {
    align-items: center;
    background: url("../images/games/leaderboard/RibbonViolet.webp") center / contain no-repeat;
    color: #fff;
    display: flex;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    margin-top: -15px;
    width: 68px;
}

.podium-ribbon-gold {
    background-image: url("../images/games/leaderboard/RibbonGold.webp");
}

.podium-ribbon-silver {
    background-image: url("../images/games/leaderboard/RibbonSilver.webp");
}

.podium-ribbon-bronze {
    background-image: url("../images/games/leaderboard/RibbonBronze.webp");
}

.podium-avatar {
    border: 3px solid var(--surface);
    border-radius: 20px;
    height: 72px;
    margin: 6px 0;
    object-fit: cover;
    width: 72px;
}

.leader-profile-link {
    border-radius: 20px;
    display: inline-flex;
    text-decoration: none;
}

.leader-profile-link .podium-avatar {
    margin: 6px 0;
}

.leader-profile-link:hover img {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--palette-primary) 38%, transparent);
    transform: translateY(-1px);
}

.podium-medal {
    display: block;
    height: 74px;
    margin-bottom: 10px;
    object-fit: contain;
    width: 74px;
}

.podium-winner .podium-medal {
    height: 84px;
    width: 84px;
}

.podium-card strong {
    color: var(--boo-primary);
    font-size: 13px;
    line-height: 1.25;
}

.podium-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.podium-score {
    align-items: center;
    display: inline-flex;
    gap: 4px;
}

.podium-score img {
    height: 24px;
    object-fit: contain;
    width: 24px;
}

.leader-dots {
    display: grid;
    gap: 6px;
    justify-content: center;
    margin: 8px 0 12px;
}

.leader-dots span {
    background: var(--boo-primary);
    border-radius: 50%;
    height: 5px;
    width: 5px;
}

.leader-list {
    display: grid;
    gap: 8px;
}

.rank-ribbon {
    align-items: center;
    background: url("../images/games/leaderboard/RibbonViolet.webp") center / contain no-repeat;
    color: #fff;
    display: flex;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    width: 58px;
}

.leader-row:nth-child(3n + 1) .rank-ribbon {
    background-image: url("../images/games/leaderboard/RibbonRed.webp");
}

.leader-row:nth-child(3n + 2) .rank-ribbon {
    background-image: url("../images/games/leaderboard/RibbonBlue.webp");
}

.leader-row:nth-child(3n + 3) .rank-ribbon {
    background-image: url("../images/games/leaderboard/RibbonGreen.webp");
}

.leader-score {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: flex;
    font-weight: 900;
    gap: 6px;
    padding: 6px 8px;
}

.leader-score img {
    height: 26px;
    width: 26px;
}

.leader-person {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px 1fr;
    min-width: 0;
}

.leader-person .avatar {
    height: 48px;
    width: 48px;
}

.leader-person .leader-profile-link {
    border-radius: 8px;
}

.leader-person span {
    display: block;
}

.leader-empty {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 72px 1fr;
}

.leader-empty img {
    width: 100%;
}

.leader-profile-hero,
.leader-profile-unavailable {
    align-items: center;
    background: var(--profile-gradient);
    display: grid;
    gap: 14px;
    grid-template-columns: 128px minmax(0, 1fr);
}

.leader-profile-avatar img,
.leader-profile-unavailable > img {
    aspect-ratio: 1;
    border: 3px solid var(--line);
    border-radius: 20px;
    object-fit: cover;
    width: 100%;
}

.leader-profile-avatar {
    width: 100%;
}

.leader-profile-copy {
    align-content: center;
    display: grid;
    justify-items: start;
    min-width: 0;
}

.leader-profile-copy > * {
    min-width: 0;
}

.leader-profile-copy .public-profile-location,
.leader-profile-copy > .muted {
    margin: 2px 0;
}

.leader-profile-about-card {
    margin: 10px 0;
    padding: 12px 14px;
}

.leader-profile-about-card h2 {
    color: var(--boo-primary);
    font-size: 17px;
    margin: 0 0 5px;
}

.leader-profile-about-card p {
    line-height: 1.55;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.player-card-tabs {
    margin-bottom: 0;
}

.player-card-tab-panel {
    min-width: 0;
}

.leader-profile-hero h1,
.leader-profile-unavailable h1 {
    color: var(--boo-primary);
    margin: 3px 0;
}

.leader-profile-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 10px 0;
}

.leader-profile-stats article {
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    min-height: 76px;
    padding: 10px;
}

.leader-profile-stats article.prestige {
    background: color-mix(in srgb, var(--surface) 76%, var(--palette-secondary));
}

.leader-profile-stats strong {
    color: var(--boo-primary);
    font-size: 22px;
}

html[dir="rtl"] .leader-profile-stats strong,
html[dir="rtl"] .leader-honor-total {
    direction: ltr;
    text-align: right;
    unicode-bidi: isolate;
}

.leader-profile-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.leader-profile-honors {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 10px;
}

.leader-profile-honors article {
    align-items: center;
    background: var(--feature-gradient);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
}

.leader-profile-honors h2 {
    color: var(--boo-primary);
    font-size: 18px;
    margin: 2px 0 0;
}

.leader-profile-honors p {
    color: var(--muted);
    font-size: 12px;
    grid-column: 1 / -1;
    margin: -4px 0 0;
}

.leader-honor-podium {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.leader-honor-podium span {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    padding: 5px 8px;
}

.leader-honor-total {
    color: var(--boo-primary);
    font-size: 30px;
    line-height: 1;
}

.leader-profile-games {
    display: grid;
    gap: 8px;
}

.leader-profile-games h2 {
    margin: 0;
}

.leader-game-record-search {
    border: 2px solid var(--line);
    border-radius: 10px;
    margin: 0;
    overflow: hidden;
}

.leader-game-record-search summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    justify-content: space-between;
    list-style: none;
    min-height: 42px;
    padding: 8px 11px;
}

.leader-game-record-search summary::-webkit-details-marker {
    display: none;
}

.leader-game-record-search summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 8px;
    margin-inline-end: 3px;
    transform: rotate(45deg);
    transition: transform .18s ease;
    width: 8px;
}

.leader-game-record-search[open] summary {
    border-bottom: 2px solid var(--line);
}

.leader-game-record-search[open] summary::after {
    transform: rotate(225deg);
}

.leader-game-record-search .game-stat-search {
    border: 0;
    border-radius: 0;
    margin: 0;
}

.leader-game-record-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.leader-game-record-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.leader-game-record-table th,
.leader-game-record-table td {
    border-bottom: 2px solid var(--boo-light-primary);
    padding: 8px 5px;
    text-align: center;
}

.leader-game-record-table th:first-child,
.leader-game-record-table td:first-child {
    text-align: start;
}

.leader-game-record-table th:nth-child(2) {
    width: 76px;
}

.leader-game-record-table th:nth-child(n + 3) {
    width: 48px;
}

.leader-game-record-table th {
    padding-block: 2px 5px;
}

.leader-game-record-table th button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    gap: 3px;
    min-height: 32px;
    padding: 0;
    width: 100%;
}

.leader-game-record-table th:not(:first-child) button {
    justify-content: center;
}

.leader-game-record-table th:first-child button {
    justify-content: flex-start;
}

.leader-game-record-table th[aria-sort]:not([aria-sort="none"]) button {
    color: var(--boo-primary);
}

.leader-game-record-table [data-player-game-sort-arrow] {
    font-size: 13px;
    line-height: 1;
}

.leader-game-record-table td {
    direction: ltr;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.leader-game-record-table td:first-child {
    direction: inherit;
    font-size: 16px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.leader-game-record-table tr[hidden] {
    display: none;
}

.leader-profile-action {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.leader-profile-action p {
    margin: 0;
}

.stats-tabs {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0 16px;
    padding: 6px;
}

.stats-tab-button {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    min-height: 40px;
    padding: 8px 12px;
}

.leader-primary-switch {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0 10px;
    padding: 5px;
}

.leader-primary-switch a {
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    min-width: 0;
    padding: 10px 12px;
    text-align: center;
}

.leader-primary-switch a.active {
    background: var(--boo-light-primary);
    color: var(--boo-primary);
}

.leader-game-browser {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    margin: 0 0 16px;
    overflow: hidden;
}

.leader-game-browser summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 2px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    list-style: none;
    padding: 11px 14px;
}

.leader-game-browser summary::-webkit-details-marker {
    display: none;
}

.leader-game-browser summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    grid-column: 2;
    grid-row: 1 / span 2;
    height: 8px;
    margin-inline-end: 3px;
    transform: rotate(45deg);
    transition: transform .18s ease;
    width: 8px;
}

.leader-game-browser[open] summary::after {
    transform: rotate(225deg);
}

.leader-game-browser summary span {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.leader-game-browser summary small {
    color: var(--muted);
    font-size: 11px;
}

.leader-game-browser-body {
    border-top: 2px solid var(--line);
    display: grid;
    gap: 8px;
    padding: 12px;
}

.leader-game-browser-body label,
.game-stat-search label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.leader-game-browser-body input,
.game-stat-search input {
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 8px 11px;
    width: 100%;
}

.leader-game-results {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.leader-game-results a {
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    padding: 9px 10px;
}

.leader-game-results a.active {
    background: var(--surface-3);
    color: var(--boo-primary);
}

.leader-game-results a[hidden] {
    display: none;
}

.leader-game-search-hint,
.leader-game-browser-body > p {
    font-size: 12px;
    margin: 0;
}

.stats-tab-button.active {
    background: var(--boo-light-primary);
    color: var(--boo-primary);
}

.stats-tab-panel {
    animation: pop .22s ease;
}

.stats-master-card,
.stats-story-card,
.game-stat-card {
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stats-story-card,
.game-stat-card {
    background: var(--surface);
}

.stats-glow-card {
    box-shadow:
        var(--shadow),
        0 0 0 7px rgba(177, 151, 252, .12),
        0 18px 36px rgba(37, 35, 58, .12);
}

html[data-theme="dark"] .stats-glow-card {
    box-shadow:
        var(--shadow),
        0 0 0 7px rgba(139, 220, 255, .14),
        0 18px 36px rgba(0, 0, 0, .34);
}

.stats-master-card {
    display: grid;
    gap: 16px;
    margin: 0 0 14px;
    padding: 18px;
}

.stats-story-head {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 76px 1fr;
}

.stats-story-head img {
    filter: drop-shadow(0 8px 0 rgba(37, 49, 74, .14));
    width: 100%;
}

.eyebrow {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 3px;
}

.stats-story-head h2 {
    font-size: 25px;
    line-height: 1.1;
    margin: 0 0 5px;
}

.stats-hero-number {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
}

.stats-hero-number strong {
    color: var(--boo-primary);
    font-size: 52px;
    line-height: .9;
}

.stats-hero-number span {
    color: var(--text);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.1;
    padding-bottom: 5px;
}

.mom-badge {
    align-self: center;
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    padding: 6px 9px;
    max-width: 100%;
    white-space: normal;
}

.mom-badge.up {
    background: rgba(162, 242, 172, .35);
    color: #14633a;
}

.mom-badge.down {
    background: var(--danger-bg);
    color: var(--danger-text);
}

html[data-theme="dark"] .mom-badge.up {
    color: #dbffe6;
}

.stats-story-strip,
.stats-chip-row,
.game-stat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-story-strip span,
.stats-chip-row em,
.game-stat-pills span {
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    padding: 6px 9px;
}

.stats-story-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-story-card {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 82px 1fr;
    min-height: 130px;
    padding: 14px;
}

.stats-story-card.pink {
    background: var(--panel-pink);
}

.stats-story-card.sky {
    background: var(--panel-sky);
}

.stats-story-card.sunny {
    background: var(--panel-sunny);
}

.stats-story-card.mint {
    background: var(--surface-3);
    background: color-mix(in srgb, var(--mint) 28%, var(--surface));
}

.stats-story-card img {
    filter: drop-shadow(0 8px 0 rgba(37, 49, 74, .14));
    max-height: 82px;
    object-fit: contain;
    width: 100%;
}

.stats-story-card strong {
    color: var(--boo-primary);
    display: block;
    font-size: 35px;
    line-height: 1;
}

.stats-story-card span {
    display: block;
    font-size: 14px;
    font-weight: 900;
    margin: 4px 0;
}

.stats-story-card p {
    margin: 0;
}

.game-stat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-stat-search {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 6px;
    margin: 0 0 14px;
    padding: 12px;
}

.game-stat-search p {
    font-size: 12px;
    margin: 0;
}

.game-stat-card[hidden] {
    display: none;
}

.game-stat-card {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.game-stat-art {
    background: var(--surface-2);
    padding: 12px;
}

.game-stat-art img {
    aspect-ratio: 16 / 10;
    display: block;
    height: auto;
    object-fit: contain;
    width: 100%;
}

.game-stat-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.game-stat-title {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px 1fr;
}

.game-stat-title img {
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(37, 35, 58, .12);
    height: 48px;
    object-fit: contain;
    padding: 4px;
    width: 48px;
}

.game-stat-title strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
}

.game-stat-title span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-top: 3px;
}

.game-stat-month,
.game-stat-mix {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
}

.game-stat-month strong {
    color: var(--boo-primary);
    font-size: 28px;
    line-height: 1;
}

.game-stat-month .mom-badge {
    grid-column: 1 / -1;
    justify-self: start;
}

.game-stat-month span,
.game-stat-mix span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.game-stat-mix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-stat-mix div {
    align-items: center;
    border: 1px solid;
    border-radius: 10px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    padding: 8px 10px;
}

.game-stat-mix .human {
    background: color-mix(in srgb, var(--palette-primary) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--palette-primary) 52%, var(--boo-light-primary));
}

.game-stat-mix .bot {
    background: color-mix(in srgb, var(--palette-secondary) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--palette-secondary) 52%, var(--boo-light-primary));
}

.game-stat-mix span {
    align-items: center;
    display: flex;
    gap: 6px;
    line-height: 1.15;
    min-width: 0;
}

.game-stat-mix span::before {
    border-radius: 999px;
    content: "";
    flex: 0 0 8px;
    height: 8px;
}

.game-stat-mix .human span::before {
    background: var(--palette-primary);
}

.game-stat-mix .bot span::before {
    background: var(--palette-secondary);
}

.game-stat-mix strong {
    background: var(--surface);
    border: 1px solid var(--boo-light-primary);
    border-radius: 999px;
    color: var(--text);
    font-size: 18px;
    line-height: 1;
    min-width: 30px;
    padding: 5px 8px;
    text-align: center;
}

.mix-meter {
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 999px;
    display: flex;
    height: 16px;
    overflow: hidden;
}

.mix-meter span {
    display: block;
    height: 100%;
}

.mix-meter .human {
    background: var(--palette-primary);
}

.mix-meter .bot {
    background: var(--palette-secondary);
}

.letters-page {
    padding-top: 16px;
}

.pen-pal-tabs {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 999px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0 12px;
    padding: 5px;
}

.pen-pal-tabs button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
}

.pen-pal-tabs button.active {
    background: var(--boo-light-primary);
    color: var(--boo-primary);
}

.pen-pal-tab-panel[hidden] {
    display: none;
}

.matches-showcase {
    align-items: end;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    margin-top: 6px;
    position: relative;
}

.match-ghost {
    display: block;
    margin: 0;
    max-width: 112px;
    position: relative;
    top: 0;
    width: 112px;
    z-index: 2;
}

.new-match-strip {
    background: rgba(123, 106, 176, .33);
    border-radius: 0 18px 18px 0;
    margin-inline-start: -20px;
    min-height: 106px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 12px 12px 42px;
    scrollbar-width: none;
    white-space: nowrap;
}

.new-match-strip::-webkit-scrollbar {
    display: none;
}

[dir="rtl"] .new-match-strip {
    border-radius: 18px 0 0 18px;
}

.empty-strip {
    align-items: center;
    display: flex;
}

.empty-strip h2 {
    color: var(--boo-primary);
    font-size: 18px;
    margin: 0;
}

.all-matches-section {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.pen-pal-search {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    margin-top: 12px;
    overflow: hidden;
}

.pen-pal-search summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 2px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    list-style: none;
    padding: 11px 14px;
}

.pen-pal-search summary::-webkit-details-marker {
    display: none;
}

.pen-pal-search summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    grid-column: 2;
    grid-row: 1;
    height: 8px;
    margin-inline-end: 3px;
    transform: rotate(45deg);
    transition: transform .18s ease;
    width: 8px;
}

.pen-pal-search[open] summary::after {
    transform: rotate(225deg);
}

.pen-pal-search summary strong {
    color: var(--text);
    display: block;
    font-size: 14px;
}

.pen-pal-search summary small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.pen-pal-search-body {
    border-top: 2px solid var(--line);
    display: grid;
    gap: 6px;
    padding: 12px;
}

.pen-pal-search-body label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.pen-pal-search-body input {
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 8px 11px;
    width: 100%;
}

.pen-pal-search-body p {
    font-size: 12px;
    margin: 0;
}

.past-opponents-section {
    margin-top: 18px;
}

.past-opponents-grid {
    display: grid;
    gap: 10px;
}

.past-opponent-card {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    box-shadow: 0 5px 0 rgba(37, 49, 74, .12);
    display: grid;
    gap: 12px;
    grid-template-columns: 108px minmax(0, 1fr);
    padding: 10px;
}

.past-opponent-card h2 {
    color: var(--boo-primary);
    font-size: 17px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.past-opponent-card p {
    margin: 0;
}

.past-opponent-avatar {
    align-items: center;
    background: var(--surface-2);
    border: 3px solid var(--line);
    border-radius: 18px;
    display: flex;
    height: 104px;
    justify-content: center;
    padding: 0;
    width: 104px;
}

.past-opponent-avatar img {
    border-radius: 14px;
    height: 94px;
    object-fit: cover;
    width: 94px;
}

.past-opponent-avatar.requestable {
    background: var(--yellow);
    cursor: pointer;
}

.past-opponent-avatar.requestable:hover {
    transform: translateY(-1px);
}

.past-opponent-history {
    margin-top: 6px;
}

.past-opponent-history summary {
    color: var(--boo-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.past-opponent-history p {
    font-size: 12px;
    margin-top: 4px;
}

.all-matches-section h2,
.letter-stamps-section h2,
.previous-letters-section h2 {
    color: var(--boo-primary);
    font-size: 20px;
    margin-bottom: 8px;
}

.match-list {
    display: grid;
    gap: 10px;
}

.match-row {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(37, 35, 58, .08);
    color: var(--text);
    display: grid;
    gap: 12px;
    grid-template-columns: 64px 1fr auto;
    padding: 10px;
}

.match-row[hidden] {
    display: none;
}

.match-row-open {
    color: inherit;
    display: contents;
    text-decoration: none;
}

.match-row .avatar {
    border-radius: 8px;
    display: block;
    height: 64px;
    width: 64px;
}

.match-row-avatar-wrap {
    display: block;
    height: 64px;
    position: relative;
    width: 64px;
}

.match-row-avatar-wrap .badge {
    inset-inline-end: -7px;
    position: absolute;
    top: -7px;
    z-index: 8;
}

.online-dot {
    background: var(--muted);
    border: 2px solid var(--surface);
    border-radius: 999px;
    bottom: -4px;
    height: 14px;
    inset-inline-end: -4px;
    position: absolute;
    width: 14px;
    z-index: 8;
}

.online-dot.online {
    background: var(--mint);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 26%, transparent);
}

.match-play-button {
    align-items: center;
    background: var(--surface-3);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    height: 44px;
    justify-content: center;
    width: 48px;
}

.match-play-button:disabled {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: .42;
}

.friend-cheer-card {
    display: grid;
    gap: 12px;
    grid-template-columns: 92px minmax(0, 1fr);
    max-width: 470px;
    overflow: hidden;
    position: relative;
}

.friend-cheer-card > :not(.friend-cheer-art):not(:nth-child(3)) {
    grid-column: 1 / -1;
}

.friend-cheer-card h2,
.friend-cheer-card p {
    margin: 0;
}

.friend-cheer-art {
    align-self: center;
    border-radius: 16px;
    height: 88px;
    object-fit: cover;
    width: 88px;
}

.friend-cheer-wallet {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 5px;
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
}

.friend-cheer-wallet > span:first-child,
.friend-cheer-wallet strong {
    font-size: 13px;
    font-weight: 900;
}

.friend-cheer-wallet-track {
    background: color-mix(in srgb, var(--line) 18%, transparent);
    border-radius: 999px;
    grid-column: 1 / -1;
    height: 12px;
    overflow: hidden;
}

.friend-cheer-wallet-track span {
    background: linear-gradient(90deg, var(--coral), var(--yellow));
    border-radius: inherit;
    display: block;
    height: 100%;
    transition: width .25s ease;
}

.friend-cheer-pair-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-cheer-pair-stats span {
    background: var(--surface-3);
    border: 2px solid var(--boo-light-primary);
    border-radius: 12px;
    display: grid;
    font-size: 11px;
    gap: 2px;
    padding: 8px;
    text-align: center;
}

.friend-cheer-pair-stats strong {
    color: var(--boo-primary);
    font-size: 19px;
}

.friend-cheer-cap {
    font-size: 11px;
    text-align: center;
}

.friend-cheer-options {
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}

.friend-cheer-options legend {
    font-size: 13px;
    font-weight: 900;
    grid-column: 1 / -1;
    margin-bottom: 6px;
}

.friend-cheer-options label {
    cursor: pointer;
    position: relative;
}

.friend-cheer-options input {
    inset: 0;
    opacity: 0;
    position: absolute;
}

.friend-cheer-options span {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    display: flex;
    font-weight: 900;
    justify-content: center;
    min-height: 44px;
}

.friend-cheer-options input:checked + span {
    background: var(--yellow);
    color: var(--status-text);
    box-shadow: none;
    transform: translateY(-2px);
}

.friend-cheer-options input:disabled + span {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: .32;
}

.friend-cheer-preview,
.friend-cheer-status {
    font-size: 12px;
    min-height: 18px;
    text-align: center;
}

.friend-cheer-status.error {
    color: var(--danger);
}

.friend-cheer-status.success {
    color: var(--boo-primary);
    font-weight: 900;
}

.friend-cheer-thanks {
    align-items: center;
    animation: friend-cheer-thanks-in .26s ease-out;
    background:
        radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--yellow) 30%, transparent), transparent 46%),
        var(--surface);
    display: flex;
    flex-direction: column;
    gap: 7px;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: absolute;
    text-align: center;
    z-index: 4;
}

.friend-cheer-thanks[hidden] {
    display: none;
}

.friend-cheer-thanks img {
    animation: friend-cheer-thanks-art-in .38s cubic-bezier(.2, .9, .32, 1.25);
    border: 3px solid var(--boo-light-primary);
    border-radius: 24px;
    box-shadow: 0 8px 0 color-mix(in srgb, var(--line) 42%, transparent);
    height: 172px;
    margin-bottom: 8px;
    object-fit: cover;
    width: 172px;
}

.friend-cheer-thanks h2,
.friend-cheer-thanks p {
    margin: 0;
}

.friend-cheer-thanks p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    max-width: 320px;
}

@keyframes friend-cheer-thanks-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes friend-cheer-thanks-art-in {
    from { opacity: 0; transform: scale(.76) rotate(-3deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
    .friend-cheer-thanks,
    .friend-cheer-thanks img {
        animation: none;
    }
}

.match-row .match-name {
    color: var(--text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
}

.outgoing-friend-requests {
    display: grid;
    gap: 8px;
}

.outgoing-friend-requests > h2 {
    font-size: 15px;
    margin: 0;
}

.outgoing-friend-request-list {
    display: grid;
    gap: 10px;
}

.pending-friend-request-row {
    background: color-mix(in srgb, var(--surface) 76%, var(--muted));
    border-color: color-mix(in srgb, var(--line) 58%, var(--muted));
    box-shadow: none;
}

.pending-friend-request-row .match-row-avatar-wrap {
    filter: grayscale(.72);
    opacity: .78;
}

.pending-friend-request-copy {
    min-width: 0;
}

.pending-friend-request-copy > p {
    margin: 0;
}

.pending-friend-request-copy > .muted,
.pending-friend-request-status {
    font-size: 12px;
    margin-top: 3px;
}

.pending-friend-request-status {
    color: var(--danger);
}

.pending-friend-request-status:empty {
    display: none;
}

.pending-friend-request-cancel {
    font-size: 12px;
    min-width: 112px;
    padding: 8px 10px;
}

.friend-request-banner {
    align-items: stretch;
    background: rgba(123, 106, 176, .33);
    border-radius: 18px;
    grid-template-columns: 90px minmax(0, 1fr);
    margin: 4px 0 12px;
    overflow: hidden;
    padding: 8px 0 6px;
    padding-inline-start: 6px;
}

.friend-request-banner .match-ghost {
    align-self: end;
    inset-inline-start: 8px;
    pointer-events: none;
}

.friend-request-banner .friend-request-strip {
    align-self: stretch;
    background: transparent;
    border-radius: 0;
    margin-inline-start: 0;
    min-width: 0;
    overscroll-behavior-inline: contain;
    padding-block: 6px 4px;
    padding-inline: 0 10px;
    scrollbar-color: var(--boo-light-primary) transparent;
    scrollbar-width: thin;
}

.friend-request-banner .friend-request-strip::-webkit-scrollbar {
    display: block;
    height: 8px;
}

.friend-request-banner .friend-request-strip::-webkit-scrollbar-thumb {
    background: var(--boo-light-primary);
    border-radius: 999px;
}

.friend-request-banner .friend-request-strip::-webkit-scrollbar-track {
    background: transparent;
}

.friend-request-banner .friend-request-list {
    display: inline-flex;
    gap: 4px;
}

.friend-request-banner .friend-request-object {
    width: 92px;
}

.friend-request-list {
    display: grid;
    gap: 10px;
}

.friend-request-object {
    align-items: center;
    display: inline-grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
    white-space: normal;
    width: 118px;
}

.friend-request-object .avatar {
    border: 4px solid var(--line);
    border-radius: 8px;
    height: 70px;
    object-fit: cover;
    width: 70px;
}

.friend-request-object h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.15;
    margin: 0;
}

.friend-request-object .friend-request-status {
    font-size: 12px;
    margin: 0;
    min-height: 14px;
}

.friend-request-object .friend-request-status:empty {
    display: none;
}

.friend-request-object .friend-request-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, 32px);
    justify-content: center;
    width: 70px;
}

.friend-request-object .btn {
    font-size: 12px;
    min-height: 30px;
    padding: 5px 8px;
}

.friend-request-object .friend-request-action {
    border-radius: 999px;
    font-size: 20px;
    height: 32px;
    line-height: 1;
    min-height: 32px;
    padding: 0;
    width: 32px;
}

.friend-request-object .friend-request-decline {
    color: var(--coral);
}

.repeat-friend-request-card {
    max-width: 430px;
}

.repeat-friend-request-card h2 {
    margin: 0;
    padding-inline-end: 42px;
}

.notification-stack {
    display: grid;
    gap: 10px;
    inset-inline: 14px;
    pointer-events: none;
    position: fixed;
    top: 14px;
    z-index: 5000;
}

.app-notification {
    align-items: center;
    background: var(--toast-bg);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--toast-text);
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) 34px;
    justify-self: center;
    max-width: min(420px, calc(100vw - 28px));
    opacity: 0;
    padding: 6px;
    pointer-events: auto;
    text-align: start;
    transform: translateY(-12px);
    transition: opacity .2s ease, transform .2s ease;
    width: 100%;
}

.app-notification-open {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 10px;
    grid-template-columns: 48px minmax(0, 1fr);
    min-width: 0;
    padding: 4px 6px;
    text-align: start;
    width: 100%;
}

.app-notification-dismiss {
    align-self: start;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    font: 700 24px/30px system-ui, sans-serif;
    height: 32px;
    padding: 0;
    width: 32px;
}

.app-notification-dismiss:hover,
.app-notification-dismiss:focus-visible {
    background: color-mix(in srgb, currentColor 12%, transparent);
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.app-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.letter-notification-flight {
    animation: letterNotificationFlight 1.55s cubic-bezier(.22, .72, .25, 1) both;
    filter: drop-shadow(0 6px 4px rgba(17, 24, 47, .28));
    height: auto;
    left: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform-origin: center;
    width: 64px;
    z-index: 5001;
}

.letter-notification-flight.is-reduced-motion {
    animation: letterNotificationFlightReduced .55s ease both;
}

@keyframes letterNotificationFlight {
    0% {
        opacity: 0;
        transform: translate3d(var(--letter-flight-start-x), var(--letter-flight-start-y), 0)
            rotate(var(--letter-flight-start-rotation)) scale(.72);
    }
    14% { opacity: 1; }
    58% {
        opacity: 1;
        transform: translate3d(var(--letter-flight-mid-x), var(--letter-flight-mid-y), 0)
            rotate(var(--letter-flight-mid-rotation)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--letter-flight-end-x), var(--letter-flight-end-y), 0)
            rotate(var(--letter-flight-end-rotation)) scale(.55);
    }
}

@keyframes letterNotificationFlightReduced {
    0% {
        opacity: 0;
        transform: translate3d(var(--letter-flight-end-x), var(--letter-flight-end-y), 0)
            rotate(var(--letter-flight-end-rotation)) scale(.9);
    }
    45% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translate3d(var(--letter-flight-end-x), var(--letter-flight-end-y), 0)
            rotate(var(--letter-flight-end-rotation)) scale(.55);
    }
}

.app-notification img {
    border: 2px solid var(--toast-text);
    border-radius: 8px;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.app-notification-avatar {
    width: 48px;
}

.app-notification-text {
    display: grid;
    gap: 3px;
}

.app-notification-text strong {
    font-size: 15px;
}

.app-notification-text span {
    font-size: 13px;
    line-height: 1.3;
}

.play-request-card {
    max-width: 420px;
}

.rules-card .play-request-art {
    filter: drop-shadow(0 7px 0 rgba(37, 49, 74, .14));
    height: 92px;
    justify-self: center;
    width: 92px;
}

#playRequestGame option:disabled {
    background: var(--surface-2);
    color: var(--boo-gray);
}

.friend-request-card {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    padding: 10px;
}

.friend-request-card h2 {
    color: var(--boo-primary);
    font-size: 18px;
    line-height: 1.15;
    margin: 0 0 4px;
}

.friend-request-card p {
    margin: 0;
}

.friend-request-card .avatar {
    border-radius: 8px;
    height: 64px;
    object-fit: cover;
    width: 64px;
}

.friend-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.letter-page {
    padding-top: 0;
}

.friend-confirm-card {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 128px minmax(0, 1fr);
    margin-top: 14px;
}

.friend-confirm-avatar {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .14);
    height: 128px;
    object-fit: cover;
    width: 128px;
}

.friend-confirm-avatar-frame {
    width: 128px;
}

.friend-confirm-card h1 {
    font-size: 26px;
    line-height: 1.1;
    margin: 0 0 8px;
}

.letter-thread-panel {
    padding-bottom: 12px;
}

.letter-match-card {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    grid-template-columns: 112px minmax(0, 1fr);
    margin: 0 0 18px;
    padding: 14px;
}

.letter-match-avatar {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .14);
    height: 112px;
    object-fit: cover;
    width: 112px;
}

.letter-match-avatar-frame {
    width: 112px;
}

.letter-match-card h1 {
    font-size: 24px;
    line-height: 1.1;
    margin: 0 0 6px;
}

.letter-match-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 3px;
}

.letter-presence {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
    line-height: 1;
    padding: 5px 8px;
}

.letter-presence-dot {
    background: var(--muted);
    border-radius: 999px;
    height: 8px;
    width: 8px;
}

.letter-presence.online {
    color: var(--text);
}

.letter-presence.online .letter-presence-dot {
    background: var(--mint);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 25%, transparent);
}

.letter-match-card p {
    margin: 0;
}

.letter-match-card .letter-match-location {
    margin: -1px 0 5px;
}

.letter-player-card-link {
    margin-top: 8px;
    width: fit-content;
}

.letter-stamps-section,
.previous-letters-section,
.letter-safety {
    margin: 18px 0;
}

.letter-stamp-strip {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) clamp(84px, 22%, 112px);
    margin: 0;
    max-width: 100%;
    width: 100%;
}

#stamps {
    display: grid;
    gap: 12px;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.letter-stamp-slot,
.letter-cheer-tile {
    aspect-ratio: 297 / 334;
    min-width: 0;
}

.letter-stamp-slot img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.letter-cheer-tile {
    background: color-mix(in srgb, var(--surface) 82%, var(--yellow));
    border: 3px solid var(--line);
    border-radius: 14px;
    box-sizing: border-box;
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 4px;
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-column: 2;
    overflow: hidden;
    padding: 6px;
    text-align: center;
    transition: box-shadow .16s ease, transform .16s ease;
}

.letter-cheer-tile:hover {
    box-shadow: none;
    transform: translateY(-1px);
}

.letter-cheer-tile img {
    border-radius: 9px;
    display: block;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    width: 100%;
}

.letter-cheer-tile strong {
    font-size: 11px;
    line-height: 1.12;
}

.letter-cheer-tile small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
}

.letter-cheer-tile:disabled {
    box-shadow: none;
    cursor: not-allowed;
    filter: grayscale(.75);
    opacity: .48;
    transform: none;
}

.letter-gift-panel {
    margin: 18px 0;
}

.letter-gift-state,
.letter-incoming-gifts,
.letter-gift-picker {
    background: color-mix(in srgb, var(--surface) 90%, var(--mint));
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 10px;
    padding: 12px;
}

.letter-gift-state {
    border-color: color-mix(in srgb, var(--mint) 65%, var(--line));
    font-weight: 800;
}

.letter-incoming-gifts h3 {
    margin: 2px 0 10px;
}

.letter-gift-row,
.letter-gift-option {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 94%, var(--sky));
    border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    border-radius: 12px;
    display: grid;
    gap: 9px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    margin-top: 8px;
    padding: 8px;
}

.letter-gift-row img,
.letter-gift-option img {
    height: 50px;
    object-fit: contain;
    width: 50px;
}

.letter-gift-row div,
.letter-gift-option div {
    display: grid;
    gap: 2px;
}

.letter-gift-row small,
.letter-gift-option small,
.letter-gift-picker summary small {
    color: var(--muted);
}

.letter-gift-picker summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
}

.letter-gift-picker summary::-webkit-details-marker,
.letter-gift-group summary::-webkit-details-marker {
    display: none;
}

.letter-gift-picker > summary > span:first-child {
    display: grid;
    gap: 2px;
}

.letter-gift-disclosure-icon {
    align-items: center;
    background: color-mix(in srgb, var(--sky) 25%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.25rem;
    height: 30px;
    justify-content: center;
    line-height: 1;
    transition: transform .18s ease;
    width: 30px;
}

details[open] > summary > .letter-gift-disclosure-icon {
    transform: rotate(180deg);
}

.letter-gift-picker > .muted {
    margin: 10px 0;
}

.letter-gift-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.letter-gift-option {
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    padding: 10px;
    position: relative;
}

.letter-gift-option img {
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    width: 100%;
}

.letter-gift-option .btn {
    width: 100%;
}

.letter-gift-option-count {
    align-items: center;
    background: color-mix(in srgb, var(--ink) 88%, transparent);
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: var(--surface);
    display: inline-flex;
    font-size: .75rem;
    font-weight: 900;
    justify-content: center;
    min-height: 1.75rem;
    min-width: 1.75rem;
    padding: .15rem .42rem;
    position: absolute;
    right: .45rem;
    top: .45rem;
}

[dir="rtl"] .letter-gift-option-count {
    left: .45rem;
    right: auto;
}

.letter-gift-groups {
    display: grid;
    gap: 9px;
}

.letter-gift-group {
    background: color-mix(in srgb, var(--surface) 95%, var(--sky));
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.letter-gift-group > summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    list-style: none;
    min-height: 72px;
    padding: 8px 10px;
}

.letter-gift-group > summary > span:nth-child(2) {
    display: grid;
    gap: 2px;
}

.letter-gift-group small {
    color: var(--muted);
}

.letter-gift-group-preview {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 56px;
    width: 68px;
}

.letter-gift-group-preview img {
    height: 27px;
    object-fit: contain;
    width: 32px;
}

.letter-gift-page {
    border-top: 1px solid var(--line);
    min-height: 54px;
    padding: 10px;
}

.letter-gift-page.is-loading {
    color: var(--muted);
    font-weight: 800;
}

.letter-gift-pagination {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.letter-gift-pagination > span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}

.store-cosmetic-group:not(.store-group-disclosure) {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.store-cosmetic-group > h3 {
    color: var(--muted);
    font-size: .92rem;
    letter-spacing: .02em;
    margin: 0 2px;
}

.store-buy-button {
    background: color-mix(in srgb, var(--mint) 72%, var(--surface));
}

.letter-gift-option.moonlit,
.letter-gift-row.moonlit {
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 84%, #829dff), color-mix(in srgb, var(--surface) 90%, #f5ca74));
}

.letter-thread-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 16px;
}

.letter-thread-toolbar #newLetterButton {
    min-width: 0;
}

.letter-thread-toolbar #newLetterButton .btn {
    padding-inline: clamp(10px, 3vw, 24px);
}

.letter-album-section {
    margin: 18px 0 24px;
}

.letter-album-styles {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.letter-album-styles[hidden] {
    display: none;
}

.letter-album-style {
    background-color: var(--album-swatch);
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, .16), transparent 22%),
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, .07) 5px);
    border: 2px solid var(--line);
    border-radius: 7px 11px 11px 7px;
    box-shadow: none;
    cursor: pointer;
    height: 42px;
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease;
    width: 34px;
}

.letter-album-style::before {
    background: rgba(26, 23, 41, .22);
    border-radius: 5px 0 0 5px;
    content: "";
    inset: 2px auto 2px 3px;
    position: absolute;
    width: 5px;
}

.letter-album-style:hover,
.letter-album-style.selected {
    box-shadow: none;
    transform: translateY(-3px);
}

.letter-album-style.selected {
    outline: 3px solid color-mix(in srgb, var(--palette-secondary) 72%, transparent);
    outline-offset: 2px;
}

.letter-album-style.style-berry { --album-swatch: #78364f; }
.letter-album-style.style-midnight { --album-swatch: #293f67; }
.letter-album-style.style-meadow { --album-swatch: #426b58; }

.letter-album {
    --album-cover: #78364f;
    --album-cover-dark: #4d2133;
    --album-metal: #f0c976;
}

.letter-album[data-album-style="midnight"] {
    --album-cover: #293f67;
    --album-cover-dark: #172640;
    --album-metal: #b9d9eb;
}

.letter-album[data-album-style="meadow"] {
    --album-cover: #426b58;
    --album-cover-dark: #29463a;
    --album-metal: #f0d69a;
}

.letter-album-stage {
    min-height: clamp(390px, 74vw, 560px);
    overflow: clip;
    overflow-clip-margin: 60px;
    perspective: 1800px;
    position: relative;
}

.letter-album-cover,
.letter-album-book {
    inset: 0;
    margin: auto;
    position: absolute;
}

.letter-album-cover {
    align-content: center;
    background-color: var(--album-cover);
    background-image:
        radial-gradient(circle at 76% 14%, rgba(255, 255, 255, .17), transparent 24%),
        repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, .025) 8px),
        linear-gradient(145deg, transparent 66%, rgba(0, 0, 0, .16));
    border: 4px solid var(--album-cover-dark);
    border-radius: 19px 25px 25px 19px;
    box-shadow:
        inset 15px 0 18px rgba(20, 17, 29, .14),
        inset 0 0 0 2px rgba(255, 255, 255, .12),
        0 7px 0 #e6d9b7,
        0 12px 0 var(--album-cover-dark),
        0 22px 0 rgba(37, 49, 74, .12),
        0 29px 38px rgba(37, 49, 74, .3);
    color: #fffaf0;
    cursor: pointer;
    display: grid;
    gap: 13px;
    height: min(68vw, 520px);
    justify-items: center;
    max-height: 520px;
    max-width: 430px;
    min-height: 360px;
    padding: 30px 34px 26px 61px;
    transform: rotateY(0deg);
    transform-origin: 4% 50%;
    transform-style: preserve-3d;
    transition: opacity 1.35s ease, transform 1.75s cubic-bezier(.22, .72, .2, 1);
    width: min(82vw, 430px);
    z-index: 4;
}

.letter-album-cover::before {
    background:
        linear-gradient(90deg, rgba(103, 78, 47, .34), transparent 45%),
        repeating-linear-gradient(0deg, #d9cda9 0 2px, #f7edd1 2px 4px);
    border-radius: 0 8px 8px 0;
    box-shadow: inset 3px 0 4px rgba(64, 43, 28, .4), 2px 0 2px rgba(25, 17, 24, .18);
    content: "";
    inset: 11px -7px 11px auto;
    position: absolute;
    width: 7px;
}

.letter-album-cover::after {
    border: 2px solid var(--album-metal);
    border-radius: 4px 18px 18px 4px;
    content: "";
    inset: 14px 13px 13px 48px;
    opacity: .72;
    pointer-events: none;
    position: absolute;
}

.letter-album-cover-binding {
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--album-cover-dark) 82%, #0d0911) 0%,
            color-mix(in srgb, var(--album-cover) 78%, #fff) 28%,
            var(--album-cover-dark) 64%,
            rgba(15, 10, 18, .78) 86%,
            rgba(255, 255, 255, .1) 100%);
    border: 2px solid color-mix(in srgb, var(--album-cover-dark) 82%, #100b13);
    border-radius: 29px 10px 10px 29px;
    box-shadow:
        inset 7px 0 7px rgba(255, 255, 255, .08),
        inset -8px 0 9px rgba(8, 6, 12, .42),
        7px 1px 8px rgba(18, 12, 22, .34),
        0 8px 5px rgba(18, 12, 22, .22);
    inset: -6px auto -8px -13px;
    position: absolute;
    transform: translateZ(8px) rotateY(-5deg);
    transform-origin: right center;
    width: 61px;
    z-index: 4;
}

.letter-album-cover-binding::before {
    border-inline-end: 1px dashed color-mix(in srgb, var(--album-metal) 48%, transparent);
    content: "";
    inset: 17px auto 17px 14px;
    position: absolute;
}

.letter-album-cover-binding::after {
    background: linear-gradient(90deg, rgba(6, 4, 9, .58), rgba(255, 255, 255, .1), rgba(6, 4, 9, .32));
    border-radius: 999px;
    box-shadow: 2px 0 2px rgba(255, 255, 255, .08);
    content: "";
    inset: 11px 5px 11px auto;
    position: absolute;
    width: 7px;
}

.letter-album-cover-binding > span {
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 35%, rgba(8, 5, 11, .38));
    border-radius: 12px 5px 5px 12px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .12), 0 3px 3px rgba(9, 6, 12, .3);
    height: 17px;
    left: 3px;
    position: absolute;
    right: 7px;
}

.letter-album-cover-binding > span:nth-child(1) { top: 12%; }
.letter-album-cover-binding > span:nth-child(2) { top: 36%; }
.letter-album-cover-binding > span:nth-child(3) { top: 61%; }
.letter-album-cover-binding > span:nth-child(4) { top: 85%; }

.letter-album-cover-frame {
    background: #efe3c6;
    border: 7px solid #fff8e7;
    box-shadow: 0 5px 0 rgba(16, 14, 25, .24), 0 10px 22px rgba(16, 14, 25, .22);
    display: block;
    margin-bottom: 22px;
    max-width: 330px;
    padding: 4px;
    position: relative;
    transform: rotate(-1.2deg);
    width: 92%;
    z-index: 2;
}

.letter-album-memory-photo {
    aspect-ratio: 3 / 2;
    display: block;
    object-fit: cover;
    width: 100%;
}

.letter-album-cover-cameos {
    align-items: center;
    bottom: -22px;
    display: flex;
    filter: drop-shadow(0 4px 3px rgba(25, 17, 24, .3));
    justify-content: center;
    left: 50%;
    position: absolute;
    transform: translateX(-50%) rotate(1.2deg);
    z-index: 2;
}

.letter-album-cover-cameo {
    background: #fff8e7;
    border: 2px solid #fffdf5;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #b89b68;
    display: block;
    height: 56px;
    overflow: hidden;
    position: relative;
    width: 56px;
}

.letter-album-cover-cameo.current-user { transform: rotate(-6deg); }
.letter-album-cover-cameo.match-user { transform: rotate(6deg); }

.letter-album-cover-cameo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.letter-album-cover-unread {
    align-items: center;
    background: var(--album-metal);
    border: 2px solid #fff8e7;
    border-radius: 50%;
    color: var(--album-cover-dark);
    display: flex;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    height: 27px;
    justify-content: center;
    margin: 0 -5px;
    min-width: 27px;
    padding: 0 5px;
    position: relative;
    z-index: 3;
}

.letter-album-cover-title {
    color: #fffaf0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.1;
    text-shadow: 0 2px 0 rgba(20, 17, 29, .34);
}

.letter-album-cover-prompt {
    background: var(--album-metal);
    border: 2px solid var(--album-cover-dark);
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(20, 17, 29, .24);
    color: #25213b;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 15px;
}

.letter-album-book {
    background: var(--album-cover-dark);
    border: 3px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 0 rgba(37, 49, 74, .13), 0 24px 38px rgba(37, 49, 74, .22);
    height: fit-content;
    opacity: 0;
    pointer-events: none;
    transform: rotateX(5deg) scale(.92);
    transform-origin: 50% 75%;
    transition: opacity .8s ease .25s, transform 1.15s cubic-bezier(.2, .75, .2, 1) .2s;
    width: 100%;
    z-index: 2;
}

.letter-album.is-opening .letter-album-cover,
.letter-album.is-open .letter-album-cover {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-18%) rotateY(-156deg) scale(.94);
}

.letter-album.is-opening .letter-album-book,
.letter-album.is-open .letter-album-book {
    opacity: 1;
    transform: rotateX(0) scale(1);
}

.letter-album.is-open .letter-album-book {
    pointer-events: auto;
}

.letter-album-toolbar {
    align-items: center;
    color: #fffaf0;
    direction: ltr;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
    min-height: 56px;
    padding: 8px 10px;
}

.letter-album-nav,
.letter-album-page-status button {
    align-items: center;
    background: color-mix(in srgb, var(--album-cover) 76%, #fff);
    border: 2px solid color-mix(in srgb, var(--album-metal) 70%, #fff);
    border-radius: 999px;
    color: #fffaf0;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    gap: 5px;
    justify-content: center;
    min-height: 38px;
    padding: 7px 11px;
}

.letter-album-nav.newer { justify-self: start; }
.letter-album-nav.older { justify-self: end; }

.letter-album-nav {
    font-size: 14px;
    padding: 7px;
    width: 44px;
}

.letter-album-nav:disabled {
    cursor: default;
    opacity: .34;
}

.letter-album-nav-page {
    text-align: center;
}

.letter-album-page-status {
    align-items: center;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 900;
    gap: 4px;
    white-space: nowrap;
}

.letter-album-page-status button {
    background: transparent;
    border: 0;
    color: color-mix(in srgb, var(--album-metal) 84%, #fff);
    min-height: 0;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.letter-album-page {
    background:
        linear-gradient(90deg,
            transparent 0 43%,
            rgba(111, 84, 54, .08) 46%,
            rgba(73, 51, 32, .3) 49.2%,
            rgba(255, 255, 255, .58) 50%,
            rgba(73, 51, 32, .3) 50.8%,
            rgba(111, 84, 54, .08) 54%,
            transparent 57%),
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .7), transparent 24%),
        #eadcb8;
    border: 2px solid #b9a57c;
    border-radius: 8px 8px 12px 12px;
    box-shadow: inset 0 0 25px rgba(83, 65, 45, .13);
    min-height: 0;
    position: relative;
    transform-style: preserve-3d;
}

.letter-album-page::after {
    background: linear-gradient(90deg, transparent 18%, rgba(255, 255, 255, .34), transparent 76%);
    content: "";
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    z-index: 20;
}

.letter-album-spine {
    background:
        linear-gradient(90deg,
            transparent,
            rgba(57, 38, 25, .22) 18%,
            rgba(57, 38, 25, .48) 42%,
            rgba(255, 255, 255, .26) 50%,
            rgba(57, 38, 25, .48) 58%,
            rgba(57, 38, 25, .22) 82%,
            transparent);
    bottom: 5px;
    box-shadow: inset 10px 0 8px rgba(62, 43, 29, .2), inset -10px 0 8px rgba(62, 43, 29, .2);
    left: calc(50% - 22px);
    pointer-events: none;
    position: absolute;
    top: 5px;
    width: 44px;
    z-index: 5;
}

.letter-album-spine::before,
.letter-album-spine::after {
    border-inline-start: 2px solid rgba(74, 50, 31, .34);
    content: "";
    inset: 8px auto 8px 10px;
    position: absolute;
}

.letter-album-spine::after {
    inset-inline: auto 10px;
}

.letter-album-spine > span {
    background: transparent;
    border: 3px solid var(--album-metal);
    border-color: #f8e8aa #9b7641 #76542f #ead394;
    border-radius: 999px;
    box-shadow: 0 4px 3px rgba(62, 43, 29, .36), inset 0 2px 2px rgba(62, 43, 29, .28);
    height: 17px;
    left: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 54px;
}

.letter-album-spine > span::before,
.letter-album-spine > span::after {
    background: #745437;
    border: 1px solid #c7a76f;
    border-radius: 50%;
    box-shadow: inset 0 2px 2px rgba(45, 29, 18, .58);
    content: "";
    height: 7px;
    left: -6px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
}

.letter-album-spine > span::after {
    left: auto;
    right: -6px;
}

.letter-album-spine > span:nth-child(1) { top: 10%; }
.letter-album-spine > span:nth-child(2) { top: 30%; }
.letter-album-spine > span:nth-child(3) { top: 50%; }
.letter-album-spine > span:nth-child(4) { top: 70%; }
.letter-album-spine > span:nth-child(5) { top: 90%; }

#previousLetters {
    display: grid;
    gap: 18px 44px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 20px 22px 24px;
}

.letter-album-socket {
    aspect-ratio: 732 / 484;
    background: rgba(92, 68, 48, .18);
    border: 2px solid rgba(97, 72, 49, .36);
    border-radius: 7px;
    box-shadow:
        inset 0 5px 8px rgba(65, 46, 31, .25),
        0 1px 0 rgba(255, 255, 255, .48);
    min-width: 0;
    overflow: hidden;
    padding: 7px;
    position: relative;
    z-index: 1;
}

.letter-album-pocket {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    position: relative;
    transform: translateY(0) scale(1);
    transition: filter .22s ease, transform .5s cubic-bezier(.2, .82, .2, 1);
    width: 100%;
}

.letter-album-socket.is-lifting {
    overflow: visible;
    z-index: 12;
}

.letter-album-socket.is-lifting .letter-album-pocket {
    filter: drop-shadow(0 15px 9px rgba(48, 34, 25, .32));
    transform: translateY(-18px) scale(1.045);
}

.letter-album-socket.is-empty {
    border-style: dashed;
    opacity: .42;
}

.letter-album-empty-mark {
    color: rgba(94, 70, 48, .55);
    font-size: clamp(18px, 4vw, 30px);
}

.letter-preview-content {
    inset: 8% 7% 9%;
    overflow: hidden;
    position: absolute;
}

.letter-preview-card {
    position: relative;
}

.letter-preview-content .row {
    margin: 0;
    padding: 0 !important;
}

.letter-preview-content > p {
    padding: 8px 7px 0;
}

.letter-preview-content .text-primary {
    color: #2d4166 !important;
}

.letter-preview-content .text-gray {
    color: #303747 !important;
}

.letter-album-page.turning-older {
    animation: letterAlbumTurnOlder .36s ease-in both;
    pointer-events: none;
    transform-origin: 4% 50%;
}

.letter-album-page.turning-newer {
    animation: letterAlbumTurnNewer .36s ease-in both;
    pointer-events: none;
    transform-origin: 96% 50%;
}

.letter-album-page.arriving-older {
    animation: letterAlbumArriveOlder .44s ease-out both;
    transform-origin: 96% 50%;
}

.letter-album-page.arriving-newer {
    animation: letterAlbumArriveNewer .44s ease-out both;
    transform-origin: 4% 50%;
}

.letter-album-page.turning-older::after,
.letter-album-page.turning-newer::after,
.letter-album-page.arriving-older::after,
.letter-album-page.arriving-newer::after {
    animation: letterAlbumSheen .4s ease;
}

@keyframes letterAlbumTurnOlder {
    from { opacity: 1; transform: rotateY(0) translateX(0); }
    to { opacity: 0; transform: rotateY(-62deg) translateX(-7%); }
}

@keyframes letterAlbumTurnNewer {
    from { opacity: 1; transform: rotateY(0) translateX(0); }
    to { opacity: 0; transform: rotateY(62deg) translateX(7%); }
}

@keyframes letterAlbumArriveOlder {
    from { opacity: 0; transform: rotateY(55deg) translateX(7%); }
    to { opacity: 1; transform: rotateY(0) translateX(0); }
}

@keyframes letterAlbumArriveNewer {
    from { opacity: 0; transform: rotateY(-55deg) translateX(-7%); }
    to { opacity: 1; transform: rotateY(0) translateX(0); }
}

@keyframes letterAlbumSheen {
    0%, 100% { opacity: 0; }
    48% { opacity: .82; }
}

.letter-compose-section {
    align-items: center;
    background: url("../images/letters/letter-friends-sunny.webp") center / cover no-repeat;
    border-radius: 18px;
    display: grid;
    justify-items: center;
    margin: 18px -8px;
    min-height: 520px;
    padding: 28px 16px;
    position: relative;
}

.paper {
    --letter-paper: #fff6df;
    --letter-rule: rgba(83, 137, 157, .30);
    --letter-margin: rgba(218, 103, 86, .48);
    background:
        radial-gradient(circle at 18% 14%, rgba(132, 93, 53, .055) 0 1px, transparent 1.5px),
        radial-gradient(circle at 76% 38%, rgba(132, 93, 53, .045) 0 1px, transparent 1.5px),
        linear-gradient(112deg, transparent 0 46%, rgba(150, 113, 68, .035) 50%, transparent 54%),
        linear-gradient(165deg, #fffaf0, var(--letter-paper));
    background-size: 17px 19px, 23px 29px, auto, auto;
    border: 1px solid rgba(111, 82, 49, .38);
    border-radius: 5px 3px 7px 4px / 4px 7px 3px 6px;
    box-shadow:
        0 2px 0 rgba(255, 255, 255, .72) inset,
        0 16px 30px rgba(73, 53, 35, .24),
        0 3px 5px rgba(73, 53, 35, .22);
    color: #2d3a50;
    height: min(70vh, 430px);
    max-width: 360px;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: min(78vw, 360px);
}

.paper:before {
    background: var(--letter-margin);
    box-shadow: 1px 0 rgba(255, 255, 255, .48);
    content: "";
    height: 100%;
    left: 44px;
    position: absolute;
    top: 0;
    width: 1px;
    z-index: 3;
}

.paper::after {
    background:
        repeating-linear-gradient(135deg, #dd7865 0 8px, #fff7e6 8px 16px, #67a6a0 16px 24px, #fff7e6 24px 32px) top / 100% 5px no-repeat,
        repeating-linear-gradient(135deg, #dd7865 0 8px, #fff7e6 8px 16px, #67a6a0 16px 24px, #fff7e6 24px 32px) bottom / 100% 5px no-repeat,
        repeating-linear-gradient(45deg, #dd7865 0 8px, #fff7e6 8px 16px, #67a6a0 16px 24px, #fff7e6 24px 32px) left / 5px 100% no-repeat,
        repeating-linear-gradient(45deg, #dd7865 0 8px, #fff7e6 8px 16px, #67a6a0 16px 24px, #fff7e6 24px 32px) right / 5px 100% no-repeat;
    content: "";
    inset: 0;
    opacity: .72;
    pointer-events: none;
    position: absolute;
    z-index: 5;
}

.lines {
    background-image: repeating-linear-gradient(transparent 0 24px, var(--letter-rule) 24px 25px);
    height: calc(100% - 34px);
    inset: 18px 0 16px;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.text {
    background: transparent;
    border: 0;
    bottom: 26px;
    color: #2d3a50;
    font-size: 14px;
    font-weight: 900;
    left: 60px;
    line-height: 25px;
    outline: 0;
    overflow-y: auto;
    padding: 0 10px;
    position: absolute;
    right: 24px;
    resize: none;
    top: 58px;
    z-index: 4;
}

.text::placeholder {
    color: rgba(45, 58, 80, .58);
}

.sending-letter {
    align-items: center;
    color: var(--boo-primary);
    display: grid;
    gap: 10px;
    justify-items: center;
    margin-top: 12px;
}

.sending-letter img {
    width: 160px;
}

.no-letters-card {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin: 18px auto;
    max-width: 280px;
    text-align: center;
}

.no-letters-card img {
    width: 100%;
}

.character-roster-link {
    margin-top: 10px;
}

.game-shelf-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.game-shelf-quick-links .btn {
    font-size: 13px;
    min-height: 38px;
    padding: 6px 10px;
}

.game-shelf-quick-links .character-roster-link {
    margin-top: 0;
}

.game-shelf-quick-links .shared-link-open img {
    filter: none;
    height: 24px;
    margin-inline-end: 5px;
    width: 24px;
}

.shared-link-card {
    gap: 14px;
}

.shared-link-intro {
    grid-template-columns: 64px minmax(0, 1fr);
    padding-inline-end: 28px;
}

.shared-link-intro p,
.shared-link-status {
    margin: 0;
}

.shared-link-field {
    display: grid;
    font-size: 13px;
    font-weight: 900;
    gap: 6px;
}

.shared-link-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shared-link-status {
    min-height: 19px;
}

.invite-room-number {
    background: color-mix(in srgb, var(--surface) 86%, var(--yellow));
    border: 2px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
    text-align: center;
}

.invite-room-number span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.invite-room-number strong {
    color: var(--ink);
    font-size: clamp(34px, 10vw, 54px);
    font-variant-numeric: tabular-nums;
    letter-spacing: .16em;
    line-height: 1;
    padding-inline-start: .16em;
}

@media (max-width: 520px) {
    .mini-hero.invite-room-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .invite-room-panel > img {
        display: none;
    }

    .invite-room-number {
        border-width: 3px;
        gap: 8px;
        padding: 16px 10px 18px;
    }

    .invite-room-number strong {
        font-size: clamp(48px, 15vw, 62px);
    }
}

.character-page {
    padding-bottom: 104px;
}

.hero.character-hero {
    gap: 12px;
    grid-template-columns: minmax(210px, 34%) minmax(0, 1fr);
    padding: 14px;
}

.character-hero img {
    aspect-ratio: 3 / 2;
    border: 2px solid var(--line-soft);
    border-radius: 8px;
    object-fit: cover;
}

.character-hero p {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
}

.character-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    margin-top: 10px;
}

.character-section-heading {
    margin: 18px 2px 8px;
}

.character-section-heading h2 {
    font-size: clamp(22px, 4vw, 28px);
    margin: 2px 0 3px;
}

.character-section-heading p {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.character-card {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 132px minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    padding: 12px 14px;
    position: relative;
}

.character-card::before {
    background: var(--panel-accent);
    content: "";
    inset-block: 0;
    inset-inline-start: 0;
    opacity: .78;
    position: absolute;
    width: 8px;
}

.character-portrait {
    align-items: center;
    align-self: stretch;
    background: radial-gradient(circle at 50% 32%, var(--character-glow, #ffe0a3), var(--surface) 74%);
    border: 2px solid var(--line);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    min-height: 142px;
    padding: 6px;
}

.character-portrait img {
    height: 124px;
    object-fit: contain;
    width: 124px;
}

.character-copy h2 {
    font-size: 23px;
    line-height: 1.05;
    margin: 2px 0 5px;
}

.character-name {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.character-species {
    color: var(--muted);
    font-size: .5em;
    font-weight: 800;
    letter-spacing: .01em;
}

.character-detail {
    margin-top: 7px;
}

.character-detail h3 {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.character-detail p {
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}

.character-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.character-traits span {
    background: var(--panel-accent);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    padding: 3px 7px;
}

.character-copy .character-voice {
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    padding-top: 6px;
}

.character-copy .character-voice p {
    font-size: 13px;
}

.character-card-ember,
.character-card-maple { --character-glow: #ffd0bd; }
.character-card-scout,
.character-card-oriole { --character-glow: #cbd5ff; }
.character-card-marlow { --character-glow: #b9eee7; }
.character-card-rowan { --character-glow: #c8d8e8; }
.character-card-cora { --character-glow: #ffc4a3; }
.character-card-glimmer { --character-glow: #e3d2ff; }
.character-card-drift { --character-glow: #b6efe4; }
.character-card-tuck { --character-glow: #d7e8aa; }
.character-card-pip { --character-glow: #ffe1a8; }
.character-card-tumble { --character-glow: #bceef0; }
.character-card-rook { --character-glow: #d5c7ff; }
.character-card-doodle { --character-glow: #ffe296; }
.character-card-ace { --character-glow: #ffc9bd; }
.character-card-patch { --character-glow: #ffe38a; }
.character-card-lexi { --character-glow: #ffb7a7; }

@media (max-width: 620px) {
    .hero.character-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .character-card {
        align-items: start;
        gap: 10px;
        grid-template-columns: 86px minmax(0, 1fr);
        padding: 10px 12px;
    }

    .character-portrait {
        min-height: 96px;
        padding: 4px;
    }

    .character-portrait img {
        height: 82px;
        width: 82px;
    }

    .character-copy h2 {
        font-size: 20px;
    }

    .character-detail h3 {
        font-size: 10px;
    }
}

.letter-item .letter-content {
    background:
        linear-gradient(90deg, transparent 34px, rgba(255, 107, 107, .24) 35px, transparent 36px),
        repeating-linear-gradient(#fffdf8, #fffdf8 24px, #b7d4ff 25px);
    border: 2px solid #25314a;
    border-radius: 8px;
    color: #25314a;
    padding: 18px 14px 14px 48px;
}

.letter-item.mine .letter-content {
    background-color: #fff8fd;
}

.letter-item.theirs .letter-content {
    background-color: #f8fbff;
}

.letter-safety {
    background: var(--surface);
    border: 2px solid var(--boo-light-primary);
    border-radius: 18px;
    padding: 12px;
}

.letter-safety summary {
    color: var(--boo-primary);
    cursor: pointer;
    font-weight: 900;
}

.letter-safety [hidden] {
    display: none !important;
}

.safety-choice-row {
    margin-bottom: 10px;
}

.safety-choice-row .btn {
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.safety-choice-row .btn.active {
    background: color-mix(in srgb, var(--palette-secondary) 68%, var(--surface));
    border-color: var(--line);
    box-shadow: none;
    color: var(--accent-strong-text);
}

.safety-action-panel {
    background: var(--surface-2);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
}

.safety-action-panel h4 {
    font-size: 18px;
    margin: 0;
}

.safety-detail-fields {
    display: grid;
    gap: 8px;
}

.safety-confirm-panel {
    background: var(--feature-gradient);
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.safety-confirm-panel p {
    margin-bottom: 0;
}

.safety-report-warning {
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    border: 2px solid var(--danger);
    border-radius: 8px;
    color: var(--ink);
    padding: 10px;
}

.safety-report-warning p {
    margin: 4px 0 0;
}

.profile-safety-link {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 46px;
    min-width: 152px;
    text-decoration: none;
    width: auto;
}

.safety-connections-panel {
    display: grid;
    gap: 16px;
}

.safety-connections-grid {
    display: grid;
    gap: 14px;
}

.safety-connection-section {
    border-top: 2px solid color-mix(in srgb, var(--line) 55%, transparent);
    padding-top: 14px;
}

.safety-section-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.safety-section-heading h2,
.safety-section-heading p {
    margin: 0;
}

.safety-section-heading > span {
    align-items: center;
    background: var(--palette-secondary);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--accent-strong-text);
    display: inline-flex;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    min-width: 34px;
}

.safety-person-list {
    display: grid;
    gap: 8px;
}

.safety-person-card {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    border: 2px solid var(--boo-light-primary);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding: 10px;
}

.safety-person-card .user-avatar-frame,
.safety-person-card .user-avatar-frame img {
    height: 58px;
    width: 58px;
}

.safety-person-copy {
    min-width: 0;
}

.safety-person-copy h3,
.safety-person-copy p {
    margin: 0;
}

.safety-person-copy h3 {
    font-size: 17px;
}

.safety-empty-state {
    margin: 4px 0;
}

.safety-reverse-card {
    max-width: 430px;
}

.safety-reverse-card h2 {
    margin: 0;
}

@media (max-width: 620px) {
    .safety-person-card {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .safety-person-card .user-avatar-frame,
    .safety-person-card .user-avatar-frame img {
        height: 52px;
        width: 52px;
    }

    .safety-person-card .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

.GameGlee-booboo {
    --primary: #3a208a;
    --gray: #626263;
    --lighterprimary: rgb(223, 216, 243);
    --border-primary: #3a208a;
    --bg-white: #fff;
    --bg-secondary: #f5b3d8;
    --bs-primary: #3a208a;
    background: var(--bg);
}

html[data-theme="dark"] .GameGlee-booboo {
    --primary: #fff;
    --gray: #fff;
    --lighterprimary: #4d4b54;
    --border-primary: #fff;
    --bg-white: #2c2f39;
    --bg-secondary: #a55481;
    --bs-primary: #fff;
    background: #00092d;
}

.page-wrapper {
    min-height: 100vh;
    overflow-x: hidden;
}

.container-fluid {
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
}

.container {
    margin-left: auto;
    margin-right: auto;
    max-width: 720px;
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -6px;
    margin-right: -6px;
}

.col,
.col-1,
.col-2,
.col-3,
.col-4,
.col-6,
.col-9,
.col-10,
.col-12,
.col-auto {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
}

.col {
    flex: 1 0 0;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-auto { flex: 0 0 auto; width: auto; }

.d-flex { display: flex; }
.inline-flex { display: inline-flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-start { justify-content: flex-start; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.text-justify { text-align: justify; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--bg-secondary) !important; }
.text-gray { color: var(--gray) !important; }
.text-white { color: #fff !important; }
.text-danger { color: #ff4a5c !important; }
.text-light { color: #f8f9fa !important; }
.bg-white { background-color: var(--bg-white) !important; }
.bg-secondary { background-color: var(--lighterprimary) !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 4px !important; padding-right: 4px !important; }
.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-4 { padding-left: 24px !important; padding-right: 24px !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-5 { padding-top: 48px !important; padding-bottom: 48px !important; }
.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 4px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-4 { padding-top: 24px !important; }
.pb-4 { padding-bottom: 24px !important; }
.pb-5 { padding-bottom: 48px !important; }
.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: 4px !important; }
.pe-1 { padding-right: 4px !important; }
.pe-2 { padding-right: 8px !important; }
.m-0 { margin: 0 !important; }
.m-3 { margin: 16px !important; }
.mx-1 { margin-left: 4px !important; margin-right: 4px !important; }
.mx-2 { margin-left: 8px !important; margin-right: 8px !important; }
.my-1 { margin-top: 4px !important; margin-bottom: 4px !important; }
.my-2 { margin-top: 8px !important; margin-bottom: 8px !important; }
.my-3 { margin-top: 16px !important; margin-bottom: 16px !important; }
.my-5 { margin-top: 48px !important; margin-bottom: 48px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 48px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 48px !important; }
.ms-1 { margin-left: 4px !important; }
.ms-3 { margin-left: 16px !important; }
.ms-5 { margin-left: 48px !important; }
.me-5 { margin-right: 48px !important; }
.h-100 { height: 100% !important; }
.img-fluid { height: auto; max-width: 100%; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-small { font-size: 11px; }
.fs-90 { font-size: 90%; }

.fa,
.fa-solid {
    display: inline-block;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.fa-comments:before { content: "✉"; }
.fa-trophy:before { content: "★"; }
.fa-gamepad:before { content: "▦"; }
.fa-user:before { content: "●"; }
.fa-chevron-left:before { content: "‹"; }
.fa-close:before { content: "×"; }

.header-shadows {
    background: var(--bg-white);
    box-shadow: 0 3px 12px rgba(58, 32, 138, .12);
    overflow: hidden;
    padding-bottom: 13px;
    padding-top: 13px;
}

.header-shadows img {
    max-height: 42px;
    object-fit: contain;
    width: auto;
}

.page-content {
    min-height: 100vh;
}

.p-t50 { padding-top: 50px; }
.p-b50 { padding-bottom: 50px; }
.p-b100 { padding-bottom: 100px; }

.sticky-bottom {
    bottom: 0;
    left: 0;
    position: fixed !important;
    width: 100%;
    z-index: 1000;
}

.shadow-top {
    box-shadow: 0 0 3px .05rem #e1e0e4 !important;
}

html[data-theme="dark"] .shadow-top {
    box-shadow: 0 0 3px .05rem rgba(255, 255, 255, .16) !important;
}

.boo-wrapper {
    margin: 0 5rem !important;
}

.active-navbar-btn {
    background-color: var(--lighterprimary);
    border-radius: 2rem;
    color: var(--primary);
    min-height: 38px;
}

.bg-matched-color {
    background-color: rgba(123, 106, 176, .33);
}

.ghost-match-position {
    position: relative;
    top: 110px;
    z-index: 5;
}

.img-resize6 {
    height: auto;
    max-width: 170px;
    width: 38vw;
}

.image-square-resize,
.image-square-resize2 {
    height: 70px;
    object-fit: cover;
    width: 70px;
}

.rounded1 {
    border-radius: 12px;
}

.rounded2 {
    border-radius: 18px;
}

.rounded4 {
    border-radius: 22px;
}

.border-new-match {
    border: 5px solid var(--primary);
}

.badge2 {
    background: var(--pink);
    border-radius: 50%;
    border: 2px solid var(--line);
    color: #25233a;
    height: 1.2rem;
    inset-inline-end: -7px;
    position: absolute;
    text-align: center;
    top: -7px;
    width: 1.2rem;
}

.badge2 p {
    color: #25233a !important;
    font-weight: 900;
}

.mt-new-match {
    margin-top: -1rem;
}

.notif {
    align-items: center;
    background: var(--pink);
    border: 2px solid var(--line);
    border-radius: 50%;
    color: #25233a !important;
    display: flex;
    font-size: 11px;
    font-weight: 900;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.bg-full-blue { background: #c7eaff; }
.bg-full-pink { background: #ffd6e7; }
.bg-full-purple { background: #dfd8f3; }
.bg-full-orange { background: #ffe1c2; }
.bg-full-green { background: #d8f6df; }

.nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.nav-justified > li {
    flex: 1 1 0;
    text-align: center;
}

.nav-pills a {
    border-radius: 2rem;
    color: var(--gray);
    display: block;
    font-size: 13px;
    font-weight: 900;
}

.active2 a.active,
.active2.active a {
    background: var(--lighterprimary);
    color: var(--primary);
}

.bg-leaderboard {
    background:
        linear-gradient(180deg, rgba(223, 216, 243, .46), rgba(255, 255, 255, 0) 34%),
        var(--bg);
}

.border-leauge {
    border: 1px solid var(--border-primary);
}

.cont-circle {
    background-color: var(--bs-primary);
    border-radius: 2rem;
    height: 5px;
    width: 5px;
}

.violetribbon {
    background: url("../images/games/leaderboard/RibbonViolet.webp") center center / contain no-repeat;
    height: 54px;
    width: 100%;
}

.bg-letter {
    background: url("../images/hana/letter.webp") center center / contain no-repeat;
    box-sizing: border-box;
    cursor: pointer;
    aspect-ratio: 732 / 484;
    height: auto;
    max-width: 340px;
    width: 100%;
}

html[data-theme="dark"] .bg-letter {
    background: url("../images/hana/letter.webp") center center / contain no-repeat;
}

.btn-boo,
.btn-boo-outline-primary {
    border: 2px solid var(--primary);
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
}

.btn-boo {
    background: var(--primary);
    color: #fff;
}

.btn-boo-outline-primary {
    background: var(--bg-white);
    color: var(--primary);
}

.bg-ghost,
.bg-ghost2,
.bg-ghost3 {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.bg-ghost { background-image: url("../images/letters/letter-friends-sunny.webp"); }
.bg-ghost2 { background-image: url("../images/letters/letter-friends-moonlit-phoenix.webp"); }
.bg-ghost3 { background-image: url("../images/letters/letter-friends-clubhouse-phoenix.webp"); }

@media (orientation: landscape) {
    .letter-compose-section,
    .bg-ghost {
        background-image: url("../images/letters/letter-friends-sunny-landscape.webp");
    }

    .bg-ghost2 {
        background-image: url("../images/letters/letter-friends-moonlit-phoenix-landscape.webp");
    }

    .bg-ghost3 {
        background-image: url("../images/letters/letter-friends-clubhouse-phoenix-landscape.webp");
    }
}

.modal {
    background: rgba(0, 0, 0, .34);
    bottom: 0;
    display: none;
    left: 0;
    overflow: auto;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1300;
}

.modal.show {
    display: block;
}

.modal-dialog {
    min-height: 100%;
}

.modal-content {
    min-height: 100%;
    position: relative;
}

.close_btn {
    align-items: center;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 36px;
    z-index: 5;
}

.btnblue,
.btnpurple,
.btnblack {
    border: 2px solid var(--bg-white);
    border-radius: 50%;
    cursor: pointer;
    height: 26px;
    position: absolute;
    top: 20px;
    width: 26px;
    z-index: 5;
}

.btnblue { background: #f0b55f; left: 18px; }
.btnpurple { background: #4d4b9d; left: 52px; }
.btnblack { background: #ef8068; left: 86px; }

.paper-read {
    height: min(70dvh, 118.8vw, 560px);
    max-width: 430px;
    width: min(88vw, 430px);
    z-index: 3;
}

.paper-send {
    height: 70vh;
    width: 70vw;
    z-index: 3;
}

.text-read {
    bottom: 26px;
    color: #2d3a50;
    font-size: 14px;
    font-weight: 900;
    left: 62px;
    line-height: 25px;
    outline: none;
    overflow-y: auto;
    position: absolute;
    right: 24px;
    top: 96px;
    white-space: pre-wrap;
    z-index: 4;
}

.letter-paper-creases {
    height: 100%;
    inset: 0;
    opacity: .82;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 2;
}

.letter-paper-creases path {
    fill: none;
    filter:
        drop-shadow(-1px -1px 0 rgba(255, 255, 255, .76))
        drop-shadow(1.25px 1.5px 1px rgba(92, 65, 37, .28));
    stroke: rgba(105, 76, 44, .40);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.08;
    vector-effect: non-scaling-stroke;
}

.letter-paper-creases path:first-child {
    stroke: rgba(94, 66, 38, .48);
    stroke-width: 1.24;
}

.letter-paper-stamp {
    aspect-ratio: 297 / 334;
    filter: drop-shadow(0 3px 2px rgba(72, 50, 31, .24));
    inset-inline-end: 18px;
    object-fit: contain;
    position: absolute;
    top: 17px;
    transform: rotate(2deg);
    width: clamp(52px, 15%, 72px);
    z-index: 4;
}

.letter-paper-stamp.secondary,
.letter-compose-stamp.secondary {
    inset-inline-end: auto;
    inset-inline-start: 18px;
    transform: rotate(-2deg);
}

.letter-compose-stamp {
    aspect-ratio: 297 / 334;
    filter: drop-shadow(0 3px 2px rgba(72, 50, 31, .24));
    inset-inline-end: 18px;
    object-fit: contain;
    position: absolute;
    top: 17px;
    transform: rotate(2deg);
    width: clamp(52px, 15%, 72px);
    z-index: 5;
}

.letter-compose-stamp[hidden] {
    display: none;
}

.paper-read.is-unfolding {
    animation: letterPaperUnfold .84s cubic-bezier(.18, .76, .22, 1) both;
    transform-origin: center;
    will-change: clip-path, opacity, transform;
}

.paper-read.is-unfolding .lines,
.paper-read.is-unfolding .letter-paper-stamp {
    animation: letterContentsReveal .84s ease-out both;
}

.paper-read.is-unfolding .letter-paper-creases path {
    animation: letterCreasesSettle .68s ease-out .30s both;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.container-letter {
    cursor: pointer;
    max-width: 340px;
    position: relative;
    text-align: center;
    width: 100%;
}

.letter-card-slot {
    box-sizing: border-box;
    max-width: 340px;
    min-width: 0;
    width: 100%;
}

.envelope {
    aspect-ratio: 732 / 484;
    height: auto;
    position: relative;
    width: 100%;
    z-index: 1;
}

.envelope:before,
.envelope:after {
    bottom: 0;
    content: "";
    position: absolute;
}

.envelope:after {
    background: url("../images/hana/letter-bottom.webp") center center / contain no-repeat;
    height: 100%;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 1;
}

.envelope-dark:after {
    background-image: url("../images/hana/letter-bottom-dark.webp");
}

.open {
    background: url("../images/hana/letter-top.webp") center center / contain no-repeat;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    transform-origin: 0% 0%;
    width: 100%;
    z-index: 999;
}

.open-dark {
    background-image: url("../images/hana/letter-top-dark.webp") !important;
}

.paper11 {
    background: var(--bg-white);
    bottom: 0;
    box-shadow: 0 -2px 3px #d4d4d4;
    height: 20vw;
    max-height: 164px;
    max-width: 218px;
    min-height: 100px;
    min-width: 133px;
    position: absolute;
    right: 20%;
    width: 26.66vw;
    z-index: 0;
}

.paper11:before {
    background: var(--bg-white);
    bottom: 0;
    content: "";
    height: 16vw;
    left: 0;
    max-height: 131px;
    max-width: 218px;
    min-height: 80px;
    min-width: 133px;
    position: absolute;
    width: 26.66vw;
}

.noti {
    background: var(--primary);
    border-radius: 35px;
    box-shadow: 0 4px 0 rgba(216, 217, 216, .7);
    color: #fff;
    cursor: pointer;
    font: bold 20px / 36px "Helvetica", Arial, sans-serif;
    height: 35px;
    opacity: 0;
    position: absolute;
    right: -15px;
    text-align: center;
    top: -15px;
    width: 35px;
}

.is-active .open {
    animation: foldUp 1s ease-in-out forwards;
}

.is-active .paper11 {
    animation: paperUp 1.5s ease-in-out forwards;
    animation-delay: 1s;
}

.is-active .noti {
    animation: noti 0.5s ease-in-out forwards;
    animation-delay: 2s;
}

@keyframes foldUp {
    from {
        transform: rotateX(0deg);
    }
    to {
        transform: rotateX(180deg);
        z-index: 0;
    }
}

@keyframes noti {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes paperUp {
    from {
        height: 21vw;
    }
    60% {
        height: 42vw;
    }
    70% {
        height: 40vw;
    }
    80% {
        height: 42vw;
    }
    90% {
        height: 41vw;
    }
    100% {
        height: 42vw;
    }
}

.note {
    align-items: center;
    bottom: 0;
    display: flex;
    height: 100dvh;
    justify-content: center;
    left: 0;
    line-height: 4;
    overflow: hidden;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 10000;
}

.rotate {
    animation: flip 1s ease-in-out;
}

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

@media (max-width: 700px) {
    #previousLetters {
        gap: 12px 14px;
        padding: 14px;
    }
}

@media (max-width: 520px) {
    .store-stamp-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .letter-stamp-picker-pack > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .letter-stamp-strip {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) clamp(78px, 25%, 104px);
    }

    #stamps {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .letter-cheer-tile {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: 112px;
        max-width: 100%;
    }

    .letter-gift-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .letter-gift-row {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .letter-gift-row form {
        display: inline-flex;
    }

    .letter-gift-picker summary {
        align-items: center;
        gap: 8px;
    }

    .container-letter {
        width: 100%;
    }

    .letter-album-stage {
        min-height: 390px;
    }

    .letter-album-book {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        height: 360px;
        min-height: 360px;
    }

    .letter-album-page {
        background:
            linear-gradient(90deg,
                transparent 0 46%,
                rgba(111, 84, 54, .08) 48%,
                rgba(73, 51, 32, .26) 49.4%,
                rgba(255, 255, 255, .52) 50%,
                rgba(73, 51, 32, .26) 50.6%,
                rgba(111, 84, 54, .08) 52%,
                transparent 54%),
            radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .7), transparent 24%),
            #eadcb8;
        box-shadow: inset 0 0 20px rgba(83, 65, 45, .11);
        min-height: 0;
    }

    .letter-album-cover {
        padding: 24px 25px 22px 51px;
    }

    .letter-album-cover-binding {
        inset-inline-start: -10px;
        width: 51px;
    }

    .letter-album-cover-cameo {
        height: 48px;
        width: 48px;
    }

    .letter-album-toolbar {
        gap: 5px;
        grid-template-columns: 58px minmax(0, 1fr) 58px;
        padding-inline: 6px;
    }

    .letter-album-nav {
        font-size: 18px;
        min-width: 44px;
        padding-inline: 8px;
    }

    #previousLetters {
        align-content: space-evenly;
        gap: 8px 18px;
        height: 100%;
        padding: 10px 7px 12px;
    }

    .letter-album-spine {
        border-radius: 999px;
        bottom: 7px;
        box-shadow: inset 4px 0 4px rgba(62, 43, 29, .2), inset -4px 0 4px rgba(62, 43, 29, .2);
        left: calc(50% - 9px);
        top: 7px;
        width: 18px;
    }

    .letter-album-spine > span {
        border-width: 2px;
        height: 10px;
        width: 28px;
    }

    .letter-album-spine > span::before,
    .letter-album-spine > span::after {
        height: 6px;
        width: 6px;
    }

    .letter-album-socket {
        padding: 4px;
    }

    .letter-preview-content .fs-12,
    .letter-preview-content .fs-small {
        font-size: 10px;
        line-height: 1.15;
    }

    .letter-preview-content > p {
        padding: 5px 4px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .letter-album-cover,
    .letter-album-book,
    .letter-album-pocket {
        transition-duration: 0s;
        transition-delay: 0s;
    }

    .letter-album-page.turning-older,
    .letter-album-page.turning-newer,
    .letter-album-page.arriving-older,
    .letter-album-page.arriving-newer {
        animation: none;
    }
}

.letter-page .modal,
.letter-reading-modal {
    height: 100dvh;
    overflow: hidden;
    padding: 0;
}

.letter-modal-dialog {
    height: 100dvh;
    max-width: none;
    min-height: 0;
    width: 100%;
}

.letter-modal-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

html.letter-overlay-open,
body.letter-overlay-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.letter-overlay-open {
    scrollbar-gutter: auto;
}

.letter-compose-frame {
    --letter-compose-width: min(88vw, 460px);
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 62px 12px 92px;
    position: relative;
    z-index: 2;
}

.letter-compose-frame .paper-send {
    flex: 0 0 auto;
    height: min(70vh, 118.8vw, 540px);
    max-width: calc(100vw - 28px);
    transform-style: preserve-3d;
    width: var(--letter-compose-width);
}

.letter-compose-frame:has(.letter-stamp-controls) .paper-send {
    height: min(56vh, 108vw, 470px);
}

.paper-send:has(.letter-compose-stamp.secondary:not([hidden])) .text {
    top: 108px;
}

.letter-stamp-controls {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 88%, var(--sky) 12%);
    border: 1px solid color-mix(in srgb, var(--line) 72%, var(--sky));
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: calc(100vw - 28px);
    padding: 7px 8px;
    width: var(--letter-compose-width);
}

.letter-stamp-action {
    background: color-mix(in srgb, var(--surface) 62%, var(--sky) 38%);
    border: 1px solid color-mix(in srgb, var(--sky) 62%, var(--line));
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    flex: 1 1 0;
    font: inherit;
    font-size: clamp(11px, 2.8vw, 13px);
    font-weight: 850;
    line-height: 1.15;
    min-height: 32px;
    min-width: 0;
    padding: 5px 8px;
    white-space: nowrap;
}

.letter-stamp-action.secondary {
    background: color-mix(in srgb, var(--surface) 58%, var(--mint) 42%);
    border-color: color-mix(in srgb, var(--mint) 64%, var(--line));
}

.letter-stamp-action:hover,
.letter-stamp-action:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.letter-stamp-controls small {
    color: var(--muted);
    flex: 1 0 100%;
    font-size: 10px;
    text-align: center;
}

.letter-stamp-remove {
    background: transparent;
    border: 0;
    color: var(--coral-dark);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    text-decoration: underline;
    white-space: nowrap;
}

.letter-stamp-picker {
    max-width: min(94vw, 720px);
    width: min(94vw, 720px);
}

.letter-stamp-picker-card {
    display: grid;
    gap: 10px;
    max-height: min(88dvh, 760px);
    overflow-y: auto;
}

.letter-stamp-picker-card h2,
.letter-stamp-picker-pack h3 {
    margin: 0;
}

.letter-stamp-picker-grid,
.letter-stamp-picker-pack {
    display: grid;
    gap: 10px;
}

.letter-stamp-picker-pack > div {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.letter-stamp-choice {
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    padding: 5px;
}

.letter-stamp-choice:hover,
.letter-stamp-choice:focus-visible {
    border-color: var(--sky);
    outline: none;
}

.letter-stamp-choice img {
    aspect-ratio: 297 / 334;
    display: block;
    object-fit: contain;
    width: 100%;
}

.paper-fold-art {
    aspect-ratio: 1;
    background-image: url("../images/letters/paper-plane-folding.webp");
    background-position: 0 center;
    background-repeat: no-repeat;
    background-size: 600% 100%;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(78%, 360px);
    z-index: 8;
}

.letter-send-button {
    align-self: center;
    background: var(--coral);
    border: 3px solid var(--line);
    border-radius: 20px;
    box-shadow: none;
    color: var(--paper-warm);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    text-align: center;
    width: min(310px, 86vw);
}

.letter-send-button:disabled {
    background: var(--surface-2);
    color: var(--muted);
    cursor: wait;
    opacity: .74;
}

.terms-accept-card {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 18px;
    padding: 14px;
}

.terms-accept-card p {
    margin: 0;
}

.new-message-container {
    align-content: center;
    display: none;
    justify-items: center;
    min-height: 100vh;
    padding: 54px 18px;
    text-align: center;
}

.new-message-container.is-active,
.new-message-container.is-preparing {
    display: grid;
}

.new-message-container.is-preparing {
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.new-message-container.is-preparing .text-primary {
    visibility: hidden;
}

.new-message-container.is-preparing .letter-paper-plane,
.new-message-container.is-preparing .letter-flight-trail {
    display: none;
}

.letter-delivery-stage {
    height: clamp(260px, 46vh, 370px);
    max-width: 720px;
    overflow: visible;
    position: relative;
    width: min(92vw, 720px);
}

.letter-delivery-mascot {
    bottom: 12px;
    height: auto;
    left: calc(50% - clamp(150px, 25vw, 205px));
    opacity: 0;
    position: absolute;
    transform-origin: 50% 90%;
    width: clamp(148px, 27vw, 202px);
    z-index: 3;
}

.letter-paper-plane {
    filter:
        drop-shadow(0 13px 7px rgba(37, 49, 74, .20))
        drop-shadow(0 4px 2px rgba(37, 49, 74, .16));
    height: auto;
    left: 61%;
    opacity: 0;
    position: absolute;
    top: 44%;
    transform-origin: 42% 56%;
    width: clamp(148px, 24vw, 190px);
    z-index: 4;
}

.letter-paper-plane img {
    display: block;
    height: auto;
    width: 100%;
}

.letter-flight-trail {
    border-top: 4px dashed color-mix(in srgb, var(--palette-secondary) 75%, white);
    border-radius: 50%;
    height: 60px;
    left: 56%;
    opacity: 0;
    position: absolute;
    top: 50%;
    width: min(42vw, 280px);
    z-index: 1;
}

.letter-flight-trail-two {
    border-color: color-mix(in srgb, var(--palette-primary) 70%, white);
    top: calc(50% + 18px);
    transform: scale(.72) rotate(-7deg);
}

.letter-launch-shadow {
    background: rgba(37, 49, 74, .24);
    border-radius: 50%;
    bottom: 18px;
    filter: blur(5px);
    height: 13px;
    left: calc(50% - clamp(128px, 21vw, 175px));
    opacity: 0;
    position: absolute;
    width: clamp(95px, 18vw, 140px);
}

/* Match the fold duration so both assets reach their handoff pose together. */
.new-message-container.is-preparing .letter-delivery-mascot {
    animation: letterMascotApproach 1.8s cubic-bezier(.22, .7, .25, 1) both;
}

.new-message-container.is-preparing .letter-launch-shadow {
    animation: letterMascotShadowApproach 1.8s ease-out both;
}

.new-message-container.is-active .letter-delivery-mascot {
    animation: letterMascotDelivery 3.4s cubic-bezier(.22, .7, .25, 1) both;
}

.new-message-container.is-active .letter-paper-plane {
    animation: letterPlaneDelivery 3.4s cubic-bezier(.18, .74, .2, 1) both;
}

.new-message-container.is-active .letter-flight-trail {
    animation: letterFlightTrail 3.4s ease-out both;
}

.new-message-container.is-active .letter-launch-shadow {
    animation: letterMascotShadow 3.4s ease-out both;
}

.new-message-container .text-primary {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 999px;
    margin: 12px 0 0;
    padding: 9px 16px;
}

.letter-delivery-status {
    color: var(--text);
    font-weight: 900;
}

.paper.folded {
    animation: letterFoldIntoPlane 1.8s cubic-bezier(.5, 0, .25, 1) forwards;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    filter: drop-shadow(0 14px 8px rgba(37, 49, 74, .30));
    pointer-events: none;
    transform-origin: center 62%;
    transform-style: preserve-3d;
}

.paper.folded::before,
.paper.folded::after,
.paper.folded .lines {
    animation: none;
    opacity: 0;
}

.paper.folded .letter-compose-stamp {
    opacity: 0;
}

.paper.folded .paper-fold-art {
    animation:
        letterFoldSprite 1.8s steps(5, end) forwards,
        letterFoldArtReveal 1.8s ease forwards;
}

@keyframes letterFoldIntoPlane {
    0% {
        opacity: 1;
        transform:
            perspective(1000px)
            rotateX(0)
            rotateY(0)
            rotateZ(0)
            scale(1);
    }
    24% {
        transform:
            perspective(1000px)
            rotateX(12deg)
            rotateY(-4deg)
            rotateZ(-2deg)
            scale(.92);
    }
    36% {
        transform:
            perspective(1000px)
            rotateX(8deg)
            rotateY(-6deg)
            rotateZ(-4deg)
            scale(.86);
    }
    72% {
        transform:
            perspective(1000px)
            rotateX(4deg)
            rotateY(-4deg)
            rotateZ(-8deg)
            scale(.82);
    }
    88% {
        opacity: 1;
        transform:
            perspective(1000px)
            translate3d(0, 3vh, 0)
            rotateX(0)
            rotateY(0)
            rotateZ(-8deg)
            scale(.76);
    }
    100% {
        opacity: 0;
        transform:
            perspective(1000px)
            translate3d(0, 4vh, 0)
            rotateX(0)
            rotateY(0)
            rotateZ(-8deg)
            scale(.70);
    }
}

@keyframes letterPaperUnfold {
    0% {
        clip-path: inset(44% 18% 44% 18% round 6px);
        opacity: .68;
        transform: perspective(1000px) translateY(22px) rotateX(72deg) rotateZ(-6deg) scale(.72);
    }
    30% {
        clip-path: inset(31% 8% 31% 8% round 5px);
        opacity: .92;
        transform: perspective(1000px) translateY(9px) rotateX(-18deg) rotateZ(2deg) scale(.82);
    }
    62% {
        clip-path: inset(8% 2% 8% 2% round 4px);
        opacity: 1;
        transform: perspective(1000px) translateY(0) rotateX(9deg) rotateZ(-1deg) scale(.98, .92);
    }
    84% {
        clip-path: inset(0 round 3px);
        transform: perspective(1000px) rotateX(-1.5deg) rotateZ(0) scale(1.012, 1.018);
    }
    100% {
        clip-path: inset(0 round 0);
        opacity: 1;
        transform: perspective(1000px) rotateX(0) rotateZ(0) scale(1);
    }
}

@keyframes letterContentsReveal {
    0%,
    38% {
        opacity: 0;
    }
    72% {
        opacity: .72;
    }
    100% {
        opacity: 1;
    }
}

@keyframes letterCreasesSettle {
    from {
        opacity: 0;
        stroke-dashoffset: 1;
    }
    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

@keyframes letterFoldSprite {
    from { background-position: 0 center; }
    to { background-position: 100% center; }
}

@keyframes letterFoldArtReveal {
    0%,
    92% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes letterMascotApproach {
    0%,
    8% {
        opacity: 0;
        transform: translateX(-48vw) translateY(10px) rotate(-8deg);
    }
    100% {
        opacity: 1;
        transform: translateX(-12px) translateY(0) rotate(3deg);
    }
}

@keyframes letterMascotDelivery {
    0% {
        opacity: 1;
        transform: translateX(-12px) translateY(0) rotate(3deg);
    }
    18% {
        opacity: 1;
        transform: translateX(8px) translateY(9px) rotate(-3deg) scaleY(.94);
    }
    37% {
        opacity: 1;
        transform: translateX(30px) translateY(-28px) rotate(8deg) scaleY(1.02);
    }
    55% {
        opacity: 1;
        transform: translateX(44px) translateY(0) rotate(-4deg);
    }
    100% {
        opacity: 1;
        transform: translateX(44px) translateY(0) rotate(0);
    }
}

@keyframes letterPlaneDelivery {
    0% {
        opacity: 1;
        transform:
            perspective(520px)
            translate3d(-50%, -50%, 0)
            rotateX(22deg)
            rotateY(-18deg)
            rotateZ(-8deg)
            scale(.96);
    }
    20% {
        opacity: 1;
        transform:
            perspective(520px)
            translate3d(-84%, -30%, 18px)
            rotateX(42deg)
            rotateY(-26deg)
            rotateZ(-14deg)
            scale(.82);
    }
    37% {
        opacity: 1;
        transform:
            perspective(520px)
            translate3d(-64%, -72%, 34px)
            rotateX(-12deg)
            rotateY(18deg)
            rotateZ(-5deg)
            scale(.88);
    }
    51% {
        opacity: 1;
        transform:
            perspective(520px)
            translate3d(-18%, -112%, 56px)
            rotateX(26deg)
            rotateY(-12deg)
            rotateZ(-14deg)
            scale(1);
    }
    74% {
        opacity: .95;
        transform:
            perspective(520px)
            translate3d(25vw, -26vh, 30px)
            rotateX(-18deg)
            rotateY(24deg)
            rotateZ(-18deg)
            scale(.7);
    }
    100% {
        opacity: 0;
        transform:
            perspective(520px)
            translate3d(58vw, -38vh, 0)
            rotateX(16deg)
            rotateY(-28deg)
            rotateZ(-22deg)
            scale(.42);
    }
}

@keyframes letterFlightTrail {
    0%,
    39% {
        opacity: 0;
        transform: translateX(-12%) scaleX(.1) rotate(-13deg);
    }
    56% {
        opacity: .85;
        transform: translateX(-3%) scaleX(.62) rotate(-13deg);
    }
    100% {
        opacity: 0;
        transform: translateX(34vw) scaleX(1) rotate(-13deg);
    }
}

@keyframes letterMascotShadowApproach {
    0%,
    8% {
        opacity: 0;
        transform: translateX(-48vw) scaleX(.72);
    }
    100% {
        opacity: .65;
        transform: translateX(0) scaleX(1);
    }
}

@keyframes letterMascotShadow {
    0% {
        opacity: .65;
        transform: translateX(0) scaleX(1);
    }
    31% {
        opacity: .25;
        transform: translateX(28px) scaleX(.72);
    }
    57%,
    100% {
        opacity: .55;
        transform: translateX(44px) scaleX(.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    .paper-read.is-unfolding,
    .paper-read.is-unfolding .lines,
    .paper-read.is-unfolding .letter-paper-stamp,
    .paper-read.is-unfolding .letter-paper-creases path {
        animation: none;
    }

    .paper.folded {
        animation: letterFoldReduced .3s ease forwards;
    }

    .new-message-container.is-active .letter-delivery-mascot,
    .new-message-container.is-active .letter-paper-plane,
    .new-message-container.is-active .letter-launch-shadow {
        animation-duration: 1.2s;
    }

    .new-message-container.is-preparing .letter-delivery-mascot,
    .new-message-container.is-preparing .letter-launch-shadow {
        animation-duration: .3s;
    }

    .new-message-container.is-active .letter-flight-trail {
        display: none;
    }

    .paper.folded .paper-fold-art {
        animation: none;
        background-position: 100% center;
        opacity: 1;
    }
}

/* Candidate games 31-35 share one tactile shell while keeping distinct boards. */
.candidate-game-page {
    min-height: 100vh;
    background-position: center;
    background-size: cover;
}

.candidate-play-card {
    width: min(94vw, 760px);
    margin: 14px auto 40px;
    padding: clamp(12px, 2.5vw, 22px);
    border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
    border-radius: 28px;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    box-shadow: 0 20px 54px rgba(18, 28, 44, .24), inset 0 1px rgba(255, 255, 255, .62);
    backdrop-filter: blur(8px);
}

.candidate-summary,
.candidate-hint {
    min-height: 34px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(36, 50, 72, .14);
    background: rgba(255, 252, 242, .94);
    color: #1d2940;
    font-weight: 700;
    text-align: center;
}

.candidate-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.candidate-hint { margin: 12px 0 0; }
.candidate-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 14px auto 0; padding: 7px; border-radius: 15px; background: rgba(255, 252, 242, .88); }
.candidate-controls .btn { min-height: 44px; }
.candidate-board { position: relative; margin: auto; direction: ltr; }
.control-label { color: #1d2940; font-weight: 800; }

.lantern-board {
    display: grid;
    width: min(82vw, 510px);
    aspect-ratio: 1;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(5px, 1vw, 9px);
    padding: clamp(10px, 2vw, 18px);
    border: 8px solid #9a6c3e;
    border-radius: 26px;
    background: linear-gradient(145deg, #d9c7aa, #aa865e);
    box-shadow: inset 0 0 0 3px #5d3e24, 0 15px 32px rgba(29, 21, 40, .3);
}

.lantern-cell {
    position: relative;
    border: 1px solid rgba(75, 52, 29, .28);
    border-radius: 17px;
    background: linear-gradient(145deg, #efe6d4, #cdb993);
    color: #362c43;
    font-size: clamp(1.45rem, 7vw, 2.4rem);
    box-shadow: inset 0 2px 3px rgba(255,255,255,.72), 0 3px 5px rgba(47,31,20,.19);
    transition: transform .16s ease, box-shadow .25s ease;
}

.lantern-cell.lit { box-shadow: inset 0 0 25px color-mix(in srgb, var(--cell-glow) 58%, transparent), 0 0 13px var(--cell-glow); }
.lantern-cell.lantern { color: var(--piece-color); filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.lantern-cell.mirror { color: #fff5d6; background: linear-gradient(145deg, #eefbff, #7095a8); text-shadow: 0 2px 4px #264354; }
.lantern-cell:not(:disabled):active { transform: scale(.92); }

.orbit-board {
    width: min(86vw, 480px);
    height: min(86vw, 480px);
    max-height: 480px;
    border: 11px solid #9d703e;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 45px, rgba(218,178,86,.7) 46px 48px, transparent 49px 84px), radial-gradient(circle, #182947, #071424 72%);
    box-shadow: inset 0 0 35px #020b17, 0 16px 38px rgba(7,14,29,.42);
}

.orbit-token {
    position: absolute;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 3px solid rgba(255,255,255,.76);
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 7px rgba(0,0,0,.46);
    transition: transform .22s ease, background .22s ease;
}

.orbit-token.occupied { background: radial-gradient(circle at 35% 28%, #fff, var(--token-color) 24%, color-mix(in srgb, var(--token-color) 60%, #06111f)); }
.orbit-token.selected { transform: translate(-50%, -50%) scale(1.32); box-shadow: 0 0 0 5px #fff3a8, 0 0 20px #ffd866; }
.orbit-token:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.15); }

.postcard-board { display: grid; gap: 12px; }
.postcard-route { padding: 12px; border: 2px solid rgba(54,81,107,.16); border-radius: 20px; background: color-mix(in srgb, var(--paper) 89%, var(--mint) 11%); box-shadow: 0 7px 13px rgba(48,48,66,.11); }
.postcard-route-title { display: block; margin-bottom: 9px; color: var(--ink); }
.postcard-track { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; height: 72px; margin-bottom: 8px; }
.postcard-track::before { content: ""; position: absolute; right: 6%; left: 6%; height: 8px; border-radius: 9px; background: repeating-linear-gradient(90deg, #6bbad0 0 20px, #f4c457 20px 40px, #ec7b7b 40px 60px); opacity: .65; }
.postcard-step { z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; justify-self: center; border: 3px solid #fff; border-radius: 50%; background: #668aa0; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.postcard-piece { position: absolute; z-index: 3; left: calc(3% + var(--progress) * 90%); top: calc(2px + var(--lane) * 13px); color: var(--player-color); font-size: 1.65rem; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.34)); transition: left .55s cubic-bezier(.2,.8,.2,1); }
.postcard-route .btn { width: 100%; }

.constellation-board { width: min(86vw, 560px); aspect-ratio: 4 / 3; overflow: hidden; border: 8px solid #aa8c64; border-radius: 28px; background: radial-gradient(circle at 30% 20%, #243d6e, #090d29 72%); box-shadow: inset 0 0 50px #030716, 0 14px 34px rgba(9,9,38,.38); }
.constellation-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation-lines line { stroke: #c9eeff; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 5px #79cfff); animation: candidate-line-arrive .45s ease both; }
.constellation-star { position: absolute; z-index: 2; width: clamp(37px, 9vw, 52px); height: clamp(37px, 9vw, 52px); border: 2px solid #fff5bc; border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, #ffe48a 22%, #bd7e2c 56%, #502c68 100%); color: #182242; font-weight: 900; transform: translate(-50%, -50%); box-shadow: 0 0 15px #ffe292; transition: left .4s ease, top .4s ease, transform .16s ease; }
.constellation-star.selected { transform: translate(-50%, -50%) scale(1.23); box-shadow: 0 0 0 5px #73ddff, 0 0 25px #73ddff; }
.goal-chip { padding: 5px 9px; border-radius: 999px; background: #252d58; color: #eef6ff; font-size: .84rem; }
.goal-chip.done { background: #287a61; box-shadow: 0 0 12px #6ee0b4; }

.chess-page .candidate-play-card { width: min(98vw, 920px); }
.chess-page .candidate-hint { display: none; }
.chess-page .candidate-summary[hidden], .chess-page .game-status-actions .move-timer { display: none; }
.chess-player-clock { align-items: center; background: #172946; border: 2px solid #fffaf0; border-radius: 999px; color: #fffaf0; direction: ltr; display: inline-flex; font-size: .76rem; font-variant-numeric: tabular-nums; font-weight: 900; justify-content: center; line-height: 1; margin-top: 4px; min-width: 48px; padding: 4px 7px; text-shadow: none; }
.chess-player-clock.running { background: #fff4d8; border-color: #14233d; color: #14233d; box-shadow: 0 0 0 3px rgba(113, 211, 255, .8); }
.chess-player-clock.danger { background: #a81534; border-color: #fff; color: #fff; animation: chess-clock-danger 520ms ease-in-out infinite alternate; }
.chess-turn-clock { background: #bfe9ff; border: 1px solid #10233d; border-radius: 999px; color: #10233d; direction: ltr; display: block; font-size: .66rem; font-variant-numeric: tabular-nums; font-weight: 900; margin-top: 4px; padding: 3px 6px; text-shadow: none; white-space: nowrap; width: fit-content; }
.chess-turn-clock[hidden] { display: none; }
.chess-page .game-player-card.active .chess-turn-clock:not(.danger) { color: #10233d; }
.chess-turn-clock.danger { background: #a81534; border-color: #fff; color: #fff; }
.chess-stage { display: grid; grid-template-columns: minmax(62px, 86px) minmax(0, 600px) minmax(62px, 86px); gap: clamp(7px, 1.5vw, 14px); align-items: stretch; justify-content: center; margin: auto; direction: ltr; }
.chess-board { display: grid; width: 100%; max-width: 600px; aspect-ratio: 1; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); overflow: hidden; border: clamp(8px, 2vw, 18px) solid #593b28; border-radius: 16px; background: #593b28; box-shadow: inset 0 0 0 3px #d6ad73, 0 17px 38px rgba(26,19,22,.36); }
.chess-square { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; line-height: 1; isolation: isolate; }
.chess-square.light { background: #e7d2aa; }
.chess-square.dark { background: #6e846c; }
.chess-square.last { box-shadow: inset 0 0 0 5px rgba(255, 215, 82, .82), inset 0 0 20px rgba(255, 229, 124, .48); }
.chess-square.selected { box-shadow: inset 0 0 0 5px #ff774d; }
.chess-square.in-check { box-shadow: inset 0 0 0 6px #c9213d, inset 0 0 28px rgba(255, 54, 78, .82); animation: chess-king-check 900ms ease-in-out infinite alternate; }
.chess-square.in-check .chess-piece { filter: drop-shadow(0 5px 3px rgba(21, 15, 18, .42)) drop-shadow(0 0 9px #ff334f); }
.chess-piece { z-index: 1; width: 96%; height: 96%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 5px 3px rgba(21, 15, 18, .42)); transform-origin: 50% 82%; }
.chess-piece-style-emberglass[src*="/emberglass/knight.webp"],
.knight-piece.chess-piece-style-emberglass {
    scale: -1 1;
}
.chess-square.piece-side-white::after,
.chess-square.piece-side-black::after {
    border: 2px solid #25314a;
    border-radius: 50%;
    bottom: 3%;
    content: "";
    height: 15%;
    position: absolute;
    width: 76%;
    z-index: 0;
}
.chess-square.piece-side-white::after { background: #fff8e8; }
.chess-square.piece-side-black::after { background: #20293a; border-color: #f8f3e6; }
.chess-square.arrival .chess-piece { animation: chess-piece-land .48s cubic-bezier(.18, .82, .24, 1.16) both; }
.chess-capture-tray { align-content: flex-start; display: flex; flex-flow: row wrap; gap: 3px; min-width: 0; padding: 7px 5px; border: 2px solid rgba(72, 48, 33, .42); border-radius: 14px; background: rgba(255, 250, 237, .88); box-shadow: inset 0 1px rgba(255,255,255,.8), 0 7px 17px rgba(32, 23, 20, .16); }
.chess-capture-label { flex-basis: 100%; color: #47362c; font-size: .68rem; line-height: 1.15; text-align: center; }
.chess-captured-piece { width: calc(50% - 2px); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(24, 17, 17, .35)); transform: scale(1.55); }
.draw-offer-pending { padding: 7px 10px; border-radius: 12px; background: rgba(255, 252, 242, .94); color: #1d2940; font-weight: 800; }
.chess-history { flex-basis: 100%; padding: 7px 10px; border-radius: 12px; background: rgba(255, 252, 242, .94); color: #1d2940; text-align: center; }
.promotion-choice { min-width: 54px; font-size: 1.6rem; }

@keyframes candidate-line-arrive { from { stroke-dasharray: 600; stroke-dashoffset: 600; } to { stroke-dasharray: 600; stroke-dashoffset: 0; } }
@keyframes chess-piece-land { 0% { opacity: .72; transform: translateY(-24%) scale(1.08); } 64% { transform: translateY(4%) scale(.97, 1.03); } 100% { opacity: 1; transform: none; } }
@keyframes chess-king-check { to { box-shadow: inset 0 0 0 6px #ef3c50, inset 0 0 34px rgba(255, 35, 61, .98), 0 0 18px rgba(255, 51, 79, .76); } }
@keyframes chess-clock-danger { to { transform: scale(1.06); } }

@media (max-width: 560px) {
    .candidate-play-card { width: calc(100vw - 16px); margin-top: 8px; padding: 10px; border-radius: 20px; }
    .orbit-board { transform: scale(.91); margin-block: -12px; }
    .orbit-token { width: 27px; height: 27px; }
    .postcard-track { height: 82px; }
    .constellation-star { font-size: .82rem; }
    .chess-stage { grid-template-columns: minmax(0, 1fr); width: min(92vw, 430px); gap: 5px; }
    .chess-capture-tray { align-items: center; flex-wrap: nowrap; min-height: 38px; overflow: hidden; padding: 3px 6px; }
    .chess-capture-label { flex: 0 0 58px; font-size: .58rem; }
    .chess-captured-piece { flex: 0 0 29px; width: 29px; height: 29px; }
    .chess-board { width: 100%; }
    .chess-page .candidate-controls { margin-top: 8px; padding: 5px; }
    .chess-page .candidate-controls .btn { min-height: 38px; padding: 7px 10px; }
}

@media (max-width: 340px) {
    .chess-page .candidate-play-card { padding: 7px; }
    .chess-page .candidate-summary { min-height: 28px; margin-bottom: 6px; padding: 5px 8px; font-size: .82rem; }
    .chess-stage { width: 82vw; gap: 3px; }
    .chess-capture-tray { min-height: 31px; padding-block: 1px; }
    .chess-captured-piece { flex-basis: 25px; width: 25px; height: 25px; }
    .chess-page .candidate-controls .btn { min-height: 34px; padding: 5px 8px; font-size: .78rem; }
    .chess-history { padding: 4px 8px; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
    .constellation-lines line { animation: none; }
    .postcard-piece, .constellation-star, .orbit-token { transition: none; }
    .chess-square.arrival .chess-piece { animation: none; }
    .chess-square.in-check, .chess-player-clock.danger { animation: none; }
}

@keyframes letterFoldReduced {
    to {
        opacity: 0;
        transform: scale(.7);
    }
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiline-truncate {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    white-space: normal;
}

@media (max-width: 700px) {
    .boo-wrapper {
        margin: 0 !important;
    }
}

.board-wrap {
    --live-game-content-width: 760px;
    --live-game-scale: 1;
    background-color: var(--bg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
}

/* Large desktop game pages should feel like a useful browser-zoom increase,
   not a wider layout. Scale the complete composition while keeping its 760px
   proportions and leaving the viewport-sized room background in place. The
   large breakpoint also prevents this layer from stacking with 125% browser
   zoom after that zoom reduces the CSS viewport width. */
@media (min-width: 2300px) and (min-height: 1350px) {
    .board-wrap {
        --live-game-scale: 1.25;
    }
}

/* Live game backgrounds stay full-bleed while their playable surfaces share
   the compact game-only width contract above. */
.board-wrap .backgammon-shell,
.board-wrap.chess-page .candidate-play-card,
.board-wrap .crazy-table,
.board-wrap .flip-nine-game,
.board-wrap .hokm-table,
.board-wrap .hundred-hop-game,
.board-wrap .ludo-shell,
.board-wrap .snakes-shell {
    max-width: var(--live-game-content-width);
}

.board-wrap.game-background-simple,
.board-wrap.game-background-world {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.board-wrap.game-background-moonlit {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

/* Supporter commerce uses the same compact cards and dialogs as the rest of
   the app so the payment surface never feels like a separate storefront. */

.support-hero {
    align-items: center;
    background: var(--feature-gradient);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.support-hero h1 {
    font-size: clamp(23px, 4vw, 30px);
    line-height: 1.08;
    margin: 0 0 6px;
}

.supporters-intro h1 {
    font-size: clamp(20px, 3vw, 24px);
    line-height: 1.1;
    margin: 0 0 4px;
}

.support-hero p,
.supporters-intro p {
    line-height: 1.4;
    margin-bottom: 0;
}

.support-current {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    display: grid;
    min-width: 145px;
    padding: 10px 12px;
    text-align: center;
}

.support-current strong {
    color: var(--accent-strong);
    font-size: 23px;
}

.support-social-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-social-card {
    align-items: center;
    box-shadow: none;
    background: var(--panel-sunny);
    color: var(--text);
    display: grid;
    gap: 12px;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    padding-block: 8px;
    text-decoration: none;
}

.support-instagram-card {
    background: color-mix(in srgb, var(--sky) 24%, var(--surface));
}

.support-social-card > img {
    height: 72px;
    object-fit: contain;
    width: 72px;
}

.support-social-card > span:not(.btn) {
    display: grid;
    gap: 2px;
}

.support-social-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.support-social-card strong {
    font-size: 19px;
}

.support-social-card:hover,
.support-social-card:focus-visible {
    box-shadow: none;
}

.support-notice {
    background: var(--panel-sunny);
    display: grid;
    gap: 5px;
}

.support-notice.success {
    background: color-mix(in srgb, var(--mint) 35%, var(--surface));
}

.support-notice p,
.support-legal-note {
    margin: 0;
}

.support-section-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.support-section-heading h2 {
    margin: 0;
}

.support-friends-link {
    background: var(--yellow);
}

.support-amount-form {
    margin-top: 14px;
}

.support-amount-options {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 176px;
}

.support-quick-amounts {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.support-amount-choice {
    align-items: center;
    background: var(--surface-3);
    border: 3px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 4px;
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 82px;
    padding: 6px 10px;
    position: relative;
    text-align: start;
}

.support-amount-choice:hover {
    border-color: var(--accent-strong);
    box-shadow: none;
}

.support-amount-choice.active {
    background: color-mix(in srgb, var(--yellow) 48%, var(--surface));
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-strong) 32%, transparent);
}

.support-amount-choice.active::after {
    align-items: center;
    background: var(--accent-strong);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--surface);
    content: "✓";
    display: flex;
    font-size: 13px;
    height: 24px;
    inset-inline-end: 5px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    top: 5px;
    width: 24px;
}

.support-amount-choice img {
    height: 66px;
    object-fit: contain;
    width: 100%;
}

.support-amount-choice strong {
    font-size: clamp(17px, 2.5vw, 22px);
    white-space: nowrap;
}

.support-other-amount {
    background: var(--surface-2);
    border: 3px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 7px;
    padding: 9px;
    transition: filter .15s ease, opacity .15s ease;
}

.support-other-amount:not(.active) {
    filter: grayscale(.65);
    opacity: .46;
}

.support-other-amount:not(.active):hover,
.support-other-amount:not(.active):focus-within {
    filter: grayscale(.25);
    opacity: .8;
}

.support-other-amount.active {
    border-color: var(--accent-strong);
    box-shadow: none;
}

.support-other-amount > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.support-amount-stepper {
    align-items: stretch;
    display: grid;
    gap: 5px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
}

.support-amount-stepper button {
    align-items: center;
    background: var(--surface-3);
    border: 2px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    justify-content: center;
    min-height: 42px;
    padding: 4px;
}

.support-amount-stepper button:hover,
.support-amount-stepper button:focus-visible {
    border-color: var(--accent-strong);
}

.support-amount-stepper button:disabled {
    cursor: default;
    opacity: .38;
}

.support-amount-stepper .support-stepper-value {
    font-size: 16px;
    white-space: nowrap;
}

.support-checkout-row {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.support-checkout-unavailable {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.support-detail-line {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 12px;
    gap: 7px;
    margin-top: 9px;
}

.support-tier-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0;
}

.support-tier-card {
    align-items: center;
    background: var(--surface-3);
    border: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 8px;
    text-align: center;
}

.support-tier-card.current {
    box-shadow: 0 0 0 4px var(--yellow);
}

.support-tier-card img {
    height: 56px;
    object-fit: contain;
    width: 56px;
}

.support-tier-card span {
    color: var(--muted);
    font-size: 12px;
}

.moonlit-collection-panel {
    align-items: center;
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 76%, #20294f), color-mix(in srgb, var(--surface-3) 70%, #233d5e));
    color: var(--text);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(320px, 1.05fr) minmax(0, .95fr);
}

.moonlit-collection-panel .muted,
.moonlit-collection-panel .tiny-label {
    color: var(--muted);
}

.moonlit-pack-preview {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.moonlit-preview-item {
    aspect-ratio: 16 / 9;
    background: #10132d;
    border: 2px solid var(--line);
    border-radius: 7px;
    color: #fff;
    cursor: zoom-in;
    font: inherit;
    height: auto;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-align: start;
}

.moonlit-pack-preview .moonlit-pack-feature {
    grid-column: 1 / -1;
    height: auto;
}

.moonlit-preview-item:hover,
.moonlit-preview-item:focus-visible {
    border-color: var(--yellow);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--yellow) 45%, transparent);
}

.moonlit-preview-item img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.moonlit-preview-item > span:not(.moonlit-swatch) {
    background: rgba(12, 16, 42, .84);
    bottom: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    inset-inline-start: 4px;
    padding: 2px 5px;
    position: absolute;
}

.moonlit-palette-chip {
    aspect-ratio: auto;
    cursor: zoom-in;
    display: grid;
    gap: 3px;
    grid-column: span 2;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 58px;
    padding: 5px 5px 18px;
}

.moonlit-palette-chip strong {
    background: rgba(12, 16, 42, .88);
    bottom: 0;
    color: #fff;
    font-size: 10px;
    inset-inline: 0;
    padding: 2px 4px;
    position: absolute;
    text-align: center;
}

.moonlit-swatch {
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    min-height: 13px;
}

.moonlit-swatch.sky,
.moonlit-palette-preview .sky {
    background: #8aa8ff;
}

.moonlit-swatch.mint,
.moonlit-palette-preview .mint {
    background: #68e0cf;
}

.moonlit-swatch.violet,
.moonlit-palette-preview .violet {
    background: #8573d8;
}

.moonlit-swatch.gold,
.moonlit-palette-preview .gold {
    background: #f8ca78;
}

.moonlit-swatch.coral,
.moonlit-palette-preview .coral {
    background: #ef7f9b;
}

.moonlit-swatch.navy,
.moonlit-palette-preview .navy {
    background: #202641;
    color: #fff;
}

.collection-preview-dialog {
    max-height: 94vh;
    max-width: min(96vw, 940px);
    width: min(96vw, 940px);
}

.collection-preview-dialog .rules-card {
    max-height: 94vh;
    max-width: none;
    overflow: auto;
    width: 100%;
}

.collection-preview-dialog [data-collection-preview-image] {
    aspect-ratio: 16 / 9;
    background: #10132d;
    border: 3px solid var(--line);
    border-radius: 9px;
    height: auto;
    max-height: min(72vh, 680px);
    object-fit: contain;
    width: 100%;
}

.collection-preview-gallery,
.collection-preview-stage {
    position: relative;
}

.collection-preview-stage {
    min-height: 180px;
}

.collection-preview-nav {
    align-items: center;
    background: var(--yellow);
    border: 3px solid var(--line);
    border-radius: 50%;
    box-shadow: none;
    color: #25233a;
    cursor: pointer;
    display: flex;
    font-size: 34px;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 4px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    z-index: 4;
}

.collection-preview-nav.previous {
    inset-inline-start: 10px;
}

.collection-preview-nav.next {
    inset-inline-end: 10px;
}

.collection-preview-nav:hover,
.collection-preview-nav:focus-visible {
    background: var(--mint);
    transform: translateY(calc(-50% - 2px));
}

.collection-preview-count {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-top: 7px;
    text-align: center;
}

.moonlit-frame-preview {
    align-items: center;
    background:
        radial-gradient(circle at 50% 24%, rgba(118, 179, 255, .26), transparent 28%),
        radial-gradient(circle at 18% 78%, rgba(104, 224, 207, .17) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 32%, rgba(248, 202, 120, .2) 0 2px, transparent 3px),
        linear-gradient(145deg, #10142f, #213d5b);
    border: 3px solid var(--line);
    border-radius: 9px;
    display: flex;
    justify-content: center;
    min-height: min(66vh, 560px);
    overflow: hidden;
    padding: 24px 64px;
}

.moonlit-frame-preview[hidden] {
    display: none;
}

.moonlit-frame-preview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 540px;
    width: 100%;
}

.moonlit-frame-preview-card {
    align-items: center;
    background: rgba(15, 19, 45, .78);
    border: 2px solid rgba(248, 202, 120, .55);
    border-radius: 12px;
    color: #fff;
    display: grid;
    gap: 10px;
    justify-items: center;
    margin: 0;
    min-width: 0;
    padding: 16px 12px 11px;
}

.moonlit-frame-preview-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 7px);
}

.moonlit-frame-preview-card figcaption {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}

.moonlit-collection-frame-avatar {
    height: clamp(96px, 14vw, 150px);
    margin: clamp(12px, 2vw, 20px);
    width: clamp(96px, 14vw, 150px);
}

.moonlit-collection-frame-avatar img {
    border-radius: 18px;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.moonlit-palette-preview {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.moonlit-palette-preview[hidden] {
    display: none;
}

.moonlit-palette-preview span {
    align-items: end;
    border: 3px solid var(--line);
    border-radius: 9px;
    color: #171a38;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    min-height: 110px;
    padding: 8px;
}

.moonlit-collection-copy h2 {
    font-size: 22px;
    margin: 1px 0 5px;
}

.moonlit-collection-copy p {
    line-height: 1.35;
    margin: 0;
}

.support-product-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 10px;
}

.support-product-actions .support-checkout-unavailable {
    padding: 0;
}

.support-owned {
    color: var(--accent-strong);
}

.support-gift-panel > p {
    line-height: 1.4;
    margin: 12px 0 0;
}

.support-gift-counts {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
}

.support-gift-counts span {
    align-items: center;
    background: color-mix(in srgb, var(--sky) 13%, var(--surface));
    border: 2px solid var(--line);
    border-radius: 12px;
    display: flex;
    font-size: 12px;
    gap: 6px;
    justify-content: center;
    min-height: 48px;
    padding: 7px;
    text-align: center;
}

.support-gift-counts strong {
    color: var(--accent-strong);
    font-size: 20px;
}

.support-gift-dialog .rules-card {
    display: grid;
    gap: 12px;
}

.support-gift-dialog .field {
    margin: 0;
}

.support-gift-confirm {
    align-items: flex-start;
    background: color-mix(in srgb, var(--yellow) 16%, var(--surface));
    border: 2px solid var(--line);
    border-radius: 12px;
    display: flex;
    font-size: 13px;
    gap: 9px;
    line-height: 1.4;
    padding: 10px;
}

.support-gift-confirm input {
    flex: 0 0 auto;
    height: 19px;
    margin: 1px 0 0;
    width: 19px;
}

.support-incoming-gift {
    align-items: center;
    border-top: 2px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
}

.support-incoming-gift p {
    line-height: 1.4;
    margin: 4px 0 0;
}

.support-incoming-gift .btn-row {
    flex: 0 0 auto;
    margin: 0;
}

.support-incoming-gift form {
    margin: 0;
}

.support-compact-card {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.support-compact-card h2 {
    font-size: 21px;
    margin: 1px 0 3px;
}

.support-compact-card p {
    margin: 0;
}

.support-badge-preview {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.support-badge-preview > img {
    height: 58px;
    object-fit: contain;
    width: 58px;
}

.support-badges-dialog,
.support-badges-dialog .rules-card {
    max-width: min(94vw, 580px);
    width: min(94vw, 580px);
}

.support-settings-panel h2 {
    margin: 1px 0 0;
}

.support-settings-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.support-settings-form .btn {
    justify-self: end;
    min-width: 150px;
}

.support-settings-saved {
    background: color-mix(in srgb, var(--mint) 35%, var(--surface));
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    padding: 5px 9px;
}

.profile-supporter-badge {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    gap: 6px;
}

.profile-supporter-badge img {
    height: 34px;
    object-fit: contain;
    width: 34px;
}

.profile-support-card {
    align-items: center;
    display: flex;
    gap: 14px;
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-block: 10px !important;
}

.profile-support-card .profile-card-head {
    min-width: 0;
}

@media (max-width: 620px) {
    .profile-support-card {
        align-items: stretch;
        display: grid;
    }

    .profile-support-card .btn-row {
        flex-wrap: nowrap;
    }

    .profile-support-card .btn {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 8px;
    }
}

.supporters-intro {
    align-items: center;
    background: var(--feature-gradient);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 16px;
}

.supporters-view-link {
    background: var(--yellow);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: #25233a;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 900;
    padding: 8px 12px;
    text-decoration: none;
}

.supporters-view-link:hover {
    transform: translateY(-1px);
}

.supporters-head,
.supporter-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(210px, 1fr) 120px 140px;
}

.supporters-head {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    margin: 12px 0 8px;
    overflow: hidden;
    padding: 3px;
}

.supporters-sort-button {
    align-items: center;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    gap: 7px;
    justify-content: space-between;
    min-height: 42px;
    padding: 7px 10px;
    text-decoration: none;
    width: 100%;
}

.supporters-sort-button.active {
    background: var(--surface-3);
    border-color: color-mix(in srgb, var(--line) 65%, transparent);
    color: var(--accent-strong);
}

.supporters-sort-button:hover {
    background: var(--surface-3);
    color: var(--text);
}

.supporters-sort-button [data-support-sort-indicator] {
    align-items: center;
    display: inline-flex;
    font-size: 18px;
    height: 26px;
    justify-content: center;
    width: 24px;
}

.supporter-row {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 0 color-mix(in srgb, var(--line) 13%, transparent);
    margin-bottom: 10px;
    padding: 12px 16px;
}

.supporter-row.private-group {
    background: linear-gradient(135deg, var(--surface), var(--surface-3));
}

.supporter-person {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.supporter-person > div {
    display: grid;
    min-width: 0;
}

.supporter-person a,
.supporter-person strong {
    font-weight: 900;
}

.supporter-person small {
    color: var(--muted);
}

.supporter-avatar,
.private-supporter-avatar {
    height: 52px;
    width: 52px;
}

.supporter-avatar img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.supporter-profile-link {
    border-radius: 20px;
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
}

.supporter-profile-link .user-avatar-frame {
    transition: filter .18s ease, transform .18s ease;
}

.supporter-profile-link:hover .user-avatar-frame,
.supporter-profile-link:focus-visible .user-avatar-frame {
    filter: drop-shadow(0 0 7px color-mix(in srgb, var(--palette-primary) 62%, transparent));
    transform: translateY(-2px) rotate(-1deg);
}

.supporter-profile-link:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 3px;
}

.private-supporter-avatar {
    align-items: center;
    background: #20294f;
    border: 3px solid var(--line);
    border-radius: 50%;
    color: #f8ca78;
    display: flex;
    flex: 0 0 52px;
    font-size: 27px;
    justify-content: center;
}

.supporter-badge-label {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 12px;
    font-weight: 800;
    gap: 4px;
}

.supporter-badge-label img {
    height: 23px;
    object-fit: contain;
    width: 23px;
}

.supporters-album-intro {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 4px 4px;
}

.supporters-album-intro h1 {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1;
    margin: 4px 0 0;
}

.supporters-album-sort {
    margin-bottom: 10px;
}

.supporters-album {
    --supporter-album-cover: #59344f;
    --supporter-album-cover-dark: #34243d;
    --supporter-album-gold: #efca77;
    min-height: 640px;
    overflow: clip;
    overflow-clip-margin: 70px;
    perspective: 1800px;
    position: relative;
}

.supporters-album-cover {
    align-content: center;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, .12) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 75%, rgba(255, 255, 255, .08) 0 2px, transparent 3px),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, .025) 6px),
        var(--supporter-album-cover);
    background-size: 46px 46px, 58px 58px, auto, auto;
    border: 4px solid var(--supporter-album-cover-dark);
    border-radius: 19px 25px 25px 19px;
    box-shadow:
        inset 15px 0 18px rgba(20, 17, 29, .2),
        inset 0 0 0 2px rgba(255, 255, 255, .12),
        0 7px 0 #e6d9b7,
        0 12px 0 var(--supporter-album-cover-dark),
        0 25px 34px rgba(26, 20, 34, .3);
    color: #fffaf0;
    cursor: pointer;
    display: grid;
    gap: 14px;
    height: calc(100% - 36px);
    inset: 0;
    justify-items: center;
    margin: auto;
    max-width: 470px;
    min-height: 530px;
    padding: 32px 34px 26px 64px;
    position: absolute;
    transform: rotateY(0deg);
    transform-origin: 4% 50%;
    transform-style: preserve-3d;
    transition: opacity .85s ease, transform 1.15s cubic-bezier(.22, .72, .2, 1);
    width: min(76vw, 470px);
    z-index: 6;
}

[dir="rtl"] .supporters-album-cover {
    border-radius: 25px 19px 19px 25px;
    box-shadow:
        inset -15px 0 18px rgba(20, 17, 29, .2),
        inset 0 0 0 2px rgba(255, 255, 255, .12),
        0 7px 0 #e6d9b7,
        0 12px 0 var(--supporter-album-cover-dark),
        0 25px 34px rgba(26, 20, 34, .3);
    padding: 32px 64px 26px 34px;
    transform-origin: 96% 50%;
}

.supporters-album-cover-binding {
    background: linear-gradient(90deg, #231827, #74506a 31%, #2a1c30 73%, #120d17);
    border: 2px solid #1c1321;
    border-radius: 29px 10px 10px 29px;
    box-shadow: inset 7px 0 7px rgba(255, 255, 255, .08), inset -8px 0 9px rgba(8, 6, 12, .42), 7px 1px 8px rgba(18, 12, 22, .34);
    inset: -7px auto -9px -14px;
    position: absolute;
    width: 62px;
}

[dir="rtl"] .supporters-album-cover-binding {
    border-radius: 10px 29px 29px 10px;
    inset: -7px -14px -9px auto;
}

.supporters-album-cover-binding::before {
    border-inline-end: 1px dashed color-mix(in srgb, var(--supporter-album-gold) 52%, transparent);
    content: "";
    inset: 17px auto 17px 14px;
    position: absolute;
}

[dir="rtl"] .supporters-album-cover-binding::before {
    inset: 17px 14px 17px auto;
}

.supporters-album-cover-binding > span {
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 35%, rgba(8, 5, 11, .38));
    border-radius: 12px 5px 5px 12px;
    height: 18px;
    inset-inline: 4px 8px;
    position: absolute;
}

.supporters-album-cover-binding > span:nth-child(1) { top: 12%; }
.supporters-album-cover-binding > span:nth-child(2) { top: 36%; }
.supporters-album-cover-binding > span:nth-child(3) { top: 61%; }
.supporters-album-cover-binding > span:nth-child(4) { top: 85%; }

.supporters-album-cover-photo {
    background: #efe3c6;
    border: 7px solid #fff8e7;
    box-shadow: 0 5px 0 rgba(16, 14, 25, .24), 0 10px 22px rgba(16, 14, 25, .22);
    display: block;
    max-width: 330px;
    padding: 4px;
    transform: rotate(-1.2deg);
    width: 92%;
}

[dir="rtl"] .supporters-album-cover-photo {
    transform: rotate(1.2deg);
}

.supporters-album-cover-photo img {
    aspect-ratio: 3 / 2;
    display: block;
    object-fit: cover;
    width: 100%;
}

.supporters-album-cover-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(23px, 4vw, 31px);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(20, 17, 29, .34);
}

.supporters-album-cover-badges {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.supporters-album-cover-badges img {
    filter: drop-shadow(0 4px 2px rgba(20, 17, 29, .36));
    height: 61px;
    object-fit: contain;
    transition: transform .2s ease;
    width: 61px;
}

.supporters-album-cover:hover .supporters-album-cover-badges img:nth-child(odd) {
    transform: translateY(-3px) rotate(-3deg);
}

.supporters-album-cover:hover .supporters-album-cover-badges img:nth-child(even) {
    transform: translateY(-3px) rotate(3deg);
}

.supporters-album-cover-prompt {
    background: var(--supporter-album-gold);
    border: 2px solid var(--supporter-album-cover-dark);
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(20, 17, 29, .24);
    color: #25213b;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 15px;
}

.supporters-album-book {
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, .12) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 75%, rgba(255, 255, 255, .08) 0 2px, transparent 3px),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, .025) 6px),
        var(--supporter-album-cover);
    background-size: 46px 46px, 58px 58px, auto, auto;
    border: 4px solid var(--line);
    border-radius: 18px 10px 10px 18px;
    box-shadow: inset 13px 0 0 var(--supporter-album-cover-dark), 0 10px 0 color-mix(in srgb, var(--line) 24%, transparent);
    opacity: 0;
    padding: 28px 22px 18px 34px;
    pointer-events: none;
    position: relative;
    transform: rotateX(5deg) scale(.94);
    transform-origin: 50% 72%;
    transition: opacity .58s ease .18s, transform .85s cubic-bezier(.2, .75, .2, 1) .15s;
}

[dir="rtl"] .supporters-album-book {
    border-radius: 10px 18px 18px 10px;
    box-shadow: inset -13px 0 0 var(--supporter-album-cover-dark), 0 10px 0 color-mix(in srgb, var(--line) 24%, transparent);
    padding: 28px 34px 18px 22px;
}

.supporters-album-book::before {
    border-inline-end: 1px dashed color-mix(in srgb, var(--supporter-album-gold) 52%, transparent);
    content: "";
    inset-block: 16px;
    inset-inline-start: 19px;
    position: absolute;
}

.supporters-album.is-opening .supporters-album-cover,
.supporters-album.is-open .supporters-album-cover {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20%) rotateY(-156deg) scale(.94);
}

[dir="rtl"] .supporters-album.is-opening .supporters-album-cover,
[dir="rtl"] .supporters-album.is-open .supporters-album-cover {
    transform: translateX(20%) rotateY(156deg) scale(.94);
}

.supporters-album.is-opening .supporters-album-book,
.supporters-album.is-open .supporters-album-book {
    opacity: 1;
    transform: rotateX(0) scale(1);
}

.supporters-album.is-open .supporters-album-book {
    pointer-events: auto;
}

.supporters-album-bookplate {
    align-items: center;
    background: var(--supporter-album-gold);
    border: 3px solid var(--supporter-album-cover-dark);
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--supporter-album-gold) 68%, white);
    color: var(--supporter-album-cover-dark);
    display: flex;
    font-family: Georgia, serif;
    font-size: 11px;
    font-weight: 900;
    height: 32px;
    inset-inline-start: 5px;
    justify-content: center;
    position: absolute;
    top: 42px;
    transform: rotate(-8deg);
    width: 32px;
    z-index: 4;
}

[dir="rtl"] .supporters-album-bookplate {
    transform: rotate(8deg);
}

.supporters-album-paper {
    background:
        linear-gradient(90deg, rgba(64, 47, 58, .08), transparent 8%, transparent 92%, rgba(64, 47, 58, .08)),
        #fff5dc;
    border: 3px solid #2f2941;
    border-radius: 8px 14px 14px 8px;
    box-shadow:
        inset 0 0 30px rgba(112, 81, 47, .12),
        6px 5px 0 #ead8ae,
        10px 9px 0 var(--supporter-album-cover-dark);
    min-height: 560px;
    padding: 28px 28px 24px;
    position: relative;
    transform-style: preserve-3d;
}

[dir="rtl"] .supporters-album-paper {
    border-radius: 14px 8px 8px 14px;
    box-shadow:
        inset 0 0 30px rgba(112, 81, 47, .12),
        -6px 5px 0 #ead8ae,
        -10px 9px 0 var(--supporter-album-cover-dark);
}

.supporters-album-paper::before {
    background: linear-gradient(90deg, transparent, rgba(74, 55, 66, .16), transparent);
    content: "";
    inset-block: 0;
    left: calc(50% - 18px);
    position: absolute;
    width: 36px;
}

.supporters-album-spine {
    display: grid;
    gap: 62px;
    left: calc(50% - 13px);
    place-items: center;
    position: absolute;
    top: 42px;
    z-index: 4;
}

.supporters-album-spine span {
    background: linear-gradient(180deg, #fff2b0, #b98936 58%, #6f481e);
    border: 2px solid #65451f;
    border-radius: 999px;
    box-shadow: 0 2px 0 rgba(47, 41, 65, .28);
    display: block;
    height: 13px;
    width: 28px;
}

.supporters-album-cards {
    display: grid;
    gap: 28px 52px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
    z-index: 2;
}

.supporters-album-paper.turning-next {
    animation: supporterAlbumTurnNext .36s ease-in both;
    pointer-events: none;
    transform-origin: 4% 50%;
}

.supporters-album-paper.turning-previous {
    animation: supporterAlbumTurnPrevious .36s ease-in both;
    pointer-events: none;
    transform-origin: 96% 50%;
}

.supporters-album-paper.arriving-next {
    animation: supporterAlbumArriveNext .44s ease-out both;
    transform-origin: 96% 50%;
}

.supporters-album-paper.arriving-previous {
    animation: supporterAlbumArrivePrevious .44s ease-out both;
    transform-origin: 4% 50%;
}

[dir="rtl"] .supporters-album-paper.turning-next {
    animation-name: supporterAlbumTurnPrevious;
    transform-origin: 96% 50%;
}

[dir="rtl"] .supporters-album-paper.turning-previous {
    animation-name: supporterAlbumTurnNext;
    transform-origin: 4% 50%;
}

[dir="rtl"] .supporters-album-paper.arriving-next {
    animation-name: supporterAlbumArrivePrevious;
    transform-origin: 4% 50%;
}

[dir="rtl"] .supporters-album-paper.arriving-previous {
    animation-name: supporterAlbumArriveNext;
    transform-origin: 96% 50%;
}

@keyframes supporterAlbumTurnNext {
    from { opacity: 1; transform: rotateY(0) translateX(0); }
    to { opacity: 0; transform: rotateY(-62deg) translateX(-7%); }
}

@keyframes supporterAlbumTurnPrevious {
    from { opacity: 1; transform: rotateY(0) translateX(0); }
    to { opacity: 0; transform: rotateY(62deg) translateX(7%); }
}

@keyframes supporterAlbumArriveNext {
    from { opacity: 0; transform: rotateY(55deg) translateX(7%); }
    to { opacity: 1; transform: rotateY(0) translateX(0); }
}

@keyframes supporterAlbumArrivePrevious {
    from { opacity: 0; transform: rotateY(-55deg) translateX(-7%); }
    to { opacity: 1; transform: rotateY(0) translateX(0); }
}

.supporter-album-card {
    --supporter-card-accent: #d36686;
    background:
        radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--supporter-card-accent) 18%, transparent) 0 28px, transparent 29px),
        #fffdf6;
    border: 2px solid #2f2941;
    border-radius: 16px;
    box-shadow: 0 6px 0 color-mix(in srgb, var(--supporter-card-accent) 42%, #2f2941);
    color: #2f2941;
    cursor: pointer;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: 230px;
    overflow: visible;
    padding: 10px;
    position: relative;
    transition: box-shadow .18s ease, transform .18s ease;
}

.supporters-album.is-opening .supporter-album-card:not([hidden]) {
    animation: supporterCardSettle .48s cubic-bezier(.2, .82, .2, 1) .42s both;
}

.supporters-album.is-opening .supporter-album-card:not([hidden]):nth-child(even) {
    animation-delay: .48s;
}

@keyframes supporterCardSettle {
    from { opacity: 0; transform: translateY(16px) rotate(-.7deg) scale(.97); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.supporter-album-card[hidden] {
    display: none;
}

.supporter-album-card.tier-table-friend { --supporter-card-accent: #5ea6b8; }
.supporter-album-card.tier-clubhouse-helper { --supporter-card-accent: #61ad82; }
.supporter-album-card.tier-clubhouse-keeper { --supporter-card-accent: #8a68bd; }
.supporter-album-card.private-group { --supporter-card-accent: #6977aa; }

.supporter-album-card::after {
    border: 2px dotted color-mix(in srgb, var(--supporter-card-accent) 72%, #2f2941);
    border-radius: 11px;
    content: "";
    inset: 5px;
    pointer-events: none;
    position: absolute;
}

.supporter-album-card::before {
    align-items: center;
    background: var(--supporter-album-gold);
    border: 2px solid #2f2941;
    border-radius: 50%;
    color: #2f2941;
    content: "✦";
    display: flex;
    font-size: 19px;
    height: 38px;
    inset-block-start: 50%;
    inset-inline-end: 14px;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: translateY(-50%) rotate(-18deg) scale(.2);
    width: 38px;
    z-index: 6;
}

.supporter-album-card:active {
    transform: translateY(3px) scale(.985);
}

.supporters-album.is-open .supporter-album-card.is-picked {
    animation: supporterCardPicked .62s cubic-bezier(.2, .82, .2, 1);
    z-index: 8;
}

.supporters-album.is-open .supporter-album-card.is-picked::before {
    animation: supporterCardSeal .62s cubic-bezier(.2, .82, .2, 1);
}

@keyframes supporterCardPicked {
    0%, 100% { box-shadow: 0 6px 0 color-mix(in srgb, var(--supporter-card-accent) 42%, #2f2941); transform: translateY(0) rotate(0); }
    38% { box-shadow: 0 18px 14px rgba(47, 41, 65, .28); transform: translateY(-11px) rotate(-1deg) scale(1.025); }
    66% { transform: translateY(-4px) rotate(.4deg) scale(1.012); }
}

@keyframes supporterCardSeal {
    0%, 18%, 100% { opacity: 0; transform: translateY(-50%) rotate(-18deg) scale(.2); }
    42%, 72% { opacity: 1; transform: translateY(-50%) rotate(8deg) scale(1); }
}

.supporter-album-card-topline {
    align-items: center;
    color: color-mix(in srgb, var(--supporter-card-accent) 65%, #2f2941);
    display: flex;
    font-size: 9px;
    font-weight: 1000;
    grid-column: 1 / -1;
    justify-content: space-between;
    letter-spacing: .08em;
    padding: 0 5px 7px;
}

.supporter-album-portrait {
    align-items: center;
    background: color-mix(in srgb, var(--supporter-card-accent) 17%, #fffdf6);
    border: 2px solid #2f2941;
    border-radius: 13px;
    display: flex;
    justify-content: center;
    min-height: 116px;
    padding: 9px;
}

.supporter-album-portrait > a {
    display: block;
}

.supporter-album-avatar {
    height: 88px;
    width: 88px;
}

.supporter-album-avatar img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.supporter-album-private-mark {
    align-items: center;
    background: #20294f;
    border: 3px solid #2f2941;
    border-radius: 50%;
    color: #f8ca78;
    display: flex;
    font-size: 45px;
    height: 84px;
    justify-content: center;
    width: 84px;
}

.supporter-album-identity {
    align-content: center;
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 8px 9px;
}

.supporter-album-identity > a,
.supporter-album-identity > strong {
    color: #2f2941;
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    overflow-wrap: anywhere;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.supporter-album-identity > span {
    align-items: center;
    color: #655b6c;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    gap: 6px;
}

.supporter-album-identity img {
    filter: drop-shadow(0 3px 2px rgba(47, 41, 65, .24));
    height: 50px;
    object-fit: contain;
    width: 50px;
}

.supporter-album-stats {
    border-top: 2px solid color-mix(in srgb, var(--supporter-card-accent) 44%, #2f2941);
    display: grid;
    gap: 7px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
    margin: 10px 3px 1px;
    padding-top: 8px;
}

.supporter-album-stats div {
    display: grid;
    gap: 1px;
}

.supporter-album-stats dt {
    color: #716679;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.supporter-album-stats dd {
    font-size: 16px;
    font-weight: 1000;
    margin: 0;
}

.supporter-album-empty {
    align-items: center;
    color: #655b6c;
    display: grid;
    grid-column: 1 / -1;
    justify-items: center;
    min-height: 470px;
    place-content: center;
    text-align: center;
}

.supporter-album-empty span {
    color: #b68c3f;
    font-size: 60px;
}

.supporters-album-controls {
    align-items: center;
    color: #fff8ec;
    display: grid;
    gap: 12px;
    grid-template-columns: 44px minmax(120px, auto) 44px;
    justify-content: center;
    padding-top: 17px;
}

.supporters-album-controls button {
    align-items: center;
    background: var(--supporter-album-gold);
    border: 2px solid var(--line);
    border-radius: 50%;
    color: #2f2941;
    cursor: pointer;
    display: flex;
    font-size: 28px;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
}

.supporters-album-controls button:disabled {
    cursor: default;
    opacity: .38;
}

.supporters-album-controls span {
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.supporters-album-status {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.supporters-album-controls .supporters-album-status > button {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--supporter-album-gold);
    font-size: 12px;
    height: auto;
    min-height: 26px;
    padding: 2px 7px;
    text-decoration: underline;
    text-underline-offset: 3px;
    width: auto;
}

@media (max-width: 700px) {
    .support-current {
        min-width: 0;
    }

    .support-social-grid {
        grid-template-columns: 1fr;
    }

    .support-social-card {
        gap: 8px;
        grid-template-columns: 58px minmax(0, 1fr) auto;
        padding: 7px 9px;
    }

    .support-social-card > img {
        height: 58px;
        width: 58px;
    }

    .support-social-card strong {
        font-size: 15px;
    }

    .support-social-card .btn {
        min-height: 38px;
        padding: 7px 10px;
    }

    .moonlit-collection-panel {
        grid-template-columns: 1fr;
    }

    .supporter-row {
        grid-template-columns: 1fr 1fr;
    }

    .supporters-head {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .supporter-person {
        grid-column: 1 / -1;
    }

    .supporter-row > [data-label] {
        display: grid;
        gap: 3px;
    }

    .supporter-row > [data-label]:before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
    }

    .supporters-album-book {
        padding: 22px 13px 15px 25px;
    }

    [dir="rtl"] .supporters-album-book {
        padding: 22px 25px 15px 13px;
    }

    .supporters-album-cover {
        height: calc(100% - 30px);
        min-height: 545px;
        width: min(84vw, 420px);
    }

    .supporters-album-paper {
        min-height: 550px;
        padding: 18px 14px;
    }

    .supporters-album-paper::before,
    .supporters-album-spine {
        display: none;
    }

    .supporters-album-cards {
        gap: 18px;
        grid-template-columns: 1fr;
    }

    .supporter-album-card {
        min-height: 245px;
    }
}

@media (max-width: 520px) {
    .support-page .brand,
    .supporters-page .brand {
        gap: 0;
    }

    .support-page .brand > img,
    .supporters-page .brand > img {
        display: none;
    }

    .support-page .brand-title,
    .supporters-page .brand-title {
        font-size: 16px;
    }

    .support-page .brand-subtitle,
    .supporters-page .brand-subtitle {
        font-size: 10px;
    }

    .support-hero {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .support-current {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        text-align: start;
        width: 100%;
    }

    .support-amount-options {
        grid-template-columns: 1fr;
    }

    .support-amount-choice {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 96px;
        padding: 5px;
        text-align: center;
    }

    .support-amount-choice img {
        height: 58px;
        width: 58px;
    }

    .support-checkout-row .btn {
        width: 100%;
    }

    .moonlit-collection-panel {
        gap: 10px;
    }

    .moonlit-pack-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .moonlit-palette-chip {
        grid-column: span 1;
    }

    .collection-preview-dialog .rules-card {
        padding-inline: 12px;
    }

    .collection-preview-nav {
        height: 42px;
        width: 42px;
    }

    .collection-preview-nav.previous {
        inset-inline-start: 6px;
    }

    .collection-preview-nav.next {
        inset-inline-end: 6px;
    }

    .moonlit-frame-preview {
        min-height: min(62vh, 470px);
        padding: 18px 52px;
    }

    .moonlit-frame-preview-grid {
        gap: 8px;
    }

    .moonlit-frame-preview-card {
        gap: 7px;
        padding: 11px 5px 8px;
    }

    .moonlit-frame-preview-card:last-child {
        width: calc(50% - 4px);
    }

    .moonlit-frame-preview-card figcaption {
        font-size: 11px;
    }

    .moonlit-collection-frame-avatar {
        height: clamp(58px, 18vw, 78px);
        margin: 10px;
        width: clamp(58px, 18vw, 78px);
    }

    .moonlit-collection-copy h2 {
        font-size: 19px;
    }

    .moonlit-palette-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .moonlit-palette-preview span {
        min-height: 84px;
    }

    .support-compact-card {
        align-items: flex-start;
        padding: 12px;
    }

    .support-gift-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-incoming-gift {
        align-items: stretch;
        flex-direction: column;
    }

    .support-incoming-gift .btn-row,
    .support-incoming-gift form,
    .support-incoming-gift .btn {
        width: 100%;
    }

    .support-settings-form .btn {
        justify-self: stretch;
    }

    .support-badge-preview > strong {
        display: none;
    }

    .support-tier-grid {
        grid-template-columns: 1fr 1fr;
    }

    .supporters-head {
        gap: 6px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 3px;
    }

    .supporters-sort-button {
        font-size: 13px;
        gap: 3px;
        min-height: 44px;
        padding: 6px;
    }

    .supporters-sort-button [data-support-sort-indicator] {
        font-size: 17px;
        width: 18px;
    }

    .supporters-intro,
    .supporters-album-intro {
        align-items: flex-start;
        gap: 10px;
    }

    .supporters-view-link {
        font-size: 11px;
        padding: 7px 9px;
    }

    .supporters-album-intro h1 {
        font-size: 22px;
    }

    .supporters-album-book {
        border-radius: 13px 7px 7px 13px;
    }

    [dir="rtl"] .supporters-album-book {
        border-radius: 7px 13px 13px 7px;
    }

    .supporters-album-cover {
        gap: 11px;
        padding: 26px 22px 22px 55px;
        width: calc(100% - 22px);
    }

    [dir="rtl"] .supporters-album-cover {
        padding: 26px 55px 22px 22px;
    }

    .supporters-album-cover-badges {
        gap: 4px;
    }

    .supporters-album-cover-badges img {
        height: 52px;
        width: 52px;
    }

    .supporter-album-card {
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 9px;
    }

    .supporter-album-avatar {
        height: 80px;
        width: 80px;
    }

    .supporter-album-identity > a,
    .supporter-album-identity > strong {
        font-size: 19px;
    }

    .supporter-album-identity img {
        height: 46px;
        width: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .supporters-album-cover,
    .supporters-album-book,
    .supporters-album-cover-badges img,
    .supporter-album-card {
        transition-duration: 0s;
        transition-delay: 0s;
    }

    .supporters-album-paper.turning-next,
    .supporters-album-paper.turning-previous,
    .supporters-album-paper.arriving-next,
    .supporters-album-paper.arriving-previous,
    .supporters-album.is-opening .supporter-album-card:not([hidden]),
    .supporters-album.is-open .supporter-album-card.is-picked,
    .supporters-album.is-open .supporter-album-card.is-picked::before {
        animation: none;
    }
}

.game-status {
    align-items: center;
    background: var(--status-bg);
    border: 3px solid var(--status-text);
    border-radius: 8px;
    box-shadow: 0 8px 0 rgba(37, 49, 74, .14);
    color: var(--status-text);
    display: grid;
    gap: 10px;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    margin: 0 auto 16px;
    max-width: 620px;
    padding: 10px;
}

html[data-theme="dark"] .game-player-card.active {
    color: var(--status-text);
}

html[data-theme="dark"] .game-player-card.active strong,
html[data-theme="dark"] .game-player-card.active span {
    color: var(--status-text);
}

.game-status > img {
    aspect-ratio: 1;
    object-fit: contain;
    width: 62px;
}

.game-bot-difficulty {
    display: inline;
    font: inherit;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.game-status-line {
    align-items: start;
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 2px;
}

.turn-callout {
    animation: turn-callout-pop .22s ease-out both, turn-callout-pulse 1.25s ease-in-out infinite;
    background: var(--accent-strong);
    border: 2px solid var(--status-text);
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .14);
    color: var(--accent-strong-text);
    display: none;
    font-size: 14px;
    font-weight: 900;
    justify-content: center;
    line-height: 1;
    margin-top: 0;
    min-height: 32px;
    max-width: 100%;
    padding: 8px 11px;
    white-space: nowrap;
    width: 160px;
}

.game-status .turn-callout.hidden {
    display: none !important;
}

.game-status-actions {
    align-items: center;
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.game-scale-control { position: relative; flex: 0 0 auto; }
.game-scale-control[hidden] { display: none; }
.game-scale-summary { min-width: 54px; padding: 6px 8px; list-style: none; cursor: pointer; font-size: 12px; }
.game-scale-summary::-webkit-details-marker { display: none; }
.game-scale-options { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); display: grid; gap: 4px; min-width: 92px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 18px #0004; z-index: 30; }
.game-scale-options button { min-height: 44px; padding: 6px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.game-scale-options button[aria-pressed="true"] { background: var(--sky); color: var(--ink); border-color: var(--line); }
.game-scale-summary:focus-visible, .game-scale-options button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.game-status:has(.game-scale-control[open]) { position: relative; z-index: 30; }
@media (max-width: 779px), (max-height: 499px) {
    .game-scale-control { display: none; }
}
@media (min-width: 780px) and (max-height: 820px) {
    .game-status-actions:has(.game-scale-control) { flex-wrap: wrap; }
}

.move-timer,
.game-tool-button {
    align-items: center;
    background: rgba(255, 255, 255, .88);
    border: 2px solid var(--status-text);
    border-radius: 8px;
    color: var(--status-text);
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    min-height: 40px;
}

.move-timer {
    min-width: 54px;
    padding: 6px 8px;
    position: relative;
    transform-origin: center;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    z-index: 2;
}

.move-timer.inactive {
    background: color-mix(in srgb, var(--status-text) 72%, transparent);
    color: color-mix(in srgb, var(--status-bg) 80%, #ffffff);
    opacity: .58;
}

.game-status.turn-you .move-timer.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.game-status.turn-you .move-timer.warning-1 {
    background: #ffe0eb;
    color: #ef476f;
    transform: scale(1.08);
}

.game-status.turn-you .move-timer.warning-2 {
    background: #ffc8d8;
    color: #e11d48;
    transform: scale(1.16);
}

.game-status.turn-you .move-timer.warning-3 {
    background: #ff9fb7;
    color: #be123c;
    transform: scale(1.25);
}

.game-status.turn-you .move-timer.warning-4 {
    background: var(--danger);
    border-color: var(--toast-text);
    color: var(--toast-text);
    transform: scale(1.34);
}

.game-status-actions .move-timer[data-display-mode="ring"] {
    flex: 0 0 44px;
}

.move-timer[data-display-mode="ring"] {
    --move-timer-progress-deg: 0deg;
    --move-timer-ring-color: #48d6f5;
    background: transparent;
    border: 0;
    box-shadow: none;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    overflow: visible;
    padding: 0;
    transform: none;
    width: 44px;
}

.move-timer[data-display-mode="ring"].inactive {
    background: transparent;
    opacity: .52;
}

.move-timer-ring {
    align-items: center;
    background:
        conic-gradient(var(--move-timer-ring-color) var(--move-timer-progress-deg), rgba(255, 255, 255, .42) 0),
        radial-gradient(circle, rgba(255, 255, 255, .94) 56%, rgba(255, 215, 111, .92) 57% 72%, var(--status-text) 73%);
    border: 2px solid var(--status-text);
    border-radius: 50%;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .16);
    display: inline-flex;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 44px;
}

.move-timer-ring::before {
    background: rgba(255, 251, 232, .9);
    border: 2px solid rgba(37, 49, 74, .18);
    border-radius: 50%;
    content: "";
    inset: 5px;
    position: absolute;
}

.move-timer-clock {
    display: block;
    height: 34px;
    position: relative;
    width: 34px;
    z-index: 1;
}

.move-timer-label {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.game-status.turn-you .move-timer[data-display-mode="ring"].danger,
.game-status.turn-you .move-timer[data-display-mode="ring"].warning-1,
.game-status.turn-you .move-timer[data-display-mode="ring"].warning-2,
.game-status.turn-you .move-timer[data-display-mode="ring"].warning-3,
.game-status.turn-you .move-timer[data-display-mode="ring"].warning-4 {
    background: transparent;
    border-color: transparent;
    color: inherit;
    transform: none;
}

.game-status.turn-you .move-timer[data-display-mode="ring"].warning-1 {
    --move-timer-ring-color: #ff8ab1;
}

.game-status.turn-you .move-timer[data-display-mode="ring"].warning-2 {
    --move-timer-ring-color: #ff6f9e;
}

.game-status.turn-you .move-timer[data-display-mode="ring"].warning-3,
.game-status.turn-you .move-timer[data-display-mode="ring"].warning-4 {
    --move-timer-ring-color: #ff3f7f;
}

.move-timer[data-display-mode="ring"].is-warning .move-timer-ring {
    box-shadow: 0 4px 0 rgba(37, 49, 74, .16), 0 0 0 4px rgba(255, 111, 158, .28);
}

.move-timer[data-display-mode="ring"].is-warning .move-timer-clock {
    animation: move-timer-warning-shake .2s linear infinite;
}

@keyframes move-timer-warning-shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-1px) rotate(-5deg);
    }
    75% {
        transform: translateX(1px) rotate(5deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .move-timer[data-display-mode="ring"].is-warning .move-timer-clock {
        animation: none;
    }
}

.game-toast {
    background: var(--toast-bg);
    border: 2px solid var(--toast-text);
    border-radius: 999px;
    box-shadow: 0 10px 0 rgba(0, 0, 0, .18);
    color: var(--toast-text);
    font-size: 14px;
    font-weight: 900;
    left: 50%;
    max-width: min(92vw, 420px);
    padding: 10px 15px;
    pointer-events: none;
    position: fixed;
    text-align: center;
    top: 112px;
    transform: translateX(-50%);
    z-index: 80;
}

.game-toast.hidden {
    display: none;
}

.game-tool-button {
    cursor: pointer;
    min-width: 40px;
    padding: 5px 7px;
}

.game-tool-button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.game-pause-button {
    gap: 4px;
}

.game-pause-button.active {
    background: #fff0a8;
    border-color: #8a5b00;
    color: #5b3b00;
}

body.game-pause-active::after {
    background: rgba(20, 27, 43, .42);
    content: "";
    inset: 0;
    position: fixed;
    z-index: 89;
}

.game-pause-panel {
    align-items: center;
    background: var(--status-bg);
    border: 3px solid var(--accent-strong);
    border-radius: 16px;
    box-shadow: 0 14px 0 rgba(20, 27, 43, .26);
    color: var(--status-text);
    display: grid;
    gap: 9px;
    left: 50%;
    max-width: min(92vw, 430px);
    padding: 18px;
    position: fixed;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 90;
}

.game-pause-panel.hidden {
    display: none;
}

.game-pause-panel > strong {
    font-size: 20px;
}

.game-pause-panel > p {
    font-weight: 700;
    margin: 0;
}

.game-pause-panel > b {
    color: var(--accent-strong);
    font-size: 34px;
    font-variant-numeric: tabular-nums;
}

.game-pause-panel > div {
    display: flex;
    gap: 9px;
    justify-content: center;
}

.game-pause-action {
    background: var(--status-bg);
    border: 2px solid var(--status-text);
    border-radius: 10px;
    color: var(--status-text);
    cursor: pointer;
    font-weight: 900;
    min-height: 44px;
    padding: 8px 16px;
}

.game-pause-action.accept,
.game-pause-action.resume {
    background: var(--accent-strong);
    color: var(--accent-strong-text);
}

.game-tool-button img {
    aspect-ratio: 1;
    display: block;
    height: 25px;
    object-fit: contain;
    width: 25px;
}

.game-tool-button.leave {
    background: var(--danger-bg);
    color: var(--danger-text);
    min-width: 58px;
}

.game-player-strip {
    direction: ltr;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    margin: 0 auto 16px;
    max-width: 620px;
}

.game-player-card {
    align-items: center;
    background: var(--status-bg);
    border: 3px solid var(--status-text);
    border-radius: 8px;
    box-shadow: none;
    color: var(--status-text);
    container-type: inline-size;
    display: grid;
    gap: 10px;
    grid-template-columns: 54px minmax(0, 1fr) 38px;
    isolation: isolate;
    overflow: hidden;
    padding: 8px;
    position: relative;
}

.game-player-body {
    min-width: 0;
}

.game-player-card-frame {
    display: none !important;
}

.game-player-card.active {
    background: var(--status-bg);
    border-color: var(--status-text);
    box-shadow: none;
}

.game-player-strip:has(.game-player-card.active) .game-player-card:not(.active) {
    filter: brightness(.42) saturate(.55);
}

.game-player-card.self:not(.active) {
    box-shadow: none;
}

.game-player-card.game-player-card-royal-inlay {
    background:
        radial-gradient(circle at 12% 18%, rgba(52, 190, 180, .25), transparent 28%),
        linear-gradient(145deg, #fff7df, #e8f0e8);
    border-color: #ad7630;
    box-shadow: inset 0 0 0 2px #e7bd62;
    color: #34231f;
    --game-player-card-frame: url("../images/collectibles/personalization/royal-inlay-player-card.webp");
    --game-player-card-frame-slice: 138 70 120 462 fill;
    --game-player-card-frame-width: 14px 24px 14px 82px;
}

.game-player-card.game-player-card-royal-inlay .game-player-card-frame,
.game-player-card.game-player-card-neon-arcade .game-player-card-frame {
    display: block !important;
    border-color: transparent;
    border-image-repeat: stretch;
    border-image-slice: var(--game-player-card-frame-slice);
    border-image-source: var(--game-player-card-frame);
    border-image-width: var(--game-player-card-frame-width);
    border-style: solid;
    border-width: var(--game-player-card-frame-width);
    box-sizing: border-box;
    inset: 2px;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.game-player-card.game-player-card-royal-inlay > *,
.game-player-card.game-player-card-neon-arcade > * {
    position: relative;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    > .game-player-avatar {
    z-index: auto;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    > :is(.game-player-body, .game-player-marker) {
    z-index: 2;
}

.game-player-card.game-player-card-royal-inlay .game-player-avatar img {
    border: 0;
    box-shadow: none;
}

.game-player-card.game-player-card-royal-inlay .game-player-marker {
    border-color: #ad7630;
    box-shadow: none;
}

.game-player-card.game-player-card-neon-arcade .game-player-avatar img {
    border: 0;
    box-shadow: none;
}

/* Neon's authored portrait aperture sits farther right than Royal's. */
.game-player-card.game-player-card-neon-arcade .game-player-avatar {
    transform: translateX(6px);
}

.game-player-card.game-player-card-neon-arcade .game-player-marker {
    border-color: #4ee4e8;
    box-shadow: none;
}

.game-player-card.game-player-card-royal-inlay span {
    color: #5d5346;
}

.game-player-card.game-player-card-royal-inlay strong,
.game-player-card.game-player-card-royal-inlay .game-player-name-row {
    color: #34231f;
}

html[data-theme="dark"] .game-player-card.active.game-player-card-royal-inlay,
html[data-theme="dark"] .game-player-card.active.game-player-card-royal-inlay strong,
html[data-theme="dark"] .game-player-card.active.game-player-card-royal-inlay .game-player-name-row {
    color: #34231f;
}

html[data-theme="dark"] .game-player-card.active.game-player-card-royal-inlay span {
    color: #5d5346;
}

.game-player-card.game-player-card-neon-arcade {
    background:
        linear-gradient(90deg, rgba(65, 231, 231, .16), transparent 28% 72%, rgba(255, 103, 125, .2)),
        linear-gradient(145deg, #172852, #11172f);
    border-color: #4ee4e8;
    box-shadow:
        inset 0 0 0 2px rgba(255, 113, 125, .72),
        0 0 12px rgba(55, 220, 231, .32);
    color: #fff6d8;
    --game-player-card-frame: url("../images/collectibles/personalization/neon-arcade-player-card.webp");
    --game-player-card-frame-slice: 115 92 105 470 fill;
    --game-player-card-frame-width: 13px 30px 13px 82px;
}

.game-player-card.game-player-card-neon-arcade strong,
.game-player-card.game-player-card-neon-arcade span {
    color: #fff6d8;
}

.game-player-card img {
    aspect-ratio: 1;
    border: 2px solid var(--status-text);
    border-radius: 999px;
    object-fit: cover;
    width: 54px;
}

.game-player-avatar {
    justify-self: center;
    width: 54px;
}

.game-player-card .user-gender-marker {
    display: inline-flex;
    overflow: visible;
}

.game-player-card .bot-player-image {
    background: var(--paper-warm);
    border-radius: 12px;
    object-fit: contain;
    padding: 2px;
    width: 54px;
}

.game-player-card strong,
.game-player-card span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-player-card strong {
    font-size: 14px;
    line-height: 1.2;
}

.game-player-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.game-player-marker {
    align-items: center;
    background: var(--player-color, var(--surface-2));
    border: 2px solid var(--status-text);
    border-radius: 999px;
    color: var(--player-ink, var(--status-text));
    display: flex;
    font-size: 16px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    justify-self: center;
    max-width: 100%;
    width: 38px;
}

.game-player-marker.x-mark {
    background: var(--danger-bg);
    color: var(--danger);
}

.game-player-marker.o-mark {
    background: var(--status-turn-you-bg);
    color: var(--accent-strong);
}

.game-player-card.game-player-card-royal-inlay,
.game-player-card.game-player-card-neon-arcade {
    grid-template-columns: 68px minmax(0, 1fr);
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    .game-player-body {
    padding-inline-end: 52px;
    padding-inline-start: 12px;
    position: relative;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    .game-player-name-row {
    box-sizing: border-box;
    overflow: visible;
    padding-inline-end: calc(clamp(1.6rem, 20cqi, 2.8rem) + .35rem);
    width: 100%;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    img.game-player-crest {
    inset-inline-end: 52px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.board-wrap > .game-player-strip:is(
    [data-player-count="3"],
    [data-player-count="4"]
) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    .game-player-marker {
    aspect-ratio: 1;
    height: 34px;
    inset-inline-end: 10px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade):has(
    > .game-player-marker:empty
) .game-player-body {
    padding-inline-end: 0;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade):has(
    > .game-player-marker:empty
) img.game-player-crest {
    inset-inline-end: 0;
}

.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    .game-player-avatar,
.game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
    .game-player-avatar img {
    width: 46px;
}

.ttt-board {
    animation: draw-board .42s ease-out both;
    direction: ltr;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(var(--ttt-size, 3), minmax(58px, 1fr));
    margin: 0 auto;
    max-width: var(--ttt-max, 340px);
    width: min(78vw, 100%);
}

.ttt-cell {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .82);
    border: 4px solid var(--status-text);
    border-radius: 8px;
    box-shadow: none;
    color: var(--status-text);
    cursor: pointer;
    direction: ltr;
    display: flex;
    font-size: 58px;
    font-weight: 900;
    justify-content: center;
    transform: scale(.98);
}

.ttt-cell.filled {
    animation: pop .22s ease-out forwards;
}

.ttt-cell.x-mark {
    color: var(--danger);
}

.ttt-cell.o-mark {
    color: var(--accent-strong);
}

.ttt-board[data-size="4"] {
    gap: 7px;
    width: min(90vw, 100%);
}

.ttt-board[data-size="4"] .ttt-cell {
    border-width: 3px;
    font-size: 46px;
}

.ttt-cell:disabled,
.bh-cell:disabled {
    cursor: default;
}

.ttt-cell:disabled:not(.filled),
.bh-cell:disabled:not(.black-hole) {
    transform: none;
}

.ultimate-ttt-page {
    overflow-x: hidden;
}

.ultimate-board {
    --ultimate-gap: clamp(5px, 1.3vw, 9px);
    animation: ultimate-board-arrive .55s cubic-bezier(.2, .85, .25, 1) both;
    background: color-mix(in srgb, var(--status-text) 90%, var(--palette-secondary));
    border: 3px solid var(--status-text);
    border-radius: 12px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .2);
    direction: ltr;
    display: grid;
    gap: var(--ultimate-gap);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 auto 32px;
    max-width: 650px;
    padding: var(--ultimate-gap);
    width: 100%;
}

.ultimate-mini-board {
    aspect-ratio: 1;
    background: color-mix(in srgb, var(--paper-warm) 92%, var(--palette-primary));
    border: 3px solid transparent;
    border-radius: 9px;
    display: grid;
    gap: clamp(1px, .4vw, 3px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    opacity: .54;
    overflow: hidden;
    padding: clamp(3px, .8vw, 6px);
    position: relative;
    transform: scale(.96);
    transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease, transform .2s ease;
}

.ultimate-mini-board:nth-child(2) { animation-delay: .04s; }
.ultimate-mini-board:nth-child(3) { animation-delay: .08s; }
.ultimate-mini-board:nth-child(4) { animation-delay: .12s; }
.ultimate-mini-board:nth-child(5) { animation-delay: .16s; }
.ultimate-mini-board:nth-child(6) { animation-delay: .20s; }
.ultimate-mini-board:nth-child(7) { animation-delay: .24s; }
.ultimate-mini-board:nth-child(8) { animation-delay: .28s; }
.ultimate-mini-board:nth-child(9) { animation-delay: .32s; }

.ultimate-mini-board.legal {
    opacity: 1;
    transform: scale(1);
}

.ultimate-mini-board.forced {
    animation: ultimate-destination-pulse 1.15s ease-in-out infinite;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 42%, transparent), 0 7px 0 rgba(37, 49, 74, .15);
    z-index: 2;
}

.ultimate-board.free-choice .ultimate-mini-board.legal {
    border-color: color-mix(in srgb, var(--palette-secondary) 72%, var(--line));
}

.ultimate-cell {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .72);
    border: 1.5px solid color-mix(in srgb, var(--status-text) 76%, transparent);
    border-radius: clamp(2px, .6vw, 5px);
    color: var(--status-text);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: clamp(13px, 4.2vw, 30px);
    font-weight: 900;
    justify-content: center;
    line-height: 1;
    min-width: 0;
    padding: 0;
    transition: background .15s ease, transform .15s ease;
}

.ultimate-cell:not(:disabled):hover {
    background: color-mix(in srgb, white 68%, var(--palette-secondary));
    transform: translateY(-2px);
}

.ultimate-cell.x-mark,
.ultimate-board-claim.x-mark {
    color: var(--danger);
}

.ultimate-cell.o-mark,
.ultimate-board-claim.o-mark {
    color: var(--accent-strong);
}

.ultimate-cell.just-played {
    animation: ultimate-mark-land .36s cubic-bezier(.2, 1.35, .4, 1) both;
}

.ultimate-board-claim {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    display: none;
    font-size: clamp(42px, 13vw, 96px);
    font-weight: 1000;
    inset: 0;
    justify-content: center;
    line-height: 1;
    position: absolute;
    text-shadow: 0 4px 0 rgba(37, 49, 74, .13);
    z-index: 4;
}

.ultimate-mini-board.closed .ultimate-board-claim {
    display: flex;
}

.ultimate-mini-board.x-claimed .ultimate-board-claim {
    color: var(--danger);
}

.ultimate-mini-board.o-claimed .ultimate-board-claim {
    color: var(--accent-strong);
}

.ultimate-mini-board.drawn .ultimate-board-claim {
    color: var(--muted);
}

.ultimate-mini-board.just-claimed .ultimate-board-claim {
    animation: ultimate-claim-land .55s cubic-bezier(.2, 1.25, .35, 1) both;
}

@keyframes ultimate-board-arrive {
    from { opacity: 0; transform: translateY(18px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ultimate-destination-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.025); }
}

@keyframes ultimate-mark-land {
    0% { opacity: 0; transform: rotate(-16deg) scale(.2); }
    100% { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes ultimate-claim-land {
    0% { opacity: 0; transform: rotate(-12deg) scale(1.7); }
    70% { opacity: 1; transform: rotate(3deg) scale(.92); }
    100% { opacity: 1; transform: rotate(0) scale(1); }
}

.roll-call-page {
    overflow-x: hidden;
}

.roll-call-page .turn-callout {
    background: #2563eb;
    border-color: var(--status-text);
    color: #ffffff !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .22);
}

.roll-call-board {
    --roll-call-gap: clamp(5px, 1.4vw, 9px);
    --roll-call-label: clamp(38px, 9vw, 54px);
    animation: roll-call-board-arrive .55s cubic-bezier(.2, .85, .25, 1) both;
    background: color-mix(in srgb, var(--paper-warm) 94%, var(--palette-secondary));
    border: 3px solid var(--status-text);
    border-radius: 12px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .2);
    direction: ltr;
    display: grid;
    gap: var(--roll-call-gap);
    grid-template-columns: var(--roll-call-label) repeat(4, minmax(0, 1fr));
    margin: 0 auto 32px;
    max-width: 610px;
    padding: var(--roll-call-gap);
    width: 100%;
}

.roll-call-corner,
.roll-call-line,
.roll-call-cell {
    align-items: center;
    border: 2px solid var(--status-text);
    display: flex;
    font-family: inherit;
    justify-content: center;
    min-width: 0;
}

.roll-call-corner {
    background: var(--surface);
    border-radius: 8px;
    color: var(--muted);
    font-size: 21px;
    font-weight: 900;
}

.roll-call-line {
    background: color-mix(in srgb, var(--surface) 76%, var(--palette-secondary));
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    flex-direction: column;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 1000;
    gap: 0;
    line-height: 1;
    padding: 4px;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.roll-call-line small {
    color: var(--accent-strong);
    font-size: 11px;
    margin-top: 2px;
}

.roll-call-line:not(:disabled):hover,
.roll-call-line:not(:disabled):focus-visible {
    background: color-mix(in srgb, var(--surface) 58%, var(--palette-primary));
    box-shadow: none;
    transform: translateY(-2px);
}

.roll-call-line.called {
    animation: roll-call-label-pulse .85s ease-in-out infinite alternate;
    background: var(--palette-primary);
    color: var(--status-text);
}

.roll-call-cell {
    aspect-ratio: 1;
    background-color: rgba(255, 255, 255, .76);
    border-radius: 8px;
    color: var(--status-text);
    cursor: pointer;
    font-size: clamp(32px, 10vw, 66px);
    font-weight: 1000;
    line-height: 1;
    padding: 0;
    position: relative;
    transition: background .17s ease, box-shadow .17s ease, transform .17s ease;
}

.roll-call-cell.called {
    background: color-mix(in srgb, rgba(255, 255, 255, .88) 58%, var(--palette-primary));
    border-color: var(--accent-strong);
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--palette-primary) 74%, transparent);
}

.roll-call-cell.called:not(:disabled):hover,
.roll-call-cell.called:not(:disabled):focus-visible {
    background: color-mix(in srgb, white 58%, var(--palette-primary));
    transform: translateY(-3px) rotate(-1deg);
}

.roll-call-cell.x-mark {
    color: var(--danger);
}

.roll-call-cell.o-mark {
    color: var(--accent-strong);
}

.roll-call-cell.just-played {
    animation: roll-call-mark-land .52s cubic-bezier(.2, 1.4, .35, 1) both;
}

.roll-call-cell:disabled:not(.filled),
.roll-call-line:disabled:not(.called) {
    cursor: default;
    opacity: .58;
}

@keyframes roll-call-board-arrive {
    from { opacity: 0; transform: translateY(16px) rotate(-1deg) scale(.97); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes roll-call-label-pulse {
    from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--palette-primary) 38%, transparent); }
    to { box-shadow: 0 0 0 6px color-mix(in srgb, var(--palette-primary) 18%, transparent); }
}

@keyframes roll-call-mark-land {
    0% { opacity: 0; transform: translate(-18px, -12px) rotate(-18deg) scale(.2); }
    72% { opacity: 1; transform: translate(2px, 1px) rotate(3deg) scale(1.14); }
    100% { opacity: 1; transform: translate(0) rotate(0) scale(1); }
}

@media (max-width: 480px) {
    .roll-call-board {
        --roll-call-gap: 4px;
        --roll-call-label: 36px;
        border-width: 2px;
        padding: 5px;
    }

    .roll-call-cell,
    .roll-call-line,
    .roll-call-corner {
        border-width: 1.5px;
    }
}

.order-chaos-page {
    overflow-x: hidden;
}

.order-chaos-mission {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 78%, var(--palette-secondary));
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 5px 0 rgba(37, 49, 74, .14);
    display: grid;
    gap: 10px;
    grid-template-columns: 68px minmax(0, 1fr);
    margin: 0 auto 10px;
    max-width: 620px;
    min-height: 72px;
    padding: 5px 12px;
}

.order-chaos-mission[data-role="order"] {
    background: color-mix(in srgb, var(--surface) 68%, var(--palette-secondary));
    border-color: var(--accent-strong);
}

.order-chaos-mission[data-role="chaos"] {
    background: color-mix(in srgb, var(--surface) 68%, var(--palette-primary));
    border-color: var(--palette-primary);
}

.order-chaos-mission img {
    height: 64px;
    object-fit: contain;
    width: 68px;
}

.order-chaos-mission span,
.order-chaos-mission strong {
    display: block;
}

.order-chaos-mission span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.order-chaos-mission strong {
    color: var(--text);
    font-size: clamp(13px, 3vw, 16px);
}

.order-chaos-symbol-dock {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 88%, var(--paper-warm));
    border: 2px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0 auto 10px;
    max-width: 620px;
    min-height: 58px;
    padding: 7px 9px 7px 13px;
}

.order-chaos-symbol-dock > span {
    color: var(--muted);
    font-size: clamp(12px, 2.7vw, 14px);
    font-weight: 800;
    line-height: 1.25;
}

.order-chaos-symbols {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, 50px);
}

.order-chaos-symbols button {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--status-text);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 28px;
    font-weight: 1000;
    height: 44px;
    justify-content: center;
    padding: 0;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.order-chaos-symbols button[data-symbol="X"] {
    color: var(--danger);
}

.order-chaos-symbols button[data-symbol="O"] {
    color: var(--accent-strong);
}

.order-chaos-symbols button.selected {
    background: color-mix(in srgb, white 55%, var(--palette-secondary));
    box-shadow: none;
    transform: translateY(-2px) rotate(-2deg);
}

.order-chaos-board {
    animation: order-chaos-board-arrive .55s cubic-bezier(.2, .85, .25, 1) both;
    background: repeating-linear-gradient(
        0deg,
        color-mix(in srgb, var(--paper-warm) 94%, white) 0,
        color-mix(in srgb, var(--paper-warm) 94%, white) 38px,
        color-mix(in srgb, var(--accent) 20%, transparent) 39px,
        color-mix(in srgb, var(--paper-warm) 94%, white) 40px
    );
    border: 3px solid var(--status-text);
    border-radius: 10px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .2);
    display: grid;
    gap: clamp(3px, .9vw, 6px);
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 auto 32px;
    max-width: 620px;
    padding: clamp(6px, 1.4vw, 10px);
    width: 100%;
}

.order-chaos-cell {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .76);
    border: 2px solid var(--status-text);
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: clamp(25px, 7vw, 48px);
    font-weight: 1000;
    justify-content: center;
    line-height: 1;
    min-width: 0;
    padding: 0;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.order-chaos-cell:not(:disabled):hover,
.order-chaos-cell:not(:disabled):focus-visible {
    background: color-mix(in srgb, white 58%, var(--palette-secondary));
    box-shadow: none;
    transform: translateY(-2px);
}

.order-chaos-cell.x-mark {
    color: var(--danger);
}

.order-chaos-cell.o-mark {
    color: var(--accent-strong);
}

.order-chaos-cell.just-played {
    animation: order-chaos-stamp .52s cubic-bezier(.2, 1.4, .35, 1) both;
}

.order-chaos-cell.winning {
    animation: order-chaos-winning-cell .8s ease-in-out infinite alternate;
    background: color-mix(in srgb, white 35%, var(--palette-primary));
    border-color: var(--palette-primary);
}

.order-chaos-cell:disabled:not(.filled) {
    cursor: default;
    opacity: .7;
}

@keyframes order-chaos-board-arrive {
    from { opacity: 0; transform: translateY(16px) rotate(-1deg) scale(.97); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes order-chaos-stamp {
    0% { opacity: 0; transform: translateY(-26px) rotate(-16deg) scale(1.7); }
    65% { opacity: 1; transform: translateY(2px) rotate(3deg) scale(.9); }
    100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes order-chaos-winning-cell {
    from { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--palette-primary) 45%, transparent); }
    to { box-shadow: inset 0 0 0 7px color-mix(in srgb, var(--palette-primary) 68%, transparent); }
}

@media (max-width: 480px) {
    .order-chaos-mission {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .order-chaos-mission img {
        height: 54px;
        width: 56px;
    }

    .order-chaos-symbol-dock {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .order-chaos-symbols {
        grid-template-columns: repeat(2, 43px);
    }

    .order-chaos-cell {
        border-width: 1.5px;
    }
}

.black-hole-board {
    --bh-board-width: 536px;
    --bh-gap: clamp(5px, 1.4vw, 10px);
    --bh-size: clamp(40px, 13vw, 78px);
    display: grid;
    gap: var(--bh-gap);
    justify-items: center;
    margin: 0 auto;
    padding: 10px 4px 24px;
    width: 100%;
}

.black-hole-board[data-rows="7"] {
    --bh-board-width: 594px;
    --bh-gap: clamp(5px, 1.3vw, 9px);
    --bh-size: clamp(34px, 10.8vw, 76px);
}

.sim-page {
    overflow-x: hidden;
}

.wishwind-page {
    overflow-x: hidden;
}

.wishwind-mission {
    align-items: center;
    background: linear-gradient(
        125deg,
        color-mix(in srgb, var(--surface) 76%, var(--mint)),
        color-mix(in srgb, var(--surface) 84%, var(--sky))
    );
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .16);
    display: grid;
    gap: 10px;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    margin: 0 auto 12px;
    max-width: 782px;
    min-height: 82px;
    padding: 4px 12px;
}

.wishwind-mission[data-role="dandelion"] {
    border-color: color-mix(in srgb, #f4b942 70%, var(--line));
}

.wishwind-mission[data-role="wind"] {
    border-color: color-mix(in srgb, var(--sky) 76%, var(--line));
}

.wishwind-mission img {
    height: 78px;
    object-fit: contain;
    width: 82px;
}

.wishwind-mission span,
.wishwind-mission strong {
    display: block;
}

.wishwind-mission span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.wishwind-mission strong {
    color: var(--text);
    font-size: clamp(13px, 2.5vw, 16px);
}

.wishwind-mission > b {
    background: color-mix(in srgb, var(--surface) 80%, var(--yellow));
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    padding: 7px 10px;
    white-space: nowrap;
}

.wishwind-game {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: 228px minmax(0, 540px);
    justify-content: center;
    margin: 0 auto 34px;
    max-width: 782px;
}

.wishwind-compass-panel {
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--surface) 88%, var(--mint)),
        color-mix(in srgb, var(--surface) 91%, var(--sky))
    );
    border: 3px solid var(--status-text);
    border-radius: 10px;
    box-shadow: 0 9px 0 rgba(37, 49, 74, .18);
    display: grid;
    gap: 10px;
    padding: 12px;
}

.wishwind-compass-panel > div:first-child {
    min-height: 52px;
}

.wishwind-compass-panel > div:first-child span,
.wishwind-compass-panel > div:first-child strong {
    display: block;
}

.wishwind-compass-panel > div:first-child span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 3px;
}

.wishwind-compass-panel > div:first-child strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.3;
}

.wishwind-compass {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, 1fr);
}

.wishwind-compass button,
.wishwind-compass-heart {
    align-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.wishwind-compass button {
    background: var(--surface);
    border: 2px solid var(--status-text);
    color: var(--text);
    cursor: pointer;
    flex-direction: column;
    font-family: inherit;
    padding: 0;
    transition: background .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

.wishwind-compass button span {
    font-size: 24px;
    font-weight: 1000;
    line-height: .8;
}

.wishwind-compass button small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    margin-top: 4px;
}

.wishwind-compass button:not(:disabled):hover,
.wishwind-compass button:not(:disabled):focus-visible {
    background: color-mix(in srgb, white 42%, var(--sky));
    box-shadow: none;
    transform: translateY(-3px) rotate(-3deg);
}

.wishwind-compass button.used {
    background: color-mix(in srgb, var(--surface) 84%, var(--muted));
    opacity: .36;
    position: relative;
}

.wishwind-compass button.used:after {
    background: var(--danger);
    content: "";
    height: 2px;
    position: absolute;
    transform: rotate(-36deg);
    width: 68%;
}

.wishwind-compass-heart {
    background: radial-gradient(circle, #ffd665 0 22%, var(--sky) 24% 54%, var(--surface) 56%);
    border: 2px solid var(--status-text);
    color: var(--status-text);
    font-size: 25px;
}

.wishwind-garden {
    animation: wishwind-garden-arrive .58s cubic-bezier(.2, .85, .25, 1) both;
    background:
        linear-gradient(rgba(54, 117, 76, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(54, 117, 76, .08) 1px, transparent 1px),
        radial-gradient(circle at 15% 12%, rgba(255, 219, 101, .18), transparent 24%),
        #fffdf4;
    background-size: 20px 20px, 20px 20px, auto, auto;
    border: 3px solid #25314a;
    border-radius: 12px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .2);
    display: grid;
    gap: clamp(4px, .9vw, 7px);
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: 540px;
    overflow: hidden;
    padding: clamp(7px, 1.4vw, 12px);
    position: relative;
    width: 100%;
}

.wishwind-cell {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .70);
    border: 2px solid #456b58;
    border-radius: 8px;
    color: #25314a;
    cursor: pointer;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.wishwind-cell:not(:disabled):hover,
.wishwind-cell:not(:disabled):focus-visible {
    background: color-mix(in srgb, white 48%, var(--yellow));
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--palette-primary) 55%, transparent);
    transform: translateY(-2px);
}

.wishwind-cell.flower {
    background: #fff7c8;
    border-color: #bd8427;
}

.wishwind-cell.seed {
    background: #e9f7ef;
    border-color: #7ba28c;
}

.wishwind-flower,
.wishwind-seed {
    display: block;
    height: 82%;
    position: relative;
    width: 82%;
}

.wishwind-flower:before {
    color: #f6b934;
    content: "✿";
    filter: drop-shadow(0 2px 0 rgba(37, 49, 74, .18));
    font-size: clamp(27px, 6vw, 49px);
    left: 50%;
    line-height: 1;
    position: absolute;
    top: 42%;
    transform: translate(-50%, -50%);
}

.wishwind-flower:after {
    background: #68a85b;
    border-radius: 999px;
    bottom: 4%;
    content: "";
    height: 34%;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 9%;
}

.wishwind-seed:before {
    color: #f7f5df;
    content: "✺";
    filter: drop-shadow(0 1px 1px rgba(37, 49, 74, .65));
    font-size: clamp(23px, 5vw, 40px);
    left: 47%;
    line-height: 1;
    position: absolute;
    top: 35%;
    transform: translate(-50%, -50%) rotate(-14deg);
}

.wishwind-seed:after {
    background: #7c5a32;
    border-radius: 999px;
    bottom: 18%;
    content: "";
    height: 33%;
    left: 54%;
    position: absolute;
    transform: rotate(-18deg);
    transform-origin: top;
    width: 7%;
}

.wishwind-cell.just-planted .wishwind-flower {
    animation: wishwind-plant .58s cubic-bezier(.18, 1.45, .35, 1) both;
}

.wishwind-cell.new-seed .wishwind-seed {
    animation: wishwind-seed-land .62s cubic-bezier(.18, .9, .28, 1.18) both;
    animation-delay: var(--seed-delay, 0ms);
}

.wishwind-gust {
    --gust-from-x: -90%;
    --gust-from-y: -50%;
    --gust-to-x: 10%;
    --gust-to-y: -50%;
    color: rgba(60, 169, 222, .88);
    font-size: clamp(28px, 7vw, 58px);
    font-weight: 1000;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    text-shadow: 0 2px 0 white;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: none;
    white-space: nowrap;
    z-index: 4;
}

.wishwind-gust.blow-n {
    --gust-from-x: -50%;
    --gust-from-y: 10%;
    --gust-to-x: -50%;
    --gust-to-y: -115%;
}

.wishwind-gust.blow-ne {
    --gust-from-x: -95%;
    --gust-from-y: 5%;
    --gust-to-x: 5%;
    --gust-to-y: -105%;
}

.wishwind-gust.blow-se {
    --gust-from-x: -95%;
    --gust-from-y: -105%;
    --gust-to-x: 5%;
    --gust-to-y: 5%;
}

.wishwind-gust.blow-s {
    --gust-from-x: -50%;
    --gust-from-y: -115%;
    --gust-to-x: -50%;
    --gust-to-y: 10%;
}

.wishwind-gust.blow-sw {
    --gust-from-x: 5%;
    --gust-from-y: -105%;
    --gust-to-x: -95%;
    --gust-to-y: 5%;
}

.wishwind-gust.blow-w {
    --gust-from-x: 10%;
    --gust-from-y: -50%;
    --gust-to-x: -90%;
    --gust-to-y: -50%;
}

.wishwind-gust.blow-nw {
    --gust-from-x: 5%;
    --gust-from-y: 5%;
    --gust-to-x: -95%;
    --gust-to-y: -105%;
}

.wishwind-gust.show {
    animation: wishwind-gust 1.05s ease-out both;
}

.wishwind-page .game-player-card.role-dandelion {
    border-bottom-color: #f4b942;
}

.wishwind-page .game-player-card.role-wind {
    border-bottom-color: var(--sky);
}

@keyframes wishwind-garden-arrive {
    from { opacity: 0; transform: translateY(18px) rotate(.8deg) scale(.97); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes wishwind-plant {
    0% { opacity: 0; transform: translateY(-42px) rotate(-18deg) scale(1.65); }
    68% { opacity: 1; transform: translateY(3px) rotate(4deg) scale(.9); }
    100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes wishwind-seed-land {
    0% { opacity: 0; transform: translate(-34px, -22px) rotate(-38deg) scale(.5); }
    70% { opacity: 1; transform: translate(3px, 2px) rotate(7deg) scale(1.08); }
    100% { opacity: 1; transform: translate(0) rotate(0) scale(1); }
}

@keyframes wishwind-gust {
    0% { opacity: 0; transform: translate(var(--gust-from-x), var(--gust-from-y)) scale(.7); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--gust-to-x), var(--gust-to-y)) scale(1.12); }
}

@media (max-width: 700px) {
    .wishwind-mission {
        grid-template-columns: 66px minmax(0, 1fr);
    }

    .wishwind-mission img {
        height: 62px;
        width: 66px;
    }

    .wishwind-mission > b {
        grid-column: 1 / -1;
        justify-self: stretch;
        text-align: center;
    }

    .wishwind-game {
        grid-template-columns: minmax(0, 1fr);
    }

    .wishwind-compass-panel {
        grid-template-columns: minmax(0, 1fr) 188px;
    }

}

@media (max-width: 470px) {
    .game-card[data-game-key="wishwind"] h3 {
        font-size: 13px;
    }

    .wishwind-compass-panel {
        grid-template-columns: minmax(0, 1fr) 156px;
        padding: 9px;
    }

    .wishwind-compass {
        gap: 4px;
    }

    .wishwind-compass button span {
        font-size: 19px;
    }

    .wishwind-cell {
        border-width: 1.5px;
        border-radius: 6px;
    }
}

.sim-mission {
    align-items: center;
    background: linear-gradient(
        125deg,
        color-mix(in srgb, var(--surface) 82%, var(--palette-primary)),
        color-mix(in srgb, var(--surface) 88%, var(--palette-secondary))
    );
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .16);
    display: grid;
    gap: 10px;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    margin: 0 auto 12px;
    max-width: 620px;
    min-height: 72px;
    padding: 5px 12px;
}

.sim-mission > img {
    height: 66px;
    object-fit: contain;
    width: 70px;
}

.sim-mission > div > span,
.sim-mission > div > strong {
    display: block;
}

.sim-mission > div > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.sim-mission > div > strong {
    color: var(--text);
    font-size: clamp(13px, 3vw, 16px);
}

.sim-color-key {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 2px solid var(--line);
    border-radius: 999px;
    display: flex;
    gap: 6px;
    padding: 6px 9px;
    white-space: nowrap;
}

.sim-color-key i {
    background: var(--sim-self-color, var(--palette-primary));
    border: 2px solid var(--status-text);
    border-radius: 50%;
    height: 16px;
    width: 16px;
}

.sim-color-key span {
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
}

.sim-board {
    animation: sim-board-arrive .65s cubic-bezier(.2, .85, .25, 1) both;
    aspect-ratio: 1;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 37px,
            color-mix(in srgb, var(--accent) 20%, transparent) 38px,
            transparent 39px
        ),
        color-mix(in srgb, var(--paper-warm) 94%, white);
    border: 3px solid var(--status-text);
    border-radius: 12px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .2);
    margin: 0 auto 34px;
    max-width: 620px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.sim-board::before {
    border-left: 2px solid color-mix(in srgb, var(--danger) 45%, transparent);
    content: "";
    inset: 0 auto 0 9%;
    pointer-events: none;
    position: absolute;
}

.sim-board svg {
    height: 100%;
    inset: 0;
    overflow: visible;
    position: absolute;
    width: 100%;
}

.sim-guide {
    display: none;
    stroke: color-mix(in srgb, var(--status-text) 24%, transparent);
    stroke-dasharray: 7 9;
    stroke-linecap: round;
    stroke-width: 4;
}

.sim-board.guided .sim-guide {
    display: block;
}

.sim-edge,
.sim-preview {
    fill: none;
    pointer-events: none;
    stroke: var(--sim-edge-color, transparent);
    stroke-linecap: round;
}

.sim-edge {
    opacity: 0;
    stroke-width: 13;
}

.sim-edge.drawn {
    filter: drop-shadow(0 3px 1px rgba(37, 49, 74, .16));
    opacity: .94;
}

.sim-edge.just-drawn {
    animation: sim-line-draw .62s ease-out both;
}

.sim-edge.losing {
    animation: sim-losing-line .48s ease-in-out .52s infinite alternate;
    filter: drop-shadow(0 0 8px var(--sim-edge-color));
    stroke-width: 18;
}

.sim-preview {
    opacity: 0;
    stroke-dasharray: 9 11;
    stroke-width: 8;
    transition: opacity .14s ease;
}

.sim-preview.visible {
    opacity: .45;
}

.sim-node {
    align-items: center;
    background: color-mix(in srgb, white 80%, var(--palette-secondary));
    border: 4px solid var(--status-text);
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    height: clamp(48px, 10vw, 66px);
    justify-content: center;
    padding: 0;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
    width: clamp(48px, 10vw, 66px);
    z-index: 2;
}

.sim-node span {
    background: var(--surface);
    border: 3px solid var(--palette-primary);
    border-radius: 50%;
    height: 34%;
    width: 34%;
}

.sim-node[data-node="0"] { left: 50%; top: 9.7%; }
.sim-node[data-node="1"] { left: 85%; top: 29.7%; }
.sim-node[data-node="2"] { left: 85%; top: 70.3%; }
.sim-node[data-node="3"] { left: 50%; top: 90.3%; }
.sim-node[data-node="4"] { left: 15%; top: 70.3%; }
.sim-node[data-node="5"] { left: 15%; top: 29.7%; }

.sim-node:not(:disabled):hover,
.sim-node:not(:disabled):focus-visible,
.sim-node.available {
    background: color-mix(in srgb, white 48%, var(--palette-secondary));
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--palette-secondary) 35%, transparent);
    transform: translate(-50%, -54%) scale(1.05);
}

.sim-node.selected {
    background: color-mix(in srgb, white 35%, var(--palette-primary));
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--palette-primary) 42%, transparent);
    transform: translate(-50%, -54%) scale(1.1);
}

.sim-node:disabled {
    cursor: default;
}

@keyframes sim-board-arrive {
    from { opacity: 0; transform: translateY(18px) rotate(-1deg) scale(.97); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes sim-line-draw {
    from { stroke-dasharray: 1; stroke-dashoffset: 1; }
    to { stroke-dasharray: 1; stroke-dashoffset: 0; }
}

@keyframes sim-losing-line {
    from { opacity: .72; }
    to { opacity: 1; }
}

@media (max-width: 480px) {
    .sim-mission {
        gap: 7px;
        grid-template-columns: 54px minmax(0, 1fr) auto;
        padding-inline: 7px;
    }

    .sim-mission > img {
        height: 52px;
        width: 54px;
    }

    .sim-color-key {
        padding: 5px;
    }

    .sim-color-key span {
        display: none;
    }

    .sim-edge {
        stroke-width: 16;
    }

    .sim-edge.losing {
        stroke-width: 21;
    }
}

.black-hole-board[data-rows="9"] {
    --bh-board-width: 648px;
    --bh-gap: clamp(5px, 1.1vw, 7px);
    --bh-size: clamp(26px, 7.5vw, 64px);
}

.black-hole-board[data-rows="9"] .bh-row {
    gap: var(--bh-gap);
}

.bh-row {
    display: flex;
    gap: var(--bh-gap);
    justify-content: center;
}

.bh-cell {
    align-items: center;
    background: var(--paper-surface);
    border: 3px solid var(--status-text);
    border-radius: 999px;
    box-shadow: none;
    color: var(--status-text);
    cursor: pointer;
    display: flex;
    font-size: clamp(15px, 3.5vw, 22px);
    font-weight: 900;
    height: var(--bh-size);
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: transform .16s ease;
    width: var(--bh-size);
}

.bh-cell:not(:disabled):hover {
    transform: translateY(-2px);
}

.bh-cell.black-hole {
    background: #111827;
    border-color: var(--paper-surface);
    color: var(--paper-surface);
    cursor: default;
}

.knight-chase-page {
    padding-bottom: 16px;
}

.knight-chase-stage {
    margin: 0 auto;
    max-width: 650px;
    width: 100%;
}

@media (min-width: 681px) and (min-height: 821px) {
    .knight-chase-page {
        --live-game-content-width: min(760px, calc(100dvh - 336px));
    }
}

.knight-chase-board {
    aspect-ratio: 1;
    background: #263849;
    border: clamp(4px, 1vw, 8px) solid #263849;
    border-radius: 12px;
    box-shadow: 0 12px 0 rgba(37, 49, 74, .24), 0 20px 38px rgba(37, 49, 74, .18);
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(var(--knight-grid-size, 8), minmax(0, 1fr));
    overflow: hidden;
    position: relative;
    width: 100%;
}

.knight-cell {
    align-items: center;
    animation: knight-square-reveal .32s ease-out both;
    animation-delay: calc(var(--cell-index) * 7ms);
    aspect-ratio: 1;
    border: 0;
    border-radius: 3px;
    cursor: default;
    display: flex;
    justify-content: center;
    min-width: 0;
    opacity: 1;
    padding: 0;
    position: relative;
    transition: filter .16s ease, transform .16s ease;
}

.knight-cell.light-square {
    background: #f3e5bd;
}

.knight-cell.dark-square {
    background: #7ca28d;
}

html[data-theme="dark"] .knight-cell.light-square {
    background: #d5c79d;
}

html[data-theme="dark"] .knight-cell.dark-square {
    background: #587c6c;
}

.knight-cell:disabled {
    opacity: 1;
}

.knight-cell.legal {
    cursor: pointer;
    z-index: 2;
}

.knight-cell.legal:after {
    animation: knight-landing-pulse 1.25s ease-in-out infinite;
    background: #ffe066;
    border: 3px solid #263849;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255, 224, 102, .44);
    content: "";
    height: clamp(11px, 2.8vw, 20px);
    position: absolute;
    width: clamp(11px, 2.8vw, 20px);
}

.knight-cell.legal:not(:disabled):hover,
.knight-cell.legal:not(:disabled):focus-visible {
    filter: brightness(1.1);
    outline: 4px solid #ffe066;
    outline-offset: -5px;
    transform: scale(.94);
}

.knight-cell.capture:after {
    background: #ff5d73;
    border-color: #fff8ec;
    box-shadow: 0 0 0 5px rgba(255, 93, 115, .45);
    height: 78%;
    width: 78%;
}

/* Clickable cells. With hints on these are also .legal (glowing); with hints
   off only .playable is set, so the board stays clickable without any tell. */
.knight-cell.playable {
    cursor: pointer;
    z-index: 2;
}

.knight-chase-board[data-show-hints="false"] .knight-cell.playable:not(:disabled):hover,
.knight-chase-board[data-show-hints="false"] .knight-cell.playable:not(:disabled):focus-visible {
    filter: brightness(1.08);
    outline: 3px solid rgba(255, 224, 102, .55);
    outline-offset: -4px;
}

.knight-cell.blocked {
    background: #32404a;
    color: #ffcf70;
}

.knight-cell.blocked:before {
    background: repeating-linear-gradient(
        135deg,
        transparent 0,
        transparent 6px,
        rgba(255, 255, 255, .055) 6px,
        rgba(255, 255, 255, .055) 10px
    );
    content: "";
    inset: 0;
    position: absolute;
}

.knight-block-mark {
    color: #ffcf70;
    font-size: clamp(24px, 7vw, 52px);
    font-weight: 900;
    line-height: 1;
    position: relative;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .24);
    z-index: 1;
}

.knight-cell.newly-blocked .knight-block-mark {
    animation: knight-cross-in .48s cubic-bezier(.2, .9, .25, 1.25) both;
}

.knight-cell.last-landing {
    box-shadow: inset 0 0 0 4px rgba(255, 224, 102, .86);
}

.knight-piece {
    filter: drop-shadow(0 clamp(3px, .8vw, 6px) 2px rgba(25, 33, 42, .48));
    height: 96%;
    object-fit: contain;
    pointer-events: none;
    position: relative;
    transform-origin: 50% 88%;
    user-select: none;
    width: 96%;
    z-index: 3;
}

.knight-piece.self {
    filter: drop-shadow(0 clamp(3px, .8vw, 6px) 2px rgba(25, 33, 42, .48)) drop-shadow(0 0 5px #ffe066);
}

.knight-piece.self.ready {
    /* Leave room for the shared pawn lift at the board's outer corners. */
    --piece-ready-rise: -5%;
    --piece-ready-scale: 1.06;
    animation: ludo-ready 650ms ease-in-out infinite alternate;
    height: 82%;
    width: 82%;
}

.knight-chase-legend {
    align-items: center;
    background: rgba(255, 248, 236, .9);
    border: 3px solid #263849;
    border-radius: 999px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .18);
    color: #263849;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 900;
    gap: 15px;
    justify-content: center;
    margin: 16px auto 0;
    padding: 8px 13px;
    width: fit-content;
}

.knight-chase-legend span {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.knight-chase-legend i {
    align-items: center;
    display: inline-flex;
    font-style: normal;
    font-weight: 900;
    justify-content: center;
}

.legal-sample {
    background: #ffe066;
    border: 2px solid #263849;
    border-radius: 999px;
    height: 15px;
    width: 15px;
}

.blocked-sample {
    background: #32404a;
    border-radius: 3px;
    color: #ffcf70;
    font-size: 19px;
    height: 21px;
    line-height: 1;
    width: 21px;
}

@keyframes knight-square-reveal {
    from {
        opacity: 0;
        transform: scale(.72) rotate(-3deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes knight-landing-pulse {
    0%, 100% {
        transform: scale(.78);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes knight-cross-in {
    0% {
        opacity: 0;
        transform: rotate(-120deg) scale(.2);
    }
    100% {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .knight-cell,
    .knight-cell.legal:after,
    .knight-cell.newly-blocked .knight-block-mark {
        animation: none;
    }
}

.ww-page {
    padding-bottom: 36px;
}

.ww-player-strip {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    max-width: 1100px;
}

.ww-player-strip .game-player-card {
    border-color: color-mix(in srgb, var(--player-color) 72%, #25314a);
    box-shadow: inset 6px 0 0 var(--player-color);
    grid-template-columns: 54px minmax(70px, 1fr) 38px minmax(104px, auto);
}

.ww-player-strip .game-player-card.active {
    border-color: var(--player-color);
    box-shadow: inset 7px 0 0 var(--player-color), 0 0 0 3px color-mix(in srgb, var(--player-color) 36%, transparent);
}

.ww-player-progress {
    align-self: stretch;
    border-left: 1px dashed color-mix(in srgb, var(--status-text) 38%, transparent);
    display: grid;
    gap: 5px;
    min-width: 104px;
    padding-left: 9px;
}

html[dir="rtl"] .ww-player-progress {
    direction: rtl;
}

.ww-collected-cards {
    align-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.ww-collected-relic {
    align-items: center;
    background: linear-gradient(145deg, #fff7c7, #f4e3a2);
    border: 1.5px solid #25314a;
    border-radius: 5px;
    box-shadow: 0 2px 0 rgba(37, 49, 74, .22);
    color: #25314a !important;
    display: flex !important;
    flex: 0 0 27px;
    font-size: 16px !important;
    height: 34px;
    justify-content: center;
    overflow: visible !important;
}

.ww-collected-relic.empty {
    background: color-mix(in srgb, var(--surface-2) 80%, transparent);
    border-style: dashed;
    color: var(--muted) !important;
    opacity: .64;
}

.ww-collected-relic .ww-relic-art {
    border-radius: 4px;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ww-viewed-count {
    align-self: end;
    background: color-mix(in srgb, #c7f2d5 78%, var(--surface));
    border: 1px solid color-mix(in srgb, #276749 65%, transparent);
    border-radius: 999px;
    color: #214b38 !important;
    display: block !important;
    font-size: 10px !important;
    font-weight: 900;
    overflow: visible !important;
    padding: 3px 7px;
    text-align: center;
    text-overflow: clip !important;
}

.ww-dice-stage {
    direction: ltr;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(var(--player-count, 2), minmax(0, 1fr));
    margin: -8px auto 8px;
    max-height: 0;
    max-width: 1100px;
    overflow: visible;
    position: relative;
    transition: max-height .2s ease, margin .2s ease;
    z-index: 35;
}

.game-world-reveal {
    align-items: center;
    background: rgba(15, 18, 40, .78);
    display: grid;
    inset: 0;
    justify-content: center;
    padding: 22px;
    position: fixed;
    z-index: 120;
}

.game-world-options {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 720px;
    transition: opacity .3s ease, transform .3s ease;
    width: min(92vw, 720px);
}

.game-world-option {
    align-content: end;
    aspect-ratio: 4 / 5;
    background-position: center;
    background-size: cover;
    border: 3px solid rgba(255, 248, 223, .68);
    border-radius: 12px;
    box-shadow: none;
    color: #fff;
    display: grid;
    justify-items: center;
    overflow: hidden;
    padding: 12px 7px;
    position: relative;
    text-align: center;
    transform: scale(.94);
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.game-world-option:before {
    background: linear-gradient(transparent 30%, rgba(20, 26, 51, .9) 88%);
    content: "";
    inset: 0;
    position: absolute;
}

.game-world-option img,
.game-world-option strong {
    position: relative;
    z-index: 1;
}

.game-world-option img {
    filter: drop-shadow(0 4px 0 rgba(15, 18, 40, .3));
    height: clamp(48px, 8vw, 72px);
    width: clamp(48px, 8vw, 72px);
}

.game-world-option strong {
    font-size: clamp(12px, 2vw, 17px);
}

.game-world-option.active {
    border-color: #fff2bd;
    box-shadow: 0 0 0 5px rgba(100, 209, 255, .55);
    transform: scale(1);
}

.game-world-reveal.world-selected .game-world-options {
    opacity: 0;
    transform: scale(.92);
}

.game-world-reveal.leaving {
    animation: ww-world-curtain .45s ease-in forwards;
    pointer-events: none;
}

.game-world-reveal-card {
    align-content: end;
    aspect-ratio: 1;
    background-position: center;
    background-size: cover;
    border: 4px solid #fff8df;
    border-radius: 16px;
    box-shadow: 0 16px 0 rgba(15, 18, 40, .24), 0 28px 70px rgba(0, 0, 0, .35);
    color: #fff;
    display: grid;
    justify-items: center;
    max-width: 520px;
    overflow: hidden;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 50%;
    top: 50%;
    text-align: center;
    width: min(82vw, 64vh);
}

.game-world-reveal.world-selected .game-world-reveal-card {
    animation: ww-world-reveal .85s cubic-bezier(.18, .8, .2, 1.08) both;
}

.game-world-reveal-card:before {
    background: linear-gradient(transparent 35%, rgba(20, 26, 51, .9) 82%);
    content: "";
    inset: 0;
    position: absolute;
}

.game-world-reveal-card img,
.game-world-reveal-card h1,
.game-world-reveal-card p,
.game-world-reveal-card small {
    position: relative;
    z-index: 1;
}

.game-world-reveal-card img {
    animation: ww-world-sticker .9s .25s cubic-bezier(.18, .8, .2, 1.18) both;
    filter: drop-shadow(0 6px 0 rgba(15, 18, 40, .28));
    height: 88px;
    width: 88px;
}

.game-world-reveal-card small {
    font-size: 12px;
    font-weight: 900;
    margin-top: 8px;
}

.game-world-reveal-card h1 {
    font-size: clamp(25px, 5vw, 38px);
    margin: 3px 0 0;
}

.game-world-reveal-card p {
    font-size: 14px;
    font-weight: 800;
    margin: 4px 0 0;
}

.world-revealing > :not(.game-world-reveal) {
    pointer-events: none;
}

.ww-confirm-toggle.active {
    background: #c7f2d5;
    color: #173b2b;
}

.ww-move-confirm-card {
    text-align: center;
}

.ww-move-confirm-card > strong {
    font-size: 20px;
}

.ww-move-confirm-card p {
    color: var(--muted);
    margin: 0;
}

.ww-dice-stage.rolling,
.ww-dice-stage.revealed {
    margin-bottom: 14px;
    max-height: 72px;
}

.ww-dice-slot {
    align-items: center;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.ww-dice-slot.active {
    background:
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, .6), transparent 52%),
        color-mix(in srgb, var(--player-color) 16%, var(--status-bg));
    border: 3px solid var(--player-color);
    border-radius: 12px;
    box-shadow: 0 6px 0 color-mix(in srgb, var(--player-color) 32%, rgba(37, 49, 74, .2));
    gap: 8px;
    min-height: 64px;
    padding: 7px 10px;
}

.ww-dice-slot strong {
    color: var(--status-text);
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ww-dice-tray {
    background: color-mix(in srgb, var(--player-color) 10%, rgba(37, 49, 74, .08));
    border-radius: 999px;
    box-shadow: inset 0 2px 4px rgba(37, 49, 74, .16);
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    padding: 4px 8px 6px;
    perspective: 180px;
}

.ww-stage-die {
    align-items: center;
    background: #fff8df;
    border: 2px solid #25314a;
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .22);
    color: #25314a;
    display: flex;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    line-height: 1;
    transform-style: preserve-3d;
    width: 44px;
}

.ww-stage-die.is-3d,
.ww-die.is-3d {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.GameGlee-die-canvas {
    display: block;
    height: 100%;
    pointer-events: none;
    width: 100%;
}

.ww-dice-stage.rolling .ww-stage-die:not(.is-3d),
.ww-die.rolling:not(.is-3d) {
    animation: ww-die-tumble .72s cubic-bezier(.35, .05, .55, .95) infinite;
}

.ww-dice-stage.rolling .ww-stage-die:not(.is-3d):nth-child(2),
.ww-die.rolling:not(.is-3d):nth-child(2) {
    animation-delay: -.31s;
    animation-direction: reverse;
}

.ww-dice-stage.revealed .ww-stage-die {
    animation: ww-die-land .5s cubic-bezier(.18, .8, .2, 1.18) both;
}

.ww-game {
    align-items: start;
    direction: ltr;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(210px, 250px) minmax(560px, 820px);
    margin: 0 auto;
    max-width: 1100px;
}

.ww-sidebar {
    direction: ltr;
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .ww-sidebar {
    direction: rtl;
}

.ww-sidebar article {
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    border: 3px solid var(--status-text);
    border-radius: 10px;
    box-shadow: 0 7px 0 rgba(28, 43, 45, .2);
    color: var(--text);
    padding: 12px;
}

.ww-target-card {
    align-items: center;
    background: linear-gradient(145deg, #fff2bd, #d8f4d2) !important;
    display: grid;
    gap: 3px;
    justify-items: center;
    min-height: 160px;
    text-align: center;
}

.ww-world-frostbound .ww-target-card {
    background: linear-gradient(145deg, #effaff, #c9ddff) !important;
}

.ww-world-frostbound .ww-tree-tier {
    background: linear-gradient(115deg, #f8fdff 0 20%, #83cae8 48%, #426fa4 100%);
}

.ww-world-frostbound .ww-tree-shadow {
    background: rgba(75, 118, 160, .3);
}

.ww-world-rune-coast .ww-target-card {
    background: linear-gradient(145deg, #fff0b8, #9edbd2) !important;
}

.ww-world-darkwood .ww-target-card {
    background: linear-gradient(145deg, #e8e1f2, #cfdbc9) !important;
}

.ww-world-darkwood .ww-tree-tier {
    background: linear-gradient(115deg, #365444, #142e2a 48%, #271d3e 100%);
}

.ww-world-darkwood .ww-tree-shadow {
    background: rgba(27, 16, 45, .38);
}

.ww-world-rune-coast .ww-tree-tier {
    background: linear-gradient(115deg, #7abf86, #256e57 48%, #173f3d 100%);
}

.ww-world-rune-coast .ww-tree-number {
    background: #ffe08a;
}

.ww-target-card > span,
.ww-target-card small {
    color: #38534a;
    font-size: 12px;
    font-weight: 900;
}

.ww-target-card strong {
    color: #25314a;
    font-size: 16px;
}

.ww-target-emoji {
    animation: ww-target-float 2.4s ease-in-out infinite;
    filter: drop-shadow(0 5px 0 rgba(37, 49, 74, .12));
    font-size: 54px;
    line-height: 1;
}

.ww-target-emoji .ww-relic-art {
    border-radius: 12px;
    display: block;
    height: 74px;
    object-fit: cover;
    width: 74px;
}

.ww-control-card,
.ww-event-card {
    display: grid;
    gap: 10px;
}

.ww-control-card p,
.ww-event-card p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    margin: 0;
}

.ww-dice {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
}

.ww-die {
    align-items: center;
    background: #fff8df;
    border: 3px solid #25314a;
    border-radius: 9px;
    box-shadow: 0 4px 0 rgba(37, 49, 74, .18);
    color: #25314a;
    display: inline-flex;
    font-weight: 900;
    height: 54px;
    justify-content: center;
    line-height: 1;
    transform-style: preserve-3d;
    transition: opacity .18s ease, transform .18s ease;
    width: 54px;
}

.ww-roll-total {
    background: #25314a;
    border: 2px solid #fff8df;
    border-radius: 999px;
    box-shadow: 0 3px 0 rgba(37, 49, 74, .2);
    color: #fff8df;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    padding: 7px 10px;
    white-space: nowrap;
}

.ww-dice > .ww-roll-total {
    flex-basis: 100%;
    justify-self: center;
    margin: 2px auto 0;
    text-align: center;
    width: max-content;
}

.ww-die-pips {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    height: 66%;
    width: 66%;
}

.ww-die-pip {
    background: #25314a;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
    opacity: 0;
    transform: scale(.35);
}

.ww-die-pip.active {
    opacity: 1;
    transform: scale(1);
}

.ww-die.empty {
    color: #829184;
    font-size: 24px;
}

.ww-die.used {
    opacity: .36;
    transform: scale(.85) rotate(-8deg);
}

.ww-controls {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ww-action {
    background: var(--surface-2);
    border: 2px solid var(--status-text);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    min-height: 42px;
    padding: 7px;
}

.ww-action.primary {
    background: #c7f2d5;
    color: #173b2b;
    grid-column: 1 / -1;
}

.ww-action.move {
    background: #fff2bd;
    color: #25314a;
}

.ww-action:disabled {
    cursor: default;
    opacity: .5;
}

.ww-control-card p.magic-explainer {
    background: color-mix(in srgb, #fff2bd 82%, var(--surface));
    border: 2px solid #a16a16;
    border-radius: 9px;
    color: #4e3715;
    padding: 9px;
}

.ww-action.with-help {
    display: grid;
    gap: 2px;
    grid-column: 1 / -1;
    min-height: 58px;
    text-align: left;
}

html[dir="rtl"] .ww-action.with-help {
    text-align: right;
}

.ww-action.with-help strong,
.ww-action.with-help small {
    display: block;
}

.ww-action.with-help small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
}

.ww-board {
    animation: ww-board-arrive .55s ease-out both;
    aspect-ratio: 1;
    background-position: center;
    background-size: cover;
    border: 5px solid #25314a;
    border-radius: 16px;
    box-shadow: 0 12px 0 rgba(25, 47, 42, .3), 0 20px 34px rgba(12, 35, 30, .22);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.ww-board:after {
    background: radial-gradient(circle at center, rgba(255, 250, 217, .03), rgba(44, 94, 68, .12));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.ww-paths,
.ww-spaces {
    direction: ltr;
    inset: 0;
    position: absolute;
}

.ww-paths {
    height: 100%;
    overflow: visible;
    width: 100%;
    z-index: 1;
}

.ww-spaces {
    z-index: 3;
}

.ww-path-shadow,
.ww-path-line,
.ww-path-active {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ww-path-shadow {
    stroke: rgba(51, 60, 45, .5);
    stroke-width: 2.35;
}

.ww-path-line {
    stroke: rgba(255, 235, 174, .9);
    stroke-width: 1.45;
}

.ww-path-active {
    animation: ww-path-dash .8s linear infinite;
    filter: drop-shadow(0 0 2px rgba(255, 209, 102, .8));
    stroke: #ffcf57;
    stroke-dasharray: 2.2 2.2;
    stroke-width: 1.4;
}

.ww-space {
    align-items: center;
    background: transparent;
    border: 0;
    color: #25314a;
    display: flex;
    height: clamp(24px, 3.5vw, 34px);
    justify-content: center;
    overflow: visible;
    padding: 0;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: filter .16s ease, transform .16s ease;
    width: clamp(24px, 3.5vw, 34px);
}

.ww-space:disabled {
    opacity: 1;
}

.ww-board-spot {
    align-items: center;
    background: radial-gradient(circle at 35% 28%, #fff8d7, #e8d89a 72%, #b39b5b);
    border: 2px solid #3b5360;
    border-radius: 999px;
    box-shadow: inset 0 3px 4px rgba(255, 255, 255, .7), 0 4px 0 rgba(37, 49, 74, .3);
    display: flex;
    height: 82%;
    justify-content: center;
    position: relative;
    width: 82%;
}

.ww-board-spot:after {
    background: #70957b;
    border-radius: 999px;
    content: "";
    height: 7px;
    width: 7px;
}

.ww-board-spot > b {
    font-size: clamp(17px, 3.1vw, 27px);
    line-height: 1;
    position: relative;
    z-index: 2;
}

.ww-board-spot > small {
    background: #fff8df;
    border: 1px solid #25314a;
    border-radius: 999px;
    bottom: -10px;
    color: #25314a;
    font-size: 8px;
    font-weight: 900;
    left: 50%;
    line-height: 1;
    padding: 3px 5px;
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 8;
}

.ww-space.village,
.ww-space.bridge,
.ww-space.key {
    height: clamp(36px, 5.2vw, 50px);
    width: clamp(36px, 5.2vw, 50px);
}

.ww-space.village .ww-board-spot {
    background: radial-gradient(circle at 35% 28%, #fff7cf, #f1c47d 72%, #bd7f42);
}

.ww-space.bridge .ww-board-spot {
    background: radial-gradient(circle at 35% 28%, #e8f5f4, #9cc7c6 72%, #557e82);
}

.ww-space.key .ww-board-spot {
    background: radial-gradient(circle at 35% 28%, #fff7be, #ffd45c 72%, #b87813);
    border-color: #7c5011;
}

.ww-space.tree {
    height: clamp(44px, 6.4vw, 60px);
    width: clamp(39px, 5.7vw, 54px);
    z-index: 5;
}

.ww-tree-piece {
    bottom: 4px;
    display: block;
    height: 88%;
    left: 50%;
    pointer-events: none;
    position: absolute;
    transform: translateX(-50%);
    transform-origin: 50% 94%;
    width: 82%;
    z-index: 5;
}

.ww-tree-shadow {
    background: rgba(24, 57, 42, .34);
    border-radius: 50%;
    bottom: -2px;
    filter: blur(2px);
    height: 10px;
    left: 4px;
    position: absolute;
    transform: skewX(-24deg);
    width: 86%;
}

.ww-tree-trunk {
    background: linear-gradient(90deg, #714422, #ca8b48 48%, #623a1f);
    border: 1px solid #49301f;
    border-radius: 4px;
    bottom: 3px;
    height: 28%;
    left: 42%;
    position: absolute;
    width: 18%;
}

.ww-tree-tier {
    background: linear-gradient(115deg, #61d39b 0%, #16835d 46%, #07533f 100%);
    clip-path: polygon(50% 0, 100% 88%, 82% 100%, 50% 91%, 16% 100%, 0 88%);
    filter: drop-shadow(0 3px 1px rgba(19, 65, 47, .3));
    left: 5%;
    position: absolute;
    width: 90%;
}

.ww-tree-tier.tier-back {
    height: 54%;
    top: 0;
    transform: scale(.68);
}

.ww-tree-tier.tier-middle {
    height: 55%;
    top: 18%;
    transform: scale(.86);
}

.ww-tree-tier.tier-front {
    height: 57%;
    top: 36%;
}

.ww-tree-number {
    align-items: center;
    background: #fff8df;
    border: 1px solid #25314a;
    border-radius: 999px;
    bottom: -5px;
    color: #25314a;
    display: flex;
    font-size: 9px;
    font-style: normal;
    height: 18px;
    justify-content: center;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 18px;
    z-index: 4;
}

.ww-space.move-choice {
    cursor: pointer;
}

.ww-space.selected-landing {
    filter: brightness(1.12) saturate(1.18);
    outline: 0;
    transform: translate(-50%, -50%) scale(1.13);
}

.ww-space.selectable {
    cursor: pointer;
    filter: brightness(1.12) saturate(1.25);
    z-index: 13;
}

.ww-space.selectable .ww-tree-piece {
    animation: ww-tree-choice .9s ease-in-out infinite;
}

.ww-space.selected .ww-tree-piece {
    filter: drop-shadow(0 0 8px #ff8fab);
    transform: translateX(-50%) scale(1.12);
}

.ww-pawns {
    align-items: end;
    display: flex;
    gap: 2px;
    height: 60px;
    justify-content: center;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 48%;
    transform: translate(-50%, -74%);
    z-index: 22;
}

.ww-space.tree .ww-pawns {
    left: 80%;
    top: 72%;
}

.ww-pawn-piece {
    display: block;
    filter: drop-shadow(0 5px 2px rgba(23, 37, 52, .48)) drop-shadow(0 0 1px #fff);
    font-style: normal;
    height: clamp(50px, 7vw, 68px);
    isolation: isolate;
    margin-left: -7px;
    position: relative;
    width: clamp(34px, 4.6vw, 47px);
}

.ww-pawn-piece:first-child {
    margin-left: 0;
}

.ww-pawn-piece:before {
    background: transparent;
    border: 0;
    border-radius: 50%;
    bottom: -2px;
    box-shadow: none;
    content: "";
    height: 24%;
    left: -8%;
    position: absolute;
    width: 116%;
    z-index: 0;
}

.ww-pawn-art {
    display: block;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    position: relative;
    width: 100%;
    z-index: 2;
}

.ww-pawn-head {
    background: radial-gradient(circle at 32% 25%, #fff 0 8%, var(--pawn-color) 24%, color-mix(in srgb, var(--pawn-color) 62%, #111) 100%);
    border: 2px solid #fff8df;
    border-radius: 999px;
    box-shadow: 0 0 0 1.5px #25314a, 1px 3px 0 rgba(37, 49, 74, .38);
    height: 37%;
    left: 25%;
    position: absolute;
    top: 0;
    width: 50%;
    z-index: 3;
}

.ww-pawn-body {
    background: linear-gradient(100deg, color-mix(in srgb, var(--pawn-color) 65%, #111), var(--pawn-color) 50%, color-mix(in srgb, var(--pawn-color) 72%, white));
    border: 2px solid #fff8df;
    border-radius: 50% 50% 18% 18%;
    bottom: 10%;
    clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
    height: 64%;
    left: 8%;
    position: absolute;
    width: 84%;
    z-index: 2;
}

.ww-pawn-base {
    background: color-mix(in srgb, var(--pawn-color) 68%, #111);
    border: 2px solid #fff8df;
    border-radius: 50%;
    bottom: 0;
    box-shadow: 0 3px 2px rgba(37, 49, 74, .35);
    height: 24%;
    left: 0;
    position: absolute;
    width: 100%;
    z-index: 3;
}

.ww-pawn-piece.self {
    filter: drop-shadow(0 6px 2px rgba(23, 37, 52, .52)) drop-shadow(0 0 6px #ffe066) drop-shadow(0 0 2px #fff);
}


.ww-pawn-piece.active-turn:before {
    animation: ww-pawn-focus 1.35s ease-in-out infinite;
}

.ww-pawn-piece.arrived {
    animation: ww-pawn-hop .62s cubic-bezier(.18, .8, .2, 1.18) both;
}

.ww-space.peeking {
    z-index: 30;
}

.ww-space.peeking .ww-tree-piece {
    animation: ww-tree-lift 2.8s ease-in-out both;
}

.ww-tree-secret {
    align-items: center;
    animation: ww-secret-reveal 2.8s ease-in-out both;
    background-color: #fff7c7;
    background-position: center;
    background-size: cover;
    border: 2px solid #25314a;
    border-radius: 10px;
    box-shadow: 0 6px 0 rgba(37, 49, 74, .25);
    color: #25314a;
    display: grid;
    gap: 1px;
    justify-items: center;
    left: 50%;
    min-width: 112px;
    padding: 5px;
    pointer-events: none;
    position: absolute;
    top: 62%;
    transform: translate(-50%, -50%);
    z-index: 24;
}

.ww-tree-secret-content {
    align-items: center;
    backdrop-filter: blur(2px);
    background: rgba(255, 250, 226, .88);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 7px;
    display: grid;
    gap: 1px;
    justify-items: center;
    min-width: 96px;
    padding: 4px 6px;
}

.ww-tree-secret-content .ww-relic-art {
    border: 1px solid rgba(37, 49, 74, .2);
    border-radius: 6px;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.ww-world-rune-coast .ww-tree-secret-content {
    background: rgba(10, 20, 28, .86);
    color: #fff4c4;
    text-shadow: 0 1px 2px #000;
}

.ww-world-frostbound .ww-tree-secret-content {
    background: rgba(241, 250, 255, .9);
    color: #17365d;
}

.ww-world-darkwood .ww-tree-secret-content {
    background: rgba(17, 21, 38, .88);
    color: #f8dd86;
    text-shadow: 0 1px 2px #000;
}

.ww-tree-secret-content b {
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .75));
    font-size: 32px;
    line-height: 1;
}

.ww-relic-fallback {
    font-size: 32px;
    line-height: 1;
}

.ww-tree-secret-content strong {
    font-size: 10px;
    white-space: nowrap;
}

.ww-tree-secret-content small {
    font-size: 7px;
    font-weight: 800;
    max-width: 100px;
}

@keyframes ww-board-arrive {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ww-world-reveal {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.72) rotate(-2deg); }
    58% { opacity: 1; transform: translate(-50%, -50%) scale(1.035) rotate(1deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes ww-world-sticker {
    from { opacity: 0; transform: translateY(24px) scale(.45) rotate(-16deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes ww-world-curtain {
    to { opacity: 0; transform: scale(1.04); }
}

@keyframes ww-target-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes ww-die-tumble {
    0% { transform: translate3d(0, 2px, 0) rotateX(0) rotateY(0) rotateZ(0) scale(1); }
    28% { transform: translate3d(-4px, -10px, 8px) rotateX(95deg) rotateY(70deg) rotateZ(-22deg) scale(.92); }
    58% { transform: translate3d(5px, -5px, 3px) rotateX(185deg) rotateY(155deg) rotateZ(18deg) scale(1.03); }
    82% { transform: translate3d(-2px, -9px, 5px) rotateX(265deg) rotateY(235deg) rotateZ(-12deg) scale(.95); }
    100% { transform: translate3d(0, 2px, 0) rotateX(360deg) rotateY(320deg) rotateZ(0) scale(1); }
}

@keyframes ww-die-land {
    0% { transform: translate3d(0, -16px, 8px) rotateX(-80deg) rotateZ(-16deg) scale(.78); }
    62% { transform: translate3d(0, 3px, 0) rotateX(8deg) rotateZ(4deg) scale(1.1); }
    100% { transform: translateY(0) rotate(0) scale(1); }
}

@keyframes ww-path-dash {
    to { stroke-dashoffset: -4.4; }
}

@keyframes ww-tree-choice {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-7px); }
}

@keyframes ww-pawn-hop {
    0% { opacity: .4; transform: translateY(24px) scale(.7) rotate(-8deg); }
    55% { opacity: 1; transform: translateY(-15px) scale(1.12) rotate(4deg); }
    100% { transform: translateY(0) scale(1) rotate(0); }
}

@keyframes ww-pawn-focus {
    0%, 100% { box-shadow: 0 0 0 2px #25314a, 0 0 0 4px rgba(255, 224, 102, .22), 0 5px 3px rgba(24, 39, 54, .42); transform: scale(1); }
    50% { box-shadow: 0 0 0 2px #25314a, 0 0 0 7px rgba(255, 224, 102, .68), 0 6px 4px rgba(24, 39, 54, .46); transform: scale(1.08); }
}

@keyframes ww-tree-lift {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(0); }
    16%, 78% { transform: translateX(-50%) translateY(-54px) rotate(-5deg) scale(1.04); }
}

@keyframes ww-secret-reveal {
    0%, 8%, 92%, 100% { opacity: 0; transform: translate(-50%, -30%) scale(.68); }
    24%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .game-world-reveal,
    .game-world-reveal-card,
    .game-world-reveal-card img,
    .ww-board,
    .ww-path-active,
    .ww-space.selectable .ww-tree-piece,
    .ww-pawn-piece.arrived,
    .ww-pawn-piece.active-turn:before,
    .ww-space.peeking .ww-tree-piece,
    .ww-tree-secret {
        animation: none;
    }

    .ww-dice-stage.rolling .ww-stage-die,
    .ww-die.rolling,
    .ww-dice-stage.revealed .ww-stage-die {
        animation: none;
    }
}

@media (max-width: 800px) {
    .ww-page {
        padding: 10px;
    }

    .ww-game {
        grid-template-columns: 1fr;
    }

    .ww-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ww-target-card,
    .ww-control-card {
        min-height: 150px;
    }

    .ww-event-card {
        min-height: 102px;
    }

    .ww-board {
        grid-row: 2;
    }
}

@media (max-width: 460px) {
    .game-world-options {
        gap: 7px;
    }

    .game-world-option {
        padding: 7px 3px;
    }

    .ww-sidebar {
        grid-template-columns: 1fr;
    }

    .ww-target-card {
        grid-template-columns: auto 58px 1fr;
        justify-items: start;
        min-height: 96px;
        text-align: start;
    }

    .ww-target-card > span,
    .ww-target-card > small {
        grid-column: 1 / -1;
    }

    .ww-target-emoji {
        font-size: 46px;
    }

    .ww-control-card,
    .ww-event-card {
        min-height: auto;
    }

    .ww-player-strip {
        grid-template-columns: 1fr;
    }

    .ww-player-strip .game-player-card {
        grid-template-columns: 48px minmax(64px, 1fr) 34px minmax(92px, auto);
    }

    .ww-dice-slot.active {
        gap: 4px;
        padding: 5px;
    }

    .ww-dice-slot strong {
        display: none;
    }

    .ww-stage-die {
        font-size: 17px;
        height: 31px;
        width: 31px;
    }

    .ww-tree-secret {
        min-width: 92px;
        padding: 6px;
    }

    .ww-tree-secret b {
        font-size: 27px;
    }

    .ww-board-spot > small {
        display: none;
    }
}

.game-end-overlay {
    align-items: flex-end;
    background: rgba(10, 12, 30, .44);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 18px;
    pointer-events: none;
    position: fixed;
    transition: opacity .22s ease;
    z-index: 1500;
}

.game-end-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.game-end-atmosphere {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
}

.game-end-fx-particle {
    display: block;
    opacity: 0;
    position: absolute;
}

.game-end-atmosphere.win .game-end-fx-particle {
    animation: game-end-confetti var(--fx-duration, 1.9s) cubic-bezier(.12, .62, .32, 1) var(--fx-delay, 0s) both;
    background: var(--fx-color);
    height: 13px;
    left: 50%;
    top: 56%;
    width: 8px;
}

.game-end-atmosphere.loss .game-end-fx-particle,
.game-end-atmosphere.left .game-end-fx-particle {
    animation: game-end-rain var(--fx-rain-duration, 1.55s) linear var(--fx-delay, 0s) both;
    background: linear-gradient(transparent, color-mix(in srgb, var(--sky) 88%, white));
    border-radius: 999px;
    height: 25px;
    left: var(--fx-position);
    top: -28px;
    transform: rotate(9deg);
    width: 3px;
}

.game-end-atmosphere.draw::after {
    animation: game-end-truce-ring 2.2s ease-out .42s both;
    border: 3px solid color-mix(in srgb, var(--violet) 70%, white);
    border-radius: 50%;
    content: "";
    height: 38px;
    left: 50%;
    position: absolute;
    top: 48%;
    transform: translate(-50%, -50%);
    width: 38px;
}

.game-end-atmosphere.draw {
    z-index: 2;
}

.game-end-atmosphere.draw .game-end-fx-particle {
    animation: game-end-firefly-truce 2.4s ease-in-out var(--fx-delay, 0s) both;
    background: var(--fx-draw-color);
    border-radius: 50%;
    box-shadow: 0 0 12px 4px color-mix(in srgb, var(--fx-draw-color) 58%, transparent);
    height: 7px;
    top: var(--fx-position);
    width: 7px;
}

.game-end-atmosphere.moonlit::before {
    background:
        radial-gradient(circle at 18% 22%, rgba(104, 224, 207, .2) 0 2px, transparent 4px),
        radial-gradient(circle at 79% 31%, rgba(248, 202, 120, .27) 0 2px, transparent 5px),
        radial-gradient(circle at 50% 12%, rgba(248, 202, 120, .34), rgba(83, 112, 196, .2) 34%, transparent 67%);
    background-size: 86px 86px, 113px 113px, auto;
    content: "";
    inset: 0;
    opacity: .2;
    position: absolute;
    animation: moonlit-end-glow 4.8s ease-out both;
}

.game-end-atmosphere.moonlit .game-end-fx-particle {
    --fx-color: #f8ca78;
    background: #f8ca78;
    border-radius: 50%;
    box-shadow: 0 0 10px #f8ca78, 0 0 18px rgba(104, 224, 207, .72);
    height: 7px;
    width: 7px;
}

.game-end-atmosphere.moonlit.win .game-end-fx-particle {
    animation: moonlit-firefly-rise calc(var(--fx-duration, 1.9s) + 1.5s) ease-in-out var(--fx-delay, 0s) both;
    bottom: -10px;
    left: var(--fx-position);
    top: auto;
}

.game-end-atmosphere.moonlit.loss .game-end-fx-particle,
.game-end-atmosphere.moonlit.left .game-end-fx-particle {
    animation: moonlit-stardust-fall calc(var(--fx-rain-duration, 1.55s) + 1.8s) ease-in var(--fx-delay, 0s) both;
    background: #8aa8ff;
    height: 5px;
    left: var(--fx-position);
    top: -10px;
    transform: none;
    width: 5px;
}

.game-end-atmosphere.moonlit.draw .game-end-fx-particle {
    animation: moonlit-firefly-orbit calc(var(--fx-duration, 1.9s) + 1.7s) ease-in-out var(--fx-delay, 0s) both;
    bottom: 8%;
    left: var(--fx-position);
    right: auto;
    top: auto;
}

.game-end-atmosphere.draw .fx-side-a {
    --fx-draw-x: 50vw;
    --fx-draw-color: var(--sky);
    left: -10px;
}

.game-end-atmosphere.draw .fx-side-b {
    --fx-draw-x: -50vw;
    --fx-draw-color: var(--coral);
    right: -10px;
}

.game-end-atmosphere .fx-lane-0 { --fx-position: 6%; --fx-burst-x: -46vw; --fx-rise: -34vh; --fx-drift: -28px; --fx-turn: -510deg; }
.game-end-atmosphere .fx-lane-1 { --fx-position: 14%; --fx-burst-x: -38vw; --fx-rise: -42vh; --fx-drift: 20px; --fx-turn: 420deg; }
.game-end-atmosphere .fx-lane-2 { --fx-position: 23%; --fx-burst-x: -30vw; --fx-rise: -31vh; --fx-drift: -16px; --fx-turn: -390deg; }
.game-end-atmosphere .fx-lane-3 { --fx-position: 32%; --fx-burst-x: -22vw; --fx-rise: -45vh; --fx-drift: 28px; --fx-turn: 540deg; }
.game-end-atmosphere .fx-lane-4 { --fx-position: 41%; --fx-burst-x: -14vw; --fx-rise: -37vh; --fx-drift: -22px; --fx-turn: -460deg; }
.game-end-atmosphere .fx-lane-5 { --fx-position: 49%; --fx-burst-x: -6vw; --fx-rise: -48vh; --fx-drift: 14px; --fx-turn: 380deg; }
.game-end-atmosphere .fx-lane-6 { --fx-position: 57%; --fx-burst-x: 7vw; --fx-rise: -46vh; --fx-drift: -14px; --fx-turn: -430deg; }
.game-end-atmosphere .fx-lane-7 { --fx-position: 65%; --fx-burst-x: 15vw; --fx-rise: -35vh; --fx-drift: 24px; --fx-turn: 510deg; }
.game-end-atmosphere .fx-lane-8 { --fx-position: 73%; --fx-burst-x: 23vw; --fx-rise: -44vh; --fx-drift: -26px; --fx-turn: -370deg; }
.game-end-atmosphere .fx-lane-9 { --fx-position: 81%; --fx-burst-x: 31vw; --fx-rise: -32vh; --fx-drift: 18px; --fx-turn: 470deg; }
.game-end-atmosphere .fx-lane-10 { --fx-position: 89%; --fx-burst-x: 39vw; --fx-rise: -41vh; --fx-drift: -18px; --fx-turn: -550deg; }
.game-end-atmosphere .fx-lane-11 { --fx-position: 96%; --fx-burst-x: 47vw; --fx-rise: -36vh; --fx-drift: 26px; --fx-turn: 400deg; }

.game-end-atmosphere .fx-delay-0 { --fx-delay: 0s; --fx-duration: 1.75s; --fx-rain-duration: 1.35s; }
.game-end-atmosphere .fx-delay-1 { --fx-delay: .04s; --fx-duration: 1.9s; --fx-rain-duration: 1.5s; }
.game-end-atmosphere .fx-delay-2 { --fx-delay: .09s; --fx-duration: 2.05s; --fx-rain-duration: 1.65s; }
.game-end-atmosphere .fx-delay-3 { --fx-delay: .15s; --fx-duration: 1.82s; --fx-rain-duration: 1.42s; }
.game-end-atmosphere .fx-delay-4 { --fx-delay: .22s; --fx-duration: 2.12s; --fx-rain-duration: 1.72s; }
.game-end-atmosphere .fx-delay-5 { --fx-delay: .3s; --fx-duration: 1.95s; --fx-rain-duration: 1.55s; }
.game-end-atmosphere .fx-delay-6 { --fx-delay: .39s; --fx-duration: 2.18s; --fx-rain-duration: 1.8s; }
.game-end-atmosphere .fx-delay-7 { --fx-delay: .49s; --fx-duration: 2s; --fx-rain-duration: 1.62s; }

.game-end-atmosphere .fx-color-0 { --fx-color: var(--coral); }
.game-end-atmosphere .fx-color-1 { --fx-color: var(--sky); }
.game-end-atmosphere .fx-color-2 { --fx-color: var(--mint); }
.game-end-atmosphere .fx-color-3 { --fx-color: var(--violet); }
.game-end-atmosphere .fx-color-4 { --fx-color: var(--orange); }
.game-end-atmosphere .fx-color-5 { --fx-color: var(--palette-secondary); }

.game-end-atmosphere.win .fx-shape-1 {
    border-radius: 50%;
    height: 9px;
    width: 9px;
}

.game-end-atmosphere.win .fx-shape-2 {
    height: 5px;
    width: 15px;
}

.game-end-card {
    animation: game-end-pop .34s ease-out both;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(21, 28, 45, .16);
    color: var(--text);
    display: grid;
    gap: 10px;
    max-width: 430px;
    padding: 18px;
    position: relative;
    text-align: center;
    width: min(100%, 430px);
    z-index: 1;
}

.game-end-overlay.moonlit-end {
    background:
        radial-gradient(circle at 50% 15%, rgba(138, 168, 255, .24), transparent 48%),
        rgba(7, 11, 31, .68);
}

.game-end-overlay.moonlit-end .game-end-card {
    border-color: #f8ca78;
    box-shadow:
        0 0 0 4px rgba(28, 40, 83, .92),
        0 0 0 7px rgba(248, 202, 120, .64),
        0 18px 40px rgba(5, 9, 29, .55),
        0 0 42px rgba(104, 224, 207, .24);
    overflow: visible;
}

.game-end-overlay.moonlit-end .game-end-card::before {
    align-items: center;
    background: #17234d;
    border: 2px solid #f8ca78;
    border-radius: 50%;
    box-shadow: 0 3px 0 rgba(6, 10, 29, .45), 0 0 16px rgba(248, 202, 120, .42);
    color: #f8ca78;
    content: "☾";
    display: flex;
    font-size: 25px;
    font-weight: 900;
    height: 42px;
    inset-inline-start: 12px;
    justify-content: center;
    position: absolute;
    top: -22px;
    transform: rotate(-14deg);
    width: 42px;
    z-index: 2;
}

#rematchButton:not(:disabled) {
    background: color-mix(in srgb, var(--palette-tertiary) 78%, white);
    color: var(--accent-strong-text);
    box-shadow: none;
}

#rematchButton:disabled {
    background: color-mix(in srgb, var(--surface) 85%, var(--muted));
    border-color: var(--muted);
    box-shadow: none;
    color: var(--muted);
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none;
}

.game-end-card .btn {
    box-shadow: none;
}

.game-end-hide-button,
.game-end-restore-button {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    box-shadow: none;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
}

.game-end-hide-button {
    border-radius: 999px;
    font-size: 18px;
    height: 36px;
    inset-inline-end: 10px;
    line-height: 1;
    padding: 0;
    position: absolute;
    top: 10px;
    width: 36px;
}

.game-end-restore-button {
    border-radius: 999px;
    bottom: 18px;
    font-size: 15px;
    left: 50%;
    min-height: 42px;
    padding: 8px 16px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 1501;
}

.game-end-hide-button:hover,
.game-end-restore-button:hover {
    background: var(--palette-secondary);
}

.game-end-hide-button:active,
.game-end-restore-button:active {
    box-shadow: none;
    transform: translateY(3px);
}

.game-end-restore-button:active {
    transform: translate(-50%, 3px);
}

.game-end-card.win {
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--surface) 68%, var(--palette-secondary)),
            color-mix(in srgb, var(--surface) 76%, var(--mint))
        );
    border-color: var(--palette-secondary);
    box-shadow: 0 3px 8px color-mix(in srgb, var(--palette-secondary) 18%, transparent);
}

.game-end-card.loss,
.game-end-card.left {
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--surface) 72%, var(--danger)),
            color-mix(in srgb, var(--surface) 80%, var(--danger-bg))
        );
    border-color: var(--danger);
    box-shadow: 0 3px 8px color-mix(in srgb, var(--danger) 16%, transparent);
}

.game-end-card.draw {
    background: color-mix(in srgb, var(--surface) 76%, var(--draw-bg));
    border-color: color-mix(in srgb, var(--draw-text) 62%, var(--line));
}

.game-end-card img {
    filter: drop-shadow(0 7px 0 rgba(37, 49, 74, .16));
    justify-self: center;
    max-height: 96px;
    object-fit: contain;
    width: 96px;
}

.game-end-card > .game-end-mascot {
    max-height: 126px;
    width: 126px;
}

.game-end-signal {
    align-items: center;
    background: var(--surface-3);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--accent-strong-text);
    display: inline-flex;
    font-size: 17px;
    font-weight: 900;
    justify-self: center;
    line-height: 1;
    padding: 8px 14px;
}

.game-end-card .game-end-trophy-icon,
.game-end-restore-button .game-end-trophy-icon {
    filter: none;
    height: 25px;
    margin-inline-end: 5px;
    object-fit: contain;
    width: 25px;
}

.game-end-signal.win {
    background: var(--palette-secondary);
    border-color: var(--status-text);
    color: var(--status-text);
}

.game-end-signal.loss,
.game-end-signal.left {
    background: var(--danger);
    border-color: var(--status-text);
    color: var(--status-text);
}

.game-end-signal.draw {
    background: var(--draw-bg);
    color: var(--draw-text);
}

.game-end-card h1 {
    font-size: 26px;
    line-height: 1.05;
    margin: 0;
}

.game-end-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.game-end-card.human-room-end {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
    width: min(100%, 480px);
    max-width: 480px;
}

.game-end-card.human-room-end > * {
    flex-shrink: 0;
}

.game-end-card.human-room-end > .game-end-signal,
.game-end-card.human-room-end > .game-end-earned-score,
.game-end-card.human-room-end > .game-end-mascot {
    align-self: center;
}

.game-end-card.human-room-end > .game-end-room-messages {
    flex-shrink: 1;
    min-height: 0;
}

.game-end-card.human-room-end > .game-end-mascot {
    height: 64px;
    width: 64px;
}

.game-end-card.human-room-end > .btn-row {
    bottom: 0;
    position: sticky;
    z-index: 2;
}

.game-end-room-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    text-align: start;
}

.game-end-room-messages > .hidden {
    display: none;
}

.game-end-message-list {
    display: grid;
    gap: 6px;
    max-height: min(32dvh, 260px);
    min-height: 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.game-end-room-message {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 6px 8px;
    min-width: 0;
}

.game-end-message-author {
    font-weight: 700;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
    white-space: nowrap;
}

.game-end-card .game-end-room-message > p {
    color: var(--text);
    font-size: 14px;
    grid-column: 1 / -1;
    grid-row: 2;
    line-height: 1.4;
    margin: 0;
    max-height: 4.2em;
    overflow-y: auto;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
    white-space: pre-wrap;
}

.game-end-message-report {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    grid-column: 2;
    grid-row: 1;
    min-height: 28px;
    padding: 3px 7px;
}

html[dir="rtl"] .game-end-message-report {
    direction: rtl;
}

.game-end-message-report:disabled {
    cursor: default;
    opacity: .6;
}

.game-end-report-confirmation {
    animation: game-end-pop .22s ease-out both;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--ink) 18%, transparent);
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    text-align: start;
}

.game-end-report-confirmation:focus {
    outline: none;
}

.game-end-report-confirmation h2 {
    font-size: 19px;
    line-height: 1.2;
    margin: 0;
}

.game-end-card .game-end-report-confirmation > p {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}

.game-end-card .game-end-report-confirmation > .game-end-report-effect {
    color: var(--muted);
}

.game-end-report-quote {
    background: var(--surface-2);
    border-inline-start: 4px solid var(--coral);
    border-radius: 8px;
    color: var(--text);
    line-height: 1.4;
    margin: 2px 0;
    max-height: 5.6em;
    overflow: auto;
    overflow-wrap: anywhere;
    padding: 8px 10px;
    unicode-bidi: plaintext;
}

.game-end-report-reasons {
    border: 0;
    display: grid;
    gap: 6px;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.game-end-report-reasons legend {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    margin-block-end: 4px;
    padding: 0;
}

.game-end-report-reasons label {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 8px;
    min-height: 38px;
    padding: 6px 9px;
}

.game-end-report-reasons label:has(input:checked) {
    border-color: var(--coral);
    box-shadow: 0 0 0 1px var(--coral);
}

.game-end-report-reasons input {
    accent-color: var(--coral);
    flex: 0 0 auto;
    margin: 0;
}

.game-end-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.game-end-report-actions .btn {
    font-size: 14px;
    min-height: 40px;
    padding: 7px 12px;
}
.game-end-message-form {
    --game-end-message-control-height: 50px;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    flex-shrink: 0;
}

.game-end-message-input {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.game-end-message-form textarea {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    height: var(--game-end-message-control-height);
    min-width: 0;
    width: 100%;
    max-height: 80px;
    padding: 6px;
    resize: none;
}

.game-end-message-count {
    color: var(--muted);
    direction: ltr;
    font-size: 11px;
    justify-self: end;
    line-height: 1;
    padding-inline-end: 2px;
}

.game-end-message-form .btn {
    font-size: 14px;
    height: var(--game-end-message-control-height);
    min-height: var(--game-end-message-control-height);
    padding: 7px 10px;
}

.game-end-message-error {
    color: var(--text);
    overflow-wrap: anywhere;
}

.game-end-earned-score {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    display: inline-flex;
    gap: 3px;
    justify-self: center;
    min-height: 44px;
    padding: 4px 8px 4px 5px;
}

.game-end-earned-score > img {
    filter: drop-shadow(0 2px 0 rgba(37, 49, 74, .16));
    height: 32px;
    object-fit: contain;
    width: 32px;
}

.game-end-earned-score > strong {
    font-size: 19px;
    font-weight: 1000;
    line-height: 1;
}

.game-end-earned-score.gain {
    background: color-mix(in srgb, var(--surface-2) 65%, var(--palette-secondary));
}

.game-end-earned-score.gain > strong {
    color: var(--accent-strong-text);
}

.game-end-earned-score.loss {
    background: color-mix(in srgb, var(--surface-2) 82%, var(--danger-bg));
    border-color: color-mix(in srgb, var(--danger) 65%, var(--line));
}

.game-end-earned-score.loss > strong {
    color: var(--danger);
}

.game-end-card .btn-row {
    justify-content: center;
    margin-top: 4px;
}

.bot-end-message {
    align-items: start;
    background: var(--paper-warm);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 5px 0 rgba(37, 49, 74, .14);
    display: grid;
    gap: 6px;
    justify-self: stretch;
    margin: 2px 0;
    padding: 10px 12px;
    position: relative;
    text-align: start;
}

.bot-end-message:before {
    background: var(--paper-warm);
    border-left: 2px solid var(--line);
    border-top: 2px solid var(--line);
    content: "";
    height: 12px;
    left: 22px;
    position: absolute;
    top: -7px;
    transform: rotate(45deg);
    width: 12px;
}

.bot-end-message.pop {
    animation: bot-message-pop .42s cubic-bezier(.18, 1.35, .42, 1) both;
}

.bot-end-speaker {
    align-items: center;
    color: var(--boo-primary);
    display: flex;
    font-size: 14px;
    gap: 8px;
}

.bot-end-image {
    animation: bot-emoji-pop .58s ease-out both;
    filter: drop-shadow(0 5px 0 rgba(37, 49, 74, .16));
    height: 52px;
    object-fit: contain;
    width: 52px;
}

.bot-end-emoji {
    animation: bot-emoji-pop .58s ease-out both;
    display: inline-flex;
    font-size: 22px;
    line-height: 1;
}

.bot-end-message .bot-end-text {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

html[data-theme="dark"] .bot-end-message,
html[data-theme="dark"] .bot-end-message:before {
    background: var(--surface-3);
}

.game-end-score {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text) !important;
    font-weight: 900;
    padding: 8px 10px;
}

.game-end-scores {
    background: transparent;
    border: 0;
    direction: ltr;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
}

.game-end-player-score {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    display: grid;
    gap: 5px 8px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-width: 0;
    padding: 10px;
    position: relative;
    text-align: start;
}

.game-end-player-score.win {
    background: color-mix(in srgb, var(--surface-2) 65%, var(--palette-secondary));
    border-color: var(--palette-secondary);
}

.game-end-player-score.loss,
.game-end-player-score.left {
    background: color-mix(in srgb, var(--surface-2) 82%, var(--danger-bg));
    border-color: color-mix(in srgb, var(--danger) 70%, var(--line));
}

.game-end-player-score.draw {
    background: color-mix(in srgb, var(--surface-2) 75%, var(--draw-bg));
    border-color: color-mix(in srgb, var(--draw-text) 55%, var(--line));
}

.game-end-score-avatar {
    grid-row: 1;
    width: 42px;
}

.game-end-score-avatar > img {
    border: 2px solid var(--line);
    border-radius: 8px;
    filter: none;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.game-end-score-avatar .user-gender-marker {
    bottom: -3px;
    font-size: 9px;
    height: 16px;
    inset-inline-start: -3px;
    width: 16px;
}

.game-end-score-identity {
    display: grid;
    min-width: 0;
}

[dir="rtl"] .game-end-score-identity {
    direction: rtl;
    text-align: right;
}

.game-end-score-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-end-score-identity span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.game-end-score-marker {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    display: flex;
    font-size: 18px;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.game-end-score-value {
    align-items: end;
    display: grid;
    grid-column: 1 / -1;
    justify-content: center;
    text-align: center;
}

.game-end-score-value small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.game-end-score-value strong {
    font-size: 38px;
    line-height: .95;
}

.game-end-score-you {
    background: var(--palette-secondary);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--status-text);
    font-size: 10px;
    font-weight: 900;
    left: 8px;
    padding: 2px 7px;
    position: absolute;
    top: -10px;
}

@media (max-width: 430px) {
    .game-end-overlay {
        align-items: center;
        padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    }

    .game-end-card {
        gap: 7px;
        max-height: 86dvh;
        max-width: 360px;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 12px;
        width: min(100%, 360px);
    }

    .game-end-overlay.moonlit-end .game-end-card {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .game-end-overlay.moonlit-end .game-end-card::before {
        font-size: 21px;
        height: 36px;
        inset-inline-start: 8px;
        top: 8px;
        width: 36px;
    }

    .game-end-hide-button {
        height: 34px;
        top: 8px;
        width: 34px;
    }

    .game-end-card > .game-end-mascot {
        max-height: 76px;
        width: 76px;
    }

    .game-end-signal {
        font-size: 15px;
        padding: 6px 12px;
    }

    .game-end-card h1 {
        font-size: 22px;
    }

    .game-end-card p {
        font-size: 13px;
        line-height: 1.25;
    }

    .bot-end-message {
        gap: 4px;
        margin: 0;
        padding: 8px 10px;
    }

    .bot-end-speaker {
        font-size: 13px;
    }

    .bot-end-image {
        height: 42px;
        width: 42px;
    }

    .bot-end-message .bot-end-text {
        font-size: 13px;
        line-height: 1.25;
    }

    .game-end-scores {
        gap: 6px;
    }

    .game-end-player-score {
        gap: 4px 6px;
        grid-template-columns: 34px minmax(0, 1fr) 26px;
        padding: 7px;
    }

    .game-end-score-avatar,
    .game-end-score-avatar > img {
        height: 34px;
        width: 34px;
    }

    .game-end-score-identity strong {
        font-size: 14px;
    }

    .game-end-score-identity span {
        font-size: 10px;
    }

    .game-end-score-marker {
        font-size: 14px;
        height: 24px;
        width: 24px;
    }

    .game-end-score-value {
        align-items: baseline;
        display: flex;
        gap: 5px;
        grid-column: 2 / 4;
        justify-content: flex-start;
        text-align: start;
    }

    .game-end-score-value small {
        font-size: 9px;
    }

    .game-end-score-value strong {
        font-size: 24px;
    }

    .game-end-score-you {
        font-size: 9px;
        left: 6px;
        top: -8px;
    }

    .game-end-card .btn-row {
        gap: 9px;
        margin-top: 2px;
    }

    .game-end-card .btn-row .btn {
        font-size: 15px;
        min-height: 44px;
        padding: 9px 14px;
    }
}

.waiting-visual {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 110px 1fr;
}

.waiting-visual img {
    animation: floaty 2.8s ease-in-out infinite;
    width: 100%;
}

.waiting-visual .waiting-game-card {
    aspect-ratio: 4 / 3;
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 0 color-mix(in srgb, var(--line) 18%, transparent);
    object-fit: cover;
}

.game-start-countdown {
    background: transparent;
    inset: 0;
    overflow: hidden;
    pointer-events: auto;
    position: fixed;
    z-index: 1450;
}

.game-start-countdown-character {
    bottom: max(8px, env(safe-area-inset-bottom));
    filter: drop-shadow(0 10px 5px rgba(10, 18, 44, .36));
    left: 50%;
    max-height: min(42vh, 330px);
    object-fit: contain;
    position: absolute;
    transform-origin: 50% 100%;
    width: min(42vw, 330px);
}

.game-start-countdown-character.from-left.is-showing {
    animation: game-countdown-from-left var(--game-countdown-step, .8s) cubic-bezier(.2, .78, .25, 1) both;
}

.game-start-countdown-character.bounce-in.is-showing {
    animation: game-countdown-bounce var(--game-countdown-step, .8s) cubic-bezier(.2, .82, .25, 1) both;
}

.game-start-countdown-character.swoop-in.is-showing {
    animation: game-countdown-swoop var(--game-countdown-step, .8s) cubic-bezier(.2, .78, .25, 1) both;
}

@keyframes game-countdown-from-left {
    0% { opacity: 0; transform: translate(-120vw, 20%) rotate(-9deg) scale(.76); }
    28%, 72% { opacity: 1; transform: translate(-50%, 0) rotate(0) scale(1); }
    100% { opacity: 0; transform: translate(46vw, -4%) rotate(7deg) scale(.9); }
}

@keyframes game-countdown-bounce {
    0% { opacity: 0; transform: translate(-50%, 72%) scale(.72); }
    32% { opacity: 1; transform: translate(-50%, -5%) scale(1.05); }
    52%, 76% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, 45%) scale(.82); }
}

@keyframes game-countdown-swoop {
    0% { opacity: 0; transform: translate(48vw, 42%) rotate(12deg) scale(.7); }
    34%, 74% { opacity: 1; transform: translate(-50%, 0) rotate(0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -28%) rotate(-4deg) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .game-start-countdown-character.from-left.is-showing,
    .game-start-countdown-character.bounce-in.is-showing,
    .game-start-countdown-character.swoop-in.is-showing {
        animation: game-countdown-fade var(--game-countdown-step, .8s) ease both;
    }
}

@keyframes game-countdown-fade {
    0%, 100% { opacity: 0; transform: translate(-50%, 0) scale(.92); }
    20%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.hidden {
    display: none !important;
}

.csp-initially-invisible {
    visibility: hidden;
}

[dir="rtl"] .letter-paper {
    padding-left: 18px;
    padding-right: 48px;
}

[dir="rtl"] .paper:before {
    left: auto;
    right: 44px;
}

[dir="rtl"] .text {
    left: 10px;
    right: 48px;
}

[dir="rtl"] .text-read {
    left: 24px;
    right: 62px;
}

[dir="rtl"] .letter-item .letter-content {
    padding-left: 14px;
    padding-right: 48px;
}

[dir="rtl"] .grid-menu-options {
    left: 0;
    right: auto;
}

[dir="rtl"] .game-card-badges {
    left: 10px;
    right: 54px;
}

[dir="rtl"] .game-favourite-button {
    left: auto;
    right: 10px;
}

[dir="rtl"] .game-variant-switch {
    left: auto;
    right: 10px;
}

[dir="rtl"] .rules-close {
    left: 12px;
    right: auto;
}

@keyframes pop {
    from {
        transform: scale(.70);
    }
    to {
        transform: scale(1);
    }
}

@keyframes card-face-pop {
    0% {
        transform: rotateY(18deg) scale(.96);
    }
    70% {
        transform: rotateY(-3deg) scale(1.02);
    }
    100% {
        transform: rotateY(0) scale(1);
    }
}

@keyframes draw-board {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floaty {
    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

@keyframes game-end-pop {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes game-end-confetti {
    0% {
        opacity: 1;
        transform: translate(-50%, 0) rotate(0) scale(.45);
    }
    28% {
        opacity: 1;
        transform: translate(calc(-50% + var(--fx-burst-x)), var(--fx-rise)) rotate(180deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--fx-burst-x) + var(--fx-drift)), 48vh) rotate(var(--fx-turn)) scale(.82);
    }
}

@keyframes game-end-rain {
    0% { opacity: 0; transform: translate(0, -30px) rotate(9deg); }
    12%, 78% { opacity: .72; }
    100% { opacity: 0; transform: translate(var(--fx-drift), 108vh) rotate(9deg); }
}

@keyframes game-end-firefly-truce {
    0% { opacity: 0; transform: translate(0, 16px) scale(.5); }
    18% { opacity: 1; }
    58% { opacity: 1; transform: translate(var(--fx-draw-x), var(--fx-drift)) scale(1.25); }
    76% { opacity: .92; transform: translate(var(--fx-draw-x), calc(var(--fx-drift) - 22px)) scale(1); }
    100% { opacity: 0; transform: translate(var(--fx-draw-x), calc(var(--fx-drift) - 88px)) scale(.35); }
}

@keyframes game-end-truce-ring {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
    32% { opacity: .86; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

@keyframes moonlit-end-glow {
    0% { opacity: 0; transform: scale(.96); }
    18%, 72% { opacity: 1; }
    100% { opacity: .28; transform: scale(1.04); }
}

@keyframes moonlit-firefly-rise {
    0% { opacity: 0; transform: translate(0, 16px) scale(.35); }
    18%, 76% { opacity: 1; }
    48% { transform: translate(var(--fx-drift), -42vh) scale(1.2); }
    100% { opacity: 0; transform: translate(calc(0px - var(--fx-drift)), -88vh) scale(.45); }
}

@keyframes moonlit-stardust-fall {
    0% { opacity: 0; transform: translate(0, -12px) scale(.4); }
    18%, 70% { opacity: .95; }
    100% { opacity: 0; transform: translate(var(--fx-drift), 104vh) scale(1.15); }
}

@keyframes moonlit-firefly-orbit {
    0% { opacity: 0; transform: translate(0, 12px) scale(.35); }
    18% { opacity: 1; }
    48% { opacity: 1; transform: translate(var(--fx-drift), -34vh) scale(1.25); }
    72% { opacity: .9; transform: translate(calc(0px - var(--fx-drift)), -49vh) scale(.9); }
    100% { opacity: 0; transform: translate(0, -67vh) scale(.3); }
}

@media (prefers-reduced-motion: reduce) {
    .game-end-atmosphere {
        display: none;
    }

    .game-end-card {
        animation: none;
    }
}

@keyframes bot-message-pop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bot-emoji-pop {
    0% {
        transform: translateY(8px) rotate(-12deg) scale(.4);
    }
    60% {
        transform: translateY(-4px) rotate(7deg) scale(1.18);
    }
    100% {
        transform: translateY(0) rotate(0) scale(1);
    }
}

@keyframes turn-callout-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes turn-callout-pulse {
    0%, 100% {
        box-shadow: 0 4px 0 rgba(37, 49, 74, .14), 0 0 0 rgba(37, 99, 235, 0);
    }
    50% {
        box-shadow: 0 4px 0 rgba(37, 49, 74, .14), 0 0 0 5px rgba(37, 99, 235, .18);
    }
}

@media (min-width: 760px) and (max-height: 780px) {
    .profile-page .app-shell {
        padding-top: 16px;
        padding-bottom: 70px;
    }

    .profile-page .top-bar {
        padding: 8px 0 18px;
    }

    .profile-page .panel {
        margin: 7px 0;
    }

    .profile-page .profile-hero-panel {
        margin-top: 12px;
    }

    .profile-panel-grid .panel {
        margin: 0;
    }

    .profile-hero-panel {
        grid-template-columns: 128px minmax(0, 1fr);
        padding: 12px;
    }

    .profile-hero-avatar,
    .profile-hero-avatar-frame {
        width: 128px;
    }

    .profile-hero-copy h1 {
        font-size: 26px;
    }

    .profile-card-head {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .profile-card-head img {
        width: 42px;
    }

    .profile-palette-grid .palette-option {
        min-height: 52px;
    }

    .profile-control-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .profile-control .input,
    .profile-control .select {
        font-size: 14px;
        min-height: 36px;
        padding: 7px 9px;
    }

    .profile-bot-card {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .profile-bot-card img {
        width: 60px;
    }
}

@media (max-width: 620px) {
    .app-shell {
        padding: 12px 12px 92px;
    }

    .shelf-controls {
        gap: 5px;
    }

    .shelf-controls .icon-btn {
        height: 40px;
        width: 40px;
    }

    .shelf-controls .icon-btn img {
        height: 28px;
        width: 28px;
    }

    .hero {
        grid-template-columns: 78px 1fr;
    }

    .mini-hero,
    .leader-hero,
    .waiting-visual {
        grid-template-columns: 66px 1fr;
    }

    .hero h1 {
        font-size: 30px;
    }

    .asset-strip {
        grid-template-columns: 1fr;
    }

    .asset-card {
        height: 148px;
    }

    .stats-story-head,
    .stats-story-card {
        grid-template-columns: 62px 1fr;
    }

    .stats-hero-number {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .stats-hero-number strong {
        font-size: 45px;
    }

    .stats-story-grid,
    .game-stat-grid {
        grid-template-columns: 1fr;
    }

    .stats-story-card {
        min-height: 112px;
    }

    .stats-story-card strong {
        font-size: 30px;
    }

    .game-stat-month {
        grid-template-columns: auto 1fr;
    }

    .game-stat-month .mom-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .game-card {
        min-height: 224px;
    }

    .game-status {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .game-status > img {
        width: 52px;
    }

    .game-status-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .move-timer {
        flex: 1 1 auto;
    }

    .friend-link-box,
    .profile-photo,
    .bot-companion-card {
        grid-template-columns: 1fr;
    }

    .profile-panel-grid,
    .profile-control-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero-avatar,
    .profile-hero-avatar-frame {
        width: 104px;
    }

    .profile-hero-copy h1 {
        font-size: 29px;
    }

    .profile-palette-grid {
        grid-template-columns: 1fr;
    }

    .profile-control select.profile-tight-select {
        font-size: 14px;
    }

    .profile-copy-control,
    .profile-link-box.compact .btn,
    .profile-save-row .btn {
        width: 100%;
    }

    .profile-save-row {
        align-items: stretch;
        flex-direction: column;
        grid-row: 11;
    }

    .profile-control-grid[data-active-face="general"] .profile-location-visibility-control {
        grid-row: 12;
    }

    .profile-control-grid[data-active-face="general"] .profile-save-row {
        grid-row: 13;
    }

    .profile-distance-control,
    .profile-control-grid[data-active-face="general"]::before {
        grid-row: 10;
    }

    .profile-control-grid[data-active-face="game"] .profile-distance-control,
    .profile-control-grid[data-active-face="game"] .profile-save-row {
        grid-row: auto;
    }

    .leader-shelf {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 190px;
    }

    .podium-card {
        min-height: 142px;
        padding-inline: 5px;
    }

    .podium-winner {
        min-height: 168px;
    }

    .podium-avatar {
        height: 58px;
        width: 58px;
    }

    .podium-card strong {
        font-size: 11px;
    }

    .chat-item,
    .letter-item,
    .leader-row {
        grid-template-columns: 52px minmax(0, 1fr) auto;
    }

    .leader-score,
    .badge {
        justify-self: start;
    }

    .leader-profile-hero,
    .leader-profile-unavailable {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .leader-profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .leader-profile-honors {
        grid-template-columns: 1fr;
    }

    .leader-game-record-table th:nth-child(2) {
        width: 64px;
    }

    .leader-game-record-table th:nth-child(n + 3) {
        width: 38px;
    }

    .leader-game-record-table th,
    .leader-game-record-table td {
        padding-inline: 3px;
    }

    .leader-game-record-table th button {
        font-size: 10px;
    }

    .leader-profile-action {
        align-items: stretch;
        flex-direction: column;
    }

    .leader-profile-action .btn {
        width: 100%;
    }

    .ttt-board {
        gap: 6px;
    }

    .ttt-cell {
        font-size: 44px;
    }

    .bottom-nav {
        gap: 6px;
        padding: 8px 10px;
    }

    .bottom-nav a {
        flex-basis: 48px;
        font-size: 11px;
        min-height: 46px;
        padding-inline: 6px;
    }

    .bottom-nav a.active {
        flex-basis: 128px;
    }

    .nav-icon {
        height: 30px;
        width: 30px;
    }

    .matches-showcase {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .match-ghost {
        max-width: 90px;
        width: 90px;
    }

    .new-match-strip {
        margin-inline-start: -16px;
        min-height: 96px;
        padding-inline-start: 32px;
    }

    .friend-request-object {
        width: 104px;
    }

    .friend-request-object .avatar {
        height: 62px;
        width: 62px;
    }

    .friend-request-object .friend-request-actions {
        gap: 4px;
        grid-template-columns: repeat(2, 29px);
        width: 62px;
    }

    .friend-request-object .friend-request-action {
        font-size: 18px;
        height: 29px;
        min-height: 29px;
        width: 29px;
    }

    .friend-request-card {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .friend-request-card .avatar {
        height: 52px;
        width: 52px;
    }

    .friend-request-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .friend-request-actions .btn {
        flex: 1 1 auto;
    }

    .friend-confirm-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .friend-confirm-avatar,
    .friend-confirm-avatar-frame {
        border-radius: 14px;
        height: 96px;
        width: 96px;
    }

    .friend-confirm-card h1 {
        font-size: 22px;
    }

    .letter-compose-section {
        margin-inline: -4px;
    }
}

/* Hex */
.hex-page {
    --hex-cell-size: clamp(30px, 6.5vw, 54px);
    align-content: start;
    background-color: var(--page-bg);
    min-height: 100vh;
}

.hex-guide {
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-accent));
    border: 2px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
    margin: 12px auto;
    max-width: 920px;
    padding: 10px 14px;
    text-align: center;
}

.hex-guide p {
    margin: 0;
}

.hex-edge-pill {
    border: 2px solid currentColor;
    border-radius: 999px;
    font-weight: 800;
    padding: 7px 10px;
    white-space: nowrap;
}

.hex-edge-pill.coral {
    color: #d94c72;
}

.hex-edge-pill.blue {
    color: #2587b4;
}

.hex-guide .btn {
    grid-column: 1 / -1;
    justify-self: center;
}

.hex-board-shell {
    background:
        radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 35%),
        linear-gradient(145deg, color-mix(in srgb, var(--panel) 90%, white), var(--panel));
    border: 3px solid var(--line);
    box-shadow: 0 10px 0 var(--shadow);
    margin: 0 auto 28px;
    max-width: 920px;
    overflow: auto;
    padding: clamp(22px, 5vw, 46px);
}

.hex-board {
    display: flex;
    flex-direction: column;
    min-width: calc(var(--hex-cell-size) * 12);
    width: max-content;
}

.hex-row {
    display: flex;
    height: calc(var(--hex-cell-size) * .86);
    margin-inline-start: calc(var(--hex-row) * var(--hex-cell-size) * .5);
}

.hex-cell {
    align-items: center;
    appearance: none;
    background: color-mix(in srgb, var(--card) 88%, var(--accent));
    border: 2px solid color-mix(in srgb, var(--line) 75%, transparent);
    box-shadow: inset 0 0 0 3px color-mix(in srgb, white 35%, transparent);
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
    cursor: pointer;
    display: flex;
    flex: 0 0 var(--hex-cell-size);
    height: var(--hex-cell-size);
    justify-content: center;
    margin-inline-end: 2px;
    padding: 0;
    position: relative;
    transition: filter .15s ease, transform .15s ease;
    width: var(--hex-cell-size);
}

.hex-cell::after {
    background: var(--stone-color);
    border: 2px solid color-mix(in srgb, var(--line) 70%, white);
    border-radius: 50%;
    box-shadow: 0 3px 0 color-mix(in srgb, var(--line) 55%, transparent);
    content: "";
    height: 64%;
    opacity: 0;
    transform: scale(.45);
    transition: opacity .2s ease, transform .25s cubic-bezier(.2, 1.5, .5, 1);
    width: 64%;
}

.hex-cell.occupied::after {
    opacity: 1;
    transform: scale(1);
}

.hex-cell.available:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.hex-cell.winning {
    filter: drop-shadow(0 0 8px #ffe372);
    z-index: 1;
}

.hex-cell.just-placed::after {
    animation: hex-stone-land .45s cubic-bezier(.2, 1.5, .5, 1);
}

@keyframes hex-stone-land {
    0% {
        opacity: 0;
        transform: translateY(-28px) rotate(-12deg) scale(.5);
    }
    70% {
        opacity: 1;
        transform: translateY(3px) rotate(2deg) scale(1.08);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 620px) {
    .hex-guide {
        grid-template-columns: 1fr 1fr;
    }

    .hex-guide p {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .hex-board-shell {
        padding: 18px 10px 26px;
    }
}

/* Gomoku */
.gomoku-page {
    align-content: start;
    background-color: var(--page-bg);
    min-height: 100vh;
}

.gomoku-guide {
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-accent));
    border: 2px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
    margin: 12px auto;
    max-width: 820px;
    padding: 10px 14px;
}

.gomoku-guide > span {
    background: var(--accent);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--button-text);
    font-weight: 800;
    padding: 7px 12px;
}

.gomoku-guide p {
    margin: 0;
    text-align: center;
}

.gomoku-board-shell {
    background:
        linear-gradient(color-mix(in srgb, white 22%, transparent), transparent),
        #d6ae73;
    border: 3px solid #4b3827;
    box-shadow: 0 10px 0 var(--shadow);
    margin: 0 auto 28px;
    max-width: 820px;
    overflow: auto;
    padding: clamp(20px, 4vw, 36px);
}

.gomoku-board {
    --gomoku-cell: clamp(25px, 5.8vw, 45px);
    background-image:
        linear-gradient(to right, transparent calc(50% - 1px), #574331 calc(50% - 1px), #574331 calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to bottom, transparent calc(50% - 1px), #574331 calc(50% - 1px), #574331 calc(50% + 1px), transparent calc(50% + 1px));
    display: grid;
    grid-template-columns: repeat(var(--gomoku-size), var(--gomoku-cell));
    margin: auto;
    min-width: calc(var(--gomoku-cell) * var(--gomoku-size));
    width: max-content;
}

.gomoku-cell {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    height: var(--gomoku-cell);
    padding: 0;
    position: relative;
    width: var(--gomoku-cell);
}

.gomoku-cell::after {
    background:
        radial-gradient(circle at 34% 28%, color-mix(in srgb, white 70%, transparent), transparent 22%),
        var(--stone-color);
    border: 2px solid color-mix(in srgb, var(--stone-color) 78%, #111);
    border-radius: 50%;
    box-shadow: 0 3px 2px #0005;
    content: "";
    inset: 7%;
    opacity: 0;
    position: absolute;
    transform: scale(.45);
    transition: opacity .2s ease, transform .2s ease;
}

.gomoku-cell.occupied::after {
    opacity: 1;
    transform: scale(1);
}

.gomoku-cell.available:hover::before {
    background: color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 50%;
    content: "";
    inset: 20%;
    position: absolute;
}

.gomoku-cell.winning::after {
    box-shadow: 0 0 0 4px #ffe27a, 0 0 14px #fff4a8;
}

.gomoku-cell.just-placed::after {
    animation: gomoku-stone-land .38s cubic-bezier(.2, 1.45, .45, 1);
}

@keyframes gomoku-stone-land {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(.55);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 620px) {
    .gomoku-guide {
        grid-template-columns: auto 1fr;
    }

    .gomoku-guide .btn {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .gomoku-board-shell {
        padding: 20px 7px;
    }
}

/* Nine Men's Morris */
.morris-page {
    align-content: start;
    background-color: var(--page-bg);
    min-height: 100vh;
}

.morris-guide {
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-accent));
    border: 2px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr auto auto;
    margin: 12px auto;
    max-width: 760px;
    padding: 10px 14px;
    text-align: center;
}

.morris-guide > div {
    align-items: center;
    background: var(--card);
    border: 2px solid var(--line);
    display: flex;
    gap: 7px;
    padding: 7px 10px;
}

.morris-guide strong {
    color: var(--accent);
    font-size: 1.35rem;
}

.morris-guide p,
.morris-guide span {
    margin: 0;
}

.morris-board-shell {
    background:
        radial-gradient(circle at 50% 40%, #f5dfb8, #bd814d 85%);
    border: 4px solid #4d2e24;
    box-shadow: inset 0 0 0 5px #f6dba9, 0 10px 0 var(--shadow);
    margin: 0 auto 30px;
    max-width: 690px;
    padding: clamp(10px, 3vw, 28px);
}

.morris-board {
    aspect-ratio: 1;
    margin: auto;
    max-width: 610px;
    position: relative;
    width: 100%;
}

.morris-lines {
    height: 100%;
    inset: 0;
    overflow: visible;
    position: absolute;
    width: 100%;
}

.morris-lines line {
    stroke: #4a3128;
    stroke-linecap: round;
    stroke-width: 10;
}

.morris-point {
    appearance: none;
    background: #fff5d9;
    border: 3px solid #4a3128;
    border-radius: 50%;
    cursor: pointer;
    height: clamp(32px, 7.8vw, 58px);
    left: var(--point-x);
    padding: 0;
    position: absolute;
    top: var(--point-y);
    transform: translate(-50%, -50%);
    transition: filter .15s ease, transform .15s ease;
    width: clamp(32px, 7.8vw, 58px);
}

.morris-point::after {
    background:
        radial-gradient(circle at 34% 26%, #fff9 0 12%, transparent 13%),
        var(--piece-color);
    border: 2px solid #30243c;
    border-radius: 50%;
    box-shadow: 0 4px 0 #0004;
    content: "";
    inset: 8%;
    opacity: 0;
    position: absolute;
    transform: scale(.4);
    transition: opacity .2s ease, transform .25s ease;
}

.morris-point.occupied::after {
    opacity: 1;
    transform: scale(1);
}

.morris-point.available {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent);
}

.morris-point.selected {
    box-shadow: 0 0 0 6px #ffe16b, 0 0 18px #fff1a0;
    transform: translate(-50%, -50%) scale(1.08);
}

.morris-point.just-changed::after {
    animation: morris-piece-snap .5s cubic-bezier(.2, 1.5, .5, 1);
}

@keyframes morris-piece-snap {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(-12deg) scale(.45);
    }
    75% {
        opacity: 1;
        transform: translateY(2px) scale(1.12);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 620px) {
    .morris-guide {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .morris-guide p {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .morris-reserve {
        display: none !important;
    }
}

/* Kalah */
.kalah-page {
    align-content: start;
    background-color: var(--page-bg);
    min-height: 100vh;
}

.kalah-guide {
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-accent));
    border: 2px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: center;
    margin: 12px auto;
    max-width: 940px;
    padding: 10px 14px;
}

.kalah-guide span {
    background: var(--accent);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--button-text);
    font-weight: 800;
    padding: 7px 12px;
}

.kalah-guide p {
    margin: 0;
}

.kalah-board-shell {
    margin: 0 auto 30px;
    max-width: 980px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.kalah-board {
    background:
        linear-gradient(145deg, #dfa365, #8d542f);
    border: 5px solid #4c2b20;
    box-shadow: inset 0 0 0 5px #f4c887, 0 10px 0 var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: 110px minmax(600px, 1fr) 110px;
    min-width: 860px;
    padding: 18px;
}

.kalah-pit-rows {
    display: grid;
    gap: 8px;
}

.kalah-pit-row {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(6, 1fr);
}

.kalah-divider {
    background: #4c2b20;
    border-radius: 999px;
    height: 4px;
}

.kalah-pit,
.kalah-store {
    background:
        radial-gradient(ellipse at 50% 65%, #6d3c29 0 48%, #3c211a 70%);
    border: 3px solid #3d2118;
    box-shadow: inset 0 7px 11px #160c0a99, 0 3px 0 #f6ce91;
    color: #fff8e4;
    overflow: hidden;
    position: relative;
}

.kalah-pit {
    aspect-ratio: 1;
    border-radius: 44%;
    cursor: pointer;
    min-width: 82px;
}

.kalah-store {
    align-items: center;
    border-radius: 46%;
    display: flex;
    justify-content: center;
    min-height: 190px;
}

.kalah-pit strong,
.kalah-store strong {
    background: #171327cc;
    border: 2px solid #fff4;
    border-radius: 999px;
    bottom: 5px;
    font-size: 1rem;
    min-width: 28px;
    padding: 2px 6px;
    position: absolute;
    right: 5px;
    text-align: center;
    z-index: 2;
}

.kalah-store strong {
    bottom: auto;
    font-size: 1.45rem;
    right: auto;
}

.kalah-stones {
    inset: 12%;
    position: absolute;
}

.kalah-stones i {
    --stone-color: hsl(calc(var(--stone-index) * 31 + 18) 78% 68%);
    background:
        radial-gradient(circle at 32% 27%, #fff9 0 15%, transparent 16%),
        var(--stone-color);
    border: 1px solid #2c1830;
    border-radius: 50%;
    height: 20px;
    left: calc((var(--stone-index) * 29) % 76 * 1%);
    position: absolute;
    top: calc((var(--stone-index) * 43) % 72 * 1%);
    transform: rotate(calc(var(--stone-index) * 19deg));
    width: 17px;
}

.kalah-pit[data-owner].receiving,
.kalah-store[data-owner].receiving {
    animation: kalah-receive .28s ease;
}

@keyframes kalah-receive {
    50% {
        filter: brightness(1.45);
        transform: translateY(-5px) scale(1.05);
    }
}

@media (max-width: 620px) {
    .kalah-guide {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
}

/* Fox and Geese */
.fox-page {
    align-content: start;
    background-color: var(--page-bg);
    min-height: 100vh;
}

.fox-guide {
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-accent));
    border: 2px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
    margin: 12px auto;
    max-width: 790px;
    padding: 10px 14px;
    text-align: center;
}

.fox-guide > div {
    align-items: center;
    background: var(--card);
    border: 2px solid var(--line);
    display: flex;
    gap: 8px;
    padding: 7px 10px;
}

.fox-guide strong {
    color: var(--accent);
    font-size: 1.25rem;
}

.fox-guide p {
    margin: 0;
}

.fox-board-shell {
    background:
        radial-gradient(circle at 48% 42%, #f4e9ad, #9dcf87 72%, #477455);
    border: 4px solid #304b39;
    box-shadow: inset 0 0 0 5px #e9d990, 0 10px 0 var(--shadow);
    margin: 0 auto 30px;
    max-width: 750px;
    padding: 12px clamp(10px, 3vw, 28px) 24px;
}

.fox-board-shell > p {
    background: #fffbe1dc;
    border: 2px solid #304b39;
    color: #213329;
    font-weight: 700;
    margin: 0 auto 10px;
    max-width: 600px;
    padding: 7px 10px;
    text-align: center;
}

.fox-board {
    aspect-ratio: 1;
    margin: auto;
    max-width: 650px;
    position: relative;
}

.fox-lines {
    height: 100%;
    inset: 0;
    overflow: visible;
    position: absolute;
    width: 100%;
}

.fox-lines line {
    stroke: #455d3c;
    stroke-linecap: round;
    stroke-width: 9;
}

.fox-point {
    appearance: none;
    background: #fff8ca;
    border: 3px solid #344c3a;
    border-radius: 50%;
    cursor: pointer;
    height: clamp(34px, 8vw, 62px);
    left: var(--point-x);
    padding: 0;
    position: absolute;
    top: var(--point-y);
    transform: translate(-50%, -50%);
    transition: filter .15s ease, transform .15s ease;
    width: clamp(34px, 8vw, 62px);
}

.fox-point::after {
    align-items: center;
    border-radius: 50%;
    display: flex;
    font-size: clamp(1.3rem, 4.5vw, 2.4rem);
    inset: 4%;
    justify-content: center;
    opacity: 0;
    position: absolute;
    transform: scale(.45);
    transition: opacity .2s ease, transform .25s ease;
}

.fox-point.fox::after {
    background: #ffd78c;
    box-shadow: 0 3px 0 #9a512e;
    content: "🦊";
    opacity: 1;
    transform: scale(1);
}

.fox-point.goose::after {
    background: #dff5ff;
    box-shadow: 0 3px 0 #5888a0;
    content: "🪿";
    opacity: 1;
    transform: scale(1);
}

.fox-point.available {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 38%, transparent);
}

.fox-point.selected {
    box-shadow: 0 0 0 6px #ffe16b, 0 0 18px #fff1a0;
    transform: translate(-50%, -50%) scale(1.08);
}

.fox-point.just-moved::after {
    animation: fox-piece-hop .55s cubic-bezier(.2, 1.45, .45, 1);
}

.fox-leg-banner {
    background: linear-gradient(135deg, var(--accent), var(--panel-accent));
    border: 3px solid var(--line);
    box-shadow: 0 8px 0 var(--shadow);
    font-size: clamp(1.05rem, 3vw, 1.4rem);
    font-weight: 900;
    left: 50%;
    padding: 16px 22px;
    position: fixed;
    text-align: center;
    top: 45%;
    transform: translate(-50%, -50%);
    z-index: 30;
}

@keyframes fox-piece-hop {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotate(-9deg) scale(.55);
    }
    75% {
        opacity: 1;
        transform: translateY(3px) scale(1.12);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 620px) {
    .fox-guide {
        grid-template-columns: 1fr 1fr;
    }

    .fox-guide p {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

/* Reversi */
.reversi-page {
    --reversi-board: #167468;
}

.reversi-score-ribbon {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    grid-template-columns: 64px 1fr 64px;
    margin: 12px auto;
    max-width: 740px;
    padding: 10px;
    text-align: center;
}

.reversi-score-ribbon span {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 50%;
    display: grid;
    font-size: 1.35rem;
    font-weight: 900;
    height: 52px;
    place-items: center;
}

.reversi-score-ribbon p {
    font-weight: 800;
    margin: 0;
}

.reversi-board-shell {
    background: color-mix(in srgb, var(--reversi-board) 80%, var(--line));
    border: 4px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 720px;
    padding: 10px;
}

.reversi-board {
    aspect-ratio: 1;
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(8, 1fr);
}

.reversi-cell {
    aspect-ratio: 1;
    background: var(--reversi-board);
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 3px;
    padding: 10%;
    position: relative;
}

.reversi-cell span {
    background: var(--disc-color);
    border: 2px solid color-mix(in srgb, var(--line) 75%, transparent);
    border-radius: 50%;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 40%, transparent);
    display: block;
    height: 100%;
    opacity: 0;
    transform: scale(.35);
    transition: opacity .2s ease, transform .25s ease;
    width: 100%;
}

.reversi-cell.occupied span {
    opacity: 1;
    transform: scale(1);
}

.reversi-cell.legal::after {
    background: color-mix(in srgb, var(--sky) 72%, white);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--sky) 35%, transparent);
    content: "";
    height: 22%;
    left: 39%;
    position: absolute;
    top: 39%;
    width: 22%;
}

.reversi-cell.legal:hover {
    filter: brightness(1.15);
}

.reversi-cell span.flipping {
    animation: reversi-flip .62s ease both;
}

@keyframes reversi-flip {
    0% { transform: perspective(220px) rotateY(0); }
    45% { transform: perspective(220px) rotateY(90deg) scale(1.12); }
    100% { transform: perspective(220px) rotateY(180deg); }
}

/* Fanorona */
.fanorona-guide {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 12px auto;
    max-width: 900px;
    min-height: 62px;
    padding: 10px 16px;
}

.fanorona-guide p {
    font-weight: 800;
    margin: 0;
}

.fanorona-capture-choice {
    display: flex;
    gap: 8px;
}

.fanorona-capture-choice button,
.chopsticks-splits button,
.sea-battle-ship-tray button {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    font-weight: 900;
    min-height: 42px;
    padding: 8px 12px;
}

.fanorona-board-shell {
    background:
        linear-gradient(135deg, rgba(255, 228, 173, .96), rgba(201, 137, 75, .94));
    border: 4px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 920px;
    padding: 18px;
}

.fanorona-board {
    display: block;
    overflow: visible;
    width: 100%;
}

.fanorona-line {
    stroke: color-mix(in srgb, var(--line) 78%, #8c4d2b);
    stroke-linecap: round;
    stroke-width: 7;
}

.fanorona-point {
    cursor: pointer;
    fill: var(--stone-color);
    filter: drop-shadow(0 5px 0 rgba(37, 35, 58, .34));
    stroke: var(--line);
    stroke-width: 5;
    transition: filter .2s ease, r .2s ease;
}

.fanorona-point:not(.occupied) {
    fill: #fff1c9;
    r: 13px;
}

.fanorona-point.selected {
    filter: drop-shadow(0 0 10px #ffe16b);
    r: 30px;
    stroke: #fff1a8;
    stroke-width: 8;
}

.fanorona-point.destination {
    fill: color-mix(in srgb, var(--sky) 72%, white);
    filter: drop-shadow(0 0 12px var(--sky));
    r: 21px;
    stroke: white;
}

/* Nim */
.nim-note {
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 12px auto;
    max-width: 800px;
    padding: 14px;
    text-align: center;
}

.nim-note p {
    margin: 5px 0 0;
}

.nim-board {
    align-items: end;
    background:
        radial-gradient(circle at 20% 16%, rgba(255, 255, 255, .12) 0 2px, transparent 3px),
        linear-gradient(145deg, #162a55, #273d72);
    background-size: 38px 38px, auto;
    border: 4px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 auto;
    max-width: 850px;
    min-height: 480px;
    padding: 24px;
}

.nim-heap {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-end;
}

.nim-heap strong {
    color: white;
    text-align: center;
}

.nim-tokens {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nim-tokens button {
    background: transparent;
    border: 0;
    color: var(--yellow);
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .32));
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    height: 48px;
    line-height: 1;
    padding: 0;
    transition: filter .2s ease, transform .2s ease;
    width: 62px;
}

.nim-heap-2 .nim-tokens button { color: var(--sky); }
.nim-heap-3 .nim-tokens button { color: var(--mint); }
.nim-heap-4 .nim-tokens button { color: var(--coral); }

.nim-tokens button:hover:not(:disabled) {
    filter: drop-shadow(0 0 10px white);
    transform: translateY(-4px) rotate(8deg);
}

/* Chopsticks */
.chopsticks-arena {
    align-items: center;
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--yellow) 38%, transparent), transparent 28%),
        var(--feature-gradient);
    border: 4px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 72px 1fr;
    margin: 12px auto;
    max-width: 900px;
    min-height: 390px;
    padding: 22px;
}

.chopsticks-side {
    text-align: center;
}

.chopsticks-side > strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 14px;
}

.chopsticks-hands {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chopsticks-hand {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 170px;
    justify-content: center;
    padding: 8px;
    transition: transform .2s ease, box-shadow .2s ease;
    width: min(125px, 42%);
}

.chopsticks-hand span {
    font-size: clamp(3rem, 8vw, 5.2rem);
    line-height: 1;
}

.chopsticks-hand strong {
    background: var(--line);
    border-radius: 50%;
    color: white;
    display: grid;
    font-size: 1.15rem;
    height: 34px;
    place-items: center;
    width: 34px;
}

.chopsticks-hand.selected {
    box-shadow: 0 0 0 6px var(--sky);
    transform: translateY(-8px) rotate(-3deg);
}

.chopsticks-hand.dead {
    filter: grayscale(1);
    opacity: .42;
}

.chopsticks-tap-spark {
    color: var(--yellow);
    font-size: 3.6rem;
    text-align: center;
    text-shadow: 0 0 16px white;
}

.chopsticks-controls {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 12px auto;
    max-width: 900px;
    padding: 12px 16px;
}

.chopsticks-controls p {
    font-weight: 800;
    margin: 0;
}

.chopsticks-splits {
    display: flex;
    gap: 8px;
}

/* Sea Battle */
.sea-battle-setup {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    margin: 12px auto;
    max-width: 980px;
    padding: 14px;
}

.sea-battle-setup p {
    margin: 4px 0 0;
}

.sea-battle-ship-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.sea-battle-ship-tray button {
    color: var(--sky);
    letter-spacing: 1px;
}

.sea-battle-ship-tray button.selected {
    background: color-mix(in srgb, var(--sky) 40%, var(--surface));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 38%, transparent);
}

.sea-battle-oceans {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
    margin: 0 auto;
    max-width: 980px;
}

.sea-battle-oceans article {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 12px;
}

.sea-battle-oceans h2 {
    font-size: 1.05rem;
    margin: 0 0 8px;
    text-align: center;
}

.sea-battle-board {
    aspect-ratio: 1;
    background: #dff7ff;
    border: 2px solid var(--line);
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(8, 1fr);
}

.sea-cell {
    aspect-ratio: 1;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .22), transparent),
        #7fd5ed;
    border: 1px solid rgba(37, 35, 58, .28);
    color: var(--line);
    font-size: clamp(.8rem, 3vw, 1.8rem);
    font-weight: 900;
    padding: 0;
    position: relative;
}

.sea-cell.ship {
    background: #ffe7a8;
}

.sea-cell.ship::before {
    background: #35496c;
    border-radius: 45% 45% 24% 24%;
    content: "";
    inset: 24% 10%;
    position: absolute;
}

.sea-cell.miss {
    background: #dff7ff;
    color: #2189ac;
}

.sea-cell.hit,
.sea-cell.sunk {
    animation: sea-hit .45s ease both;
    background: #ffb3c1;
    color: #9f1239;
}

.sea-cell.sunk {
    background: #ff718d;
}

.sea-battle-hint {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 2px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
    margin: 12px auto;
    max-width: 980px;
    padding: 10px;
    text-align: center;
}

@keyframes sea-hit {
    0% { filter: brightness(2); transform: scale(.35) rotate(-20deg); }
    72% { transform: scale(1.22) rotate(8deg); }
    100% { transform: none; }
}

@media (max-width: 680px) {
    .fanorona-guide,
    .chopsticks-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .fanorona-capture-choice,
    .chopsticks-splits {
        justify-content: center;
    }

    .nim-board {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 390px;
        padding: 15px 8px;
    }

    .nim-tokens button {
        font-size: 2.15rem;
        height: 40px;
        width: 42px;
    }

    .chopsticks-arena {
        gap: 7px;
        grid-template-columns: 1fr 34px 1fr;
        min-height: 310px;
        padding: 12px 8px;
    }

    .chopsticks-hand {
        height: 135px;
        padding: 3px;
    }

    .chopsticks-tap-spark {
        font-size: 2rem;
    }

    .sea-battle-setup {
        grid-template-columns: 1fr;
    }

    .sea-battle-oceans {
        gap: 7px;
    }

    .sea-battle-oceans article {
        padding: 6px;
    }
}

/* Merge Race */
.merge-race-page,
.word-ladder-page,
.liars-dice-page,
.golf-page,
.crazy-eights-page {
    min-height: 100dvh;
    padding-bottom: 28px;
}

.merge-race-banner {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto 1fr;
    margin: 12px auto;
    max-width: 760px;
    padding: 10px 16px;
    text-align: center;
    width: calc(100% - 24px);
}

.merge-race-banner span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.merge-race-banner span:last-child {
    text-align: end;
}

.merge-race-banner span:first-child {
    text-align: start;
}

.merge-race-banner strong {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
}

.merge-race-boards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 780px;
    width: calc(100% - 24px);
}

.merge-race-board {
    background: color-mix(in srgb, var(--surface) 90%, var(--violet));
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 12px;
}

.merge-race-board.self {
    background: color-mix(in srgb, var(--surface) 86%, var(--pink));
    border-color: var(--pink);
}

.merge-race-board header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.merge-race-board header span,
.merge-race-board > small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.merge-race-board > small {
    display: block;
    margin-top: 8px;
    text-align: center;
}

.merge-race-grid {
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--line) 78%, #654c7f), var(--line));
    border: 3px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
}

.merge-race-tile {
    align-items: center;
    aspect-ratio: 1;
    background: color-mix(in srgb, var(--surface) 24%, transparent);
    border: 2px solid color-mix(in srgb, var(--surface) 42%, transparent);
    border-radius: 7px;
    display: flex;
    font-size: clamp(.78rem, 3vw, 1.2rem);
    font-weight: 900;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}

.merge-race-tile.filled {
    animation: mergeTileLand .28s ease-out;
    background: color-mix(in srgb, var(--yellow) 78%, white);
    border-color: #fff6d2;
    color: #302741;
    box-shadow: inset 0 -4px 0 rgba(37, 35, 58, .18);
}

.merge-race-tile[data-value="4"] { background: color-mix(in srgb, var(--sky) 62%, white); }
.merge-race-tile[data-value="8"] { background: color-mix(in srgb, var(--mint) 68%, white); }
.merge-race-tile[data-value="16"] { background: color-mix(in srgb, var(--pink) 62%, white); }
.merge-race-tile[data-value="32"] { background: color-mix(in srgb, var(--orange) 70%, white); }
.merge-race-tile[data-value="64"] { background: color-mix(in srgb, var(--coral) 72%, white); }
.merge-race-tile[data-value="128"],
.merge-race-tile[data-value="256"],
.merge-race-tile[data-value="512"],
.merge-race-tile[data-value="1024"],
.merge-race-tile[data-value="2048"] {
    background: linear-gradient(145deg, var(--violet), var(--pink));
    color: #fff;
}

.merge-race-controls {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(3, 58px);
    grid-template-areas: ". up ." "left down right";
    justify-content: center;
    margin: 16px auto;
}

.merge-race-controls button {
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    font-size: 1.45rem;
    height: 52px;
}

.merge-race-controls button:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(4px);
}

.merge-race-controls button:disabled {
    opacity: .38;
}

.merge-race-controls [data-direction="up"] { grid-area: up; }
.merge-race-controls [data-direction="left"] { grid-area: left; }
.merge-race-controls [data-direction="down"] { grid-area: down; }
.merge-race-controls [data-direction="right"] { grid-area: right; }

@keyframes mergeTileLand {
    from { opacity: .25; transform: scale(.72); }
    70% { transform: scale(1.08); }
    to { opacity: 1; transform: scale(1); }
}

/* Word Ladder Duel */
.word-ladder-goal {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto 1fr auto;
    margin: 12px auto;
    max-width: 720px;
    padding: 12px 18px;
    width: calc(100% - 24px);
}

.word-ladder-goal div {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 7px 12px;
    text-align: center;
}

.word-ladder-goal small,
.word-ladder-goal em {
    color: var(--muted);
    font-size: .7rem;
    font-style: normal;
    font-weight: 900;
}

.word-ladder-goal strong {
    display: block;
    font-size: 1.28rem;
    letter-spacing: 0;
}

.word-ladder-race {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 760px;
    width: calc(100% - 24px);
}

.word-ladder-sheet {
    background:
        linear-gradient(90deg, transparent 39px, color-mix(in srgb, var(--coral) 58%, transparent) 40px, transparent 41px),
        repeating-linear-gradient(0deg, var(--paper-surface) 0 31px, color-mix(in srgb, var(--sky) 52%, transparent) 32px 33px);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #25233a;
    min-height: 340px;
    padding: 15px 14px 15px 54px;
}

.word-ladder-sheet.self {
    border-color: var(--sky);
}

.word-ladder-sheet header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-height: 34px;
}

.word-ladder-sheet header span,
.word-ladder-sheet p {
    color: #667085;
    font-size: .76rem;
}

.word-ladder-steps {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 13px 0;
    min-height: 188px;
}

.word-ladder-steps span {
    animation: ladderStep .35s ease-out both;
    animation-delay: calc(var(--step) * 45ms);
    font-family: "Courier New", monospace;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: lowercase;
}

.word-ladder-steps span:not(:last-child)::after {
    color: var(--coral);
    content: " ↓";
}

.word-ladder-sheet form {
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr auto;
}

.word-ladder-sheet input {
    background: rgba(255, 255, 255, .82);
    border: 2px solid #25233a;
    border-radius: 7px;
    color: #25233a;
    min-width: 0;
    padding: 10px;
}

.word-ladder-hidden-path {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 190px;
}

.word-ladder-hidden-path span {
    align-items: center;
    animation: hiddenWordBob 2.4s ease-in-out infinite;
    background: color-mix(in srgb, var(--violet) 38%, white);
    border: 2px solid #25233a;
    border-radius: 8px;
    display: flex;
    font-size: 1.3rem;
    font-weight: 900;
    height: 55px;
    justify-content: center;
    transform: rotate(-3deg);
    width: 48px;
}

.word-ladder-hidden-path span:nth-child(2) { animation-delay: .18s; transform: rotate(2deg); }
.word-ladder-hidden-path span:nth-child(3) { animation-delay: .36s; transform: rotate(-1deg); }

@keyframes ladderStep {
    from { opacity: 0; transform: translateX(-18px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes hiddenWordBob {
    50% { transform: translateY(-5px) rotate(2deg); }
}

/* Liar's Dice */
.liars-table {
    background:
        radial-gradient(ellipse at center, color-mix(in srgb, #2d8b72 86%, var(--surface)) 0 52%, #17382f 100%);
    border: 4px solid color-mix(in srgb, var(--line) 70%, #7a4b2c);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    color: #fff;
    margin: 12px auto;
    max-width: 780px;
    min-height: 470px;
    padding: 16px;
    position: relative;
    width: calc(100% - 24px);
}

.liars-table > header {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.liars-table > header span,
.liars-table > header strong {
    background: rgba(20, 27, 39, .72);
    border: 2px solid rgba(255, 255, 255, .76);
    border-radius: 999px;
    padding: 7px 13px;
}

.liars-cups {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    margin: 18px 0 10px;
}

.liars-player-cup {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: .74;
    text-align: center;
}

.liars-player-cup.active {
    opacity: 1;
}

.liars-player-cup.active .cup-shape {
    animation: cupShake .55s ease-in-out;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--player-color) 55%, transparent);
}

.cup-shape {
    align-items: center;
    background: linear-gradient(100deg, #734b39, #bd7f5a 48%, #59382f);
    border: 3px solid #251a1c;
    border-radius: 8px 8px 22px 22px;
    box-shadow: inset 8px 0 12px rgba(255, 255, 255, .12), 0 8px 0 rgba(0, 0, 0, .22);
    display: flex;
    font-size: 1.5rem;
    height: 72px;
    justify-content: center;
    width: 84px;
}

.liars-own-cup {
    background: rgba(19, 28, 40, .78);
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    margin: 12px auto;
    max-width: 520px;
    padding: 10px;
    text-align: center;
}

.liars-cup-lid {
    color: #d8f8ec;
    font-size: .76rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.liars-dice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
}

.liars-dice-row span {
    align-items: center;
    background: #fffaf0;
    border: 2px solid #251a1c;
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .24);
    color: #25233a;
    display: flex;
    font-size: 2rem;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.liars-controls {
    align-items: end;
    background: rgba(20, 27, 39, .82);
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(80px, 1fr)) auto auto;
    margin-top: 14px;
    padding: 10px;
}

.liars-controls label {
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
}

.liars-controls select {
    background: #fff;
    border: 2px solid #25233a;
    border-radius: 7px;
    color: #25233a;
    display: block;
    margin-top: 4px;
    padding: 8px;
    width: 100%;
}

.liars-reveal {
    align-items: center;
    animation: diceReveal .32s ease-out;
    background: var(--surface);
    border: 3px solid var(--pink);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    inset: 28% 8% auto;
    justify-content: center;
    padding: 18px;
    position: absolute;
    z-index: 4;
}

.liars-reveal div {
    flex-basis: 100%;
    font-size: 1.45rem;
    text-align: center;
}

@keyframes cupShake {
    20% { transform: translateX(-6px) rotate(-4deg); }
    40% { transform: translateX(6px) rotate(4deg); }
    60% { transform: translateX(-4px) rotate(-2deg); }
    80% { transform: translateX(3px) rotate(2deg); }
}

@keyframes diceReveal {
    from { opacity: 0; transform: scale(.82) rotate(-2deg); }
    to { opacity: 1; transform: scale(1); }
}

/* Golf */
.golf-table {
    margin: 12px auto;
    max-width: 900px;
    width: calc(100% - 24px);
}

.golf-table-header,
.crazy-hand-header {
    align-items: center;
    background: var(--feature-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 9px 13px;
}

.golf-table-header span {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
}

.golf-draw-area {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    min-height: 150px;
    padding: 12px;
}

.golf-pile,
.golf-drawn-card {
    align-items: center;
    background: var(--surface-gradient);
    border: 3px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.golf-pile:not(:disabled):hover {
    border-color: var(--sky);
    transform: translateY(-3px);
}

.golf-pile .playing-card,
.golf-drawn-card .playing-card {
    height: 100px;
    width: 70px;
}

.golf-boards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.golf-board {
    background: color-mix(in srgb, var(--surface) 90%, var(--mint));
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.golf-board.self {
    border-color: var(--pink);
}

.golf-board header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.golf-board header span,
.golf-board > small {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.golf-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, 1fr);
}

.golf-grid .playing-card {
    height: auto;
    width: 100%;
}

/* Crazy Eights */
.crazy-eights-page .game-player-marker:empty {
    display: none;
}

.crazy-table {
    background:
        radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--pink) 36%, transparent), transparent 24%),
        radial-gradient(circle at 90% 88%, color-mix(in srgb, var(--sky) 34%, transparent), transparent 28%),
        color-mix(in srgb, var(--surface) 92%, var(--violet));
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 12px auto;
    max-width: 860px;
    padding: 12px;
    width: calc(100% - 24px);
}

.crazy-opponents {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.crazy-opponents article {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    padding: 7px;
    text-align: center;
}

.crazy-opponents article.active {
    border-color: var(--player-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--player-color) 28%, transparent);
}

.crazy-card-backs {
    display: flex;
    justify-content: center;
    min-height: 49px;
}

.crazy-card-backs .playing-card {
    height: 54px;
    margin-inline-start: -21px;
    width: 38px;
}

.crazy-card-backs .playing-card:first-child {
    margin-inline-start: 0;
}

.crazy-center {
    align-items: center;
    display: flex;
    gap: 22px;
    justify-content: center;
    min-height: 178px;
}

.crazy-pile,
.crazy-discard {
    align-items: center;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.crazy-pile:not(:disabled):hover {
    border-color: var(--sky);
    transform: translateY(-3px);
}

.crazy-pile .playing-card,
.crazy-discard .playing-card {
    height: 108px;
    width: 76px;
}

.crazy-suit-picker {
    animation: suitPickerEnter .28s ease-out;
    background: var(--surface-gradient);
    border: 3px solid var(--pink);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    margin: 0 auto 12px;
    max-width: 470px;
    padding: 12px;
    text-align: center;
}

.crazy-suit-picker div {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 8px;
}

.crazy-suit-picker button {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 1.65rem;
    height: 48px;
}

.crazy-suit-picker button:nth-child(-n + 2) {
    color: #d83d59;
}

.crazy-hand-header {
    margin-bottom: 8px;
}

.crazy-hand {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(62px, 82px));
    justify-content: center;
}

.crazy-eights-page .crazy-hand {
    direction: ltr;
}

.crazy-hand .playing-card {
    height: 116px;
    width: 82px;
}

.crazy-hand .playing-card.legal {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 40%, transparent), var(--shadow);
}

@keyframes suitPickerEnter {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
    .merge-race-boards,
    .word-ladder-race {
        grid-template-columns: 1fr;
    }

    .merge-race-board:not(.self) .merge-race-grid {
        gap: 4px;
        margin: auto;
        max-width: 210px;
    }

    .merge-race-board:not(.self) {
        order: 2;
    }

    .merge-race-banner {
        padding: 8px;
    }

    .merge-race-banner span {
        font-size: .64rem;
    }

    .word-ladder-goal {
        gap: 6px;
        grid-template-columns: 1fr auto 1fr;
        padding: 8px;
    }

    .word-ladder-goal em {
        grid-column: 1 / -1;
        text-align: center;
    }

    .word-ladder-sheet {
        min-height: 295px;
    }

    .word-ladder-sheet.rival {
        min-height: 180px;
    }

    .word-ladder-hidden-path {
        min-height: 80px;
    }

    .liars-table {
        padding: 10px;
    }

    .liars-controls {
        grid-template-columns: repeat(2, 1fr);
    }

    .liars-controls button {
        width: 100%;
    }

    .golf-draw-area {
        gap: 6px;
        overflow-x: auto;
        padding-inline: 2px;
    }

    .golf-table-header span {
        display: none;
    }

    .golf-table-header {
        justify-content: center;
    }

    .golf-boards {
        grid-template-columns: 1fr;
    }

    .crazy-center {
        min-height: 158px;
    }

    .crazy-hand {
        grid-template-columns: repeat(auto-fit, minmax(52px, 68px));
    }

    .crazy-hand .playing-card {
        height: 98px;
        width: 68px;
    }
}

/* Go Fish */
.go-fish-page {
    min-height: 100vh;
    background-color: var(--page);
    background-size: cover;
}

.fish-table {
    width: min(960px, calc(100% - 24px));
    margin: 12px auto 80px;
    padding: 18px;
    border: 3px solid var(--line);
    border-radius: 10px;
    background:
        radial-gradient(circle at 80% 8%, color-mix(in srgb, var(--sky) 30%, transparent), transparent 28%),
        linear-gradient(145deg, color-mix(in srgb, var(--panel) 94%, var(--mint)), var(--panel));
    box-shadow: 0 9px 0 var(--shadow);
}

.fish-table > header,
.fish-hand-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fish-table > header > div:first-child {
    display: grid;
    gap: 2px;
}

.fish-table > header > div:first-child strong {
    font-size: 2.8rem;
    color: var(--sky);
}

.fish-stock {
    display: grid;
    grid-template-columns: 58px auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 10px;
}

.fish-stock > span {
    grid-row: 1 / 3;
}

.fish-stock .playing-card {
    width: 54px;
}

.fish-stock strong {
    font-size: 1.5rem;
}

.fish-books {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.fish-books article {
    min-height: 86px;
    padding: 10px;
    border: 2px solid var(--line);
    border-top: 8px solid var(--player-color);
    border-radius: 8px;
    background: var(--card);
    display: grid;
    gap: 3px;
}

.fish-books article span {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 800;
}

.fish-request {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--sky) 12%, var(--card));
}

.fish-request div {
    display: grid;
    gap: 5px;
}

.fish-request select {
    min-height: 46px;
}

.fish-last-move {
    margin: 12px 0;
    padding: 10px 12px;
    border-inline-start: 5px solid var(--sky);
    background: var(--card);
    font-weight: 700;
}

.fish-hand-title {
    margin-bottom: 8px;
}

.fish-hand {
    display: flex;
    min-height: 164px;
    padding: 12px;
    overflow-x: auto;
    gap: 7px;
    border: 2px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--paper) 88%, var(--mint));
}

.fish-hand .playing-card {
    flex: 0 0 92px;
}

@media (max-width: 620px) {
    .fish-table {
        width: calc(100% - 12px);
        padding: 10px;
    }

    .fish-request {
        grid-template-columns: 1fr 1fr;
    }

    .fish-request .btn {
        grid-column: 1 / -1;
    }

    .fish-hand .playing-card {
        flex-basis: 76px;
    }
}

/* Odd One Out / Old Maid */
.old-maid-page {
    min-height: 100vh;
    background-color: var(--page);
    background-size: cover;
}

.maid-table {
    width: min(940px, calc(100% - 24px));
    margin: 12px auto 80px;
    padding: 18px;
    border: 3px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 90%, var(--coral)), var(--panel));
    box-shadow: 0 9px 0 var(--shadow);
}

.maid-table > header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--line-soft);
}

.maid-table > header img {
    width: 104px;
    aspect-ratio: 1;
    object-fit: cover;
    border: 3px solid var(--line);
    border-radius: 8px;
    background: var(--card);
}

.maid-table > header h1,
.maid-table > header p {
    margin: 3px 0;
}

.maid-target {
    margin: 18px 0 10px;
    padding: 16px;
    border: 2px solid var(--line);
    border-radius: 8px;
    text-align: center;
    background: color-mix(in srgb, var(--coral) 13%, var(--card));
}

.maid-target-cards,
.maid-hand {
    display: flex;
    justify-content: center;
    gap: 5px;
    min-height: 150px;
    padding: 12px;
    overflow-x: auto;
}

.maid-target-cards .playing-card,
.maid-hand .playing-card {
    flex: 0 0 86px;
}

.maid-target-cards .playing-card {
    transition: transform 160ms ease, filter 160ms ease;
}

.maid-target-cards .playing-card:not(:disabled):hover {
    transform: translateY(-12px) rotate(2deg);
    filter: drop-shadow(0 9px 5px var(--shadow));
}

.maid-last-move {
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--card);
    text-align: center;
    font-weight: 750;
}

.maid-own {
    margin-top: 10px;
    border: 2px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--paper) 90%, var(--mint));
}

.maid-own > header {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px 0;
}

@media (max-width: 620px) {
    .maid-table {
        width: calc(100% - 12px);
        padding: 10px;
    }

    .maid-table > header img {
        width: 76px;
    }

    .maid-target-cards .playing-card,
    .maid-hand .playing-card {
        flex-basis: 66px;
    }
}

/* Chinese Checkers */
.chinese-checkers-page {
    min-height: 100vh;
    background-color: var(--page);
    background-size: cover;
}

.checkers-shell {
    width: min(1100px, calc(100% - 24px));
    margin: 12px auto 80px;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 14px;
}

.checkers-shell > aside,
.checkers-shell > section {
    padding: 14px;
    border: 3px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 94%, var(--mint)), var(--panel));
    box-shadow: 0 8px 0 var(--shadow);
}

.checkers-shell > aside > img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 8px;
}

.checkers-progress {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.checkers-progress div {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 7px;
    padding: 8px;
    border: 2px solid var(--line-soft);
    border-radius: 6px;
    background: var(--card);
}

.checkers-progress div span {
    width: 14px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--player-color);
}

.checkers-board {
    position: relative;
    width: min(100%, 650px);
    aspect-ratio: 1;
    margin: auto;
    border: 4px solid var(--line);
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 55%, color-mix(in srgb, var(--mint) 32%, transparent)),
        linear-gradient(135deg, color-mix(in srgb, var(--paper) 88%, var(--yellow)), var(--paper));
    box-shadow: inset 0 0 35px color-mix(in srgb, var(--ink) 18%, transparent);
}

.checkers-hole {
    position: absolute;
    width: clamp(12px, 3.2%, 22px);
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--line) 75%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 14%, var(--paper));
    box-shadow: inset 0 2px 3px color-mix(in srgb, var(--ink) 28%, transparent);
    transform: translate(-50%, -50%);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.checkers-hole.occupied {
    border-color: color-mix(in srgb, var(--marble) 70%, var(--line));
    background:
        radial-gradient(circle at 35% 28%, white 0 8%, transparent 10%),
        radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--marble) 65%, white), var(--marble) 70%);
    box-shadow: 0 3px 4px var(--shadow), inset -2px -3px 4px color-mix(in srgb, var(--ink) 25%, transparent);
}

.checkers-hole.selectable {
    cursor: pointer;
    outline: 2px solid color-mix(in srgb, var(--sky) 72%, transparent);
    outline-offset: 2px;
}

.checkers-hole.selected {
    z-index: 3;
    transform: translate(-50%, -50%) scale(1.45);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--yellow) 65%, transparent), 0 7px 8px var(--shadow);
}

.checkers-hole.destination {
    cursor: pointer;
    background: var(--mint);
    animation: checkers-pulse 900ms ease-in-out infinite alternate;
}

.checkers-hole.route {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--sky) 45%, transparent);
}

@keyframes checkers-pulse {
    to { transform: translate(-50%, -50%) scale(1.35); }
}

.checkers-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.checkers-actions > span {
    min-width: 0;
    font-weight: 750;
}

@media (max-width: 760px) {
    .checkers-shell {
        width: calc(100% - 10px);
        grid-template-columns: 1fr;
    }

    .checkers-shell > aside {
        display: grid;
        grid-template-columns: 72px 1fr;
        align-items: center;
        gap: 10px;
    }

    .checkers-shell > aside > img {
        grid-row: 1 / 3;
    }

    .checkers-shell > aside h2,
    .checkers-shell > aside p {
        margin: 0;
    }

    .checkers-progress {
        grid-column: 1 / -1;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        margin-top: 0;
    }

    .checkers-actions {
        grid-template-columns: 1fr 1fr;
    }

    .checkers-actions > span {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* Ludo */
.ludo-page {
    min-height: 100vh;
    background-color: var(--page);
}

.ludo-shell {
    width: 100%;
    margin: 12px auto 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.ludo-shell > aside,
.ludo-shell > section {
    padding: 14px;
    border: 3px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 94%, var(--yellow)), var(--panel));
    box-shadow: 0 8px 0 var(--shadow);
}

.ludo-shell > aside {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding-block: 8px;
    text-align: start;
}

.ludo-shell > aside > img {
    display: none;
}

.ludo-shell > aside.color-choice-active {
    grid-template-columns: minmax(0, 1fr);
}

.ludo-shell > aside.board-choice-active {
    grid-template-columns: minmax(0, 1fr);
}

.ludo-shell > aside:not(.board-choice-active):not(.color-choice-active) {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    padding-block: 2px;
}

.ludo-shell > aside.board-choice-active > .ludo-die,
.ludo-shell > aside.board-choice-active > #ludoRoll,
.ludo-shell > aside.color-choice-active > .ludo-die,
.ludo-shell > aside.color-choice-active > #ludoRoll {
    display: none;
}

.ludo-board-choice,
.ludo-color-choice {
    display: grid;
    grid-template-columns: minmax(132px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ludo-board-choice > strong,
.ludo-color-choice > strong {
    line-height: 1.2;
}

.ludo-board-options,
.ludo-color-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    gap: 7px;
}

.ludo-board-options {
    grid-template-columns: repeat(3, minmax(58px, 96px));
    justify-content: start;
}

.ludo-board-option {
    min-width: 0;
    padding: 3px;
    border: 2px solid color-mix(in srgb, var(--sky) 62%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 92%, var(--sky));
    box-shadow: none;
}

.ludo-board-option img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

.ludo-board-option:not(:disabled) {
    animation: ludo-board-option-float 900ms ease-in-out infinite alternate;
}

.ludo-board-option:nth-child(2) {
    animation-delay: 120ms;
}

.ludo-board-option:nth-child(3) {
    animation-delay: 240ms;
}

.ludo-board-option:hover:not(:disabled),
.ludo-board-option:focus-visible {
    border-color: var(--coral);
    box-shadow: none;
}

.ludo-color-option {
    min-width: 0;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 7px;
    border: 2px solid color-mix(in srgb, var(--choice-color) 68%, #4d3424);
    border-radius: 12px;
    color: #2d2118;
    background:
        radial-gradient(circle at 28% 18%, rgba(255,255,255,.86), transparent 28%),
        color-mix(in srgb, var(--choice-color) 38%, #fff8e8);
    box-shadow: none;
    font-weight: 850;
}

.ludo-color-option:hover:not(:disabled),
.ludo-color-option:focus-visible {
    transform: translateY(-2px);
    box-shadow: none;
}

.ludo-color-option .ludo-pawn-piece {
    position: relative;
    inset: auto;
    width: 29px;
    height: 38px;
    flex: 0 0 29px;
}

.ludo-page .game-player-marker {
    background: var(--player-color, var(--surface-2));
    color: transparent;
}

.ludo-die {
    display: grid;
    place-items: center;
    font-size: 3rem;
}

.ludo-die-visual {
    width: 100%;
    height: 100%;
}

body.game-turn-opponent :is(
    #backgammonDice,
    #farkleDice,
    #hhDie,
    #liarsOwnDice,
    #ludoDie,
    #pigDie,
    #snakesDie,
    #wwDice,
    #wwDiceStage,
    #yachtDice
) {
    filter: grayscale(.7);
    opacity: .72;
    transition: filter .18s ease, opacity .18s ease;
}

.ludo-board-stage {
    position: relative;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 0 !important;
}

.ludo-shell > .ludo-board-stage {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ludo-board {
    --ludo-board-image: none;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, minmax(0, 1fr));
    width: min(100%, 760px);
    aspect-ratio: 1;
    margin: auto;
    padding: 5.4%;
    overflow: visible;
    border: 0;
    border-radius: 4.8%;
    background: var(--ludo-board-image) center / 100% 100% no-repeat;
    box-shadow:
        0 18px 18px color-mix(in srgb, #160c08 42%, transparent),
        0 3px 0 color-mix(in srgb, #fff 35%, transparent);
    container-type: inline-size;
}

.ludo-board::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 5.1%;
    border-radius: 3.6%;
    background:
        radial-gradient(circle at 30% 26%, color-mix(in srgb, white 14%, transparent), transparent 30%),
        linear-gradient(color-mix(in srgb, #fff8e8 8%, transparent), color-mix(in srgb, #3f2414 6%, transparent));
    box-shadow: inset 0 0 22px color-mix(in srgb, #3f2414 24%, transparent);
    pointer-events: none;
}

.ludo-board.world-arrival {
    animation: ludo-board-arrival 720ms cubic-bezier(.2,.86,.24,1);
}

.ludo-board.world-previewing {
    transition: filter 180ms ease, opacity 180ms ease;
}

.ludo-finish-vote {
    align-items: center;
    background: rgba(10, 12, 30, .5);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 1450;
}

.ludo-finish-vote-card {
    width: min(100%, 390px);
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 3px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--yellow) 38%, transparent), transparent 32%),
        var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.ludo-finish-vote-card h2,
.ludo-finish-vote-card p,
.ludo-finish-vote-card small {
    margin: 0;
}

.ludo-finish-vote-card small {
    color: var(--muted);
    font-weight: 800;
}

.ludo-finish-vote-card .btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ludo-cell {
    position: relative;
    z-index: 2;
    min-width: 0;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ludo-cell.zone-0 { background: color-mix(in srgb, #ef6587 16%, transparent); }
.ludo-cell.zone-1 { background: color-mix(in srgb, #58bde8 16%, transparent); }
.ludo-cell.zone-2 { background: color-mix(in srgb, #f3b94f 17%, transparent); }
.ludo-cell.zone-3 { background: color-mix(in srgb, #79ce9b 16%, transparent); }

.ludo-cell.track {
    margin: clamp(.35px, .12vw, 1.2px);
    border: clamp(1px, .13vw, 2px) solid #624c35;
    border-radius: 16%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255,255,255,.74), transparent 28%),
        linear-gradient(145deg, #fffdf1 0 45%, #ead9b6 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,.9),
        inset -2px -2px 2px rgba(91,59,31,.2),
        0 2px 2px rgba(43,24,13,.28);
}

.ludo-cell.track.safe::after {
    content: "★";
    color: #83602e;
    opacity: .72;
    font-size: clamp(.42rem, 2.2cqw, 1rem);
    text-shadow: 0 1px #fff6d9;
}

.ludo-cell.home-lane {
    margin: clamp(.35px, .12vw, 1.2px);
    border: clamp(1px, .13vw, 2px) solid color-mix(in srgb, var(--pawn-color) 58%, #4e3726);
    border-radius: 16%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255,255,255,.65), transparent 30%),
        linear-gradient(145deg, color-mix(in srgb, var(--pawn-color) 46%, #fff4dc), color-mix(in srgb, var(--pawn-color) 72%, #b8824b));
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,.68),
        inset -2px -2px 2px rgba(70,35,20,.2),
        0 2px 2px rgba(43,24,13,.25);
}

.ludo-cell.yard-slot {
    background: transparent;
}

/* Optional yard markers: uncomment this block to restore the four circular
   pawn bases in each player's out-of-play area.
.ludo-cell.yard-slot::before {
    content: "";
    position: absolute;
    inset: 8%;
    border: clamp(1px, .2vw, 3px) solid color-mix(in srgb, var(--pawn-color) 72%, #523522);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255,255,255,.66), transparent 19%),
        radial-gradient(circle, color-mix(in srgb, var(--pawn-color) 55%, #f7dfb5) 0 44%, color-mix(in srgb, var(--pawn-color) 72%, #70472b) 47% 52%, rgba(63,35,20,.24) 55% 64%, transparent 66%);
    box-shadow:
        inset 0 4px 5px rgba(63,35,20,.24),
        0 2px 1px rgba(255,255,255,.3);
}
*/

.ludo-center-rosette {
    position: absolute;
    z-index: 3;
    inset: 45.2%;
    display: grid;
    place-items: center;
    border: clamp(2px, .35vw, 4px) solid #5a3b25;
    border-radius: 50%;
    color: #fff9dc;
    background: conic-gradient(
        from 225deg,
        #ef6587 0 25%,
        #58bde8 0 50%,
        #f3b94f 0 75%,
        #79ce9b 0
    );
    box-shadow:
        inset 0 0 0 clamp(2px, .4vw, 5px) rgba(255,255,255,.45),
        0 4px 5px rgba(47,24,12,.38);
    font-size: clamp(.65rem, 3.2cqw, 1.45rem);
    text-shadow: 0 2px 2px rgba(51,29,17,.45);
    pointer-events: none;
}

.ludo-zone-player {
    position: absolute;
    z-index: 1;
    width: 17%;
    aspect-ratio: 1;
    object-fit: contain;
    opacity: .34;
    filter: sepia(.12) saturate(.82) drop-shadow(0 3px 2px rgba(50,29,16,.35));
    pointer-events: none;
}

.ludo-zone-player.human {
    border: clamp(2px, .3vw, 4px) solid color-mix(in srgb, var(--cream) 78%, #68482f);
    border-radius: 50%;
    object-fit: cover;
    opacity: .48;
    box-shadow: 0 3px 6px rgba(50,29,16,.32);
}

.ludo-zone-player.zone-0 { top: 12.5%; left: 12.5%; }
.ludo-zone-player.zone-1 { top: 12.5%; right: 12.5%; }
.ludo-zone-player.zone-2 { right: 12.5%; bottom: 12.5%; }
.ludo-zone-player.zone-3 { bottom: 12.5%; left: 12.5%; }

.ludo-board[data-world="moon"] .ludo-zone-player {
    opacity: .42;
    filter: grayscale(.15) brightness(1.32) drop-shadow(0 3px 3px rgba(0,0,0,.55));
}

.ludo-board[data-world="toybox"] .ludo-zone-player {
    opacity: .4;
    filter: saturate(.92) drop-shadow(0 3px 2px rgba(91,57,29,.25));
}

.ludo-pawn {
    --stack-x: 0px;
    --stack-y: 0px;
    position: absolute;
    top: calc(50% + var(--stack-y));
    left: calc(50% + var(--stack-x));
    width: min(82%, 42px);
    height: min(96%, 46px);
    padding: 0;
    border: 0;
    color: transparent;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    transform: translate(-50%, -50%);
    overflow: visible;
}

.ludo-pawn.is-animation-target {
    opacity: 0;
}

.ludo-moving-pawn {
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 12 !important;
}

.ludo-pawn-piece {
    position: absolute;
    display: block;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    transform-origin: 50% 92%;
    filter: drop-shadow(0 4px 2px rgba(47,24,14,.42));
}

.ludo-pawn.legal {
    cursor: pointer;
}

.ludo-pawn.legal .ludo-pawn-piece {
    animation: ludo-ready 650ms ease-in-out infinite alternate;
}

@keyframes ludo-ready {
    to {
        transform: translateY(var(--piece-ready-rise, -14%)) scale(var(--piece-ready-scale, 1.12));
        filter:
            drop-shadow(0 7px 3px rgba(47,24,14,.42))
            drop-shadow(0 0 5px color-mix(in srgb, var(--sky) 88%, transparent));
    }
}

@keyframes ludo-board-arrival {
    0% { transform: scale(.965) rotate(-.4deg); opacity: .7; }
    68% { transform: scale(1.008) rotate(.15deg); opacity: 1; }
    100% { transform: none; }
}

@keyframes ludo-board-option-float {
    to { transform: translateY(-4px) rotate(.6deg); }
}

@media (max-width: 700px) {
    .ludo-shell {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .ludo-shell > aside {
        display: grid;
        grid-template-columns: 62px minmax(0, 1fr) auto;
        text-align: start;
    }

    .ludo-board-choice,
    .ludo-color-choice {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: center;
    }

    .ludo-board-options,
    .ludo-color-options {
        gap: 5px;
    }

    .ludo-board-options {
        grid-template-columns: repeat(3, minmax(58px, 82px));
        justify-content: center;
    }

    .ludo-color-option {
        min-height: 50px;
        flex-direction: column;
        gap: 0;
        padding: 0;
        font-size: .7rem;
    }

    .ludo-color-option .ludo-pawn-piece {
        width: 25px;
        height: 31px;
        flex-basis: 31px;
    }

    .ludo-shell > aside > img {
        display: none;
    }

    .ludo-board-stage {
        padding: 0 !important;
    }

    .ludo-shell > aside .btn,
    .ludo-shell > aside p {
        margin: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ludo-board-option,
    .ludo-board.world-arrival,
    .ludo-pawn.legal .ludo-pawn-piece,
    .knight-piece.self.ready {
        animation: none;
    }
}

/* Backlog volume 2: tactile classic boards. */
.classic-board-page .classic-play-card {
    background: rgba(255, 250, 237, .94);
}

.four-row-board {
    display: grid;
    width: min(88vw, 590px);
    aspect-ratio: 7 / 6;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(4px, 1vw, 9px);
    padding: clamp(10px, 2.5vw, 22px);
    border: clamp(7px, 1.8vw, 15px) solid #245e9a;
    border-radius: 28px 28px 18px 18px;
    background:
        linear-gradient(110deg, rgba(255,255,255,.2), transparent 22% 72%, rgba(7,34,75,.2)),
        #3182c9;
    box-shadow: inset 0 0 0 3px #174a7d, 0 18px 0 #153b68, 0 26px 38px rgba(15,35,64,.28);
}

.four-row-cell {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 8%;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(19,43,67,.9) 0 57%, rgba(255,255,255,.32) 59% 65%, #174d84 67% 100%);
    box-shadow: inset 0 5px 6px rgba(3,22,47,.55), 0 2px rgba(255,255,255,.2);
}

.four-row-cell:not(:disabled) { cursor: pointer; }
.four-row-cell:not(:disabled):hover { filter: brightness(1.13); }
.four-row-token {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: clamp(2px, .45vw, 4px) solid color-mix(in srgb, var(--token-color) 64%, #52281d);
    border-radius: 50%;
    background:
        radial-gradient(circle at 33% 26%, rgba(255,255,255,.9) 0 8%, transparent 10% 100%),
        radial-gradient(circle at 46% 42%, color-mix(in srgb, var(--token-color) 78%, white), var(--token-color) 55%, color-mix(in srgb, var(--token-color) 68%, #3b241f));
    box-shadow: inset -5px -7px 9px rgba(53,26,22,.22), 0 4px 6px rgba(4,22,45,.45);
}

.four-row-token.just-dropped { animation: four-token-drop .58s cubic-bezier(.2,.8,.2,1) both; }
.four-row-token.winning { animation: four-token-win .72s ease-in-out infinite alternate; }

@keyframes four-token-drop { from { opacity: .25; transform: translateY(-520%); } 75% { transform: translateY(8%); } to { opacity: 1; transform: none; } }
@keyframes four-token-win { to { transform: scale(1.08); box-shadow: 0 0 0 5px #fff6a8, 0 0 22px #ffe15b; } }

.quick-go-board {
    display: grid;
    width: min(88vw, 610px);
    aspect-ratio: 1;
    grid-template-columns: repeat(9, 1fr);
    padding: clamp(16px, 4vw, 34px);
    border: clamp(8px, 2vw, 17px) solid #735037;
    border-radius: 22px;
    background-color: #d8a95e;
    background-image:
        linear-gradient(rgba(64,44,25,.76) 2px, transparent 2px),
        linear-gradient(90deg, rgba(64,44,25,.76) 2px, transparent 2px),
        radial-gradient(circle at 23% 17%, rgba(255,245,197,.52), transparent 36%),
        linear-gradient(135deg, #edc77d, #b77b3f);
    background-position: calc(100% / 18) calc(100% / 18), calc(100% / 18) calc(100% / 18), 0 0, 0 0;
    background-size: calc((100% - clamp(32px, 8vw, 68px)) / 8) calc((100% - clamp(32px, 8vw, 68px)) / 8), calc((100% - clamp(32px, 8vw, 68px)) / 8) calc((100% - clamp(32px, 8vw, 68px)) / 8), auto, auto;
    box-shadow: inset 0 0 0 3px #4b2d1c, inset 0 0 28px rgba(74,38,18,.36), 0 18px 36px rgba(34,24,20,.3);
}

.go-point {
    position: relative;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.go-point::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 8%;
    border: 2px solid color-mix(in srgb, var(--stone-color, transparent) 78%, #111);
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 25%, rgba(255,255,255,.78), transparent 18%),
        radial-gradient(circle, var(--stone-color) 52%, color-mix(in srgb, var(--stone-color) 72%, #111));
    box-shadow: 0 4px 6px rgba(42,26,15,.48), inset -4px -5px 7px rgba(0,0,0,.23);
    opacity: 0;
    transform: scale(.4);
    transition: opacity .15s ease, transform .2s ease;
}

.go-point.occupied::before { opacity: 1; transform: scale(1); }
.go-point.last::after { content: ""; position: absolute; z-index: 2; inset: 40%; border-radius: 50%; background: #ff5a56; box-shadow: 0 0 0 2px #fff7c7; }
.go-point:not(:disabled):hover::before { opacity: .32; transform: scale(.78); --stone-color: #f2f0e6; }

.oware-board {
    display: grid;
    width: min(92vw, 720px);
    grid-template-columns: 82px 1fr 82px;
    gap: clamp(7px, 1.6vw, 14px);
    align-items: stretch;
    padding: clamp(12px, 2vw, 20px);
    border: clamp(8px, 2vw, 16px) solid #744828;
    border-radius: 42px;
    background:
        radial-gradient(ellipse at 25% 20%, rgba(255,231,167,.38), transparent 32%),
        repeating-linear-gradient(96deg, rgba(73,38,19,.08) 0 2px, transparent 2px 13px),
        linear-gradient(135deg, #c98a4b, #91562f);
    box-shadow: inset 0 0 0 3px #4f2c19, inset 0 8px 16px rgba(255,220,158,.22), 0 18px 38px rgba(45,25,16,.34);
}

.oware-field { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(5px, 1.2vw, 10px); }
.oware-pit,
.oware-store {
    position: relative;
    min-width: 0;
    border: 2px solid rgba(75,40,22,.72);
    color: #fff6dc;
    background: radial-gradient(ellipse at center, #71432b 0 43%, #4d2b1d 72%, #ad7545 76% 100%);
    box-shadow: inset 0 9px 14px rgba(24,13,10,.56), 0 2px 2px rgba(255,224,165,.2);
}

.oware-pit { aspect-ratio: 1; padding: 4px; border-radius: 50%; }
.oware-pit.own:not(:disabled) { outline: 3px solid #ffe089; cursor: pointer; transform: translateY(-1px); }
.oware-pit.own:not(:disabled):hover { filter: brightness(1.18); }
.oware-store { display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 38px; text-align: center; }
.oware-store strong { font-size: 1.65rem; }
.oware-store-label { font-size: .7rem; font-weight: 800; }
.oware-seed-count { position: absolute; z-index: 2; top: 4px; right: 6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #fff6d7; color: #432b24; font-size: .72rem; font-weight: 900; }
.oware-seeds { position: absolute; inset: 20%; }
.oware-seed { position: absolute; top: 15%; left: 18%; width: 28%; aspect-ratio: .68; border-radius: 50%; background: radial-gradient(circle at 35% 26%, #ffe8a2, #c98236 46%, #774020); box-shadow: 0 2px 2px rgba(0,0,0,.45); transform: rotate(24deg); }
.oware-seed:nth-child(2n) { left: 38%; transform: rotate(-28deg); }
.oware-seed:nth-child(3n) { top: 42%; left: 12%; transform: rotate(62deg); }
.oware-seed:nth-child(4n) { top: 46%; left: 56%; transform: rotate(12deg); }
.oware-seed:nth-child(5n) { top: 17%; left: 62%; transform: rotate(82deg); }

.graph-board {
    width: min(89vw, 610px);
    aspect-ratio: 1;
    overflow: visible;
    border: clamp(8px, 2vw, 17px) solid #70452c;
    border-radius: 28px;
    background:
        radial-gradient(circle at 35% 25%, rgba(255,246,201,.5), transparent 38%),
        repeating-linear-gradient(7deg, rgba(91,50,26,.045) 0 2px, transparent 2px 11px),
        linear-gradient(145deg, #d7b273, #a86f3f);
    box-shadow: inset 0 0 0 3px #4b2e20, inset 0 0 30px rgba(73,38,20,.25), 0 19px 39px rgba(39,24,18,.32);
}

.graph-tracks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.graph-tracks line,
.graph-tracks path { fill: none; stroke: #54382b; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.surakarta-tracks path { stroke: #2d8587; stroke-width: 8; filter: drop-shadow(0 2px 0 rgba(255,244,191,.45)); }
.graph-point {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(32px, 9vw, 57px);
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid #6f4a30;
    border-radius: 50%;
    background: radial-gradient(circle, #efd295 0 34%, #8a5d37 38% 44%, #d0a267 47% 100%);
    color: #fff;
    font-size: clamp(1.6rem, 6vw, 2.7rem);
    line-height: 1;
    text-shadow: 0 2px 2px rgba(0,0,0,.3);
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 5px rgba(54,29,16,.35);
}

.surakarta-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 62%, #42251a);
    background:
        radial-gradient(circle at 32% 25%, rgba(255,255,255,.92) 0 7%, transparent 9%),
        radial-gradient(circle, color-mix(in srgb, var(--piece-color) 78%, white), var(--piece-color) 54%, color-mix(in srgb, var(--piece-color) 60%, #281b19));
    box-shadow: inset -5px -6px 7px rgba(39,20,17,.2), 0 5px 7px rgba(46,26,18,.42);
}

.graph-point.selected { transform: translate(-50%, -50%) scale(1.16); box-shadow: 0 0 0 5px #fff0a5, 0 0 22px #ffcf55; }
.graph-point.legal { animation: graph-legal 680ms ease-in-out infinite alternate; cursor: pointer; }
.graph-point.last { outline: 4px solid #ff744f; outline-offset: 3px; }
.bagh-point { width: clamp(38px, 10vw, 64px); font-size: clamp(1.35rem, 6.2vw, 2.8rem); }
.bagh-point.tiger { border-color: #6d2f1f; background: radial-gradient(circle, #ffd08b, #d67636 62%, #774026); }
.bagh-point.goat { border-color: #436237; background: radial-gradient(circle, #f7efcf, #8eba75 64%, #4d7142); }

.hnefatafl-board {
    border-color: #334c62;
    background:
        radial-gradient(circle at 34% 22%, rgba(236,253,255,.66), transparent 36%),
        repeating-linear-gradient(94deg, rgba(31,62,76,.055) 0 2px, transparent 2px 13px),
        linear-gradient(145deg, #b9d9dc, #7195a2);
    box-shadow: inset 0 0 0 3px #223c50, inset 0 0 32px rgba(25,50,66,.28), 0 19px 39px rgba(17,36,52,.34);
}
.hnefatafl-tracks line { stroke: #35596a; stroke-width: 3; }
.hnefatafl-point { width: clamp(25px, 6.7vw, 44px); border-color: #426274; background: radial-gradient(circle, #d9edf0, #7397a2 72%); font-size: clamp(1.15rem, 4.4vw, 2rem); }
.hnefatafl-point.restricted { border-radius: 24%; outline: 2px solid #d9a849; outline-offset: 2px; }
.hnefatafl-point.occupied.attacker { border-color: #142a3b; background: radial-gradient(circle at 34% 24%, #8297a8 0 8%, #344f64 34%, #14283b 74%); }
.hnefatafl-point.occupied.defender { border-color: #547381; background: radial-gradient(circle at 34% 24%, #fff 0 9%, #e4f1ef 38%, #94b5b7 76%); color: #284151; }
.hnefatafl-point.king { border-color: #9a6d17; background: radial-gradient(circle at 34% 23%, #fff8c9, #e3bd58 58%, #8b6017); color: #563b12; }

.seega-board {
    border-color: #7a442b;
    background:
        radial-gradient(circle at 50% 50%, rgba(107,210,201,.5) 0 12%, transparent 13%),
        repeating-linear-gradient(8deg, rgba(111,56,30,.055) 0 2px, transparent 2px 12px),
        linear-gradient(145deg, #e1b46e, #b96f43);
}
.seega-tracks line { stroke: #70432d; stroke-width: 5; }
.seega-point { border-color: #815134; background: radial-gradient(circle, #f1d69b, #b97846 74%); }
.seega-point.safe { border-color: #318b8c; border-radius: 32%; outline: 3px solid #9ce3d9; outline-offset: 2px; }
.seega-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 62%, #3d241b);
    background: radial-gradient(circle at 33% 24%, #fff 0 7%, color-mix(in srgb, var(--piece-color) 78%, white) 12%, var(--piece-color) 62%, color-mix(in srgb, var(--piece-color) 64%, #2b201d));
}

.rectangular-graph-board { aspect-ratio: 6 / 5; }
.yote-board {
    border-color: #68452e;
    background:
        radial-gradient(circle at 28% 24%, rgba(255,229,143,.5), transparent 36%),
        repeating-linear-gradient(6deg, rgba(78,42,24,.05) 0 2px, transparent 2px 14px),
        linear-gradient(145deg, #d4a65f, #9b6439);
}
.yote-tracks line { stroke: #68452e; stroke-width: 5; }
.yote-point { width: clamp(31px, 8vw, 54px); border-color: #775035; background: radial-gradient(circle, #ebca86, #a66b3e 74%); }
.yote-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 64%, #35241e);
    background: radial-gradient(circle at 33% 24%, #fff 0 7%, color-mix(in srgb, var(--piece-color) 78%, white) 12%, var(--piece-color) 62%, color-mix(in srgb, var(--piece-color) 62%, #2b201d));
}

.dara-board {
    border-color: #56372c;
    background:
        radial-gradient(circle at 74% 20%, rgba(255,225,119,.42), transparent 34%),
        repeating-linear-gradient(92deg, rgba(67,36,27,.055) 0 2px, transparent 2px 12px),
        linear-gradient(145deg, #c58b52, #7e4b36);
}
.dara-tracks line { stroke: #52352c; stroke-width: 5; }
.dara-point { width: clamp(31px, 8vw, 54px); border-color: #694434; background: radial-gradient(circle, #ddaf6b, #8d593e 74%); }
.dara-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 64%, #36241f);
    background: radial-gradient(circle at 33% 24%, #fff 0 7%, color-mix(in srgb, var(--piece-color) 78%, white) 12%, var(--piece-color) 62%, color-mix(in srgb, var(--piece-color) 62%, #2b201d));
}
.dara-point.in-mill { box-shadow: 0 0 0 4px #fff0a0, 0 0 20px #ffc940; }

.shisima-board {
    border-color: #275b66;
    border-radius: 50%;
    background:
        radial-gradient(circle at 48% 46%, rgba(203,255,239,.6) 0 10%, transparent 11%),
        radial-gradient(circle at 30% 24%, rgba(238,255,237,.56), transparent 32%),
        repeating-radial-gradient(circle at center, rgba(25,102,111,.07) 0 3px, transparent 4px 17px),
        linear-gradient(145deg, #69c6bd, #227d8d);
    box-shadow: inset 0 0 0 4px #163f4c, inset 0 0 34px rgba(7,60,73,.34), 0 19px 39px rgba(15,53,65,.38);
}
.shisima-tracks line,
.shisima-tracks polygon { fill: none; stroke: #164f5c; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 0 rgba(212,255,236,.38)); }
.shisima-point { width: clamp(39px, 10vw, 67px); border-color: #195361; background: radial-gradient(circle, #b9e6cf, #4ba49e 72%); }
.shisima-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 64%, #17383e);
    background: radial-gradient(circle at 33% 24%, #fff 0 7%, color-mix(in srgb, var(--piece-color) 78%, white) 12%, var(--piece-color) 62%, color-mix(in srgb, var(--piece-color) 62%, #17343a));
}
.shisima-bug {
    position: relative;
    display: block;
    width: 45%;
    height: 62%;
    border: 2px solid rgba(31,42,43,.72);
    border-radius: 52% 52% 45% 45%;
    background: linear-gradient(90deg, rgba(255,255,255,.3), transparent 42%), color-mix(in srgb, var(--piece-color) 72%, #35292b);
    box-shadow: 0 2px 2px rgba(13,35,39,.35);
}
.shisima-bug::before,
.shisima-bug::after {
    content: "";
    position: absolute;
    top: 20%;
    width: 68%;
    height: 53%;
    border: 2px solid rgba(31,42,43,.62);
    border-radius: 75% 25% 68% 32%;
    background: color-mix(in srgb, var(--piece-color) 58%, rgba(255,255,255,.55));
}
.shisima-bug::before { right: 58%; transform: rotate(-28deg); }
.shisima-bug::after { left: 58%; transform: scaleX(-1) rotate(-28deg); }
.shisima-point.winning { animation: graph-legal 680ms ease-in-out infinite alternate; outline-color: #fff49b; }

.mu-torere-board {
    border-color: #264d50;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(216,246,220,.62) 0 9%, transparent 10%),
        repeating-radial-gradient(circle at center, rgba(21,76,73,.06) 0 2px, transparent 3px 19px),
        linear-gradient(145deg, #91c6a7, #3b8279);
    box-shadow: inset 0 0 0 4px #183d42, inset 0 0 32px rgba(14,54,59,.32), 0 19px 39px rgba(21,48,51,.38);
}
.mu-torere-tracks line,
.mu-torere-tracks polygon { fill: none; stroke: #214d4d; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px rgba(235,255,224,.36)); }
.mu-torere-point { width: clamp(39px, 10vw, 67px); border-color: #315a55; background: radial-gradient(circle, #c8dfbd, #629286 72%); }
.mu-torere-point.occupied {
    border-color: color-mix(in srgb, var(--piece-color) 64%, #192b2e);
    background: radial-gradient(circle at 34% 24%, #fff 0 7%, color-mix(in srgb, var(--piece-color) 76%, white) 12%, var(--piece-color) 62%, color-mix(in srgb, var(--piece-color) 58%, #18282c));
}
.mu-torere-stone { width: 62%; aspect-ratio: 1; border: 2px solid rgba(22,38,40,.55); border-radius: 46% 54% 48% 52%; background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.54), transparent 18%), color-mix(in srgb, var(--piece-color) 76%, #d6e0cd); box-shadow: inset -3px -4px 4px rgba(17,37,39,.23), 0 3px 3px rgba(17,37,39,.3); transform: rotate(14deg); }

.konane-board {
    display: grid;
    width: min(90vw, 620px);
    aspect-ratio: 1;
    grid-template-columns: repeat(8, 1fr);
    overflow: hidden;
    border: clamp(8px, 2vw, 16px) solid #3f3028;
    border-radius: 24px;
    background: #9d7150;
    box-shadow: inset 0 0 0 3px #241d1a, 0 19px 39px rgba(33,24,21,.4);
}
.konane-cell { position: relative; display: grid; place-items: center; min-width: 0; padding: 8%; border: 0; }
.konane-cell.light-cell { background: linear-gradient(145deg, #d9a66c, #b87b4f); }
.konane-cell.dark-cell { background: linear-gradient(145deg, #80533c, #563c34); }
.konane-stone { display: block; width: 82%; aspect-ratio: 1; border: 3px solid color-mix(in srgb, var(--piece-color) 72%, #30241f); border-radius: 46% 54% 50% 48%; background: radial-gradient(circle at 34% 25%, rgba(255,255,255,.82) 0 7%, transparent 9%), radial-gradient(circle, color-mix(in srgb, var(--piece-color) 78%, white), var(--piece-color) 60%, color-mix(in srgb, var(--piece-color) 62%, #221e1e)); box-shadow: inset -4px -5px 6px rgba(25,20,19,.22), 0 4px 5px rgba(25,19,18,.48); }
.konane-cell.selected { z-index: 2; box-shadow: inset 0 0 0 5px #ffe993; }
.konane-cell.legal { cursor: pointer; box-shadow: inset 0 0 0 5px #8de7d4; animation: graph-legal 680ms ease-in-out infinite alternate; }
.konane-cell.last { outline: 4px solid #f87455; outline-offset: -5px; }

.loa-board {
    display: grid;
    width: min(90vw, 620px);
    aspect-ratio: 1;
    grid-template-columns: repeat(8, 1fr);
    overflow: hidden;
    border: clamp(8px, 2vw, 16px) solid #384354;
    border-radius: 20px;
    background: #aeb7c0;
    box-shadow: inset 0 0 0 3px #202937, 0 19px 39px rgba(23,31,43,.38);
}
.loa-cell { position: relative; display: grid; place-items: center; min-width: 0; padding: 8%; border: 0; }
.loa-cell.light-cell { background: linear-gradient(145deg, #d6d1c4, #b8b5ad); }
.loa-cell.dark-cell { background: linear-gradient(145deg, #8295a3, #607481); }
.loa-piece { display: block; width: 80%; aspect-ratio: 1; border: 3px solid color-mix(in srgb, var(--piece-color) 68%, #252d35); border-radius: 50%; background: radial-gradient(circle at 34% 25%, rgba(255,255,255,.88) 0 7%, transparent 9%), radial-gradient(circle, color-mix(in srgb, var(--piece-color) 78%, white), var(--piece-color) 59%, color-mix(in srgb, var(--piece-color) 62%, #222a34)); box-shadow: inset -4px -5px 6px rgba(22,28,35,.23), 0 4px 5px rgba(22,28,35,.42); }
.loa-cell.selected { z-index: 2; box-shadow: inset 0 0 0 5px #ffe47d; }
.loa-cell.legal { cursor: pointer; box-shadow: inset 0 0 0 5px #75e3d0; }
.loa-cell.last { outline: 4px solid #ff715b; outline-offset: -5px; }
.loa-distance { position: absolute; z-index: 3; right: 4px; bottom: 3px; display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; color: #fff; background: #27364b; font-size: .7rem; font-weight: 900; }

.amazons-board {
    display: grid;
    width: min(92vw, 650px);
    aspect-ratio: 1;
    grid-template-columns: repeat(10, 1fr);
    overflow: hidden;
    border: clamp(8px, 2vw, 16px) solid #324f50;
    border-radius: 22px;
    background: #5d8d83;
    box-shadow: inset 0 0 0 3px #1b3438, 0 19px 39px rgba(20,43,45,.4);
}
.amazons-cell { position: relative; display: grid; place-items: center; min-width: 0; padding: 5%; border: 0; }
.amazons-cell.light-cell { background: linear-gradient(145deg, #d8c99f, #b5b07f); }
.amazons-cell.dark-cell { background: linear-gradient(145deg, #4f877e, #356a69); }
.amazons-piece { display: block; width: 74%; height: 82%; border: 2px solid color-mix(in srgb, var(--piece-color) 62%, #243235); border-radius: 52% 52% 24% 24%; background: radial-gradient(circle at 36% 20%, rgba(255,255,255,.86) 0 7%, transparent 9%), linear-gradient(90deg, color-mix(in srgb, var(--piece-color) 72%, #55656b), var(--piece-color) 48%, color-mix(in srgb, var(--piece-color) 65%, white)); box-shadow: 0 4px 4px rgba(22,37,38,.38); clip-path: polygon(31% 0, 69% 0, 77% 25%, 62% 38%, 88% 100%, 12% 100%, 38% 38%, 23% 25%); }
.amazons-arrow { position: relative; display: block; width: 24%; height: 82%; border-radius: 45% 45% 20% 20%; background: linear-gradient(#f0b75b 0 18%, #4e332d 20% 100%); box-shadow: 0 3px 3px rgba(24,31,33,.42); transform: rotate(18deg); }
.amazons-arrow::after { content: ""; position: absolute; right: 50%; bottom: -1px; width: 120%; height: 28%; background: #b85045; clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); transform: translateX(50%); }
.amazons-cell.selected { z-index: 2; box-shadow: inset 0 0 0 4px #ffe68b; }
.amazons-cell.legal { cursor: pointer; box-shadow: inset 0 0 0 4px #86f0cf; }
.amazons-cell.last { outline: 3px solid #ff6c58; outline-offset: -4px; }

.breakthrough-board {
    display: grid;
    width: min(90vw, 610px);
    aspect-ratio: 1;
    grid-template-columns: repeat(7, 1fr);
    overflow: hidden;
    border: clamp(8px, 2vw, 16px) solid #4c493f;
    border-radius: 24px;
    background: #cbac73;
    box-shadow: inset 0 0 0 3px #302f2c, 0 19px 39px rgba(39,33,28,.4);
}
.breakthrough-cell { position: relative; display: grid; place-items: center; min-width: 0; padding: 7%; border: 0; }
.breakthrough-cell.light-cell { background: linear-gradient(145deg, #ead39e, #c9aa73); }
.breakthrough-cell.dark-cell { background: linear-gradient(145deg, #7aa3a9, #557b84); }
.breakthrough-cell.home-row::after { content: ""; position: absolute; inset-inline: 12%; bottom: 6%; height: 4px; border-radius: 2px; background: rgba(255,244,193,.72); }
.breakthrough-piece { position: relative; z-index: 1; display: block; width: 72%; height: 82%; border: 3px solid color-mix(in srgb, var(--piece-color) 64%, #3d3430); border-radius: 48% 48% 34% 34%; background: radial-gradient(circle at 35% 24%, rgba(255,255,255,.86) 0 8%, transparent 10%), linear-gradient(135deg, color-mix(in srgb, var(--piece-color) 76%, white), var(--piece-color) 58%, color-mix(in srgb, var(--piece-color) 62%, #3c3130)); box-shadow: inset -4px -5px 5px rgba(48,34,31,.2), 0 4px 5px rgba(39,30,28,.38); clip-path: polygon(50% 0, 88% 24%, 78% 100%, 22% 100%, 12% 24%); }
.breakthrough-cell.selected { z-index: 2; box-shadow: inset 0 0 0 5px #fff09b; }
.breakthrough-cell.legal { cursor: pointer; box-shadow: inset 0 0 0 5px #82efd0; }
.breakthrough-cell.last { outline: 4px solid #ff664f; outline-offset: -5px; }
.breakthrough-cell.winning { animation: graph-legal 650ms ease-in-out infinite alternate; }

@keyframes graph-legal { to { box-shadow: 0 0 0 5px rgba(255,239,144,.72), 0 0 18px #ffe66e; } }

.role-chip { padding: 7px 10px; border: 1px solid rgba(47,53,62,.16); border-radius: 999px; background: #fff8e6; color: #26354a; font-weight: 800; }

@media (max-width: 560px) {
    .four-row-board { width: min(94vw, 430px); gap: 4px; border-width: 7px; border-radius: 18px 18px 12px 12px; }
    .quick-go-board { width: min(94vw, 430px); padding: 16px; border-width: 8px; border-radius: 15px; }
    .oware-board { width: min(96vw, 440px); grid-template-columns: 49px 1fr 49px; gap: 5px; padding: 8px; border-width: 7px; border-radius: 24px; }
    .oware-field { gap: 3px; }
    .oware-pit { border-width: 1px; }
    .oware-store { border-radius: 22px; }
    .oware-store-label { writing-mode: vertical-rl; font-size: .61rem; }
    .oware-store strong { font-size: 1.15rem; }
    .oware-seed-count { top: 1px; right: 1px; min-width: 16px; height: 16px; font-size: .62rem; }
    .graph-board { width: min(94vw, 440px); border-width: 8px; border-radius: 18px; }
    .graph-tracks line { stroke-width: 4; }
    .surakarta-tracks path { stroke-width: 6; }
}

@media (prefers-reduced-motion: reduce) {
    .four-row-token.just-dropped,
    .four-row-token.winning,
    .graph-point.legal { animation: none; }
}
.account-links-panel {
    background: var(--feature-gradient);
    max-width: 760px;
    margin: 0 auto;
}

.location-panel {
    background: var(--feature-gradient);
    margin-inline: auto;
    max-width: 760px;
}

.account-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 90%, var(--palette-secondary));
}

.account-link-card h2,
.account-link-card p {
    margin: 0;
}

.account-link-status {
    flex: 0 0 auto;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 16%, var(--surface));
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
}

.account-link-status.connected {
    background: color-mix(in srgb, var(--mint) 38%, var(--surface));
    color: var(--text);
}

.account-link-code {
    max-width: 13rem;
    font-size: 1.4rem;
    letter-spacing: .35em;
    text-align: center;
}

.account-merge-notes {
    margin: 0;
    padding-inline-start: 1.4rem;
}

.account-merge-confirm {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
}

.profile-status.error {
    color: var(--danger);
}

.telegram-entry-shell {
    max-width: 640px;
}

.telegram-entry-panel {
    gap: 18px;
    margin-top: clamp(28px, 8vh, 72px);
    padding: clamp(20px, 5vw, 34px);
}

.telegram-entry-panel .mini-hero {
    padding-bottom: 6px;
}

.telegram-entry-panel > .btn {
    width: 100%;
}

.telegram-entry-panel [hidden] {
    display: none !important;
}

.telegram-entry-terms {
    margin-bottom: 0;
    text-align: center;
}

.telegram-entry-terms a {
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Public landing page */
.landing-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--yellow) 70%, transparent), transparent 27rem),
        radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--sky) 42%, transparent), transparent 30rem),
        linear-gradient(180deg, var(--paper-warm), var(--page));
}

.landing-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 36px;
}

.landing-nav,
.landing-nav-actions,
.landing-social-links,
.landing-brand,
.landing-actions,
.landing-facts,
.landing-footer,
.landing-footer nav {
    display: flex;
    align-items: center;
}

.landing-nav {
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.landing-brand {
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -.025em;
}

.landing-brand img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 5px 0 rgba(37, 35, 58, .13));
}

.landing-nav-actions {
    gap: 10px;
}

.landing-social-links {
    gap: 7px;
}

.landing-social-link {
    align-items: center;
    background: color-mix(in srgb, var(--coral) 24%, white);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--status-text);
    display: flex;
    font-size: .82rem;
    font-weight: 900;
    gap: 5px;
    min-height: 46px;
    padding: 4px 11px 4px 6px;
    transition: box-shadow .18s ease, transform .18s ease;
}

[dir="rtl"] .landing-social-link {
    padding: 4px 6px 4px 11px;
}

.landing-instagram-link {
    background: color-mix(in srgb, var(--sky) 24%, white);
}

.landing-social-link img {
    height: 34px;
    object-fit: contain;
    width: 34px;
}

.landing-social-link:hover,
.landing-social-link:focus-visible {
    box-shadow: none;
    transform: translateY(-2px);
}

.landing-nav-link {
    padding: 10px 12px;
    font-weight: 850;
}

.landing-language {
    font-weight: 900;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    align-items: center;
    gap: clamp(24px, 4vw, 54px);
    min-height: 590px;
    padding: clamp(28px, 5vw, 68px);
    overflow: hidden;
    border: 3px solid var(--line);
    border-radius: 30px;
    background: var(--feature-gradient);
    box-shadow: 0 12px 0 rgba(37, 35, 58, .13);
}

.landing-hero-copy {
    position: relative;
    z-index: 1;
}

.landing-eyebrow,
.landing-kicker,
.landing-feature-card span {
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.landing-eyebrow {
    color: var(--accent-strong-text);
    display: inline-flex;
    padding: 8px 12px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--yellow) 72%, var(--surface));
    box-shadow: 0 4px 0 rgba(37, 35, 58, .12);
}

.landing-kicker,
.landing-feature-card span {
    color: var(--text);
}

.landing-hero h1 {
    max-width: 11ch;
    margin: 22px 0 18px;
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 950;
    letter-spacing: -.065em;
    line-height: .96;
}

[dir="rtl"] .landing-hero h1 {
    letter-spacing: -.035em;
    line-height: 1.14;
}

.landing-hero-copy > p {
    max-width: 58ch;
    margin-bottom: 25px;
    color: var(--muted);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-weight: 650;
    line-height: 1.65;
}

.landing-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.landing-actions .btn,
.landing-final-cta .btn {
    min-height: 52px;
    padding-inline: 19px;
}

.landing-facts {
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.landing-facts li {
    padding: 7px 10px;
    border: 1.5px solid color-mix(in srgb, var(--line) 50%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    font-size: .8rem;
    font-weight: 800;
}

.landing-hero-art {
    position: relative;
    margin: 0;
    padding: 12px;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 9px 10px 0 color-mix(in srgb, var(--violet) 45%, rgba(37, 35, 58, .16));
    transform: rotate(1.5deg);
}

[dir="rtl"] .landing-hero-art {
    transform: rotate(-1.5deg);
}

.landing-hero-art img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 15px;
}

.landing-hero-art figcaption {
    padding: 12px 7px 3px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
    text-align: center;
}

.landing-section {
    padding: clamp(64px, 9vw, 100px) 0;
}

.landing-section-heading {
    max-width: 720px;
    margin-bottom: 30px;
}

.landing-section-heading h2,
.landing-final-cta h2 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 950;
    letter-spacing: -.045em;
    line-height: 1.05;
}

[dir="rtl"] .landing-section-heading h2,
[dir="rtl"] .landing-final-cta h2 {
    letter-spacing: -.025em;
    line-height: 1.25;
}

.landing-section-heading p {
    margin: 0;
    color: var(--muted);
    font-weight: 650;
    line-height: 1.6;
}

.landing-category-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.landing-category-card {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 155px;
    padding: 14px 8px 12px;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 6px 0 rgba(37, 35, 58, .12);
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease;
}

.landing-category-card:hover {
    transform: translateY(-4px) rotate(-1deg);
    box-shadow: 0 10px 0 rgba(37, 35, 58, .1);
}

.landing-category-card:nth-child(even):hover {
    transform: translateY(-4px) rotate(1deg);
}

.landing-category-card img {
    width: min(82px, 80%);
    height: 82px;
    object-fit: contain;
}

.landing-category-card strong {
    font-size: .88rem;
}

.landing-category-card.category-board,
.landing-category-card.category-puzzle {
    background: color-mix(in srgb, var(--mint) 32%, var(--surface));
}

.landing-category-card.category-card,
.landing-category-card.category-drawing {
    background: color-mix(in srgb, var(--pink) 25%, var(--surface));
}

.landing-category-card.category-dice,
.landing-category-card.category-word {
    background: color-mix(in srgb, var(--sky) 32%, var(--surface));
}

.landing-category-card.category-paper {
    background: color-mix(in srgb, var(--yellow) 48%, var(--surface));
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: clamp(64px, 9vw, 100px);
}

.landing-feature-card {
    display: grid;
    align-content: start;
    min-height: 100%;
    overflow: hidden;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 8px 0 rgba(37, 35, 58, .13);
}

.landing-feature-card > img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-bottom: 3px solid var(--line);
    background: var(--surface-3);
}

.landing-feature-card > div {
    padding: 24px;
}

.landing-feature-card h2 {
    margin: 8px 0 10px;
    font-size: 1.4rem;
    font-weight: 950;
    line-height: 1.12;
}

.landing-feature-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.55;
}

.landing-final-cta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: clamp(26px, 5vw, 48px);
    border: 3px solid var(--line);
    border-radius: 26px;
    background:
        radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--coral) 25%, transparent), transparent 32%),
        color-mix(in srgb, var(--yellow) 55%, var(--surface));
    box-shadow: 0 10px 0 rgba(37, 35, 58, .13);
}

.landing-final-cta > img {
    width: clamp(72px, 10vw, 112px);
    filter: drop-shadow(0 6px 0 rgba(37, 35, 58, .12));
}

.landing-final-cta h2 {
    max-width: 20ch;
    margin-bottom: 0;
    font-size: clamp(1.7rem, 3.2vw, 2.8rem);
}

.landing-footer {
    justify-content: space-between;
    gap: 20px;
    padding: 30px 4px 0;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 750;
}

.landing-footer nav {
    gap: 18px;
}

.landing-footer a:hover,
.landing-nav-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 960px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .landing-hero-copy {
        max-width: 720px;
    }

    .landing-hero-art {
        width: min(650px, 100%);
        margin-inline: auto;
    }

    .landing-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .landing-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 10px;
    }

    .landing-nav {
        margin-bottom: 12px;
    }

    .landing-brand span {
        display: none;
    }

    .landing-nav-actions {
        gap: 5px;
    }

    .landing-social-links {
        gap: 4px;
    }

    .landing-social-link {
        min-height: 44px;
        padding: 4px 7px;
    }

    .landing-social-link img {
        height: 30px;
        width: 30px;
    }

    .landing-nav-link {
        padding-inline: 7px;
    }

    .landing-social-link span {
        display: none;
    }

    .landing-hero {
        min-height: auto;
        padding: 26px 18px 30px;
        border-radius: 22px;
    }

    .landing-hero h1 {
        font-size: clamp(2.45rem, 12vw, 3.8rem);
    }

    .landing-actions .btn {
        flex: 1 1 100%;
    }

    .landing-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-category-card:last-child {
        grid-column: 1 / -1;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .landing-final-cta {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .landing-final-cta .btn {
        width: 100%;
    }

    .landing-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 340px) {
    .landing-nav-actions {
        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-category-card {
        transition: none;
    }
}

/* Phone layouts keep complete cards and active controls readable at Galaxy-size widths. */
.grid-1x1 {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 720px) {
    .hundred-hop-control-panel {
        grid-column: 1 / -1;
        left: 0;
        right: 0;
        width: auto;
    }

    .move-timer,
    .game-tool-button {
        min-height: 44px;
    }

    .game-tool-button {
        min-width: 44px;
    }
}

@media (max-width: 520px) {
    .shelf-controls .icon-btn {
        height: 44px;
        width: 44px;
    }

    .player-option {
        min-height: 44px;
    }

    .player-link-btn {
        min-width: 44px;
    }

    .roll-call-board {
        --roll-call-label: 44px;
    }

    .roll-call-line.column-call {
        min-height: 44px;
    }

    .flip-nine-page .game-player-strip.three-player {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flip-nine-page .game-player-strip.three-player .game-player-card:first-child {
        grid-column: 1 / -1;
    }
}

html[data-theme="dark"] .game-player-card:not(.active) span {
    color: var(--status-text);
}

.leaderboard-loading .leader-primary-switch,
.leaderboard-loading .leader-game-browser,
.leaderboard-loading .leader-board-panel {
    opacity: .62;
    pointer-events: none;
}

@media (max-width: 520px) {
    .top-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding-bottom: 12px;
    }

    .brand {
        flex: 1 1 140px;
        gap: 7px;
    }

    .brand > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .brand img {
        height: 40px;
        width: 40px;
    }

    .brand-title {
        font-size: 17px;
    }

    .brand-subtitle {
        font-size: 11px;
        line-height: 1.2;
    }

    .header-actions {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .header-actions .icon-btn,
    .header-user {
        height: 42px;
        min-height: 42px;
        width: 42px;
    }

    .header-user img {
        height: 30px;
        width: 30px;
    }

    .top-bar.has-back .brand {
        gap: 5px;
    }

    .top-bar.has-back .brand img {
        height: 34px;
        width: 34px;
    }

    .top-bar.has-back .header-actions {
        gap: 3px;
    }

    .top-bar.has-back .header-actions .icon-btn,
    .top-bar.has-back .header-user {
        height: 38px;
        min-height: 38px;
        width: 38px;
    }

    .top-bar.has-back .header-user img {
        height: 28px;
        width: 28px;
    }

    .game-world-page .hero {
        gap: 10px;
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 10px;
    }

    .game-world-page .hero h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .game-world-page .hero p {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .game-world-page .character-roster-link {
        min-height: 38px;
        padding: 6px 9px;
    }

    .game-shelf-quick-links {
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 6px;
    }

    .game-shelf-quick-links .btn {
        font-size: 11px;
        min-height: 34px;
        padding: 4px 6px;
    }

    .game-shelf-quick-links .shared-link-open img {
        height: 20px;
        width: 20px;
    }

    .profile-hero-panel {
        align-items: start;
        gap: 20px;
        grid-template-columns: 88px minmax(0, 1fr);
        padding: 12px;
    }

    .profile-hero-avatar,
    .profile-hero-avatar-frame {
        width: 88px;
    }

    .profile-hero-copy h1 {
        font-size: 24px;
        margin-bottom: 3px;
    }

    .profile-hero-copy > .muted,
    .profile-hero-copy .public-profile-location {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 3px;
    }

    .profile-hero-meta {
        gap: 5px 8px;
        margin: 4px 0 5px;
    }

    .profile-stats-link {
        min-height: 28px;
        padding: 5px 8px;
    }

    .profile-hero-about {
        gap: 6px;
        margin-top: 5px;
        padding: 5px 6px;
    }

    .profile-hero-about-title,
    .profile-hero-about .profile-about-preview {
        font-size: 10px;
    }

    .profile-hero-about .profile-about-edit {
        font-size: 11px;
        min-height: 34px;
        padding: 5px 8px;
    }

    .profile-photo-actions {
        display: grid;
        gap: 5px;
        grid-template-columns: minmax(0, 1fr) auto;
        margin-top: 6px;
    }

    .profile-photo-actions .btn {
        font-size: 12px;
        min-height: 40px;
        padding: 6px 9px;
    }

    .profile-picture-change-control .btn {
        padding-inline-end: 36px;
        width: 100%;
    }

    .profile-picture-change-control .profile-help-button {
        inset-inline-end: 6px;
    }

    .profile-photo-selector {
        gap: 4px;
        grid-template-columns: 28px auto 28px minmax(0, 1fr);
        margin-top: 5px;
    }

    .profile-photo-selector > strong,
    .profile-photo-selector > .muted {
        font-size: 10px;
    }

    .profile-photo-step {
        height: 28px;
        width: 28px;
    }

    .game-status {
        gap: 6px;
        grid-template-columns: 44px minmax(0, 1fr);
        margin-bottom: 10px;
        padding: 8px;
    }

    .game-status > img {
        width: 44px;
    }

    .game-status > div:not(.game-status-actions) {
        min-width: 0;
    }

    .game-status > div:not(.game-status-actions) > strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .game-status-line {
        align-items: center;
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .game-status-line #gameStatus {
        display: -webkit-box;
        line-height: 1.3;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .game-status .turn-callout.hidden {
        display: none !important;
    }

    .turn-callout {
        font-size: 11px;
        min-height: 26px;
        padding: 5px 7px;
        width: auto;
    }

    .game-status-actions {
        gap: 6px;
    }

    .move-timer {
        min-width: 0;
    }

    .game-status-actions .game-tool-button:not(.leave) {
        flex: 0 0 44px;
        padding-inline: 4px;
        width: 44px;
    }

    .game-status-actions .game-tool-button.leave {
        flex: 0 0 auto;
        min-width: 58px;
    }

    .game-status-actions .game-pause-button {
        flex-direction: column;
        gap: 0;
        line-height: 20px;
        padding-block: 2px;
    }

    .game-pause-count {
        font-size: 10px;
        line-height: 12px;
    }

    /* Three columns are an intentionally dense browsing mode on phones.
       Keep every room action usable instead of squeezing the desktop card. */
    .grid-3x3 .game-card {
        min-height: 0;
    }

    .grid-3x3 .game-card-badges {
        display: none;
    }

    .grid-3x3 .game-favourite-button {
        height: 28px;
        left: 4px;
        padding: 5px;
        top: 4px;
        width: 28px;
    }

    .grid-3x3 .game-card-flip,
    .grid-3x3 .game-card-media {
        aspect-ratio: 1;
    }

    .grid-3x3 .game-card-media {
        padding: 4px;
    }

    .grid-3x3 .game-variant-switch {
        bottom: 3px;
        gap: 1px;
        left: 3px;
        padding: 2px;
    }

    .grid-3x3 .game-variant-switch button {
        font-size: 8px;
        padding: 4px 3px;
    }

    .grid-3x3 .game-card-body {
        gap: 5px;
        grid-template-rows: auto auto;
        padding: 5px;
    }

    .grid-3x3 .game-card-title {
        gap: 3px;
        grid-template-columns: minmax(0, 1fr) 26px;
        min-height: 32px;
    }

    .grid-3x3 .game-card-title > img {
        display: none;
    }

    .grid-3x3 .game-card h3 {
        font-size: 11px;
    }

    .grid-3x3 .rules-button {
        font-size: 13px;
        height: 26px;
        width: 26px;
    }

    .grid-3x3 .player-options {
        display: grid;
        gap: 5px;
        grid-template-columns: 1fr;
    }

    .grid-3x3 .player-option {
        font-size: 11px;
        grid-template-columns: minmax(0, 1fr) 27px;
        min-height: 36px;
        width: 100%;
    }

    .grid-3x3 .player-play-btn {
        gap: 2px;
        padding-inline: 2px;
    }

    .grid-3x3 .room-score-factor {
        font-size: .54rem;
        height: 1.05rem;
        max-width: 2rem;
        min-width: 1.75rem;
    }

    .grid-3x3 .player-link-btn {
        min-width: 27px;
    }

    .grid-3x3 .player-link-btn img {
        height: 18px;
        width: 18px;
    }

    .grid-3x3 .computer-open-button {
        font-size: 11px;
        gap: 2px;
        min-height: 38px;
        overflow: hidden;
        padding-inline: 3px;
        width: 100%;
    }

    .grid-3x3 .computer-open-button img {
        flex: 0 0 22px;
        height: 22px;
        width: 22px;
    }

    .grid-3x3 .computer-open-button span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .grid-3x3 .invite-status:empty {
        display: none;
    }

    .grid-1x1 .game-card {
        grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
        grid-template-rows: auto auto;
        min-height: 0;
    }

    .grid-1x1 .game-card-badges {
        grid-column: 1 / -1;
        grid-row: 1;
        left: auto;
        padding: 6px 8px 3px 52px;
        position: static;
        right: auto;
        top: auto;
    }

    [dir="rtl"] .grid-1x1 .game-card-badges {
        padding-left: 8px;
        padding-right: 52px;
    }

    .grid-1x1 .game-card-flip,
    .grid-1x1 .game-card > .game-card-media {
        aspect-ratio: auto;
        grid-column: 1;
        grid-row: 2;
        height: 100%;
        min-height: 186px;
    }

    .grid-1x1 .game-card-body {
        grid-column: 2;
        grid-row: 2;
    }

    .grid-1x1 .game-card-media {
        height: 100%;
    }

    .grid-1x1 .game-variant-switch {
        bottom: 6px;
        left: 6px;
    }

    .grid-1x1 .game-card-title,
    .grid-2x2 .game-card-title {
        gap: 5px;
        grid-template-columns: 28px minmax(0, 1fr) 30px;
        min-height: 34px;
    }

    .grid-1x1 .game-card-title img,
    .grid-2x2 .game-card-title img {
        height: 28px;
        width: 28px;
    }

    .grid-1x1 .game-card h3,
    .grid-2x2 .game-card h3 {
        font-size: 14px;
    }

    .grid-1x1 .rules-button,
    .grid-2x2 .rules-button {
        height: 30px;
        width: 30px;
    }

    .grid-1x1 .game-card-body,
    .grid-2x2 .game-card-body {
        gap: 6px;
        grid-template-rows: auto auto;
        padding: 8px;
    }

    .grid-1x1 .player-options,
    .grid-2x2 .player-options {
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-1x1 .player-option,
    .grid-2x2 .player-option {
        grid-template-columns: minmax(0, 1fr) 32px;
        min-height: 44px;
    }

    .grid-1x1 .player-play-btn,
    .grid-2x2 .player-play-btn {
        gap: 3px;
        padding-inline: 4px;
    }

    .grid-1x1 .room-score-factor,
    .grid-2x2 .room-score-factor {
        font-size: .54rem;
        min-width: 1.9rem;
    }

    /* Keep two room choices per row without narrowing their invite buttons. */
    .grid-1x1 .player-option:has(:where(.room-score-factor:not([hidden]):not(.is-hidden))) .player-play-btn,
    .grid-2x2 .player-option:has(:where(.room-score-factor:not([hidden]):not(.is-hidden))) .player-play-btn {
        flex-direction: column;
        font-size: 11px;
        gap: 1px;
        line-height: 1;
        padding-inline: 2px;
    }

    .grid-1x1 .player-options .room-score-factor,
    .grid-2x2 .player-options .room-score-factor {
        font-size: .5rem;
        height: 14px;
        min-width: 1.4rem;
    }

    .grid-1x1 .player-link-btn,
    .grid-2x2 .player-link-btn {
        min-width: 32px;
    }

    .grid-1x1 .computer-open-button,
    .grid-2x2 .computer-open-button {
        gap: 3px;
        min-height: 44px;
        padding-inline: 5px;
    }

    .grid-1x1 .computer-open-button img,
    .grid-2x2 .computer-open-button img {
        height: 30px;
        width: 30px;
    }

    .grid-1x1 .invite-status:empty,
    .grid-2x2 .invite-status:empty {
        display: none;
    }

    .grid-2x2 .game-card {
        min-height: 0;
    }

    .grid-2x2 .game-card-flip,
    .grid-2x2 .game-card-media {
        aspect-ratio: 2 / 1;
    }

    .grid-2x2 .game-favourite-button {
        height: 30px;
        left: 6px;
        padding: 5px;
        top: 6px;
        width: 30px;
    }

    .grid-2x2 .game-card-badges {
        gap: 3px;
        left: 42px;
        right: 5px;
        top: 6px;
    }

    .grid-2x2 .game-badge {
        font-size: 9px;
        padding: 4px 5px;
    }

    .grid-2x2 .game-variant-switch {
        bottom: 5px;
        left: 5px;
        padding: 2px;
    }

    .grid-2x2 .game-variant-switch button {
        font-size: 10px;
        padding: 5px;
    }
}

/* Every live-game section shares the app's width contract. This also keeps
   disabled games safe to re-enable without reviving a desktop-wide surface. */
.board-wrap > :where(section, nav, p):where(:not(.game-end-overlay):not(.game-world-reveal):not(.ludo-finish-vote)) {
    max-width: var(--live-game-content-width);
    zoom: var(--live-game-scale);
}

.board-wrap > .game-end-overlay .game-end-card,
.board-wrap > .game-world-reveal .game-world-reveal-card,
.board-wrap > .ludo-finish-vote .ludo-finish-vote-card {
    zoom: var(--live-game-scale);
}

.board-wrap > section.ttt-board.ttt-board {
    max-width: min(var(--ttt-max, 340px), 78vw);
}

.board-wrap > #blackHoleBoard {
    max-width: var(--bh-board-width);
}

.board-wrap > section.ttt-board.ttt-board[data-size="4"] {
    max-width: min(var(--ttt-max, 420px), 90vw);
}

/* Mobile game-density pass: Galaxy S24 is the reference viewport; the
   narrower rules keep the same hierarchy usable down to compact phones. */
@media (max-width: 520px) {
    .board-wrap {
        overflow-x: hidden;
        padding: 4px;
    }

    .board-wrap > :where(section, nav, p):where(:not(.game-end-overlay):not(.game-world-reveal):not(.ludo-finish-vote)) {
        width: 100%;
    }

    /* Background art may crop at an edge, but it must never stretch with a
       tall game document. The fixed positioning area stays viewport-shaped
       even while an explicit detail overlay scrolls internally. */
    .board-wrap.game-background-simple,
    .board-wrap.game-background-world {
        background-position: center;
        background-size: cover;
    }

    .board-wrap.game-background-moonlit {
        background-position: center;
        background-size: cover;
    }

    /* A bot action shares a narrow 2x2 shelf column with the player actions.
       Bound both the mascot and label so neither can escape the button. */
    .grid-2x2 .computer-open-button {
        font-size: 11px;
        gap: 2px;
        justify-content: center;
        min-width: 0;
        overflow: hidden;
        padding-inline: 2px;
        width: 100%;
    }

    .grid-2x2 .computer-open-button img {
        flex: 0 0 24px;
        height: 24px;
        max-width: 24px;
        width: 24px;
    }

    .grid-2x2 .computer-open-button span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Statistics keep the artwork recognizable without spending a full card
       row on it. The desktop two-column composition remains unchanged. */
    .game-stat-card {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .game-stat-art {
        align-items: flex-start;
        border-inline-end: 2px solid var(--boo-light-primary);
        display: flex;
        padding: 7px;
    }

    .game-stat-art img {
        aspect-ratio: 1;
        border-radius: 7px;
        object-fit: cover;
    }

    .game-stat-body {
        gap: 7px;
        padding: 9px;
    }

    .game-stat-title {
        gap: 7px;
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .game-stat-title img {
        border-width: 1px;
        height: 34px;
        padding: 2px;
        width: 34px;
    }

    .game-stat-title strong {
        font-size: 16px;
    }

    .game-stat-pills,
    .game-stat-body .stats-chip-row {
        gap: 4px;
    }

    .game-stat-pills span,
    .game-stat-body .stats-chip-row em,
    .game-stat-month .mom-badge {
        border-width: 1px;
        font-size: 10px;
        padding: 4px 6px;
    }

    .game-stat-month {
        gap: 5px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .game-stat-month .mom-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .game-stat-month strong {
        font-size: 22px;
    }

    .game-stat-mix strong {
        font-size: 16px;
        min-width: 26px;
        padding: 4px 7px;
    }

    .game-stat-mix {
        gap: 5px;
    }

    .game-stat-mix div {
        align-items: center;
        display: flex;
        gap: 5px;
        justify-content: space-between;
        padding: 5px 7px;
    }

    .mix-meter {
        border-width: 1px;
        height: 9px;
    }

    .game-status {
        border-width: 2px;
        box-shadow: 0 4px 0 rgba(37, 49, 74, .14);
        gap: 5px;
        grid-template-columns: 38px minmax(0, 1fr);
        margin-bottom: 8px;
        padding: 6px;
    }

    .game-status > img {
        width: 38px;
    }

    .game-status > div:nth-child(2) > strong {
        display: block;
        font-size: 14px;
        line-height: 1.15;
    }

    .game-status-line {
        gap: 2px;
        margin-top: 1px;
    }

    .game-status-line #gameStatus {
        font-size: 12px;
        line-height: 1.15;
    }

    .turn-callout {
        font-size: 10px;
        min-height: 22px;
        padding: 4px 7px;
        width: fit-content;
    }

    .game-status-actions {
        gap: 5px;
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .game-status-actions .move-timer {
        flex: 1 1 auto;
    }

    .move-timer,
    .game-tool-button {
        min-height: 44px;
    }

    .game-tool-button {
        min-width: 44px;
        padding: 4px 6px;
    }

    .game-tool-button img {
        height: 23px;
        width: 23px;
    }

    .game-tool-button.leave {
        min-width: 56px;
    }

    .game-player-strip {
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 8px;
    }

    .board-wrap .game-player-strip:has(> .game-player-card:nth-child(3)) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .board-wrap .game-player-strip:has(> .game-player-card:nth-child(3)) > .game-player-card {
        min-width: 0;
    }

    .board-wrap .game-player-card,
    .board-wrap .game-player-card.bot-player-card {
        border-width: 2px;
        box-shadow: none;
        gap: 5px;
        grid-template-columns: 40px minmax(0, 1fr) 30px;
        min-width: 0;
        padding: 5px;
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade) {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 60px;
    }

    .board-wrap .game-player-card.game-player-card-royal-inlay {
        --game-player-card-frame-width: 9px 16px 9px 56px;
    }

    .board-wrap .game-player-card.game-player-card-neon-arcade {
        --game-player-card-frame-width: 8px 20px 8px 56px;
    }

    .board-wrap .game-player-card.game-player-card-neon-arcade .game-player-avatar {
        transform: translateX(4px);
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-body {
        padding-inline-end: 34px;
        padding-inline-start: 6px;
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        img.game-player-crest {
        inset-inline-end: 34px;
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-marker {
        height: 22px;
        inset-inline-end: 8px;
        width: 22px;
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-avatar,
    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-avatar img {
        width: 32px;
    }

    .board-wrap .game-player-card img,
    .board-wrap .game-player-avatar,
    .board-wrap .game-player-card.bot-player-card .game-player-avatar {
        width: 40px;
    }

    .board-wrap .game-player-card .bot-player-image {
        border-radius: 8px;
        width: 40px;
    }

    .board-wrap .game-player-card strong {
        font-size: 12px;
    }

    .board-wrap .game-player-card span {
        font-size: 10px;
    }

    .board-wrap .game-player-marker {
        font-size: 13px;
        height: 30px;
        width: 30px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card,
    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card.bot-player-card {
        gap: 3px;
        grid-template-columns: 34px minmax(0, 1fr) 24px;
        min-height: 50px;
        padding: 3px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade) {
        grid-template-columns: 42px minmax(0, 1fr);
        min-height: 50px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card.game-player-card-royal-inlay {
        --game-player-card-frame-width: 7px 14px 7px 44px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card.game-player-card-neon-arcade {
        --game-player-card-frame-width: 7px 17px 7px 44px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card.game-player-card-neon-arcade
        .game-player-avatar {
        transform: translateX(3px);
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-avatar,
    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-avatar img {
        width: 28px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card img,
    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-avatar,
    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card.bot-player-card .game-player-avatar,
    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card .bot-player-image {
        width: 34px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-marker {
        font-size: 11px;
        height: 24px;
        width: 24px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card strong {
        font-size: 11px;
    }

    .board-wrap .game-player-strip:is([data-player-count="3"], [data-player-count="4"])
        .game-player-card span {
        font-size: 9px;
    }

    /* Rich multiplayer identities become a swipeable rail instead of a tall
       stack; each card still has room for its public progress. */
    .ww-player-strip {
        display: flex;
        gap: 7px;
        max-width: 100%;
        overflow-x: auto;
        padding: 0 0 5px;
        scroll-snap-type: x proximity;
    }

    .ww-player-strip .game-player-card,
    .ww-player-strip .game-player-card.bot-player-card {
        flex: 0 0 min(82vw, 310px);
        grid-template-columns: 40px minmax(64px, 1fr) 30px minmax(86px, auto);
        scroll-snap-align: start;
    }

    .ww-player-progress {
        min-width: 86px;
        padding-left: 6px;
    }

    /* Keep secondary instructions present, but stop them competing with the
       first playable surface for the opening viewport. */
    .order-chaos-mission,
    .wishwind-mission,
    .sim-mission,
    .dots-boxes-scoreboard,
    .paper-soccer-banner,
    .sprouts-mission,
    .sos-toolbar,
    .hex-guide,
    .gomoku-guide,
    .morris-guide,
    .kalah-guide,
    .fox-guide,
    .reversi-score-ribbon,
    .fanorona-guide,
    .nim-note,
    .merge-race-banner,
    .word-ladder-goal,
    .flip-nine-deck-banner {
        border-width: 2px;
        box-shadow: 0 3px 0 rgba(37, 49, 74, .14);
        gap: 6px;
        margin: 6px auto 8px;
        min-height: 0;
        padding: 6px 8px;
        width: 100%;
    }

    .order-chaos-mission > img,
    .wishwind-mission > img,
    .sim-mission > img,
    .dots-boxes-scoreboard > img,
    .paper-soccer-banner > img,
    .sprouts-mission > img,
    .sos-toolbar > img {
        height: 34px;
        width: 34px;
    }

    .order-chaos-mission span,
    .order-chaos-mission strong,
    .wishwind-mission span,
    .wishwind-mission strong,
    .sim-mission span,
    .sim-mission strong,
    .paper-soccer-banner span,
    .paper-soccer-banner strong,
    .sprouts-mission span,
    .sprouts-mission strong,
    .sos-toolbar span,
    .sos-toolbar strong,
    .hex-guide,
    .gomoku-guide,
    .morris-guide,
    .kalah-guide,
    .fox-guide,
    .reversi-score-ribbon,
    .fanorona-guide,
    .nim-note,
    .merge-race-banner,
    .word-ladder-goal,
    .flip-nine-deck-banner {
        font-size: 11px;
        line-height: 1.2;
    }

    .dots-boxes-paper,
    .paper-soccer-sheet,
    .sprouts-paper,
    .sos-paper,
    .candidate-play-card,
    .candidate-board {
        max-width: 100%;
        width: 100%;
    }

    .dots-boxes-paper,
    .paper-soccer-sheet,
    .sprouts-paper,
    .sos-paper,
    .candidate-play-card {
        margin-left: auto;
        margin-right: auto;
        padding-left: 7px;
        padding-right: 7px;
    }

    .rummy-table,
    .fish-table,
    .maid-table,
    .fan-tan-table,
    .yacht-table,
    .pig-table,
    .farkle-table,
    .domino-table {
        margin: 6px auto 24px;
        padding: 8px;
        width: 100%;
    }

    .maid-table > header {
        display: none;
    }

    .rummy-table > header {
        gap: 6px;
        padding: 8px;
    }

    .rummy-table > header > div:last-child {
        display: none;
    }

    .rummy-piles {
        gap: 7px;
        width: 100%;
    }

    .rummy-piles button {
        min-height: 94px;
        padding: 5px;
        width: 50%;
    }

    .rummy-piles .playing-card {
        width: 40px;
    }

    .hundred-hop-game {
        gap: 7px;
    }

    .hundred-hop-console {
        border-width: 2px;
        box-shadow: 0 4px 0 rgba(37, 49, 74, .18);
    }

    .hundred-hop-control-panel {
        gap: 4px;
        grid-template-columns: 52px minmax(0, 1fr);
        overflow: visible;
        padding: 5px;
    }

    .hundred-hop-die-stage {
        grid-template-columns: 1fr;
    }

    .hundred-hop-die {
        border-width: 2px;
        box-shadow: 0 3px 0 rgba(37, 49, 74, .2);
        font-size: 30px;
    }

    .hundred-hop-roll {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
    }

    .hundred-hop-choices {
        gap: 4px;
        grid-column: 2;
        grid-row: 1;
    }

    .hundred-hop-choice {
        border-width: 2px;
        min-height: 44px;
        padding: 3px;
    }

    .hundred-hop-choice small,
    .hundred-hop-choice span {
        font-size: 8px;
        line-height: 1.05;
    }

    .hundred-hop-choice strong {
        font-size: 16px;
    }

    .shared-die-visual,
    .shared-single-die-target {
        height: var(--shared-die-compact-size, 52px) !important;
        width: var(--shared-die-compact-size, 52px) !important;
    }

    #farkleDice {
        --shared-die-compact-size: 46px;
    }

    .shared-single-die-surface {
        min-height: 72px;
    }

    /* Flip Nine keeps the actionable 3x3 grid primary. Opponent grids become
       readable progress rails and can still be expanded in place. */
    .flip-nine-game,
    .flip-nine-boards,
    .flip-nine-boards.three-player {
        gap: 5px;
    }

    .flip-nine-boards:not(.three-player) {
        grid-template-columns: 1fr;
    }

    .flip-nine-boards.three-player {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flip-nine-boards.three-player .flip-nine-board.self {
        grid-column: 1 / -1;
    }

    .flip-nine-page .game-player-strip.three-player {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow-x: visible;
        padding-bottom: 0;
    }

    .flip-nine-page .game-player-strip.three-player .game-player-card:first-child {
        grid-column: auto;
    }

    .flip-nine-deck-banner {
        border-width: 2px;
        box-shadow: 0 3px 0 rgba(37, 49, 74, .18);
        min-height: 32px;
        padding: 4px 6px;
    }

    .flip-nine-deck-banner strong {
        border-width: 1px;
        font-size: 10px;
        padding: 3px 6px;
    }

    .flip-nine-board {
        border-width: 2px;
        box-shadow: 0 4px 0 rgba(37, 49, 74, .18);
        gap: 4px;
        padding: 5px;
    }

    .flip-nine-board.self > header {
        min-height: 30px;
    }

    .flip-nine-board.self .flip-nine-play-area {
        gap: 5px;
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .flip-nine-board.self .flip-nine-deck-pile {
        gap: 4px;
    }

    .flip-nine-board.self .flip-nine-deck-pile .playing-card {
        height: 45px;
        width: 32px;
    }

    .flip-nine-board.self .flip-nine-deck-pile > strong {
        font-size: 9px;
        line-height: 1.1;
        max-width: 36px;
    }

    .flip-nine-board.self .flip-nine-grid {
        gap: 3px;
        justify-self: center;
        max-width: 236px;
        padding: 4px;
        width: 100%;
    }

    .flip-nine-board.self .flip-nine-grid .playing-card {
        aspect-ratio: 5 / 6;
        border-width: 1px;
        box-shadow: 0 2px 0 rgba(21, 28, 45, .22);
        padding: 2px;
    }

    .flip-nine-board.self > footer {
        min-height: 44px;
    }

    .flip-nine-guess {
        border-width: 2px;
        box-shadow: none;
        min-height: 40px;
    }

    .flip-nine-board.compact:not(.expanded) {
        align-items: center;
        grid-template-columns: minmax(62px, .42fr) minmax(0, 1.58fr);
    }

    .flip-nine-board.compact:not(.expanded) > header {
        justify-content: flex-start;
        min-height: 30px;
    }

    .flip-nine-board.compact:not(.expanded) > header > strong {
        font-size: 11px;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-expand {
        flex-basis: 28px;
        font-size: 14px;
        height: 28px;
        width: 28px;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-play-area,
    .flip-nine-board.compact:not(.expanded):not(.self) .flip-nine-play-area {
        display: grid;
        gap: 4px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-deck-pile,
    .flip-nine-board.compact:not(.expanded):not(.self) .flip-nine-deck-pile {
        display: grid;
        grid-column: 1;
        grid-row: 1;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-deck-pile .playing-card,
    .flip-nine-board.compact:not(.expanded) .flip-nine-deck-pile > span,
    .flip-nine-board.compact:not(.expanded) > footer {
        display: none;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-deck-pile > strong {
        font-size: 8px;
        line-height: 1.05;
        max-width: 42px;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-grid,
    .flip-nine-board.compact:not(.expanded):not(.self) .flip-nine-grid {
        gap: 1px;
        grid-column: 2;
        grid-row: 1;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        padding: 2px;
    }

    .flip-nine-board.compact:not(.expanded) .flip-nine-grid .playing-card {
        aspect-ratio: 5 / 6;
        border-width: 1px;
        border-radius: 3px;
        box-shadow: none;
        padding: 0;
    }

    .flip-nine-board.compact:not(.expanded) .playing-card-corner,
    .flip-nine-board.compact:not(.expanded) .playing-card-center {
        display: none;
    }

    .flip-nine-boards.three-player .flip-nine-board.compact:not(.expanded) {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .flip-nine-boards.three-player .flip-nine-board.compact:not(.expanded) .flip-nine-play-area {
        display: block;
    }

    .flip-nine-boards.three-player .flip-nine-board.compact:not(.expanded) .flip-nine-grid {
        display: none;
    }

    /* The remaining dice games use bounded, single-row trays on phones.
       Their WebGL canvases inherit these sizes, so rolling never expands or
       clips the play surface. */
    .yacht-dice,
    .farkle-dice {
        flex-wrap: nowrap;
        gap: 5px;
        margin: 8px 0;
    }

    .yacht-die,
    .farkle-die {
        aspect-ratio: 1;
        flex: 1 1 0;
        height: auto;
        max-width: 58px;
        min-width: 0;
        padding: 0;
        width: auto;
    }

    .yacht-die > span,
    .farkle-die > span {
        font-size: clamp(34px, 11vw, 48px);
        height: 100%;
        width: 100%;
    }

    .farkle-score-strip {
        gap: 6px;
        margin: 7px auto;
    }

    .farkle-score-strip article {
        padding: 6px;
    }

    .pig-roll-card {
        gap: 10px;
        margin: 8px auto;
        padding: 8px 12px;
    }

    .pig-die {
        flex: 0 0 auto;
    }

    .pig-die > span {
        font-size: 50px;
    }

    .pig-roll-card > div:last-child strong {
        font-size: 32px;
    }

    .liars-table {
        margin: 6px auto 24px;
        min-height: 0;
        width: 100%;
    }

    .liars-cups {
        gap: 6px;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        margin: 8px 0 6px;
    }

    .cup-shape {
        height: 54px;
        width: 62px;
    }

    .liars-own-cup,
    .liars-controls {
        margin-top: 8px;
        padding: 7px;
    }

    .liars-dice-row span {
        font-size: 1.55rem;
        height: 40px;
        width: 40px;
    }

    /* Kalah has a fixed 14-pocket topology. On phones the full physical board
       is more useful than an accidentally clipped desktop board. */
    .kalah-board-shell {
        overflow-x: visible;
        padding-bottom: 5px;
    }

    .kalah-board {
        border-width: 3px;
        gap: 4px;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        min-width: 0;
        padding: 6px;
        width: 100%;
    }

    .kalah-pit-rows,
    .kalah-pit-row {
        gap: 3px;
        min-width: 0;
    }

    .kalah-divider {
        height: 2px;
    }

    .kalah-pit,
    .kalah-store {
        border-width: 2px;
    }

    .kalah-pit {
        min-width: 0;
    }

    .kalah-store {
        min-height: 92px;
    }

    .kalah-pit strong,
    .kalah-store strong {
        border-width: 1px;
        bottom: 2px;
        font-size: 9px;
        min-width: 17px;
        padding: 1px 3px;
        right: 2px;
    }

    .kalah-store strong {
        font-size: 13px;
        right: auto;
    }

    .kalah-stones i {
        height: 9px;
        width: 8px;
    }

    /* During setup only the editable fleet needs the viewport. During battle
       the target ocean leads; the reference ocean remains available below. */
    .sea-battle-oceans {
        grid-template-columns: 1fr;
    }

    .sea-battle-oceans article {
        border-width: 2px;
        padding: 6px;
    }

    .sea-battle-oceans h2 {
        font-size: .82rem;
        margin-bottom: 4px;
    }

    .sea-battle-oceans.setup-phase article:last-child {
        display: none;
    }

    .sea-battle-oceans:not(.setup-phase) article:last-child {
        grid-row: 1;
    }

    .sea-battle-oceans:not(.setup-phase) article:first-child {
        justify-self: center;
        max-width: 180px;
        width: 100%;
    }

    .sea-battle-setup,
    .sea-battle-hint {
        margin: 6px auto 8px;
        padding: 7px;
    }

    .checkers-shell,
    .ludo-shell {
        gap: 7px;
        margin: 6px auto 24px;
        width: 100%;
    }

    .checkers-shell > aside,
    .checkers-shell > section,
    .ludo-shell > aside,
    .ludo-shell > section {
        border-width: 2px;
        box-shadow: 0 4px 0 var(--shadow);
        padding: 7px;
    }

    .checkers-shell > aside {
        display: block;
    }

    .checkers-shell > aside > img,
    .checkers-shell > aside > h2,
    .checkers-shell > aside > p {
        display: none;
    }

    .checkers-progress {
        display: flex;
        gap: 5px;
        margin: 0;
        overflow-x: auto;
    }

    .checkers-progress div {
        flex: 1 0 104px;
        gap: 4px;
        grid-template-columns: 10px minmax(0, 1fr) auto;
        padding: 5px;
    }

    .checkers-progress div span {
        width: 10px;
    }

    .ludo-shell > aside {
        gap: 6px;
        grid-template-columns: 62px minmax(0, 1fr) auto;
        padding: 6px;
    }

    .ludo-shell > aside > img {
        display: none;
    }

    .ludo-shell > aside .btn {
        grid-column: 3;
        min-height: 44px;
    }

    .ludo-shell > aside p {
        font-size: 10px;
    }

    .sprouts-board {
        min-height: min(420px, 110vw);
    }

    .nim-board {
        min-height: min(390px, 110vw);
    }

    .candidate-board,
    .four-row-board,
    .quick-go-board,
    .oware-board,
    .graph-board,
    .konane-board,
    .loa-board,
    .amazons-board,
    .breakthrough-board,
    .chess-board,
    .constellation-board,
    .orbit-board,
    .lantern-board {
        max-width: 100%;
    }
}

@media (max-width: 340px) {
    .board-wrap {
        padding: 3px;
    }

    .game-status {
        gap: 4px;
        grid-template-columns: 34px minmax(0, 1fr);
        margin-bottom: 6px;
        padding: 5px;
    }

    .game-status > img {
        width: 34px;
    }

    .game-status-actions {
        gap: 4px;
    }

    .move-timer,
    .game-tool-button {
        min-height: 40px;
    }

    .game-tool-button {
        min-width: 40px;
    }

    .game-player-strip {
        gap: 4px;
        margin-bottom: 6px;
    }

    .flip-nine-board.self .flip-nine-grid {
        max-width: 220px;
    }

    .grid-2x2 .computer-open-button {
        font-size: 11px;
        gap: 2px;
        padding-inline: 2px;
    }

    .grid-2x2 .computer-open-button img {
        flex-basis: 22px;
        height: 22px;
        max-width: 22px;
        width: 22px;
    }

    .game-stat-card {
        grid-template-columns: 1fr;
    }

    .game-stat-art {
        display: none;
    }

    .board-wrap .game-player-card,
    .board-wrap .game-player-card.bot-player-card {
        gap: 3px;
        grid-template-columns: 36px minmax(0, 1fr) 28px;
        padding: 4px;
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade) {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .board-wrap .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-marker {
        height: 18px;
        width: 18px;
    }

    .board-wrap .game-player-card img,
    .board-wrap .game-player-avatar,
    .board-wrap .game-player-card.bot-player-card .game-player-avatar,
    .board-wrap .game-player-card .bot-player-image {
        width: 36px;
    }

    .board-wrap .game-player-marker {
        font-size: 12px;
        height: 28px;
        width: 28px;
    }

    .kalah-board {
        gap: 3px;
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        padding: 4px;
    }

    .kalah-store {
        min-height: 82px;
    }
}

/* Short browser viewports can expose less height than their phone's physical
   screen after browser chrome is accounted for. Keep the same phone layout,
   but tighten the two tallest active surfaces instead of introducing page
   scrolling or clipping the game. */
@media (max-width: 520px) and (max-height: 680px) {
    .flip-nine-deck-banner {
        min-height: 28px;
        padding-block: 2px;
    }

    .flip-nine-board.self > header {
        min-height: 26px;
    }

    .flip-nine-board.self .flip-nine-grid {
        max-width: 214px;
    }

    .hundred-hop-paper {
        padding: 5px;
    }

    .hundred-hop-paper-header {
        margin-bottom: 4px;
    }

    .hundred-hop-paper-row {
        padding: 2px 0;
    }

    .hundred-hop-row {
        margin: 2px 0;
    }

    .hundred-hop-row-result {
        min-height: 14px;
        padding-bottom: 0;
    }
}

@media (max-width: 620px) {
    .profile-settings-panel .profile-bot-card {
        gap: 10px;
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 8px;
    }

    .profile-settings-panel .profile-bot-card img {
        width: 72px;
    }

    .profile-settings-panel .profile-bot-card p {
        font-size: 12px;
        line-height: 1.35;
        margin: 0;
    }
}

@media (min-width: 360px) and (max-width: 759px) {
    .profile-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-control select.profile-tight-select {
        font-size: 11px;
    }

    .profile-birthday-control .profile-control-title {
        display: block;
        padding-inline-end: 28px;
        position: relative;
    }

    .profile-birthday-control .profile-control-title > span {
        display: block;
        line-height: 1.05;
        min-width: 0;
    }

    .profile-birthday-control .profile-control-title > .profile-help-button {
        inset-block-start: 0;
        inset-inline-end: 0;
        position: absolute;
    }

    .profile-birthday-control .profile-control-title small {
        display: block;
        margin-top: 2px;
    }

    .profile-leaderboard-visibility-control {
        grid-column: 1 / -1;
    }

    .profile-control-grid[data-active-face="general"]::before {
        grid-row: 6;
    }

    .profile-past-opponents-control {
        grid-column: auto;
    }

    .profile-control-grid[data-active-face="general"] .profile-location-visibility-control {
        grid-row: 7;
    }

    .profile-save-row {
        align-items: stretch;
        flex-direction: row;
    }

    .profile-control-grid[data-active-face="game"] .profile-distance-control,
    .profile-control-grid[data-active-face="game"] .profile-save-row {
        grid-row: auto;
    }

    .profile-control-grid[data-active-face="general"] .profile-save-row {
        grid-row: 8;
    }

    .profile-save-row .btn {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }
}

/* Snakes & Ladders ------------------------------------------------------- */
.snakes-page {
    max-width: none;
    width: 100%;
}

.snakes-page .game-player-strip {
    grid-template-columns: repeat(var(--snakes-player-count, 2), minmax(0, 1fr));
}

.snakes-shell {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    margin-inline: auto;
}

.snakes-console,
.snakes-board-stage {
    background: color-mix(in srgb, var(--surface) 91%, transparent);
    border: 3px solid var(--ink);
    border-radius: 14px;
    box-shadow: 0 7px 0 color-mix(in srgb, var(--ink) 28%, transparent);
}

.snakes-console {
    align-items: center;
    display: grid;
    gap: 8px 14px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 8px 12px;
    width: 100%;
}

#snakesRulesButton {
    font-size: 20px;
    height: 44px;
    padding: 0;
    width: 44px;
}

.snakes-console.color-choice-active {
    grid-template-columns: minmax(0, 1fr);
}

.snakes-console.color-choice-active > :is(.snakes-die, .snakes-yard, #snakesRoll) {
    display: none !important;
}

.snakes-color-choice {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
    width: 100%;
}

.snakes-color-choice > strong {
    font-size: 13px;
    line-height: 1.2;
}

.snakes-color-options {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.snakes-color-option {
    align-items: center;
    background: color-mix(in srgb, var(--choice-color) 18%, var(--surface));
    border: 2px solid color-mix(in srgb, var(--choice-color) 76%, var(--ink));
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    gap: 4px;
    justify-content: center;
    min-height: 48px;
    min-width: 0;
    padding: 3px 5px;
}

.snakes-color-option:hover:not(:disabled),
.snakes-color-option:focus-visible {
    background: color-mix(in srgb, var(--choice-color) 34%, var(--surface));
    transform: translateY(-1px);
}

.snakes-color-option .snakes-pawn-art {
    flex: 0 0 auto;
    height: 38px;
    width: 31px;
}

.snakes-console p,
.snakes-console strong {
    line-height: 1.3;
    margin: 0;
}

.snakes-console p {
    color: var(--ink-soft);
    font-size: 12px;
}

.snakes-die,
.snakes-die-visual {
    align-items: center;
    display: flex;
    font-size: 48px;
    height: 68px;
    justify-content: center;
    width: 68px;
}

.snakes-die-visual canvas {
    height: 68px !important;
    width: 68px !important;
}

.snakes-board-stage {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 8px;
    width: 100%;
}

.snakes-board-stage > header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 1px 4px 7px;
}

.snakes-board-stage > header span {
    font-weight: 900;
}

.snakes-board-stage > header small {
    color: var(--ink-soft);
    font-weight: 700;
}

.snakes-board {
    --snakes-board-image: none;
    aspect-ratio: 1;
    background-image: var(--snakes-board-image);
    background-position: center;
    background-size: cover;
    border: 2px solid #eaf7ff;
    border-radius: 10px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(0, 1fr));
    isolation: isolate;
    overflow: hidden;
    padding: 8.7%;
    position: relative;
    width: 100%;
}

.snakes-cell {
    align-items: flex-start;
    background: color-mix(in srgb, #fff7d7 77%, transparent);
    border: 1px solid color-mix(in srgb, #542f22 68%, transparent);
    color: #3c281e;
    display: flex;
    font-size: clamp(7px, 1.7vw, 13px);
    font-weight: 900;
    justify-content: flex-start;
    min-height: 0;
    min-width: 0;
    padding: 2px;
    position: relative;
}

.snakes-cell:nth-child(3n + 1) {
    background: color-mix(in srgb, #a9e2cf 73%, transparent);
}

.snakes-cell:nth-child(3n + 2) {
    background: color-mix(in srgb, #f3b9b0 74%, transparent);
}

.snakes-board[data-world="moonlit"] .snakes-cell {
    background: color-mix(in srgb, #d5ecf2 72%, transparent);
    border-color: color-mix(in srgb, #132d52 74%, transparent);
    color: #10243e;
}

.snakes-board[data-world="moonlit"] .snakes-cell:nth-child(3n + 1) {
    background: color-mix(in srgb, #85d7cf 68%, transparent);
}

.snakes-board[data-world="moonlit"] .snakes-cell:nth-child(3n + 2) {
    background: color-mix(in srgb, #c7a6e7 68%, transparent);
}

.snakes-cell > span:first-child {
    opacity: .82;
    position: relative;
    z-index: 1;
}

.snakes-connectors {
    inset: 8.7%;
    overflow: visible;
    pointer-events: none;
    position: absolute;
    z-index: 3;
}

.snakes-yard {
    align-items: center;
    align-self: stretch;
    background: transparent;
    border: 0;
    display: flex;
    gap: clamp(4px, 1.5vw, 10px);
    justify-content: flex-end;
    margin: 0;
    min-height: 68px;
    overflow: hidden;
    padding: 3px 8px;
    position: relative;
}

.snakes-yard .snakes-pawn {
    flex: 0 0 auto;
    height: clamp(42px, 6.5vw, 54px);
    justify-content: center;
    left: auto;
    position: relative;
    top: auto;
    transform: none;
    width: clamp(34px, 5.2vw, 44px);
}

.snakes-ladder line {
    stroke: url(#ladderGold);
    stroke-linecap: round;
    stroke-width: 1.25;
}

.snakes-ladder .rung {
    stroke-width: 1;
}

.snakes-ladder.turquoise-inlay line,
.snakes-ladder.moon-silver line {
    stroke: url(#ladderSilver);
}

.snakes-ladder.pomegranate-wood line {
    stroke: #a63f35;
}

.snakes-ladder.brass-rope line {
    stroke: #e7b85d;
    stroke-dasharray: 1.3 .55;
}

.snakes-ladder.woven-rope line {
    stroke: #d7a87a;
    stroke-dasharray: .55 .35;
}

.ladder-piece-art {
    filter: drop-shadow(0 .65px .42px rgba(16, 18, 27, .58));
    overflow: visible;
}

.snake-piece-art {
    filter: drop-shadow(0 .72px .45px rgba(10, 13, 22, .62));
    overflow: visible;
}

.snake-piece-reactor {
    transform-box: fill-box;
    transform-origin: right center;
}

.snakes-snake.is-hit .snake-piece-reactor {
    animation: snakes-strike .36s cubic-bezier(.2,.8,.2,1);
}

.snakes-ladder.is-used {
    animation: snakes-ladder-shimmer .62s ease-in-out;
}

@keyframes snakes-strike {
    0%, 100% { transform: translateX(0) scale(1); }
    42% { transform: translateX(1.7px) scale(1.04, .91); }
    70% { transform: translateX(-.3px) scale(1.015, 1.08); }
}

@keyframes snakes-ladder-shimmer {
    0%, 100% { filter: brightness(1); }
    45% { filter: brightness(1.7) drop-shadow(0 0 1.5px #fff2a5); }
}

.snakes-pawn {
    appearance: none;
    align-items: center;
    background: transparent;
    border: 0;
    bottom: auto;
    box-shadow: none;
    color: transparent;
    display: flex;
    height: min(132%, 64px);
    justify-content: center;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(calc(-50% + var(--stack-x, 0%)), calc(-50% + var(--stack-y, 0%)));
    width: min(108%, 52px);
    z-index: 7;
}

.snakes-pawn.is-at-start {
    height: clamp(44px, 7vw, 56px);
    width: clamp(36px, 5.7vw, 46px);
}

.snakes-pawn.is-ready {
    cursor: pointer;
}

.snakes-pawn.is-ready .snakes-pawn-art {
    animation: ludo-ready 650ms ease-in-out infinite alternate;
}

.snakes-pawn.is-animation-target {
    opacity: 0;
}

.snakes-moving-pawn {
    height: clamp(28px, 8.2%, 52px);
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -50%);
    width: clamp(24px, 6.8%, 42px);
    z-index: 12 !important;
}

.snakes-pawn-art {
    display: block;
    filter: drop-shadow(0 3px 2px rgba(23, 33, 44, .55));
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    width: 100%;
}

@media (max-width: 680px) {
    .snakes-page .game-player-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .snakes-page .game-player-strip > .game-player-card {
        min-width: 0;
    }

    .snakes-shell {
        grid-template-columns: 1fr;
    }

    .snakes-console {
        display: grid;
        gap: 6px 10px;
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 6px 8px;
        text-align: start;
    }

    .snakes-color-choice {
        gap: 5px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .snakes-color-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .snakes-color-option {
        flex-direction: column;
        font-size: 10px;
        gap: 1px;
        min-height: 54px;
        padding: 2px;
    }

    .snakes-color-option .snakes-pawn-art {
        height: 34px;
        width: 28px;
    }

    .snakes-die {
        grid-row: 1 / span 2;
    }

    .snakes-die,
    .snakes-die-visual,
    .snakes-die-visual canvas {
        height: 52px !important;
        width: 52px !important;
    }

    .snakes-yard {
        min-height: 52px;
        padding-inline: 5px;
    }

    .snakes-yard .snakes-pawn {
        height: 44px;
        width: 36px;
    }

    .snakes-console .btn {
        grid-column: 3;
        grid-row: 1 / span 2;
        min-width: 92px;
    }

    .snakes-console p {
        display: none;
    }

    .snakes-board-stage {
        max-width: none;
        padding: 5px;
        width: 100%;
    }

    .snakes-board-stage > header {
        padding-bottom: 4px;
    }
}

@media (max-width: 380px) {
    .snakes-console {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .snakes-die,
    .snakes-die-visual,
    .snakes-die-visual canvas {
        height: 52px !important;
        width: 52px !important;
    }

    .snakes-console strong {
        font-size: 12px;
    }

    .snakes-cell {
        border-width: .5px;
        padding: 1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .snakes-pawn.is-ready .snakes-pawn-art {
        animation: none;
        filter: drop-shadow(0 0 5px var(--pawn-color));
    }
}

/* Routine rules belong in the rulebook; gameplay keeps only live state. */
.candidate-hint,
.knight-chase-legend,
#chopsticksHint,
#dotsBoxesHint,
#farkleHint,
#gomokuHint,
#hexHint,
#nimHint,
#orderChaosPrompt,
#paperSoccerHint,
#pigHint,
#seaBattleHint,
#sosHint,
#sproutsHint {
    display: none !important;
}
/* Collectible cabinet room */
.collection-page-intro {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-block: 1rem;
}

.collection-page-shell {
    padding-bottom: 96px;
}

.profile-crest-panel {
    display: grid;
    gap: .8rem;
    margin-block: 1rem;
}

.profile-crest-heading {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.profile-crest-heading h2,
.profile-crest-heading p {
    margin: .15rem 0 0;
}

.profile-crest-heading p {
    color: var(--muted);
    font-size: .82rem;
}

.profile-crest-current {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line-soft);
    border-radius: .8rem;
    display: flex;
    gap: .55rem;
    justify-self: start;
    padding: .35rem .55rem;
}

.profile-crest-current img,
.profile-crest-current-none {
    height: 2.4rem;
    object-fit: contain;
    width: 2.4rem;
}

.profile-crest-current-none {
    align-items: center;
    border: 2px dashed var(--line);
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    font-size: 1.25rem;
    justify-content: center;
}

.profile-crest-current > span:last-child {
    display: grid;
    gap: .05rem;
}

.profile-crest-current small {
    color: var(--muted);
    font-size: .68rem;
}

.profile-crest-current strong {
    font-size: .78rem;
}

.profile-crest-form {
    display: grid;
    gap: .4rem;
}

.profile-crest-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.profile-crest-choice {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid var(--line-soft);
    border-radius: .85rem;
    cursor: pointer;
    display: inline-grid;
    height: 4.8rem;
    justify-items: center;
    padding: .35rem;
    width: 4.8rem;
}

.profile-crest-choice.selected {
    border-color: var(--line);
    box-shadow: 0 0 0 .15rem var(--sky);
}

.profile-crest-choice img,
.profile-crest-choice > span {
    aspect-ratio: 1;
    height: 4rem;
    object-fit: contain;
    width: 4rem;
}

.profile-crest-choice > span {
    align-items: center;
    border: 2px dashed var(--line);
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    font-size: 1.6rem;
    justify-content: center;
}

.profile-crest-status {
    font-size: .72rem;
    margin: 0;
    min-height: 1em;
}

.profile-crest-dialog,
.collectible-inventory-dialog {
    width: min(calc(100vw - 2rem), 760px);
}

.profile-crest-dialog-card {
    align-items: center;
    display: grid;
    gap: .55rem;
    justify-items: center;
    max-height: 92dvh;
    max-width: none;
    overflow: hidden;
    padding: 1rem;
    width: 100%;
}

.profile-crest-dialog-card h2 {
    margin: 0;
    text-align: center;
}

.profile-crest-dialog-stage {
    align-items: center;
    display: grid;
    gap: .55rem;
    grid-template-columns: 2.7rem minmax(0, 1fr) 2.7rem;
    min-height: 0;
    width: 100%;
}

.profile-crest-dialog-visual {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-2);
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    margin-inline: auto;
    max-height: 65dvh;
    width: min(100%, 34rem);
}

.profile-crest-dialog-visual img {
    height: 92%;
    object-fit: contain;
    width: 92%;
}

.profile-crest-dialog-visual > span {
    align-items: center;
    border: 3px dashed var(--line);
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    font-size: clamp(3rem, 14vw, 6rem);
    height: 45%;
    justify-content: center;
    width: 45%;
}

.profile-crest-dialog-visual > [hidden],
.collectible-inventory-card > [hidden] {
    display: none;
}

.profile-crest-dialog-status {
    margin: 0;
    min-height: 1em;
}

.collection-tabs {
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    border: 2px solid var(--line);
    border-radius: 1rem;
    display: grid;
    gap: .35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1rem 0;
    padding: .35rem;
}

.collection-tab {
    background: transparent;
    border: 0;
    border-radius: .7rem;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 2.9rem;
    padding: .6rem 1rem;
}

.collection-tab[aria-selected="true"] {
    background: var(--sky);
    box-shadow: none;
    color: #10243a;
}

.collection-tab:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

.collection-tab-panel[hidden],
.game-style-slide[hidden],
.game-style-slide [hidden] {
    display: none;
}

.game-style-panel {
    display: grid;
    gap: 1rem;
    margin-block: 1rem;
}

.game-style-heading h2 {
    margin: .15rem 0 0;
}

.game-style-heading p {
    color: var(--muted);
    margin: .3rem 0 0;
}

.game-style-grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-style-form {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 1rem;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding: .8rem;
}

.game-style-card-heading,
.game-style-dialog-actions {
    align-items: center;
    display: flex;
    gap: .45rem;
    justify-content: space-between;
}

.game-style-card-heading,
.game-style-summaries {
    grid-column: 1 / -1;
}

.game-style-choice-total,
.game-style-count {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
}

.game-style-summary {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: zoom-in;
    display: grid;
    gap: .7rem;
    font: inherit;
    grid-template-columns: 7rem minmax(0, 1fr);
    min-height: 7rem;
    padding: 0;
    text-align: start;
    width: 100%;
}

.game-style-summary[hidden],
.game-style-slide[hidden],
.game-style-slide [hidden] {
    display: none;
}

.game-style-summary strong {
    line-height: 1.2;
}

.game-style-summary:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: .25rem;
}

.game-style-dialog {
    max-height: none;
    max-width: none;
    width: min(calc(100vw - 2rem), 45.5rem);
}

.game-style-dialog-card {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    gap: .75rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
    margin: 0;
    max-height: 92dvh;
    min-height: min(42rem, 92dvh);
    overflow: hidden;
    padding: 1rem;
    position: relative;
    width: 100%;
}

.game-style-dialog-heading {
    display: grid;
    gap: .15rem;
    padding-inline-end: 2.5rem;
}

.game-style-dialog-heading h2 {
    margin: 0;
}

.game-style-dialog-heading .game-style-count {
    position: absolute;
    inset-inline-end: 3.6rem;
    top: 1.2rem;
}

.game-style-dialog-stage {
    align-items: center;
    display: grid;
    gap: .55rem;
    grid-template-columns: 2.7rem minmax(0, 1fr) 2.7rem;
    min-height: 0;
}

.game-style-carousel-stage,
.game-style-slide {
    height: 100%;
    min-height: 0;
}

.game-style-slide {
    align-content: center;
    display: grid;
    gap: .8rem;
    grid-template-rows: minmax(0, 1fr) auto;
}

.game-style-preview {
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 50% 38%, rgba(116, 216, 255, .18), transparent 48%),
        color-mix(in srgb, var(--panel) 78%, #18243f);
    border: 1px solid var(--line-soft);
    border-radius: .85rem;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.game-style-dialog .game-style-preview {
    aspect-ratio: 4 / 3;
    height: min(55dvh, 31rem);
    margin-inline: auto;
    width: min(100%, 42rem);
}

.game-style-preview img {
    height: 90%;
    object-fit: contain;
    width: 90%;
}

[data-style-key="emberglass-chessmen"] .game-style-preview > img,
.store-cosmetic-card[data-cosmetic-key="emberglass-chessmen"] .store-cosmetic-preview > img {
    scale: -1 1;
}

.game-style-preview-game_background_style > img,
.game-style-preview-card_deck_style > img {
    height: 100%;
    width: 100%;
}

.game-style-preview-game_background_style > img {
    object-fit: cover;
}

.game-style-preview-card_deck_style > img {
    object-fit: contain;
}

.game-style-copy {
    display: grid;
    gap: .35rem;
    justify-items: center;
    min-width: 0;
    text-align: center;
}

.game-style-copy strong {
    font-size: clamp(1.15rem, 3vw, 1.55rem);
}

.game-style-copy p {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
    margin: 0;
    max-width: 38rem;
}

.game-style-copy .store-badge {
    justify-self: center;
}

.game-style-piece-set {
    align-items: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    height: 88%;
    justify-items: center;
    width: 78%;
}

.game-style-piece-set img {
    filter: drop-shadow(0 .25rem .3rem rgba(0, 0, 0, .35));
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.game-style-classic-dice {
    align-items: center;
    display: flex;
    gap: 7%;
    height: 72%;
    justify-content: center;
    width: 84%;
}

.game-style-classic-dice i {
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 28% 28%, #24314a 0 7%, transparent 7.5%),
        radial-gradient(circle at 72% 28%, #24314a 0 7%, transparent 7.5%),
        radial-gradient(circle at 50% 50%, #24314a 0 7%, transparent 7.5%),
        radial-gradient(circle at 28% 72%, #24314a 0 7%, transparent 7.5%),
        radial-gradient(circle at 72% 72%, #24314a 0 7%, transparent 7.5%),
        linear-gradient(145deg, #fffdf0, #d9e7f4);
    border: .16rem solid #fff;
    border-radius: 17%;
    box-shadow: .35rem .45rem 0 rgba(11, 20, 42, .7);
    display: block;
    transform: rotate(-8deg);
    width: 40%;
}

.game-style-classic-dice i + i {
    background:
        radial-gradient(circle at 28% 28%, #f8fbff 0 7%, transparent 7.5%),
        radial-gradient(circle at 72% 28%, #f8fbff 0 7%, transparent 7.5%),
        radial-gradient(circle at 28% 72%, #f8fbff 0 7%, transparent 7.5%),
        radial-gradient(circle at 72% 72%, #f8fbff 0 7%, transparent 7.5%),
        linear-gradient(145deg, #e46c79, #8e2747);
    transform: rotate(9deg) translateY(8%);
}

.game-style-classic-player-card {
    background: linear-gradient(145deg, #fbfbff, #dbe7f6);
    border: .18rem solid #fff;
    border-radius: .8rem;
    box-shadow: .4rem .5rem 0 rgba(25, 41, 71, .7);
    display: grid;
    gap: 6%;
    grid-template-columns: 32% 1fr;
    grid-template-rows: 1fr 1fr;
    height: 62%;
    padding: 8%;
    position: relative;
    transform: rotate(-3deg);
    width: 78%;
}

.game-style-classic-player-card i {
    background: linear-gradient(145deg, #72d7f6, #f37f94);
    border: .15rem solid #fff;
    border-radius: 50%;
    grid-row: 1 / 3;
}

.game-style-classic-player-card b {
    align-self: end;
    background: #263650;
    border-radius: 999px;
    height: 24%;
}

.game-style-classic-player-card b + b {
    align-self: start;
    background: #7688a2;
    width: 72%;
}

.game-style-classic-player-card em {
    background: #53d19f;
    border: .12rem solid #fff;
    border-radius: 50%;
    bottom: 5%;
    height: 18%;
    inset-inline-start: 27%;
    position: absolute;
    width: 12%;
}

.game-style-dialog-actions {
    min-height: 2.8rem;
}

.game-style-dialog-actions .btn {
    min-width: 8rem;
}

.game-style-status {
    color: var(--muted);
    font-size: .78rem;
    min-height: 1rem;
}

.profile-name-with-crest,
.leader-name-with-crest,
.game-player-name-row {
    align-items: center;
    display: flex;
    gap: .35rem;
    min-width: 0;
}

.game-player-name-row {
    gap: clamp(.12rem, 1.5cqi, .35rem);
    overflow: hidden;
}

.game-player-name-row .game-player-name {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-name-with-crest h1 {
    margin-inline: 0;
}

.profile-crest-mark,
.game-player-card img.game-player-crest {
    aspect-ratio: 1;
    border: 0;
    border-radius: 0;
    flex: 0 0 auto;
    height: 2.65rem;
    object-fit: contain;
    width: 2.65rem;
}

.leader-name-with-crest .profile-crest-mark,
.game-player-card img.game-player-crest {
    height: clamp(1.6rem, 20cqi, 2.8rem) !important;
    width: clamp(1.6rem, 20cqi, 2.8rem) !important;
}

.game-player-name-row {
    color: inherit;
}

.collection-page-intro h1,
.collection-page-intro p {
    margin: 0.25rem 0;
}

.collectible-room-panel {
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 214, 102, 0.22), transparent 30%),
        linear-gradient(145deg, rgba(37, 28, 58, 0.98), rgba(30, 55, 70, 0.96));
    color: #fff8e8;
    margin-block: 1rem;
    overflow: hidden;
}

.collectible-room-panel .muted {
    color: rgba(255, 248, 232, 0.76);
}

.public-collectible-list {
    margin-top: 1rem;
}

.public-collectible-list h3 {
    align-items: center;
    color: #fff8e8;
    display: flex;
    font-size: 1rem;
    gap: .45rem;
    margin: 0 0 .55rem;
}

.public-collectible-list h3 span {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: .72rem;
    padding: .2rem .5rem;
}

.public-collectible-rail {
    display: grid;
    gap: .55rem;
    grid-auto-columns: minmax(6.7rem, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 0 .45rem;
    scrollbar-color: rgba(255, 255, 255, .42) rgba(255, 255, 255, .08);
    scrollbar-width: thin;
}

.public-collectible-item {
    align-content: start;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .8rem;
    display: grid;
    gap: .35rem;
    min-height: 8.1rem;
    padding: .45rem;
    position: relative;
    text-align: center;
}

.public-collectible-item.hero {
    border-color: rgba(255, 214, 102, .62);
}

.public-collectible-item img {
    height: 5.4rem;
    margin-inline: auto;
    object-fit: contain;
    width: 100%;
}

.public-collectible-item strong {
    color: #fff8e8;
    font-size: .72rem;
    line-height: 1.15;
}

.collectible-room-head,
.collectible-inventory-head {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.collectible-room-actions {
    display: flex;
    gap: .5rem;
}

.collectible-room-head h2,
.collectible-inventory-head h3,
.collectible-incoming-list h3 {
    color: #fff8e8;
    margin: 0.2rem 0;
}

.collectible-visibility-form {
    align-items: end;
    display: flex;
    gap: 0.55rem;
}

.collectible-visibility-form label {
    display: grid;
    font-size: 0.78rem;
    gap: 0.3rem;
}

.collectible-visibility-form .select {
    min-width: 13rem;
}

.collectible-state {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.8rem;
    margin-top: 0.8rem;
    padding: 0.65rem 0.8rem;
}

.collectible-state-accepted,
.collectible-state-saved {
    background: rgba(83, 209, 159, 0.18);
}

.collectible-cabinet-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.collectible-cabinet {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    box-shadow: 0 1rem 2rem rgba(5, 9, 22, 0.28);
    padding: 0.7rem;
}

.collectible-cabinet-title {
    align-items: center;
    display: grid;
    font-size: 0.78rem;
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 0.45rem;
}

.collectible-cabinet-style-form {
    align-items: stretch;
    display: grid;
    gap: .4rem;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
}

.collectible-cabinet-style-field,
.collectible-cabinet-style-field .select {
    min-width: 0;
    width: 100%;
}

.collectible-cabinet-style-form .btn,
.collectible-cabinet-style-form .select {
    min-height: 2.65rem;
}

.collectible-cabinet-style-status {
    color: rgba(255, 248, 232, .72);
    font-size: .68rem;
    grid-column: 1 / -1;
    min-height: .8rem;
}

.collectible-cabinet-stage {
    aspect-ratio: 4 / 5;
    border-radius: 0.8rem;
    margin-inline: auto;
    overflow: hidden;
    perspective: 72rem;
    position: relative;
    width: min(100%, clamp(12rem, 27dvh, 20rem));
}

.collectible-cabinet-art {
    height: 100%;
    inset: 0;
    object-fit: contain;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.collectible-cabinet-slots {
    display: grid;
    gap: 4% 7%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    inset: 13% 13% 15%;
    pointer-events: auto;
    position: absolute;
    opacity: 1;
    z-index: 4;
}

.collectible-cabinet-style-persian-inlay .collectible-cabinet-slots {
    inset: 20% 16% 14%;
}

.collectible-cabinet-style-moonlit-observatory .collectible-cabinet-slots {
    inset: 20% 15% 15%;
}

.collectible-cabinet-style-starlight-conservatory .collectible-cabinet-slots {
    inset: 20% 16% 16%;
}

.collectible-slot {
    align-items: end;
    background: linear-gradient(to top, rgba(25, 11, 8, 0.3), transparent 45%);
    border: 1px dashed transparent;
    border-radius: 0.55rem;
    color: #fff8e8;
    display: flex;
    justify-content: center;
    min-height: 0;
    padding: 0.18rem;
    position: relative;
}

button.collectible-slot:hover,
button.collectible-slot:focus-visible {
    background: rgba(125, 225, 255, 0.16);
    border-color: rgba(180, 235, 255, 0.8);
    outline: none;
}

.collectible-slot img {
    filter: drop-shadow(0 0.35rem 0.25rem rgba(20, 7, 3, 0.42));
    height: 82%;
    object-fit: contain;
    width: 88%;
}

.collectible-empty-mark {
    align-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.52);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.78);
    display: inline-flex;
    font-size: 1.2rem;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.collectible-edition,
.collectible-provenance {
    background: rgba(20, 12, 30, 0.82);
    border-radius: 999px;
    bottom: 0.08rem;
    color: #fff;
    font-size: clamp(0.5rem, 1.5vw, 0.68rem);
    left: 0.1rem;
    line-height: 1.2;
    padding: 0.12rem 0.28rem;
    position: absolute;
}

.collectible-provenance {
    background: rgba(87, 52, 125, 0.88);
    left: auto;
    right: 0.1rem;
}

.collectible-doors {
    inset: 0;
    pointer-events: none;
    position: absolute;
    transform-style: preserve-3d;
    z-index: 4;
}

.collectible-door {
    backdrop-filter: blur(0.25px) saturate(1.05);
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.22), transparent 22% 72%, rgba(180, 230, 255, 0.1)),
        rgba(171, 211, 218, 0.08);
    border: 0.55rem solid #5b301f;
    box-shadow:
        inset 0 0 0 0.16rem #b67643,
        inset 0 0 1.1rem rgba(230, 251, 255, 0.35),
        0 0.4rem 0.8rem rgba(16, 6, 4, 0.32);
    height: 100%;
    position: absolute;
    top: 0;
    transition: transform 720ms cubic-bezier(0.2, 0.75, 0.2, 1);
    width: 50.5%;
}

.collectible-door::after {
    background: radial-gradient(circle, #f3c677 0 35%, #5b301f 38% 100%);
    border-radius: 50%;
    content: "";
    height: 0.72rem;
    position: absolute;
    top: 50%;
    width: 0.72rem;
}

.collectible-door-left {
    left: 0;
    transform-origin: left center;
}

.collectible-door-left::after {
    right: 0.35rem;
}

.collectible-door-right {
    right: 0;
    transform-origin: right center;
}

.collectible-cabinet-style-starlight-conservatory .collectible-door {
    background:
        linear-gradient(112deg, rgba(255, 255, 255, .2), transparent 24% 74%, rgba(130, 207, 255, .12)),
        rgba(25, 58, 108, .08);
    border-color: #102a61;
    box-shadow:
        inset 0 0 0 .16rem #cf9f44,
        inset 0 0 1.1rem rgba(215, 237, 255, .32),
        0 .4rem .8rem rgba(5, 9, 24, .36);
}

.collectible-door-right::after {
    left: 0.35rem;
}

.collectible-cabinet.is-open .collectible-door-left {
    transform: rotateY(-106deg);
}

.collectible-cabinet.is-open .collectible-door-right {
    transform: rotateY(106deg);
}

.collectible-door-toggle {
    background: rgba(20, 15, 32, .72);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
    margin: 0;
    padding: .28rem .58rem;
}

.collectible-cabinet.is-open .collectible-door-toggle {
    background: var(--sky);
    border-color: #fff;
    color: #10243a;
}

.collectible-inventory-dialog {
    max-height: none;
    max-width: none;
}

.collectible-inventory-card {
    display: grid;
    gap: .7rem;
    grid-template-rows: minmax(0, 1fr);
    max-height: 90dvh;
    max-width: none;
    overflow: hidden;
    width: 100%;
}

.collectible-inventory-card h2 {
    margin: 0;
}

[data-collectible-inventory-grid-view] {
    display: grid;
    gap: .7rem;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.collectible-gift-hint,
.collectible-inventory-empty {
    grid-column: 1 / -1;
}

.collectible-inventory-head > span {
    color: rgba(255, 248, 232, 0.7);
    font-size: 0.78rem;
}

.collectible-inventory-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    max-height: 76dvh;
    overflow-y: auto;
    padding: .2rem;
}

.collectible-inventory-item,
.collectible-incoming-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.8rem;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 3.8rem minmax(0, 1fr) auto;
    padding: 0.55rem;
}

button.collectible-inventory-item {
    color: inherit;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.collectible-inventory-dialog .collectible-inventory-item {
    align-content: start;
    display: grid;
    gap: .35rem;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 9.5rem;
    position: relative;
}

.collectible-copy-count {
    align-items: center;
    background: rgba(18, 25, 48, .9);
    border: 2px solid rgba(255, 248, 232, .9);
    border-radius: 999px;
    color: #fff8e8;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 900;
    justify-content: center;
    min-height: 1.75rem;
    min-width: 1.75rem;
    padding: .12rem .4rem;
    position: absolute;
    right: .4rem;
    top: .4rem;
}

[dir="rtl"] .collectible-copy-count {
    left: .4rem;
    right: auto;
}

button.collectible-inventory-item:hover,
button.collectible-inventory-item:focus-visible {
    background: rgba(125, 225, 255, 0.16);
    border-color: rgba(180, 235, 255, 0.8);
    outline: none;
}

.collectible-inventory-item.hero {
    border-color: rgba(255, 206, 111, 0.72);
    box-shadow: inset 0 0 1rem rgba(255, 205, 106, 0.13);
}

.collectible-inventory-dialog .collectible-inventory-item > img,
.collectible-incoming-card > img {
    height: 6.5rem;
    object-fit: contain;
    width: 100%;
}

.collectible-inventory-dialog .collectible-inventory-item strong {
    font-size: .76rem;
    line-height: 1.2;
}

.collectible-inventory-detail {
    display: grid;
    gap: .7rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.collectible-inventory-back {
    justify-self: start;
}

.collectible-inventory-detail .collectible-detail-stage {
    min-height: 0;
}

.collectible-inventory-detail .collectible-detail-stage > img {
    aspect-ratio: 1;
    max-height: 65dvh;
    min-height: 0;
}

.collectible-inventory-item p,
.collectible-incoming-card span {
    color: rgba(255, 248, 232, 0.72);
    font-size: 0.78rem;
    margin: 0.12rem 0 0;
}

.collectible-origin-note {
    color: #ffd995;
    display: block;
    font-size: 0.72rem;
    margin-top: 0.18rem;
}

.collectible-incoming-list {
    margin-top: 0.8rem;
}

.collectible-incoming-card {
    grid-template-columns: 3.8rem minmax(0, 1fr) auto auto;
    margin-top: 0.5rem;
}

.collectible-dialog-card {
    max-width: 42rem;
}

.collectible-detail-dialog {
    max-height: none;
    max-width: none;
    width: min(94vw, 52rem);
}

.collectible-detail-card {
    align-items: stretch;
    display: grid;
    gap: 0.75rem;
    grid-template-rows: minmax(0, 1fr) auto;
    max-height: 92dvh;
    max-width: none;
    overflow: hidden;
    padding: 1rem;
    width: 100%;
}

.collectible-detail-stage {
    align-items: center;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 2.7rem minmax(0, 1fr) 2.7rem;
    min-height: 0;
}

.collectible-detail-stage > img {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    border-radius: 1rem;
    height: auto;
    max-height: 68dvh;
    object-fit: contain;
    padding: 0.35rem;
    width: 100%;
}

.collectible-detail-arrow {
    align-items: center;
    align-self: center;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 2rem;
    font-weight: 900;
    height: 2.7rem;
    justify-content: center;
    line-height: 1;
    padding: 0 0 0.18rem;
    width: 2.7rem;
}

.collectible-detail-arrow:hover,
.collectible-detail-arrow:focus-visible {
    background: var(--sky);
    outline: 2px solid color-mix(in srgb, var(--sky) 40%, transparent);
    outline-offset: 2px;
}

.collectible-detail-copy {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    min-width: 0;
    text-align: center;
}

.collectible-detail-copy p {
    color: var(--muted);
    margin: 0;
    max-width: 46rem;
}

.collectible-detail-count {
    color: var(--muted);
    direction: ltr;
    font-size: 0.75rem;
    font-weight: 850;
    unicode-bidi: isolate;
}

.collectible-detail-card h2 {
    font-size: clamp(1rem, 2vw, 1.45rem);
    margin: 0;
    overflow-wrap: anywhere;
}

.collectible-picker-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0.75rem 0;
    max-height: min(48vh, 25rem);
    overflow: auto;
    padding: 0.2rem;
}

.collectible-picker-filters {
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    border: 2px solid var(--line);
    border-radius: 999px;
    display: grid;
    gap: 0.2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.75rem;
    padding: 0.2rem;
}

.collectible-picker-filters button {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 850;
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
}

.collectible-picker-filters button[aria-pressed="true"] {
    background: var(--sky);
    box-shadow: none;
    color: #10243a;
}

.collectible-picker-filters button:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

.collectible-picker-option[hidden],
.collectible-picker-empty[hidden] {
    display: none;
}

.collectible-picker-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 1rem 0.5rem;
    text-align: center;
}

.collectible-picker-option {
    align-items: center;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    cursor: pointer;
    display: grid;
    gap: 0.3rem;
    justify-items: center;
    min-width: 0;
    padding: 0.45rem;
    position: relative;
    text-align: center;
}

.collectible-picker-option:has(input:checked) {
    border-color: var(--sky);
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--sky) 22%, transparent);
}

.collectible-picker-option input {
    cursor: pointer;
    height: 100%;
    inset: 0;
    margin: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.collectible-picker-option:has(input:focus-visible) {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

.collectible-picker-option img {
    height: 5rem;
    object-fit: contain;
    width: 5rem;
}

.collectible-picker-option strong {
    font-size: 0.76rem;
}

.collectible-picker-option.empty-option {
    align-content: center;
}

@media (max-width: 680px) {
    .profile-crest-heading,
    .profile-crest-form {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .profile-crest-heading {
        display: grid;
    }

    .game-style-grid {
        grid-template-columns: 1fr;
    }

    .game-style-dialog-card {
        min-height: min(40rem, 92dvh);
        padding: .8rem;
    }

    .game-style-dialog-stage {
        gap: .3rem;
        grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
    }

    .game-style-dialog-stage .collectible-detail-arrow {
        font-size: 1.65rem;
        height: 2.35rem;
        width: 2.35rem;
    }

    .game-style-dialog .game-style-preview {
        height: min(48dvh, 23rem);
    }

    .game-style-dialog-heading .game-style-count {
        position: static;
    }

    .game-style-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .game-style-dialog-actions .btn {
        width: 100%;
    }

    .collection-page-intro,
    .collectible-room-head,
    .collectible-inventory-head,
    .collectible-visibility-form {
        align-items: stretch;
        flex-direction: column;
    }

    .collectible-visibility-form .select {
        min-width: 0;
        width: 100%;
    }

    .collectible-cabinet-grid,
    .collectible-inventory-grid {
        grid-template-columns: 1fr;
    }

    .collectible-cabinet-stage {
        width: min(100%, 18rem);
    }

    .collectible-inventory-dialog .collectible-inventory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collectible-inventory-dialog .collectible-inventory-item {
        min-height: 8rem;
    }

    .collectible-inventory-dialog .collectible-inventory-item > img {
        height: 5rem;
    }

    .collectible-incoming-card {
        grid-template-columns: 3.4rem minmax(0, 1fr);
    }

    .collectible-incoming-card form {
        display: inline-flex;
    }

    .collectible-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collectible-detail-card {
        padding: 0.75rem;
    }

    .collectible-detail-stage {
        gap: 0.35rem;
        grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
    }

    .profile-crest-dialog-stage {
        gap: .35rem;
        grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
    }

    .collectible-detail-stage > img {
        margin-inline: auto;
        max-width: 100%;
    }

    .collectible-detail-arrow {
        font-size: 1.65rem;
        height: 2.35rem;
        width: 2.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collectible-door {
        transition: none;
    }
}

/* Hokm keeps the shared tactile card language while making partnership state central. */
.hokm-page,
.backgammon-page {
    min-height: 100dvh;
}

.hokm-table {
    background: color-mix(in srgb, var(--surface) 68%, transparent);
    backdrop-filter: blur(2px);
    border: 2px solid var(--line);
    border-radius: 1.4rem;
    box-sizing: border-box;
    box-shadow: 0 1rem 2.4rem rgb(13 29 43 / 22%);
    color: var(--text);
    margin: 0 auto;
    padding: clamp(.55rem, 1.5vw, .9rem);
    width: min(100%, var(--live-game-content-width));
}

.hokm-round-table {
    direction: ltr;
    aspect-ratio: 1;
    margin: 0 auto .55rem;
    max-width: 39rem;
    position: relative;
    width: 100%;
}

/* Keep room for full tricks and draft choices on short desktop windows. */
@media (min-width: 681px) and (max-height: 1092px) {
    .hokm-page {
        --live-game-scale: min(1, calc((100dvh - 32px) / 1060px));
    }
}

.hokm-page .game-status-line {
    display: none;
}

#gamePlayers.hokm-player-banners {
    margin-bottom: .65rem;
    max-width: 100%;
}

.hokm-player-banners .game-player-marker:empty {
    display: none;
}

#gamePlayers.hokm-player-banners:is([data-player-count="3"], [data-player-count="4"]) {
    grid-template-columns: repeat(var(--hokm-banner-count), minmax(0, 1fr));
}

#gamePlayers.hokm-player-banners[data-player-count="3"] {
    --hokm-banner-count: 2;
}

#gamePlayers.hokm-player-banners[data-player-count="4"] {
    --hokm-banner-count: 2;
}

.hokm-seat-indicators {
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: auto;
    z-index: 6;
}

.hokm-team-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block: 12px;
}

.hokm-team-choices button[aria-pressed="true"] {
    background: var(--yellow);
    color: var(--text);
}

.hokm-seat-indicator {
    align-items: center;
    background: color-mix(in srgb, var(--surface) 94%, #d8f5e9 6%);
    border: 2px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 .25rem .55rem rgb(9 35 31 / 22%);
    color: var(--text);
    display: flex;
    gap: .3rem;
    justify-content: center;
    max-width: min(30%, 7.5rem);
    min-height: 1.95rem;
    overflow: visible;
    padding: .2rem .48rem;
    position: absolute;
    width: fit-content;
}

.hokm-seat-indicator[data-hokm-team="a"] {
    border-color: #ef6587;
}

.hokm-seat-indicator[data-hokm-team="b"] {
    border-color: #58bde8;
}

.hokm-seat-indicator.active {
    background: #fff0a9;
    border-color: #9a6500;
    color: #352300;
}

.hokm-seat-turn {
    color: #9a6500;
    display: none;
    flex: 0 0 auto;
    font-size: .75rem;
}

.hokm-seat-indicator.active .hokm-seat-turn {
    display: block;
}

.hokm-seat-hakem {
    color: #9a6500;
    flex: 0 0 auto;
    font-size: .78rem;
    line-height: 1;
    position: absolute;
    top: .15rem;
    left: 50%;
    transform: translateX(-50%);
}

.hokm-seat-indicator.hakem {
    border-radius: .8rem;
    padding-block-start: 1.1rem;
}

.hokm-seat-name {
    font-size: .72rem;
    line-height: 1;
    max-width: 5.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hokm-seat-indicator[data-hokm-seat="top"] {
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="bottom"] {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="left"],
.hokm-seat-indicator[data-hokm-seat="right"] {
    top: 50%;
    max-width: 5.2rem;
}

.hokm-seat-indicator[data-hokm-seat="left"] {
    left: .15rem;
    transform: translateY(-50%);
}

.hokm-seat-indicator[data-hokm-seat="right"] {
    right: .15rem;
    transform: translateY(-50%);
}

.hokm-felt {
    align-content: center;
    align-items: center;
    background:
        radial-gradient(circle at 50% 42%, rgb(66 142 112 / 92%), rgb(24 76 65 / 98%) 72%),
        #174c43;
    border: .7rem solid #7b4929;
    border-radius: 1.5rem;
    box-shadow:
        inset 0 0 0 3px #d7a15b,
        inset 0 0 2.4rem rgb(4 33 28 / 44%),
        0 .7rem 1rem rgb(26 15 11 / 24%);
    color: #fff;
    display: grid;
    gap: .25rem .7rem;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    inset: .35rem;
    padding: 1rem;
    position: absolute;
    z-index: 1;
}

.hokm-round-table[data-player-count="2"] .hokm-felt {
    inset: 4.25rem .5rem;
}

.hokm-round-table[data-player-count="3"] .hokm-felt {
    inset: .7rem 5.4rem 4.25rem;
}

.hokm-round-table[data-player-count="3"]
    .hokm-seat-indicator:is(
        [data-hokm-seat="left"],
        [data-hokm-seat="right"]
    ) {
    top: 38%;
}

.hokm-round-table[data-player-count="4"] .hokm-felt {
    inset: 4.15rem 4.75rem;
}

.hokm-page .game-player-card[data-hokm-team="a"] {
    border-color: #ef6587;
}

.hokm-page .game-player-card[data-hokm-team="b"] {
    border-color: #58bde8;
}

.hokm-player-progress {
    color: var(--muted);
    display: block;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hokm-won-tricks {
    align-items: center;
    background: rgb(7 42 36 / 92%);
    border: 2px solid #ffe16a;
    border-radius: .55rem;
    box-shadow: 0 .2rem .45rem rgb(6 27 24 / 34%);
    display: flex;
    gap: .22rem;
    min-height: 1.8rem;
    min-width: 2.7rem;
    padding: .18rem .32rem;
    pointer-events: none;
    position: absolute;
    z-index: 7;
}

.hokm-seat-indicator > .hokm-won-tricks {
    position: absolute;
}

.hokm-won-tricks.hidden {
    display: none;
}

.hokm-won-tricks.empty {
    display: none;
}

.hokm-won-card-stack {
    display: flex !important;
    min-width: 1.1rem;
    overflow: visible !important;
}

.hokm-won-card-stack .playing-card {
    border-radius: 3px;
    box-shadow: 0 2px 0 rgb(0 0 0 / 26%);
    flex: 0 0 1.25rem;
    height: 1.75rem;
    margin-left: -.68rem;
    padding: 1px;
    width: 1.25rem;
}

.hokm-won-card-stack .playing-card:first-child {
    margin-left: 0;
}

.hokm-won-tricks > b {
    color: #fff;
    font-size: .82rem;
}

.hokm-seat-indicator[data-hokm-seat="top"] .hokm-won-tricks {
    left: 50%;
    top: calc(100% + .2rem);
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="bottom"] .hokm-won-tricks {
    bottom: calc(100% + .2rem);
    left: 50%;
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="left"] .hokm-won-tricks {
    left: 50%;
    top: calc(100% + .2rem);
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="right"] .hokm-won-tricks {
    left: 50%;
    right: auto;
    top: calc(100% + .2rem);
    transform: translateX(-50%);
}

.hokm-seat-indicator[data-hokm-seat="left"] .hokm-won-tricks,
.hokm-seat-indicator[data-hokm-seat="right"] .hokm-won-tricks {
    flex-direction: column;
    gap: .14rem;
    min-width: 1.85rem;
    padding: .22rem .28rem;
}

.hokm-seat-indicator[data-hokm-seat="left"] .hokm-won-card-stack,
.hokm-seat-indicator[data-hokm-seat="right"] .hokm-won-card-stack {
    flex-direction: column;
    min-width: 0;
}

.hokm-seat-indicator[data-hokm-seat="left"] .hokm-won-card-stack .playing-card,
.hokm-seat-indicator[data-hokm-seat="right"] .hokm-won-card-stack .playing-card {
    margin-left: 0;
    margin-top: -.95rem;
}

.hokm-seat-indicator[data-hokm-seat="left"] .hokm-won-card-stack .playing-card:first-child,
.hokm-seat-indicator[data-hokm-seat="right"] .hokm-won-card-stack .playing-card:first-child {
    margin-top: 0;
}

.hokm-stock {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    grid-column: 1;
    text-align: center;
}

.hokm-stock strong,
.hokm-stock small {
    color: #fff;
    text-shadow: 0 1px 2px #062d26;
}

.hokm-stock small {
    font-size: .68rem;
}

.hokm-stock-stack {
    display: grid;
    height: 5.2rem;
    place-items: center;
    width: 3.8rem;
}

.hokm-stock-stack .playing-card {
    grid-area: 1 / 1;
    height: 5rem;
    width: 3.55rem;
}

.hokm-stock-stack .playing-card:nth-child(2) {
    transform: translate(.15rem, -.12rem);
}

.hokm-stock-stack .playing-card:nth-child(3) {
    transform: translate(.3rem, -.24rem);
}

.hokm-deal-animation {
    inset: 0;
    overflow: visible;
    pointer-events: none;
    position: absolute;
    z-index: 10;
}

.hokm-deal-animation .playing-card {
    animation: hokm-deal-card .72s cubic-bezier(.2, .74, .34, 1) both;
    animation-delay: var(--deal-delay, 0ms);
    height: 3.85rem;
    margin: -1.925rem 0 0 -1.375rem;
    position: absolute;
    width: 2.75rem;
}

@keyframes hokm-deal-card {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-8deg) scale(.88);
    }
    16%, 72% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--deal-x), var(--deal-y)) rotate(5deg) scale(.68);
    }
}

.hokm-trick {
    align-items: center;
    color: #fff;
    display: grid;
    gap: clamp(.15rem, 1vw, .55rem);
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
    min-height: 11.5rem;
    min-width: 0;
}

.hokm-felt.stock-empty .hokm-trick {
    align-self: stretch;
    grid-column: 1 / -1;
}

.hokm-trick-cards {
    display: block;
    grid-column: 1;
    height: clamp(12rem, 34vw, 17rem);
    margin: 0 auto;
    max-width: 24rem;
    position: relative;
    width: 100%;
}

.hokm-round-table[data-player-count="4"] .hokm-trick-cards {
    height: clamp(17rem, 42vw, 22.5rem);
    max-width: 30rem;
}

.hokm-trick-card {
    display: grid;
    justify-items: center;
    gap: .15rem;
    pointer-events: none;
    position: absolute;
    transition: opacity 560ms ease-in, transform 560ms cubic-bezier(.42, 0, .72, .45);
    z-index: 3;
}

.hokm-round-table[data-player-count="4"] .hokm-trick-card[data-hokm-seat="left"] {
    left: 7%;
}

.hokm-round-table[data-player-count="4"] .hokm-trick-card[data-hokm-seat="right"] {
    right: 7%;
}

.hokm-trick-card[data-hokm-seat="top"] {
    left: 50%;
    top: 0;
    translate: -50% 0;
}

.hokm-trick-card[data-hokm-seat="bottom"] {
    bottom: 0;
    left: 50%;
    translate: -50% 0;
}

.hokm-trick-card[data-hokm-seat="left"] {
    left: 0;
    top: 50%;
    translate: 0 -50%;
}

.hokm-trick-card[data-hokm-seat="right"] {
    right: 0;
    top: 50%;
    translate: 0 -50%;
}

.hokm-trick-card.winner .playing-card {
    box-shadow: 0 0 0 4px #ffe16a, 0 .45rem .9rem rgb(0 0 0 / 35%);
}

.hokm-trick-result {
    background: rgb(5 37 31 / 90%);
    border: 2px solid #ffe16a;
    border-radius: 999px;
    color: #fff;
    font-size: clamp(.72rem, 1.6vw, .9rem);
    grid-column: 1;
    justify-self: center;
    max-width: min(100%, 22rem);
    padding: .25rem .65rem;
    text-align: center;
    text-shadow: 0 1px 2px #062d26;
    white-space: nowrap;
    z-index: 5;
}

.hokm-trick.collecting .hokm-trick-card {
    opacity: .08;
    transform: translate(var(--collect-x), var(--collect-y)) scale(.28) rotate(9deg);
}

.hokm-trick.collecting .hokm-trick-card:nth-child(even) {
    transform: translate(var(--collect-x), var(--collect-y)) scale(.28) rotate(-9deg);
}

.hokm-trick .playing-card,
.hokm-phase-controls .playing-card {
    width: clamp(4.8rem, 10vw, 7rem);
}

.hokm-phase-controls {
    align-items: center;
    display: flex;
    grid-column: 1 / -1;
    justify-content: center;
    gap: .55rem;
    min-height: 2.4rem;
    position: relative;
    z-index: 5;
}

.hokm-felt .crazy-suit-picker {
    animation: none;
    background: #fff7f5;
    border-color: #ff65b0;
    color: #25233a;
    grid-column: 1 / -1;
    margin: 0;
    padding: .55rem;
    position: relative;
    width: min(100%, 25rem);
    z-index: 6;
}

.hokm-felt .crazy-suit-picker > strong {
    color: #25233a;
}

.hokm-felt .crazy-suit-picker button {
    background: #f8f5ec;
    border-color: #fff;
    color: #05070b;
    cursor: pointer;
    font-weight: 1000;
    text-shadow: none;
}

.hokm-felt .crazy-suit-picker button[data-suit="hearts"],
.hokm-felt .crazy-suit-picker button[data-suit="diamonds"] {
    color: #c62c45;
}

.hokm-felt .crazy-suit-picker button[data-suit="clubs"],
.hokm-felt .crazy-suit-picker button[data-suit="spades"] {
    color: #05070b;
    font-weight: 1000;
}

.hokm-felt .crazy-suit-picker button:disabled {
    cursor: default;
    opacity: .55;
}

.hokm-draft-offer {
    align-items: center;
    background: rgb(8 42 37 / 82%);
    border: 2px solid #ffe16a;
    border-radius: .9rem;
    display: grid;
    gap: .45rem;
    grid-template-columns: auto minmax(3.5rem, 5rem) auto;
    padding: .5rem .65rem;
}

.hokm-draft-offer > strong {
    color: #fff;
    max-width: 8rem;
}

.hokm-draft-offer > div {
    display: grid;
    gap: .35rem;
}

.hokm-draft-offer .btn {
    min-width: 5.3rem;
    padding: .45rem .7rem;
}

.hokm-draft-offer.revealing {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 20rem);
}

.hokm-draft-offer.final-pair {
    background: transparent;
    border: 0;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    width: min(100%, 21rem);
}

.hokm-draft-offer.final-pair > strong {
    background: rgb(8 42 37 / 92%);
    border: 2px solid #ffe16a;
    border-radius: 999px;
    justify-self: center;
    max-width: none;
    padding: .28rem .8rem;
    text-align: center;
}

.hokm-final-pair-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem !important;
    justify-items: center;
}

.hokm-final-pair-choice {
    appearance: none;
    background: transparent;
    border: 3px solid transparent;
    border-radius: .85rem;
    cursor: pointer;
    padding: .2rem;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
    width: clamp(7rem, 11vw, 8.5rem);
}

.hokm-final-pair-choice .playing-card {
    pointer-events: none;
    width: 100%;
}

.hokm-final-pair-choice:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

.hokm-final-pair-choice:disabled {
    cursor: default;
    opacity: .6;
}

@media (hover: hover) and (pointer: fine) {
    .hokm-final-pair-choice:hover:not(:disabled) {
        background: rgb(255 225 106 / 14%);
        border-color: #ffe16a;
        transform: translateY(-.22rem);
    }
}

.hokm-draft-offer.revealing > strong {
    max-width: none;
    text-align: center;
}

.hokm-draft-offer > .hokm-draft-cards {
    display: flex;
    gap: .75rem;
    justify-content: center;
}

@media (min-width: 681px) {
    .hokm-round-table[data-player-count="2"].has-draft-choice {
        aspect-ratio: 3 / 2;
    }

    .hokm-round-table[data-player-count="2"] .hokm-felt.has-draft-choice .hokm-trick {
        display: none;
    }

    .hokm-round-table[data-player-count="2"] .hokm-felt.has-draft-choice .hokm-phase-controls {
        grid-column: 2;
        grid-row: 1;
    }

    /* The final pair has no stock left, so center it against the whole felt. */
    .hokm-round-table[data-player-count="2"]
        .hokm-felt.has-draft-choice
        .hokm-phase-controls:has(.hokm-draft-offer.final-pair) {
        grid-column: 1 / -1;
    }

    .hokm-round-table[data-player-count="2"] .hokm-draft-offer:not(.revealing):not(.final-pair) {
        box-sizing: border-box;
        grid-template-columns: minmax(7.5rem, 1fr) minmax(4.8rem, 7rem) minmax(5.3rem, 1fr);
        width: min(100%, 27rem);
    }
}

.hokm-draft-cards figure {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin: 0;
}

.hokm-draft-cards figure.kept .playing-card {
    box-shadow: 0 0 0 4px #65e6b0, 0 .4rem .7rem rgb(0 0 0 / 28%);
}

.hokm-draft-cards figure.discarded .playing-card {
    filter: saturate(.55) brightness(.78);
    opacity: .82;
}

.hokm-draft-cards figcaption {
    display: grid;
    font-size: .68rem;
    gap: .05rem;
    justify-items: center;
    line-height: 1.1;
}

.hokm-draft-cards figcaption span,
.hokm-draft-cards figcaption b {
    color: #fff;
}

.hokm-draft-cards figure.kept figcaption b {
    color: #8ff1c9;
}

.hokm-draft-cards figure.discarded figcaption b {
    color: #ffb1bd;
}

.hokm-table .crazy-hand-header {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
    margin-bottom: .45rem;
}

.hokm-table .crazy-hand-header span {
    color: var(--text);
}

.hokm-hand-actions {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.hokm-trump-indicator {
    align-items: center;
    background: color-mix(in srgb, var(--surface-2) 88%, var(--sky) 12%);
    border: 2px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    gap: .32rem;
    min-height: 2rem;
    padding: .12rem .38rem .12rem .58rem;
}

.hokm-trump-indicator > span {
    font-size: .72rem;
    font-weight: 900;
}

.hokm-trump-indicator > b {
    align-items: center;
    background: #fffdf8;
    border: 2px solid #25233a;
    border-radius: 50%;
    color: #07080c;
    display: inline-flex;
    font-size: 1.3rem;
    height: 1.65rem;
    justify-content: center;
    line-height: 1;
    width: 1.65rem;
}

.hokm-trump-indicator.red > b {
    color: #c32640;
}

.hokm-hand-actions button {
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: .72rem;
    font-weight: 900;
    min-height: 32px;
    padding: .25rem .65rem;
}

.hokm-hand-actions button[aria-pressed="true"] {
    background: var(--mint);
    color: #152438;
}

.hokm-hand {
    --hokm-card-step: var(--hokm-card-width);
    --hokm-card-width: 5.125rem;
    box-sizing: border-box;
    direction: ltr;
    display: flex;
    gap: 0;
    justify-content: center;
    min-height: 7rem;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    padding: .55rem 1.2rem .25rem;
    width: 100%;
}

.hokm-suit-group {
    display: flex;
    flex: 0 0 auto;
    gap: 0;
    min-width: 0;
}

.hokm-suit-group + .hokm-suit-group {
    margin-left: calc(var(--hokm-card-step) - var(--hokm-card-width));
}

.hokm-hand .playing-card {
    flex: 0 0 var(--hokm-card-width);
    height: auto;
    max-width: none;
    width: var(--hokm-card-width);
}

.hokm-hand > .playing-card + .playing-card,
.hokm-hand .hokm-suit-group .playing-card + .playing-card {
    margin-left: calc(var(--hokm-card-step) - var(--hokm-card-width));
}

.hokm-hand .playing-card.legal {
    border-color: #25233a;
    box-shadow: 0 5px 0 rgb(21 28 45 / 26%);
}

.hokm-hand .playing-card.unplayable,
.crazy-eights-page .crazy-hand .playing-card.unplayable {
    filter: grayscale(.84) brightness(.58) saturate(.45);
    opacity: 1;
}

.hokm-hand .playing-card.selected {
    transform: translateY(-.6rem);
    outline: 3px solid var(--coral);
    z-index: 20;
}

.hokm-table .playing-card {
    --card-ink: #07080c;
    --card-red: #c32640;
}

.hokm-table .playing-card-corner b,
.hokm-table .playing-card-corner i,
.hokm-table .playing-card-center.pip-layout i,
.hokm-table .playing-card-center.ace-layout,
.hokm-table .court-suit {
    font-weight: 1000;
    text-shadow: none;
}

/* Takhte Nard is code-native so legal points remain exact at every size. */
.backgammon-shell {
    display: grid;
    grid-template-columns: minmax(8.5rem, 12rem) minmax(0, 1fr);
    gap: .8rem;
    width: min(100%, 74rem);
    margin: 0 auto;
}

.backgammon-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .75rem;
    border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--paper) 94%, #b97735 6%);
    text-align: center;
}

.backgammon-dice {
    display: flex;
    gap: .35rem;
}

.backgammon-die {
    display: grid;
    place-items: center;
    width: 3.25rem;
    aspect-ratio: 1;
    border-radius: .7rem;
    background: #f8e6c6;
    color: #19263a;
    font-weight: 900;
    box-shadow: 0 .3rem .7rem rgb(25 20 14 / 25%);
}

.backgammon-board {
    position: relative;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: .25rem;
    width: min(100%, 52rem);
    aspect-ratio: 1.38;
    margin: auto;
    padding: .8rem 3rem;
    border: .75rem solid #71421f;
    border-radius: 1.1rem;
    background: linear-gradient(90deg, #c58a4c 0 49%, #6f3f21 49% 51%, #c58a4c 51%);
    box-shadow: inset 0 0 0 .22rem #e7ba75, 0 1rem 2.2rem rgb(27 17 10 / 32%);
    overflow: hidden;
}

.backgammon-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    min-height: 0;
}

.backgammon-point {
    position: relative;
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: .12rem;
    border: 0;
    background: #7f3e32;
    cursor: default;
}

.backgammon-row.top .backgammon-point {
    align-items: flex-start;
    clip-path: polygon(0 0, 100% 0, 50% 90%);
}

.backgammon-row.bottom .backgammon-point {
    align-items: flex-end;
    clip-path: polygon(50% 10%, 100% 100%, 0 100%);
}

.backgammon-point.light {
    background: #edc78b;
}

.backgammon-checkers {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .08rem;
    width: 85%;
    z-index: 2;
}

.backgammon-row.bottom .backgammon-checkers {
    flex-direction: column-reverse;
}

.backgammon-checkers i {
    display: block;
    width: min(100%, 2.45rem);
    aspect-ratio: 1;
    border: 2px solid rgb(255 255 255 / 35%);
    border-radius: 50%;
    background: #f3d9ad;
    box-shadow: inset 0 -.25rem .35rem rgb(99 54 23 / 22%), 0 .12rem .25rem rgb(0 0 0 / 30%);
}

.backgammon-checkers.owner-1 i {
    border-color: rgb(255 255 255 / 18%);
    background: #263c59;
}

.backgammon-checkers b {
    position: absolute;
    padding: .05rem .3rem;
    border-radius: 999px;
    background: #111c2c;
    color: #fff;
}

.backgammon-bar,
.backgammon-off {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .2rem;
    border: 0;
    color: #fff;
    background: rgb(62 34 19 / 82%);
}

.backgammon-bar {
    inset: 0 calc(50% - 1.2rem);
}

.backgammon-off {
    top: .4rem;
    right: .2rem;
    bottom: .4rem;
    width: 2.55rem;
    border-radius: .55rem;
}

.backgammon-bar-stacks {
    display: grid;
    gap: .25rem;
}

.backgammon-bar .backgammon-checkers {
    width: 1.9rem;
}

.backgammon-board .legal-source,
.backgammon-board .legal-destination {
    cursor: pointer;
    filter: drop-shadow(0 0 .38rem #62e7bb);
}

.backgammon-board .legal-source::after,
.backgammon-board .legal-destination::after {
    content: "";
    position: absolute;
    width: .75rem;
    aspect-ratio: 1;
    border: 2px solid #102e29;
    border-radius: 50%;
    background: #62e7bb;
    z-index: 3;
}

.backgammon-board .selected {
    filter: drop-shadow(0 0 .55rem #ffe16a);
}

@media (max-width: 680px) {
    .hokm-felt.has-trick-cards {
        z-index: 4;
    }

    .hokm-table {
        border-radius: .9rem;
        padding: .4rem;
    }

    .hokm-round-table {
        aspect-ratio: 1;
        height: auto;
        max-width: min(100%, 25.5rem);
    }

    #gamePlayers.hokm-player-banners {
        margin-bottom: .4rem;
    }

    #gamePlayers.hokm-player-banners:is([data-player-count="3"], [data-player-count="4"]) {
        --hokm-banner-count: 2;
    }

    .hokm-seat-indicator {
        max-width: 5.4rem;
        min-height: 1.55rem;
        padding: .12rem .3rem;
    }

    .hokm-seat-name {
        font-size: .58rem;
        max-width: 4.35rem;
    }

    .hokm-seat-indicator[data-hokm-seat="left"],
    .hokm-seat-indicator[data-hokm-seat="right"] {
        max-width: 4.7rem;
        top: 56%;
    }

    .hokm-round-table[data-player-count="3"] .hokm-seat-indicator:is(
            [data-hokm-seat="left"],
            [data-hokm-seat="right"]
        ) {
        top: 35%;
    }

    .hokm-felt {
        border-width: .45rem;
        gap: .2rem;
        grid-template-columns: 4rem minmax(0, 1fr);
        inset: .15rem;
        padding: .45rem;
    }

    .hokm-round-table[data-player-count="2"] .hokm-felt {
        inset: 3.4rem .15rem;
    }

    .hokm-round-table[data-player-count="2"] .hokm-felt.has-draft-choice .hokm-trick {
        display: none;
    }

    .hokm-round-table[data-player-count="2"]
        .hokm-felt.has-draft-choice
        .hokm-phase-controls {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .hokm-round-table[data-player-count="3"] .hokm-felt {
        inset: .15rem 3.6rem 3.4rem;
    }

    .hokm-round-table[data-player-count="4"] .hokm-felt {
        inset: 2.45rem 2.05rem;
    }

    .hokm-player-progress {
        font-size: .57rem;
    }

    .hokm-stock-stack {
        height: 4.3rem;
        width: 3.1rem;
    }

    .hokm-stock-stack .playing-card {
        height: 4.1rem;
        width: 2.9rem;
    }

    .hokm-trick {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        min-height: 4.8rem;
    }

    .hokm-trick-cards {
        height: 10.4rem;
        max-width: 12rem;
    }

    .hokm-round-table[data-player-count="4"] .hokm-trick-cards {
        display: block;
        height: clamp(13rem, 55vw, 15.5rem);
        max-width: 17rem;
    }

    .hokm-round-table[data-player-count="4"] .hokm-trick .playing-card {
        width: clamp(4.05rem, 15vw, 4.55rem);
    }

    .hokm-round-table[data-player-count="4"] .hokm-trick-card[data-hokm-seat="left"] {
        left: 6%;
        top: 47%;
    }

    .hokm-round-table[data-player-count="4"] .hokm-trick-card[data-hokm-seat="right"] {
        right: 6%;
        top: 47%;
    }

    .hokm-trick .playing-card,
    .hokm-phase-controls .playing-card {
        width: 3.45rem;
    }

    .hokm-felt .crazy-suit-picker {
        padding: .35rem;
    }

    .hokm-felt .crazy-suit-picker button {
        height: 38px;
    }

    .hokm-round-table[data-player-count="4"] .crazy-suit-picker {
        font-size: .68rem;
        padding: .25rem;
        transform: translateX(1rem);
        width: 7.2rem;
    }

    .hokm-felt .crazy-suit-picker > strong {
        display: none;
    }

    .hokm-round-table[data-player-count="4"] .crazy-suit-picker div {
        gap: .2rem;
        grid-template-columns: repeat(2, 1fr);
        margin-top: .25rem;
    }

    .hokm-round-table[data-player-count="4"] .crazy-suit-picker button {
        font-size: 1.2rem;
        height: 32px;
    }

    .hokm-draft-offer {
        gap: .3rem;
        grid-template-columns: 3.6rem minmax(0, 1fr);
        padding: .45rem;
        width: min(calc(100% - 1rem), 18.5rem);
    }

    .hokm-draft-offer > strong {
        font-size: .72rem;
        grid-column: 1 / -1;
        max-width: none;
    }

    .hokm-draft-offer > div {
        display: grid;
    }

    .hokm-draft-offer .btn {
        min-width: 3.8rem;
        padding: .35rem .45rem;
    }

    .hokm-draft-offer.revealing {
        grid-template-columns: minmax(0, 1fr);
        width: min(calc(100% - .5rem), 19rem);
    }

    .hokm-draft-offer.final-pair {
        grid-template-columns: minmax(0, 1fr);
        width: min(calc(100% - .5rem), 15rem);
    }

    .hokm-final-pair-choices {
        gap: .65rem !important;
    }

    .hokm-final-pair-choice {
        width: 6.25rem;
    }

    .hokm-final-pair-choice .playing-card {
        width: 100%;
    }

    .hokm-draft-offer > .hokm-draft-cards {
        display: flex;
        gap: .8rem;
    }

    .hokm-draft-offer.revealing .playing-card {
        width: 3.65rem;
    }

    .hokm-hand {
        --hokm-card-width: 4.25rem;
        gap: 0;
        justify-content: center;
        min-height: 5rem;
        overflow-x: hidden;
        overflow-y: visible;
        padding: .7rem .3rem .4rem;
    }

    .hokm-hand-actions {
        gap: .3rem;
    }

    .hokm-hand-actions button {
        font-size: .64rem;
        min-height: 30px;
        padding: .2rem .48rem;
    }

    .hokm-hand .playing-card {
        flex-basis: var(--hokm-card-width);
        width: var(--hokm-card-width);
    }

    .hokm-hand .playing-card-center.court-layout {
        inset: 9% 11%;
    }

    .hokm-hand .hokm-suit-group {
        flex: 0 0 auto;
        gap: 0;
    }

    .hokm-hand .hokm-suit-group + .hokm-suit-group {
        margin-left: calc(var(--hokm-card-step) - var(--hokm-card-width));
    }

    .backgammon-shell {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    .backgammon-rail {
        display: grid;
        grid-template-columns: auto auto auto minmax(0, 1fr);
        min-height: 3.4rem;
        padding: .35rem .5rem;
    }

    .backgammon-rail small {
        text-align: start;
    }

    .backgammon-die {
        width: 2.45rem;
    }

    .backgammon-board {
        width: 100%;
        max-height: 58dvh;
        padding: .45rem 2.15rem;
        border-width: .48rem;
    }

    .backgammon-off {
        width: 1.85rem;
    }

    .backgammon-bar {
        inset-inline: calc(50% - .82rem);
    }

    .backgammon-checkers i {
        border-width: 1px;
    }
}

@media (max-width: 390px) {
    .hokm-hand {
        --hokm-card-width: 4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hokm-deal-animation {
        display: none;
    }

    .hokm-hand .playing-card,
    .backgammon-checkers i {
        transition: none;
    }
}

/* Harvested seed gifts use one quantity-and-action form, unlike collectible replies. */
[data-grown-seed-gifts] .letter-gift-row {grid-template-columns:54px minmax(0,1fr) auto;}
[data-grown-seed-gifts] .letter-gift-row form {display:flex;align-items:center;gap:10px;min-width:0;}
[data-grown-seed-gifts] label {display:flex;align-items:center;gap:8px;margin:0;}
[data-grown-seed-gifts] select {min-width:54px;min-height:40px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);padding:6px;}
[data-grown-seed-gifts] button {white-space:nowrap;min-height:40px;}
@media(max-width:600px) {
    [data-grown-seed-gifts] .letter-gift-row {grid-template-columns:46px minmax(0,1fr);}
    [data-grown-seed-gifts] .letter-gift-row form {grid-column:1 / -1;justify-content:space-between;}
    [data-grown-seed-gifts] label {font-size:.85rem;}
}

.safety-letter-evidence {
    display: grid;
    gap: 8px;
}

.safety-letter-evidence-options {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.safety-letter-evidence-option {
    align-items: start;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 9px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px;
}

.safety-letter-evidence-option:has(input:checked) {
    background: color-mix(in srgb, var(--palette-secondary) 22%, var(--surface));
    border-color: var(--palette-secondary);
}

.safety-letter-evidence-option input {
    margin-top: 4px;
}

.safety-letter-evidence-option > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.safety-letter-evidence-option small {
    color: var(--muted);
}

.safety-letter-evidence-option span span {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Short-wide screens need a landscape composition, not the width-only desktop
   stack. Ordinary pages move their persistent navigation to the side; active
   games use that width for a compact identity rail and a height-bounded play
   surface. Phone and normal desktop breakpoints remain independent. */
@media (min-width: 780px) and (max-height: 820px) and (orientation: landscape) {
    .app-shell {
        max-width: 850px;
        padding-block: 8px 20px;
        padding-inline: 90px 12px;
    }

    .top-bar {
        padding-bottom: 10px;
    }

    .bottom-nav {
        border-inline-end: 2px solid rgba(58, 32, 138, .16);
        border-top: 0;
        border-radius: 0;
        bottom: 0;
        flex-direction: column;
        gap: 6px;
        height: 100dvh;
        inset-inline-start: 0;
        inset-inline-end: auto;
        justify-content: center;
        left: auto;
        padding: 8px;
        right: auto;
        top: 0;
        width: 74px;
    }

    .bottom-nav a,
    .bottom-nav a.active {
        flex: 0 0 52px;
        max-width: none;
        min-height: 48px;
        padding: 5px;
        width: 100%;
    }

    .bottom-nav a.active {
        border-radius: 12px;
    }

    .bottom-nav a.active .nav-label {
        display: none;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) {
        --live-game-landscape-rail: clamp(250px, 27vw, 300px);
        --live-game-landscape-size: min(
            var(--live-game-content-width),
            calc(100dvh - var(--live-game-landscape-overhead, 16px)),
            calc(100vw - var(--live-game-landscape-rail) - 36px)
        );
        align-content: start;
        align-items: start;
        column-gap: 12px;
        display: grid;
        grid-template-columns:
            var(--live-game-landscape-rail)
            minmax(0, var(--live-game-landscape-size));
        grid-template-rows: auto minmax(0, 1fr) auto;
        justify-content: center;
        min-height: 100dvh;
        padding: 8px;
        row-gap: 8px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-status {
        gap: 5px 7px;
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: 44px minmax(0, 1fr);
        margin: 0;
        max-width: none;
        padding: 5px;
        width: 100%;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-status > img {
        width: 44px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-status .game-status-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-status .game-status-actions > * {
        min-height: 44px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-player-strip {
        align-self: start;
        gap: 5px;
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr);
        margin: 0;
        max-width: none;
        width: 100%;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-player-strip > .game-player-card {
        border-width: 2px;
        gap: 6px;
        grid-template-columns: 44px minmax(0, 1fr) 30px;
        padding: 4px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-player-strip > .game-player-card
        :is(.game-player-avatar, .game-player-avatar img, .bot-player-image) {
        width: 44px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > .game-player-strip > .game-player-card .game-player-marker {
        height: 30px;
        width: 30px;
    }

    :is(
        .board-wrap:has(> #tttBoard),
        .ludo-page,
        .backgammon-page,
        .knight-chase-page,
        .board-wrap:has(> #blackHoleBoard),
        .ultimate-ttt-page,
        .hundred-hop-page,
        .snakes-page,
        .flip-nine-page,
        .chess-page,
        .crazy-eights-page,
        .order-chaos-page
    ) > :is(
        #tttBoard,
        .knight-chase-stage,
        #blackHoleBoard,
        .ultimate-board,
        .hundred-hop-game,
        .flip-nine-game,
        .candidate-play-card,
        .crazy-table,
        .order-chaos-table
    ) {
        align-self: start;
        grid-column: 2;
        grid-row: 1 / span 3;
        justify-self: center;
        margin-block: 0;
        max-width: var(--live-game-landscape-size);
        width: 100%;
    }

    :is(.crazy-eights-page, .order-chaos-page) #gamePlayers
        > .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade) {
        --game-player-card-frame-width: 9px 16px 9px 56px;
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 56px;
    }

    :is(.crazy-eights-page, .order-chaos-page) #gamePlayers
        > .game-player-card.game-player-card-neon-arcade {
        --game-player-card-frame-width: 8px 20px 8px 56px;
    }

    :is(.crazy-eights-page, .order-chaos-page) #gamePlayers
        > .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        :is(.game-player-avatar, .game-player-avatar img) {
        width: 32px;
    }

    :is(.crazy-eights-page, .order-chaos-page) #gamePlayers
        > .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-body {
        padding-inline-end: 34px;
        padding-inline-start: 6px;
    }

    :is(.crazy-eights-page, .order-chaos-page) #gamePlayers
        > .game-player-card:is(.game-player-card-royal-inlay, .game-player-card-neon-arcade)
        .game-player-marker {
        height: 22px;
        inset-inline-end: 8px;
        width: 22px;
    }

    .board-wrap > #tttBoard {
        width: min(100%, var(--ttt-max, 340px));
    }
}


@media (min-width: 780px) and (max-height: 820px) and (orientation: landscape) {
    .board-wrap > #tttBoard#tttBoard {
        max-width: min(var(--ttt-max, 340px), 100%);
        width: min(100%, var(--ttt-max, 340px));
    }

    .board-wrap > #blackHoleBoard {
        --bh-gap: min(8px, 1vmin);
        --bh-size: min(78px, calc((100dvh - 100px) / 6));
        width: min(100%, var(--bh-board-width));
    }

    .board-wrap > #blackHoleBoard[data-rows="7"] {
        --bh-size: min(76px, calc((100dvh - 108px) / 7));
    }

    .board-wrap > #blackHoleBoard[data-rows="9"] {
        --bh-size: min(64px, calc((100dvh - 122px) / 9));
    }

    .ludo-shell,
    .snakes-shell {
        display: contents;
    }

    .ludo-shell > aside,
    .snakes-shell > .snakes-console {
        align-self: start;
        grid-column: 1;
        grid-row: 3;
        margin: 0;
        min-width: 0;
        width: 100%;
    }

    .ludo-shell > aside {
        gap: 5px;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        padding: 5px;
    }

    .ludo-board-choice,
    .ludo-color-choice {
        gap: 6px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ludo-board-options {
        grid-template-columns: repeat(3, minmax(54px, 1fr));
    }

    .ludo-color-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ludo-shell > .ludo-board-stage,
    .snakes-shell > .snakes-board-stage {
        align-self: start;
        grid-column: 2;
        grid-row: 1 / span 3;
        justify-self: center;
        margin: 0;
        width: var(--live-game-landscape-size);
    }

    .ludo-board {
        width: 100%;
    }

    .snakes-shell > .snakes-board-stage {
        width: min(var(--live-game-landscape-size), calc(100dvh - 48px));
    }

    .snakes-console {
        gap: 5px;
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 5px;
    }

    .snakes-console .btn {
        grid-column: 1 / -1;
        min-height: 44px;
        width: 100%;
    }

    .snakes-die,
    .snakes-die-visual,
    .snakes-die-visual canvas {
        height: 52px !important;
        width: 52px !important;
    }

    .board-wrap.chess-page .chess-stage {
        max-width: 100%;
    }

    .board-wrap.chess-page .candidate-controls .btn {
        min-height: 44px;
    }
}

/* Card-table games already own one composed surface. On a short landscape
   screen, expose its children to the same rail-and-table grid: identities and
   the scrollable hand stay in the rail while the full felt uses the height. */
@media (min-width: 780px) and (max-height: 820px) and (orientation: landscape) {
    .hokm-page {
        --live-game-landscape-rail: clamp(270px, 29vw, 330px);
        --live-game-landscape-size: min(
            var(--live-game-content-width),
            calc(100dvh - 16px),
            calc(100vw - var(--live-game-landscape-rail) - 36px)
        );
        --live-game-scale: 1;
        align-content: start;
        column-gap: 12px;
        display: grid;
        grid-template-columns:
            var(--live-game-landscape-rail)
            minmax(0, var(--live-game-landscape-size));
        grid-template-rows: auto auto auto minmax(0, 1fr);
        justify-content: center;
        min-height: 100dvh;
        padding: 8px;
        row-gap: 6px;
    }

    .hokm-page > .game-status {
        gap: 5px 7px;
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: 44px minmax(0, 1fr);
        margin: 0;
        max-width: none;
        padding: 5px;
        width: 100%;
    }

    .hokm-page > .game-status > img {
        width: 44px;
    }

    .hokm-page > .game-status .game-status-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .hokm-page > .game-status .game-status-actions > * {
        min-height: 44px;
    }

    .hokm-table {
        display: contents;
    }

    #gamePlayers.hokm-player-banners:is(
        [data-player-count="2"],
        [data-player-count="3"],
        [data-player-count="4"]
    ) {
        gap: 4px;
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr);
        margin: 0;
        max-width: none;
        width: 100%;
    }

    #gamePlayers.hokm-player-banners > .game-player-card {
        border-width: 2px;
        gap: 5px;
        grid-template-columns: 40px minmax(0, 1fr) 28px;
        padding: 3px;
    }

    #gamePlayers.hokm-player-banners > .game-player-card
        :is(.game-player-avatar, .game-player-avatar img, .bot-player-image) {
        width: 40px;
    }

    #gamePlayers.hokm-player-banners > .game-player-card .game-player-marker {
        height: 28px;
        width: 28px;
    }

    .hokm-round-table {
        align-self: start;
        grid-column: 2;
        grid-row: 1 / span 4;
        justify-self: center;
        margin: 0;
        max-width: var(--live-game-landscape-size);
        width: 100%;
    }

    .hokm-table .crazy-hand-header {
        grid-column: 1;
        grid-row: 3;
        margin: 0;
        padding: 5px 7px;
    }

    .hokm-hand {
        --hokm-card-step: var(--hokm-card-width);
        grid-column: 1;
        grid-row: 4;
        justify-content: flex-start;
        min-height: 7.5rem;
        overflow-x: auto;
        padding: .45rem .25rem .75rem;
        scrollbar-gutter: stable;
    }

    .hokm-hand-actions button {
        min-height: 40px;
    }
}

/* Height still constrains square race boards on ordinary desktop windows.
   Keep the established stacked desktop composition and reduce only the two
   shells whose control rail adds height beyond their square board. */
@media (min-width: 780px) and (min-height: 821px) and (max-height: 1120px) {
    .ludo-shell,
    .snakes-shell {
        margin-block: 0;
        max-width: calc(100vh - 364px) !important;
    }
}

@media (max-width: 680px) {
    .board-wrap.chess-page .candidate-controls .btn {
        min-height: 44px !important;
    }
}

@media (min-width: 780px) and (max-height: 820px) and (orientation: landscape) {
    #hundredHopGame.hundred-hop-game {
        max-width: min(var(--live-game-landscape-size), calc(100dvh - 40px)) !important;
    }

    .hokm-hand {
        --hokm-card-width: 4.6rem;
        min-height: 7rem;
    }
}

@media (min-width: 780px) and (min-height: 821px) and (max-height: 1120px) {
    .board-wrap .ludo-shell,
    .board-wrap .snakes-shell {
        max-width: calc(100vh - 364px) !important;
        width: calc(100vh - 364px) !important;
    }
}

@media (min-width: 780px) and (max-height: 820px) and (orientation: landscape) {
    #hundredHopGame .hundred-hop-paper {
        padding: 5px;
    }

    #hundredHopGame .hundred-hop-paper-header {
        margin-bottom: 4px;
    }

    #hundredHopGame .hundred-hop-paper-row {
        padding: 2px 0;
    }

    #hundredHopGame .hundred-hop-row {
        margin: 2px 0;
    }

    #hundredHopGame .hundred-hop-row-result {
        min-height: 14px;
        padding-bottom: 0;
    }
}

@media (min-width: 780px) and (min-height: 821px) and (max-height: 1120px) {
    .ludo-board,
    .snakes-board-stage {
        width: calc(100vh - 364px) !important;
    }
}

@media (min-width: 780px) and (min-height: 821px) and (max-height: 1200px) {
    .snakes-page:has(#gamePlayers[data-player-count="3"], #gamePlayers[data-player-count="4"])
        .snakes-shell {
        max-width: min(100%, calc(100dvh - 460px)) !important;
        width: min(100%, calc(100dvh - 460px)) !important;
    }

    .snakes-page:has(#gamePlayers[data-player-count="3"], #gamePlayers[data-player-count="4"])
        .snakes-board-stage {
        width: 100% !important;
    }
}

@media (max-width: 680px) {
    .chess-page .chess-draw-button {
        height: 44px !important;
        min-height: 44px !important;
    }
}


/* Reserve status-rail height for square boards on medium-height desktop windows. */

@media (min-width: 780px) and (min-height: 821px) and (max-height: 1120px) {
    .knight-chase-stage,
    .ultimate-board {
        width: min(100%, calc(100vh - 270px)) !important;
    }
}

/* A 320x640 device has enough width for the cards but not the default table
   whitespace. Preserve card and control sizes while reclaiming that spacing. */

@media (max-width: 340px) and (max-height: 680px) {
    .hokm-table {
        padding-block: .2rem;
    }

    .hokm-round-table {
        margin-bottom: 0;
    }

    .hokm-hand {
        min-height: 4.5rem;
        padding-block: .35rem .1rem;
    }
}

/* Keep the gift decision controls together in both writing directions. */
.letter-gift-row > div { min-width: 0; overflow-wrap: anywhere; }
.letter-gift-row .letter-gift-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.letter-gift-actions form { margin: 0; min-width: 0; flex: 1 1 90px; display: flex; }
.letter-gift-actions .btn { width: 100%; min-width: 0; white-space: normal; margin: 0; }
.letter-stamp-copy { grid-column: 1; grid-row: 1; min-width: 0; align-self: center; }
.letter-stamp-copy h4 { margin: 0 0 8px; }
.letter-stamp-copy p { margin: 0; overflow-wrap: anywhere; font-size: clamp(.8rem, 2.8vw, 1rem); }
.letter-stamp-strip > .letter-cheer-tile { grid-row: 1; align-self: center; width: 100%; max-width: 112px; }
.match-row-actions { display: flex; align-items: center; gap: 8px; }
.match-gift-link { font-size: 22px; text-decoration: none; padding: 8px; border-radius: 10px; background: var(--mint); color: var(--ink); }
.match-gift-link[hidden] { display: none; }
@media (max-width: 520px) {
    .letter-stamp-copy { grid-column: 1; grid-row: 1; align-self: center; }
    .letter-stamp-strip > .letter-cheer-tile { grid-row: 1; }
    .letter-gift-row .letter-gift-actions { grid-column: 1 / -1; }
    .match-row { gap: 8px; }
}

.daily-login-reward-overlay[hidden] { display: none; }

.inbox-header-link { position: relative; text-decoration: none; }
.inbox-count { position: absolute; inset-inline-end: -5px; top: -5px; min-width: 18px; padding: 1px 4px; border: 2px solid var(--surface); border-radius: 99px; background: var(--mint); color: var(--accent-strong-text); font-size: 10px; line-height: 1.3; font-weight: 900; }
.inbox-count[hidden] { display: none; }
.notification-document { scrollbar-gutter: stable; }
.inbox-heading { margin: 18px 0; }
.inbox-heading h1 { margin: 0; }
.inbox-filters, .inbox-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inbox-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.inbox-filters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.inbox-filters a { color: var(--text); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 800; font-size: .85rem; }
.inbox-filters a[aria-current="page"] { background: var(--mint); color: var(--accent-strong-text); }
.inbox-types { position: relative; justify-self: start; width: 180px; max-width: 100%; }
.inbox-type-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .85rem; list-style: none; cursor: pointer; }
.inbox-type-summary::-webkit-details-marker { display: none; }
.inbox-type-chevron { flex-shrink: 0; }
.inbox-types[open] .inbox-type-chevron { transform: rotate(180deg); }
.inbox-type-options { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 20; display: grid; gap: 3px; width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 20px #0003; }
.inbox-type-toggle { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.inbox-type-check { display: inline-block; flex-shrink: 0; width: 1em; visibility: hidden; font-weight: 900; }
.inbox-type-toggle[aria-pressed="true"] .inbox-type-check { visibility: visible; }
.inbox-mark-all, .inbox-open { border: 0; background: none; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 4px; }
.inbox-mark-all { color: var(--muted); }
.inbox-mark-all-form { grid-column: 3; grid-row: 1; justify-self: end; }
.inbox-mark-all:disabled { opacity: .45; cursor: default; }
.inbox-list { display: grid; gap: 8px; }
.inbox-entry { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px; padding-right: 56px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.inbox-entry-icon { font-size: 24px; text-align: center; }
.inbox-entry-copy { min-width: 0; }
.inbox-entry-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inbox-entry h2 { font-size: .95rem; margin: 0; overflow-wrap: anywhere; }
.inbox-entry p { margin: 4px 0; font-size: .85rem; overflow-wrap: anywhere; }
.inbox-status { font-size: .7rem; color: var(--muted); }
.inbox-entry time { font-size: .72rem; color: var(--muted); }
.inbox-entry-actions { display: flex; align-items: center; flex-wrap: wrap; column-gap: 12px; }
.inbox-entry-actions form, .inbox-toolbar form, .inbox-dismiss-form { margin: 0; }
.inbox-dismiss-form { position: absolute; right: 5px; top: 5px; }
.inbox-dismiss { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--danger); cursor: pointer; }
.inbox-dismiss:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.inbox-empty { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px 18px; }
.inbox-empty > span { font-size: 40px; }
.inbox-pagination { justify-content: center; margin-top: 20px; }
@media (max-width: 640px) {
    .inbox-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
    .inbox-filters { justify-self: start; }
    .inbox-mark-all-form { grid-column: 2; }
    .inbox-types { grid-column: 1 / -1; grid-row: 2; }
    .inbox-entry { gap: 8px; }
    .inbox-header-link { flex-shrink: 0; }
}

.letter-gift-receipt {
    align-items: center;
    background: var(--paper-warm);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: #303747;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 3px 6px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    height: 100%;
    min-height: 0;
    min-width: 0;
    padding: clamp(3px, 1vw, 10px);
    text-align: start;
    width: 100%;
}
.letter-gift-receipt img { grid-row: 1 / 3; max-height: 100%; min-height: 0; object-fit: contain; width: 100%; }
.letter-gift-receipt strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: clamp(.6rem, 1.8vw, .85rem); line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; }
.letter-gift-receipt span { font-size: clamp(.5rem, 1.5vw, .7rem); overflow-wrap: anywhere; }
.letter-gift-receipt time { font-size: clamp(.5rem, 1.5vw, .7rem); grid-column: 1 / -1; text-align: center; }
.letter-gift-receipt:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; }
.letter-gift-detail { display: grid; gap: 12px; justify-items: center; padding-top: 42px; text-align: center; }
.letter-gift-detail > img { height: 140px; max-width: 100%; object-fit: contain; }
.letter-gift-detail > strong { font-size: 1.2rem; }
