/* ==========================================
   CSS CUSTOM PROPERTIES - DARK/LIGHT MODE
   ========================================== */

:root[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #1a1d2e;
    --bg-secondary: #252837;
    --bg-card: #2d3250;
    
    /* Text Colors */
    --text-primary: #f8f9fa;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Neon Accent Colors */
    --neon-cyan: #00f5ff;
    --neon-magenta: #ff00ff;
    --neon-green: #39ff14;
    --neon-yellow: #fffc00;
    
    /* UI Colors */
    --border-color: #3d4563;
    --hover-bg: #363b52;
    --shadow-color: rgba(0, 245, 255, 0.3);
}

:root[data-theme="light"] {
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Neon Accent Colors (adjusted for light mode) */
    --neon-cyan: #06b6d4;
    --neon-magenta: #d946ef;
    --neon-green: #22c55e;
    --neon-yellow: #eab308;
    
    /* UI Colors */
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --shadow-color: rgba(6, 182, 212, 0.2);
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.btn-parallelogram {
    position: relative;
    padding: 0.75rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transform: skewX(-15deg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.btn-parallelogram span {
    display: inline-block;
    transform: skewX(15deg);
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--shadow-color);
    transform: skewX(-15deg) translateY(-2px);
}

/* Outline Button */
.btn-outline {
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.btn-outline:hover {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow-color);
}

/* ==========================================
   HEADER
   ========================================== */

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-header.minimal {
    padding: 1rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#logo-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    pointer-events: none;
    /* JS controls transform and font-size */
}

#logo-container a {
    pointer-events: auto;
    text-decoration: none;
}

.logo {
    font-weight: 900;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.logo span {
    color: var(--neon-cyan);
    -webkit-text-fill-color: var(--neon-cyan);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 4rem;
    margin-top: 10vh;
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ==========================================
   MODE SWITCHER
   ========================================== */

.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    position: relative;
    padding: 0.75rem 2rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transform: skewX(-10deg);
    transition: all 0.3s ease;
}

.mode-btn span {
    display: inline-block;
    transform: skewX(10deg);
}

.mode-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
    transform: skewX(-10deg) translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.mode-btn.active:hover {
    transform: skewX(-10deg) translateY(-2px);
}

/* ==========================================
   COMBO DISPLAY
   ========================================== */

.combo-display {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Lock Toggle Button */
.combo-lock-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-lock-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
}

.combo-lock-toggle.locked {
    background: rgba(76, 175, 80, 0.3);
    border-color: var(--neon-green);
}

.combo-lock-toggle.unlocked {
    background: rgba(255, 152, 0, 0.3);
    border-color: var(--neon-yellow);
}

/* ==========================================
   BURST MODE STATS
   ========================================== */

.burst-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    gap: 1rem;
}

.burst-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.burst-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.burst-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    font-variant-numeric: tabular-nums;
}

#burst-timer.warning {
    color: var(--neon-yellow);
}

#burst-timer.critical {
    color: var(--neon-magenta);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==========================================
   COMBO KEYS
   ========================================== */

.combo-keys {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.key {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--neon-cyan);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    box-shadow: 0 0 15px var(--shadow-color);
    transition: all 0.3s ease;
}

.key:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--shadow-color);
}

/* ==========================================
   COMBO INFO
   ========================================== */

.combo-info {
    text-align: center;
}

.combo-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.combo-game {
    color: var(--text-muted);
    font-size: 1rem;
}

.combo-status {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.combo-status.info {
    background: rgba(33, 150, 243, 0.2);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.combo-status.success {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
}

.combo-status.error {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid var(--neon-magenta);
    color: var(--neon-magenta);
}

/* Multi-line status for end screen */
.combo-status.multi-line {
    white-space: pre-line;
    line-height: 1.8;
}

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

/* ==========================================
   RESET BUTTON
   ========================================== */

.reset-btn {
    position: relative;
    padding: 0.75rem 2rem;
    margin-top: 1.5rem;
    width: 100%;
    border: 2px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transform: skewX(-10deg);
    transition: all 0.3s ease;
}

.reset-btn span {
    display: inline-block;
    transform: skewX(10deg);
}

.reset-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow-color);
    transform: skewX(-10deg) translateY(-2px);
}

/* ==========================================
   GAMES SECTION
   ========================================== */

.games-section {
    padding: 4rem 0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Filter Controls */
.all-games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-input {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 250px;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--shadow-color);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.select-wrapper {
    position: relative;
}

.filter-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--shadow-color);
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-cyan);
    pointer-events: none;
}

/* ==========================================
   GAME CARDS GRID
   ========================================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.new-games {
    grid-template-columns: repeat(4, 1fr);
}

/* Game Card */
.game-card {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background: linear-gradient(
        135deg,
        var(--gradient-start) 0%,
        var(--gradient-mid) 50%,
        var(--gradient-end) 100%
    );
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--neon-cyan);
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

/* Favorite Star */
.favorite-star {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.favorite-star:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

.favorite-star.active {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

/* Coming Soon Cards */
.game-card.coming-soon {
    opacity: 0.6;
    cursor: default;
}

.game-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

.coming-soon-badge {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Game Card Content */
.game-card-content {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 5;
}

.game-name {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--neon-cyan);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Tablet */
@media screen and (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .new-games {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .all-games-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-controls {
        width: 100%;
    }
    
    .filter-input {
        flex: 1;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .new-games {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body:not(.scrolled) .logo {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .mode-switcher {
        gap: 0.5rem;
    }
    
    .mode-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .combo-keys {
        gap: 0.5rem;
    }
    
    .key {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .burst-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .burst-stat {
        width: 100%;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .btn-parallelogram {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-input,
    .filter-select {
        width: 100%;
    }
}

/* Large Desktop (WQHD and above) */
@media screen and (min-width: 2560px) {
    .container {
        max-width: 2000px;
    }
    
    .games-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .new-games {
        grid-template-columns: repeat(5, 1fr);
    }
}
