/* ─── Reset / root ─────────────────────────────── */
#aviator-root *,#aviator-root *::before,#aviator-root *::after{box-sizing:border-box;margin:0;padding:0}
#aviator-root {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0b0e1f;
    border-radius: 10px;
    overflow: hidden;
    max-width: 960px;
    margin: 0 auto;
    box-shadow: 0 8px 40px rgba(0,0,0,.7);
    user-select: none;
    color: #fff;
}

/* ─── History bar ──────────────────────────────── */
.av-history {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #060810;
    min-height: 34px;
    flex-wrap: wrap;
    border-bottom: 1px solid #1a1e35;
    overflow: hidden;
}
.av-history-chip {
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
.av-history-chip.low  { background: rgba(96,165,250,.15); color: #60a5fa; }
.av-history-chip.mid  { background: rgba(52,211,153,.15); color: #34d399; }
.av-history-chip.high { background: rgba(192,132,252,.15); color: #c084fc; }
.av-history-chip.moon { background: rgba(251,191,36,.15);  color: #fbbf24; }

/* ─── Body: left panel + stage ─────────────────── */
.av-body {
    display: flex;
    height: 340px;
}

/* ── Left bets panel ── */
.av-bets-panel {
    width: 240px;
    min-width: 180px;
    background: #080b1a;
    border-right: 1px solid #1a1e35;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}
.av-bets-tabs {
    display: flex;
    border-bottom: 1px solid #1a1e35;
}
.av-bets-tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    transition: color .2s;
}
.av-bets-tab.active { color: #fff; border-bottom: 2px solid #ef4444; }
.av-bets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    font-size: 10px;
    color: rgba(255,255,255,.35);
}
.av-bets-header .av-prev-round {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: rgba(255,255,255,.4);
}
.av-bets-cols {
    display: flex;
    padding: 3px 10px 4px;
    font-size: 10px;
    color: rgba(255,255,255,.3);
    border-bottom: 1px solid #1a1e35;
}
.av-bets-cols span:first-child { flex: 1; }
.av-bets-cols span:last-child  { text-align: right; }
.av-bets-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a1e35 transparent;
}
.av-bet-row {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 11px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    transition: background .15s;
}
.av-bet-row:hover { background: rgba(255,255,255,.03); }
.av-bet-row .av-bet-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,.7);
}
.av-bet-row .av-bet-player .av-avatar {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.av-bet-row .av-bet-amount { color: rgba(255,255,255,.55); font-size: 10px; min-width: 50px; text-align: center;}
.av-bet-row .av-bet-win    { font-size: 10px; font-weight: 700; min-width: 50px; text-align: right; }
.av-bet-row .av-bet-win.won  { color: #34d399; }
.av-bet-row .av-bet-win.lost { color: rgba(255,255,255,.25); }

/* ── Game stage ── */
.av-stage {
    flex: 1;
    position: relative;
    background: radial-gradient(ellipse at 30% 60%, #0d1030 0%, #060810 80%);
    overflow: hidden;
    min-width: 0;
}
#av-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Multiplier */
.av-multiplier-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    z-index: 10;
    letter-spacing: -2px;
    pointer-events: none;
    text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.av-multiplier-display span { font-size: 40px; }
.av-multiplier-display.crashed { color: #ef4444; }
.av-multiplier-display.cashed  { color: #34d399; }
.av-multiplier-display.waiting { color: rgba(255,255,255,.5); font-size: 36px; letter-spacing: 0; }

.av-status-label {
    position: absolute;
    top: calc(50% + 20px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255,255,255,.4);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Countdown */
.av-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: 900;
    color: rgba(255,255,255,.7);
    z-index: 10;
    pointer-events: none;
}
.av-countdown-label {
    position: absolute;
    top: calc(50% + 46px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255,255,255,.35);
    z-index: 10;
    pointer-events: none;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Plane */
.av-plane-wrap {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 70px;
    height: 50px;
    z-index: 20;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(239,68,68,.6));
}

/* Stars */
.av-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}
@keyframes twinkle { from{opacity:.2} to{opacity:.8} }

/* Flash on crash */
@keyframes crash-flash {
    0%   { background: rgba(239,68,68,.15); }
    100% { background: transparent; }
}
.av-stage.crashed { animation: crash-flash .6s ease-out; }

/* ─── Bottom bet panels ─────────────────────────── */
.av-bottom {
    background: #0b0e1f;
    border-top: 1px solid #1a1e35;
}
.av-bet-panels {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #1a1e35;
}
.av-bet-slot {
    flex: 1;
    padding: 12px 14px;
    border-right: 1px solid #1a1e35;
}
.av-bet-slot:last-child { border-right: none; }

/* Amount control */
.av-amount-control {
    display: flex;
    align-items: center;
    background: #060810;
    border: 1px solid #1e2340;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}
.av-amount-btn {
    width: 36px; height: 40px;
    border: none;
    background: #0f1228;
    color: rgba(255,255,255,.7);
    font-size: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.av-amount-btn:hover { background: #1a1e35; color: #fff; }
.av-amount-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    outline: none;
    min-width: 0;
}
.av-amount-input::-webkit-inner-spin-button,
.av-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Quick amounts */
.av-quick {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}
.av-quick button {
    flex: 1;
    padding: 4px 0;
    background: #0f1228;
    border: 1px solid #1e2340;
    border-radius: 5px;
    color: rgba(255,255,255,.55);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.av-quick button:hover { background: #1a1e35; color: #fff; }

/* Bet / Cashout button */
.av-action-row {
    display: flex;
    gap: 6px;
}
.av-btn-main {
    flex: 1;
    padding: 12px 8px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .3px;
    line-height: 1.2;
    text-align: center;
}
.av-btn-main.bet {
    background: linear-gradient(180deg, #3dcb5a 0%, #25a041 100%);
    color: #fff;
    box-shadow: 0 3px 16px rgba(37,160,65,.4);
}
.av-btn-main.bet:hover:not(:disabled) {
    background: linear-gradient(180deg, #4de06c 0%, #2bb84d 100%);
    box-shadow: 0 5px 22px rgba(37,160,65,.6);
}
.av-btn-main.bet:disabled {
    background: #1e2340;
    color: rgba(255,255,255,.3);
    box-shadow: none;
    cursor: not-allowed;
}
.av-btn-main.cashout {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 3px 16px rgba(217,119,6,.4);
    animation: pulse-cashout .8s infinite alternate;
}
.av-btn-main.cashout:disabled {
    background: #1e2340;
    color: rgba(255,255,255,.3);
    box-shadow: none;
    animation: none;
    cursor: not-allowed;
}
@keyframes pulse-cashout {
    from { box-shadow: 0 3px 16px rgba(217,119,6,.4); }
    to   { box-shadow: 0 5px 28px rgba(217,119,6,.9); }
}

/* Auto buttons row */
.av-auto-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.av-btn-auto {
    flex: 1;
    padding: 5px 4px;
    border-radius: 6px;
    border: 1px solid #1e2340;
    background: #0f1228;
    color: rgba(255,255,255,.45);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    transition: background .15s, color .15s;
}
.av-btn-auto:hover { background: #1a1e35; color: rgba(255,255,255,.75); }

/* Balance & footer strip */
.av-balance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #060810;
    font-size: 11px;
    color: rgba(255,255,255,.4);
}
.av-balance-bar .av-bal-val {
    color: #fbbf24;
    font-weight: 700;
    font-size: 13px;
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
    .av-bets-panel { display: none; }
    .av-bet-panels { flex-direction: column; }
    .av-body { height: 280px; }
}
