/* ==========================================================================
   TABtooch — components. The vocabulary is print: stamps, ledgers with dotted
   leaders, ruled cards and a perforated betting docket.
   ========================================================================== */

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.6rem 1.15rem;
    font-size: var(--t-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background-color var(--speed) var(--ease),
                color var(--speed) var(--ease),
                border-color var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--brand-fill);
    border-color: var(--brand-fill);
    color: var(--on-brand);
}

.btn--primary:hover {
    background: var(--brand-fill-hover);
    border-color: var(--brand-fill-hover);
    color: var(--on-brand);
}

.btn--fg {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

.btn--fg:hover {
    background: var(--fg-2);
    border-color: var(--fg-2);
    color: var(--bg);
}

.btn--outline {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--fg);
}

.btn--outline:hover {
    border-color: var(--fg);
    background: var(--surface);
    color: var(--fg);
}

/* Ghost buttons sitting on a dark band need their own light treatment. */
.on-deep .btn--outline {
    border-color: var(--deep-line);
    color: var(--deep-fg);
}

.on-deep .btn--outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--deep-fg);
    color: #fff;
}

.btn--sm {
    min-height: 2.25rem;
    padding: 0.35rem 0.8rem;
    font-size: var(--t-xs);
}

.btn--lg {
    min-height: 3.25rem;
    padding: 0.85rem 1.6rem;
    font-size: var(--t-base);
}

.btn--block {
    width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

/* A quiet inline link with an arrow — used for "see all" affordances. */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--t-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-bottom: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
    padding-bottom: 1px;
}

.link-more:hover {
    border-bottom-color: var(--brand);
}

.link-more .icon {
    transition: transform var(--speed) var(--ease);
}

.link-more:hover .icon {
    transform: translateX(3px);
}

/* --------------------------------------------------------------- stamps -- */
/* Signature element: a rotated, double-ruled stamp. Repeats across tags,
   the 18+ mark, the licence plate and section eyebrows. */

.stamp {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
    border: 1px solid var(--brand);
    box-shadow: 0 0 0 1px var(--bg), 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent);
    border-radius: 2px;
    background: var(--brand-tint);
}

.stamp--tilt {
    transform: rotate(-1.6deg);
}


.stamp--tote {
    color: var(--tote);
    border-color: var(--tote);
    background: var(--tote-tint);
    box-shadow: 0 0 0 1px var(--bg), 0 0 0 2px color-mix(in srgb, var(--tote) 28%, transparent);
}

.stamp--deep {
    color: var(--deep-fg);
    border-color: var(--deep-line);
    background: var(--deep-2);
    box-shadow: none;
}

/* ---------------------------------------------------------------- cards -- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s-5);
    box-shadow: var(--shadow-1);
}

.card--flush {
    padding: 0;
    overflow: hidden;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2) var(--s-4);
    padding: var(--s-3) var(--s-4);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
}

.card__title .icon {
    color: var(--brand);
    font-size: 1.2em;
}

.card__meta {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-soft);
}

.card__foot {
    padding: var(--s-3) var(--s-4);
    border-top: 1px dotted var(--line-strong);
    font-size: var(--t-sm);
    color: var(--fg-soft);
}

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

.price {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 4.5rem;
    min-height: 3rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    padding: 0.4rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--fg);
    transition: background-color var(--speed) var(--ease),
                border-color var(--speed) var(--ease),
                color var(--speed) var(--ease);
}

.price__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fg-soft);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--speed) var(--ease);
}

.price__value {
    font-family: var(--font-mono);
    font-size: var(--t-md);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.price__move {
    position: absolute;
    top: 0.25rem;
    right: 0.35rem;
    font-size: 0.55rem;
    line-height: 1;
}

.price--in .price__move {
    color: var(--tote);
}

.price--out .price__move {
    color: var(--danger);
}

.price:hover {
    border-color: var(--fg);
    background: var(--surface-2);
}

.price[aria-pressed="true"] {
    background: var(--brand-fill);
    border-color: var(--brand);
    color: var(--on-brand);
}

.price[aria-pressed="true"] .price__label,
.price[aria-pressed="true"] .price__move {
    color: rgba(255, 255, 255, 0.82);
}

.price--void {
    background: var(--bg-sunk);
    border-style: dashed;
    color: var(--fg-soft);
    cursor: default;
}

.price.is-flash {
    animation: price-flash 420ms var(--ease);
}

@keyframes price-flash {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent);
    }
    100% {
        box-shadow: 0 0 0 12px transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .price.is-flash {
        animation: none;
    }
}

/* --------------------------------------------------------------- ledger -- */
/* The sports board. A fixture row with dotted leaders, like a form guide. */

.ledger {
    display: grid;
}

/* minmax(0, 1fr) rather than an auto track: an auto track is sized from the
   max-content width of the longest fixture name, which pushes the row wider
   than the card and gets it clipped on a small phone. */
.ledger__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-4);
    border-bottom: 1px solid var(--line);
}

.ledger__row:last-child {
    border-bottom: 0;
}

.ledger__row:nth-child(even) {
    background: var(--surface-stripe);
}

/* On a phone the fixture name takes the first line to itself and the time and
   market chip drop underneath; a single row cannot hold all three without
   crushing the name to one word per line. */
.ledger__event {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s-3);
    row-gap: var(--s-2);
    min-width: 0;
}

.ledger__teams {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ledger__v {
    font-family: var(--font-body);
    font-size: var(--t-sm);
    font-style: italic;
    font-weight: 400;
    color: var(--fg-soft);
}

/* Signature: the dotted leader that pulls the eye to the time or price. There
   is no room for it on the narrowest phones, so it starts hidden. */
.ledger__event::after {
    content: "";
    display: none;
    flex: 1 1 auto;
    min-width: 1.5rem;
    align-self: center;
    border-bottom: 1px dotted var(--line-strong);
    transform: translateY(-0.15em);
}

@media (min-width: 480px) {
    .ledger__event::after {
        display: block;
        order: 1;
    }

    .ledger__more {
        order: 2;
    }
}

.ledger__time {
    flex: none;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.04em;
    color: var(--fg-soft);
    white-space: nowrap;
}

.ledger__markets {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
    min-width: 0;
}

.ledger__prices {
    display: flex;
    gap: var(--s-2);
    min-width: 0;
}

/* The market name only shows when all three sets are stacked — that is, when
   JavaScript is unavailable and the tabs cannot switch between them. */
.ledger__market-label {
    display: none;
    align-self: center;
    flex: none;
    width: 3.5rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-soft);
}

/* The fixture name on a board row links to its own market book. */
.ledger__link {
    flex: 1 1 100%;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    border-bottom: 1px solid transparent;
    transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.ledger__link:hover,
.ledger__link:focus-visible {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.ledger__link:hover .ledger__v {
    color: var(--brand);
}

/* The count of extra markets, so the route to the event page is stated rather
   than left to a hover. */
.ledger__more {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    min-height: 24px;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--brand);
    background: var(--brand-tint);
    border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
    border-radius: var(--radius-pill);
    transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.ledger__more-icon {
    font-size: 0.9em;
    transition: transform var(--speed) var(--ease);
}

.ledger__more:hover,
.ledger__more:focus-visible {
    color: var(--on-brand);
    background: var(--brand-fill);
    border-color: var(--brand-fill);
}

.ledger__more:hover .ledger__more-icon {
    transform: translateX(2px);
}

/* ------------------------------------------------- event page: markets --- */

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--s-2);
    padding: var(--s-4);
}

.market-grid .price {
    flex: none;
    min-height: 3.25rem;
}

.market-grid .price__label {
    white-space: normal;
    overflow: visible;
    line-height: 1.25;
}

.event-more {
    margin-top: var(--s-7);
}

.event-more__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-2) var(--s-4);
    padding-bottom: var(--s-3);
    margin-bottom: var(--s-4);
    border-bottom: 3px double var(--line-strong);
}

/* Rail of other fixtures in the same sport. */
.event-rail {
    display: grid;
    gap: 1px;
    background: var(--bg);
    border-radius: var(--radius);
}

.event-rail__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-2) var(--s-4);
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    color: var(--fg);
    text-decoration: none;
    transition: background-color var(--speed) var(--ease);
}

.event-rail__item:hover {
    background: var(--surface-2);
    color: var(--fg);
}

.event-rail__teams {
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.event-rail__meta {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fg-soft);
}

/* ---------------------------------------------------------- market tabs -- */

.market-tabs {
    display: flex;
    gap: var(--s-1);
    padding: var(--s-2) var(--s-4) 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

.market-tabs::-webkit-scrollbar {
    display: none;
}

.market-tab {
    position: relative;
    flex: none;
    padding: 0.5rem 0.9rem 0.6rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-soft);
    white-space: nowrap;
    transition: color var(--speed) var(--ease);
}

.market-tab::after {
    content: "";
    position: absolute;
    inset-inline: 0.4rem;
    bottom: -1px;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform var(--speed) var(--ease);
}

.market-tab:hover {
    color: var(--fg);
}

.market-tab[aria-selected="true"] {
    color: var(--fg);
}

.market-tab[aria-selected="true"]::after {
    transform: scaleX(1);
}


@media (min-width: 760px) {
    .ledger__row {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
        align-items: center;
        gap: var(--s-5);
    }

    /* Wide enough for one line again: name, time, chip, then the leader runs
       out to the prices. */
    .ledger__event {
        flex-wrap: nowrap;
    }

    .ledger__link {
        flex: 0 1 auto;
    }

    .ledger__event::after {
        order: 2;
    }

    .ledger__more {
        order: 1;
    }
}

/* Chip counter on the sport filters. */
.chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding-inline: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--fg-soft);
    background: var(--surface-2);
    border-radius: var(--radius-pill);
}

.chip[aria-current="true"] .chip__count {
    color: var(--bg);
    background: var(--surface);
}

/* ----------------------------------------------------------- race cards -- */

.racecard {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--fg);
    border-radius: var(--radius);
}

.racecard__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-4) var(--s-3);
    border-bottom: 1px solid var(--line);
}

.racecard__track {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
}

.racecard__track .icon {
    color: var(--brand);
    font-size: 1.25em;
}

.racecard__sub {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-soft);
}

.countdown {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--tote);
    background: var(--tote-tint);
    border: 1px solid color-mix(in srgb, var(--tote) 30%, transparent);
    border-radius: 2px;
    white-space: nowrap;
}

.countdown.is-soon {
    color: var(--gold);
    background: var(--gold-tint);
    border-color: color-mix(in srgb, var(--gold) 40%, transparent);
}

.countdown.is-done {
    color: var(--fg-soft);
    background: var(--bg-sunk);
    border-color: var(--line);
}

.racecard__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    padding: var(--s-2) var(--s-4);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.05em;
    color: var(--fg-soft);
    text-transform: uppercase;
}

.runners {
    display: grid;
    padding: var(--s-2) var(--s-4);
    margin: 0;
}

.runner {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) 0;
    border-bottom: 1px dotted var(--line);
}

.runner:last-child {
    border-bottom: 0;
}

.runner__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--bg);
    background: var(--fg);
    border-radius: 2px;
}

.runner__name {
    min-width: 0;
    font-weight: 600;
    line-height: 1.3;
}

.runner__rider {
    display: block;
    font-family: var(--font-body);
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--fg-soft);
}

.runner .price {
    flex: none;
    min-width: 4.5rem;
    min-height: 2.5rem;
}

.runner .price__label {
    display: none;
}

.racecard__foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-top: 1px dotted var(--line-strong);
    font-size: var(--t-sm);
}

/* ----------------------------------------------------------- the docket -- */
/* Bet slip. A full-width bar anchored to the bottom edge that expands upward
   into a printed docket, complete with a perforated top edge. */

.docket {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 80;
    background: var(--deep);
    color: var(--deep-fg);
    border-top: 1px solid var(--deep-line);
    box-shadow: var(--shadow-3);
}

.docket__bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    min-height: var(--docket-h);
    padding: 0.5rem var(--gutter);
    color: var(--deep-fg);
    text-align: left;
}

.docket__bar:hover {
    background: var(--deep-2);
}

.docket__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.docket__tag .icon {
    color: var(--brand);
    font-size: 1.2em;
}

.docket__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding-inline: 0.35rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--on-brand);
    background: var(--brand-fill);
    border-radius: 2px;
}

.docket__count.is-bumped {
    animation: bump 340ms var(--ease);
}

@keyframes bump {
    35% {
        transform: scale(1.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    .docket__count.is-bumped {
        animation: none;
    }
}

.docket__summary {
    display: none;
    align-items: baseline;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--deep-fg-soft);
}

.docket__summary b {
    color: #fff;
    font-weight: 600;
}

.docket__chevron {
    margin-left: auto;
    display: inline-flex;
    font-size: 1.1rem;
    transform: rotate(-90deg);
    transition: transform var(--speed) var(--ease);
}

.docket.is-open .docket__chevron {
    transform: rotate(90deg);
}

@media (min-width: 560px) {
    .docket__summary {
        display: flex;
    }
}

.docket__sheet {
    display: none;
    max-height: min(70vh, 34rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--deep-line);
    background: var(--surface);
    color: var(--fg);
}

.docket.is-open .docket__sheet {
    display: block;
}

.docket__inner {
    width: min(100% - (var(--gutter) * 2), 46rem);
    margin-inline: auto;
    padding-block: var(--s-5) var(--s-6);
}

/* Signature: perforation, so the sheet reads as a torn-off docket. */
.docket__perf {
    height: 8px;
    margin-bottom: var(--s-4);
    background-image: radial-gradient(circle at 5px 0, transparent 4px, var(--line) 4px, var(--line) 5px, transparent 5px);
    background-size: 12px 8px;
    background-repeat: repeat-x;
}

.docket__empty {
    padding: var(--s-5) 0;
    text-align: center;
    color: var(--fg-soft);
}

.docket__lines {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}

.docket-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--s-3);
    padding-bottom: var(--s-2);
    border-bottom: 1px dotted var(--line-strong);
}

.docket-line__selection {
    min-width: 0;
    font-weight: 600;
    line-height: 1.25;
}

.docket-line__event {
    display: block;
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--fg-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docket-line__odds {
    font-family: var(--font-mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.docket-line__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.95rem;
    color: var(--fg-soft);
    border: 1px solid var(--line);
    border-radius: 2px;
}

.docket-line__remove:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.docket__totals {
    display: grid;
    gap: 0.4rem;
    padding: var(--s-4);
    margin-bottom: var(--s-4);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.docket__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    font-size: var(--t-sm);
    color: var(--fg-soft);
}

.docket__row span:last-child {
    font-family: var(--font-mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}

.docket__row--total {
    padding-top: var(--s-2);
    margin-top: var(--s-1);
    border-top: 3px double var(--line-strong);
    font-size: var(--t-base);
    color: var(--fg);
    font-weight: 600;
}

.docket__row--total span:last-child {
    font-size: var(--t-md);
    color: var(--brand);
}

.docket__actions {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-3);
}

@media (min-width: 480px) {
    .docket__actions {
        grid-template-columns: 1fr auto;
    }
}

.docket__note {
    font-size: var(--t-xs);
    color: var(--fg-soft);
    line-height: 1.5;
}

/* ---------------------------------------------------------------- forms -- */

.field {
    display: grid;
    gap: 0.35rem;
    margin-bottom: var(--s-4);
}

.field > label {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--fg-2);
}

.field__hint {
    font-size: var(--t-xs);
    color: var(--fg-soft);
    line-height: 1.5;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 2.9rem;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--fg);
    transition: border-color var(--speed) var(--ease),
                box-shadow var(--speed) var(--ease);
}

.textarea {
    min-height: 8rem;
    resize: vertical;
}

.select {
    appearance: none;
    padding-right: 2.25rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--fg-soft) 50%),
                      linear-gradient(135deg, var(--fg-soft) 50%, transparent 50%);
    background-position: right 1.05rem center, right 0.8rem center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--fg-faint);
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.field__error {
    display: none;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--danger);
}

.field.is-invalid .field__error {
    display: block;
}

.field-row {
    display: grid;
    gap: 0 var(--s-4);
}

@media (min-width: 560px) {
    .field-row {
        grid-template-columns: 1fr 1fr;
    }
}

.fieldset {
    padding: var(--s-4);
    margin-bottom: var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-stripe);
}

.fieldset > legend {
    padding-inline: 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-soft);
}

.checkrow {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
    margin-bottom: var(--s-3);
    font-size: var(--t-sm);
    line-height: 1.5;
    cursor: pointer;
}

.checkrow input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.checkrow.is-invalid {
    color: var(--danger);
}

.form-note {
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-4);
    font-size: var(--t-sm);
    line-height: 1.6;
    background: var(--surface-2);
    border-left: 3px solid var(--line-strong);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.form-alert {
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-4);
    font-size: var(--t-sm);
    font-weight: 500;
    border-radius: var(--radius);
    border-left: 3px solid;
}

.form-alert--error {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    border-color: var(--danger);
}

.form-alert--ok {
    color: var(--tote);
    background: var(--tote-tint);
    border-color: var(--tote);
}

/* ----------------------------------------------------------- notices ----- */

.notice {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-4);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: var(--t-sm);
    line-height: 1.65;
}

.notice .icon {
    flex: none;
    font-size: 1.3em;
    color: var(--brand);
    margin-top: 0.1rem;
}

.notice--calm {
    border-left-color: var(--tote);
}

.notice--calm .icon {
    color: var(--tote);
}

/* ------------------------------------------------------------- rg strip -- */

.rg-strip {
    background: var(--bg-sunk);
    border-bottom: 1px solid var(--line-strong);
}

.rg-strip__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-4);
    padding-block: var(--s-3);
}

.rg-strip__msg {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    font-style: italic;
    color: var(--fg);
    transition: opacity var(--speed) var(--ease);
}

.rg-strip__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-4);
    margin-left: auto;
    font-size: var(--t-sm);
}

/* Help, deposit limits and BetStop keep a 24px target — WCAG 2.2 AA 2.5.8. */
.rg-strip__links a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

/* --------------------------------------------------------------- chips --- */

.chiprow {
    display: flex;
    gap: var(--s-2);
    overflow-x: auto;
    padding-bottom: var(--s-2);
    margin-bottom: var(--s-5);
    scrollbar-width: thin;
}

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.9rem;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--fg-2);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--speed) var(--ease),
                color var(--speed) var(--ease),
                border-color var(--speed) var(--ease);
}

.chip .icon {
    color: var(--brand);
    font-size: 1.15em;
}

.chip:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.chip[aria-current="true"] {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

.chip[aria-current="true"] .icon {
    color: var(--surface-2);
}

/* -------------------------------------------------------------- ticker --- */

.ticker {
    display: flex;
    align-items: stretch;
    background: var(--deep-2);
    color: var(--deep-fg);
    border-block: 1px solid var(--deep-line);
    overflow: hidden;
}

.ticker__label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem var(--s-4);
    background: var(--brand-fill);
    color: var(--on-brand);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ticker__viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
}

.ticker__track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: ticker-scroll 46s linear infinite;
}

.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker__track {
        animation: none;
    }

    .ticker__viewport {
        overflow-x: auto;
    }
}

.ticker__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem var(--s-4);
    color: var(--deep-fg);
    font-size: var(--t-sm);
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid var(--deep-line);
}

.ticker__item .icon {
    color: var(--gold);
}

.ticker__item b {
    font-weight: 600;
}

.ticker__item:hover {
    background: var(--brand-deep);
    color: #fff;
}

.ticker__item .countdown {
    color: var(--gold);
    background: transparent;
    border-color: var(--deep-line);
    padding: 0.1rem 0.35rem;
}

/* ------------------------------------------------------------- carousel -- */

.carousel {
    position: relative;
}

.carousel__viewport {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
}

.carousel__track {
    display: flex;
    transition: transform var(--speed-slow) var(--ease);
}

.carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.carousel__controls {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-3);
}

.carousel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.05rem;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
}

.carousel__btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.carousel__btn--prev .icon {
    transform: rotate(180deg);
}

.carousel__dots {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

/* The visible mark is a 4px bar, but the button itself keeps a 24px hit area. */
.carousel__dot {
    display: flex;
    align-items: center;
    width: 2rem;
    height: 24px;
    padding: 0;
    background: none;
}

.carousel__dot::before {
    content: "";
    width: 100%;
    height: 4px;
    background: var(--line-strong);
    border-radius: 2px;
    transition: background-color var(--speed) var(--ease);
}

.carousel__dot[aria-current="true"]::before {
    background: var(--brand);
}

.carousel__dot:hover::before {
    background: var(--fg-soft);
}

/* ------------------------------------------------------------------ faq -- */

.faq {
    border-top: 1px solid var(--line-strong);
}

.faq__item {
    border-bottom: 1px solid var(--line);
}

.faq__item > summary {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    padding: var(--s-4) 0;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq__item > summary::-webkit-details-marker {
    display: none;
}

.faq__item > summary::after {
    content: "+";
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--brand);
    transition: transform var(--speed) var(--ease);
}

.faq__item[open] > summary::after {
    content: "–";
}

.faq__item > summary:hover {
    color: var(--brand);
}

.faq__n {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--fg-soft);
}

.faq__answer {
    padding: 0 0 var(--s-4) 0;
    max-width: 72ch;
    color: var(--fg-2);
}

.faq__answer p + p {
    margin-top: var(--s-3);
}

/* --------------------------------------------------------------- prose --- */

.prose {
    max-width: 74ch;
}

.prose > * + * {
    margin-top: var(--s-4);
}

.prose h2 {
    margin-top: var(--s-6);
    font-size: var(--t-lg);
}

.prose h3 {
    margin-top: var(--s-5);
    font-size: var(--t-md);
}

.prose ul,
.prose ol {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.35rem;
}

.prose ol {
    list-style: decimal;
}

/* Signature: the bullet is a small ruled square, not a dot. */
.prose ul li {
    position: relative;
}

.prose ul li::before {
    content: "";
    position: absolute;
    left: -1.15rem;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border: 1px solid var(--brand);
    background: var(--brand-tint);
}

.prose ol li {
    padding-left: 0.25rem;
}

/* --------------------------------------------------------------- tables -- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.data-table {
    min-width: 30rem;
    font-size: var(--t-sm);
}

.data-table th,
.data-table td {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table thead th {
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-soft);
    border-bottom: 1px solid var(--line-strong);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.05rem 0.3rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 2px;
}

/* ------------------------------------------------------- cookie & gate --- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: var(--gutter);
    background: rgba(6, 3, 10, 0.9);
    overflow-y: auto;
}

.gate {
    width: min(30rem, 100%);
    padding: var(--s-6) var(--s-5);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-top: 4px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
}

.gate__mark {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--s-4);
}

.gate__mark b {
    font-weight: 600;
    font-style: italic;
    color: var(--brand);
}

.gate__age {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    margin-bottom: var(--s-4);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent);
}

.gate h2 {
    font-size: var(--t-xl);
    margin-bottom: var(--s-3);
}

.gate p {
    color: var(--fg-2);
    margin-bottom: var(--s-4);
}

.gate__actions {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}

@media (min-width: 420px) {
    .gate__actions {
        grid-template-columns: 1fr 1fr;
    }
}

.gate__deny {
    padding: var(--s-3);
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    border-radius: var(--radius);
    font-size: var(--t-sm);
    color: var(--danger);
}

.gate__fine {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--t-sm);
    color: var(--fg-soft);
    margin: 0;
}

.cookie {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 150;
    background: var(--surface);
    border-top: 3px double var(--line-strong);
    box-shadow: var(--shadow-3);
    max-height: 85vh;
    overflow-y: auto;
}

.cookie__inner {
    width: min(100% - (var(--gutter) * 2), var(--shell));
    margin-inline: auto;
    display: grid;
    gap: var(--s-4);
    padding-block: var(--s-5);
}

.cookie h2 {
    font-size: var(--t-lg);
}

.cookie p {
    max-width: 72ch;
    font-size: var(--t-sm);
    color: var(--fg-2);
}

.cookie__cats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
}

.cookie__cats .checkrow {
    margin-bottom: 0;
}

.cookie__actions {
    display: grid;
    gap: var(--s-2);
}

@media (min-width: 720px) {
    .cookie__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .cookie__actions {
        grid-auto-flow: column;
        align-items: center;
    }
}

/* ------------------------------------------------------- back to top ----- */

.to-top {
    position: fixed;
    right: var(--gutter);
    bottom: calc(var(--docket-h) + var(--s-4));
    z-index: 70;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.1rem;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.to-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.to-top:hover {
    color: var(--brand);
    border-color: var(--brand);
}
