@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* CSS Variables for theming */
:root {
    /* Dark theme (default) */
    --bg-body: #0f172a;
    --bg-canvas: #0f172a;
    --bg-container: #0f172a;
    --bg-overlay: rgba(15, 23, 42, 0.85);
    --bg-button: #1e293b;
    --bg-button-hover: #334155;
    --bg-kbd: #1e293b;
    --bg-game-area: #0f172a;
    --border-color: #334155;
    --border-game-area: #1e293b;
    --text-primary: #94a3b8;
    --text-secondary: #64748b;
    --text-title: #64748b;
    --text-subtitle: #475569;
    --dino-color: #475569;
    --dino-spike: #64748b;
    --dino-eye: #94a3b8;
    --cactus-color: #166534;
    --bird-color: #86198f;
    --line-color: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Light theme */
[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-canvas: #ffffff;
    --bg-container: #f1f5f9;
    --bg-overlay: rgba(241, 245, 249, 0.95);
    --bg-button: #e2e8f0;
    --bg-button-hover: #cbd5e1;
    --bg-kbd: #e2e8f0;
    --bg-game-area: #ffffff;
    --border-color: #cbd5e1;
    --border-game-area: #e2e8f0;
    --text-primary: #475569;
    --text-secondary: #64748b;
    --text-title: #334155;
    --text-subtitle: #64748b;
    --dino-color: #334155;
    --dino-spike: #475569;
    --dino-eye: #64748b;
    --cactus-color: #22c55e;
    --bird-color: #a855f7;
    --line-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Red theme */
[data-theme="red"] {
    --bg-body: #1a0505;
    --bg-canvas: #0f0202;
    --bg-container: #1a0505;
    --bg-overlay: rgba(26, 5, 5, 0.95);
    --bg-button: #450a0a;
    --bg-button-hover: #7f1d1d;
    --bg-kbd: #450a0a;
    --bg-game-area: #0f0202;
    --border-color: #7f1d1d;
    --border-game-area: #450a0a;
    --text-primary: #fca5a5;
    --text-secondary: #f87171;
    --text-title: #ef4444;
    --text-subtitle: #dc2626;
    --dino-color: #991b1b;
    --dino-spike: #b91c1c;
    --dino-eye: #fca5a5;
    --cactus-color: #166534;
    --bird-color: #be123c;
    --line-color: #450a0a;
    --shadow-color: rgba(220, 38, 38, 0.3);
}

/* Neon theme */
[data-theme="neon"] {
    --bg-body: #0a0a0a;
    --bg-canvas: #050505;
    --bg-container: #0a0a0a;
    --bg-overlay: rgba(10, 10, 10, 0.95);
    --bg-button: #1a1a2e;
    --bg-button-hover: #16213e;
    --bg-kbd: #1a1a2e;
    --bg-game-area: #050505;
    --border-color: #00ff88;
    --border-game-area: #00ffff;
    --text-primary: #00ff88;
    --text-secondary: #00ffff;
    --text-title: #ff00ff;
    --text-subtitle: #00ffff;
    --dino-color: #00ff88;
    --dino-spike: #00ffff;
    --dino-eye: #ff00ff;
    --cactus-color: #00ff00;
    --bird-color: #ff00ff;
    --line-color: #1a1a2e;
    --shadow-color: rgba(0, 255, 136, 0.3);
}

body {
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: ui-sans-serif, system-ui, sans-serif;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.font-pixel {
    font-family: 'Press+Start+2P', cursive;
}
#game-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    padding: 20px;
}
canvas {
    background-color: var(--bg-canvas);
    width: 100%;
    height: auto;
    display: block;
    transition: background-color 0.3s ease;
}
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    text-align: center;
    padding: 20px;
    z-index: 20;
    transition: background 0.3s ease;
}
.hidden { display: none !important; }
#start-overlay { cursor: pointer; }

/* Theme switcher styles */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
    background: var(--bg-button);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 10px var(--shadow-color);
}

.theme-dark { background: #0f172a; color: #94a3b8; }
.theme-light { background: #f1f5f9; color: #475569; }
.theme-red { background: #450a0a; color: #fca5a5; }
.theme-neon { background: #0a0a0a; color: #00ff88; border: 1px solid #00ff88; }

/* Neon theme special effects */
[data-theme="neon"] .theme-btn {
    box-shadow: 0 0 5px currentColor;
}

[data-theme="neon"] .theme-btn.active {
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
}
