/* ============================================================
   FUEL - Professional Investment Theme
   Deep Navy:    #0a1628  (primary background)
   Navy Blue:    #1a2a4a  (cards, surfaces)
   White:        #ffffff  (primary text)
   Soft Gray:    #94a9c9  (secondary text)
   Bright Green: #00c853  (positive, wins)
   Soft Red:     #ff4757  (negative, losses)
   Accent Blue:  #2d7aff  (CTAs, active states)
   Subtle Gold:  #c9a84c  (APY, rewards - sparingly)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a1628;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app {
    max-width: 480px;
    width: 100%;
    min-height: 100vh;
    padding: 0 16px 80px;
    background: #0a1628;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 20px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.logo i {
    font-size: 1.2rem;
    color: #2d7aff;
}

.logo span {
    font-weight: 300;
    font-size: 0.65rem;
    color: #94a9c9;
}

.header-center {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.header-price {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.header-change {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.header-change.up {
    color: #00c853;
    background: rgba(0, 200, 83, 0.08);
}

.header-change.down {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.08);
}

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

.buy-btn {
    background: rgba(45, 122, 255, 0.12);
    border: 1px solid rgba(45, 122, 255, 0.15);
    color: #2d7aff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.buy-btn:hover {
    background: rgba(45, 122, 255, 0.2);
}

.buy-btn i {
    font-size: 0.7rem;
}

.wallet-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallet-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.wallet-btn i {
    font-size: 0.7rem;
    color: #94a9c9;
}

.wallet-btn .balance {
    color: #ffffff;
    font-weight: 600;
}

/* ============================================================
   CAMPFIRE HERO
   ============================================================ */
.campfire-hero {
    text-align: center;
    padding: 20px 0 16px;
    margin-bottom: 16px;
    position: relative;
}

.campfire-hero .village-title {
    font-size: 0.6rem;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.campfire-hero .village-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.campfire-hero .village-name i {
    color: #2d7aff;
    margin-right: 6px;
}

/* ============================================================
   FIRE ANIMATION - TONED DOWN
   ============================================================ */
.fire-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    position: relative;
}

.flame {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: bottom center;
}

.flame-1 {
    width: 32px;
    height: 70px;
    left: 38%;
    background: linear-gradient(180deg, #fff7a0 0%, #c9a84c 40%, #f97316 70%, #dc2626 100%);
    animation: flicker 1.8s infinite alternate ease-in-out;
    filter: blur(1px);
    opacity: 0.5;
}

.flame-2 {
    width: 40px;
    height: 85px;
    left: 50%;
    background: linear-gradient(180deg, #c9a84c 0%, #f97316 50%, #dc2626 100%);
    animation: flicker 2.2s infinite alternate-reverse ease-in-out;
    filter: blur(1px);
    opacity: 0.4;
}

.flame-3 {
    width: 28px;
    height: 60px;
    left: 62%;
    background: linear-gradient(180deg, #c9a84c 0%, #f97316 50%, #dc2626 100%);
    animation: flicker 1.6s infinite alternate ease-in-out;
    filter: blur(1px);
    opacity: 0.3;
}

.embers {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: radial-gradient(ellipse at 50% 100%, rgba(249, 115, 22, 0.3) 0%, rgba(220, 38, 38, 0.2) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(4px);
}

.fire-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: glowPulse 3s infinite alternate ease-in-out;
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) scaleY(1) rotate(-3deg);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-50%) scaleY(1.08) rotate(2deg);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-50%) scaleY(0.92) rotate(-1deg);
        opacity: 0.4;
    }
}

@keyframes glowPulse {
    0% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.fire-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a9c9;
    margin-bottom: 2px;
}

.fire-status i {
    margin-right: 4px;
}

.fire-timer {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.fire-timer.urgent {
    color: #ff4757;
    animation: pulse 0.8s infinite alternate;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.4;
    }
}

/* ============================================================
   STAKE CARD
   ============================================================ */
.stake-card {
    background: #1a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.stake-card:hover {
    border-color: rgba(255, 255, 255, 0.06);
}

.stake-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.stake-stat {
    text-align: center;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.stake-stat .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
}

.stake-stat .value.gold {
    color: #c9a84c;
}

.stake-stat .value.green {
    color: #00c853;
}

.stake-stat .label {
    font-size: 0.5rem;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stake-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.stake-feed-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 20px;
    border: none;
    background: #2d7aff;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.stake-feed-btn:hover:not(:disabled) {
    background: #1a5fc9;
    transform: scale(0.98);
}

.stake-feed-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.stake-feed-btn i {
    margin-right: 4px;
}

.stake-cost {
    font-size: 0.65rem;
    color: #94a9c9;
    white-space: nowrap;
}

.stake-cost .highlight {
    color: #c9a84c;
    font-weight: 600;
}

/* ============================================================
   QUICK STATS
   ============================================================ */
.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-stat {
    background: #1a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}

.quick-stat .num {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
}

.quick-stat .num.gold {
    color: #c9a84c;
}

.quick-stat .num.green {
    color: #00c853;
}

.quick-stat .label {
    font-size: 0.5rem;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================================
   DONATION SECTION
   ============================================================ */
.donation-section {
    background: #1a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.donation-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.donation-left .icon {
    font-size: 1.2rem;
    color: #94a9c9;
}

.donation-left .info .amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.donation-left .info .label {
    font-size: 0.55rem;
    color: #94a9c9;
}

.donation-btn {
    padding: 6px 16px;
    border-radius: 16px;
    border: 1px solid rgba(45, 122, 255, 0.15);
    background: rgba(45, 122, 255, 0.04);
    color: #2d7aff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.donation-btn:hover {
    background: rgba(45, 122, 255, 0.08);
}

/* ============================================================
   RANK PROGRESS
   ============================================================ */
.rank-section {
    background: #1a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-left .emoji {
    font-size: 1.4rem;
}

.rank-left .info .current {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.rank-left .info .next {
    font-size: 0.6rem;
    color: #94a9c9;
}

.rank-right {
    text-align: right;
}

.rank-right .progress-text {
    font-size: 0.65rem;
    color: #94a9c9;
}

.rank-right .progress-text .highlight {
    color: #c9a84c;
    font-weight: 600;
}

.rank-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.rank-progress .fill {
    height: 100%;
    background: linear-gradient(90deg, #2d7aff, #c9a84c);
    border-radius: 4px;
    width: 45%;
    transition: width 0.5s;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #0a1628;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 16px 12px;
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: #94a9c9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
    position: relative;
}

.nav-btn:hover {
    color: #ffffff;
}

.nav-btn .icon {
    font-size: 1.2rem;
}

.nav-btn .label {
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-btn.active {
    color: #2d7aff;
}

.nav-btn .badge {
    position: absolute;
    top: -2px;
    right: 2px;
    background: #2d7aff;
    color: #ffffff;
    font-size: 0.4rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

/* ============================================================
   PREDICTION AREA & AUTO-PREDICT BUTTON - FIXED
   ============================================================ */
.prediction-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1a2a4a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin: 12px 0;
}

.pred-status {
    text-align: center;
    font-size: 0.85rem;
    color: #94a9c9;
    padding: 0.1rem;
    min-height: 1.6rem;
    transition: all 0.3s;
    flex: 1;
}

.pred-status.win {
    color: #00c853;
}

.pred-status.lose {
    color: #ff4757;
}

/* AUTO-PREDICT BUTTON - CORRECTLY COLORED */
.auto-bet-toggle {
    background: rgba(45, 122, 255, 0.08);
    border: 1px solid rgba(45, 122, 255, 0.15);
    color: #2d7aff;
    padding: 0.2rem 0.6rem;
    border-radius: 40px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.auto-bet-toggle:hover {
    background: rgba(45, 122, 255, 0.15);
}

.auto-bet-toggle.active {
    background: rgba(0, 200, 83, 0.08);
    border-color: rgba(0, 200, 83, 0.15);
    color: #00c853;
}

.auto-bet-toggle .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2d7aff;
    transition: all 0.2s;
}

.auto-bet-toggle.active .dot {
    background: #00c853;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .app {
        padding: 0 12px 80px;
    }
    .header {
        flex-wrap: wrap;
        gap: 6px;
    }
    .logo {
        font-size: 1.2rem;
    }
    .header-price {
        font-size: 0.85rem;
    }
    .header-change {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    .buy-btn {
        font-size: 0.6rem;
        padding: 4px 10px;
    }
    .wallet-btn {
        font-size: 0.6rem;
        padding: 4px 10px;
    }
    .fire-timer {
        font-size: 1.8rem;
    }
    .fire-container {
        width: 100px;
        height: 100px;
    }
    .flame-1 {
        height: 55px;
        width: 26px;
    }
    .flame-2 {
        height: 70px;
        width: 34px;
    }
    .flame-3 {
        height: 45px;
        width: 22px;
    }
    .campfire-hero .village-name {
        font-size: 1.3rem;
    }
}

@media (max-height: 650px) {
    .campfire-hero {
        padding: 10px 0 8px;
    }
    .fire-container {
        width: 80px;
        height: 80px;
    }
    .flame-1 {
        height: 45px;
        width: 22px;
    }
    .flame-2 {
        height: 55px;
        width: 28px;
    }
    .flame-3 {
        height: 35px;
        width: 18px;
    }
    .fire-timer {
        font-size: 1.5rem;
    }
    .stake-grid {
        margin-bottom: 8px;
    }
    .stake-stat .value {
        font-size: 0.9rem;
    }
    .stake-actions {
        padding-top: 8px;
    }
    .stake-feed-btn {
        padding: 8px 12px;
        font-size: 0.7rem;
    }
    .quick-stats {
        gap: 4px;
    }
    .quick-stat {
        padding: 6px 4px;
    }
    .quick-stat .num {
        font-size: 0.8rem;
    }
}

/* ============================================================
   BUY FUEL MODAL
   ============================================================ */
.buy-fuel-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.buy-fuel-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.buy-fuel-modal-content {
    max-width: 380px;
    width: 90%;
    background: #1a2a4a;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.buy-fuel-modal.active .buy-fuel-modal-content {
    transform: scale(1);
}

.buy-fuel-modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a9c9;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.buy-fuel-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.buy-fuel-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #c9a84c;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.buy-fuel-modal-title i {
    font-size: 1.3rem;
    color: #2d7aff;
}

.buy-fuel-modal-subtitle {
    font-size: 0.8rem;
    color: #94a9c9;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.buy-fuel-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.buy-fuel-exchange-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 0.8rem;
    border: none;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: 'Inter', sans-serif;
}

.buy-fuel-exchange-btn:hover {
    transform: scale(0.96);
}

.buy-fuel-exchange-btn.dedust {
    background: linear-gradient(135deg, #2d7aff, #1a5fc9);
    color: #ffffff;
}

.buy-fuel-exchange-btn.stonfi {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.buy-fuel-exchange-btn.stonfi:hover {
    background: rgba(255, 255, 255, 0.08);
}

.buy-fuel-address-box {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.6rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.buy-fuel-address-box .address-label {
    font-size: 0.6rem;
    color: #94a9c9;
    font-weight: 500;
}

.buy-fuel-address-box .address {
    flex: 1;
    font-size: 0.6rem;
    color: #94a9c9;
    font-family: 'Inter', monospace;
    word-break: break-all;
    min-width: 100px;
}

.buy-fuel-address-box .copy-btn {
    background: rgba(45, 122, 255, 0.08);
    border: none;
    color: #2d7aff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.65rem;
    transition: 0.15s;
    white-space: nowrap;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.buy-fuel-address-box .copy-btn:hover {
    background: rgba(45, 122, 255, 0.15);
}

.buy-fuel-steps {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.buy-fuel-steps .step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.7rem;
    color: #94a9c9;
}

.buy-fuel-steps .step .num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(45, 122, 255, 0.06);
    color: #2d7aff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   OVERLAYS (Staking, Referral, Deposit, Market)
   ============================================================ */
.staking-overlay,
.referral-overlay,
.deposit-overlay,
.market-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.staking-overlay.active,
.referral-overlay.active,
.deposit-overlay.active,
.market-overlay.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.overlay-content {
    max-width: 480px;
    width: 100%;
    padding-bottom: 2rem;
    position: relative;
}

.overlay-close {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #94a9c9;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    margin-bottom: 1rem;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* ============================================================
   SLIDEOUT TOGGLE
   ============================================================ */
.slideout-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 122, 255, 0.08);
    border: 1px solid rgba(45, 122, 255, 0.15);
    border-right: none;
    color: #2d7aff;
    padding: 16px 12px 16px 16px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    background: rgba(10, 22, 40, 0.8);
}

.slideout-toggle:hover {
    background: rgba(45, 122, 255, 0.15);
}

.slideout-toggle .toggle-icon {
    font-size: 24px;
}

.slideout-toggle .toggle-label {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    color: #94a9c9;
}

/* ============================================================
   MARKET SLIDEOUT
   ============================================================ */
.market-slideout {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.market-slideout.open {
    pointer-events: all;
}

.slideout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.market-slideout.open .slideout-overlay {
    opacity: 1;
}

.slideout-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: #0a1628;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    padding: 20px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.market-slideout.open .slideout-content {
    right: 0;
}

.slideout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.slideout-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: 1px;
}

.slideout-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a9c9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideout-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    z-index: 99999 !important;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a2a4a;
    backdrop-filter: blur(8px);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    text-align: center;
    line-height: 1.4;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.win {
    border-color: rgba(0, 200, 83, 0.15);
}

.toast.lose {
    border-color: rgba(255, 71, 87, 0.15);
}

.toast.gold {
    border-color: rgba(201, 168, 76, 0.15);
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    padding: 0.15rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.01);
    margin: 12px 0;
}

.ticker-inner {
    display: flex;
    gap: 2rem;
    white-space: nowrap;
    animation: tickerScroll 90s linear infinite;
    width: max-content;
}

.ticker-item {
    display: inline-flex;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #94a9c9;
}

.ticker-item .highlight {
    color: #2d7aff;
    font-weight: 600;
}

.ticker-item .gold {
    color: #c9a84c;
    font-weight: 600;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================================
   DOWNLINE POPUP
   ============================================================ */
.downline-popup {
    position: fixed !important;
    top: 25% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 380px !important;
    width: 90% !important;
    text-align: center !important;
    background: rgba(10, 22, 40, 0.95) !important;
    border: 2px solid rgba(45, 122, 255, 0.4) !important;
    border-radius: 14px !important;
    padding: 16px 24px !important;
    z-index: 999999 !important;
    box-shadow: 0 0 60px rgba(45, 122, 255, 0.15) !important;
    display: none !important;
}

.downline-popup.show {
    display: block !important;
}

.downline-popup .emoji {
    font-size: 1.3rem !important;
    margin-right: 8px !important;
}

.downline-popup .wallet {
    color: #c9a84c !important;
    font-weight: 700 !important;
}

.downline-popup .sub-text {
    font-size: 0.8rem !important;
    color: #94a9c9 !important;
    margin-top: 4px !important;
}

/* ============================================================
   CHAT SLIDEOUT
   ============================================================ */
.chat-slideout .slideout-content {
    background: radial-gradient(ellipse at 50% 0%, rgba(26, 42, 74, 0.98) 0%, #0a1628 100%) !important;
    border-left: 1px solid rgba(45, 122, 255, 0.06) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6) !important;
}

.chat-slideout .slideout-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.chat-slideout .slideout-title {
    font-family: 'Cinzel', serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #c9a84c !important;
}

.chat-slideout .slideout-close {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: #94a9c9 !important;
    transition: all 0.3s ease !important;
}

.chat-slideout .slideout-close:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.chat-slideout .chat-messages {
    background: rgba(0, 0, 0, 0.15) !important;
    border-radius: 10px !important;
}

.chat-slideout .chat-channel-selector {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.02) !important;
}

.chat-slideout .channel-btn {
    padding: 4px 12px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: #5a4a3a !important;
    font-size: 0.6rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.chat-slideout .channel-btn:hover:not(.locked) {
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #94a9c9 !important;
}

.chat-slideout .channel-btn.active {
    border-color: rgba(45, 122, 255, 0.15) !important;
    color: #2d7aff !important;
    background: rgba(45, 122, 255, 0.04) !important;
}

.chat-slideout .channel-btn.view {
    border-color: rgba(0, 200, 83, 0.06) !important;
    color: #00c853 !important;
}

.chat-slideout .channel-btn.locked {
    opacity: 0.15 !important;
    cursor: not-allowed !important;
}

.chat-slideout .chat-input-area {
    border-top: 1px solid rgba(255, 255, 255, 0.02) !important;
}

.chat-slideout .chat-input-area input {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    color: #f0ece6 !important;
    outline: none !important;
    font-size: 0.8rem !important;
}

.chat-slideout .chat-input-area input:focus {
    border-color: rgba(45, 122, 255, 0.08) !important;
}

.chat-slideout .chat-input-area button {
    background: linear-gradient(135deg, #2d7aff, #1a5fc9) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
}

.chat-slideout .chat-input-area button:hover:not(:disabled) {
    transform: scale(0.96) !important;
}

.chat-slideout .chat-input-area button:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   MARKET SLIDEOUT - Complete Styles
   ============================================================ */
.market-slideout .slideout-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 500px;
}

.market-slideout .slideout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.market-slideout .slideout-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #c9a84c;
}

.market-slideout .slideout-subtitle {
    font-size: 0.65rem;
    color: #94a9c9;
    letter-spacing: 1px;
}

.market-slideout .slideout-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a9c9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-slideout .slideout-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Price Display */
.market-slideout .price-display {
    text-align: center;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.market-slideout .price-display .price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.market-slideout .price-display .current-price {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
}

.market-slideout .price-display .slideout-price-arrow {
    font-size: 1.8rem;
    font-weight: 900;
    opacity: 0.3;
}

.market-slideout .price-display .slideout-price-arrow.up {
    color: #00c853;
    opacity: 1;
}

.market-slideout .price-display .slideout-price-arrow.down {
    color: #ff4757;
    opacity: 1;
}

.market-slideout .price-display .slideout-price-arrow.neutral {
    color: #94a9c9;
    opacity: 0.5;
}

.market-slideout .price-display .entry-price {
    font-size: 0.75rem;
    color: #94a9c9;
}

.market-slideout .price-display .entry-price strong {
    color: #c9a84c;
    font-weight: 600;
}

/* Chart Area */
.market-slideout .chart-area {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.8rem;
    padding: 0.5rem;
    height: 210px;
    flex-shrink: 0;
}

.market-slideout .chart-area canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Energy Bar - Market */
.market-slideout .energy-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.4rem;
    flex-shrink: 0;
}

.market-slideout .energy-bar .icon {
    font-size: 0.8rem;
    color: #94a9c9;
}

.market-slideout .energy-bar .track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
}

.market-slideout .energy-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #2d7aff, #c9a84c);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.market-slideout .energy-bar .label {
    font-size: 0.65rem;
    color: #94a9c9;
    font-weight: 500;
    min-width: 28px;
}

.market-slideout .energy-bar .timer {
    font-size: 0.55rem;
    color: #94a9c9;
    min-width: 35px;
    text-align: right;
}

/* Timer + Auto Predict */
.market-slideout .timer-auto-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.market-slideout .timer-display {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #c9a84c;
}

.market-slideout .timer-display.urgent {
    color: #ff4757;
    animation: pulse 0.5s infinite alternate;
}

.market-slideout .phase-label {
    font-size: 0.7rem;
    color: #94a9c9;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.1rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.market-slideout .phase-label.betting {
    color: #c9a84c;
    border-color: rgba(201, 168, 76, 0.15);
    background: rgba(201, 168, 76, 0.06);
}

.market-slideout .phase-label.watching {
    color: #2d7aff;
    border-color: rgba(45, 122, 255, 0.15);
    background: rgba(45, 122, 255, 0.06);
}

.market-slideout .phase-label.processing {
    color: #94a9c9;
    border-color: rgba(148, 169, 201, 0.15);
    background: rgba(148, 169, 201, 0.06);
}

.market-slideout .phase-label.ready {
    color: #00c853;
    border-color: rgba(0, 200, 83, 0.15);
    background: rgba(0, 200, 83, 0.06);
}

.market-slideout .auto-predict button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a9c9;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.market-slideout .auto-predict button.active {
    border-color: #2d7aff;
    color: #2d7aff;
    background: rgba(45, 122, 255, 0.08);
}

.market-slideout .auto-predict button .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #94a9c9;
    display: inline-block;
}

.market-slideout .auto-predict button.active .dot {
    background: #00c853;
}

/* Prediction Status - Market */
.market-slideout .pred-status {
    text-align: center;
    font-size: 0.8rem;
    color: #94a9c9;
    flex-shrink: 0;
    padding: 0.1rem 0;
}

.market-slideout .pred-status.win {
    color: #00c853;
}

.market-slideout .pred-status.lose {
    color: #ff4757;
}

/* Bet Buttons - Market */
.market-slideout .bet-buttons {
    display: flex;
    gap: 0.8rem;
    flex: 1;
    min-height: 80px;
}

.market-slideout .bet-btn {
    flex: 1;
    padding: 0.8rem 0.3rem;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.market-slideout .bet-btn .direction {
    font-size: 2.4rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.market-slideout .bet-btn .amount {
    font-size: 0.7rem;
    color: #94a9c9;
}

.market-slideout .bet-btn.up {
    border-color: rgba(0, 200, 83, 0.1);
}

.market-slideout .bet-btn.up .direction {
    color: #00c853;
}

.market-slideout .bet-btn.up:hover:not(:disabled) {
    background: rgba(0, 200, 83, 0.06);
    border-color: rgba(0, 200, 83, 0.25);
    transform: scale(1.02);
}

.market-slideout .bet-btn.down {
    border-color: rgba(255, 71, 87, 0.1);
}

.market-slideout .bet-btn.down .direction {
    color: #ff4757;
}

.market-slideout .bet-btn.down:hover:not(:disabled) {
    background: rgba(255, 71, 87, 0.06);
    border-color: rgba(255, 71, 87, 0.25);
    transform: scale(1.02);
}

.market-slideout .bet-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive - Market */
@media (max-width: 480px) {
    .market-slideout .slideout-content {
        padding: 0.8rem;
        min-height: 450px;
    }
    .market-slideout .price-display .current-price {
        font-size: 1.8rem;
    }
    .market-slideout .price-display .slideout-price-arrow {
        font-size: 1.4rem;
    }
    .market-slideout .chart-area {
        height: 140px !important;
    }
    .market-slideout .bet-btn .direction {
        font-size: 2rem;
    }
    .market-slideout .bet-buttons {
        min-height: 70px;
    }
    .market-slideout .timer-display {
        font-size: 1.3rem;
    }
}

@media (max-height: 700px) {
    .market-slideout .chart-area {
        height: 120px !important;
    }
    .market-slideout .bet-buttons {
        min-height: 60px;
    }
    .market-slideout .bet-btn .direction {
        font-size: 1.8rem;
    }
    .market-slideout .price-display .current-price {
        font-size: 1.6rem;
    }
    .market-slideout .bet-btn {
        padding: 0.5rem 0.3rem;
    }
}

/* ============================================================
   ROYAL TREASURY / REFERRAL OVERLAY
   ============================================================ */
.referral-overlay .overlay-content {
    max-width: 500px;
    width: 100%;
    padding: 24px;
    background: linear-gradient(145deg, #1a2a4a, #0a1628);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.referral-overlay .overlay-content::-webkit-scrollbar {
    width: 4px;
}

.referral-overlay .overlay-content::-webkit-scrollbar-thumb {
    background: rgba(45, 122, 255, 0.2);
    border-radius: 10px;
}

.referral-overlay .overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #94a9c9;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
}

.referral-overlay .overlay-close:hover {
    color: #ffffff;
}

/* Royal Treasury Header */
.referral-overlay .treasury-header {
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.referral-overlay .treasury-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #c9a84c;
}

.referral-overlay .treasury-subtitle {
    font-size: 0.85rem;
    color: #94a9c9;
    margin-top: 4px;
}

/* Rank Display */
.referral-overlay .rank-display {
    background: rgba(45, 122, 255, 0.08);
    border: 1px solid rgba(45, 122, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 18px;
}

.referral-overlay .rank-emoji {
    font-size: 3.2rem;
}

.referral-overlay .rank-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 2px;
}

.referral-overlay .rank-level {
    font-size: 0.85rem;
    color: #94a9c9;
    margin-top: 4px;
}

.referral-overlay .rank-level span {
    color: #c9a84c;
    font-weight: 600;
}

.referral-overlay .rank-progress-wrap {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.referral-overlay .rank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2d7aff, #c9a84c);
    border-radius: 20px;
    transition: width 0.5s ease;
}

.referral-overlay .rank-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #94a9c9;
    margin-top: 6px;
}

.referral-overlay .rank-progress-labels span {
    color: #ffffff;
}

/* Stats Grid */
.referral-overlay .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.referral-overlay .stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.referral-overlay .stat-box .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #94a9c9;
    letter-spacing: 0.5px;
}

.referral-overlay .stat-box .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 4px;
}

.referral-overlay .stat-box .stat-value.gold {
    color: #c9a84c;
}

/* Kingdom List */
.referral-overlay .kingdom-section {
    margin-bottom: 14px;
}

.referral-overlay .kingdom-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Next Rank Preview */
.referral-overlay .next-rank-preview {
    background: rgba(45, 122, 255, 0.05);
    border: 1px dashed rgba(45, 122, 255, 0.2);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.referral-overlay .next-rank-preview .label {
    font-size: 0.7rem;
    color: #94a9c9;
}

.referral-overlay .next-rank-preview .emoji {
    font-size: 2rem;
}

.referral-overlay .next-rank-preview .name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.referral-overlay .next-rank-preview .need {
    font-size: 0.8rem;
    color: #c9a84c;
    margin-top: 4px;
}

.referral-overlay .next-rank-preview .need span {
    font-weight: 700;
}

/* Leaderboard */
.referral-overlay .leaderboard-section {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.referral-overlay .leaderboard-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
}

.referral-overlay .leaderboard-header {
    display: grid;
    grid-template-columns: 40px 1fr 100px;
    gap: 6px;
    padding: 6px 8px;
    font-size: 0.6rem;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 4px;
}

.referral-overlay .leaderboard-header span:last-child {
    text-align: right;
}

.referral-overlay .leaderboard-body {
    min-height: 100px;
}

.referral-overlay .leaderboard-update {
    font-size: 0.55rem;
    color: #94a9c9;
    text-align: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Referral Link */
.referral-overlay .referral-link-section {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.referral-overlay .referral-link-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a9c9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.referral-overlay .referral-link-row {
    display: flex;
    gap: 10px;
}

.referral-overlay .referral-link-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 0.8rem;
    font-family: monospace;
    outline: none;
}

.referral-overlay .referral-link-row input:focus {
    border-color: rgba(45, 122, 255, 0.2);
}

.referral-overlay .referral-copy-btn {
    background: rgba(45, 122, 255, 0.15);
    border: 1px solid rgba(45, 122, 255, 0.2);
    border-radius: 8px;
    padding: 10px 20px;
    color: #2d7aff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.referral-overlay .referral-copy-btn:hover {
    background: rgba(45, 122, 255, 0.25);
}

.referral-overlay .referral-footer {
    font-size: 0.6rem;
    color: #94a9c9;
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Rank Items in Kingdom List */
.referral-overlay .rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
}

.referral-overlay .rank-item.unlocked {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #00c853;
}

.referral-overlay .rank-item.active {
    background: rgba(45, 122, 255, 0.08);
    border-left: 3px solid #2d7aff;
}

.referral-overlay .rank-item.locked {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid #94a9c9;
    opacity: 0.4;
}

.referral-overlay .rank-item .rank-name-display {
    font-size: 0.9rem;
    color: #ffffff;
}

.referral-overlay .rank-item .rank-name-display.active-text {
    color: #2d7aff;
    font-weight: 600;
}

.referral-overlay .rank-item .rank-badge {
    font-size: 0.7rem;
}

.referral-overlay .rank-item .rank-badge.unlocked {
    color: #00c853;
}

.referral-overlay .rank-item .rank-badge.active {
    color: #2d7aff;
}

.referral-overlay .rank-item .rank-badge.locked {
    color: #94a9c9;
}

/* Leaderboard Row */
.referral-overlay .lb-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px;
    gap: 6px;
    padding: 6px 4px;
    border-radius: 6px;
    align-items: center;
    font-size: 0.8rem;
}

.referral-overlay .lb-row .rank-num {
    color: #94a9c9;
    font-weight: 600;
    text-align: center;
}

.referral-overlay .lb-row .rank-num.top1 {
    color: #c9a84c;
}

.referral-overlay .lb-row .rank-num.top2 {
    color: #94a9c9;
}

.referral-overlay .lb-row .rank-num.top3 {
    color: #c9a84c;
}

.referral-overlay .lb-row .player {
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.referral-overlay .lb-row .player.you {
    color: #c9a84c;
    font-weight: 700;
}

.referral-overlay .lb-row .lb-earnings {
    color: #c9a84c;
    font-weight: 600;
    text-align: right;
}

.referral-overlay .lb-row .lb-earnings .fuel {
    font-size: 0.6rem;
    color: #94a9c9;
    font-weight: 400;
}

.referral-overlay .lb-row.you-row {
    background: rgba(45, 122, 255, 0.06);
    border-left: 2px solid #2d7aff;
    border-radius: 6px;
}

/* Responsive - Royal Treasury */
@media (max-width: 480px) {
    .referral-overlay .overlay-content {
        padding: 16px;
        border-radius: 16px;
    }
    .referral-overlay .treasury-title {
        font-size: 1.4rem;
    }
    .referral-overlay .stats-grid {
        gap: 8px;
    }
    .referral-overlay .stat-box .stat-value {
        font-size: 1.2rem;
    }
    .referral-overlay .rank-emoji {
        font-size: 2.6rem;
    }
    .referral-overlay .rank-name {
        font-size: 1.1rem;
    }
    .referral-overlay .referral-link-row {
        flex-wrap: wrap;
    }
    .referral-overlay .referral-link-row input {
        min-width: 100%;
    }
}

@media (max-height: 650px) {
    .referral-overlay .overlay-content {
        padding: 14px;
    }
    .referral-overlay .rank-display {
        padding: 12px;
        margin-bottom: 12px;
    }
    .referral-overlay .stats-grid {
        margin-bottom: 12px;
    }
    .referral-overlay .stat-box {
        padding: 10px;
    }
    .referral-overlay .stat-box .stat-value {
        font-size: 1.1rem;
    }
    .referral-overlay .rank-emoji {
        font-size: 2.2rem;
    }
    .referral-overlay .rank-name {
        font-size: 1rem;
    }
    .referral-overlay .leaderboard-section {
        padding: 10px;
    }
    .referral-overlay .lb-row {
        font-size: 0.7rem;
        padding: 4px 2px;
    }
    .referral-overlay .referral-link-section {
        padding: 10px;
    }
    .referral-overlay .referral-link-row input {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    .referral-overlay .referral-copy-btn {
        padding: 6px 14px;
        font-size: 0.7rem;
    }
}

/* ============================================================
   MARKET OVERLAY STYLES
   ============================================================ */
.market-slideout {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.market-slideout.open {
    display: flex;
    pointer-events: all;
    opacity: 1;
}

.market-slideout .slideout-overlay {
    display: none;
}

.market-slideout .slideout-content {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a2a4a, #0a1628);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 450px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: scale(0.95);
    opacity: 0;
}

.market-slideout.open .slideout-content {
    transform: scale(1);
    opacity: 1;
}

.market-slideout .slideout-content::-webkit-scrollbar {
    width: 4px;
}

.market-slideout .slideout-content::-webkit-scrollbar-thumb {
    background: rgba(45, 122, 255, 0.2);
    border-radius: 10px;
}

.market-slideout .slideout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.market-slideout .slideout-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a9c9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.market-slideout .slideout-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Hide the slideout toggle button */
.slideout-toggle {
    display: none !important;
}

/* ============================================================
   DEPOSIT OVERLAY - FUEL STALL
   ============================================================ */
.deposit-overlay .overlay-content {
    max-width: 480px;
    width: 100%;
    padding: 24px;
    background: linear-gradient(145deg, #1a2a4a, #0a1628);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.deposit-overlay .overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #94a9c9;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
}

.deposit-overlay .overlay-close:hover {
    color: #ffffff;
}

.deposit-overlay .stall-token-btn {
    padding: 8px 6px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: #94a9c9;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.deposit-overlay .stall-token-btn.active {
    border-color: #2d7aff;
    color: #2d7aff;
    background: rgba(45, 122, 255, 0.04);
}

.deposit-overlay .stall-token-btn:hover:not(.active) {
    border-color: rgba(45, 122, 255, 0.2);
    color: #ffffff;
}

.deposit-overlay #stallBuyBtn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2d7aff, #1a5fc9);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.deposit-overlay #stallBuyBtn:hover {
    transform: scale(0.98);
}

/* ============================================================
   CHAT PILLS
   ============================================================ */
.pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: #94a9c9;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    user-select: none;
    flex-shrink: 0;
}

.pill:hover:not(.locked) {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.08);
}

.pill.active {
    background: rgba(45, 122, 255, 0.12) !important;
    color: #2d7aff !important;
    border-color: rgba(45, 122, 255, 0.2) !important;
    box-shadow: 0 0 30px rgba(45, 122, 255, 0.2), 0 0 60px rgba(45, 122, 255, 0.08) !important;
}

.pill.view {
    border-color: rgba(0, 200, 83, 0.1);
    color: #00c853;
}

.pill.view:hover:not(.locked) {
    border-color: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.pill.view.active {
    background: rgba(0, 200, 83, 0.08) !important;
    color: #00c853 !important;
    border-color: rgba(0, 200, 83, 0.15) !important;
    box-shadow: 0 0 30px rgba(0, 200, 83, 0.15), 0 0 60px rgba(0, 200, 83, 0.05) !important;
}

.pill.news {
    border-color: rgba(45, 122, 255, 0.1);
    color: #2d7aff;
    background: rgba(45, 122, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill.news:hover {
    background: rgba(45, 122, 255, 0.08);
    border-color: rgba(45, 122, 255, 0.15);
}

.pill.news.active {
    background: rgba(45, 122, 255, 0.12) !important;
    color: #2d7aff !important;
    border-color: rgba(45, 122, 255, 0.2) !important;
    box-shadow: 0 0 30px rgba(45, 122, 255, 0.2), 0 0 60px rgba(45, 122, 255, 0.08) !important;
}

.pill.locked {
    opacity: 0.2;
    cursor: not-allowed;
}

.pill .icon {
    font-size: 0.65rem;
}

#channelSelector::-webkit-scrollbar {
    height: 2px;
}

#channelSelector::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* ============================================================
   AUTO-PREDICT CONTROLS
   ============================================================ */

/* Toggle Switch */
.toggle {
    width: 40px;
    height: 22px;
    background: #1a2a4a;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.toggle.active {
    background: #2d7aff;
    border-color: rgba(45, 122, 255, 0.3);
}

.toggle .knob {
    width: 16px;
    height: 16px;
    background: #94a9c9;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle.active .knob {
    left: 20px;
    background: #ffffff;
}

/* Status Badge */
.status-badge {
    font-size: 0.5rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(0, 200, 83, 0.08);
    color: #00c853;
    border: 1px solid rgba(0, 200, 83, 0.06);
}

.status-badge.idle {
    background: rgba(148, 169, 201, 0.08);
    color: #94a9c9;
    border-color: rgba(148, 169, 201, 0.06);
}

.status-badge.stopped {
    background: rgba(255, 71, 87, 0.08);
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.06);
}

.status-badge.running {
    background: rgba(45, 122, 255, 0.12);
    color: #2d7aff;
    border-color: rgba(45, 122, 255, 0.15);
    animation: pulse-status 1.5s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Strategy Select */
.auto-strategy-select {
    background: #0a1628 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    outline: none !important;
    cursor: pointer !important;
    width: 100% !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.auto-strategy-select option {
    background: #0a1628 !important;
    color: #ffffff !important;
    padding: 4px 8px !important;
}

.auto-strategy-select option:hover {
    background: rgba(45, 122, 255, 0.1) !important;
}

.auto-strategy-select:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Direction Indicator */
.direction-indicator {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 6px;
}

.direction-indicator.up {
    color: #00c853;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.15);
}

.direction-indicator.down {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.15);
}

.direction-indicator.waiting {
    color: #94a9c9;
    background: rgba(148, 169, 201, 0.08);
    border: 1px solid rgba(148, 169, 201, 0.06);
}

/* Stop Button */
.btn-stop {
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.06);
    color: #ff4757;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.55rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-stop:hover:not(:disabled) {
    background: rgba(255, 71, 87, 0.15);
}

.btn-stop:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Stepper Buttons */
.stepper-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #94a9c9;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.6rem;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.stepper-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Auto Predict Panel */
.auto-predict-panel {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 14px 12px;
}
