* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #060a11;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.top-bar {
    height: 64px;
    background: #0a1018;
    border-bottom: 1px solid #182636;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-btn {
    display: none;
}

.logo-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.logo {
    font-size: 34px;
    font-weight: 800;
    color: #f7b740;
    letter-spacing: 0.8px;
    line-height: 1;
}

.logo span {
    color: #ff613f;
}

.online {
    font-size: 12px;
    color: #7e90a7;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance {
    background: #0f1a26;
    border: 1px solid #1f3044;
    border-radius: 8px;
    padding: 9px 14px;
    font-weight: 700;
    min-width: 140px;
    text-align: center;
    font-size: 14px;
}

.balance small {
    display: block;
    font-size: 10px;
    color: #8ea2ba;
    margin-bottom: 2px;
    font-weight: 500;
}

.balance strong {
    font-size: 18px;
    line-height: 1;
}

.deposit {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(180deg, #34d95a 0%, #22a947 100%);
    cursor: pointer;
    font-size: 12px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #1d2c3d;
    background: #0d1723;
    color: #8fa3bd;
    cursor: pointer;
    font-weight: 700;
}

.desktop-only {
    display: inline-flex;
}

.text-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    width: 42px;
    height: 42px;
}

.icon-symbol {
    line-height: 1;
}

.icon-caption {
    font-size: 10px;
    color: #7f97b2;
    line-height: 1;
}

.container {
    display: grid;
    grid-template-columns: 250px minmax(760px, 1fr) 230px;
    gap: 8px;
    padding: 8px;
    height: calc(100vh - 64px);
}

.left-panel,
.chat,
.panel {
    background: #0a1119;
    border: 1px solid #182636;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.left-panel h3,
.chat h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #d2deed;
}

.green {
    color: #38d26e;
}

.bet-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.bet-tab {
    border: 1px solid #1a2a3a;
    background: #0d1824;
    color: #7d94ad;
    border-radius: 8px;
    height: 26px;
    font-size: 11px;
}

.bet-tab.active {
    color: #d8e6f7;
}

.bet-head {
    display: grid;
    grid-template-columns: 1fr 70px 50px;
    gap: 8px;
    font-size: 12px;
    color: #6f8298;
    padding: 8px;
    border-radius: 8px;
    background: #0a1018;
    border: 1px solid #1a2431;
}

.bet-list {
    margin-top: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.bet-item {
    display: grid;
    grid-template-columns: 1fr 70px 50px;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    padding: 9px 8px;
    border-bottom: 1px solid #182433;
}

.bet-item .name {
    color: #d9e4f3;
}

.bet-item .amount {
    color: #f8f9fb;
}

.bet-item .cash {
    color: #7f96b4;
}

.bet-item.win .cash {
    color: #2ed17c;
}

.game-area {
    background: #0b121b;
    border: 1px solid #182739;
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.multipliers {
    min-height: 26px;
    border: 1px solid #1a2a3d;
    background: #0a111a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 12px;
    color: #8ca0b8;
}

.history-pill {
    font-size: 13px;
    font-weight: 700;
}

.history-pill.good {
    color: #57e47b;
}

.history-pill.mid {
    color: #4da3ff;
}

.history-pill.high {
    color: #bf6eff;
}

.history-pill.bad {
    color: #ff7a6f;
}

.game-screen {
    position: relative;
    margin-top: 8px;
    height: 455px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid #203247;
}

#gameCanvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    isolation: isolate;
    --shake-duration: 0.08s;
    --shake-x: 1px;
    animation: cameraShake var(--shake-duration) infinite alternate;
}

.arena {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
}

.horse {
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 256px;
    height: 341px;
    transform: translateX(-50%);
    background-image: url("../assets/cavalo/sprite.png?v=1");
    background-repeat: no-repeat;
    background-size: 1024px 682px;
    background-position: 0 0;
    overflow: hidden;
    image-rendering: auto;
    filter: none;
    clip-path: none;
    transition: none;
    transform-origin: center bottom;
    z-index: 3;
    will-change: transform, filter, background-position;
    animation: none;
}

.horse-shadow {
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 256px;
    height: 341px;
    background-image: url("../assets/cavalo/sprite.png?v=1");
    background-repeat: no-repeat;
    background-size: 1024px 682px;
    background-position: 0 0;
    opacity: 0;
    filter: none;
    clip-path: none;
    transform-origin: center bottom;
    z-index: 2;
    pointer-events: none;
    will-change: transform, filter, background-position, opacity;
    animation: none;
    display: none;
}

.horse-track {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.dust {
    position: absolute;
    left: 50%;
    bottom: 12px;
    width: 190px;
    height: 82px;
    transform: translateX(-50%) scale(1);
    opacity: 0.62;
    filter: blur(0.2px);
    z-index: 2;
    pointer-events: none;
    animation: dustMove 0.3s infinite;
}

@keyframes dustMove {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.4;
    }

    100% {
        transform: translateX(-80%) scale(1.6);
        opacity: 0.22;
    }
}

@keyframes cameraShake {
    from {
        transform: translateX(calc(var(--shake-x) * -1));
    }

    to {
        transform: translateX(var(--shake-x));
    }
}

#multiplier {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 68px;
    font-weight: 800;
    color: #ffd76a;
    text-shadow: 0 0 18px rgba(255, 191, 46, 0.52), 0 2px 8px rgba(68, 39, 0, 0.45);
    z-index: 3;
    text-align: center;
}

.timer-box {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    background: rgba(78, 50, 29, 0.9);
    border: 1px solid rgba(255, 196, 118, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    font-size: 15px;
    color: #f8e2c4;
    font-weight: 700;
    min-width: 90px;
}

.timer-box span {
    font-size: 36px;
}

.progress-track {
    margin-top: 8px;
    background: #0f1825;
    border: 1px solid #1f3147;
    border-radius: 100px;
    overflow: hidden;
    padding: 2px;
}

.progress-bar {
    width: 0%;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #f2a436 0,
        #f2a436 14px,
        #c9771f 14px,
        #c9771f 16px
    );
    transition: width 0.1s linear;
}

.status {
    text-align: center;
    margin-top: 8px;
    font-size: 22px;
    color: #dbe8f8;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.status span {
    color: #ff613f;
    font-weight: 700;
}

.bet-controls {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bet-box {
    background: #090f18;
    border: 1px solid #1a2c41;
    border-radius: 10px;
    padding: 10px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tab {
    flex: 1;
    border: 1px solid #20354c;
    background: #0d1621;
    color: #8fa7c0;
    border-radius: 8px;
    padding: 7px 0;
    font-size: 12px;
}

.tab.active {
    color: #fff;
    border-color: #2f4d70;
    background: #152334;
}

.amount-input,
.auto-input,
.chat input {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #25364d;
    background: #0b1520;
    color: #fff;
    padding: 0 10px;
    outline: none;
}

.quick-values {
    margin: 8px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.quick {
    border: 1px solid #1f3042;
    border-radius: 8px;
    background: #0f1a27;
    color: #b8cadf;
    height: 30px;
    font-weight: 700;
    cursor: pointer;
}

.quick.active {
    border-color: #2ecb45;
    color: #fff;
    background: #1b3b26;
}

.auto-wrap {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #8fa6bd;
}

.bet-btn {
    margin-top: 8px;
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(180deg, #00c853, #009624);
    box-shadow: 0 0 18px rgba(0, 255, 100, 0.5);
}

.bet-btn.cashout {
    background: linear-gradient(180deg, #42a5ff 0%, #1e78cc 100%);
    box-shadow: 0 0 15px rgba(66, 165, 255, 0.45);
}

.messages {
    flex: 1;
    background: #07101a;
    border: 1px solid #16283b;
    border-radius: 10px;
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.msg {
    font-size: 13px;
    margin-bottom: 10px;
    color: #d3e0f0;
}

.msg .time {
    color: #7a90a8;
    font-size: 11px;
    margin-left: 6px;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 220px 1fr;
    }

    .chat {
        display: none;
    }
}

@media (max-width: 1024px) {
    body {
        overflow: auto;
    }

    .top-bar {
        height: auto;
        min-height: 56px;
        padding: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo {
        font-size: 26px;
    }

    .container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - 56px);
        padding: 6px;
    }

    .left-panel {
        order: 2;
    }

    .game-area {
        order: 1;
    }

    .chat {
        order: 3;
        display: flex;
        min-height: 220px;
    }

    .game-screen {
        height: clamp(290px, 56vw, 430px);
    }

    #multiplier {
        top: 38%;
        font-size: clamp(40px, 8vw, 64px);
    }

    .timer-box {
        top: 10px;
        right: 10px;
        min-width: 74px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .timer-box span {
        font-size: clamp(24px, 5vw, 32px);
    }
}

@media (max-width: 768px) {
    .top-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .balance {
        min-width: 120px;
        font-size: 13px;
        padding: 8px 10px;
    }

    .deposit,
    .icon-btn {
        height: 32px;
    }

    .left-panel,
    .game-area,
    .chat {
        border-radius: 10px;
        padding: 8px;
    }

    .bet-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .status {
        font-size: 18px;
    }

    .horse,
    .horse-shadow {
        width: 220px;
        height: 293px;
        background-size: 880px 586px;
    }

    .dust {
        width: 160px;
        height: 68px;
        bottom: 10px;
    }

}

@media (max-width: 480px) {
    .top-bar {
        height: auto;
        min-height: 0;
        border-radius: 0;
        margin-bottom: 4px;
        padding: 8px 10px 10px;
        display: grid;
        grid-template-columns: 34px 1fr 34px;
        row-gap: 8px;
        align-items: center;
        border: none;
        border-bottom: 1px solid #13273e;
        background: linear-gradient(180deg, #08121d 0%, #050c16 100%);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
    }

    .mobile-nav-btn {
        display: inline-flex;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        border: 1px solid #1d344d;
        background: #0b1a2a;
        color: #c2d5ea;
        font-size: 16px;
        position: relative;
        padding: 0;
    }

    .menu-toggle {
        justify-self: start;
    }

    .notif-btn {
        justify-self: end;
    }

    .notif-dot {
        position: absolute;
        top: 3px;
        right: 2px;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #36e26b;
        box-shadow: 0 0 6px rgba(54, 226, 107, 0.75);
    }

    .logo-wrap {
        align-items: center;
        grid-column: 2;
    }

    .logo {
        font-size: 22px;
        letter-spacing: 0.4px;
    }

    .online {
        margin-top: 2px;
        font-size: 11px;
        color: #a6b9ce;
    }

    .online::before {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #1ae458;
        margin-right: 5px;
        box-shadow: 0 0 8px rgba(26, 228, 88, 0.75);
        vertical-align: middle;
    }

    .top-actions {
        grid-column: 1 / 4;
        width: 100%;
        justify-content: space-between;
        gap: 5px;
        padding: 6px;
        border-radius: 11px;
        border: 1px solid #17324f;
        background: linear-gradient(180deg, #071323 0%, #091320 100%);
        box-shadow: inset 0 0 0 1px rgba(22, 49, 75, 0.45);
    }

    .balance {
        min-width: 136px;
        flex: 1;
        text-align: left;
        border-radius: 9px;
        padding: 6px 9px;
        background: #091423;
        border: 1px solid #1a3450;
    }

    .balance small {
        font-size: 9px;
        color: #8ca2b8;
        margin-bottom: 2px;
    }

    .balance strong {
        font-size: 21px;
    }

    .deposit {
        height: 38px;
        min-width: 102px;
        padding: 0 11px;
        border-radius: 9px;
        font-size: 11px;
        font-weight: 800;
        background: linear-gradient(180deg, #30df5f 0%, #149d3f 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 12px rgba(22, 185, 74, 0.34);
    }

    .icon-btn {
        width: 36px;
        height: 38px;
        border-radius: 9px;
        border: 1px solid #1f3a58;
        background: #0c1b2c;
    }

    .text-icon {
        gap: 3px;
    }

    .icon-symbol {
        font-size: 15px;
    }

    .icon-caption {
        font-size: 8px;
    }

    .desktop-only {
        display: none;
    }

    .container {
        padding: 4px;
        gap: 6px;
    }

    .left-panel,
    .chat {
        display: none;
    }

    .game-area {
        border-radius: 14px;
        border: 1px solid #12304c;
        background: radial-gradient(100% 90% at 50% 0%, #0c1724 0%, #080f18 85%);
        box-shadow: inset 0 0 0 1px rgba(35, 67, 97, 0.45), 0 10px 26px rgba(0, 0, 0, 0.45);
    }

    .multipliers {
        min-height: 24px;
        gap: 8px;
        padding: 0 8px;
        border: 1px solid #203654;
        border-radius: 10px;
        background: #070f19;
    }

    .history-pill {
        font-size: 11px;
    }

    .game-screen {
        height: clamp(240px, 58vw, 300px);
    }

    #multiplier {
        top: 36%;
        font-size: clamp(32px, 9vw, 44px);
        color: #ffd76a;
        text-shadow: 0 0 14px rgba(255, 192, 50, 0.48), 0 2px 6px rgba(67, 37, 0, 0.42);
    }

    .timer-box {
        top: 8px;
        right: 8px;
        min-width: 64px;
        padding: 6px 8px;
    }

    .horse,
    .horse-shadow {
        width: 180px;
        height: 240px;
        background-size: 720px 480px;
    }

    .dust {
        width: 130px;
        height: 56px;
        bottom: 8px;
    }

    .status {
        font-size: 15px;
        letter-spacing: 0.2px;
        background: #071424;
        border: 1px solid #173659;
        border-radius: 12px;
        padding: 10px 8px;
    }

    .bet-controls {
        gap: 10px;
        margin-top: 8px;
    }

    .bet-box {
        padding: 10px;
        border-radius: 14px;
        border: 1px solid #1b3654;
        background: linear-gradient(180deg, #0c1a2a 0%, #091422 100%);
        box-shadow: inset 0 0 0 1px rgba(39, 76, 110, 0.35), 0 10px 18px rgba(0, 0, 0, 0.35);
    }

    .manual-card {
        border-color: #175237;
        box-shadow: inset 0 0 0 1px rgba(33, 110, 68, 0.4), 0 10px 18px rgba(0, 0, 0, 0.4);
    }

    .auto-card {
        border-color: #4a276f;
        box-shadow: inset 0 0 0 1px rgba(115, 67, 168, 0.42), 0 10px 18px rgba(0, 0, 0, 0.4);
    }

    .tabs {
        margin-bottom: 10px;
        gap: 6px;
    }

    .tab {
        border-radius: 10px;
        border-color: #21405f;
        background: #0b1827;
        color: #98b1cc;
        font-size: 11px;
        text-transform: uppercase;
    }

    .tab.active {
        color: #fff;
        border-color: #2f567d;
        background: #15283e;
    }

    .manual-card .tab.active {
        border-color: #2ea35f;
        background: rgba(39, 121, 69, 0.28);
    }

    .auto-card .tab.active {
        border-color: #9052cf;
        background: rgba(102, 55, 156, 0.32);
    }

    .amount-input,
    .auto-input {
        height: 40px;
        border-radius: 10px;
        border-color: #1d3a57;
        background: #0a1727;
        font-size: 25px;
        font-weight: 700;
    }

    .quick-values {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .quick {
        height: 28px;
        border-radius: 8px;
        font-size: 12px;
        background: #0b1725;
    }

    .manual-card .quick.active {
        border-color: #36d96b;
        background: #154b2f;
    }

    .auto-card .quick.active {
        border-color: #b15cff;
        background: #351853;
    }

    .auto-wrap {
        font-size: 12px;
        color: #9ab0c8;
    }

    .bet-btn {
        height: 44px;
        margin-top: 10px;
        border-radius: 10px;
        font-size: 20px;
        background: linear-gradient(180deg, #25e760 0%, #0cb044 100%);
        box-shadow: 0 6px 16px rgba(11, 214, 84, 0.35);
    }

    .bet-btn.purple {
        background: linear-gradient(180deg, #b449ff 0%, #6f2ed6 100%);
        box-shadow: 0 6px 16px rgba(135, 58, 235, 0.35);
    }

    .bet-btn.cashout {
        background: linear-gradient(180deg, #35b7ff 0%, #1e76cc 100%);
        box-shadow: 0 6px 16px rgba(66, 165, 255, 0.42);
    }
}
