/* ----------------------------------------------------
   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.45);
    --spribe-green-start: #32cd32;
    --spribe-green-end: #228b22;
    --spribe-green-glow: rgba(50, 205, 50, 0.4);
    --spribe-orange-start: #ffb300;
    --spribe-orange-end: #ff8f00;
    --spribe-orange-glow: rgba(255, 179, 0, 0.55);

    --mult-blue-bg: #111e38;
    --mult-blue-text: #3b82f6;
    --mult-purple-bg: #231238;
    --mult-purple-text: #a855f7;
    --mult-pink-bg: #330f28;
    --mult-pink-text: #ec4899;
    --mult-gold-bg: #3b2a0a;
    --mult-gold-text: #fbbf24;

    --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 {
    background: #232532;
    border: none;
    color: #c4c7d4;
    border-radius: 6px;
    width: 34px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.av-icon-menu svg { width: 18px; height: 18px; }

/* ----------------------------------------------------
   2. SLIDE-IN MENU DRAWER
   ---------------------------------------------------- */
.av-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}
.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: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 900;
    font-family: var(--font-mono);
    white-space: nowrap;
    border: 1px solid transparent;
}
.mult-pill.blue {
    background: var(--mult-blue-bg);
    color: var(--mult-blue-text);
    border-color: rgba(59, 130, 246, 0.4);
}
.mult-pill.purple {
    background: var(--mult-purple-bg);
    color: var(--mult-purple-text);
    border-color: rgba(168, 85, 247, 0.4);
}
.mult-pill.pink {
    background: var(--mult-pink-bg);
    color: var(--mult-pink-text);
    border-color: rgba(236, 72, 153, 0.4);
}
.mult-pill.gold {
    background: var(--mult-gold-bg);
    color: var(--mult-gold-text);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.history-dropdown-btn {
    background: #171822;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: #8e92a4;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 0.72rem;
    flex-shrink: 0;
}
.history-dropdown-btn svg { width: 14px; height: 14px; }

.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 FLOW (MOBILE-FIRST)
   ---------------------------------------------------- */
.av-main-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 10px 20px;
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
}

/* ----------------------------------------------------
   5. FLIGHT STAGE & CANVAS
   ---------------------------------------------------- */
.av-canvas-container {
    position: relative;
    width: 100%;
    height: 250px;
    background: #000000;
    border: 1px solid #1f212c;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: inset 0 0 40px 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);
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
    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.2s ease-out;
}
@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);
    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 (VERTICAL STACK)
   ---------------------------------------------------- */
.av-dual-panels-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.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: #f59e0b !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.3) !important;
}

.panel-mode-capsule {
    background: var(--bg-card-dark);
    border-radius: var(--radius-full);
    padding: 3px;
    display: inline-flex;
    width: fit-content;
    margin: 0 auto 2px;
}
.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 (Image 4) */
.btn-state-orange {
    background: linear-gradient(180deg, var(--spribe-orange-start) 0%, var(--spribe-orange-end) 100%);
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.65);
}
.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);
}

/* 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 (IMAGE 3)
   ---------------------------------------------------- */
.av-bets-table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
}

.bets-segmented-tabs {
    background: var(--bg-card-dark);
    border-radius: var(--radius-full);
    padding: 3px;
    display: flex;
    gap: 4px;
}
.tab-pill {
    flex: 1;
    background: transparent;
    border: none;
    color: #7f8396;
    font-size: 0.8rem;
    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: 10px 0 6px;
}
.count-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #8e92a4;
    letter-spacing: 0.5px;
}
.count-val {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ffffff;
    font-family: var(--font-mono);
}

.bets-table-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.6fr 1fr;
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7280;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0 6px;
}

.bets-table-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 6px;
}

.av-row-player {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.6fr 1fr;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 700;
    background: #0e0f14;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.av-row-player.cashed {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid #22c55e;
}
.row-user-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-avatar-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #252836;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.row-stake-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: right;
}
.row-mult-cell {
    font-family: var(--font-mono);
    color: #f59e0b;
    font-weight: 800;
    text-align: center;
}
.row-win-cell {
    font-family: var(--font-mono);
    font-weight: 800;
    text-align: right;
    color: #9ca3af;
}
.row-win-cell.won { color: #22c55e; }

/* ----------------------------------------------------
   8. MODALS & POPUPS
   ---------------------------------------------------- */
.av-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
.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 */
.toast-container {
    position: fixed;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2000;
    width: 90%;
    max-width: 360px;
    pointer-events: none;
}
.toast-item {
    background: #1f222e;
    border-left: 4px solid var(--av-red-bright);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    text-align: center;
}
.toast-item.success { border-left-color: #22c55e; }
.toast-item.info { border-left-color: #3b82f6; }

/* ----------------------------------------------------
   RESPONSIVE ADAPTATIONS (MOBILE FIRST)
   ---------------------------------------------------- */
@media (max-width: 900px) {
    .av-body-grid {
        grid-template-columns: 1fr;
    }
    .av-sidebar {
        display: none;
    }
    .mobile-panel-switcher {
        display: flex;
    }
    .av-dual-controls {
        display: block;
    }
    .av-control-panel {
        display: none;
    }
    .av-control-panel.active {
        display: flex;
    }
    .av-dual-controls.show-both {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .av-dual-controls.show-both .av-control-panel {
        display: flex;
        padding: 6px 8px;
    }
    .av-dual-controls.show-both .btn-big-action {
        height: 56px;
    }
    .av-dual-controls.show-both .action-title {
        font-size: 1.05rem;
    }
    .av-dual-controls.show-both .action-sub {
        font-size: 0.75rem;
    }
    .av-big-multiplier {
        font-size: 4.2rem;
    }
}

@media (max-width: 540px) {
    .av-header {
        padding: 0 6px;
    }
    .av-header-right {
        gap: 4px;
    }
    .av-top-green-balance {
        font-size: 0.85rem;
    }
    .av-btn-header-dep {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
    .av-btn-header-with {
        padding: 5px 7px;
        font-size: 0.72rem;
    }
    .av-btn-header-status {
        padding: 5px 6px;
        font-size: 0.7rem;
    }
    .av-icon-menu {
        width: 30px;
        height: 28px;
    }
}
