:root {
    color-scheme: dark;
    --page: #0f1012;
    --panel: #1a1b1d;
    --panel-soft: #202124;
    --panel-deep: #111214;
    --line: #2b2d32;
    --line-soft: #222428;
    --text: #f6f7fb;
    --muted: #8f939b;
    --muted-2: #5f636b;
    --red: #f20d46;
    --green: #1fb500;
    --green-dark: #158900;
    --orange: #d77900;
    --blue: #12a9ff;
    --purple: #9148ff;
    --pink: #e500c9;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--page);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    min-height: 100vh;
    background: #111214;
}

.topbar {
    height: 46px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    background: #191a1c;
    border-bottom: 1px solid #151618;
}

.brand {
    color: var(--red);
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 900;
    font-size: 29px;
    line-height: 1;
}

.wallet {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 800;
    color: var(--green);
    font-size: 15px;
}

.wallet span:last-child {
    color: #9da0a8;
    font-weight: 500;
}

.icon-button {
    width: 28px;
    height: 32px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
}

.menu-button {
    gap: 4px;
}

.menu-button span {
    width: 14px;
    height: 2px;
    display: block;
    border-radius: 3px;
    background: #737780;
}

.desktop-layout {
    display: grid;
    grid-template-columns: 374px minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
}

.play-column {
    min-width: 0;
    display: grid;
    grid-template-rows: 29px auto auto;
    gap: 4px;
}

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

.history-row {
    display: flex;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    scrollbar-width: thin;
}

.history-row span {
    flex: 0 0 auto;
}

.history-row::-webkit-scrollbar {
    height: 6px;
}

.history-row::-webkit-scrollbar-thumb {
    background: #3a3c42;
    border-radius: 999px;
}

.history-row span.purple { color: var(--purple); }
.history-row span.pink { color: var(--pink); }
.history-row span.blue { color: var(--blue); }

.history-more {
    width: 33px;
    height: 22px;
    border: 0;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a3c42;
    color: #c5c7cc;
    padding: 0;
    gap: 3px;
}

.history-more span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: block;
    background: currentColor;
}

.stage-card {
    position: relative;
    min-height: 300px;
    border: 1px solid #2c2f34;
    border-radius: 21px;
    overflow: hidden;
    background: #030405;
}

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.multiplier {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: clamp(68px, 9vw, 104px);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.stage-card.waiting .multiplier {
    opacity: 0;
}

.waiting-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: clamp(140px, 72%, 340px);
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 6;
}

.stage-card.waiting .waiting-indicator {
    opacity: 1;
}

.stage-card.crashed .multiplier {
    color: var(--red);
}

.round-message {
    position: absolute;
    left: 50%;
    top: calc(50% + 68px);
    transform: translateX(-50%);
    color: rgba(255,255,255,0.72);
    font-size: 18px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
}

.stage-card.crashed .round-message {
    opacity: 1;
}

.rider-pill {
    position: absolute;
    right: 14px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 109px;
    height: 39px;
    border-radius: 22px;
    background: rgba(31, 32, 35, 0.92);
    padding: 4px 12px 4px 8px;
    font-size: 15px;
}

.avatar-stack {
    display: flex;
    align-items: center;
    min-height: 34px;
}

.avatar,
.avatar-chip {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 2px solid #2b2d32;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    background: radial-gradient(circle at 30% 25%, #ffeb8a, #d43158 55%, #5c1534);
}

.avatar + .avatar,
.avatar-chip + .avatar-chip {
    margin-left: -11px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.avatar.a2 { background: radial-gradient(circle at 35% 25%, #ffe5bd, #7d8c6d 55%, #3c322b); }
.avatar.a3 { background: radial-gradient(circle at 35% 25%, #fff, #d5085b 45%, #670b35); }
.avatar-stack.small .avatar { width: 30px; height: 30px; }

.bet-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.bet-panel,
.bets-board {
    background: var(--panel);
    border-radius: 17px;
    border: 1px solid #1f2023;
}

.bet-panel {
    position: relative;
    min-height: 185px;
    padding: 11px 64px 16px;
}

.segmented {
    width: 208px;
    height: 31px;
    margin: 0 auto 31px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #141517;
    border-radius: 18px;
}

.segmented button {
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #bfc2c7;
    font-size: 12px;
}

.segmented button.active {
    background: #2c2e33;
    color: #fff;
}

.bet-inner {
    display: grid;
    grid-template-columns: minmax(138px, 0.7fr) minmax(210px, 1fr);
    align-items: center;
    gap: 12px;
}

.amount-side {
    min-width: 138px;
}

.amount-row {
    height: 36px;
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.round-control {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #2b2d32;
    color: #979ba3;
    font-size: 23px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.amount-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #d9dce2;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.quick-grid button {
    height: 24px;
    border: 0;
    border-radius: 13px;
    background: #151618;
    color: #858991;
    font-size: 13px;
}

.bet-action {
    min-height: 65px;
    border: 2px solid rgba(255, 255, 255, 0.52);
    border-radius: 9px;
    background: var(--green);
    color: #fff;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
}

.bet-action span {
    font-size: 18px;
    line-height: 1;
}

.bet-action strong {
    font-size: 18px;
    font-weight: 500;
}

.bet-action.cashout {
    background: var(--orange);
}

.bet-action[disabled] {
    cursor: not-allowed;
    filter: grayscale(0.3) brightness(0.75);
}

.mini-icon {
    position: absolute;
    right: 22px;
    top: 14px;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 0;
    color: #9aa0a7;
    background: #282a2f;
    display: grid;
    place-items: center;
}

.mini-icon:before {
    content: '';
    width: 12px;
    height: 8px;
    border: 2px solid #9aa0a7;
    border-radius: 2px;
    display: block;
}

.bets-board {
    min-height: calc(100vh - 54px);
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    padding: 10px 8px 8px;
}

.tabs {
    height: 31px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 3px;
    border-radius: 16px;
    background: #121315;
    margin-bottom: 10px;
}

.tabs button {
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #b5b8bf;
    font-size: 12px;
}

.tabs button.active {
    color: #fff;
    background: #2b2d32;
}

.bets-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px 6px;
}

.summary-count {
    font-size: 14px;
    color: #d6d8dd;
}

.summary-count span {
    color: #fff;
}

.summary-win {
    text-align: right;
}

.summary-win strong {
    display: block;
    font-size: 21px;
}

.summary-win span {
    display: block;
    color: #767a82;
    font-size: 12px;
    margin-top: 3px;
}

.progress {
    height: 8px;
    margin: 0 10px 14px;
    border-radius: 999px;
    background: #25272b;
    overflow: hidden;
}

.progress span {
    display: block;
    width: 24%;
    height: 100%;
    border-radius: inherit;
    background: #45a906;
}

.table-head {
    display: grid;
    grid-template-columns: 1.1fr 0.85fr 0.45fr 0.85fr;
    gap: 8px;
    padding: 0 8px 9px;
    color: #81858e;
    font-size: 10px;
}

.table-head span:nth-child(n+2) {
    text-align: right;
}

.bets-list {
    --visible-bet-rows: 10;
    --bet-row-height: 35px;
    --bet-row-gap: 5px;
    display: grid;
    align-content: start;
    gap: var(--bet-row-gap);
    max-height: calc((var(--visible-bet-rows) * var(--bet-row-height)) + ((var(--visible-bet-rows) - 1) * var(--bet-row-gap)));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.bet-row {
    min-height: var(--bet-row-height);
    display: grid;
    grid-template-columns: 1.1fr 0.85fr 0.45fr 0.85fr;
    align-items: center;
    gap: 8px;
    border-radius: 17px;
    padding: 3px 8px;
    color: #c9ccd2;
    background: #111214;
    font-size: 13px;
    transition: background-color .22s ease, transform .22s ease;
}

.bet-row.win {
    background: #1b3e08;
    animation: bet-win-pulse .45s ease;
}

.bet-row.placed {
    background: #15171b;
}

.bet-player {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.bet-player span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bet-row .num,
.bet-row .x,
.bet-row .win-amount {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.bet-row .x {
    color: var(--blue);
    font-weight: 800;
}

.bet-row .x.live {
    color: #ffb24c;
    letter-spacing: 0.4px;
    animation: live-tag-blink 1s ease-in-out infinite;
}

@keyframes live-tag-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@keyframes bet-win-pulse {
    0% { transform: translateX(0); filter: brightness(1); }
    35% { transform: translateX(-1px); filter: brightness(1.3); }
    100% { transform: translateX(0); filter: brightness(1); }
}

.fair-footer {
    height: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #898d95;
    font-size: 11px;
    padding: 0 8px;
}

.fair-footer span:first-child:before {
    content: '';
    width: 9px;
    height: 12px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 4px 4px 6px 6px;
    background: #9fa3aa;
    vertical-align: -2px;
}

.menu-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 20;
}

.player-menu {
    position: fixed;
    top: 82px;
    right: 8px;
    width: min(754px, calc(100vw - 18px));
    max-width: 82vw;
    max-height: calc(100vh - 98px);
    overflow: auto;
    background: #1a1b1d;
    border: 1px solid #292b31;
    border-radius: 7px;
    box-shadow: 0 18px 55px rgba(0,0,0,.55);
    transform: translateY(-8px) scale(.48);
    transform-origin: top right;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 21;
}

body.menu-open .menu-scrim {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .player-menu {
    opacity: 1;
    pointer-events: auto;
    transform: scale(.5);
}

.profile-row {
    min-height: 142px;
    display: grid;
    grid-template-columns: 94px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: #2a2b30;
}

.profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #fff3c8, #bd8755 48%, #2e241e 49%, #111);
    border: 2px solid #1c1d21;
}

.profile-row strong {
    font-size: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-row button {
    min-width: 190px;
    border: 1px solid #50525a;
    border-radius: 47px;
    background: transparent;
    color: #a9adb6;
    font-size: 28px;
    padding: 14px 18px;
}

.menu-toggle,
.player-menu a {
    min-height: 106px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 0 30px;
    border-bottom: 1px solid #2a2c31;
    color: #f2f3f5;
    font-size: 34px;
    text-decoration: none;
}

.player-menu a {
    grid-template-columns: 44px 1fr;
}

.player-menu a:before {
    content: '?';
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #8f939c;
    border: 2px solid #767a84;
    font-size: 21px;
}

.player-menu a:nth-of-type(1):before { content: '*'; }
.player-menu a:nth-of-type(2):before { content: '<'; }
.player-menu a:nth-of-type(3):before { content: '$'; }
.player-menu a:nth-of-type(4):before { content: '?'; background: #4a4d55; border: 0; }
.player-menu a:nth-of-type(5):before { content: '#'; }
.player-menu a:nth-of-type(6):before { content: 'v'; }

.menu-toggle input {
    position: absolute;
    opacity: 0;
}

.menu-toggle i {
    width: 88px;
    height: 57px;
    border-radius: 33px;
    background: #111214;
    position: relative;
}

.menu-toggle i:after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 41px;
    height: 41px;
    border-radius: 50%;
    background: #aeb0b5;
}

.menu-toggle input:checked + i {
    background: #184b0c;
}

.menu-toggle input:checked + i:after {
    background: #4cdc22;
    right: 39px;
}

.icon {
    width: 36px;
    height: 36px;
    border: 2px solid #858994;
    border-radius: 50%;
    display: block;
    position: relative;
}

.icon.sound:before,
.icon.music:before,
.icon.animation:before {
    content: '';
    position: absolute;
    inset: 8px;
    border-left: 10px solid #858994;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.menu-separator {
    height: 48px;
    background: #2b2c31;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: rgba(20,21,23,.96);
    border: 1px solid #3a3d45;
    color: #fff;
    padding: 10px 14px;
    border-radius: 7px;
    z-index: 30;
    transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: start;
    padding: 18px;
    background: rgba(0,0,0,.58);
    opacity: 0;
    pointer-events: none;
    z-index: 40;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(680px, 100%);
    max-height: min(720px, 88vh);
    overflow: hidden;
    background: #1a1b1d;
    border: 1px solid #2e3037;
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(0,0,0,.5);
}

.modal-card header {
    height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid #2a2c31;
}

.modal-card h2 {
    margin: 0;
    font-size: 20px;
}

.modal-card header button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #2b2d32;
    color: #fff;
}

.history-table {
    max-height: 620px;
    overflow: auto;
}

.history-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid #27292e;
    color: #d9dce1;
}

.history-item span {
    color: #8f939b;
}

.history-item.win strong:last-child {
    color: var(--green);
}

.history-item.loss strong:last-child {
    color: var(--red);
}

.round-history-card {
    width: min(520px, 100%);
}

.round-history-controls {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #2a2c31;
}

.round-history-controls button {
    min-width: 92px;
    border: 1px solid #3b3e46;
    border-radius: 999px;
    background: #1f2024;
    color: #b9bcc3;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.round-history-controls button.active {
    border-color: #5c7cff;
    color: #dce3ff;
    background: #25325a;
}

.round-history-list {
    max-height: 420px;
    overflow: auto;
    white-space: normal;
    word-break: break-word;
}

.round-history-value {
    font-weight: 800;
}

.round-history-value.blue { color: var(--blue); }
.round-history-value.purple { color: var(--purple); }
.round-history-value.pink { color: var(--pink); }

.round-history-separator {
    color: #9da1a8;
}

.round-crash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid #27292e;
}

.round-crash-item .round-id {
    color: #a1a5ad;
    font-size: 13px;
}

.round-crash-item .round-x {
    font-size: 18px;
    font-weight: 800;
}

.round-crash-item .round-x.purple { color: var(--purple); }
.round-crash-item .round-x.pink { color: var(--pink); }
.round-crash-item .round-x.blue { color: var(--blue); }

.round-history-empty {
    padding: 18px 16px;
    color: #a1a5ad;
}

@media (min-width: 901px) {
    .stage-card {
        height: clamp(300px, calc(100vh - 272px), 370px);
    }

    .desktop-layout {
        align-items: start;
    }
}

@media (max-width: 900px) {
    body {
        background: #111214;
    }

    .topbar {
        height: 82px;
        padding: 0 20px;
    }

    .brand {
        font-size: 42px;
    }

    .wallet {
        font-size: 28px;
    }

    .menu-button {
        width: 38px;
        height: 38px;
    }

    .menu-button span {
        width: 27px;
        height: 4px;
    }

    .desktop-layout {
        display: flex;
        flex-direction: column;
        gap: 9px;
        padding: 0 8px 8px;
    }

    .play-column {
        display: contents;
    }

    .history-strip {
        order: 1;
        height: 92px;
        padding: 0 12px;
        gap: 16px;
    }

    .history-row {
        height: 100%;
        gap: 28px;
        padding: 0 8px;
        font-size: 30px;
        background: #111214;
    }

    .history-more {
        width: 57px;
        height: 38px;
        border-radius: 20px;
        gap: 5px;
    }

    .history-more span {
        width: 7px;
        height: 7px;
    }

    .round-history-list {
        max-height: 74vh;
        padding: 15px;
        line-height: 1.5;
        font-size: 13px;
    }

    .round-history-empty {
        font-size: 24px;
    }

    .stage-card {
        order: 2;
        aspect-ratio: 1.62 / 1;
        min-height: auto;
        border-radius: 34px;
    }

    .multiplier {
        font-size: clamp(78px, 22vw, 120px);
    }

    .round-message {
        top: calc(50% + 82px);
        font-size: 28px;
    }

    .rider-pill {
        right: 18px;
        bottom: 18px;
        min-width: 149px;
        height: 58px;
        border-radius: 31px;
        font-size: 29px;
    }

    .avatar,
    .avatar-chip,
    .avatar-stack.small .avatar {
        width: 41px;
        height: 41px;
    }

    .avatar + .avatar,
    .avatar-chip + .avatar-chip {
        margin-left: -15px;
    }

    .bet-panel-grid {
        order: 3;
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .bet-panel {
        min-height: 328px;
        border-radius: 32px;
        padding: 22px 30px 29px;
    }

    .segmented {
        width: 490px;
        max-width: 60%;
        height: 69px;
        border-radius: 36px;
        padding: 7px;
        margin-bottom: 27px;
    }

    .segmented button {
        border-radius: 31px;
        font-size: 29px;
    }

    .bet-inner {
        grid-template-columns: 330px 1fr;
        gap: 27px;
    }

    .amount-row {
        height: 64px;
        grid-template-columns: 66px 1fr 66px;
        gap: 10px;
        margin-bottom: 13px;
    }

    .round-control {
        width: 57px;
        height: 57px;
        font-size: 43px;
    }

    .amount-input {
        height: 62px;
        font-size: 42px;
    }

    .quick-grid {
        gap: 11px;
    }

    .quick-grid button {
        height: 54px;
        border-radius: 29px;
        font-size: 31px;
    }

    .bet-action {
        min-height: 188px;
        border-radius: 15px;
    }

    .bet-action span {
        font-size: 45px;
    }

    .bet-action strong {
        font-size: 34px;
    }

    .mini-icon {
        width: 63px;
        height: 63px;
        right: 29px;
        top: 32px;
        font-size: 35px;
    }

    .bets-board {
        order: 4;
        min-height: 470px;
        border-radius: 32px;
        padding: 24px 28px 10px;
    }

    .tabs {
        height: 61px;
        border-radius: 31px;
        margin-bottom: 22px;
    }

    .tabs button {
        border-radius: 29px;
        font-size: 29px;
    }

    .bets-summary {
        padding: 0 12px 12px;
    }

    .summary-count {
        font-size: 30px;
    }

    .summary-win strong {
        font-size: 41px;
    }

    .summary-win span {
        font-size: 30px;
    }

    .progress {
        height: 15px;
        margin: 0 12px 32px;
    }

    .table-head {
        grid-template-columns: 1.25fr 0.95fr 0.5fr 0.95fr;
        font-size: 25px;
        padding-bottom: 18px;
    }

    .bets-list {
        --bet-row-height: 74px;
        --bet-row-gap: 11px;
    }

    .bet-row {
        min-height: 74px;
        grid-template-columns: 1.25fr 0.95fr 0.5fr 0.95fr;
        border-radius: 38px;
        padding: 6px 18px 6px 4px;
        font-size: 29px;
    }

    .fair-footer {
        height: 69px;
        font-size: 23px;
    }

    .player-menu {
        top: 52px;
        width: calc(100vw - 18px);
        max-width: calc(100vw - 18px);
    }
}

@media (max-width: 560px) {
    .topbar {
        height: clamp(40px, 12vw, 62px);
        padding: 0 7px;
        gap: 7px;
    }

    .brand { font-size: clamp(22px, 7.4vw, 31px); }
    .wallet { font-size: clamp(12px, 4.6vw, 19px); }

    .menu-button {
        width: 25px;
        height: 30px;
    }

    .menu-button span {
        width: 17px;
        height: 2px;
    }

    .desktop-layout {
        gap: 4px;
        padding: 0 4px 7px;
    }

    .history-row {
        height: clamp(31px, 10vw, 55px);
        gap: clamp(13px, 5vw, 21px);
        padding: 0 10px;
        font-size: clamp(12px, 4.3vw, 19px);
    }

    .history-more {
        width: 33px;
        height: 23px;
        border-radius: 12px;
    }

    .history-more span {
        width: 4px;
        height: 4px;
    }

    .stage-card {
        border-radius: 13px;
        min-height: 0;
    }

    .multiplier {
        font-size: clamp(50px, 18vw, 78px);
    }

    .round-message {
        top: calc(50% + 45px);
        font-size: 15px;
    }

    .rider-pill {
        right: 8px;
        bottom: 9px;
        min-width: 70px;
        height: 32px;
        border-radius: 17px;
        gap: 5px;
        padding: 3px 8px 3px 5px;
        font-size: 14px;
    }

    .avatar,
    .avatar-chip,
    .avatar-stack.small .avatar {
        width: 24px;
        height: 24px;
        font-size: 9px;
        border-width: 1px;
    }

    .avatar + .avatar,
    .avatar-chip + .avatar-chip {
        margin-left: -9px;
    }

    .bet-panel {
        min-height: 119px;
        padding: 8px 8px 10px;
        border-radius: 8px;
    }

    .segmented {
        width: min(164px, 55vw);
        height: 22px;
        max-width: none;
        border-radius: 12px;
        padding: 3px;
        margin-bottom: 10px;
    }

    .segmented button {
        border-radius: 10px;
        font-size: 10px;
    }

    .bet-inner {
        grid-template-columns: minmax(86px, 47%) minmax(0, 1fr);
        gap: 8px;
    }

    .amount-side {
        min-width: 0;
    }

    .amount-row {
        height: 25px;
        grid-template-columns: 22px minmax(34px, 1fr) 22px;
        gap: 4px;
        margin-bottom: 5px;
    }

    .round-control {
        width: 20px;
        height: 20px;
        font-size: 15px;
    }

    .amount-input {
        height: 25px;
        font-size: 16px;
    }

    .quick-grid {
        gap: 4px;
    }

    .quick-grid button {
        height: 20px;
        border-radius: 11px;
        font-size: 10px;
    }

    .bet-action {
        min-height: 61px;
        border-width: 1px;
        border-radius: 6px;
    }

    .bet-action span {
        font-size: 16px;
    }

    .bet-action strong {
        font-size: 12px;
    }

    .mini-icon {
        width: 32px;
        height: 32px;
        right: 18px;
        top: 20px;
    }

    .bets-board {
        border-radius: 9px;
        padding: 9px 9px 8px;
        min-height: 280px;
    }

    .tabs {
        height: 26px;
        border-radius: 14px;
        margin-bottom: 8px;
    }

    .tabs button,
    .summary-count,
    .summary-win span,
    .table-head,
    .fair-footer {
        font-size: 10px;
    }

    .summary-win strong {
        font-size: 17px;
    }

    .bets-summary {
        padding: 0 8px 5px;
    }

    .progress {
        height: 8px;
        margin: 0 8px 10px;
    }

    .table-head {
        padding: 0 8px 7px;
    }

    .bets-list {
        --bet-row-height: 35px;
        --bet-row-gap: 5px;
    }

    .bet-row {
        min-height: 35px;
        border-radius: 18px;
        padding: 3px 7px;
        font-size: 12px;
    }

    .profile-row {
        min-height: 95px;
        grid-template-columns: 60px 1fr auto;
        gap: 10px;
        padding: 17px;
    }

    .profile-avatar {
        width: 58px;
        height: 58px;
    }

    .profile-row strong {
        font-size: 24px;
    }

    .profile-row button {
        min-width: 116px;
        font-size: 18px;
        padding: 9px;
    }

    .menu-toggle,
    .player-menu a {
        min-height: 72px;
        font-size: 24px;
        padding: 0 22px;
    }
}
