/*
THESIS: интерфейс — вечерний салон ЛиАЗа на маршруте №7. Отказываемся от «казино»: никаких неоновых градиентов,
        стеклянных карточек и эмодзи; главным объектом становится бумажный билет.
OWN-WORLD: тёплый асфальт #121110, плоские таблички жёлтый ЛиАЗ / сигнальный оранжевый / талонный розовый /
        троллейбусная бирюза / салатовый; иллюстрации тушью с растровым зерном, кладутся multiply на цвет;
        билеты с перфорацией; Tektur (узкий, табло) + Golos Text.
STORY: игрок видит, что такое «счастливый билет», пробует оторвать талон, видит рейс и джекпот, садится в автобус.
FIRST VIEWPORT: слева меню-маршрут с остановками-иллюстрациями; справа гигантский пробный талон с кондукторшей
        на корешке и кнопкой «Оторвать»; под ним жёлтая плашка рейса с ЛиАЗом и оранжевая — джекпот.
FORM: комбинация утверждённых эскизов A (меню, плашки), B (талон-герой), C (автобус сверху в салоне).
*/

:root {
    --asphalt: #121110;
    --depot: #1C1A18;
    --depot-2: #262320;
    --depot-3: #322E2A;
    --ink: #0B0A09;
    --paper: #F4EEE2;
    --paper-2: #ADA598;
    --line: rgba(244, 238, 226, 0.09);
    --line-2: rgba(244, 238, 226, 0.18);

    --yellow: #F5C21B;
    --orange: #F0562E;
    --pink: #F28CB8;
    --teal: #22BFA9;
    --lime: #B9DD4A;
    --upholstery: #CFC7B8;
    --ticket: #F1E8D4;

    --display: "Tektur", "Arial Narrow", sans-serif;
    --body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--paper);
    background: var(--asphalt);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

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

button { font: inherit; color: inherit; }

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
    border-radius: 6px;
}

code {
    font-family: var(--mono);
    font-size: 0.82em;
    word-break: break-all;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--paper-2); }
.small { font-size: 0.85rem; }
.positive { color: var(--lime); }
.negative { color: var(--orange); }
.accent { color: var(--yellow); }

/* Иллюстрация тушью: белый фон растворяется в цвете подложки */
.ink-art {
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.25) brightness(1.06);
    pointer-events: none;
    user-select: none;
}

/* ================= APP SHELL ================= */

.app {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
    min-height: 100vh;
}

.rail {
    position: sticky;
    top: 14px;
    height: calc(100vh - 28px);
    min-height: 560px;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 14px;
    background: var(--depot);
    border-radius: var(--r-lg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.brand-mark {
    width: 40px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    background: var(--yellow);
    color: var(--ink);
    font: 800 1.45rem/1 var(--display);
    transform: rotate(-7deg);
    --hole: 3.5px;
    -webkit-mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / 9px 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / 9px 51% repeat-x;
    mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / 9px 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / 9px 51% repeat-x;
    transition: transform 0.5s var(--ease-snap);
}

.brand:hover .brand-mark { transform: rotate(5deg) scale(1.06); }

.brand-name {
    font: 800 1.3rem/0.92 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.route {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 6px;
    margin-top: 44px;
}

.route::before {
    content: "";
    position: absolute;
    left: 32px;
    top: 28px;
    bottom: 28px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--line-2) 0 5px, transparent 5px 11px);
}

.stop {
    --tile: var(--yellow);
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 10px 7px 9px;
    border-radius: 16px;
    color: var(--paper-2);
    font-weight: 500;
    font-size: 1.02rem;
    transition: color 0.2s, background-color 0.2s;
}

.stop[data-tone="pink"] { --tile: var(--pink); }
.stop[data-tone="orange"] { --tile: var(--orange); }
.stop[data-tone="teal"] { --tile: var(--teal); }
.stop[data-tone="lime"] { --tile: var(--lime); }

.stop-art {
    position: relative;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 14px;
    background: var(--tile);
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 0 0 4px var(--depot);
    transition: transform 0.45s var(--ease-snap), box-shadow 0.2s;
}

.stop-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.35) brightness(1.08);
    transition: transform 0.45s var(--ease-out);
}

.stop:hover { color: var(--paper); }
.stop:hover .stop-art { transform: rotate(-8deg) scale(1.06); }
.stop:hover .stop-art img { transform: scale(1.14) translateY(-1px); }

.stop.is-active {
    color: var(--paper);
    font-weight: 700;
    background: var(--depot-2);
}

.stop.is-active .stop-art { box-shadow: 0 0 0 4px var(--depot-2); }

.stop-bus {
    width: 22px;
    height: 22px;
    margin-left: auto;
    fill: none;
    stroke: var(--tile);
    stroke-width: 2;
    stroke-linecap: round;
    animation: busIdle 1.6s ease-in-out infinite;
}

@keyframes busIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1.5px); }
}

.purse {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--depot-2);
    border-radius: 16px;
    transition: background-color 0.2s;
}

.purse:hover { background: var(--depot-3); }

.purse-coin {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--ink);
    font: 800 1.15rem/1 var(--display);
    box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 0 5px var(--ink);
}

.purse-text { display: flex; flex-direction: column; min-width: 0; }

.purse-amount {
    font: 700 1.35rem/1.1 var(--display);
    font-variation-settings: "wdth" 85;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.purse-label { font-size: 0.8rem; color: var(--paper-2); }

.mobilebar { display: none; }

.stage {
    min-width: 0;
    max-width: 1180px;
    width: 100%;
    padding: 4px 4px 0;
    display: flex;
    flex-direction: column;
}

.colophon {
    margin-top: auto;
    padding: 48px 4px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 24px;
    color: var(--paper-2);
    font-size: 0.82rem;
}

/* ================= NOTICES ================= */

.notice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px 10px 10px;
    margin-bottom: 16px;
    border-radius: var(--r-md);
    color: var(--ink);
    font-weight: 600;
    animation: noticeIn 0.6s var(--ease-out) both;
}

.notice--error { background: var(--orange); }
.notice--ok { background: var(--lime); }

.notice-face {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.3);
}

@keyframes noticeIn {
    from { opacity: 0; transform: translateY(-10px) rotate(-1deg); }
}

/* ================= PRIMITIVES ================= */

.plaque {
    --c: var(--yellow);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 26px;
    border-radius: var(--r-lg);
    background: var(--c);
    color: var(--ink);
}

.plaque::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--grain);
    opacity: 0.16;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.plaque--yellow { --c: var(--yellow); }
.plaque--orange { --c: var(--orange); }
.plaque--pink { --c: var(--pink); }
.plaque--teal { --c: var(--teal); }
.plaque--lime { --c: var(--lime); }
.plaque--paper { --c: var(--upholstery); }

.plaque-title {
    display: block;
    font: 800 1.5rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.panel {
    padding: 22px;
    border-radius: var(--r-lg);
    background: var(--depot);
}

.panel-title {
    font: 700 1.2rem/1.1 var(--display);
    font-variation-settings: "wdth" 85;
    margin-bottom: 16px;
}

.plaque .panel-title { color: var(--ink); }

/* Перфорированный бумажный талон */
.ticket {
    --hole: 5px;
    --pitch: 13px;
    position: relative;
    background: var(--ticket);
    color: var(--ink);
    -webkit-mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / var(--pitch) 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / var(--pitch) 51% repeat-x;
    mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / var(--pitch) 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / var(--pitch) 51% repeat-x;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50px;
    padding: 8px 8px 8px 22px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: 700 1rem/1 var(--display);
    font-variation-settings: "wdth" 85;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.25s var(--ease-out), background-color 0.2s, color 0.2s;
}

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

.btn-go {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.1rem;
    transition: transform 0.35s var(--ease-snap);
}

.btn:hover .btn-go { transform: translateX(3px) rotate(-12deg); }

.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink .btn-go { background: var(--yellow); color: var(--ink); }
.btn--ink:hover { background: #26221E; }

.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--yellow .btn-go { background: var(--ink); color: var(--yellow); }
.btn--yellow:hover { background: #FFD43E; }

.btn--ghost {
    padding: 8px 22px;
    background: transparent;
    color: var(--paper);
    box-shadow: inset 0 0 0 2px var(--line-2);
}

.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--paper); }

.btn--sm { min-height: 38px; padding: 6px 16px; font-size: 0.9rem; }

.link-ink {
    font-weight: 700;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.link-paper {
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
    color: var(--yellow);
}

.link-paper:hover, .link-ink:hover { text-decoration-thickness: 3px; }

/* Тиры */
.tier-badge {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 7px;
    font: 800 0.85rem/1 var(--display);
    color: var(--ink);
    background: var(--upholstery);
    box-shadow: inset 0 0 0 2px var(--ink);
}

.tier-badge.tier-S { background: var(--yellow); }
.tier-badge.tier-A { background: var(--pink); }
.tier-badge.tier-B { background: var(--teal); }
.tier-badge.tier-C { background: var(--orange); }
.tier-badge.tier-D { background: var(--lime); }
.tier-badge.tier-E { background: var(--upholstery); }

/* ================= PAGE HEAD (внутренние страницы) ================= */

.page-head {
    --c: var(--orange);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 170px;
    margin-bottom: 18px;
    padding: 26px 28px;
    border-radius: var(--r-lg);
    background: var(--c);
    color: var(--ink);
}

.page-head[data-tone="teal"] { --c: var(--teal); }
.page-head[data-tone="lime"] { --c: var(--lime); }
.page-head[data-tone="pink"] { --c: var(--pink); }

.page-head::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grain);
    opacity: 0.16;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.page-head-copy { position: relative; z-index: 1; max-width: 60ch; }

.page-head h1 {
    font: 800 clamp(2.2rem, 4.6vw, 3.6rem)/0.95 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.page-head p { margin-top: 10px; font-weight: 500; max-width: 52ch; }

.page-head-art {
    width: 220px;
    height: 170px;
    max-width: 42%;
    object-fit: contain;
    object-position: right center;
    margin: -28px -10px -36px 0;
    flex: none;
    animation: artSettle 0.9s var(--ease-snap) both;
}

@keyframes artSettle {
    from { transform: translateY(18px) rotate(6deg); opacity: 0; }
}

/* ================= LOBBY ================= */

.lobby { display: flex; flex-direction: column; gap: 18px; }

.hero { padding: 6px 0 4px; }

.ticket--hero {
    --hole: 9px;
    --pitch: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(220px, 30%, 330px);
    min-height: 430px;
    transform: rotate(-0.6deg);
    animation: ticketIssue 0.9s var(--ease-out) both;
}

@keyframes ticketIssue {
    from { transform: translateY(-26px) rotate(-2.5deg); clip-path: inset(0 0 100% 0); }
    to { transform: rotate(-0.6deg); clip-path: inset(0 0 0 0); }
}

.ticket--hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grain);
    opacity: 0.22;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.ht-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 40px 44px 38px;
    border-right: 2px dashed rgba(11, 10, 9, 0.35);
}

.ht-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font: 700 0.85rem/1 var(--display);
    font-variation-settings: "wdth" 85;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(11, 10, 9, 0.7);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ink);
}

.ht-number {
    display: flex;
    align-items: baseline;
    font: 800 clamp(4rem, 10.5vw, 9rem)/0.85 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    margin-top: 8px;
}

.ht-number .d {
    display: inline-block;
    min-width: 0.52em;
    text-align: center;
}

.ht-number .gap { width: 0.22em; }

.ht-number.is-rolling .d { animation: digitShake 0.09s steps(2) infinite; }

.ht-number .d.is-set { animation: digitDrop 0.5s var(--ease-snap) both; }

@keyframes digitShake {
    0% { transform: translateY(-3px); }
    100% { transform: translateY(3px); }
}

@keyframes digitDrop {
    from { transform: translateY(-0.18em) scale(1.08); }
}

.ht-sums {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    font: 600 1.25rem/1.2 var(--display);
    font-variation-settings: "wdth" 85;
    font-variant-numeric: tabular-nums;
}

.ht-sums b { font-weight: 800; }
.ht-eq { color: var(--orange); font-weight: 800; }
.ht-sums.is-off .ht-eq { color: rgba(11, 10, 9, 0.4); }

.ht-verdict {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    font-size: 1.02rem;
}

.ht-verdict.is-fresh { animation: verdictIn 0.5s var(--ease-out) both; }

@keyframes verdictIn {
    from { opacity: 0; transform: translateX(-10px); }
}

.ht-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.ht-note { font-size: 0.9rem; color: rgba(11, 10, 9, 0.68); }

.ht-stub {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--ticket);
}

.ht-stub img {
    position: absolute;
    right: -6%;
    bottom: 0;
    width: 112%;
    max-width: none;
    height: 104%;
    object-fit: contain;
    object-position: right bottom;
}

.punch {
    position: absolute;
    top: 34px;
    left: 26px;
    display: grid;
    grid-template-columns: repeat(4, 14px);
    gap: 8px;
    z-index: 3;
}

.punch i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--asphalt);
    transform: scale(0);
}

.punch i:nth-child(odd) { margin-top: 6px; }

.punch.is-punched i { animation: holePunch 0.32s var(--ease-snap) both; }
.punch.is-punched i:nth-child(1) { animation-delay: 0.00s; }
.punch.is-punched i:nth-child(2) { animation-delay: 0.05s; }
.punch.is-punched i:nth-child(3) { animation-delay: 0.10s; }
.punch.is-punched i:nth-child(4) { animation-delay: 0.15s; }
.punch.is-punched i:nth-child(5) { animation-delay: 0.20s; }
.punch.is-punched i:nth-child(6) { animation-delay: 0.25s; }
.punch.is-punched i:nth-child(7) { animation-delay: 0.30s; }

@keyframes holePunch {
    0% { transform: scale(0); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 16px;
}

.ride-plaque {
    min-height: 330px;
    display: flex;
    align-items: stretch;
}

.ride-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 52%;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--yellow);
    font: 700 0.85rem/1 var(--display);
    font-variation-settings: "wdth" 85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-chip i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-chip.is-live i { animation: liveDot 1.4s ease-in-out infinite; }

@keyframes liveDot {
    50% { opacity: 0.25; }
}

.ride-title {
    font: 800 clamp(2.4rem, 4.4vw, 3.6rem)/0.92 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
}

.ride-meta { font-weight: 600; font-size: 0.92rem; }

.ride-hint { max-width: 36ch; font-size: 0.98rem; margin-bottom: 8px; }

.ride-copy .btn { margin-top: auto; }

.ride-art {
    position: absolute;
    right: -4%;
    bottom: -6%;
    height: auto;
    width: auto;
    max-height: 110%;
    max-width: 58%;
    object-fit: contain;
    object-position: right bottom;
    transform-origin: 70% 80%;
    animation: busArrive 1.2s var(--ease-out) 0.2s both;
    transition: transform 0.45s var(--ease-out);
}

@keyframes busArrive {
    from { transform: translateX(28%); }
    to { transform: translateX(0); }
}

.ride-plaque:hover .ride-art {
    animation: none;
    transform: translateY(-5px) rotate(-1deg);
}

.jackpot-plaque {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 330px;
}

.jackpot-amount {
    position: relative;
    z-index: 1;
    font: 800 clamp(2.6rem, 5vw, 4.2rem)/0.95 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
    margin-top: 6px;
}

.jackpot-hint { position: relative; z-index: 1; max-width: 24ch; font-size: 0.95rem; }

.jackpot-art {
    position: absolute;
    right: -4%;
    bottom: -6%;
    width: auto;
    max-width: 48%;
    max-height: 105%;
    height: auto;
    object-fit: contain;
    object-position: right bottom;
    transition: transform 0.6s var(--ease-snap);
}

.jackpot-plaque:hover .jackpot-art { transform: rotate(-6deg) translateY(-6px); }

.block { padding: 18px 2px 4px; }

.block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    margin-bottom: 18px;
}

.block-title {
    font: 800 clamp(1.7rem, 3vw, 2.3rem)/1 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.block-head .block-title { margin-bottom: 0; }

.block-note { color: var(--paper-2); font-size: 0.92rem; }
.block-note b { color: var(--paper); }

.route-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    position: relative;
}

.route-steps::before {
    content: "";
    position: absolute;
    top: 21px;
    left: 22px;
    right: 22px;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--yellow) 0 14px, transparent 14px 24px);
    opacity: 0.6;
}

.route-steps li { position: relative; }

.rs-stop {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--ink);
    font: 800 1.2rem/1 var(--display);
    box-shadow: 0 0 0 6px var(--asphalt);
}

.route-steps h3 {
    font: 700 1.25rem/1.1 var(--display);
    font-variation-settings: "wdth" 85;
    margin-bottom: 6px;
}

.route-steps p { color: var(--paper-2); font-size: 0.95rem; max-width: 30ch; }

.tier-tickets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tier-ticket {
    --hole: 5px;
    --pitch: 14px;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.4s var(--ease-snap);
}

.tier-ticket:nth-child(odd) { transform: rotate(-0.8deg); }
.tier-ticket:nth-child(even) { transform: rotate(0.7deg); }
.tier-ticket:hover { transform: rotate(0) translateY(-4px); }

.tier-bg-S { background: var(--yellow); }
.tier-bg-A { background: var(--pink); }
.tier-bg-B { background: var(--teal); }
.tier-bg-C { background: var(--orange); }
.tier-bg-D { background: var(--lime); }
.tier-bg-E { background: var(--upholstery); }

.tt-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tt-code {
    font: 800 3rem/0.85 var(--display);
    font-variation-settings: "wdth" 75;
}

.tt-mult {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font: 700 0.95rem/1 var(--display);
    font-variation-settings: "wdth" 85;
}

.tt-name {
    font: 800 1.35rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    text-transform: uppercase;
    margin-top: 8px;
}

.tt-rule { font-size: 0.92rem; min-height: 2.8em; }

.tt-example {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px dashed rgba(11, 10, 9, 0.4);
    font: 700 1.6rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.fair-plaque {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-top: 14px;
    padding: 28px 34px 28px 20px;
}

.fair-plaque .plaque-title { font-size: clamp(1.9rem, 3vw, 2.5rem); font-variation-settings: "wdth" 75; }

.fair-art { width: 210px; height: 210px; object-fit: contain; transform: rotate(-6deg); }

.fair-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.fair-copy p { max-width: 58ch; }

.hash-strip {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--ink);
    color: var(--paper);
}

.hash-strip span { display: block; font-size: 0.78rem; color: var(--paper-2); margin-bottom: 4px; }
.hash-strip code { color: var(--teal); font-size: 0.78rem; }

/* ================= CABIN ================= */

.cabin { display: flex; flex-direction: column; gap: 16px; }

.cabin-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
}

.route-board {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 12px;
    border-radius: var(--r-lg);
    background: var(--depot);
}

.rb-route {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--yellow);
    color: var(--ink);
    font: 800 2.2rem/1 var(--display);
    font-variation-settings: "wdth" 75;
}

.rb-text { display: flex; flex-direction: column; }

.rb-ride {
    font: 800 1.45rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    text-transform: uppercase;
}

.rb-bus { color: var(--paper-2); font-size: 0.88rem; margin-top: 4px; }

.phase-board {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--r-lg);
    background: var(--orange);
    color: var(--ink);
}

.cabin[data-phase="FILLING"] .phase-board { background: var(--yellow); }
.cabin[data-phase="REVEAL_WAVE"] .phase-board,
.cabin[data-phase="COUNTING"] .phase-board { background: var(--pink); }
.cabin[data-phase="ANNOUNCING"] .phase-board,
.cabin[data-phase="PAYOUT"] .phase-board { background: var(--teal); }

.pb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.pb-name {
    font: 800 1.45rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    text-transform: uppercase;
}

.pb-timer {
    font: 800 2.2rem/0.9 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
}

.pb-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(11, 10, 9, 0.18);
    overflow: hidden;
}

.pb-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--ink);
    transition: width 1s linear;
}

.jackpot-chip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 22px;
    border-radius: var(--r-lg);
    background: var(--depot);
    text-align: right;
}

.jc-label { color: var(--paper-2); font-size: 0.85rem; }

.jc-value {
    font: 800 1.9rem/1 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
    color: var(--yellow);
    white-space: nowrap;
}

.announce {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 22px 10px 10px;
    border-radius: var(--r-lg);
    background: var(--depot);
}

.announce-face {
    width: 64px;
    height: 64px;
    flex: none;
    overflow: hidden;
    isolation: isolate;
    border-radius: 16px;
    background: var(--orange);
}

.announce.is-boarding .announce-face { background: var(--yellow); }
.cabin[data-phase="REVEAL_WAVE"] .announce-face,
.cabin[data-phase="COUNTING"] .announce-face { background: var(--pink); }

.announce-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 62% 6%;
    transform: scale(1.9);
    transform-origin: 62% 12%;
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.3) brightness(1.06);
}

.announce-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.announce-text strong {
    font: 800 1.3rem/1.1 var(--display);
    font-variation-settings: "wdth" 85;
}

.announce-text span { color: var(--paper-2); }

.announce-count {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 2px;
    font: 800 2.2rem/1 var(--display);
    font-variation-settings: "wdth" 75;
    color: var(--pink);
}

.announce-count small { font-size: 1.2rem; color: var(--paper-2); }
.announce-count em { font: 500 0.85rem var(--body); color: var(--paper-2); margin-left: 8px; }

.cabin-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

/* Автобус сверху */
.bus {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
    padding: 18px 26px 22px;
    border-radius: 64px 64px 30px 30px;
    background: var(--yellow);
    box-shadow: inset 0 0 0 4px var(--ink);
}

.bus-interior { z-index: 0; }

.bus::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    width: 46%;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 0 0 12px 12px;
    background: var(--ink);
}

.cabin[data-phase="DEPARTING"] .bus { animation: engineRumble 0.12s linear infinite; }

@keyframes engineRumble {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(0.6px, -0.4px); }
    75% { transform: translate(-0.6px, 0.4px); }
}

.bus-windows {
    position: absolute;
    z-index: 1;
    top: 96px;
    bottom: 70px;
    width: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.bus-windows-left { left: 9px; }
.bus-windows-right { right: 9px; }

.bus-windows span {
    display: block;
    height: 46px;
    border-radius: 3px;
    background: var(--ink);
    box-shadow: inset 2px 0 0 rgba(244, 238, 226, 0.25);
}

.bus-interior {
    position: relative;
    padding: 14px 14px 12px;
    border-radius: 48px 48px 16px 16px;
    background:
        repeating-linear-gradient(90deg, rgba(244, 238, 226, 0.035) 0 2px, transparent 2px 9px),
        var(--depot-2);
    box-shadow: inset 0 0 0 3px var(--ink);
}

.driver-area {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 14px;
    margin-bottom: 12px;
    border-bottom: 3px solid var(--ink);
}

.steering-wheel {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 5px solid var(--paper-2);
    position: relative;
}

.steering-wheel::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 4px;
    transform: translate(-50%, -50%);
    background: var(--paper-2);
    border-radius: 2px;
}

.destination-board {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--yellow);
    font-family: var(--display);
    font-variation-settings: "wdth" 80;
}

.db-route { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.db-number { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.door-mark {
    display: grid;
    place-items: center;
    height: 30px;
    border-radius: 6px;
    background: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, var(--ink) 6px 12px);
    color: transparent;
    font-size: 0;
}

.seats-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.seat-row {
    display: grid;
    grid-template-columns: 1fr 1fr 22px 1fr 1fr;
    gap: 7px;
    align-items: stretch;
}

.aisle {
    border-radius: 4px;
    background: repeating-linear-gradient(180deg, rgba(244, 238, 226, 0.08) 0 6px, transparent 6px 13px);
}

.seat {
    --seat: var(--depot-3);
    position: relative;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 7px 7px;
    background: var(--seat);
    color: var(--ink);
    transition: transform 0.3s var(--ease-snap), box-shadow 0.2s;
}

/* Спинка кресла — пассажиры смотрят на водителя, спинка снизу */
.seat::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 7px;
    border-radius: 4px;
    background: rgba(11, 10, 9, 0.22);
    pointer-events: none;
}

.seat-number {
    position: absolute;
    top: 4px;
    left: 6px;
    z-index: 2;
    font: 700 0.66rem/1 var(--display);
    color: rgba(11, 10, 9, 0.55);
}

.seat.free {
    --seat: transparent;
    box-shadow: inset 0 0 0 2px rgba(245, 194, 27, 0.55);
    background-image: repeating-linear-gradient(-45deg, rgba(245, 194, 27, 0.07) 0 5px, transparent 5px 10px);
    animation: seatAppear 0.5s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 18ms);
}

.seat.free::after { background: rgba(245, 194, 27, 0.18); }
.seat.free .seat-number { color: rgba(245, 194, 27, 0.75); }

@keyframes seatAppear {
    from { opacity: 0; transform: translateY(8px) scale(0.92); }
}

.seat.free:hover,
.seat.free:focus-within {
    --seat: var(--yellow);
    transform: translateY(-3px) rotate(-1.5deg);
    box-shadow: inset 0 0 0 2px var(--ink), 0 6px 0 rgba(0, 0, 0, 0.35);
}

.seat.free:hover .seat-number,
.seat.free:focus-within .seat-number { color: rgba(11, 10, 9, 0.6); }

.seat.occupied { --seat: var(--upholstery); }
.seat.other { --seat: var(--teal); }
.seat.player { --seat: var(--pink); animation: seatClaim 0.55s var(--ease-snap); }

@keyframes seatClaim {
    0% { transform: scale(0.82) rotate(-4deg); }
    100% { transform: scale(1); }
}

.seat.buying { transform: scale(0.9); opacity: 0.7; }

.buy-form { position: absolute; inset: 0; }

.buy-btn {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding-top: 6px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.buy-btn:focus-visible { outline-offset: 2px; }

.buy-btn .price {
    font: 700 0.9rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    color: var(--yellow);
}

.seat.free:hover .price,
.seat.free:focus-within .price { color: var(--ink); }

.occupied-marker {
    width: 42px;
    height: 42px;
    margin-top: 4px;
    border-radius: 50%;
    overflow: hidden;
}

.occupied-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.35) brightness(1.08);
}

.occupied-marker.you {
    display: grid;
    place-items: center;
    width: auto;
    height: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--pink);
    font: 800 0.85rem/1 var(--display);
    text-transform: uppercase;
}

.ticket-back {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--ticket);
    font: 700 0.6rem/1.2 var(--display);
    text-transform: uppercase;
    box-shadow: 0 0 0 1.5px var(--ink);
    animation: ticketHandOut 0.5s var(--ease-snap) both;
    animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes ticketHandOut {
    from { transform: translate(-50%, -16px) rotate(-20deg); opacity: 0; }
}

.seat-empty {
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: rgba(244, 238, 226, 0.2);
}

/* Билет в кресле */
.ticket-face {
    --hole: 2.5px;
    --pitch: 7px;
    position: relative;
    padding: 7px 10px 6px 5px;
    margin-top: 6px;
    background: var(--ticket);
    -webkit-mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / var(--pitch) 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / var(--pitch) 51% repeat-x;
    mask:
        radial-gradient(var(--hole) at 50% 0, #0000 97%, #000) 50% 0 / var(--pitch) 51% repeat-x,
        radial-gradient(var(--hole) at 50% 100%, #0000 97%, #000) 50% 100% / var(--pitch) 51% repeat-x;
}

.ticket-number {
    font: 700 0.8rem/1 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.seat .tier-badge {
    position: absolute;
    top: -7px;
    right: -6px;
    z-index: 3;
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
    border-radius: 6px;
}

.seat.tier-S, .seat.tier-A, .seat.tier-B, .seat.tier-C, .seat.tier-D {
    box-shadow: 0 0 0 3px var(--tier-ring, var(--paper));
}

.seat.tier-S { --tier-ring: var(--yellow); }
.seat.tier-A { --tier-ring: var(--pink); }
.seat.tier-B { --tier-ring: var(--teal); }
.seat.tier-C { --tier-ring: var(--orange); }
.seat.tier-D { --tier-ring: var(--lime); }

/* Компостирование: билет выезжает из компостера, затем пробивается */
.seat.reveal-ready .ticket-face {
    animation: ticketPunchIn 0.55s var(--ease-out) both;
    animation-delay: var(--reveal-delay, 0s);
}

.seat.reveal-ready .ticket-face::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 3px;
    width: 3px;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 -5px 0 var(--ink), 0 5px 0 var(--ink);
    animation: holePunch 0.3s var(--ease-snap) both;
    animation-delay: calc(var(--reveal-delay, 0s) + 0.4s);
}

@keyframes ticketPunchIn {
    0% { clip-path: inset(0 0 100% 0); transform: translateY(-10px); }
    70% { clip-path: inset(0 0 0 0); transform: translateY(1px); }
    100% { clip-path: inset(0 0 0 0); transform: translateY(0); }
}

.seat.reveal-ready .tier-badge {
    animation: badgePop 0.4s var(--ease-snap) both;
    animation-delay: calc(var(--reveal-delay, 0s) + 0.45s);
}

@keyframes badgePop {
    from { transform: scale(0) rotate(-30deg); }
}

.cabin[data-phase="ANNOUNCING"] .seat.tier-S,
.cabin[data-phase="ANNOUNCING"] .seat.tier-A,
.cabin[data-phase="PAYOUT"] .seat.tier-S,
.cabin[data-phase="PAYOUT"] .seat.tier-A {
    animation: winnerHop 0.9s var(--ease-out) infinite;
}

@keyframes winnerHop {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px) rotate(-2deg); }
}

.rear-door {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 3px solid var(--ink);
}

.rear-label {
    font: 700 0.75rem/1 var(--display);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--paper-2);
}

.cabin-side { display: flex; flex-direction: column; gap: 14px; }

.side-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--pink);
    color: var(--ink);
    isolation: isolate;
}

.side-empty img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.side-empty p { font-size: 0.92rem; font-weight: 500; }

.player-seats-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.mini-ticket {
    --hole: 4px;
    --pitch: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    background: var(--pink);
}

.mini-ticket .seat-label {
    font: 700 1rem/1 var(--display);
    font-variation-settings: "wdth" 85;
}

.mini-ticket .ticket-num {
    margin-left: auto;
    font: 800 1.2rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    font-variant-numeric: tabular-nums;
}

.mini-ticket .waiting { margin-left: auto; font-size: 0.85rem; color: rgba(11, 10, 9, 0.7); }

.player-seat-item.just-bought { animation: seatClaim 0.55s var(--ease-snap); }

.hint-pick { margin-top: 12px; color: var(--paper-2); font-size: 0.9rem; }

.legend-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.legend-list li { display: flex; align-items: center; gap: 12px; font-size: 0.92rem; color: var(--paper-2); }

.legend-marker { width: 26px; height: 22px; border-radius: 7px 7px 4px 4px; flex: none; }
.legend-marker.free { box-shadow: inset 0 0 0 2px rgba(245, 194, 27, 0.7); }
.legend-marker.player { background: var(--pink); }
.legend-marker.other { background: var(--teal); }
.legend-marker.bot { background: var(--upholstery); }

.side-fair { padding: 20px 22px; }
.side-fair .panel-title { margin-bottom: 10px; }

.seed-hash-mini {
    display: block;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--ink);
    color: var(--teal);
    font-size: 0.78rem;
}

/* ================= RESULTS ================= */

.verdict-plaque {
    display: flex;
    align-items: center;
    min-height: 300px;
    margin-bottom: 18px;
    padding: 30px 34px;
}

.verdict-copy {
    position: relative;
    z-index: 1;
    max-width: 46%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.verdict-title {
    font: 800 clamp(2.6rem, 5vw, 4.2rem)/0.9 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
}

.verdict-amount {
    font: 800 clamp(2.2rem, 4.2vw, 3.4rem)/1 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
}

.verdict-art {
    position: absolute;
    right: -2%;
    bottom: -6%;
    width: 62%;
    animation: artSettle 0.9s var(--ease-snap) 0.15s both;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.split-main, .split-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.winners-list { display: flex; flex-direction: column; gap: 8px; }

.winner-item {
    display: grid;
    grid-template-columns: 26px minmax(90px, 1fr) auto minmax(100px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--depot-2);
}

.winner-item.is-player { background: var(--pink); color: var(--ink); }
.winner-item.is-bot { color: var(--paper-2); }

.tier-name {
    font: 700 1.05rem/1 var(--display);
    font-variation-settings: "wdth" 85;
}

.ticket-visual {
    --hole: 3px;
    --pitch: 8px;
    display: inline-block;
    padding: 8px 12px;
    font: 800 1.15rem/1 var(--display);
    font-variation-settings: "wdth" 80;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.winner-seat { font-size: 0.88rem; color: inherit; opacity: 0.8; }

.winner-payout { text-align: right; font: 700 1.1rem/1 var(--display); font-variant-numeric: tabular-nums; }
.player-win { color: var(--ink); font-weight: 800; }
.other-win { color: var(--paper); }
.bot-label { color: var(--yellow); font-size: 0.9rem; }

.mini-bus {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: fit-content;
    margin: 0 auto 12px;
    padding: 18px 16px 16px;
    border-radius: 34px 34px 14px 14px;
    background: var(--yellow);
    box-shadow: inset 0 0 0 3px var(--ink);
}

.mini-row { display: flex; gap: 5px; }
.mini-aisle { width: 14px; }

.mini-seat {
    width: 28px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px 7px 4px 4px;
    background: var(--depot-2);
    color: var(--ink);
    font: 800 0.72rem/1 var(--display);
}

.mini-seat.bot { background: var(--upholstery); }
.mini-seat.player { box-shadow: 0 0 0 2px var(--pink); background: var(--pink); }
.mini-seat.tier-S { background: var(--ink); color: var(--yellow); }
.mini-seat.tier-A { background: var(--ink); color: var(--pink); }
.mini-seat.tier-B { background: var(--ink); color: var(--teal); }
.mini-seat.tier-C { background: var(--ink); color: var(--orange); }
.mini-seat.tier-D { background: var(--ink); color: var(--lime); }
.mini-seat.tier-E { background: var(--ink); color: var(--upholstery); }
.mini-seat.player[class*="tier-"] { box-shadow: 0 0 0 2px var(--pink); }

.ticket-cards { display: flex; flex-direction: column; gap: 12px; }

.ticket-card {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ticket-card.tier-S { background: var(--yellow); }
.ticket-card.tier-A { background: var(--pink); }
.ticket-card.tier-B { background: var(--teal); }
.ticket-card.tier-C { background: var(--orange); }
.ticket-card.tier-D { background: var(--lime); }

.ticket-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 600; }

.ticket-number-large {
    font: 800 2.2rem/1 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 2px dashed rgba(11, 10, 9, 0.35);
    font-size: 0.9rem;
}

.payout-amount { font: 800 1.1rem/1 var(--display); }
.no-win-label { color: rgba(11, 10, 9, 0.6); }

.facts {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    font-size: 0.95rem;
}

.facts dt { color: var(--paper-2); }

.facts dd {
    text-align: right;
    font: 700 1.1rem/1.2 var(--display);
    font-variation-settings: "wdth" 85;
    font-variant-numeric: tabular-nums;
}

.actions { display: flex; flex-direction: column; gap: 10px; }
.actions .btn { width: 100%; justify-content: space-between; }
.actions .btn--ghost { justify-content: center; }

/* ================= HISTORY ================= */

.rides-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.ride-stub {
    --hole: 5px;
    --pitch: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 20px 20px;
    transform: rotate(var(--tilt, 0deg));
    transition: transform 0.4s var(--ease-snap);
}

.ride-stub:hover { transform: rotate(0) translateY(-4px); }

.ride-stub:nth-child(4n+1) { background: var(--ticket); }
.ride-stub:nth-child(4n+2) { background: var(--pink); }
.ride-stub:nth-child(4n+3) { background: var(--teal); }
.ride-stub:nth-child(4n+4) { background: var(--yellow); }

.rs-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ink);
}

.rs-no {
    font: 800 2.2rem/0.9 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
}

.rs-class { font: 700 0.8rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; }

.rs-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.92rem; }
.rs-facts dt { color: rgba(11, 10, 9, 0.65); }
.rs-facts dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.rs-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 2px dashed rgba(11, 10, 9, 0.35);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 24px 36px;
    border-radius: var(--r-lg);
    background: var(--yellow);
    color: var(--ink);
    isolation: isolate;
}

.empty h2 {
    font: 800 2rem/1 var(--display);
    font-variation-settings: "wdth" 75;
    text-transform: uppercase;
}

.empty p { max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.empty-art { width: 200px; height: 200px; object-fit: contain; }

.empty--inline { flex-direction: row; text-align: left; padding: 12px 18px; margin-top: 14px; background: var(--teal); }
.empty--inline .empty-art { width: 80px; height: 80px; }

/* ================= WALLET ================= */

.balance-plaque { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 28px 30px; }

.balance-amount {
    position: relative;
    z-index: 1;
    font: 800 clamp(3rem, 6.5vw, 5rem)/0.9 var(--display);
    font-variation-settings: "wdth" 75;
    font-variant-numeric: tabular-nums;
}

.balance-plaque p { position: relative; z-index: 1; max-width: 50ch; }
.balance-plaque .btn { position: relative; z-index: 1; margin-top: 6px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }

.ledger { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.ledger th {
    padding: 0 10px 10px;
    text-align: left;
    font: 700 0.78rem/1 var(--display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--paper-2);
    border-bottom: 2px solid var(--line-2);
}

.ledger td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.ledger tr:last-child td { border-bottom: 0; }

.ledger .num, .ledger th.num { text-align: right; }

.ledger td.num {
    font: 700 1rem/1.2 var(--display);
    font-variation-settings: "wdth" 85;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger a { color: var(--yellow); font-weight: 600; }
.tx-date { color: var(--paper-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ================= VERIFY ================= */

.seal-plaque {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 26px;
}

.seal-stamp {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--teal);
    font: 800 2.2rem/1 var(--display);
    transform: rotate(-10deg);
    animation: stampDown 0.6s var(--ease-snap) both;
}

.plaque--orange .seal-stamp { color: var(--orange); }

@keyframes stampDown {
    from { transform: scale(1.6) rotate(-30deg); opacity: 0; }
}

.seal-plaque > div:last-child { position: relative; z-index: 1; }
.seal-verdict { margin-top: 6px; max-width: 56ch; font-weight: 500; }

.seed-reveal { display: flex; flex-direction: column; gap: 14px; }

.seed-label { display: block; font-size: 0.85rem; color: var(--paper-2); margin-bottom: 6px; }

.seed-value {
    display: block;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--asphalt);
    color: var(--teal);
    font-size: 0.8rem;
}

.algorithm-code {
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: var(--asphalt);
    color: var(--paper);
    font: 0.82rem/1.7 var(--mono);
    white-space: pre-wrap;
    overflow-x: auto;
}

.verify-table td { font-size: 0.85rem; }
.verify-table code { color: var(--paper-2); }
.verify-table .ticket-num { font: 700 1rem/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.verify-table .ok { color: var(--teal); font-weight: 700; white-space: nowrap; }
.verify-table .fail { color: var(--orange); font-weight: 700; white-space: nowrap; }
.verify-table tr.invalid td { background: rgba(240, 86, 46, 0.1); }

.verify-steps { padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; color: var(--paper-2); }
.verify-steps code { color: var(--paper); background: var(--asphalt); padding: 2px 6px; border-radius: 4px; }

.rides-select { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.ride-select-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--depot-2);
    transition: background-color 0.2s, transform 0.3s var(--ease-out);
}

.ride-select-item:hover { background: var(--teal); color: var(--ink); transform: translateX(4px); }
.ride-select-item:hover .ride-date { color: var(--ink); }

.ride-num { font: 700 1.1rem/1 var(--display); font-variation-settings: "wdth" 85; }
.ride-date { color: var(--paper-2); font-size: 0.88rem; }

.rides-list-mini { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.rides-list-mini a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.rides-list-mini a:hover { background: var(--depot-2); }
.rides-list-mini a.is-active { background: var(--teal); color: var(--ink); }
.rides-list-mini .date { color: var(--paper-2); font-size: 0.85rem; }
.rides-list-mini a.is-active .date { color: var(--ink); }

.dash-list { list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--paper-2); font-size: 0.92rem; }
.dash-list li { padding-left: 22px; position: relative; }
.dash-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    background: var(--teal);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1180px) {
    .cabin-head { grid-template-columns: 1fr 1fr; }
    .phase-board { grid-column: 1 / -1; grid-row: 1; }
    .tier-tickets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
    .lobby-grid { grid-template-columns: 1fr; }
    .ride-plaque, .jackpot-plaque { min-height: 280px; }
    .jackpot-art { width: 40%; }
    .cabin-body, .split { grid-template-columns: 1fr; }
    .route-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
    .route-steps::before { display: none; }
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
    }

    .rail {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 50;
        height: auto;
        min-height: 0;
        padding: 8px;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .rail .brand, .rail .purse { display: none; }

    .route { flex-direction: row; justify-content: space-between; gap: 2px; margin: 0; }
    .route::before { display: none; }

    .stop {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        padding: 6px 2px;
        font-size: 0.72rem;
        border-radius: 14px;
    }

    .stop-art { width: 38px; height: 38px; border-radius: 12px; }
    .stop-bus { display: none; }

    .mobilebar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 4px;
    }

    .mobilebar .brand { padding: 0; }
    .mobilebar .brand-mark { width: 34px; height: 40px; font-size: 1.2rem; }
    .mobilebar .brand-name { font-size: 1.15rem; }

    .purse--compact { margin: 0; padding: 6px 14px 6px 6px; gap: 8px; border-radius: 999px; }
    .purse--compact .purse-coin { width: 30px; height: 30px; font-size: 0.95rem; }
    .purse--compact .purse-amount { font-size: 1.1rem; }

    .stage { padding: 0; }
}

@media (max-width: 720px) {
    .ticket--hero { grid-template-columns: 1fr; min-height: 0; }
    .ht-main { padding: 30px 22px 26px; border-right: 0; border-bottom: 2px dashed rgba(11, 10, 9, 0.35); }
    .ht-head { flex-direction: column; gap: 4px; }
    .ht-stub { height: 230px; }
    .ht-stub img { right: 0; width: 100%; height: 100%; object-position: center bottom; }
    .ht-foot .btn { width: 100%; justify-content: space-between; }

    .ride-copy { max-width: 100%; }
    .ride-plaque { flex-direction: column; min-height: 0; padding-bottom: 200px; }
    .ride-art { height: auto; max-height: 220px; max-width: 78%; width: auto; right: -8%; bottom: -24px; }
    .jackpot-plaque { min-height: 250px; }
    .jackpot-art { width: 52%; }

    .tier-tickets { grid-template-columns: 1fr; }
    .route-steps { grid-template-columns: 1fr; }

    .fair-plaque { grid-template-columns: 1fr; }
    .fair-art { width: 170px; margin: -10px 0 -20px -10px; }

    .page-head { min-height: 0; padding: 22px; }
    .page-head-art { width: 110px; height: 100px; margin: -8px -8px -18px 0; }

    .cabin-head { gap: 10px; }
    .route-board { gap: 10px; padding: 8px 12px 8px 8px; }
    .rb-route { width: 42px; height: 42px; font-size: 1.6rem; border-radius: 11px; }
    .rb-ride { font-size: 1.15rem; }
    .rb-bus { font-size: 0.75rem; }
    .jackpot-chip { padding: 8px 14px; }
    .jc-value { font-size: 1.45rem; }
    .phase-board { padding: 12px 18px; }

    .announce { flex-wrap: wrap; gap: 12px; padding: 8px 14px 8px 8px; }
    .announce-face { width: 52px; height: 52px; border-radius: 13px; }
    .announce-text { flex: 1 1 0; }
    .announce-text strong { font-size: 1.1rem; }
    .announce-text span { font-size: 0.9rem; }
    .announce-count { flex-basis: 100%; margin-left: 64px; font-size: 1.8rem; }

    .bus { padding: 14px 18px 16px; border-radius: 48px 48px 24px 24px; }
    .bus-windows { width: 7px; }
    .bus-windows-left { left: 6px; }
    .bus-windows-right { right: 6px; }
    .bus-interior { padding: 12px 8px 10px; border-radius: 38px 38px 12px 12px; }
    .seat-row { gap: 5px; grid-template-columns: 1fr 1fr 14px 1fr 1fr; }
    .seats-grid { gap: 5px; }
    .seat { min-height: 56px; }
    .occupied-marker { width: 36px; height: 36px; }
    .ticket-number { font-size: 0.72rem; }

    .verdict-plaque { flex-direction: column; align-items: stretch; padding: 24px 22px 220px; }
    .verdict-copy { max-width: 100%; }
    .verdict-art { width: 92%; right: -6%; }

    .winner-item { grid-template-columns: 26px 1fr auto; row-gap: 8px; }
    .winner-item .ticket-visual { grid-column: 1 / 3; justify-self: start; }
    .winner-seat { grid-column: 1 / 3; }
    .winner-payout { grid-column: 3; grid-row: 1; }

    .colophon { flex-direction: column; padding-top: 32px; }
}

@media (max-width: 380px) {
    .seat-number { display: none; }
    .ticket-number { font-size: 0.64rem; }
    .stop-label { font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}


/* ================= AUTH + DEPOSIT FORMS ================= */

.rail-auth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 6px 10px;
    margin-top: auto;
}

.auth-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--depot-2);
    color: var(--paper);
    text-decoration: none;
    transition: background 0.25s var(--ease-out);
}
.auth-chip:hover, .auth-chip.is-active { background: var(--depot-3); }
.auth-chip-name {
    font-family: "Tektur", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.auth-chip-meta { font-size: 0.72rem; color: var(--paper-2); }

.auth-link {
    color: var(--paper-2);
    text-decoration: none;
    font-size: 0.85rem;
    background: none;
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.auth-link:hover { color: var(--paper); }
.auth-link--accent { color: var(--yellow); font-weight: 700; }
.auth-link--compact { font-size: 0.78rem; white-space: nowrap; }

.mobilebar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-page, .account-page { display: flex; flex-direction: column; gap: 18px; }
.auth-panel { max-width: 480px; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-family: "Tektur", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--paper-2);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="number"] {
    appearance: none;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--depot);
    color: var(--paper);
    font: inherit;
    font-size: 1rem;
}
.auth-form input:focus {
    outline: 2px solid var(--yellow);
    outline-offset: 1px;
    border-color: transparent;
}

.auth-switch { margin-top: 16px; }
.auth-switch a { color: var(--yellow); }

.inline-form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.deposit-demo-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 194, 27, 0.12);
    border: 1px dashed rgba(245, 194, 27, 0.35);
}

.asset-switch {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.asset-switch legend { width: 100%; margin-bottom: 4px; }

.chip-radio {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--depot-2);
    color: var(--paper-2);
    font-family: "Tektur", sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.chip-radio input:checked + span {
    background: var(--yellow);
    color: var(--ink);
}
.chip-radio:hover span { transform: translateY(-1px); }

.deposit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 640px) {
    .deposit-grid { grid-template-columns: 1fr; }
}

.rate-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--depot-2);
    font-size: 0.95rem;
}
.rate-preview strong {
    font-family: "Tektur", sans-serif;
    color: var(--yellow);
}

.pending-deposits { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.deposit-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: var(--depot);
    border: 1px solid var(--line);
}
.deposit-address { margin-top: 6px; font-size: 0.82rem; word-break: break-all; }
.deposit-address code {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--depot-3);
    color: var(--paper);
}
