/* css/aviator.css */

/* --- 1. RESET & BASE --- */

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* --- 2. GAME HEADER (Fixed Position) --- */

.game-header {
    height: 40px;
    background: #1b1c1d;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    flex-shrink: 0;
    z-index: 90;
    width: 100%;
    position: relative;
    /* ✅ ADDED MARGIN TOP: To show your included PHP header */
    margin-top: 60px;
}

.logo-img {
    height: 18px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bal-amount {
    color: #28a909;
    font-weight: 700;
    font-size: 14px;
}

.currency {
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    margin-left: 2px;
}

.header-icon {
    width: 20px;
    height: 20px;
    fill: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* HISTORY DROPDOWN */

.history-dropdown {
    position: absolute;
    /* ✅ Adjusted Top to account for margin */
    top: 40px;
    left: 0;
    width: 100%;
    background: #000;
    z-index: 1000;
    border-bottom: 1px solid #333;
    display: none;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

.hd-header {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 12px;
}

.hd-close {
    cursor: pointer;
    color: #888;
    font-size: 14px;
}

.hd-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hd-item {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
    background: transparent;
    border-radius: 6px;
    border: 1px solid #222;
    text-align: center;
    min-width: 50px;
}

.hd-footer {
    margin-top: 15px;
    text-align: center;
    color: #444;
    font-size: 10px;
    text-transform: uppercase;
}

/* --- 3. LAYOUT --- */

.main-wrapper {
    flex: 1;
    display: flex;
    width: 100%;
    height: auto;
    position: relative;
    padding-bottom: 40px;
}

.sidebar {
    width: 300px;
    background: #151515;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: calc(100vh - 100px);
    position: sticky;
    top: 100px;
}

.bet-header {
    padding: 10px;
    background: #222;
    font-size: 12px;
    color: #888;
    text-align: center;
}

.bet-list {
    flex: 1;
    overflow-y: auto;
    font-size: 13px;
    color: #666;
    padding: 10px;
    text-align: center;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    position: relative;
    width: 100%;
}

/* --- HISTORY STRIP --- */

.history-strip-wrapper {
    background: transparent;
    padding: 2px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-list {
    display: flex;
    gap: 6px;
    overflow: hidden;
    align-items: center;
    flex: 1;
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.hist-item {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0.9;
}

.color-blue {
    color: #3b82f6;
}

.color-purple {
    color: #8b5cf6;
}

.color-pink {
    color: #d946ef;
}

.history-btn {
    background: #252525;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0px 6px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
}

/* --- STAGE --- */

.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    min-height: 220px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* BG ROTATE */

.bg-rotate {
    position: absolute;
    width: 450%;
    height: 450%;
    left: 0;
    bottom: 0;
    transform: translate(-50%, 50%);
    background: url('../images/bg-rotate-old.svg') no-repeat center;
    background-size: contain;
    opacity: 0.65;
    z-index: 0;
    pointer-events: none;
    animation: spin 80s linear infinite;
}

.bg-rotate.paused {
    animation-play-state: paused !important;
}

@keyframes spin {
    from {
        transform: translate(-50%, 50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, 50%) rotate(360deg);
    }
}

/* SMOKE EFFECT */

.smoke-bg {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 80px;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    filter: blur(35px);
    opacity: 0.95;
    transition: background 0.5s ease;
}

.smoke-blue {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.9) 0%, rgba(59, 130, 246, 0.2) 60%, transparent 70%);
}

.smoke-purple {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.9) 0%, rgba(139, 92, 246, 0.2) 60%, transparent 70%);
}

.smoke-pink {
    background: radial-gradient(circle, rgba(217, 70, 239, 0.9) 0%, rgba(217, 70, 239, 0.2) 60%, transparent 70%);
}

/* CANVAS */

canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 2;
}

/* TEXT */

.center-info {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#multiplier {
    font-size: 60px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    order: 2;
}

.flew-text {
    font-size: 22px;
    font-weight: 500;
    color: #fff;
    display: none;
    margin-bottom: 5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    order: 1;
    text-transform: uppercase;
}

/* LOADER */

.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.ufc-logo {
    width: 220px;
    height: auto;
    margin-bottom: 2px;
}

.spribe-badge {
    width: 240px;
    height: auto;
    margin-top: 2px;
}

.loading-area {
    width: 220px;
    position: relative;
}

.load-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.load-fill {
    width: 100%;
    height: 100%;
    background: #e50539;
    border-radius: 2px;
    box-shadow: 0 0 10px #e50539;
}

.loading-plane {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 90px;
    opacity: 0.9;
    filter: drop-shadow(0 0 5px #e50539);
}

/* --- CONTROLS --- */

.controls {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    z-index: 50;
}

.bet-panels-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.bet-panel {
    position: relative;
    flex: 1;
    min-width: 320px;
    max-width: 480px;
    background: #151515;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.panel-toggle-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.icon-plus {
    background: #28a909;
}

.icon-minus {
    background: #e50539;
}

.panel-tabs {
    display: flex;
    background: #000;
    border-radius: 20px;
    padding: 2px;
    width: 50%;
    margin: 0 auto;
    border: 1px solid #333;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    color: #777;
    cursor: pointer;
    border-radius: 15px;
    font-weight: bold;
    transition: 0.3s;
}

.tab-btn.active {
    background: #333;
    color: #fff;
}

.panel-body {
    display: flex;
    gap: 10px;
    height: 85px;
}

.left-controls {
    width: 140px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
}

.right-btn {
    flex: 1;
    height: 100%;
}

.stepper {
    background: #1a1a1a;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    height: 32px;
    border: 1px solid #333;
}

.stepper button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #252525;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.stepper input {
    background: transparent;
    border: none;
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
}

.btns-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 2px;
}

.q-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 12px;
    font-size: 10px;
    padding: 6px 0;
    cursor: pointer;
    font-weight: bold;
}

.main-btn {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-text-large {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 2px;
}

.btn-text-small {
    font-size: 14px;
    font-weight: 400;
}

.btn-green {
    background: #28a909;
    box-shadow: 0 4px 0 #186606;
    color: #fff;
    border: 1px solid #ffffff;
}

.btn-green:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #186606;
}

.btn-orange {
    background: #ff8c00;
    box-shadow: 0 4px 0 #cc7000;
    color: #fff;
}

.btn-red {
    background: #e50539;
    box-shadow: 0 4px 0 #9f0427;
    color: #fff;
}

.auto-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #222;
    margin-top: 4px;
}

.auto-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #ccc;
    background: #080808;
    padding: 4px 8px;
    border-radius: 15px;
    border: 1px solid #222;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #28a909;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.cashout-input-wrapper {
    display: flex;
    align-items: center;
    background: #000;
    border-radius: 12px;
    padding: 2px 5px;
    width: 60px;
    border: 1px solid #333;
    margin-left: 5px;
}

.cashout-input-box {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    text-align: center;
    font-weight: bold;
}

.cashout-close {
    color: #666;
    font-size: 10px;
    cursor: pointer;
    margin-left: 2px;
    padding: 2px;
}

.hidden {
    display: none !important;
}

/* MODALS */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 55px;
}

.modal-content {
    background: #151515;
    border: 1px solid #333;
    border-radius: 0 0 15px 15px;
    width: 100%;
    max-width: 100%;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
}

.close-btn {
    background: #333;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.modal-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    justify-content: flex-start;
}

.modal-pill {
    background: transparent;
    border: none;
    padding: 1px 4px;
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
}

.modal-pill.color-blue {
    color: #3b82f6;
}

.modal-pill.color-purple {
    color: #8b5cf6;
}

.modal-pill.color-pink {
    color: #d946ef;
}

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }
    .bet-panels-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    .bet-panel {
        width: 100%;
        max-width: none;
    }
    .stage {
        height: auto;
        min-height: 220px;
    }
}