/* ----------------------------------------------------
   AUTHENTIC SPRIBE AVIATOR MOBILE UI STYLESHEET
   1:1 Pixel Match to Real Market Casino Aviator App
   ---------------------------------------------------- */

:root {
    --bg-app: #0c0d12;
    --bg-card: #14151b;
    --bg-card-dark: #0a0b0e;
    --bg-input: #0c0d12;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-card: #222430;

    --spribe-red: #e51b24;
    --spribe-red-glow: rgba(229, 27, 36, 0.55);
    --spribe-green-start: #32cd32;
    --spribe-green-end: #228b22;
    --spribe-green-glow: rgba(50, 205, 50, 0.4);
    --spribe-orange-start: #ffb300;
    --spribe-orange-end: #ff7a00;
    --spribe-orange-glow: rgba(255, 122, 0, 0.55);

    --mult-blue-bg: #111e38;
    --mult-blue-text: #34b4ff;
    --mult-purple-bg: #231238;
    --mult-purple-text: #913ef8;
    --mult-pink-bg: #330f28;
    --mult-pink-text: #c017b4;
    --mult-gold-bg: #3b2a0a;
    --mult-gold-text: #e69a0a;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-app);
    color: #ffffff;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.text-emerald { color: #22c55e !important; }
.text-danger { color: #ef4444 !important; }

/* ----------------------------------------------------
   1. TOP HEADER BAR
   ---------------------------------------------------- */
.av-header {
    height: 50px;
    background: #090a0e;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.av-header-left, .av-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.av-btn-back {
    background: transparent;
    border: none;
    color: #8e92a4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.av-btn-back svg { width: 22px; height: 22px; }

.av-logo-spribe {
    display: flex;
    align-items: center;
    gap: 6px;
}
.av-logo-text {
    font-size: 1.55rem;
    font-weight: 900;
    font-style: italic;
    color: var(--spribe-red);
    letter-spacing: -0.5px;
    font-family: 'Brush Script MT', 'Dancing Script', 'Segoe UI', cursive, sans-serif;
    text-shadow: 0 0 12px rgba(229, 27, 36, 0.4);
}
.av-help-badge {
    background: #242634;
    color: #8e92a4;
    font-size: 0.72rem;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.av-top-green-balance {
    font-size: 1.05rem;
    font-weight: 900;
    color: #22c55e;
    font-family: var(--font-mono);
    letter-spacing: -0.3px;
}

.av-btn-header-dep {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
    transition: all 0.15s ease;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.av-btn-header-dep:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.6);
}
.av-btn-header-dep:active { transform: scale(0.95); }

.av-btn-header-with {
    background: linear-gradient(135deg, #1f2638 0%, #151a27 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    border-radius: var(--radius-full);
    padding: 6px 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.15s ease;
    white-space: nowrap;
}
.av-btn-header-with:hover {
    background: #283045;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}
.av-btn-header-with:active { transform: scale(0.95); }

.av-btn-header-status {
    background: linear-gradient(135deg, #162035 0%, #0f1626 100%);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.45);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    border-radius: var(--radius-full);
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    transition: all 0.15s ease;
    white-space: nowrap;
}
.av-btn-header-status:hover {
    background: #1e2c47;
    border-color: #60a5fa;
    color: #bfdbfe;
    transform: translateY(-1px);
}
.status-pulse-dot {
    width: 7px;
    height: 7px;
    background: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 8px #38bdf8;
    animation: pulse 1.2s infinite;
}

.av-icon-menu,
.av-drawer-overlay,
.av-drawer-menu {
    display: none !important;
}
.av-drawer-menu {
    width: 310px;
    max-width: 85%;
    height: 100%;
    background: #12131a;
    border-left: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideInRight 0.2s ease-out;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.drawer-user-info { display: flex; align-items: center; gap: 10px; }
.drawer-avatar { font-size: 1.5rem; background: #222430; padding: 6px; border-radius: 50%; }
.drawer-uname { font-weight: 800; font-size: 0.95rem; color: #fff; }
.drawer-balance { font-size: 0.82rem; font-weight: 900; color: #22c55e; }
.drawer-close-btn { background: transparent; border: none; color: #9ca3af; cursor: pointer; }

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}
.drawer-link-btn {
    background: #191a24;
    border: 1px solid var(--border-color);
    color: #d1d5db;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}
.drawer-link-btn:hover { background: #242636; color: #fff; }
.drawer-link-btn.primary { background: linear-gradient(135deg, #15803d, #22c55e); color: #fff; border: none; }
.drawer-link-btn svg { width: 18px; height: 18px; }

/* ----------------------------------------------------
   3. MULTIPLIER HISTORY PILLS STRIP
   ---------------------------------------------------- */
.av-history-container {
    background: #0e0f14;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 10px 4px;
}

.av-history-strip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.av-history-pills {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.av-history-pills::-webkit-scrollbar { display: none; }

.mult-pill {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 900;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInPill {
    0% { transform: translateX(-30px) scale(0.8); opacity: 0; }
    60% { transform: translateX(3px) scale(1.05); opacity: 0.9; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

.mult-pill.slide-in {
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mult-pill.blue {
    background: var(--mult-blue-bg);
    color: var(--mult-blue-text);
    border-color: rgba(52, 180, 255, 0.4);
}
.mult-pill.purple {
    background: var(--mult-purple-bg);
    color: var(--mult-purple-text);
    border-color: rgba(145, 62, 248, 0.4);
}
.mult-pill.pink {
    background: var(--mult-pink-bg);
    color: var(--mult-pink-text);
    border-color: rgba(192, 23, 180, 0.45);
}
.mult-pill.gold {
    background: var(--mult-gold-bg);
    color: var(--mult-gold-text);
    border-color: rgba(230, 154, 10, 0.7);
    box-shadow: 0 0 12px rgba(230, 154, 10, 0.45);
    animation: goldGlowPulse 1.8s infinite alternate ease-in-out;
}

@keyframes goldGlowPulse {
    from { box-shadow: 0 0 6px rgba(230, 154, 10, 0.3); border-color: rgba(230, 154, 10, 0.5); }
    to { box-shadow: 0 0 16px rgba(230, 154, 10, 0.8); border-color: rgba(230, 154, 10, 1); }
}

.history-dropdown-btn {
    background: #171822;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: #8e92a4;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 0.72rem;
    flex-shrink: 0;
    position: relative;
    z-index: 25;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.history-dropdown-btn:hover {
    background: #252837;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}
.history-dropdown-btn svg, .history-dropdown-btn i { 
    width: 14px; 
    height: 14px; 
    pointer-events: none; 
}

.av-round-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #717588;
}
.round-id-capsule {
    background: #15161f;
    border-radius: var(--radius-full);
    padding: 1px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.round-id-capsule strong { color: #b1b5c8; }
.ping-capsule { font-family: var(--font-mono); font-size: 0.72rem; }

/* ----------------------------------------------------
   4. MAIN GAME 2-COLUMN LAYOUT (SPRIBE PARITY)
   ---------------------------------------------------- */
.av-main-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 10px;
    padding: 6px 12px 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

@media (min-width: 1440px) {
    .av-main-layout {
        grid-template-columns: 330px 1fr;
        gap: 12px;
    }
}

@media (max-width: 960px) {
    .av-main-layout {
        grid-template-columns: 275px 1fr;
        gap: 8px;
        padding: 4px 8px 10px;
    }
}

@media (max-width: 860px) {
    .av-main-layout {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 4px 6px 20px;
    }
    .av-gameplay-main {
        order: 1 !important;
        width: 100%;
    }
    .av-sidebar-section {
        order: 2 !important;
        width: 100%;
        height: auto !important;
        margin-top: 6px;
    }
    .av-bets-table-section {
        height: auto !important;
    }
}

/* LEFT SIDEBAR: ALL BETS SECTION */
.av-sidebar-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

/* RIGHT COLUMN: MAIN GAMEPLAY AREA */
.av-gameplay-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* TOP HISTORY STRIP & ROUND META BAR */
.av-top-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #111217;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 3px 10px;
}

.av-history-strip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    flex: 1;
}

.av-round-meta-capsules {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.round-id-capsule {
    background: #171822;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 0.72rem;
    color: #7b8094;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.round-id-capsule strong {
    color: #cbd5e1;
    font-family: var(--font-mono);
}
.ping-capsule {
    font-size: 0.72rem;
    color: #7b8094;
    font-family: var(--font-mono);
}
.ping-capsule strong {
    color: #22c55e;
}

/* ----------------------------------------------------
   5. FLIGHT STAGE & CANVAS
   ---------------------------------------------------- */
.av-canvas-container {
    position: relative;
    width: 100%;
    height: 380px;
    min-height: 320px;
    background: #0b0c0e;
    border: 1px solid #1f212c;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95);
}
#flight-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.av-big-multiplier {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.4rem;
    font-weight: 900;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.45);
    letter-spacing: -0.5px;
    pointer-events: none;
}

.av-flew-away-box {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    animation: popScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popScale {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.flew-away-title {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--spribe-red);
    text-shadow: 0 0 25px var(--spribe-red-glow);
    display: block;
    letter-spacing: 2px;
}
.flew-away-mult {
    font-size: 2.7rem;
    font-weight: 900;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    display: block;
}

.av-waiting-box {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 250px;
}
.waiting-header {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--spribe-red);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.waiting-plane { font-size: 1.2rem; animation: rotatePlane 1.2s infinite linear; }
@keyframes rotatePlane { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.waiting-progress-track {
    width: 100%;
    height: 6px;
    background: #1a1b24;
    border-radius: var(--radius-full);
    overflow: hidden;
}
.waiting-progress-bar {
    height: 100%;
    background: var(--spribe-red);
    box-shadow: 0 0 8px var(--spribe-red);
    width: 0%;
}

/* REAL-TIME CASHOUT FLOATING BANNER (Image 5) */
.av-cashout-toast-ribbon {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 43, 20, 0.95);
    border: 1.5px solid #22c55e;
    border-radius: var(--radius-full);
    padding: 4px 10px 4px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 16px rgba(34, 197, 94, 0.4);
    animation: slideDownToast 0.25s ease-out;
    z-index: 50;
}
@keyframes slideDownToast {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
.ribbon-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.ribbon-sub { font-size: 0.68rem; color: #a7f3d0; font-weight: 700; }
.ribbon-mult { font-size: 1.15rem; font-weight: 900; color: #ffffff; font-family: var(--font-mono); }

.ribbon-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ribbon-win-box {
    background: #22c55e;
    color: #ffffff;
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ribbon-win-box strong { font-size: 0.92rem; font-family: var(--font-mono); }
.star-icon { font-size: 0.72rem; color: #fef08a; }
.ribbon-close { background: transparent; border: none; color: #86efac; cursor: pointer; font-size: 0.9rem; font-weight: 900; }

/* ----------------------------------------------------
   6. DUAL BET CONTROL PANELS (SIDE-BY-SIDE HORIZONTAL GRID)
   Matches Image 2 Side-by-Side Dual Panels
   ---------------------------------------------------- */
.av-dual-panels-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}
@media (max-width: 580px) {
    .av-dual-panels-stack {
        grid-template-columns: 1fr;
    }
}

.av-bet-panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Active cashout panel glowing border (Image 4) */
.av-bet-panel-card.active-in-flight {
    border-color: #ff7a00 !important;
    box-shadow: 0 0 16px rgba(255, 122, 0, 0.4) !important;
}

.panel-mode-capsule-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    margin-bottom: 2px;
}
.btn-toggle-second-bet, .btn-close-second-bet {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1c1e28;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    z-index: 5;
}
.btn-toggle-second-bet:hover, .btn-toggle-second-bet:active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}
.btn-close-second-bet:hover, .btn-close-second-bet:active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.panel-mode-capsule {
    background: var(--bg-card-dark);
    border-radius: var(--radius-full);
    padding: 3px;
    display: inline-flex;
    width: fit-content;
    margin: 0 auto;
}
.mode-pill {
    background: transparent;
    border: none;
    color: #7f8396;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 22px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}
.mode-pill.active {
    background: #252836;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.auto-cashout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f1016;
    padding: 4px 10px;
    border-radius: 8px;
}
.auto-switch-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #9ca3af;
    cursor: pointer;
}
.auto-mult-input-box {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #171822;
    padding: 2px 8px;
    border-radius: 6px;
}
.auto-mult-input-box input {
    width: 48px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 900;
    font-family: var(--font-mono);
    text-align: right;
    outline: none;
}

.panel-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 8px;
    align-items: center;
}

.controls-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amount-stepper-box {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-full);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
}
.btn-circular-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #232532;
    border: none;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s;
}
.btn-circular-step:active { background: #373a4d; }

.stepper-value-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}
.stepper-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 900;
    font-family: var(--font-mono);
    text-align: center;
    outline: none;
}

.presets-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.preset-pill-btn {
    background: #1c1d27;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-full);
    color: #8e92a4;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s;
}
.preset-pill-btn:active { background: #2b2e3e; color: #fff; }

.controls-right {
    display: flex;
    align-items: center;
}

.btn-giant-action {
    width: 100%;
    height: 74px;
    border-radius: 16px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: transform 0.08s;
}
.btn-giant-action:active { transform: scale(0.97); }

/* Normal / Waiting Green State */
.btn-state-green {
    background: linear-gradient(180deg, var(--spribe-green-start) 0%, var(--spribe-green-end) 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}
.btn-state-green .giant-label {
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.1;
}
.btn-state-green .giant-amount {
    font-size: 1.05rem;
    font-weight: 800;
    opacity: 0.95;
    font-family: var(--font-mono);
}

/* In-Flight Active Cashout Orange State (Spribe Parity) */
.btn-state-orange {
    background: linear-gradient(180deg, var(--spribe-orange-start) 0%, var(--spribe-orange-end) 100%) !important;
    color: #000000 !important;
    box-shadow: 0 0 16px rgba(255, 122, 0, 0.55), 0 0 30px rgba(255, 122, 0, 0.3) !important;
    animation: pulseCashoutGlow 1.2s infinite alternate ease-in-out !important;
}
@keyframes pulseCashoutGlow {
    from { 
        box-shadow: 0 0 14px rgba(255, 122, 0, 0.45), 0 0 24px rgba(255, 122, 0, 0.2); 
        transform: scale(1);
    }
    to { 
        box-shadow: 0 0 24px rgba(255, 122, 0, 0.85), 0 0 45px rgba(255, 122, 0, 0.45); 
        transform: scale(1.015);
    }
}
.btn-state-orange .giant-label {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #000000;
    line-height: 1.1;
}
.btn-state-orange .giant-amount {
    font-size: 1.05rem;
    font-weight: 900;
    color: #000000;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Queued Cancel Red State (Image 1) */
.btn-state-red {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}
.btn-state-red .giant-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 2px;
}
.btn-state-red .giant-amount {
    font-size: 1.18rem;
    font-weight: 900;
}

/* ----------------------------------------------------
   7. ALL BETS DRAWER / TABLE (MATCHING IMAGE 2)
   ---------------------------------------------------- */
.av-bets-table-section {
    background: #101116;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.bets-segmented-tabs {
    background: #171822;
    border-radius: var(--radius-full);
    padding: 3px;
    display: flex;
    gap: 4px;
}
.tab-pill {
    flex: 1;
    background: transparent;
    border: none;
    color: #7f8396;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}
.tab-pill.active {
    background: #252836;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.bets-count-header {
    display: flex;
    flex-direction: column;
    margin: 8px 2px 6px;
}
.count-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #8e92a4;
    letter-spacing: 0.5px;
}
.count-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    font-family: var(--font-mono);
}

.bets-table-header {
    display: grid;
    grid-template-columns: 1.15fr 1fr 0.65fr 1fr;
    font-size: 0.70rem;
    font-weight: 800;
    color: #656a7d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px 4px 6px;
}

.bets-table-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 195px);
    min-height: 480px;
    margin-top: 5px;
    padding-right: 2px;
}

/* Custom sleek scrollbar for bets list */
.bets-table-list::-webkit-scrollbar {
    width: 4px;
}
.bets-table-list::-webkit-scrollbar-track {
    background: #0f1015;
}
.bets-table-list::-webkit-scrollbar-thumb {
    background: #2c2f40;
    border-radius: 4px;
}

.av-row-player {
    display: grid;
    grid-template-columns: 1.15fr 1fr 0.65fr 1fr;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    background: #14151c;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s, border-color 0.15s;
}

.av-row-player.cashed {
    background: rgba(34, 197, 94, 0.07);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.row-user-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-avatar-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #232534;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.row-stake-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: right;
    color: #ffffff;
    font-size: 0.76rem;
}
.row-mult-cell {
    font-family: var(--font-mono);
    text-align: center;
    color: #6b7280;
}
.badge-mult-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 800;
    font-family: var(--font-mono);
}
.badge-mult-pill.mult-purple {
    background: rgba(147, 51, 234, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
}
.badge-mult-pill.mult-blue {
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}
.badge-mult-pill.mult-green {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #4ade80;
}

.row-win-cell {
    font-family: var(--font-mono);
    font-weight: 800;
    text-align: right;
    color: #6b7280;
    font-size: 0.76rem;
}
.row-win-cell.won {
    color: #22c55e;
}

/* Provably Fair footer link matching Image 2 */
.bets-provably-fair {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.72rem;
    color: #6b7280;
    cursor: pointer;
}
.bets-provably-fair:hover .fair-badge {
    text-decoration: underline;
}
.fair-badge {
    color: #22c55e;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ----------------------------------------------------
   8. MODALS & POPUPS
   ---------------------------------------------------- */
.av-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
    z-index: 3000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
#modal-auth {
    z-index: 5000 !important;
}
#modal-history {
    z-index: 99999 !important;
}
.av-modal {
    background: #14151b;
    border: 1px solid #282a3a;
    border-radius: 18px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
.av-modal-header {
    background: #101117;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.av-modal-header h3 { font-size: 1rem; font-weight: 900; }
.modal-close-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer; }
.modal-close-btn:hover { color: #fff; }
.av-modal-body { padding: 16px; max-height: 75vh; overflow-y: auto; }

.rule-card {
    display: flex;
    gap: 10px;
    background: #111218;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.rule-num {
    background: var(--av-red-bright);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.rule-card strong { display: block; margin-bottom: 2px; font-size: 0.85rem; }
.rule-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }

.deposit-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}
.dep-pill {
    background: #111218;
    border: 1px solid var(--border-color);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 7px 0;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}
.dep-pill:hover { border-color: #22c55e; }

.form-group label { display: block; font-size: 0.75rem; font-weight: 800; color: var(--text-dim); margin-bottom: 4px; }
.form-group input {
    width: 100%;
    background: #101117;
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 0.9rem;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    outline: none;
}

/* Toast Notification - HIGHEST Z-INDEX OVER ALL MODALS */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999999 !important;
    width: 90%;
    max-width: 440px;
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    background: #181a24;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 5px solid #ef4444;
    padding: 12px 18px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
    text-align: center;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: toastPopIn 0.25s ease-out;
}
@keyframes toastPopIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-item.error {
    background: #2a1114;
    border-color: #ef4444;
    border-left-color: #ff334b;
    color: #fecaca;
}
.toast-item.success {
    background: #0d281a;
    border-color: #22c55e;
    border-left-color: #22c55e;
    color: #bbf7d0;
}
.toast-item.info {
    background: #111f38;
    border-color: #3b82f6;
    border-left-color: #38bdf8;
    color: #bfdbfe;
}

/* MODAL INLINE ALERTS (Displayed directly inside modal/form on error) */
.modal-inline-alert {
    display: none;
    background: rgba(239, 68, 68, 0.16);
    border: 1.5px solid #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    color: #fca5a5;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    align-items: center;
    gap: 8px;
    animation: alertPopIn 0.2s ease-out;
}
.modal-inline-alert.active {
    display: flex !important;
}
.modal-inline-alert.success {
    background: rgba(34, 197, 94, 0.16);
    border-color: #22c55e;
    color: #86efac;
}
@keyframes alertPopIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* UNIVERSAL POINTER AND INTERACTIVE FEEDBACK FOR ALL BUTTONS */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"],
.btn-big-action,
.btn-green-bet,
.btn-action-sm,
.auth-tab-btn,
.dep-tab-btn,
.merchant-select-card,
.btn-circular-step,
.preset-pill-btn,
.btn-giant-action,
.modal-close-btn,
.admin-nav-item,
.mode-card,
.av-btn-header-dep,
.av-btn-header-with,
.av-btn-header-login {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
}

/* BIG CASINO ACTION BUTTONS (Login, Deposit, Withdraw) */
.btn-big-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: all 0.15s ease-in-out;
    position: relative;
    outline: none;
}
.btn-green-bet {
    background: linear-gradient(180deg, #28a745 0%, #1e7e34 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.btn-green-bet:hover {
    background: linear-gradient(180deg, #34c759 0%, #228b3b 100%) !important;
    box-shadow: 0 6px 22px rgba(40, 167, 69, 0.65) !important;
    transform: translateY(-1px);
    filter: brightness(1.12);
}
.btn-green-bet:active {
    transform: scale(0.97) !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4) !important;
}
.btn-big-action:disabled,
.btn-big-action.btn-loading {
    opacity: 0.72 !important;
    cursor: wait !important;
    pointer-events: none !important;
    filter: grayscale(0.25);
}

/* Spinner for loading state */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.75s linear infinite;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------
   RESPONSIVE ADAPTATIONS (MOBILE, TABLET, DESKTOP)
   ---------------------------------------------------- */

/* TABLETS (Portrait & Small Laptops): 768px to 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .av-main-layout {
        grid-template-columns: 260px 1fr !important;
        gap: 8px !important;
        padding: 4px 8px 12px !important;
    }
    .av-canvas-container {
        height: clamp(240px, 36vh, 340px) !important;
        min-height: 220px !important;
    }
    .av-dual-panels-stack {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .btn-giant-action {
        height: 64px !important;
    }
    #control-panel-2 {
        display: flex !important;
    }
    .btn-toggle-second-bet, .btn-close-second-bet {
        display: none !important;
    }
}

/* DESKTOP & LARGE TABLETS: 768px+ */
@media (min-width: 768px) {
    #control-panel-2 {
        display: flex !important;
    }
    .btn-toggle-second-bet, .btn-close-second-bet {
        display: none !important;
    }
}

/* MOBILE PHONES (Portrait): under 768px */
@media (max-width: 768px) {
    .av-header {
        padding: 0 6px !important;
        height: calc(44px + max(0px, env(safe-area-inset-top, 0px))) !important;
        padding-top: max(2px, env(safe-area-inset-top, 0px)) !important;
        overflow: hidden !important;
    }
    .av-btn-back, .av-help-badge {
        display: none !important;
    }
    .av-header-left {
        margin-right: 6px !important;
        gap: 3px !important;
        flex-shrink: 0 !important;
        min-width: max-content !important;
    }
    .av-logo-text {
        font-size: 1.15rem !important;
        letter-spacing: -0.3px !important;
    }
    .av-header-right {
        gap: 4px !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }
    .av-top-green-balance {
        font-size: 0.78rem !important;
        margin-right: 1px !important;
    }
    .av-btn-header-dep {
        padding: 4px 8px !important;
        font-size: 0.68rem !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }
    .av-btn-header-with {
        padding: 4px 7px !important;
        font-size: 0.68rem !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }
    .av-btn-header-login {
        padding: 4px 10px !important;
        font-size: 0.68rem !important;
        gap: 3px !important;
        flex-shrink: 0 !important;
    }
    /* Hide status button on mobile/tablet — it is always accessible in hamburger drawer */
    .av-btn-header-status {
        display: none !important;
    }
    /* When user is guest/logged out, hide withdraw button on mobile/tablet so LOGIN has full room */
    .guest-hidden {
        display: none !important;
    }
    .av-icon-menu {
        display: none !important;
    }

    .av-top-meta-row {
        padding: 2px 6px !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }
    .ping-capsule {
        display: none !important;
    }
    .round-id-label {
        display: none !important;
    }
    .round-id-capsule {
        padding: 1px 6px !important;
        font-size: 0.65rem !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }
    .round-id-capsule::before {
        content: '#' !important;
        color: #64748b !important;
        font-weight: 800 !important;
    }
    .history-dropdown-btn {
        padding: 2px 6px !important;
        flex-shrink: 0 !important;
    }
    .av-history-strip-row {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        gap: 4px !important;
    }
    .av-history-pills {
        gap: 4px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .mult-pill {
        padding: 2px 7px !important;
        font-size: 0.68rem !important;
        flex-shrink: 0 !important;
    }

    /* Fluid canvas height adapting to phone viewport */
    .av-canvas-container {
        height: clamp(180px, 28vh, 235px) !important;
        min-height: 175px !important;
        border-radius: 12px;
    }
    .av-big-multiplier {
        font-size: clamp(2.5rem, 10vw, 3.5rem);
    }
    .flew-away-title {
        font-size: clamp(1.35rem, 5.5vw, 1.7rem);
    }
    .flew-away-mult {
        font-size: clamp(1.75rem, 7.5vw, 2.3rem);
    }

    /* Mobile dual panels: stacked */
    .av-dual-panels-stack {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    #control-panel-2.mobile-hidden {
        display: none !important;
    }
    .av-bet-panel-card {
        padding: 6px 8px !important;
        border-radius: 12px !important;
        gap: 4px !important;
    }
    .panel-controls-grid {
        grid-template-columns: 1fr 1.05fr !important;
        gap: 6px !important;
    }
    .amount-stepper-box {
        height: clamp(32px, 5vh, 36px) !important;
        padding: 2px 5px !important;
    }
    .btn-circular-step {
        width: 26px !important;
        height: 26px !important;
        font-size: 1rem !important;
    }
    .stepper-input {
        font-size: 1rem !important;
    }
    .presets-grid-2x2 {
        gap: 3px !important;
    }
    .preset-pill-btn {
        padding: 3px 0 !important;
        font-size: 0.70rem !important;
    }
    .btn-giant-action {
        height: clamp(58px, 9vh, 68px) !important;
        border-radius: 12px !important;
    }
    .btn-state-green .giant-label,
    .btn-state-orange .giant-label,
    .btn-state-red .giant-label {
        font-size: clamp(0.95rem, 3.5vw, 1.10rem) !important;
    }
    .btn-state-green .giant-amount,
    .btn-state-orange .giant-amount,
    .btn-state-red .giant-amount {
        font-size: clamp(0.85rem, 3.2vw, 0.98rem) !important;
    }

    /* Bets table cleanly sized below controls */
    .bets-table-list {
        min-height: 220px !important;
        max-height: 380px !important;
    }
}

/* MOBILE LANDSCAPE: when phone is held horizontally */
@media (max-height: 520px) and (orientation: landscape) {
    .av-header {
        height: 36px !important;
        padding: 0 8px !important;
    }
    .av-logo-text { font-size: 1.05rem !important; }
    .av-main-layout {
        display: grid !important;
        grid-template-columns: 1.25fr 1fr !important;
        gap: 6px !important;
        padding: 2px 6px 10px !important;
    }
    .av-sidebar-section {
        display: none !important;
    }
    .av-canvas-container {
        height: calc(100vh - 84px) !important;
        min-height: 180px !important;
    }
    .av-dual-panels-stack {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }
    .btn-giant-action {
        height: 48px !important;
    }
}
