/* ============================================
   HONZA3D - ULTIMATE CLICKER EMPIRE
   Premium CSS Design System
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }

:root {
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --red-400: #f87171;
    --red-500: #ef4444;
    --yellow-400: #facc15;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    --panel-bg: rgba(15, 23, 42, 0.95);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-hover: rgba(30, 41, 59, 0.8);
    --border-dim: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.12);
    --glow-orange: rgba(249, 115, 22, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

html, body {
    height: 100%; overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
    background: var(--slate-950);
    color: #e2e8f0;
    font-size: 16px;
    line-height: 1.4;
}

#bg-canvas {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-500); }

/* --- Typography --- */
.font-display { font-family: 'Orbitron', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
    position: relative; z-index: 1;
    display: flex; height: 100vh; width: 100%;
}

/* --- Clicker Panel (Left) --- */
.clicker-panel {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative; padding: 16px;
    background: radial-gradient(ellipse at 50% 40%, rgba(249,115,22,0.04) 0%, transparent 70%);
}

/* --- Top Bar --- */
.top-bar {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; z-index: 10;
}
.top-bar-left, .top-bar-right { display: flex; gap: 8px; align-items: center; }

.rebirth-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 700;
    color: var(--purple-400);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 6px 12px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 6px;
}

.boost-indicator {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 700;
    color: var(--yellow-400);
    background: rgba(250, 204, 21, 0.15);
    border: 1px solid rgba(250, 204, 21, 0.3);
    padding: 6px 12px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 6px;
    animation: boostPulse 1s infinite alternate;
}
@keyframes boostPulse {
    from { box-shadow: 0 0 8px rgba(250,204,21,0.2); }
    to { box-shadow: 0 0 20px rgba(250,204,21,0.4); }
}

.icon-btn {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--card-bg); border: 1px solid var(--border-dim);
    color: #94a3b8; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition-fast);
    position: relative;
}
.icon-btn:hover { background: var(--card-hover); color: white; border-color: var(--border-light); }

.notif-dot {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red-500);
    animation: notifPulse 1.5s infinite;
}
@keyframes notifPulse { 50% { opacity: 0.5; } }

/* --- Game Title --- */
.game-title {
    text-align: center; margin-bottom: 20px;
    user-select: none; pointer-events: none;
}
.title-text {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 900; font-style: italic;
    background: linear-gradient(180deg, #fdba74 0%, var(--orange-500) 40%, var(--orange-700) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(249,115,22,0.3));
    line-height: 1;
}
.title-sub {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(10px, 2vw, 14px);
    font-weight: 500; letter-spacing: 0.4em;
    color: rgba(249, 115, 22, 0.4);
    text-transform: uppercase;
    margin-top: 4px;
}

/* --- Printer Button --- */
.printer-wrapper {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; margin-bottom: 24px;
}

.printer-glow {
    position: absolute;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
    pointer-events: none;
    transition: all 0.3s;
}

.printer-btn {
    position: relative;
    width: clamp(140px, 30vw, 200px);
    height: clamp(140px, 30vw, 200px);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(51, 65, 85, 0.8), rgba(15, 23, 42, 0.9));
    border: 2px solid rgba(249, 115, 22, 0.25);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 
        0 0 40px rgba(249, 115, 22, 0.1),
        inset 0 -4px 12px rgba(0,0,0,0.3),
        inset 0 2px 8px rgba(255,255,255,0.03);
    z-index: 2;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.printer-btn:hover {
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 0 60px rgba(249, 115, 22, 0.2), inset 0 -4px 12px rgba(0,0,0,0.3);
}
.printer-btn:active {
    transform: scale(0.92);
    border-color: var(--orange-500);
    box-shadow: 0 0 80px rgba(249, 115, 22, 0.35);
}

.printer-inner { position: relative; display: flex; align-items: center; justify-content: center; }
.printer-emoji {
    font-size: clamp(48px, 10vw, 72px);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transition: transform 0.1s;
    pointer-events: none;
}
.printer-btn:active .printer-emoji { transform: scale(0.9); }

.printer-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(249,115,22,0.1);
    pointer-events: none;
    animation: ringPulse 3s infinite;
}
.ring-1 { width: 130%; height: 130%; animation-delay: 0s; }
.ring-2 { width: 160%; height: 160%; animation-delay: 1s; }
.ring-3 { width: 190%; height: 190%; animation-delay: 2s; }

@keyframes ringPulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

/* Combo Display */
.combo-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: 800;
    color: var(--yellow-400);
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.25);
    padding: 4px 16px; border-radius: var(--radius-xl);
    margin-top: 12px;
    animation: comboGlow 0.5s infinite alternate;
}
@keyframes comboGlow {
    from { text-shadow: 0 0 5px rgba(250,204,21,0.3); }
    to { text-shadow: 0 0 15px rgba(250,204,21,0.6); }
}

/* --- Money Display --- */
.money-section { text-align: center; margin-bottom: 20px; }

.money-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 900; color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(255,255,255,0.1);
    transition: transform 0.1s;
}
.money-amount.bump { transform: scale(1.03); }

.money-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.stat-chip {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 600;
    padding: 6px 14px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 6px;
}
.stat-auto {
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.15);
}
.stat-click {
    color: var(--orange-400);
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

/* --- Bottom Actions --- */
.bottom-actions {
    display: flex; gap: 10px;
    position: absolute; bottom: 16px; left: 16px; right: 16px;
    justify-content: center;
}

.action-btn {
    flex: 1; max-width: 200px;
    padding: 12px 16px; border-radius: var(--radius-md);
    border: 1px solid var(--border-dim);
    background: var(--card-bg);
    color: #cbd5e1;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.action-btn i { font-size: 18px; margin-bottom: 2px; }
.action-btn:hover { background: var(--card-hover); border-color: var(--border-light); }

.wheel-btn i { color: var(--purple-400); }
.wheel-btn:hover { border-color: rgba(168,85,247,0.3); }
.lb-btn i { color: var(--yellow-400); }
.lb-btn:hover { border-color: rgba(250,204,21,0.3); }

.action-status {
    font-size: 9px; font-weight: 600;
    color: var(--green-400); letter-spacing: 0.1em;
}

/* ============================================
   SHOP PANEL (Right)
   ============================================ */
.shop-panel {
    width: 380px; display: flex; flex-direction: column;
    background: var(--panel-bg);
    border-left: 1px solid var(--border-dim);
    backdrop-filter: blur(20px);
}

.shop-header {
    padding: 16px; border-bottom: 1px solid var(--border-dim);
    background: rgba(0,0,0,0.2);
}
.shop-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px; font-weight: 700;
    color: var(--orange-500);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.shop-tabs { display: flex; gap: 4px; }
.shop-tab {
    flex: 1; padding: 8px 12px; border-radius: var(--radius-sm);
    background: transparent; border: 1px solid var(--border-dim);
    color: #64748b; font-family: 'Rajdhani', sans-serif;
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.shop-tab.active {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--orange-400);
}
.shop-tab:hover:not(.active) { background: var(--card-bg); color: #94a3b8; }

/* --- Shop Content --- */
.shop-content {
    flex: 1; overflow-y: auto; padding: 12px;
    -webkit-overflow-scrolling: touch;
}

/* --- Upgrade Cards --- */
.upgrade-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; margin-bottom: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition-fast);
    position: relative; overflow: hidden;
}
.upgrade-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 3px;
}
.upgrade-card.type-auto::before { background: var(--blue-500); }
.upgrade-card.type-click::before { background: var(--orange-500); }

.upgrade-card:hover { background: var(--card-hover); border-color: var(--border-light); }
.upgrade-card:active { transform: scale(0.98); }
.upgrade-card.cant-afford { opacity: 0.35; }
.upgrade-card.cant-afford:hover { opacity: 0.5; }

.upgrade-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.type-auto .upgrade-icon { background: rgba(59,130,246,0.1); }
.type-click .upgrade-icon { background: rgba(249,115,22,0.1); }

.upgrade-info { flex: 1; min-width: 0; }
.upgrade-name {
    font-size: 13px; font-weight: 700; color: #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upgrade-effect {
    font-size: 10px; font-weight: 600;
    color: #64748b; margin-top: 1px;
}
.upgrade-owned {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; color: #475569;
    margin-top: 2px;
}

.upgrade-right { text-align: right; flex-shrink: 0; }
.upgrade-cost {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 700;
    color: var(--orange-400);
    white-space: nowrap;
}
.upgrade-card.cant-afford .upgrade-cost { color: var(--red-400); }

.upgrade-buy-max {
    margin-top: 4px; padding: 3px 10px;
    border-radius: 4px; border: 1px solid var(--border-dim);
    background: rgba(255,255,255,0.05);
    color: #64748b; font-size: 9px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.upgrade-buy-max:hover { background: rgba(255,255,255,0.1); color: #94a3b8; }

/* --- Boost Cards --- */
.boost-card {
    padding: 14px; margin-bottom: 8px;
    background: var(--card-bg); border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition-fast);
}
.boost-card:hover { background: var(--card-hover); border-color: var(--border-light); }
.boost-card.cant-afford { opacity: 0.35; }
.boost-card.active-boost { border-color: var(--yellow-400); background: rgba(250,204,21,0.05); }

.boost-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.boost-icon { font-size: 24px; }
.boost-name { font-weight: 700; font-size: 14px; }
.boost-desc { font-size: 11px; color: #64748b; margin-bottom: 8px; }
.boost-cost-row { display: flex; justify-content: space-between; align-items: center; }
.boost-cost {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px; font-weight: 700; color: var(--orange-400);
}
.boost-card.cant-afford .boost-cost { color: var(--red-400); }
.boost-duration {
    font-size: 10px; color: #475569; font-weight: 600;
}

/* --- Rebirth Section --- */
.rebirth-section {
    padding: 14px; border-top: 1px solid var(--border-dim);
    background: rgba(0,0,0,0.3);
}

.rebirth-progress { margin-bottom: 10px; }
.rebirth-progress-labels {
    display: flex; justify-content: space-between;
    font-size: 10px; font-weight: 700;
    color: #475569; text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 6px;
}
.rebirth-progress-labels span:last-child { color: var(--orange-500); }

.rebirth-bar-track {
    height: 6px; background: rgba(0,0,0,0.4);
    border-radius: 10px; overflow: hidden;
}
.rebirth-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--orange-600), var(--orange-400));
    border-radius: 10px; transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(249,115,22,0.3);
}

.rebirth-btn {
    width: 100%; padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-dim);
    color: #475569; font-family: 'Rajdhani', sans-serif;
    cursor: not-allowed; transition: var(--transition-normal);
    display: flex; justify-content: space-between; align-items: center;
}
.rebirth-btn:disabled { opacity: 0.5; }

.rebirth-btn.ready {
    cursor: pointer; opacity: 1;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(168, 85, 247, 0.15));
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--purple-400);
    animation: rebirthGlow 2s infinite alternate;
}
@keyframes rebirthGlow {
    from { box-shadow: 0 0 10px rgba(168,85,247,0.1); }
    to { box-shadow: 0 0 25px rgba(168,85,247,0.25); }
}
.rebirth-btn.ready:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(168, 85, 247, 0.25));
}

.rebirth-btn-content { display: flex; align-items: center; gap: 10px; }
.rebirth-btn-content i { font-size: 18px; }
.rebirth-btn-title { font-size: 13px; font-weight: 700; text-transform: uppercase; text-align: left; }
.rebirth-btn-sub { font-size: 10px; opacity: 0.7; text-align: left; }

.rebirth-btn-cost {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
}

/* ============================================
   MOBILE LAYOUT
   ============================================ */
.mobile-tabs {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.98);
    border-top: 1px solid var(--border-dim);
    backdrop-filter: blur(20px);
    padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
}
.mobile-tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    padding: 8px; border-radius: var(--radius-sm);
    background: transparent; border: none;
    color: #475569; font-size: 10px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.mobile-tab i { font-size: 18px; }
.mobile-tab.active { color: var(--orange-500); }

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .clicker-panel { height: 100vh; padding-bottom: 70px; }
    .shop-panel {
        position: fixed; inset: 0; z-index: 40;
        width: 100%; transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .shop-panel.show { transform: translateX(0); }
    .mobile-tabs { display: flex; }
    .bottom-actions { bottom: 70px; }
    .game-title { margin-bottom: 12px; }
    .printer-wrapper { margin-bottom: 16px; }
}

/* ============================================
   MONEY PARTICLES
   ============================================ */
.money-particle {
    position: fixed; z-index: 100;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px; font-weight: 800;
    color: var(--orange-400);
    text-shadow: 0 0 8px rgba(249,115,22,0.5);
    animation: particleFly 1s ease-out forwards;
}
@keyframes particleFly {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-120px) scale(0.7); opacity: 0; }
}

/* Critical hit particle */
.money-particle.crit {
    font-size: 22px;
    color: var(--yellow-400);
    text-shadow: 0 0 12px rgba(250,204,21,0.6);
    animation: critFly 1.2s ease-out forwards;
}
@keyframes critFly {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    30% { transform: translateY(-30px) scale(1.5); }
    100% { transform: translateY(-160px) scale(0.8); opacity: 0; }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--slate-900);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-height: 90vh; display: flex; flex-direction: column;
    animation: modalSlide 0.25s ease;
    width: 100%;
}
@keyframes modalSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 500px; }
.modal-lg { max-width: 600px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-dim);
}
.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px; font-weight: 700;
    color: var(--orange-500);
    display: flex; align-items: center; gap: 8px;
}
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--border-dim);
    color: #64748b; cursor: pointer; transition: var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--card-hover); color: white; }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* --- Settings --- */
.settings-group { display: flex; flex-direction: column; gap: 2px; }
.setting-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.setting-item:hover { background: var(--card-bg); }
.setting-item span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.setting-item i { color: #64748b; width: 18px; text-align: center; }
.setting-item.danger { color: var(--red-400); }
.setting-item.danger i { color: var(--red-400); }

.settings-btn {
    padding: 6px 14px; border-radius: var(--radius-sm);
    background: var(--card-bg); border: 1px solid var(--border-dim);
    color: #94a3b8; font-size: 11px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
}
.settings-btn:hover { background: var(--card-hover); color: white; }
.danger-btn { color: var(--red-400); border-color: rgba(239,68,68,0.2); }
.danger-btn:hover { background: rgba(239,68,68,0.1); }

.settings-divider { height: 1px; background: var(--border-dim); margin: 10px 0; }

.settings-footer { text-align: center; margin-top: 20px; }
.settings-footer p { font-size: 11px; color: #334155; }

/* Toggle switch */
.setting-item input[type="checkbox"] {
    appearance: none; width: 40px; height: 22px;
    background: #334155; border-radius: 11px;
    position: relative; cursor: pointer;
    transition: background 0.2s;
}
.setting-item input[type="checkbox"]::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; border-radius: 50%;
    background: white; top: 2px; left: 2px;
    transition: transform 0.2s;
}
.setting-item input[type="checkbox"]:checked { background: var(--orange-500); }
.setting-item input[type="checkbox"]:checked::before { transform: translateX(18px); }

/* --- Stats Modal --- */
.stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border-dim);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 13px; color: #64748b; font-weight: 600; }
.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px; font-weight: 700; color: white;
}

/* --- Achievements --- */
.ach-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: #64748b; margin-left: 8px;
}
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .ach-grid { grid-template-columns: 1fr; } }

.ach-card {
    padding: 14px; border-radius: var(--radius-md);
    background: var(--card-bg); border: 1px solid var(--border-dim);
    transition: var(--transition-fast);
}
.ach-card.earned {
    border-color: rgba(250, 204, 21, 0.3);
    background: rgba(250, 204, 21, 0.03);
}
.ach-card.locked { opacity: 0.3; }
.ach-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ach-icon { font-size: 24px; }
.ach-name { font-size: 13px; font-weight: 700; }
.ach-desc { font-size: 10px; color: #64748b; }

/* --- Wheel --- */
.wheel-body { display: flex; flex-direction: column; align-items: center; }

.wheel-container {
    position: relative;
    width: 280px; height: 280px;
    margin-bottom: 20px;
}
.wheel-pointer {
    position: absolute; top: -4px; left: 50%;
    transform: translateX(-50%);
    font-size: 24px; color: white; z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
#wheel-canvas { border-radius: 50%; box-shadow: 0 0 30px rgba(168,85,247,0.2); }

.spin-btn {
    width: 100%; padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
    border: none; color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
    cursor: pointer; transition: var(--transition-fast);
    box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.spin-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(168,85,247,0.4); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.wheel-timer {
    text-align: center; margin-top: 12px;
    font-size: 13px; font-weight: 700;
    color: var(--purple-400);
}

/* --- Leaderboard --- */
.lb-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.lb-tab {
    flex: 1; padding: 8px; border-radius: var(--radius-sm);
    background: transparent; border: 1px solid var(--border-dim);
    color: #475569; font-family: 'Rajdhani', sans-serif;
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
    text-transform: uppercase;
}
.lb-tab.active {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--orange-400);
}

.lb-content { min-height: 200px; max-height: 350px; overflow-y: auto; }

.lb-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: var(--card-bg); border: 1px solid var(--border-dim);
    transition: var(--transition-fast);
}
.lb-row.me {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
}
.lb-row.top3 { border-color: rgba(250, 204, 21, 0.2); }

.lb-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px; font-weight: 800;
    width: 28px; color: #475569;
}
.lb-row.top3 .lb-rank { color: var(--yellow-400); }

.lb-name { font-weight: 700; font-size: 13px; flex: 1; margin-left: 8px; }
.lb-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 700; color: var(--orange-400);
}

.lb-footer {
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border-dim);
    display: flex; justify-content: space-between; align-items: center;
}
.lb-label { font-size: 10px; color: #475569; text-transform: uppercase; font-weight: 700; }
.lb-player-name { font-size: 15px; font-weight: 800; color: var(--orange-400); margin-left: 8px; }
.lb-change-btn {
    padding: 6px 14px; border-radius: var(--radius-sm);
    background: var(--card-bg); border: 1px solid var(--border-dim);
    color: #94a3b8; font-size: 11px; font-weight: 700;
    cursor: pointer; transition: var(--transition-fast);
}
.lb-change-btn:hover { background: var(--card-hover); color: white; }

/* --- Offline Earnings --- */
.offline-body { text-align: center; }
.offline-icon { font-size: 64px; margin-bottom: 12px; }
.offline-text { font-size: 14px; color: #94a3b8; margin-bottom: 8px; }
.offline-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px; font-weight: 900;
    color: var(--green-400);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(74,222,128,0.3);
}
.offline-collect-btn {
    width: 100%; padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--green-500), #16a34a);
    border: none; color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px; font-weight: 800;
    text-transform: uppercase; cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}
.offline-collect-btn:hover { transform: translateY(-1px); }

/* --- Toast Notifications --- */
#toast-container {
    position: fixed; top: 16px; right: 16px;
    z-index: 9999; display: flex; flex-direction: column;
    gap: 8px; pointer-events: none;
}
.toast {
    padding: 12px 18px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 700;
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; gap: 8px;
}
.toast.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: var(--green-400); }
.toast.info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--blue-400); }
.toast.warning { background: rgba(250,204,21,0.15); border: 1px solid rgba(250,204,21,0.3); color: var(--yellow-400); }
.toast.achievement { background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3); color: var(--purple-400); }

@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* --- Utility --- */
.hidden { display: none !important; }

/* Tier badges */
.tier-badge {
    font-size: 8px; font-weight: 800;
    padding: 1px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-left: 6px;
}
.tier-1 { background: rgba(100,116,139,0.2); color: #94a3b8; }
.tier-2 { background: rgba(34,197,94,0.15); color: var(--green-400); }
.tier-3 { background: rgba(59,130,246,0.15); color: var(--blue-400); }
.tier-4 { background: rgba(168,85,247,0.15); color: var(--purple-400); }
.tier-5 { background: rgba(249,115,22,0.15); color: var(--orange-400); }
.tier-6 { background: rgba(250,204,21,0.15); color: var(--yellow-400); }
.tier-7 { background: rgba(239,68,68,0.15); color: var(--red-400); }

/* Screen shake on big events */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
.shake { animation: shake 0.3s ease; }

/* Rebirth flash */
@keyframes rebirthFlash {
    0% { background: rgba(168,85,247,0.6); }
    100% { background: transparent; }
}
.rebirth-flash {
    position: fixed; inset: 0; z-index: 9998;
    pointer-events: none;
    animation: rebirthFlash 0.8s ease forwards;
}
