/* --- THE GLOBAL COLOR PALETTE --- */
:root {
    --primary: #4F46E5; 
    --primary-hover: #4338CA;
    --secondary: #F43F5E; 
    --secondary-hover: #E11D48;
    --accent: #F59E0B;
    --success: #10B981;
    --bg-color: #F3F4F6; 
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --modal-bg: rgba(31, 41, 55, 0.8);
}

/* --- THE DARK THEME OVERRIDE --- */
body.dark-theme {
    --bg-color: #111827;
    --card-bg: #1F2937;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --border-color: #374151;
    --modal-bg: rgba(0, 0, 0, 0.85);
}

/* --- GLOBAL STYLES --- */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    margin: 0; 
    padding: 0; 
    transition: background-color 0.3s, color 0.3s;
}

/* --- NAVIGATION --- */
.nav { 
    background: var(--primary); 
    color: white; 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav h2 { margin: 0; font-size: 1.5em; letter-spacing: 1px;}

.stats-container { display: flex; align-items: center; }

.hero-badge { 
    background: rgba(255,255,255,0.2); 
    padding: 8px 15px; 
    border-radius: 20px; 
    font-weight: bold; 
    margin-right: 10px;
}

.paw-badge { 
    background: var(--accent); 
    color: white; 
    padding: 8px 15px; 
    border-radius: 20px; 
    font-weight: bold; 
    margin-right: 15px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- CARDS & GRID --- */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
    margin-top: 20px; 
}

.card { 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    text-align: center; 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    border: 1px solid var(--border-color);
}

.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.card img { 
    width: 100%; 
    height: 220px; 
    object-fit: cover; 
    border-radius: 10px; 
    margin-bottom: 10px; 
}

/* --- THE FIX: Universal Skeleton Loading State --- */
.skeleton-load {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-color) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite linear;
    min-height: 220px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- ECONOMY TAGS --- */
.multiplier { color: #D97706; font-weight: bold; background: #FEF3C7; padding: 5px 10px; border-radius: 5px; display: inline-block; margin-top: 5px; font-size: 0.85em; border: 1px solid #FCD34D;}
.progress-bg { background: var(--border-color); border-radius: 10px; height: 12px; overflow: hidden; margin: 10px 0; }
.progress-fill { background: #10B981; height: 100%; transition: width 0.4s ease; }

/* --- BUTTONS --- */
.btn { 
    border: none; 
    padding: 12px 20px; 
    border-radius: 8px; 
    cursor: pointer; 
    width: 100%; 
    font-weight: bold; 
    font-size: 1em; 
    transition: background 0.2s; 
    margin-top: 10px;
}

/* --- THE FIX: Universal Disabled State Visual Muting --- */
.btn:disabled {
    background: var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    border: 1px solid var(--border-color) !important;
}

.btn-play { background: var(--success); color: white; } 
.btn-play:hover { filter: brightness(0.9); }

.btn-claim { background: var(--primary); color: white; }
.btn-claim:hover { background: var(--primary-hover); }

.btn-donate { background: var(--accent); color: white; }
.btn-donate:hover { filter: brightness(0.9); }

.btn-logout { 
    background: var(--secondary); 
    color: white; 
    border-radius: 20px; 
    padding: 8px 15px; 
    font-size: 0.9em; 
    width: auto; 
    margin-top: 0;
}

.btn-close { background: var(--border-color); color: var(--text-main); margin-top: 25px; border-radius: 20px; font-size: 1em; padding: 10px;}
.btn-close:hover { filter: brightness(0.9); }

/* --- TAB MENU --- */
.tab-menu { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;}
.tab-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px 20px; border-radius: 25px; font-weight: bold; cursor: pointer; font-size: 1em; transition: 0.3s;}
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4); }

/* --- AUTH PANEL --- */
.auth-panel { background: var(--card-bg); padding: 40px; border-radius: 15px; max-width: 350px; margin: 80px auto; box-shadow: 0 10px 25px rgba(0,0,0,0.1); text-align: center; border: 1px solid var(--border-color);}
.auth-panel input { width: 90%; padding: 12px; margin: 10px 0; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1em; background: var(--bg-color); color: var(--text-main);}

/* --- MODALS --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--modal-bg); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-card { background: var(--card-bg); padding: 30px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; transform: translateY(20px); transition: transform 0.3s; box-shadow: 0 20px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color);}
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-card h2 { margin-top: 0; color: var(--primary); font-size: 1.8em;}

/* --- THE FIX: Arcade Menu Custom Visual Categorization Header --- */
.arcade-category-header {
    width: 100%;
    margin: 30px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px dashed var(--border-color);
    color: var(--primary);
    font-size: 1.1em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: left;
    padding-left: 5px;
}

/* --- ARCADE GAME OPTIONS --- */
.game-option { background: var(--bg-color); border: 2px solid var(--border-color); border-radius: 15px; padding: 15px; margin-top: 15px; cursor: pointer; transition: all 0.2s; text-align: left; display: flex; align-items: center; gap: 15px;}
.game-option:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); background: var(--card-bg);}
.game-icon { font-size: 2.8em; }
.game-details h3 { margin: 0 0 5px 0; color: var(--text-main); font-size: 1.2em;}
.game-details p { margin: 0; font-size: 0.9em; color: var(--text-muted); line-height: 1.3;}

/* --- LEDGER / LEADERBOARD LISTS --- */
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--border-color); background: var(--card-bg);}
.list-row:first-child { border-radius: 10px 10px 0 0; }
.list-row:last-child { border-radius: 0 0 10px 10px; border-bottom: none; }

/* --- THE FIX: Responsive Scaling for Live Ticker to protect Bottom Nav --- */
@media screen and (max-height: 600px) {
    .ticker-wrap {
        padding: 4px 0 !important;
        bottom: 55px !important;
    }
    .ticker-item {
        font-size: 0.7em !important;
    }
}

/* --- THE MAGIC FIX --- */
.hidden { display: none !important; }
