/* Layout, spacing and typography refinements. Loaded last; uses only the existing palette. */

/* Scripts hide elements with the hidden attribute (e.g. the lobby filter); no display rule may override it. */
[hidden] {
    display: none !important;
}

/* The fixed centre line ran through headings and cards; keep only the horizontal grid texture. */
body:before {
    background: linear-gradient(#ffffff04 1px, transparent 1px);
    background-size: 100% 64px;
}

/* Form fields inherited the 10px label size, which made typed values hard to read. */
label input,
label select,
.operator-form select {
    font-size: 15px;
    letter-spacing: .02em;
}
input[readonly] {
    color: var(--muted);
    cursor: default;
    text-overflow: ellipsis;
}
.fund-card input[readonly] {
    font-family: monospace;
    font-size: 13px;
}
.fund-card form + small {
    display: block;
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.6;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

/* Page headings: large enough to lead, small enough not to wrap one word per line. */
.dash-head h1 {
    font-size: clamp(38px, 5.2vw, 72px);
    line-height: .95;
    max-width: 16ch;
}
.investor-head h1 {
    font-size: clamp(42px, 6vw, 84px);
}

/* Section headings were page-heading sized; bring them down and give their kicker the eyebrow style. */
.section-title > span {
    color: var(--lime);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2em;
}
.section-title h2 {
    font-size: clamp(26px, 3vw, 40px);
    margin: 8px 0 20px;
}
.ledger {
    padding-top: 40px;
    padding-bottom: 40px;
}
.fairness {
    margin-top: 40px;
}

/* Lobby: cards keep a sensible width even when only one round is open, and their actions line up. */
.arena-card {
    display: flex;
    flex-direction: column;
}
/* Everything below the description sits at the bottom, so the final action buttons align across a row. */
.arena-card .quick-facts {
    margin-top: auto;
}
.arena-card .play-link {
    display: block;
    text-align: center;
    text-decoration: none;
}
.arena-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.lobby-bar {
    gap: 20px;
    flex-wrap: wrap;
}

/* Activity rows. */
.row {
    gap: 12px;
}
.row strong {
    white-space: nowrap;
}
.row small {
    overflow-wrap: anywhere;
}

/* Home: headline block reads top to bottom instead of scattering across two columns. */
.home-games-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    column-gap: 48px;
    row-gap: 0;
}
.home-games-head .eyebrow {
    grid-column: 1 / -1;
}
.home-games-head h2 {
    margin: 10px 0 0;
    line-height: 1;
}
.home-games-head p {
    justify-self: start;
    margin: 0 0 6px;
}

/* Five games: the flagship spans two columns so no card is left alone on a row. */
.home-game-grid {
    grid-template-columns: repeat(3, 1fr);
}
.home-game.gm-week {
    grid-column: span 2;
}
.home-game {
    min-height: 420px;
}

/* Funds: the three-step flow aligns as a row of equal steps. */
.money-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 10px;
    align-items: start;
}
.money-flow i {
    color: var(--muted);
    font-style: normal;
    padding-top: 18px;
}

/* Operator notes: links were browser-default blue. */
.operator-note a,
.ledger a,
.clarity-box a {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ledger small a {
    color: inherit;
}

/* Hash values wrap instead of overflowing on small screens. */
.hash {
    overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
    .home-game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .home-games-head {
        grid-template-columns: 1fr;
    }
    .home-games-head p {
        margin-top: 12px;
    }
    .money-flow {
        grid-template-columns: 1fr;
    }
    .money-flow i {
        display: none;
    }
    .row {
        grid-template-columns: 28px 1fr;
    }
    .row strong {
        grid-column: 2;
    }
}

@media (max-width: 650px) {
    .home-game-grid {
        grid-template-columns: 1fr;
    }
    .home-game.gm-week {
        grid-column: auto;
    }
}

/* Daily Jackpot: a full-width card under the other games, in the existing lime accent. */
.home-game.jackpot {
    grid-column: span 2;
    min-height: auto;
}
.home-game.horses:before {
    background: linear-gradient(90deg, #ff5a6a, #4d8dff, #c8ff35, #ffad4d, #b65cff, #5fe0e8);
}
@media (max-width: 650px) {
    .home-game.jackpot {
        grid-column: auto;
    }
}
.home-game.jackpot:before {
    background: var(--lime);
}
.home-game.jackpot .home-game-icon {
    color: var(--lime);
}

/* Player guide: sticky contents on the left, a readable single column on the right. */
.guide-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    padding: 60px clamp(22px, 6vw, 100px) 90px;
    max-width: 1280px;
    margin: 0 auto;
}
.guide-toc {
    position: sticky;
    top: 24px;
    align-self: start;
    display: grid;
    gap: 10px;
}
.guide-toc a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}
.guide-toc a:hover {
    color: var(--lime);
}
.guide-body {
    max-width: 820px;
}
.guide-intro h1 {
    font-size: clamp(38px, 5vw, 64px);
    line-height: .95;
    margin: 12px 0;
}
.guide-intro p,
.guide-section p,
.guide-section li {
    color: #aeb6c2;
    line-height: 1.7;
}
.guide-section {
    border-top: 1px solid var(--line);
    padding: 36px 0;
    scroll-margin-top: 20px;
}
.guide-section h2 {
    font-size: clamp(24px, 2.6vw, 32px);
    margin: 0 0 16px;
}
.guide-section b {
    color: var(--white);
}
.guide-section a,
.home-games-head p a,
.guide-head p a {
    color: var(--lime);
}
.guide-steps {
    display: grid;
    gap: 14px;
    padding-left: 22px;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.guide-grid > div {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 18px;
}
.guide-grid p {
    margin: 6px 0 0;
}
.guide-note,
.guide-tip {
    font-size: 14px;
}
.guide-game {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 24px;
    margin-top: 18px;
    scroll-margin-top: 20px;
}
.guide-game-head {
    display: flex;
    gap: 14px;
    align-items: center;
}
.guide-game-head h3 {
    margin: 0 0 4px;
    font-size: 22px;
}
.guide-game-head small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
}
.guide-game ul {
    padding-left: 20px;
}
.guide-details {
    border: 1px solid var(--line);
    padding: 14px 18px;
    margin-top: 10px;
}
.guide-details summary {
    cursor: pointer;
    font-weight: 700;
}
.guide-section code {
    color: var(--lime);
    font-size: 13px;
}
.guide-cta {
    padding-top: 30px;
}
.guide-cta a {
    display: inline-block;
    text-decoration: none;
}

@media (max-width: 900px) {
    .guide-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 36px;
    }
    .guide-toc {
        position: static;
        grid-template-columns: repeat(2, 1fr);
    }
    .guide-toc .eyebrow {
        grid-column: 1 / -1;
    }
}

/* Pickers for Crowd Dodge doors and duel moves: same look as the team picker, lime when selected. */
.choice-picker {
    border: 0;
    padding: 0;
    margin: 14px 0;
    display: grid;
    gap: 8px;
}
.choice-picker.doors {
    grid-template-columns: repeat(5, 1fr);
}
.choice-picker.moves {
    grid-template-columns: repeat(3, 1fr);
}
.choice-picker legend {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .1em;
    margin-bottom: 7px;
}
.choice-picker label {
    margin: 0;
    position: relative;
}
.choice-picker input {
    position: absolute;
    opacity: 0;
}
.choice-picker span {
    display: block;
    text-align: center;
    padding: 11px 4px;
    border: 1px solid var(--line);
    background: #0b0e13;
    color: var(--white);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
}
.choice-picker input:checked + span {
    background: var(--lime);
    border-color: var(--lime);
    color: #07090d;
}
.choice-picker input:focus-visible + span {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

/* Crowd Dodge results. */
.door-results {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 18px 0;
}
.door-results div {
    border: 1px solid var(--line);
    padding: 12px 8px;
    text-align: center;
    display: grid;
}
.door-results b {
    font-size: 22px;
}
.door-results small {
    color: var(--muted);
}
.door-results .drawn {
    border-color: var(--lime);
    color: var(--lime);
}
.door-results .mine {
    outline: 1px dashed var(--muted);
    outline-offset: -5px;
}

/* Duel board. */
.duel-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
}
.duel-board div {
    border: 1px solid var(--line);
    padding: 18px;
    text-align: center;
    display: grid;
    gap: 6px;
}
.duel-board small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .1em;
}
.duel-board b {
    font-size: 24px;
}
.duel-board .empty-side b {
    color: var(--muted);
}
.duel-board > span {
    color: var(--muted);
    font-weight: 800;
}

/* Lobby: duel section and the tab that jumps to it. */
.mode-tab-link {
    background: #10141a;
    color: #9ca5b4;
    border: 1px solid var(--line);
    padding: 11px 15px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-decoration: none;
}
.mode-tab-link:hover {
    border-color: var(--lime);
    color: var(--lime);
}
.section-lead {
    color: var(--muted);
    max-width: 760px;
    margin: -6px 0 22px;
}
.duel-create h3 {
    margin: 14px 0 0;
}

/* Home: Crowd Dodge, Duck Crossing and the duel fill the row above the jackpot. */
.home-game.ducks:before,
.home-game.doors:before,
.home-game.duel:before {
    background: var(--lime);
}
.home-game.doors .home-game-icon {
    color: var(--lime);
}

/* ---------- Duels page ---------- */
.duel-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 22px;
    margin: 10px clamp(22px, 6vw, 100px) 0;
    align-items: start;
}
.duel-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 26px;
}
.duel-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px;
    font-weight: 700;
}
.duel-step b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    background: var(--lime);
    color: #07090d;
    font-size: 12px;
}
.stake-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.stake-chips button {
    background: #0b0e13;
    color: var(--white);
    border: 1px solid var(--line);
    padding: 10px 0;
}
.stake-chips button.active,
.stake-chips button:hover {
    border-color: var(--lime);
    color: var(--lime);
}
.big-moves {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.big-moves label {
    margin: 0;
    position: relative;
}
.big-moves input {
    position: absolute;
    opacity: 0;
}
.big-moves span {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 16px 6px;
    border: 1px solid var(--line);
    background: #0b0e13;
    color: var(--white);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .08em;
    cursor: pointer;
}
.big-moves i {
    font-style: normal;
    font-size: 34px;
    line-height: 1;
}
.big-moves input:checked + span {
    border-color: var(--lime);
    background: #10141a;
    color: var(--lime);
    box-shadow: inset 0 0 0 1px var(--lime);
}
.big-moves input:focus-visible + span {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}
.duel-summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0 14px;
    color: var(--muted);
    font-size: 14px;
}
.duel-summary b {
    color: var(--white);
}
.duel-hint {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
.duel-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.duel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    background: #0b0e13;
    padding: 14px 16px;
}
.duel-row.mine {
    border-color: var(--lime);
}
.duel-who {
    display: grid;
    gap: 2px;
}
.duel-who small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .1em;
}
.duel-who b {
    font-size: 20px;
}
.duel-who b i {
    font-style: normal;
    font-size: 12px;
    color: var(--lime);
}
.duel-who span {
    color: var(--muted);
    font-size: 12px;
}
.duel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.duel-actions button[name="choice"] {
    width: 52px;
    height: 52px;
    font-size: 26px;
    background: #10141a;
    border: 1px solid var(--line);
    padding: 0;
}
.duel-actions button[name="choice"]:hover {
    border-color: var(--lime);
    background: #151a22;
}
.duel-actions .play-with,
.duel-actions .waiting {
    color: var(--muted);
    font-size: 12px;
}
.duel-banner {
    margin: 40px clamp(22px, 6vw, 100px) 0;
    padding: 26px 30px;
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.duel-banner h2 {
    margin: 8px 0;
    font-size: clamp(22px, 2.6vw, 30px);
}
.duel-banner p {
    color: var(--muted);
    margin: 0;
}
.duel-banner > a {
    text-decoration: none;
    white-space: nowrap;
}

/* ---------- History ---------- */
.history-filter {
    justify-content: flex-start;
    margin-bottom: 18px;
}
.history-filter a {
    background: #10141a;
    color: #9ca5b4;
    border: 1px solid var(--line);
    padding: 11px 15px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-decoration: none;
}
.history-filter a.active,
.history-filter a:hover {
    background: var(--lime);
    border-color: var(--lime);
    color: #07090d;
}
a.history-row {
    color: inherit;
    text-decoration: none;
}
a.history-row:hover {
    background: #10141a;
}
.history-row .pending {
    color: var(--muted);
}
.history-row .neutral {
    color: var(--white);
}
.table .empty a {
    color: var(--lime);
}

@media (max-width: 900px) {
    .duel-layout {
        grid-template-columns: 1fr;
    }
    .duel-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Quick match: waiting counts on stake chips and the "will you be matched" line. */
.stake-chips button small {
    display: block;
    margin-top: 2px;
    color: var(--lime);
    font-size: 9px;
    letter-spacing: .06em;
}
.duel-match {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-size: 13px;
}
.duel-match.ready {
    border-color: var(--lime);
    color: var(--lime);
}
.text-button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 6px 0;
    background: none;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.text-button:hover {
    color: var(--white);
}

/* Public results: lobby card footer and the round page list. */
.last-result {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.last-result b {
    color: var(--white);
    font-weight: 700;
}
.result-row .tx-icon {
    color: var(--lime);
}
a.last-result:hover b {
    color: var(--lime);
}

/* ---------- Duck Crossing ---------- */
.duck-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}
.duck-stage {
    margin: 26px 0 8px;
}
.duck-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 10px;
}
.duck-stage-head b {
    display: block;
    margin-top: 6px;
    font-size: 15px;
}
.duck-controls {
    display: flex;
    gap: 8px;
}
.duck-controls .ghost {
    padding: 8px 14px;
    font-size: 11px;
    letter-spacing: .1em;
    cursor: pointer;
}
.duck-road {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 20% 30%, #ffffff06 0 1px, transparent 2px) 0 0 / 13px 13px,
        radial-gradient(circle at 70% 60%, #00000040 0 1px, transparent 2px) 0 0 / 17px 17px,
        linear-gradient(180deg, #1b2029, #14181f);
    box-shadow: inset 0 0 80px #000a;
}
.road-lanes {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 8% repeat(10, 1fr) 8%;
}
.road-lanes .curb {
    background:
        repeating-linear-gradient(0deg, transparent 0 22px, #ffffff0d 22px 24px),
        repeating-linear-gradient(90deg, transparent 0 22px, #ffffff0d 22px 24px),
        #232a35;
}
.road-lanes .curb.start {
    border-right: 5px solid #4a5464;
    box-shadow: 3px 0 0 #e8edf3;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .2em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
.road-lanes .curb.end {
    border-left: 5px solid #4a5464;
    box-shadow: -3px 0 0 #e8edf3;
    background:
        repeating-linear-gradient(0deg, transparent 0 22px, #ffffff0d 22px 24px),
        linear-gradient(90deg, #c8ff3510, #c8ff3524),
        #232a35;
}
.road-lanes .lane {
    position: relative;
    background: linear-gradient(180deg, #ffffff2e 0 14px, transparent 14px) 0 0 / 2px 26px repeat-y;
    transition: background .3s;
}
/* Double centre line between the two directions of traffic. */
.road-lanes .lane:nth-child(7) {
    background: linear-gradient(90deg, #ffc93c 0 2px, transparent 2px 5px, #ffc93c 5px 7px, transparent 7px) 0 0 / 7px 100% no-repeat;
}
.road-lanes .lane:nth-child(2) {
    background: none;
}
.road-lanes .lane i {
    position: absolute;
    top: 7px;
    left: 0;
    right: 0;
    text-align: center;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff59;
}
.road-lanes .lane.car-lane {
    background: linear-gradient(180deg, #ff6f7d26, #ff6f7d0d);
}
.road-lanes .lane.car-lane i {
    color: #ff6f7d;
}
.duck-road.playing .lane.car-lane {
    background: none;
}
.duck-road.playing .lane.car-lane i {
    color: #ffffff40;
}
.duck-road.car-coming .lane.car-lane {
    background: linear-gradient(180deg, #ff6f7d26, #ff6f7d0d);
}
.duck-rows {
    position: relative;
    padding: 30px 0 10px;
}
.duck-row {
    position: relative;
    height: 38px;
}
.duck {
    position: absolute;
    top: 50%;
    left: 4%;
    width: 36px;
    height: 31px;
    transform: translate(-50%, -50%);
    transition: left .38s ease-in-out;
    z-index: 2;
}
.duck svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 2px 2px #000a);
    transform-origin: 50% 80%;
    transition: transform .35s, opacity .35s, filter .35s;
}
.duck em {
    position: absolute;
    top: 50%;
    left: calc(100% + 3px);
    transform: translateY(-50%);
    padding: 0 3px;
    background: var(--lime);
    color: #07090d;
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1.4;
}
.duck-row.mine .duck svg {
    filter: drop-shadow(0 0 5px #c8ff35b0);
}
.duck-road[data-final="false"] .duck svg {
    animation: duck-idle 1.8s ease-in-out infinite;
}
.duck-road[data-final="false"] .duck-row:nth-child(2n) .duck svg {
    animation-delay: -.9s;
}
.duck-road[data-final="false"] .duck-row:nth-child(3n) .duck svg {
    animation-delay: -1.7s;
}
.duck.walking svg {
    animation: duck-waddle .38s ease-in-out infinite;
}
.duck.safe svg {
    animation: duck-hop .5s ease-in-out 3;
}
.duck.hit svg {
    transform: rotate(150deg) scale(.85);
    opacity: .45;
    filter: grayscale(1);
}
.duck.hit::after {
    content: "";
    position: absolute;
    inset: -8px;
    border: 2px solid #ff6f7d;
    border-radius: 50%;
    animation: duck-splat .55s ease-out forwards;
}
/* The ring only flashes while the crossing plays. */
.duck-road:not(.playing) .duck.hit::after {
    display: none;
}
.duck-target {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--lime);
    font-size: 13px;
    opacity: .7;
}
.road-car {
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 70px;
    transform: translate(-50%, -110%);
    z-index: 3;
    filter: drop-shadow(0 6px 8px #000c);
}
.road-car.driving {
    transition: transform .9s linear;
}
.road-car svg {
    display: block;
    width: 100%;
    height: 100%;
}
.duck-banner {
    margin: 12px 0 0;
    padding: 14px 16px;
    border-left: 3px solid var(--lime);
    background: #10141b;
    color: var(--white);
    font-size: 14px;
}
@keyframes duck-waddle {
    0%, 100% { transform: rotate(-7deg); }
    50% { transform: rotate(7deg) translateY(-2px); }
}
@keyframes duck-idle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-9deg); }
    40% { transform: rotate(7deg) translateY(-3px); }
    55% { transform: rotate(0) translateY(0); }
    70% { transform: rotate(-5deg); }
}
@keyframes duck-hop {
    50% { transform: translateY(-7px); }
}
@keyframes duck-splat {
    from { transform: scale(.3); opacity: 1; }
    to { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .duck, .duck svg, .road-car.driving { transition: none; }
    .duck svg, .duck.walking svg, .duck.safe svg, .duck.hit::after { animation: none !important; }
}
/* Flash messages line up with the round page content. */
.play-shell > .flash {
    margin-left: 0;
    margin-right: 0;
}

/* Lane picker: 3 x 3 with odds on the round page, one compact row on lobby cards. */
.choice-picker.lanes {
    grid-template-columns: repeat(3, 1fr);
}
.choice-picker.lanes span small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .04em;
    opacity: .75;
}
.choice-picker.lanes.compact {
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
}
.choice-picker.lanes.compact span {
    padding: 10px 0;
}
.lane-hint {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Leaderboard after the crossing. */
.play-shell .duck-board {
    padding: 30px 0 10px;
}
.duck-board .row.duck-board-row,
.duck-board .row.duck-board-head {
    grid-template-columns: 44px minmax(0, 1fr) 70px 100px 110px;
}
.duck-board-head {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    padding-top: 12px;
    padding-bottom: 12px;
}
.duck-board-head strong {
    font-weight: 400;
    text-align: right;
}
.duck-board-row strong {
    text-align: right;
}
.duck-board-row .place {
    font-weight: 800;
    color: var(--muted);
}
.duck-board-row.safe .place,
.duck-board-row.safe .result {
    color: var(--lime);
}
.duck-board-row:not(.safe) .result {
    color: var(--muted);
}
.duck-board-row.mine {
    background: #c8ff350d;
    box-shadow: inset 3px 0 0 var(--lime);
}

@media (max-width: 760px) {
    .duck-row {
        height: 28px;
    }
    .duck {
        width: 24px;
        height: 21px;
    }
    .duck em {
        display: none;
    }
    .road-car {
        width: 24px;
        height: 42px;
    }
    .duck-board .row.duck-board-row,
    .duck-board .row.duck-board-head {
        grid-template-columns: 26px minmax(0, 1fr) 40px 64px 74px;
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 13px;
    }
    .duck-board .row strong {
        grid-column: auto;
    }
    .duck-board-head {
        font-size: 8px;
        letter-spacing: .06em;
    }
    .duck-board-row b {
        white-space: nowrap;
    }
    .choice-picker.lanes.compact span {
        padding: 9px 0;
        font-size: 11px;
    }
}

/* ---------- Horse race ---------- */
.h1 { --c: #ff5a6a; }
.h2 { --c: #4d8dff; }
.h3 { --c: #c8ff35; }
.h4 { --c: #ffad4d; }
.h5 { --c: #b65cff; }
.h6 { --c: #5fe0e8; }
.race-scene {
    margin: 26px 0 8px;
}
.race-hud {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.race-status b {
    display: block;
    margin-top: 6px;
    font-size: 17px;
    min-height: 1.5em;
}
.race-board {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.race-board li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px 6px 6px;
    border: 1px solid var(--line);
    background: #0b0e13;
    font-size: 11px;
    font-weight: 700;
    transition: border-color .2s;
}
.race-board li i,
.race-results .badge,
.race-gate b {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    background: var(--c);
    color: #07090d;
    font-style: normal;
    font-weight: 900;
    font-size: 11px;
}
.race-board li.leading {
    border-color: var(--c);
    box-shadow: inset 0 -2px 0 var(--c);
}
.race-track {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0e2416;
}
.race-stands {
    position: relative;
    height: 54px;
    background:
        radial-gradient(circle at 2px 2px, #ffffff30 1.2px, transparent 2px) 0 4px / 9px 8px,
        radial-gradient(circle at 6px 5px, #c8ff3530 1.2px, transparent 2px) 0 4px / 13px 9px,
        linear-gradient(180deg, #07090d, #141a22 70%, #1d2530);
    border-bottom: 1px solid #000;
}
.race-lights {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 160px 60px at 15% 0, #fff6c838, transparent 70%),
        radial-gradient(ellipse 160px 60px at 50% 0, #fff6c838, transparent 70%),
        radial-gradient(ellipse 160px 60px at 85% 0, #fff6c838, transparent 70%);
}
.race-rail {
    height: 6px;
    background: repeating-linear-gradient(90deg, #f2f5f8 0 18px, #c9d0d8 18px 20px);
    box-shadow: 0 2px 0 #00000080;
}
.race-lane {
    position: relative;
    height: 64px;
    background:
        repeating-linear-gradient(90deg, #ffffff06 0 40px, transparent 40px 80px),
        linear-gradient(180deg, #17402a, #12351f);
    border-bottom: 1px dashed #ffffff14;
}
.race-lane:nth-of-type(even) {
    background:
        repeating-linear-gradient(90deg, #ffffff06 0 40px, transparent 40px 80px),
        linear-gradient(180deg, #1a4630, #153a24);
}
.race-lane.mine {
    box-shadow: inset 3px 0 0 var(--lime);
}
.race-gate {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 2px;
    background: linear-gradient(90deg, #2a313c, #20262f);
    border-right: 3px solid #5b6575;
    z-index: 1;
}
.race-gate em {
    font-style: normal;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .08em;
    color: var(--lime);
}
.horse {
    position: absolute;
    left: 0;
    top: 50%;
    width: 84px;
    height: 56px;
    margin-top: -30px;
    z-index: 2;
    will-change: transform;
}
.horse svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 3px 2px #000b);
}
.horse .coat { fill: #7a4b2b; }
.horse .dark { fill: #3b2414; }
.horse .legs path {
    fill: none;
    stroke: #4a2d19;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.horse .silk { fill: var(--c); }
.horse .silk-line {
    stroke: var(--c);
    stroke-width: 2.6;
    stroke-linecap: round;
}
.horse .helmet {
    stroke: #07090d;
    stroke-width: .6;
}
.horse text {
    fill: #07090d;
    font: 900 7px Inter, Segoe UI, sans-serif;
}
.horse .legs-b { opacity: 0; }
.horse.running .legs-a { animation: gallop-a .28s steps(1) infinite; }
.horse.running .legs-b { animation: gallop-b .28s steps(1) infinite; }
.horse.running svg { animation: horse-bob .28s ease-in-out infinite; }
.horse .dust {
    position: absolute;
    left: -4px;
    bottom: 2px;
    width: 16px;
    height: 7px;
    border-radius: 50%;
    background: #d9c79e;
    opacity: 0;
}
.horse.running .dust { animation: horse-dust .42s linear infinite; }
.race-finish {
    position: absolute;
    top: 60px;
    bottom: 6px;
    left: 93%;
    width: 10px;
    background: repeating-conic-gradient(#f4f7fb 0 25%, #07090d 0 50%) 0 0 / 10px 10px;
    box-shadow: 0 0 12px #ffffff40;
    z-index: 1;
}
/* Quarter poles: a sense of distance as the field passes them. */
.race-pole {
    position: absolute;
    top: 60px;
    bottom: 6px;
    width: 2px;
    background: repeating-linear-gradient(180deg, #ffffff38 0 10px, transparent 10px 18px);
    z-index: 1;
}
.race-pole i {
    position: absolute;
    top: -2px;
    left: 4px;
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff70;
}
.race-pole.q1 { left: calc(48px + (93% - 132px) * .25); }
.race-pole.q2 { left: calc(48px + (93% - 132px) * .5); }
.race-pole.q3 { left: calc(48px + (93% - 132px) * .75); }
.race-banner.settled {
    animation: none;
}
.race-countdown {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    z-index: 4;
    font-size: clamp(56px, 10vw, 120px);
    font-weight: 900;
    color: var(--white);
    text-shadow: 0 6px 30px #000;
    pointer-events: none;
}
.race-banner {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%, -50%);
    z-index: 4;
    padding: 14px 24px;
    background: #07090de6;
    border: 2px solid var(--c);
    box-shadow: 0 0 40px #00000099;
    color: var(--c);
    font-size: clamp(18px, 3vw, 30px);
    font-weight: 900;
    letter-spacing: .04em;
    white-space: nowrap;
    animation: race-banner-in .4s ease-out;
}
.race-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}
.race-foot .ghost {
    padding: 8px 14px;
    font-size: 11px;
    letter-spacing: .1em;
    cursor: pointer;
}
.race-foot .ghost:disabled {
    opacity: .4;
    cursor: default;
}
@keyframes gallop-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes gallop-b { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes horse-bob { 50% { transform: translateY(-2px); } }
@keyframes horse-dust {
    from { transform: translateX(0) scale(.5); opacity: .55; }
    to { transform: translateX(-26px) scale(1.4); opacity: 0; }
}
@keyframes race-banner-in {
    from { transform: translate(-50%, -50%) scale(.7); opacity: 0; }
}
/* The race itself is the content, so it always runs; only the decoration stops for reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .horse.running .legs-a, .horse.running .legs-b, .horse.running svg, .horse.running .dust, .race-banner { animation: none; }
}

/* Horse picker: number in the horse colour. */
.choice-picker.horses {
    grid-template-columns: repeat(3, 1fr);
}
.choice-picker.horses span i {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    background: var(--c);
    color: #07090d;
    font-style: normal;
}
.choice-picker.horses span small {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    font-weight: 600;
}
.choice-picker.horses input:checked + span {
    background: #10141b;
    border-color: var(--c);
    color: var(--white);
    box-shadow: inset 0 0 0 2px var(--c);
}
.choice-picker.horses.compact {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}
.choice-picker.horses.compact span {
    padding: 8px 0;
}

/* Results after the race. */
.play-shell .race-results {
    padding: 30px 0 10px;
}
.race-board-title {
    margin-top: 34px;
}
.race-results .row.race-places-head,
.race-results .row.race-place-row {
    grid-template-columns: 60px minmax(0, 1fr) 60px 110px;
}
.race-results .row.race-bet-head,
.race-results .row.race-bet-row {
    grid-template-columns: 44px minmax(0, 1fr) 60px 90px 110px;
}
.race-places-head,
.race-bet-head {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    padding-top: 12px;
    padding-bottom: 12px;
}
.race-results strong {
    text-align: right;
}
.race-places-head strong,
.race-bet-head strong {
    font-weight: 400;
}
.race-results .place {
    font-weight: 800;
    color: var(--muted);
}
.race-place-row.won,
.race-place-row.won .place,
.race-bet-row.won .place {
    color: var(--lime);
}
.race-place-row.won {
    background: #c8ff350a;
}
.race-results .badge {
    margin-right: 6px;
}
.race-bet-row.mine {
    background: #c8ff350d;
    box-shadow: inset 3px 0 0 var(--lime);
}

@media (max-width: 760px) {
    .race-board {
        flex-wrap: wrap;
    }
    .race-board li span {
        display: none;
    }
    .race-board li {
        padding: 4px;
    }
    .race-stands {
        height: 34px;
    }
    .race-lane {
        height: 42px;
    }
    .race-pole {
        top: 40px;
    }
    .race-pole i {
        display: none;
    }
    .race-gate {
        width: 28px;
    }
    .race-gate b {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    .race-gate em {
        display: none;
    }
    .horse {
        width: 46px;
        height: 31px;
        margin-top: -17px;
    }
    .race-finish {
        top: 40px;
        left: 91%;
        width: 7px;
        background-size: 7px 7px;
    }
    .race-foot {
        flex-direction: column;
        align-items: flex-start;
    }
    .race-results .row.race-places-head,
    .race-results .row.race-place-row {
        grid-template-columns: 40px minmax(0, 1fr) 40px 80px;
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .race-results .row.race-bet-head,
    .race-results .row.race-bet-row {
        grid-template-columns: 22px minmax(0, 1fr) 36px 52px 70px;
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 13px;
    }
    .race-results .row strong {
        grid-column: auto;
    }
    .race-places-head,
    .race-bet-head {
        font-size: 8px;
        letter-spacing: .06em;
    }
    .race-bet-row b {
        white-space: nowrap;
    }
}


/* ---------- Social rewards ---------- */
.social-stats {
    grid-template-columns: repeat(3, 1fr);
}
.social-layout {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
    gap: 22px;
    margin: 26px clamp(22px, 6vw, 100px) 0;
    align-items: start;
}
.social-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 26px;
    min-width: 0;
}
.social-panel h2 {
    margin: 8px 0 16px;
}
.requirements,
.social-rules {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    gap: 8px;
}
.requirements li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: #0b0e13;
}
.requirements i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    font-style: normal;
    font-weight: 900;
    background: #ff6f7d26;
    color: #ff7b88;
}
.requirements li.met i {
    background: #c8ff3526;
    color: var(--lime);
}
.requirements span {
    display: grid;
    gap: 2px;
}
.requirements small {
    color: var(--muted);
    overflow-wrap: anywhere;
}
.social-connect {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 6px;
}
.social-copy {
    color: var(--muted);
    margin: 0 0 10px;
}
.social-contract {
    display: block;
    padding: 10px 12px;
    background: #0b0e13;
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}
.social-intent {
    display: block;
    margin-top: 10px;
    text-align: center;
}
.social-submit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.social-submit button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.social-rules {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.social-rules li {
    padding-left: 14px;
    position: relative;
}
.social-rules li:before {
    content: "";
    position: absolute;
    left: 0;
    top: .65em;
    width: 5px;
    height: 5px;
    background: var(--lime);
}
.social-rules b {
    color: var(--white);
}
.social-board .row.social-board-row,
.social-board .row.social-board-head {
    grid-template-columns: 34px minmax(0, 1fr) 54px 80px 96px;
}
.social-board-head {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    padding-top: 12px;
    padding-bottom: 12px;
}
.social-board strong {
    text-align: right;
}
.social-board-head strong {
    font-weight: 400;
}
.social-board-row .place {
    font-weight: 800;
    color: var(--lime);
}
.social-board-row.removed {
    opacity: .55;
}
.social-board-row.removed .place {
    color: var(--muted);
}
.social-board-row .warn {
    color: #ffad4d;
}
.social-board-row.mine,
.row.mine-row {
    background: #c8ff350d;
    box-shadow: inset 3px 0 0 var(--lime);
}
.investor-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.social-settings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 18px;
    align-items: end;
}
.social-settings .check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 13px;
}
.social-settings .check input {
    width: auto;
}
.social-settings button {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 8px;
}
@media (max-width: 900px) {
    .social-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .social-stats {
        grid-template-columns: 1fr;
    }
    .social-board .row.social-board-row,
    .social-board .row.social-board-head {
        grid-template-columns: 22px minmax(0, 1fr) 36px 50px 64px;
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 13px;
    }
    .social-board .row strong {
        grid-column: auto;
    }
    .social-board-head {
        font-size: 8px;
        letter-spacing: .06em;
    }
    .social-panel {
        padding: 20px 16px;
    }
}


/* ---------- Operator console: sections, reports, lists ---------- */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}
.admin-nav a {
    padding: 9px 14px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
}
.admin-nav a:hover {
    color: var(--white);
    border-color: #4a5462;
}
.admin-nav a.active {
    background: var(--lime);
    border-color: var(--lime);
    color: #07090d;
}
.panel-link {
    display: inline-block;
    margin-top: 14px;
    padding: 9px 14px;
    font-size: 11px;
    letter-spacing: .1em;
    text-decoration: none;
}
.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0;
}
.player-wallet {
    font-size: clamp(28px, 4vw, 48px);
}
.admin-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
}
.admin-search .ghost {
    padding: 12px 16px;
    text-decoration: none;
}
.report-table {
    border: 1px solid var(--line);
}
.report-row {
    display: grid;
    grid-template-columns: 110px 54px 64px repeat(3, minmax(0, 1fr)) repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    color: var(--white);
}
.report-row:last-child {
    border-bottom: 0;
}
.report-row.head {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    background: #0b0e13;
}
.report-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.report-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}
.report-row a {
    color: var(--lime);
    text-decoration: none;
}
.players-table .report-row {
    grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) 60px minmax(0, 1.2fr);
}
.money-table .report-row {
    grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 140px;
}
.money-table .report-row > span:last-child {
    text-align: right;
}
a.report-row.link-row {
    color: var(--white);
}
a.report-row.link-row:hover {
    background: #10141a;
}
.admin-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 13px;
}
.admin-pager a {
    justify-self: start;
    padding: 10px 14px;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: .1em;
}
.admin-pager a:last-child {
    justify-self: end;
}
@media (max-width: 900px) {
    .report-row .opt,
    .report-row.head .opt {
        display: none;
    }
    .report-row {
        grid-template-columns: 82px 40px 50px repeat(3, minmax(0, 1fr));
    }
    .players-table .report-row {
        grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    }
    .money-table .report-row {
        grid-template-columns: 86px minmax(0, 1.2fr) minmax(0, 1fr) 90px;
    }
}
@media (max-width: 520px) {
    .report-row {
        gap: 6px;
        padding: 10px;
        font-size: 12px;
    }
    .report-row.head {
        font-size: 8px;
        letter-spacing: .06em;
    }
    .admin-search {
        grid-template-columns: 1fr auto;
    }
    .admin-search .ghost {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* Long wallet addresses and transaction hashes wrap instead of widening the page on phones. */
.row b,
.row small a {
    overflow-wrap: anywhere;
}

/* The live pot number sits inside the big amount; don't style it like the small caption below it. */
.pool-display strong [data-live-pot] {
    display: inline;
    color: inherit;
    font-size: inherit;
}

/* "Check this result" in the fairness box. */
.verify {
    margin-top: 14px;
}
.verify .ghost {
    padding: 9px 14px;
    font-size: 11px;
    letter-spacing: .1em;
    cursor: pointer;
}
.verify .ghost:disabled {
    opacity: .5;
}
.verify ul {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.verify li.ok { color: var(--lime); }
.verify li.bad { color: #ff7b88; }
.verify li.info { color: var(--white); }


/* Small action button inside an admin list cell. */
.inline-action {
    display: inline-block;
    margin-left: 8px;
}
.inline-action .ghost {
    padding: 5px 9px;
    font-size: 10px;
    letter-spacing: .08em;
    cursor: pointer;
}

/* Wallet: deposit progress messages and transfers still confirming on chain. */
.deposit-status {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left-width: 3px;
    background: #0b0e13;
    font-size: 13px;
    line-height: 1.5;
}
.deposit-status[hidden] {
    display: none;
}
.deposit-status b {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.deposit-status span {
    color: var(--muted);
}
.deposit-status a {
    color: var(--lime);
    font-family: monospace;
    font-size: 12px;
    text-decoration: none;
}
.deposit-status a:hover {
    text-decoration: underline;
}
.deposit-status.is-info {
    border-left-color: #6aa9ff;
}
.deposit-status.is-info b {
    color: #9cc6ff;
}
.deposit-status.is-ok {
    border-left-color: var(--lime);
    background: #c8ff350d;
}
.deposit-status.is-ok b {
    color: var(--lime);
}
.deposit-status.is-error {
    border-left-color: #ff6f7d;
    background: #ff4d600d;
}
.deposit-status.is-error b {
    color: #ff7b88;
}
.confirming-row b {
    color: #ffd166;
}
.confirming-row a {
    color: var(--lime);
    font-family: monospace;
    text-decoration: none;
    white-space: nowrap;
}
.pulse-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffd166;
    box-shadow: 0 0 0 0 #ffd16680;
    animation: pulse-dot 1.6s ease-out infinite;
}
@keyframes pulse-dot {
    to {
        box-shadow: 0 0 0 9px #ffd16600;
    }
}
@media (prefers-reduced-motion: reduce) {
    .pulse-dot {
        animation: none;
    }
}

/* Signed-out visitors: public pages invite them to connect where a player sees a balance or an entry form. */
.guest-invite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 clamp(22px, 6vw, 100px);
    padding: 22px 25px;
    border: 1px solid #c8ff3540;
    background: #c8ff350a;
}
.guest-invite p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 60ch;
}
.guest-invite button {
    white-space: nowrap;
    flex-shrink: 0;
}
/* Outlined, so the card's "Open round" stays the main action. */
.arena-card .guest-play {
    width: 100%;
    margin-top: 12px;
    padding: 12px 20px;
    background: transparent;
    color: var(--lime);
    border: 1px solid #c8ff3580;
}
.arena-card .guest-play:hover {
    background: #c8ff3512;
    border-color: var(--lime);
}
.guest-join > p {
    color: var(--muted);
    line-height: 1.6;
}
.guest-join .entry-submit {
    width: 100%;
    margin-top: 14px;
}
.guest-join .duel-hint {
    display: block;
    margin-top: 12px;
}
.duel-actions button[data-connect] {
    white-space: nowrap;
}

/* The page shown instead of History, Funds, Rewards or Business when no wallet is connected. */
.connect-gate {
    display: grid;
    justify-items: center;
    gap: 28px;
    padding: clamp(48px, 9vw, 110px) clamp(16px, 6vw, 100px) 80px;
}
.connect-card {
    width: min(620px, 100%);
    padding: clamp(26px, 5vw, 46px);
    background: linear-gradient(145deg, #141922, #0d1015);
    border: 1px solid var(--line);
    border-top: 3px solid var(--lime);
}
.connect-card h1 {
    margin: 12px 0 14px;
    font-size: clamp(34px, 6vw, 56px);
    line-height: .95;
}
.connect-lead {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.6;
}
.connect-points {
    display: grid;
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}
.connect-points li {
    position: relative;
    padding-left: 26px;
    line-height: 1.5;
}
.connect-points li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--lime);
    font-weight: 800;
}
.connect-big {
    width: 100%;
    padding: 17px 20px;
    font-size: 15px;
}
.connect-note {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}
.connect-alt {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 26px;
}
.connect-alt span {
    width: 100%;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2em;
}
.connect-alt a {
    color: var(--lime);
    text-decoration: none;
    font-weight: 700;
}
@media (max-width: 760px) {
    .guest-invite {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Header menu. On wide screens the wrapper is invisible to layout and the links sit in the header as before;
   on phones and tablets they move into a panel that slides in from the right, with the wallet button. */
.nav-menu {
    display: contents;
}
.menu-toggle,
.menu-head,
.menu-backdrop {
    display: none;
}
header nav a[aria-current="page"] {
    color: var(--white);
}
@media (max-width: 900px) {
    /* The panel lives inside the header, so the header must sit above the backdrop (8); the wallet dialog is 10. */
    .nav {
        height: 68px;
        padding: 0 16px;
        z-index: 9;
    }
    .menu-toggle {
        display: grid;
        align-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 11px;
        background: transparent;
        border: 1px solid var(--line);
    }
    .menu-toggle span {
        display: block;
        height: 2px;
        background: var(--white);
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 9;
        display: flex;
        flex-direction: column;
        width: min(320px, 86vw);
        padding: 18px 22px 28px;
        overflow-y: auto;
        background: var(--panel);
        border-left: 1px solid var(--line);
        box-shadow: -24px 0 60px #0009;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .25s ease, visibility 0s linear .25s;
    }
    .nav-menu.open {
        transform: none;
        visibility: visible;
        transition: transform .25s ease;
    }
    .menu-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }
    .menu-close {
        width: 40px;
        height: 40px;
        background: transparent;
        color: var(--white);
        font-size: 28px;
        line-height: 1;
    }
    .nav-menu nav {
        display: flex;
        flex-direction: column;
        gap: 0;
        order: 0;
        width: auto;
    }
    .nav-menu nav a {
        padding: 15px 4px;
        border-bottom: 1px solid var(--line);
        color: var(--white);
        font-size: 17px;
        font-weight: 700;
    }
    .nav-menu nav a[aria-current="page"] {
        color: var(--lime);
        box-shadow: inset 3px 0 var(--lime);
        padding-left: 14px;
    }
    .nav-menu .nav-action {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: auto;
        padding-top: 26px;
    }
    .nav-menu .nav-action .wallet {
        display: block;
        text-align: center;
    }
    .nav-menu .nav-action .connect,
    .nav-menu .nav-action .ghost {
        width: 100%;
        padding: 15px 20px;
    }
    .menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 8;
        background: #000a;
    }
    body.menu-open {
        overflow: hidden;
    }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
    .nav-menu,
    .nav-menu.open {
        transition: none;
    }
}

/* GM Week: when a table stops taking players, and the tables already under way. */
.entry-deadline {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 2px solid var(--lime);
    background: #c8ff350a;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.entry-deadline b {
    display: block;
    color: var(--lime);
    font-size: 10px;
    letter-spacing: .16em;
}
.entry-deadline time {
    color: var(--white);
}
.gm-running .guide-note {
    margin: 0 0 14px;
    color: var(--muted);
}
.gm-running-row.mine b {
    color: var(--lime);
}

/* Buy $GM: the live quote under the ETH amount, and the price, fee and slippage lines. */
.buy-form button {
    width: 100%;
}
.buy-form button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.buy-quote {
    display: grid;
    padding: 18px;
    border: 1px solid #c8ff3540;
    background: #c8ff350d;
}
.buy-quote small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .15em;
}
.buy-quote strong {
    font-size: clamp(26px, 7vw, 40px);
    line-height: 1.15;
}
.buy-quote span {
    color: var(--lime);
    font-size: 11px;
    letter-spacing: .12em;
}
.buy-facts {
    display: grid;
    gap: 6px;
    margin: 16px 0 20px;
    font-size: 13px;
}
.buy-facts div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.buy-facts dt {
    color: var(--muted);
}
.buy-facts dd {
    margin: 0;
    text-align: right;
}
.buy-watch {
    width: 100%;
    margin-top: 12px;
    cursor: pointer;
}
.buy-alt {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.buy-alt a,
.fund-card .balance-help a,
.duel-hint a {
    color: var(--lime);
}

/* Admin social pool: the "count now" button under the fee figures. */
.count-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 16px;
}
.count-now button {
    cursor: pointer;
}
.count-now small {
    flex: 1 1 220px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
