@import url('https://fonts.googleapis.com/css2?family=Rye&family=Barlow+Condensed:wght@400;600;700&family=Barlow:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-deep:    #0d0b09;
    --bg-mid:     #141210;
    --bg-panel:   rgba(10,8,6,0.95);
    --border:     #3a2a1a;
    --border-lit: #6b3e1e;
    --amber:      #f5a623;
    --ember:      #e8541e;
    --cream:      #f0e8d8;
    --muted:      #8a7a68;
    --gold:       #ffd166;
    --glow:       rgba(245,166,35,0.35);
    --panel-w:    320px;
    --ticker-h:   34px;
    --header-h:   70px;
}

/* ── RESET & BASE ── */
body {
    font-family: 'Barlow', sans-serif;
    background-color: var(--bg-deep);
    background-image: url('log_splitter_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--cream);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── BACKGROUND LOGS FADE IN/OUT ── */
#bg-logs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0; /* Behind the game content */
    overflow: hidden;
}

.bg-log-fade {
    position: absolute;
    opacity: 0;
    user-select: none;
    /* Hardware acceleration for smooth performance */
    will-change: transform, opacity;
    animation: logFadeInAndOut linear forwards;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

@keyframes logFadeInAndOut {
    0%   { opacity: 0; transform: scale(0.8) rotate(var(--start-rot)); }
    50%  { opacity: var(--max-opacity); transform: scale(1.1) rotate(var(--mid-rot)); }
    100% { opacity: 0; transform: scale(0.9) rotate(var(--end-rot)); }
}

/* ── GEM RAIN ANIMATION ── */
#gem-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}

.falling-gem {
    position: absolute;
    top: -50px;
    animation: gemFall linear forwards;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.8);
    user-select: none;
}

@keyframes gemFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ── TICKER ── */
#news-ticker-container {
    height: var(--ticker-h);
    background: rgba(0,0,0,0.92);
    border-bottom: 1px solid var(--ember);
    display: flex;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
#news-ticker {
    position: absolute;
    white-space: nowrap;
    color: var(--amber);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-left: 100%;
    animation: tickerMove 30s linear infinite;
}
@keyframes tickerMove { from { transform: translateX(0); } to { transform: translateX(-200%); } }

/* ── LAYOUT ── */
.game-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    position: relative;
    z-index: 10; /* Keeps game elements above the fading logs */
}

.main-area {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 16px 20px;
    overflow: hidden;
    min-width: 0;
}

/* ── HEADER ── */
.header-ui { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#main-logo { width: 340px; filter: drop-shadow(0 3px 12px rgba(0,0,0,0.8)); }
.stats-container { display: flex; gap: 10px; }

.stat-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-lit);
    border-radius: 6px;
    padding: 5px 18px;
    text-align: center;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}
.stat-box::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(245,166,35,0.05) 0%, transparent 100%); }
.stat-box .label { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 0.6rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; }
.stat-box span:not(.label) { font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.stat-box.boost-glow { border-color: var(--gold); box-shadow: 0 0 14px var(--glow), inset 0 0 10px rgba(255,209,102,0.08); }

.gem-stat-box { border-color: #7c3aed !important; box-shadow: 0 0 10px rgba(124, 58, 237, 0.3); }
.gem-stat-box span:not(.label) { color: #a78bfa !important; }

/* ── SPLITTER ── */
.splitter-area { display: flex; justify-content: center; align-items: center; }
#split-btn { background: none; border: none; outline: none; cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 10px; border-radius: 50%; transition: filter 0.1s; }
#split-btn:active { filter: brightness(1.2); }
#log-image { width: min(420px, 55vw); height: auto; transition: transform 0.07s ease, filter 0.07s; filter: drop-shadow(0 10px 28px rgba(0,0,0,0.8)); display: block; image-rendering: auto; }

/* ── FLOATING TEXT ── */
.floating-text { position: fixed; font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--cream); pointer-events: none; z-index: 999; animation: floatUp 0.85s ease-out forwards; text-shadow: 0 2px 6px rgba(0,0,0,0.8); }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-55px) scale(1.15); } }

/* ── LEADERBOARD ── */
.leaderboard-section { display: flex; gap: 10px; padding-top: 10px; }
.leaderboard-box { flex: 1; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 0.72rem; }
.leaderboard-box h3 { font-family: 'Rye', serif; font-size: 0.65rem; color: var(--amber); letter-spacing: 0.12em; margin-bottom: 6px; text-align: center; }
.leaderboard-box ul { list-style: none; }
.leaderboard-box li { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.75rem; color: var(--cream); gap: 8px; }
.leaderboard-box li:last-child { border-bottom: none; }
.score { color: var(--gold); font-weight: 600; font-family: 'Barlow Condensed', sans-serif; }

/* ── SIDEBAR ── */
.upgrades-area { width: var(--panel-w); flex-shrink: 0; background: var(--bg-panel); border-left: 2px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 14px; gap: 0; scrollbar-width: thin; scrollbar-color: var(--border-lit) transparent; z-index: 11; }
.upgrades-area::-webkit-scrollbar { width: 4px; }
.upgrades-area::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 2px; }

/* ── BOOST SECTION ── */
.boost-section { border: 1px solid var(--amber); border-radius: 8px; padding: 10px; text-align: center; background: rgba(245,166,35,0.05); margin-bottom: 14px; }
.boost-section h3 { font-family: 'Rye', serif; font-size: 0.65rem; color: var(--amber); letter-spacing: 0.1em; margin-bottom: 4px; }
.boost-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(255,255,255,0.03); padding: 8px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); }
.boost-info { flex: 1; text-align: left; }
.boost-label { font-family: 'Barlow Condensed', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--cream); }
.boost-timer { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--gold); line-height: 1; }
.boost-sub { font-size: 0.65rem; color: var(--muted); }
.boost-ad-btn { width: auto !important; padding: 6px 12px !important; font-size: 0.75rem !important; flex-shrink: 0; }

/* ── BUTTONS ── */
.reset-btn { width: 100%; padding: 8px 12px; background: var(--ember); color: #fff; border: none; border-radius: 6px; font-family: 'Barlow Condensed', sans-serif; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; cursor: pointer; text-transform: uppercase; transition: background 0.15s, transform 0.1s; }
.reset-btn:hover { background: #c0392b; }
.reset-btn:active { transform: scale(0.97); }
.reset-btn.gold { background: var(--amber); color: #000; }
.reset-btn.gold:hover { background: var(--gold); }
.gem-ad-btn { background: #059669 !important; color: #fff !important; }
.gem-ad-btn:hover { background: #047857 !important; }
.purple-btn { background: #7c3aed !important; color: #fff !important; }
.purple-btn:hover { background: #6d28d9 !important; }

/* ── SECTION TITLE ── */
.section-title { font-family: 'Rye', serif; font-size: 0.7rem; color: var(--amber); letter-spacing: 0.12em; text-transform: uppercase; margin: 14px 0 8px 0; padding-bottom: 5px; border-bottom: 1px solid var(--border); }

/* ── SKIN SHOP ── */
.skin-scroll-box { max-height: 380px; overflow-y: auto; background: rgba(0,0,0,0.4); border-radius: 6px; border: 1px solid var(--border); padding: 8px; scrollbar-width: thin; scrollbar-color: var(--border-lit) transparent; }
.skin-category-title { font-family: 'Barlow Condensed', sans-serif; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; margin: 8px 0 4px 0; }
.skin-category-title:first-child { margin-top: 0; }
.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 4px; }
.skin-slot { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.skin-slot:hover { border-color: var(--border-lit); background: rgba(245,166,35,0.06); }
.skin-slot.active { border-color: var(--amber); background: rgba(245,166,35,0.1); }
.skin-icon { width: 44px; height: 36px; object-fit: contain; }
.skin-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; }
.skin-req { font-size: 0.6rem; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; }
.skin-slot.active .skin-req { color: var(--amber); }

/* ── UPGRADES ── */
#upgrades-container { display: flex; flex-direction: column; gap: 6px; }
.upgrade-btn { width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; color: var(--cream); font-family: 'Barlow Condensed', sans-serif; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; text-align: left; transition: background 0.15s, border-color 0.15s, opacity 0.15s; display: flex; justify-content: space-between; align-items: center; }
.upgrade-btn:hover { background: rgba(245,166,35,0.08); border-color: var(--border-lit); }
.upgrade-btn.disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.5); }
.upgrade-btn small { font-size: 0.72rem; color: var(--gold); font-weight: 400; }

/* ── ACCOUNT ── */
#logged-out-ui { display: flex; flex-direction: column; gap: 6px; }
.input-field { width: 100%; padding: 8px 10px; background: rgba(0,0,0,0.5); color: var(--cream); border: 1px solid var(--border); border-radius: 6px; font-family: 'Barlow', sans-serif; font-size: 0.82rem; outline: none; transition: border-color 0.15s; }
.input-field:focus { border-color: var(--border-lit); }
.input-field::placeholder { color: var(--muted); }
#logged-in-ui { text-align: center; }
#logged-in-ui p { font-family: 'Barlow Condensed', sans-serif; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
#logged-in-ui p span { color: var(--cream); font-weight: 600; }
#user-display-name { color: var(--cream); font-weight: 600; }

/* ── STORE MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 2000; }
.store-modal-content { background: var(--bg-panel); border: 2px solid var(--border-lit); border-radius: 14px; width: 92%; max-width: 480px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(0,0,0,0.6); }
.store-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.store-title { font-family: 'Rye', serif; font-size: 1rem; color: var(--gold); }
.modal-close-btn { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: color 0.15s; }
.modal-close-btn:hover { color: var(--cream); }
.store-tabs { display: flex; gap: 4px; padding: 12px 20px 0; }
.store-tab { flex: 1; padding: 8px 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px 8px 0 0; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; border-bottom: none; }
.store-tab.active { background: rgba(245,166,35,0.1); border-color: var(--amber); color: var(--amber); }
.store-body { flex: 1; overflow-y: auto; padding: 16px 20px 20px; border-top: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border-lit) transparent; }
.store-subtitle { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.store-warning { background: rgba(232,84,30,0.12); border: 1px solid var(--ember); border-radius: 6px; padding: 8px 10px; font-size: 0.75rem; color: #ffb09a; margin-bottom: 12px; }
.store-divider { height: 1px; background: var(--border); margin: 12px 0; }
.store-tab-link { background: none; border: none; color: var(--amber); font-size: 0.75rem; cursor: pointer; padding: 0 4px; text-decoration: underline; font-family: 'Barlow', sans-serif; }

.gem-packs { display: flex; flex-direction: column; gap: 8px; }
.gem-pack { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; transition: border-color 0.15s; }
.gem-pack.featured { border-color: var(--amber); background: rgba(245,166,35,0.06); }
.gem-pack-left { display: flex; align-items: center; gap: 10px; }
.gem-icon { font-size: 1.4rem; }
.gem-pack-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.9rem; font-weight: 600; color: var(--cream); }
.gem-pack-badge { font-size: 0.62rem; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.gem-boost-option { display: flex; align-items: center; justify-content: space-between; background: rgba(124,58,237,0.08); border: 1px solid #7c3aed; border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.gem-boost-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.9rem; font-weight: 600; color: var(--cream); }
.gem-boost-desc { font-size: 0.7rem; color: var(--muted); }

.store-buy-btn { padding: 7px 14px; border: none; border-radius: 6px; font-family: 'Barlow Condensed', sans-serif; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; cursor: pointer; text-transform: uppercase; transition: all 0.15s; white-space: nowrap; }
.store-buy-btn.gold { background: var(--amber); color: #000; }
.store-buy-btn.gold:hover { background: var(--gold); }
.store-buy-btn.gem-btn { background: #7c3aed; color: #fff; margin-top: 4px; width: 100%; }
.store-buy-btn.gem-btn:hover { background: #6d28d9; }
.store-buy-btn.gem-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.store-buy-btn.equipped { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid #2ecc71; }
.purple-store-btn { background: #7c3aed !important; color: #fff !important; }
.purple-store-btn:hover { background: #6d28d9 !important; }
.purple-store-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.premium-skin-list { display: flex; flex-direction: column; gap: 10px; }
.premium-skin-row { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; padding: 12px; transition: border-color 0.15s; }
.premium-skin-row.owned { border-color: #2ecc71; background: rgba(46,204,113,0.05); }
.premium-skin-img { width: 56px; height: 42px; object-fit: contain; flex-shrink: 0; }
.premium-skin-info { flex: 1; }
.premium-skin-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--gold); }
.premium-skin-rarity { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.premium-skin-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* BUNDLE CARD */
.bundle-card { border: 2px solid var(--gold); background: rgba(255,209,102,0.06); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.bundle-card.owned-bundle { border-color: #2ecc71; background: rgba(46,204,113,0.06); }
.bundle-card-header { margin-bottom: 10px; }
.bundle-card-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; color: var(--gold); }
.bundle-card-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.bundle-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bundle-preview-img { width: 42px; height: 32px; object-fit: contain; border-radius: 4px; background: rgba(255,255,255,0.05); }
.bundle-buy-btn { width: 100% !important; padding: 10px !important; font-size: 0.9rem !important; }

/* ── AUTH TABS & MESSAGES ── */
.auth-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.auth-tab { flex: 1; padding: 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; }
.auth-tab.active { background: rgba(245,166,35,0.12); border-color: var(--amber); color: var(--amber); }
.auth-message { padding: 8px 10px; border-radius: 6px; font-size: 0.78rem; line-height: 1.4; margin-bottom: 4px; }
.auth-message.error { background: rgba(232,84,30,0.15); border: 1px solid var(--ember); color: #ffb09a; }
.auth-message.success { background: rgba(46,204,113,0.12); border: 1px solid #2ecc71; color: #a8f0c4; }

/* ── TOAST NOTIFICATIONS ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(20,16,12,0.96); border: 1px solid var(--border-lit); border-radius: 8px; color: var(--cream); font-family: 'Barlow Condensed', sans-serif; font-size: 0.9rem; font-weight: 600; padding: 10px 20px; z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MOBILE ── */
@media (max-width: 768px) {
    :root { --panel-w: 100%; }
    body { height: auto; overflow-y: auto; overflow-x: hidden; }
    .game-container { flex-direction: column; overflow: visible; height: auto; }
    .main-area { grid-template-rows: auto auto auto; height: auto; padding: 12px 14px 20px; overflow: visible; }
    #main-logo { width: 260px; }
    .stat-box { min-width: 85px; padding: 4px 12px; }
    .stat-box span:not(.label) { font-size: 1.15rem; }
    #log-image { width: min(320px, 72vw); }
    .splitter-area { padding: 10px 0; }
    .leaderboard-section { flex-direction: row; gap: 8px; margin-top: 10px; }
    .upgrades-area { width: 100%; border-left: none; border-top: 2px solid var(--border); overflow-y: visible; max-height: none; padding: 14px; }
    .skin-scroll-box { max-height: 220px; }
    .store-modal-content { max-height: 92vh; width: 96%; }
    .stats-container { flex-wrap: wrap; justify-content: center; }
    .gem-stat-box { min-width: 85px; }
    .premium-skin-row { flex-wrap: wrap; }
    .premium-skin-actions { flex-direction: row; width: 100%; }
    .store-buy-btn.gem-btn { width: auto; flex: 1; }
}

/* ── TINY PHONES (≤ 380px) ── */
@media (max-width: 380px) {
    .leaderboard-section { flex-direction: column; }
    #log-image { width: 200px; }
    .stats-container { gap: 6px; }
    .stat-box { min-width: 75px; padding: 4px 8px; }
}
/* ════════════════════════════════════════════════════════
   DYNAMIC LIFE — pure CSS, zero JS required
════════════════════════════════════════════════════════ */

/* 1. SPLIT BUTTON — idle breathing pulse so it always looks alive */
#split-btn {
    animation: btnBreathe 3s ease-in-out infinite;
}
@keyframes btnBreathe {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(245,166,35,0.2)); }
    50%       { filter: drop-shadow(0 0 22px rgba(232,84,30,0.55)); }
}

/* 2. LOG IMAGE — very gentle slow sway when not being clicked */
#log-image {
    animation: logSway 4s ease-in-out infinite;
    transform-origin: center bottom;
}
@keyframes logSway {
    0%, 100% { transform: scale(2) rotate(-1.5deg); }
    50%       { transform: scale(2) rotate(1.5deg);  }
}
/* Override sway when cracked (already has its own transform) */
#split-btn:active #log-image { animation: none; }

/* 3. STAT BOXES — number pops when value changes (add .pop class via JS) */
@keyframes statPop {
    0%   { transform: scale(1);    }
    40%  { transform: scale(1.18); color: var(--amber); }
    100% { transform: scale(1);    }
}
.stat-pop { animation: statPop 0.35s ease-out; }

/* 4. SECTION TITLES — subtle left-edge ember glow sweep */
.section-title {
    position: relative;
    overflow: hidden;
}
.section-title::after {
    content: '';
    position: absolute;
    left: -100%;
    top: 0; bottom: 0;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(245,166,35,0.18), transparent);
    animation: titleShimmer 5s ease-in-out infinite;
}
@keyframes titleShimmer {
    0%        { left: -100%; }
    40%, 100% { left: 160%;  }
}

/* 5. UPGRADE BUTTONS — ember glow on hover already exists but add idle shimmer */
.upgrade-btn {
    position: relative;
    overflow: hidden;
}
.upgrade-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -75%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
    animation: btnShine 4s ease-in-out infinite;
    animation-delay: var(--shine-delay, 0s);
}
@keyframes btnShine {
    0%, 60%, 100% { left: -75%; opacity: 0; }
    20%            { left: 125%; opacity: 1; }
}

/* 6. BOOST SECTION — flickering border to feel like a fire panel */
.boost-section {
    animation: boostFlicker 6s ease-in-out infinite;
}
@keyframes boostFlicker {
    0%, 100% { border-color: var(--border-lit); box-shadow: 0 0 6px rgba(232,84,30,0.15); }
    25%       { border-color: var(--amber);     box-shadow: 0 0 14px rgba(245,166,35,0.3); }
    50%       { border-color: var(--ember);     box-shadow: 0 0 10px rgba(232,84,30,0.25); }
    75%       { border-color: var(--amber);     box-shadow: 0 0 18px rgba(245,166,35,0.35); }
}

/* 7. LEADERBOARD ROWS — staggered fade-in on load */
#global-list li {
    animation: rowSlideIn 0.4s ease-out both;
}
#global-list li:nth-child(1)  { animation-delay: 0.05s; }
#global-list li:nth-child(2)  { animation-delay: 0.10s; }
#global-list li:nth-child(3)  { animation-delay: 0.15s; }
#global-list li:nth-child(4)  { animation-delay: 0.20s; }
#global-list li:nth-child(5)  { animation-delay: 0.25s; }
#global-list li:nth-child(6)  { animation-delay: 0.30s; }
#global-list li:nth-child(7)  { animation-delay: 0.35s; }
#global-list li:nth-child(8)  { animation-delay: 0.40s; }
#global-list li:nth-child(9)  { animation-delay: 0.45s; }
#global-list li:nth-child(10) { animation-delay: 0.50s; }
@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0);     }
}

/* 8. GEM STAT BOX — gentle purple pulse */
.gem-stat-box {
    animation: gemBoxPulse 3.5s ease-in-out infinite;
}
@keyframes gemBoxPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(124,58,237,0.3);  }
    50%       { box-shadow: 0 0 20px rgba(124,58,237,0.6); }
}

/* 9. SKIN SHOP — active skin slot glows */
.skin-slot.active {
    animation: activeSkinGlow 2.5s ease-in-out infinite;
}
@keyframes activeSkinGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(245,166,35,0.3);  }
    50%       { box-shadow: 0 0 16px rgba(245,166,35,0.7); }
}

/* 10. LOGO — very slow breathing scale so it never looks dead */
#main-logo {
    animation: logoBreathe 8s ease-in-out infinite;
}
@keyframes logoBreathe {
    0%, 100% { transform: scale(1);     filter: drop-shadow(0 3px 12px rgba(0,0,0,0.8)); }
    50%       { transform: scale(1.015); filter: drop-shadow(0 4px 20px rgba(245,166,35,0.25)); }
}

/* Stagger the shine delay on each upgrade button */
#upgrades-container .upgrade-btn:nth-child(1) { --shine-delay: 0s;    }
#upgrades-container .upgrade-btn:nth-child(2) { --shine-delay: 1s;    }
#upgrades-container .upgrade-btn:nth-child(3) { --shine-delay: 2s;    }
#upgrades-container .upgrade-btn:nth-child(4) { --shine-delay: 3s;    }