/* ========================================
   Base Styles & Reset
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Arial', sans-serif;
    font-weight: 500;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Exo 2', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
}

.game-container {
    background: var(--container-bg);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 900px;
    width: calc(100vw - 40px);
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
    position: relative;
}

/* Full-screen overlay for screens that fill the container */
.full-screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.active-game-screen {
    display: none;
    flex-direction: column;
    flex: 1;
    position: relative;
    min-height: 0;
}

/* ==============================================
   SCREEN ARCHITECTURE
   Standardized layout: title bar + scrollable content
   ============================================== */
.screen-title-bar {
    position: sticky;
    top: 0;
    background: var(--background);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

[data-theme="light"] .screen-title-bar {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.screen-scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

/* ==============================================
   BUTTON STYLES
   ============================================== */

.btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: 2px solid transparent;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-color);
    box-shadow: none;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.button-group .btn {
    min-width: 160px;
    max-width: 220px;
}

/* ==============================================
   MOBILE RESPONSIVE FONT SIZES
   ============================================== */
@media (max-width: 768px) {
    body {
        font-size: 18px; /* Increase base font from 16px */
    }
    
    h1 {
        font-size: 2.5rem; /* Larger on mobile */
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    p, li {
        font-size: 1.1rem; /* Slightly larger paragraphs */
    }
    
    /* Labels and metadata remain readable */
    .stat-label, .pill-label {
        font-size: 0.9rem;
    }
}

/* ==============================================
   CUSTOM SCROLLBARS
   ============================================== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.5) rgba(255, 255, 255, 0.05);
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-button {
    display: none; /* Hide up/down arrows */
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
}

/* Light theme scrollbars */
[data-theme="light"] * {
    scrollbar-color: rgba(102, 126, 234, 0.4) rgba(14, 18, 53, 0.05);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(14, 18, 53, 0.04);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5), rgba(118, 75, 162, 0.5));
    border-color: rgba(14, 18, 53, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.7), rgba(118, 75, 162, 0.7));
}
