/* ========================================
   GOLDEN REACTION TEST - VIP STYLE
   ======================================== */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    color: #E0E0E0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Marble texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(201, 169, 97, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#gameContainer {
    position: relative;
    z-index: 1;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.game-title {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #C9A961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 1rem;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); }
    50% { filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.6)); }
}

.game-subtitle {
    font-size: 1.2rem;
    color: #C9A961;
    margin-bottom: 3rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* ========================================
   SCREEN MANAGEMENT
   ======================================== */

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.screen.active {
    display: flex;
}

/* ========================================
   MAIN MENU
   ======================================== */

#mainMenu {
    background: radial-gradient(circle at center, rgba(26, 26, 46, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
}

.menu-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 3rem;
    background: rgba(20, 20, 35, 0.6);
    border: 2px solid rgba(201, 169, 97, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(10px);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ========================================
   BUTTONS
   ======================================== */

.primary-btn {
    background: linear-gradient(135deg, #FFD700 0%, #C9A961 100%);
    color: #0a0a0f;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #FFE55C 0%, #D4B76A 100%);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: rgba(201, 169, 97, 0.1);
    color: #C9A961;
    border: 2px solid rgba(201, 169, 97, 0.4);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.secondary-btn:hover {
    background: rgba(201, 169, 97, 0.2);
    border-color: rgba(201, 169, 97, 0.6);
    transform: translateY(-2px);
}

/* Back To Home Button */
.back-home-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    background: rgba(20, 20, 35, 0.6);
    border: 2px solid rgba(201, 169, 97, 0.3);
    border-radius: 10px;
    color: #C9A961;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: rgba(201, 169, 97, 0.1);
    border-color: #C9A961;
    transform: translateX(-5px);
}

/* ========================================
   GET READY SCREEN
   ======================================== */

#getReadyScreen {
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0f 100%);
    cursor: pointer;
    pointer-events: auto; /* Ensure clicks are captured */
}

.ready-content {
    text-align: center;
    pointer-events: none; /* Let clicks pass through to parent */
}

.ready-text {
    font-size: 4rem;
    color: #FFD700;
    margin-bottom: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
    pointer-events: none; /* Let clicks pass through to parent */
}

.ready-subtitle {
    font-size: 1.5rem;
    color: #C9A961;
    margin-bottom: 3rem;
    pointer-events: none; /* Let clicks pass through to parent */
}

.pulse-indicator {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border: 4px solid #FFD700;
    border-radius: 50%;
    animation: pulseRing 1.5s ease-in-out infinite;
    pointer-events: none; /* Let clicks pass through to parent */
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 1; }
    50% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* ========================================
   GOLD FLASH SCREEN
   ======================================== */

#goldScreen {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    cursor: pointer;
    animation: goldFlash 0.3s ease-in;
    pointer-events: auto; /* Ensure clicks are captured */
}

@keyframes goldFlash {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.gold-content {
    text-align: center;
    pointer-events: none; /* Let clicks pass through to parent */
}

.gold-text-large {
    font-size: 5rem;
    color: #0a0a0f;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: clickNow 0.5s ease-in-out infinite;
    pointer-events: none; /* Let clicks pass through to parent */
}

@keyframes clickNow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   RESULT SCREEN
   ======================================== */

#resultScreen {
    background: radial-gradient(circle at center, rgba(26, 26, 46, 0.95) 0%, rgba(10, 10, 15, 0.98) 100%);
}

.result-content {
    text-align: center;
    max-width: 700px;
    width: 100%;
    padding: 3rem;
    background: rgba(20, 20, 35, 0.7);
    border: 2px solid rgba(201, 169, 97, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.result-title {
    font-size: 2rem;
    color: #C9A961;
    margin-bottom: 2rem;
}

.reaction-time-display {
    font-size: 6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700 0%, #C9A961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-family: 'Inter', monospace;
    animation: resultPop 0.5s ease-out;
}

@keyframes resultPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.reaction-rating {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 10px;
}

.reaction-rating.elite {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border: 2px solid #FFD700;
}

.reaction-rating.excellent {
    background: rgba(192, 192, 192, 0.2);
    color: #C0C0C0;
    border: 2px solid #C0C0C0;
}

.reaction-rating.good {
    background: rgba(205, 127, 50, 0.2);
    color: #CD7F32;
    border: 2px solid #CD7F32;
}

.reaction-rating.average {
    background: rgba(201, 169, 97, 0.1);
    color: #C9A961;
    border: 2px solid rgba(201, 169, 97, 0.4);
}

.reaction-rating.slow {
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
    border: 2px solid rgba(255, 107, 107, 0.4);
}

/* Session Stats */
.session-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(201, 169, 97, 0.05);
    border-radius: 8px;
    min-width: 120px;
}

.mini-label {
    font-size: 0.9rem;
    color: #C9A961;
    margin-bottom: 0.5rem;
}

.mini-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFD700;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ========================================
   TOO EARLY SCREEN
   ======================================== */

#tooEarlyScreen {
    background: radial-gradient(circle at center, rgba(255, 107, 107, 0.2) 0%, #0a0a0f 100%);
}

.too-early-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 3rem;
    background: rgba(20, 20, 35, 0.8);
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(255, 0, 0, 0.2);
}

.error-title {
    font-size: 3rem;
    color: #FF6B6B;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.3rem;
    color: #E0E0E0;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.gold-text {
    color: #FFD700;
    font-weight: 700;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(10, 10, 15, 0.98) 100%);
    padding: 2.5rem;
    border: 2px solid rgba(201, 169, 97, 0.3);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.7);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: #C9A961;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: #FFD700;
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 2.5rem;
    color: #FFD700;
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    font-size: 1.5rem;
    color: #C9A961;
    margin: 1.5rem 0 1rem;
}

/* Instructions */
.instructions ol, .instructions ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.instructions li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.instructions strong {
    color: #FFD700;
}

/* Rating Table */
.rating-table {
    margin-top: 1rem;
}

.rating-row {
    padding: 0.8rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
}

.rating-row.elite {
    background: rgba(255, 215, 0, 0.15);
    border-left: 4px solid #FFD700;
}

.rating-row.excellent {
    background: rgba(192, 192, 192, 0.15);
    border-left: 4px solid #C0C0C0;
}

.rating-row.good {
    background: rgba(205, 127, 50, 0.15);
    border-left: 4px solid #CD7F32;
}

.rating-row.average {
    background: rgba(201, 169, 97, 0.1);
    border-left: 4px solid #C9A961;
}

.rating-row.slow {
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #FF6B6B;
}

/* ========================================
   LEADERBOARD
   ======================================== */

.leaderboard-list {
    margin-top: 1.5rem;
}

.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(20, 20, 35, 0.5);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.leaderboard-row:hover {
    background: rgba(201, 169, 97, 0.1);
    border-color: rgba(201, 169, 97, 0.4);
    transform: translateX(5px);
}

.leaderboard-row.top-three {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.rank {
    font-weight: 700;
    color: #C9A961;
    min-width: 80px;
    font-size: 1.1rem;
}

.player-name {
    flex: 1;
    color: #E0E0E0;
    font-size: 1.1rem;
}

.score {
    font-weight: 700;
    color: #FFD700;
    font-size: 1.2rem;
    font-family: monospace;
}

.loading-text, .no-data, .login-prompt {
    text-align: center;
    color: #C9A961;
    font-size: 1.2rem;
    padding: 2rem;
}

.error-text {
    text-align: center;
    color: #FF6B6B;
    font-size: 1.2rem;
    padding: 2rem;
}

/* ========================================
   STATS DISPLAY
   ======================================== */

.stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: rgba(20, 20, 35, 0.6);
    border: 2px solid rgba(201, 169, 97, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #C9A961;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.stat-label {
    font-size: 1rem;
    color: #C9A961;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700 0%, #C9A961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: monospace;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .ready-text {
        font-size: 3rem;
    }
    
    .ready-subtitle {
        font-size: 1.2rem;
    }
    
    .gold-text-large {
        font-size: 3.5rem;
    }
    
    .reaction-time-display {
        font-size: 4rem;
    }
    
    .reaction-rating {
        font-size: 1.2rem;
    }
    
    .menu-content, .result-content, .too-early-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
    
    .session-stats {
        flex-direction: column;
    }
    
    .stats-display {
        grid-template-columns: 1fr;
    }
    
    .primary-btn {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    
    .secondary-btn {
        font-size: 1rem;
        padding: 0.9rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .gold-text-large {
        font-size: 2.5rem;
    }
    
    .reaction-time-display {
        font-size: 3rem;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    body {
        padding: 1rem;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(20, 20, 35, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.7);
}
