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

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

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

/* ============================================================
   HEADER - Price + Buy Button
   ============================================================ */
.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: #fff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

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

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

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

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

.header-change.up {
    color: #00ba7c;
    background: rgba(0, 186, 124, 0.08);
}

.header-change.down {
    color: #f4212e;
    background: rgba(244, 33, 46, 0.08);
}

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

.buy-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: #fff;
    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 {
    transform: scale(0.96);
    box-shadow: 0 0 20px rgba(249, 115, 22, 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: #e7e7e8;
    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: #71767b;
}

.wallet-btn .balance {
    color: #fff;
    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: #71767b;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

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

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

/* ============================================================
   FIRE ANIMATION
   ============================================================ */
.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%, #fbbf24 40%, #f97316 70%, #dc2626 100%);
    animation: flicker 1.8s infinite alternate ease-in-out;
    filter: blur(1px);
}

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

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

.embers {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: radial-gradient(ellipse at 50% 100%, #f97316 0%, #dc2626 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(249, 115, 22, 0.08) 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.9;
    }
    50% {
        transform: translateX(-50%) scaleY(1.08) rotate(2deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scaleY(0.92) rotate(-1deg);
        opacity: 0.85;
    }
}

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

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

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

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

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

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

/* ============================================================
   STAKE CARD
   ============================================================ */
.stake-card {
    background: rgba(255, 255, 255, 0.02);
    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: #e7e7e8;
    display: block;
}

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

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

.stake-stat .label {
    font-size: 0.5rem;
    color: #71767b;
    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: #f97316;
    color: #fff;
    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: #ea580c;
    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: #71767b;
    white-space: nowrap;
}

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

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

.quick-stat {
    background: rgba(255, 255, 255, 0.02);
    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: #e7e7e8;
    display: block;
}

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

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

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

/* ============================================================
   DONATION SECTION
   ============================================================ */
.donation-section {
    background: rgba(255, 255, 255, 0.02);
    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: #71767b;
}

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

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

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

.donation-btn:hover {
    background: rgba(29, 155, 240, 0.08);
}

/* ============================================================
   RANK PROGRESS
   ============================================================ */
.rank-section {
    background: rgba(255, 255, 255, 0.02);
    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: #e7e7e8;
}

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

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

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

.rank-right .progress-text .highlight {
    color: #fbbf24;
    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, #fbbf24, #f97316);
    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: rgba(0, 0, 0, 0.92);
    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: #71767b;
    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: #e7e7e8;
}

.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: #1d9bf0;
}

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

/* ============================================================
   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(0, 0, 0, 0.8);
    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: #0a0a0f;
    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: #71767b;
    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: #fff;
}

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

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

.buy-fuel-modal-subtitle {
    font-size: 0.8rem;
    color: #71767b;
    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, #7b2ffc, #1d9bf0);
    color: #fff;
}

.buy-fuel-exchange-btn.stonfi {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    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: #71767b;
    font-weight: 500;
}

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

.buy-fuel-address-box .copy-btn {
    background: rgba(251, 191, 36, 0.08);
    border: none;
    color: #fbbf24;
    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(251, 191, 36, 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: #94a3b8;
}

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

/* ============================================================
   STAKING OVERLAY
   ============================================================ */
.staking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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 {
    display: flex;
}

.referral-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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;
}

.referral-overlay.active {
    display: flex;
}

.deposit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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;
}

.deposit-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: #71767b;
    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: #fff;
}

/* ============================================================
   SLIDEOUT TOGGLE
   ============================================================ */
.slideout-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-right: none;
    color: #f97316;
    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(0, 0, 0, 0.8);
}

.slideout-toggle:hover {
    background: rgba(249, 115, 22, 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: #94a3b8;
}

.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: #0a0a0f;
    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: #fbbf24;
    letter-spacing: 1px;
}

.slideout-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    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: #fff;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    z-index: 99999 !important;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    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, 186, 124, 0.15);
}

.toast.lose {
    border-color: rgba(244, 33, 46, 0.15);
}

.toast.gold {
    border-color: rgba(251, 191, 36, 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: #71767b;
}

.ticker-item .highlight {
    color: #1d9bf0;
    font-weight: 600;
}

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

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

/* ============================================================
   PREDICTION AREA
   ============================================================ */
.prediction-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    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: #71767b;
    padding: 0.1rem;
    min-height: 1.6rem;
    transition: all 0.3s;
    flex: 1;
}

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

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

.auto-bet-toggle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.6rem;
    border-radius: 40px;
    color: #71767b;
    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(255, 255, 255, 0.06);
}

.auto-bet-toggle.active {
    background: rgba(0, 186, 124, 0.06);
    border-color: rgba(0, 186, 124, 0.15);
    color: #00ba7c;
}

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

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

/* ============================================================
   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, 10, 26, 0.95) !important;
    border: 2px solid rgba(249, 115, 22, 0.4) !important;
    border-radius: 14px !important;
    padding: 16px 24px !important;
    z-index: 999999 !important;
    box-shadow: 0 0 60px rgba(249, 115, 22, 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: #fbbf24 !important;
    font-weight: 700 !important;
}

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

/* ============================================================
   CHAT SLIDEOUT
   ============================================================ */
.chat-slideout .slideout-content {
    background: radial-gradient(ellipse at 50% 0%, rgba(15, 12, 18, 0.98) 0%, #08060a 100%) !important;
    border-left: 1px solid rgba(255, 180, 50, 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: #fbbf24 !important;
}

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

.chat-slideout .slideout-close:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !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: #c4b4a4 !important;
}

.chat-slideout .channel-btn.active {
    border-color: rgba(251, 191, 36, 0.15) !important;
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.04) !important;
}

.chat-slideout .channel-btn.view {
    border-color: rgba(0, 186, 124, 0.06) !important;
    color: #00ba7c !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(251, 191, 36, 0.08) !important;
}

.chat-slideout .chat-input-area button {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    color: #0a080c !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: #fbbf24;
}

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

.market-slideout .slideout-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    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: #fff;
}

/* 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: #fff;
}

.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: #4ade80;
    opacity: 1;
}

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

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

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

.market-slideout .price-display .entry-price strong {
    color: #fbbf24;
    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: #6a6a80;
}

.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, #f59e0b, #fbbf24);
    border-radius: 10px;
    transition: width 0.3s ease;
}

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

.market-slideout .energy-bar .timer {
    font-size: 0.55rem;
    color: #6a6a80;
    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: #fbbf24;
}

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

.market-slideout .phase-label {
    font-size: 0.7rem;
    color: #94a3b8;
    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: #fbbf24;
    border-color: rgba(255, 215, 0, 0.15);
    background: rgba(255, 215, 0, 0.06);
}

.market-slideout .phase-label.watching {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.15);
    background: rgba(96, 165, 250, 0.06);
}

.market-slideout .phase-label.processing {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.15);
    background: rgba(167, 139, 250, 0.06);
}

.market-slideout .phase-label.ready {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.15);
    background: rgba(74, 222, 128, 0.06);
}

.market-slideout .auto-predict button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    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: #fbbf24;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
}

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

.market-slideout .auto-predict button.active .dot {
    background: #4ade80;
}

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

.market-slideout .pred-status.win {
    color: #4ade80;
}

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

/* 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: #6a6a80;
}

.market-slideout .bet-btn.up {
    border-color: rgba(74, 222, 128, 0.1);
}

.market-slideout .bet-btn.up .direction {
    color: #4ade80;
}

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

.market-slideout .bet-btn.down {
    border-color: rgba(248, 113, 113, 0.1);
}

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

.market-slideout .bet-btn.down:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.06);
    border-color: rgba(248, 113, 113, 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 - Complete Styles
   ============================================================ */

.referral-overlay .overlay-content {
    max-width: 500px;
    width: 100%;
    padding: 24px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    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(255, 215, 0, 0.2);
    border-radius: 10px;
}

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

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

/* 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: #fbbf24;
}

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

/* Rank Display */
.referral-overlay .rank-display {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 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: #e2e8f0;
    margin-top: 2px;
}

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

.referral-overlay .rank-level span {
    color: #fbbf24;
    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, #fbbf24, #f59e0b);
    border-radius: 20px;
    transition: width 0.5s ease;
}

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

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

/* 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: #94a3b8;
    letter-spacing: 0.5px;
}

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

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

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

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

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

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

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

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

.referral-overlay .next-rank-preview .need {
    font-size: 0.8rem;
    color: #fbbf24;
    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: #94a3b8;
    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: #6a6a80;
    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: #4a4a6a;
    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: #94a3b8;
    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: #e2e8f0;
    font-size: 0.8rem;
    font-family: monospace;
    outline: none;
}

.referral-overlay .referral-link-row input:focus {
    border-color: rgba(251, 191, 36, 0.2);
}

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

.referral-overlay .referral-copy-btn:hover {
    background: rgba(251, 191, 36, 0.25);
}

.referral-overlay .referral-footer {
    font-size: 0.6rem;
    color: #6a6a80;
    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 #10b981;
}

.referral-overlay .rank-item.active {
    background: rgba(251, 191, 36, 0.08);
    border-left: 3px solid #fbbf24;
}

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

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

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

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

.referral-overlay .rank-item .rank-badge.unlocked {
    color: #10b981;
}

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

.referral-overlay .rank-item .rank-badge.locked {
    color: #4a4a6a;
}

/* 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: #6a6a80;
    font-weight: 600;
    text-align: center;
}

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

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

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

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

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

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

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

.referral-overlay .lb-row.you-row {
    background: rgba(251, 191, 36, 0.06);
    border-left: 2px solid #fbbf24;
    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 (Converted from slideout)
   ============================================================ */
.market-slideout {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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, #0d0d14, #12121c);
    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(255, 215, 0, 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: #94a3b8;
    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: #fff;
}

/* ============================================================
   MARKET OVERLAY (Converted from slideout)
   ============================================================ */
.market-slideout {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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 !important;
    top: auto !important;
    transform: none !important;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    background: linear-gradient(145deg, #0d0d14, #12121c);
    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(255, 215, 0, 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: #94a3b8;
    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: #fff;
}

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

/* ============================================================
   MARKET OVERLAY
   ============================================================ */
.market-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 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;
}

.market-overlay.active {
    display: flex;
}

.market-overlay .overlay-content {
    max-width: 520px;
    width: 100%;
    padding: 28px;
    background: linear-gradient(145deg, #0d0d14, #12121c);
    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);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

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

.market-overlay .overlay-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
}

.market-overlay .overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #6a6a80;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.market-overlay .overlay-close:hover {
    color: #fff;
}

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

/* ============================================================
   CHAT PILLS - Active Glow Effect
   ============================================================ */
.pill.active {
    background: rgba(251, 191, 36, 0.08) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.12) !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.08), 0 0 40px rgba(251, 191, 36, 0.04) !important;
    transition: box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease !important;
}

.pill.active:hover {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.12), 0 0 60px rgba(251, 191, 36, 0.06) !important;
}

.pill.news.active {
    background: rgba(96, 165, 250, 0.08) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.15) !important;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.08), 0 0 40px rgba(96, 165, 250, 0.04) !important;
}

.pill.news.active:hover {
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.12), 0 0 60px rgba(96, 165, 250, 0.06) !important;
}

/* ============================================================
   CHAT PILLS - Base + Active Glow Effect
   ============================================================ */
.pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: #5a4a3a;
    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: #94a3b8;
    border-color: rgba(255, 255, 255, 0.06);
}

.pill.active {
    background: rgba(251, 191, 36, 0.12) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.3), 0 0 60px rgba(251, 191, 36, 0.1) !important;
}

.pill.view {
    border-color: rgba(74, 222, 128, 0.06);
    color: #4ade80;
}

.pill.news {
    border-color: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill.news:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.2);
}

.pill.news.active {
    background: rgba(96, 165, 250, 0.12) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.3), 0 0 60px rgba(96, 165, 250, 0.1) !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;
}

/* ============================================================
   CHAT PILLS - Full Color + Glow
   ============================================================ */
.pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: #94a3b8;
    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: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Current rank pill - always gold when active */
.pill.active {
    background: rgba(251, 191, 36, 0.12) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.25), 0 0 60px rgba(251, 191, 36, 0.08) !important;
}

/* View pill (next rank) - green */
.pill.view {
    border-color: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.pill.view:hover:not(.locked) {
    border-color: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

/* View pill when active (should stay green) */
.pill.view.active {
    background: rgba(74, 222, 128, 0.08) !important;
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.15) !important;
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.15), 0 0 60px rgba(74, 222, 128, 0.05) !important;
}

/* News pill */
.pill.news {
    border-color: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill.news:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.15);
}

.pill.news.active {
    background: rgba(96, 165, 250, 0.12) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.2), 0 0 60px rgba(96, 165, 250, 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;
}
