/* ========================================
   RECALL MASTERY - VIP STYLESHEET
   Dark elegant theme with premium aesthetics
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f1419;
    --accent-gold: #d4af37;
    --accent-silver: #c0c0c0;
    --accent-blue: #00d4ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success-color: #00ff88;
    --error-color: #ff4757;
    
    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    --gradient-silver: linear-gradient(135deg, #c0c0c0 0%, #e0e0e0 100%);
    --gradient-blue: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    --gradient-dark: linear-gradient(180deg, #1a1a2e 0%, #0f1419 100%);
    
    /* Shadows */
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-hard: 0 12px 24px rgba(0, 0, 0, 0.5);
    --glow-gold: 0 0 20px rgba(212, 175, 55, 0.5);
    --glow-blue: 0 0 20px rgba(0, 212, 255, 0.5);
    --glow-success: 0 0 20px rgba(0, 255, 136, 0.6);
    --glow-error: 0 0 20px rgba(255, 71, 87, 0.6);
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', monospace;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main Container */
#gameContainer {
    width: 100%;
    max-width: 1200px;
    min-height: 600px;
    position: relative;
}

/* Header Section */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(15, 20, 25, 0.8);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
}

.score-display,
.level-display,
.lives-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--accent-silver);
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lives-container {
    display: flex;
    gap: 8px;
}

.life-icon {
    font-size: 1.5rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 8px var(--accent-gold));
    transition: all 0.3s ease;
}

.life-icon.lost {
    color: var(--text-secondary);
    filter: none;
    opacity: 0.3;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MENU SCREEN
   ======================================== */

.menu-container {
    text-align: center;
    padding: 40px;
    background: rgba(15, 20, 25, 0.8);
    border-radius: 20px;
    box-shadow: var(--shadow-hard);
    backdrop-filter: blur(10px);
}

.game-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: 4px;
    text-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    color: var(--accent-silver);
    letter-spacing: 3px;
    margin-bottom: 50px;
    text-transform: uppercase;
}

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

.mode-btn {
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.1), rgba(0, 212, 255, 0.05));
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
    transform: translateY(-5px);
}

.mode-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px var(--accent-gold));
}

.mode-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.mode-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.high-score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.high-score-label {
    font-size: 1rem;
    color: var(--accent-silver);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.high-score-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Back to Home Button */
.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    margin-top: 30px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-primary);
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border: 2px solid rgba(192, 192, 192, 0.4);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.back-home-btn:hover {
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1));
    border-color: var(--accent-silver);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.4);
    transform: translateY(-2px);
}

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

.back-home-icon {
    font-size: 1.2rem;
    color: var(--accent-silver);
}

/* ========================================
   GAME SCREEN
   ======================================== */

.game-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 40px;
    background: rgba(15, 20, 25, 0.8);
    border-radius: 20px;
    box-shadow: var(--shadow-hard);
    backdrop-filter: blur(10px);
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.streak-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.streak-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--accent-silver);
}

.streak-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px var(--accent-blue));
}

.message-display {
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-align: center;
    min-width: 250px;
}

.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

/* Pattern Grid */
.grid-container {
    display: grid;
    gap: 10px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.grid-tile {
    aspect-ratio: 1;
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.1), rgba(0, 0, 0, 0.2));
    border: 2px solid rgba(192, 192, 192, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.grid-tile::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.grid-tile:hover::before {
    width: 200%;
    height: 200%;
}

.grid-tile:hover {
    border-color: var(--accent-gold);
    transform: scale(1.05);
}

.grid-tile.selected {
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.grid-tile.pattern-show {
    animation: patternPulse 0.6s ease-in-out;
}

.grid-tile.correct-flash {
    animation: correctFlash 0.6s ease-in-out;
}

.grid-tile.wrong-flash {
    animation: wrongFlash 0.6s ease-in-out;
}

/* Grid Tile Colors */
.grid-tile.color-gold {
    background: var(--gradient-gold);
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.grid-tile.color-silver {
    background: var(--gradient-silver);
    border-color: var(--accent-silver);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.grid-tile.color-blue {
    background: var(--gradient-blue);
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

/* Animations */
@keyframes patternPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

@keyframes correctFlash {
    0%, 100% {
        background: linear-gradient(145deg, rgba(0, 255, 136, 0.3), rgba(0, 255, 136, 0.1));
        box-shadow: var(--glow-success);
    }
    50% {
        background: linear-gradient(145deg, rgba(0, 255, 136, 0.5), rgba(0, 255, 136, 0.2));
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
}

@keyframes wrongFlash {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.action-btn {
    padding: 18px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-primary);
    background: var(--gradient-gold);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow-gold);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-btn:disabled:hover {
    box-shadow: var(--shadow-medium);
}

.action-btn.secondary {
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1));
    border: 2px solid rgba(192, 192, 192, 0.4);
}

.action-btn.secondary:hover {
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

/* Progress Bar */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--accent-silver);
    letter-spacing: 1px;
}

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent-gold);
}

/* ========================================
   GAME OVER SCREEN
   ======================================== */

.game-over-container {
    text-align: center;
    padding: 60px 40px;
    background: rgba(15, 20, 25, 0.9);
    border-radius: 20px;
    box-shadow: var(--shadow-hard);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.game-over-title {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    letter-spacing: 3px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.final-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.final-stat-label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent-silver);
    text-transform: uppercase;
}

.final-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

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

@media (max-width: 768px) {
    .game-header {
        padding: 15px 20px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .life-icon {
        font-size: 1.2rem;
    }
    
    .game-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .game-subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .mode-selection {
        grid-template-columns: 1fr;
    }
    
    .game-content {
        padding: 20px;
        gap: 20px;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .message-display {
        min-width: auto;
    }
    
    .grid-container {
        padding: 15px;
        gap: 8px;
    }
    
    .grid-tile {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        padding: 15px;
    }
    
    .final-stats {
        grid-template-columns: 1fr;
    }
    
    .game-over-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .game-header {
        padding: 10px 15px;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-over-title {
        font-size: 2rem;
    }
    
    .mode-btn {
        padding: 20px 15px;
    }
    
    .grid-tile {
        font-size: 1.2rem;
    }
}
