/* ================================================================
   PalsBet Aviator — Mobile-First Professional UI
   Inspired by Spribe / Betika Aviator design language
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green:         #00c853;
    --green-dark:    #00a844;
    --green-glow:    rgba(0,200,83,0.40);
    --red:           #f03e3e;
    --red-glow:      rgba(240,62,62,0.40);
    --yellow:        #f59e0b;
    --blue:          #3b82f6;
    --bg:            #0a0b12;
    --bg-nav:        #0d0e1a;
    --bg-card:       #111220;
    --bg-card2:      #171828;
    --bg-input:      rgba(255,255,255,0.05);
    --border:        rgba(255,255,255,0.08);
    --border-green:  rgba(0,200,83,0.3);
    --text:          #e2e8f0;
    --text-dim:      #94a3b8;
    --text-muted:    #475569;
    --radius-sm:     8px;
    --radius:        12px;
    --radius-lg:     16px;
    --radius-xl:     20px;
    --shadow:        0 4px 24px rgba(0,0,0,0.6);
    --shadow-green:  0 4px 20px rgba(0,200,83,0.30);
}

html { height: 100%; }

body.game-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    overflow-x: hidden;
}

/* ── Utility ──────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadein  { from { opacity: 0; } to { opacity: 1; } }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }

/* ── Demo banner ───────────────────────────────────────────── */
.demo-banner {
    background: linear-gradient(90deg, rgba(245,158,11,0.15), rgba(245,158,11,0.07));
    border-bottom: 1px solid rgba(245,158,11,0.25);
    padding: 0.32rem 1rem;
    font-size: 0.69rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}
.demo-badge {
    background: #f59e0b;
    color: #000;
    font-weight: 900;
    font-size: 0.58rem;
    padding: 0.1rem 0.38rem;
    border-radius: 4px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.demo-cta-link  {
    color: #fff; font-weight: 700; text-decoration: none;
    padding: 0.1rem 0.45rem; background: rgba(255,255,255,0.1); border-radius: 4px;
}
.demo-reset-link { color: #fbbf24; font-weight: 700; text-decoration: none; opacity: 0.7; }

/* ── Navigation ────────────────────────────────────────────── */
.game-nav {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    height: 52px;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.nav-brand {
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    flex-shrink: 0;
}
.nav-brand-icon {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 7px;
    display: grid; place-items: center;
    font-size: 13px;
    box-shadow: 0 2px 8px var(--green-glow);
    flex-shrink: 0;
}
.nav-brand-name { display: none; }
@media (min-width: 380px) { .nav-brand-name { display: inline; } }
.nav-brand-badge {
    background: rgba(0,200,83,0.14);
    color: #4ade80;
    font-size: 0.48rem;
    font-weight: 800;
    padding: 0.1rem 0.32rem;
    border-radius: 4px;
    letter-spacing: 0.07em;
    border: 1px solid rgba(0,200,83,0.22);
}
.nav-right { display: flex; align-items: center; gap: 0.38rem; }
.nav-balance-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    cursor: pointer;
    gap: 1px;
}
.nav-bal-label  { color: var(--text-muted); font-size: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-bal-amount { color: #4ade80; font-size: 0.8rem; font-weight: 800; letter-spacing: -0.2px; }
.btn-deposit {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 0.32rem 0.65rem;
    border-radius: 99px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: filter 0.2s, transform 0.2s;
    box-shadow: var(--shadow-green);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-deposit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-deposit-text { display: none; }
@media (min-width: 400px) { .btn-deposit-text { display: inline; } }
.btn-withdraw-nav {
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.68rem;
    padding: 0.3rem 0.6rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    display: none;
}
@media (min-width: 500px) { .btn-withdraw-nav { display: flex; } }
.btn-withdraw-nav:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-icon-link {
    color: var(--text-muted);
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    text-decoration: none;
}
.nav-icon-link:hover { color: var(--text-dim); background: rgba(255,255,255,0.06); }
.nav-icon-link.hide-xs { display: none; }
@media (min-width: 460px) { .nav-icon-link.hide-xs { display: grid; } }

/* ── History Bar ──────────────────────────────────────────── */
.history-bar {
    background: rgba(0,0,0,0.6);
    border-bottom: 1px solid var(--border);
    padding: 0.28rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.history-bar::-webkit-scrollbar { display: none; }
.history-label {
    color: var(--text-muted);
    font-size: 0.56rem;
    white-space: nowrap;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.history-items  { display: flex; gap: 0.2rem; flex: 1; align-items: center; }
.history-empty  { color: var(--text-muted); font-size: 0.62rem; white-space: nowrap; }
.history-pill {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.12rem 0.38rem;
    border-radius: 5px;
    white-space: nowrap;
    letter-spacing: -0.2px;
    flex-shrink: 0;
}
.colour-red    { background: rgba(239,68,68,0.14);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.colour-yellow { background: rgba(245,158,11,0.14); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.colour-green  { background: rgba(0,200,83,0.11);   color: #4ade80; border: 1px solid rgba(0,200,83,0.2); }
.colour-purple { background: rgba(168,85,247,0.14); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.fairness-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.57rem;
    font-weight: 700;
    padding: 0.17rem 0.42rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.22rem;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.fairness-btn:hover { color: #4ade80; border-color: var(--border-green); background: rgba(0,200,83,0.06); }

/* ═══════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════ */
.game-layout {
    display: flex;
    flex-direction: column;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.45rem 0.45rem 5rem;  /* extra bottom padding for mobile space */
    gap: 0.45rem;
}
/* game-right is sidebar on desktop, hidden on mobile */
.game-right  { display: none; }
/* mobile-hide-desktop: visible on mobile, hidden on ≥860px (duplicate of sidebar) */
.mobile-only { display: block; }

@media (min-width: 860px) {
    .game-layout {
        flex-direction: row;
        padding: 0.75rem 1rem 1.5rem;
        align-items: flex-start;
        gap: 0.875rem;
    }
    .game-left   { flex: 1; min-width: 0; }
    .game-right  { display: block; width: 295px; flex-shrink: 0; position: sticky; top: 58px; }
    .mobile-only { display: none; }
}
.game-left  { display: flex; flex-direction: column; gap: 0.45rem; }

/* ── Canvas ───────────────────────────────────────────────── */
.canvas-wrapper {
    position: relative;
    background: linear-gradient(180deg, #07091a 0%, #090c1e 65%, #060810 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-xl);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 7;
    min-height: 175px;
    max-height: 340px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), var(--shadow);
}
.game-canvas { width: 100%; height: 100%; display: block; }

.canvas-round-info { position: absolute; top: 0.55rem; left: 0.65rem; z-index: 2; }
.round-badge {
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.28);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.12rem 0.42rem;
    border-radius: 5px;
    letter-spacing: 0.04em;
    backdrop-filter: blur(4px);
}

/* ── Multiplier Overlay ──────────────────────────────────── */
.multiplier-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

/* Waiting */
.waiting-display { text-align: center; animation: fadein 0.3s ease; }
.waiting-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.18rem;
}
.waiting-countdown {
    color: #fff;
    font-size: clamp(2.4rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1;
    text-shadow: 0 0 40px rgba(255,255,255,0.22);
}
.waiting-sub {
    color: rgba(255,255,255,0.25);
    font-size: 0.65rem;
    margin-top: 0.18rem;
    letter-spacing: 0.03em;
}
.waiting-progress {
    width: 56px; height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    margin: 0.5rem auto 0;
    overflow: hidden;
}
.waiting-progress-bar {
    height: 100%;
    background: var(--green);
    border-radius: 99px;
    transition: width 1s linear;
    box-shadow: 0 0 6px var(--green-glow);
}

/* Flying */
.multiplier-display {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mult-x-label {
    color: rgba(0,200,83,0.38);
    font-size: 1.05rem;
    font-weight: 900;
    position: relative;
    top: 0.44em;
    left: -0.42em;
    margin-bottom: -0.28em;
}
.multiplier-value {
    font-size: clamp(2.8rem, 9vw, 7rem);
    font-weight: 900;
    color: var(--green);
    text-shadow: 0 0 60px var(--green-glow);
    line-height: 1;
    letter-spacing: -3px;
    display: block;
}
.multiplier-value.pulse { animation: mult-pulse 0.5s ease-in-out infinite alternate; }
@keyframes mult-pulse {
    from { text-shadow: 0 0 40px var(--green-glow); }
    to   { text-shadow: 0 0 90px var(--green-glow), 0 0 160px rgba(0,200,83,0.2); }
}

/* Crashed */
.crashed-display { text-align: center; animation: fadein 0.2s ease; }
.crashed-flew-away {
    font-size: clamp(0.65rem, 2.2vw, 1.3rem);
    font-weight: 900;
    color: var(--red);
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 30px var(--red-glow);
}
.crashed-mult {
    font-size: clamp(2rem, 7vw, 5rem);
    font-weight: 900;
    color: #ff6b6b;
    letter-spacing: -2px;
    line-height: 1;
    margin-top: 0.08rem;
    text-shadow: 0 0 40px var(--red-glow);
}

/* Win banner */
.win-banner {
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #00c853, #00a844);
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-lg);
    animation: banner-pop 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
    box-shadow: 0 8px 40px rgba(0,200,83,0.65);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}
.win-banner-icon   { font-size: 1.4rem; }
.win-banner-title  { font-size: 0.6rem; font-weight: 700; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.win-banner-amount { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.5px; }
@keyframes banner-pop {
    from { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
    to   { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   BET PANELS — Dual panels, compact on mobile
   ═══════════════════════════════════════════════════════════ */
.bet-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.bet-panels-row.single { grid-template-columns: 1fr; }

.bet-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.6rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    transition: border-color 0.3s;
    min-width: 0;
}
.bet-panel.panel-active { border-color: var(--border-green); }
.bet-panel.panel-b      { border-color: rgba(59,130,246,0.2); }
.bet-panel.panel-b.panel-active { border-color: rgba(59,130,246,0.4); }

/* Panel header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-label {
    font-size: 0.56rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(0,200,83,0.7);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.bet-panel.panel-b .panel-label { color: rgba(59,130,246,0.7); }
.panel-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}
.bet-panel.panel-b .panel-dot { background: var(--blue); }

/* Mode tabs: Manual | Auto */
.panel-mode-tabs {
    display: flex;
    gap: 0.15rem;
    background: rgba(0,0,0,0.35);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.panel-mode-tab {
    flex: 1;
    padding: 0.2rem 0.2rem;
    font-size: 0.58rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text-muted);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.panel-mode-tab.active {
    background: var(--bg-card2);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Quick amount pills */
.bet-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.18rem;
}
.shortcut-btn {
    padding: 0.2rem 0.06rem;
    font-size: 0.58rem;
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.shortcut-btn:hover, .shortcut-btn.active {
    background: rgba(0,200,83,0.12);
    border-color: rgba(0,200,83,0.35);
    color: #4ade80;
}
.bet-panel.panel-b .shortcut-btn:hover,
.bet-panel.panel-b .shortcut-btn.active {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.35);
    color: #60a5fa;
}

/* Stepper row */
.bet-input-row { display: flex; align-items: center; gap: 0.18rem; }
.bet-stepper {
    width: 28px; height: 34px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: grid; place-items: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.bet-stepper:hover { background: rgba(255,255,255,0.12); color: #fff; }
.bet-amount-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.38rem 0.22rem;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    min-width: 0;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
.bet-amount-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(0,200,83,0.1); }
.bet-amount-input::placeholder { color: rgba(255,255,255,0.18); font-weight: 400; }
.bet-amount-input::-webkit-inner-spin-button,
.bet-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.bet-amount-input[type=number] { -moz-appearance: textfield; }

/* Auto cashout row */
.autocash-row   { display: flex; flex-direction: column; gap: 0.22rem; }
.autocash-label {
    color: var(--text-muted);
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.autocash-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}
.autocash-toggle-label { color: var(--text-dim); font-size: 0.62rem; font-weight: 600; }

/* Auto-bet settings */
.autobet-settings { display: flex; flex-direction: column; gap: 0.38rem; }
.autobet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    min-height: 28px;
}
.autobet-row-label {
    color: var(--text-dim);
    font-size: 0.58rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}
.autobet-input-sm {
    width: 62px;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.26rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}
.autobet-input-sm:focus { outline: none; border-color: var(--green); }
.autobet-input-sm::-webkit-inner-spin-button { -webkit-appearance: none; }
.autobet-input-sm[type=number] { -moz-appearance: textfield; }
.autobet-rounds-display {
    font-size: 0.58rem;
    font-weight: 700;
    color: #4ade80;
    text-align: center;
    padding: 0.18rem 0.4rem;
    background: rgba(0,200,83,0.08);
    border: 1px solid rgba(0,200,83,0.18);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.autobet-rounds-display.inactive { color: var(--text-muted); background: rgba(255,255,255,0.03); border-color: var(--border); }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 0.3rem; }
.toggle-switch {
    position: relative;
    width: 32px; height: 17px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 13px; height: 13px;
    left: 2px; top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(15px); }

/* ── Action Buttons ─────────────────────────────────────────── */
.btn-bet {
    background: linear-gradient(160deg, #00d45a, #00a844);
    color: #fff;
    font-weight: 900;
    padding: 0.52rem 0.35rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    box-shadow: var(--shadow-green);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
    gap: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.btn-bet:hover:not(:disabled)  { filter: brightness(1.08); transform: translateY(-1px); }
.btn-bet:active:not(:disabled) { transform: none; }
.btn-bet:disabled { opacity: 0.35; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn-bet.panel-b-btn {
    background: linear-gradient(160deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}
.btn-bet-label  { font-size: 0.54rem; font-weight: 700; opacity: 0.65; letter-spacing: 0.08em; text-transform: uppercase; }
.btn-bet-amount { font-size: 0.85rem; font-weight: 900; letter-spacing: -0.5px; }

.btn-cashout {
    background: linear-gradient(160deg, #f03e3e, #c92a2a);
    color: #fff;
    font-weight: 900;
    padding: 0.52rem 0.35rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 20px rgba(240,62,62,0.4);
    animation: cashout-pulse 0.65s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
    gap: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
@keyframes cashout-pulse {
    from { box-shadow: 0 4px 16px rgba(240,62,62,0.35); }
    to   { box-shadow: 0 8px 28px rgba(240,62,62,0.65); transform: translateY(-1px); }
}
.btn-cashout:disabled { opacity: 0.5; cursor: not-allowed; animation: none; transform: none; }

.btn-autobet-start {
    background: linear-gradient(160deg, #00d45a, #00a844);
    color: #000;
    font-weight: 900;
    padding: 0.52rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-green);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.bet-panel.panel-b .btn-autobet-start {
    background: linear-gradient(160deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}
.btn-autobet-stop {
    background: linear-gradient(160deg, #f03e3e, #c92a2a);
    color: #fff;
    font-weight: 900;
    padding: 0.52rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    animation: cashout-pulse 0.65s ease infinite alternate;
    touch-action: manipulation;
}

.btn-loading          { display: flex; align-items: center; justify-content: center; gap: 0.32rem; font-size: 0.72rem; font-weight: 700; }
.btn-spinner          { width: 11px; height: 11px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; flex-shrink: 0; }

/* Status displays */
.bet-queued {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    padding: 0.42rem;
    background: rgba(0,200,83,0.07);
    border: 1px solid rgba(0,200,83,0.18);
    border-radius: var(--radius);
    font-size: 0.62rem;
    font-weight: 700;
    color: #4ade80;
    text-align: center;
    line-height: 1.4;
}
.bet-result {
    padding: 0.42rem 0.45rem;
    border-radius: var(--radius);
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    line-height: 1.45;
    flex-wrap: wrap;
}
.bet-result.won     { background: rgba(0,200,83,0.09);   color: #4ade80; border: 1px solid rgba(0,200,83,0.2); }
.bet-result.lost    { background: rgba(239,68,68,0.09);  color: #f87171; border: 1px solid rgba(239,68,68,0.18); }
.bet-result.pending { background: rgba(245,158,11,0.08); color: #fbbf24; border: 1px solid rgba(245,158,11,0.18); }
.bet-result.neutral { background: rgba(255,255,255,0.02);color: var(--text-muted); border: 1px solid var(--border); }
.bet-error {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
    font-size: 0.6rem;
    padding: 0.3rem 0.42rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   BETS TABLE  (All Bets / My Bets / Top)
   ═══════════════════════════════════════════════════════════ */
.livebets-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.lb-tabs {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border);
    padding: 0 0.45rem;
    gap: 0.05rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab {
    padding: 0.52rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.lb-tab:hover  { color: var(--text-dim); }
.lb-tab.active { color: #fff; border-bottom-color: var(--green); }
.lb-tab-count {
    background: rgba(0,200,83,0.13);
    color: #4ade80;
    font-size: 0.54rem;
    font-weight: 800;
    min-width: 15px; height: 15px;
    display: grid; place-items: center;
    border-radius: 4px;
    padding: 0 2px;
}

.lb-col-headers {
    display: grid;
    grid-template-columns: 1fr 58px 42px 60px;
    padding: 0.28rem 0.7rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.lb-col-headers span {
    font-size: 0.54rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.livebets-list {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 860px) { .livebets-list { max-height: 520px; } }

.livebets-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.livebet-row {
    display: grid;
    grid-template-columns: 1fr 58px 42px 60px;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 0.68rem;
    transition: background 0.12s;
}
.livebet-row:hover { background: rgba(255,255,255,0.016); }
.livebet-row.mine  { background: rgba(0,200,83,0.045); border-left: 2px solid rgba(0,200,83,0.28); }

.livebet-user {
    display: flex; align-items: center; gap: 0.28rem;
    color: var(--text-dim); font-weight: 500;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}
.livebet-avatar {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #64748b;
    font-size: 0.52rem; font-weight: 800;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.livebet-avatar.me { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; }
.livebet-rank {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(245,158,11,0.14); color: #fbbf24;
    font-size: 0.52rem; font-weight: 800;
    display: grid; place-items: center; flex-shrink: 0;
}
.livebet-amount { color: var(--text); font-weight: 700; font-size: 0.67rem; }
.livebet-mult   { font-size: 0.66rem; font-weight: 700; }
.livebet-win    { font-size: 0.67rem; font-weight: 700; }
.mult-won  { color: #4ade80; }
.mult-lost { color: #f87171; }
.mult-live { color: #fbbf24; }
.win-pos   { color: #4ade80; }
.win-neg   { color: #f87171; }
.win-live  { color: #fbbf24; }

/* ── Toasts ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 5rem; left: 50%; transform: translateX(-50%);
    z-index: 9999;
    display: flex; flex-direction: column; gap: 0.3rem;
    pointer-events: none;
    width: 90%; max-width: 320px;
    align-items: center;
}
@media (min-width: 480px) {
    .toast-container {
        top: 3.75rem; right: 0.75rem; left: auto; bottom: auto;
        transform: none;
        align-items: flex-end;
        width: auto; max-width: 280px;
    }
}
.toast {
    padding: 0.58rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.74rem; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    width: 100%;
}
.toast-success { background: rgba(0,180,70,0.96);   color: #fff; border: 1px solid rgba(0,200,83,0.4); }
.toast-error   { background: rgba(220,50,50,0.96);  color: #fff; border: 1px solid rgba(240,62,62,0.4); }
.toast-info    { background: rgba(45,100,215,0.96); color: #fff; border: 1px solid rgba(59,130,246,0.4); }
.toast-enter-active, .toast-leave-active { transition: all 0.3s ease; }
.toast-enter-from { opacity: 0; transform: translateY(16px); }
.toast-leave-to   { opacity: 0; transform: translateY(16px); }

/* ── Modals — bottom-sheet on mobile ────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(6px);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 300;
    animation: fadein 0.2s ease;
}
@media (min-width: 480px) {
    .modal-overlay { align-items: center; padding: 1rem; }
}
.modal-card {
    background: var(--bg-card2);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    animation: modal-up 0.3s cubic-bezier(0.175,0.885,0.32,1.05);
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-height: 92vh;
    overflow-y: auto;
}
@media (min-width: 480px) {
    .modal-card {
        border-radius: var(--radius-xl);
        animation: modal-in 0.25s cubic-bezier(0.175,0.885,0.32,1.1);
        max-height: none;
        overflow-y: visible;
    }
}
@keyframes modal-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes modal-in { from { transform: translateY(18px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* drag handle */
.modal-drag-handle {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.14);
    border-radius: 99px;
    margin: 0.65rem auto 0;
    display: block;
}
@media (min-width: 480px) { .modal-drag-handle { display: none; } }

.modal-header {
    background: rgba(0,0,0,0.3);
    padding: 0.85rem 1.2rem;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { color: #fff; font-weight: 800; font-size: 0.88rem; }
.modal-close {
    color: var(--text-muted); font-size: 1.4rem;
    background: none; border: none; cursor: pointer;
    line-height: 1; padding: 0 0.18rem;
    transition: color 0.15s;
}
.modal-close:hover { color: #fff; }
.modal-body   { padding: 1rem 1.2rem; }
.modal-footer { padding: 0 1.2rem 1rem; }

.form-label {
    display: block; color: var(--text-dim);
    font-size: 0.7rem; font-weight: 600;
    margin-bottom: 0.26rem; letter-spacing: 0.02em;
}
.form-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff; border-radius: var(--radius-sm);
    padding: 0.7rem 0.875rem;
    font-size: 1rem; width: 100%;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,200,83,0.1); }
.form-input::placeholder { color: rgba(255,255,255,0.18); }
.form-error {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171; font-size: 0.72rem;
    padding: 0.38rem 0.55rem; border-radius: var(--radius-sm); margin-top: 0.42rem;
}
.quick-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; margin-bottom: 0.4rem; }
.quick-btn-sm {
    background: rgba(255,255,255,0.06); color: var(--text-dim);
    border: 1px solid rgba(255,255,255,0.09); border-radius: var(--radius-sm);
    padding: 0.45rem 0.3rem; font-size: 0.78rem; font-weight: 700;
    cursor: pointer; transition: all 0.15s; text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.quick-btn-sm:hover, .quick-btn-sm.active {
    background: rgba(0,200,83,0.12); border-color: rgba(0,200,83,0.38); color: #4ade80;
}
.btn-mpesa {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff; font-weight: 800; font-size: 1.05rem;
    padding: 0.9rem; border-radius: var(--radius);
    border: none; cursor: pointer; width: 100%;
    transition: all 0.2s; box-shadow: var(--shadow-green);
    -webkit-tap-highlight-color: transparent;
}
.btn-mpesa:hover:not(:disabled) { filter: brightness(1.08); }
.btn-mpesa:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cancel {
    background: rgba(255,255,255,0.06); color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.55rem 1.75rem; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.82rem; font-weight: 600;
    transition: all 0.15s;
}
.btn-cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }

.mpesa-note {
    display: flex; align-items: center; gap: 0.28rem;
    color: #4ade80; font-size: 0.7rem; margin-top: 0.6rem;
}
.available-balance { color: var(--text-muted); font-size: 0.7rem; margin-top: 0.4rem; text-align: right; }

/* STK animation */
.stk-anim {
    position: relative;
    width: 68px; height: 68px;
    margin: 1rem auto;
    display: flex; align-items: center; justify-content: center;
}
.stk-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(0,200,83,0.22);
    border-top-color: var(--green);
    animation: spin 0.85s linear infinite;
}
.stk-phone { font-size: 1.9rem; }

/* Seed display */
.seed-display {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.48rem 0.7rem;
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    color: #94a3b8;
    word-break: break-all;
    line-height: 1.65;
    margin-bottom: 0.7rem;
}
