/* REFLECTIONS - Neon Crypt Arcade Theme */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Neon Crypt Palette */
:root {
    /* Core Palette */
    --void: #0A0A12;
    --deep: #1B1B2F;
    --arc: #4E78E8;
    --pink: #E87ADC;
    --flare: #E84E6A;
    --ghost: #D4D4E8;

    /* Semantic mappings */
    --bg-primary: var(--void);
    --bg-secondary: var(--deep);
    --accent-primary: var(--arc);
    --accent-secondary: var(--pink);
    --accent-action: var(--flare);
    --text-primary: var(--ghost);
    --text-secondary: rgba(212, 212, 232, 0.6);

    /* UI Elements */
    --card-bg: rgba(27, 27, 47, 0.9);
    --border-glow: rgba(78, 120, 232, 0.6);
    --danger-red: var(--flare);
    --success-color: var(--arc);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--void);
    background-attachment: fixed;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Professional Navigation Bar */
.navbar {
    width: 100%;
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.navbar-right {
    justify-content: flex-end;
}

.navbar-center {
    flex: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Navbar Timer - Centered Focal Point */
.navbar-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(78, 120, 232, 0.5);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(78, 120, 232, 0.2);
}

.navbar-timer i {
    font-size: 20px;
    color: var(--arc);
}

.navbar-timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--arc);
    text-shadow: 0 0 20px rgba(78, 120, 232, 0.6);
    min-width: 70px;
}

/* Daily Info in Navbar - REMOVED (keeping for cleanup) */

/* Navbar Action Buttons - Prominent */
.navbar-btn-primary,
.navbar-btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.navbar-btn-primary {
    background: linear-gradient(135deg, var(--flare), #c43a54);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(232, 78, 106, 0.4);
}

.navbar-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(232, 78, 106, 0.6);
}

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

.navbar-btn-secondary {
    background: rgba(78, 120, 232, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(78, 120, 232, 0.5);
}

.navbar-btn-secondary:hover {
    background: rgba(78, 120, 232, 0.5);
    transform: translateY(-2px);
}

.navbar-btn-primary i,
.navbar-btn-secondary i {
    font-size: 16px;
}

/* Legacy - hidden */
.navbar-title {
    display: none;
}

.nav-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(78, 120, 232, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 20px;
}

.nav-icon-btn:hover {
    background: rgba(78, 120, 232, 0.15);
    border-color: var(--arc);
    color: var(--arc);
    box-shadow: 0 0 15px rgba(78, 120, 232, 0.3);
    transform: translateY(-2px);
}

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

/* Mode Selector - REMOVED (keeping for cleanup) */

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, var(--arc), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--pink), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--flare), transparent);
    background-repeat: repeat;
    background-size: 120px 120px;
    animation: float 15s ease-in-out infinite;
    opacity: 0.15;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Typography - LEGACY h1 (Hidden, now in navbar) */
h1 {
    display: none !important;
}

.neon-text {
    display: none !important;
}

@keyframes neon-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(78, 120, 232, 0.5))
                drop-shadow(0 0 40px rgba(232, 122, 220, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(78, 120, 232, 0.7))
                drop-shadow(0 0 60px rgba(232, 122, 220, 0.5));
    }
}

/* Instructions Panel */
#instructions {
    max-width: 700px;
    margin: 20px 0;
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 32px rgba(78, 120, 232, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.instruction-header {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--pink);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(232, 122, 220, 0.6);
}

.instruction-content {
    display: grid;
    gap: 12px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 400;
    padding: 10px 0;
    border-bottom: 1px solid rgba(78, 120, 232, 0.2);
    transition: all 0.3s ease;
}

.instruction-item i {
    font-size: 1.2rem;
    color: var(--arc);
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.instruction-item:hover {
    color: var(--pink);
    text-shadow: 0 0 10px rgba(232, 122, 220, 0.5);
}

.instruction-item:last-child {
    border-bottom: none;
}

/* Timer Display */
.timer-display {
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 15px 25px;
    margin: 20px 0;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(78, 120, 232, 0.15);
}

.timer-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--arc);
    text-shadow: 0 0 20px rgba(78, 120, 232, 0.6);
}

/* Main Content Wrapper - Provides consistent spacing for all game elements */
.main-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Fill available vertical space and center content */
    min-height: calc(100vh - 60px);
    /* Ensure no z-index/stacking issues */
    position: relative;
    z-index: auto;
}

/* Game Header Section - Container for controls */
.game-header-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0; /* Let children control their own spacing */
}

/* Game Controls Bar */
.game-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 32px rgba(78, 120, 232, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin: 5px 0;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-group-center {
    flex: 1;
    justify-content: center;
}

.control-group-actions {
    gap: 10px;
}

/* Timer Display */
.timer-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(78, 120, 232, 0.4);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(78, 120, 232, 0.15);
}

.timer-display i {
    font-size: 24px;
    color: var(--arc);
}

.timer-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timer-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--arc);
    text-shadow: 0 0 20px rgba(78, 120, 232, 0.6);
    line-height: 1;
}

/* Status Display */
.status-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: 25px;
    color: var(--text-primary);
    text-align: center;
    max-width: 500px;
    letter-spacing: 0.5px;
}

/* Update button styles to include icons */
.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary i,
.btn-secondary i {
    font-size: 18px;
}

/* Legacy game header - hidden */
.game-header {
    display: none !important;
}

.controls-row {
    display: none !important;
}

/* Game Container - Self-contained, independent module */
#gameContainer {
    position: relative;
    /* No visual styling - just a positioning wrapper */
    display: flex;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    display: block;
    border: 2px solid var(--arc);
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(78, 120, 232, 0.3),
        0 0 40px rgba(78, 120, 232, 0.2);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    pointer-events: auto;
    touch-action: none;
    transform: translateZ(0);
}

/* Legacy UI Controls - now integrated into game header */

.status-modern {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 25px;
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 25px;
    color: var(--text-primary);
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(78, 120, 232, 0.15);
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    letter-spacing: 1px;
}

/* Modern Button Styles */
.btn-primary, .btn-secondary, .btn-debug, .btn-info {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    margin: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-width: 140px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--flare), #c43a54);
    color: #ffffff;
    box-shadow:
        0 4px 15px rgba(232, 78, 106, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(232, 78, 106, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #c43a54, var(--flare));
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(78, 120, 232, 0.8), rgba(232, 122, 220, 0.8));
    color: var(--text-primary);
    border: 1px solid var(--arc);
    box-shadow: 0 4px 15px rgba(78, 120, 232, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 120, 232, 0.5);
    background: linear-gradient(135deg, var(--arc), var(--pink));
}

.btn-debug {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.8), rgba(255, 0, 68, 0.8));
    color: var(--text-primary);
    border: 1px solid var(--danger-red);
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.2);
}

.btn-debug:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, rgba(78, 120, 232, 0.8), rgba(232, 122, 220, 0.8));
    color: #ffffff;
    border: 1px solid var(--arc);
    box-shadow:
        0 4px 15px rgba(78, 120, 232, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(78, 120, 232, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--arc), var(--pink));
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

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

.btn-primary:disabled, .btn-secondary:disabled, .btn-debug:disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid rgba(100, 100, 100, 0.3);
}

/* Game Over Modal */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.5s ease;
}

.game-over-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* .game-over-content {
    background: var(--card-bg);
    border: 2px solid var(--danger-red);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(255, 51, 102, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
} */

@keyframes modalSlideIn {
    from { transform: scale(0.7) translateY(-50px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.game-over-animation {
    margin-bottom: 30px;
}

.explosion-effect {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--danger-red), transparent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: explosion 1s ease-out;
}

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

.glitch-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--danger-red);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
        0 0 20px var(--danger-red),
        2px 0 0 var(--sunset-orange),
        -2px 0 0 var(--sunset-pink);
    animation: glitch 1s ease-in-out infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px); }
    20% { transform: translateX(2px); }
}

.game-over-stats {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pink);
    text-shadow: 0 0 15px rgba(232, 122, 220, 0.6);
}

.retry-btn {
    margin-top: 20px;
    font-size: 1.2rem;
    padding: 15px 30px;
}

/* Rules Modal */
.rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.rules-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.rules-content {
    background: var(--card-bg);
    border: 2px solid var(--border-glow);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
        0 20px 60px rgba(78, 120, 232, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: modalSlideIn 0.3s ease;
}

.close-rules {
    margin-top: 20px;
    width: 100%;
}

/* Snapshot Modal Styles - For shareable game over/victory screens */
.snapshot-modal {
    padding: 0 !important;
    overflow: hidden;
    max-width: 500px;
    border-radius: 12px;
}

.snapshot-header {
    padding: 8px 15px;
    text-align: center;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(78, 120, 232, 0.2);
}

.snapshot-header .score-value {
    font-size: 1.8rem;
    margin: 0 0 4px 0;
    line-height: 1;
}

.snapshot-header .performance-rating {
    font-size: 0.75rem;
    letter-spacing: 1px;
    line-height: 1;
    margin: 0;
}

.snapshot-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #000;
}

.game-snapshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.snapshot-modal .modal-buttons {
    padding: 10px 15px;
    background: var(--card-bg);
    border-top: 1px solid rgba(78, 120, 232, 0.2);
}

.snapshot-modal .modal-buttons .btn-primary,
.snapshot-modal .modal-buttons .btn-secondary {
    font-size: 0.65rem;
    padding: 6px 13px;
    gap: 5px;
}

.snapshot-modal .modal-buttons .btn-primary i,
.snapshot-modal .modal-buttons .btn-secondary i {
    font-size: 11px;
}

/* Game Over Modal Specific Styles */
.game-over-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: center;
    height: 100%;
    min-height: 400px;
    background: var(--card-bg);
    border: 2px solid var(--danger-red);
    border-radius: 15px;
    padding: 10px;
    margin: 40px;
}

.final-score {
    flex-shrink: 0;
    margin-bottom: 20px;
}

.score-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.score-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--arc);
    text-shadow: 0 0 30px rgba(78, 120, 232, 0.7);
    letter-spacing: 3px;
}

.score-details {
    margin: 0 auto;
    padding: 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(78, 120, 232, 0.3);
    width: calc(100% - 40px);
    max-width: 380px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1em;
    margin: 10px 0;
    color: var(--text-secondary);
}

/* Compact score layout */
.compact-score {
    text-align: center;
    padding: 20px;
}

.compact-score .score-value {
    margin-bottom: 10px;
}

.compact-score .performance-rating {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.compact-score .performance-rating.perfect {
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
}

/* Modal button row - MUST override base button styles */
.modal-buttons {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
}

.modal-buttons button,
.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
    display: inline-block !important;
    padding: 11px 15px !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    box-shadow: none !important;
    transform: none !important;
}

.modal-buttons .btn-primary {
    background: var(--flare) !important;
    border: none !important;
    color: white !important;
}

.modal-buttons .btn-secondary {
    background: var(--arc) !important;
    border: none !important;
    color: white !important;
}

.status-failed {
    color: var(--danger-red);
    font-weight: 600;
    text-shadow: 0 0 10px var(--danger-red);
}

#leaderboardPosition {
    color: var(--text-primary);
    font-weight: 600;
}

.performance-rating {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    h1 {
        display: none !important;
    }
    
    .game-header {
        display: none !important;
    }
    
    .rules-modal {
        display: none !important;
    }
    
    .info-bubble {
        display: block;
    }
}

/* Mobile portrait - show rotation prompt */
@media screen and (max-width: 768px) and (orientation: portrait) {
    body::after {
        content: "ROTATE DEVICE FOR OPTIMAL LASER EXPERIENCE";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: var(--card-bg);
        color: var(--pink);
        padding: 20px;
        border-radius: 10px;
        border: 2px solid var(--border-glow);
        z-index: 1000;
        text-align: center;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 600;
        font-size: 14px;
        max-width: 300px;
        box-shadow: 0 10px 30px rgba(78, 120, 232, 0.4);
        text-shadow: 0 0 12px rgba(232, 122, 220, 0.6);
    }
    
    body > * {
        opacity: 0.3;
    }
}

/* Mobile landscape optimizations */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 0;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        margin: 0;
        overflow: hidden;
        background: var(--dark-bg);
    }
    
    #instructions {
        display: none !important;
    }
    
    #gameContainer {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100vh * 0.85);
        height: calc(100vh * 0.85 * 0.75);
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 80px);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #gameCanvas {
        width: 100%;
        height: 100%;
        touch-action: none;
        display: block;
        border: 2px solid var(--arc);
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(78, 120, 232, 0.3);
    }
    
    #ui {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 100;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 25px;
        padding: 8px;
        backdrop-filter: blur(10px);
        flex-direction: row;
        gap: 8px;
    }
    
    .status-modern {
        font-size: 10px;
        margin: 3px 0;
        padding: 6px 12px;
        border-radius: 12px;
        max-width: 280px;
        min-height: 30px;
    }
    
    #ui .btn-primary, #ui .btn-secondary, #ui .btn-debug {
        padding: 8px 12px;
        font-size: 10px;
        margin: 0 2px;
        border-radius: 18px;
        min-width: 40px;
        min-height: 16px;
        max-width: 50px;
        max-height: 20px;
    }
}

/* Info bubble styles for mobile */
.info-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
}

.info-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--arc);
    border: 2px solid var(--border-glow);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(78, 120, 232, 0.3);
    transition: all 0.2s ease;
    text-shadow: 0 0 8px rgba(78, 120, 232, 0.5);
}

.info-button:hover {
    background: rgba(78, 120, 232, 0.15);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(78, 120, 232, 0.5);
}

.info-popup {
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(78, 120, 232, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.info-popup.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.info-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger-red);
    border: 1px solid var(--danger-red);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 51, 102, 0.4);
    transform: scale(1.1);
}

/* Desktop specific styles */
@media (min-width: 769px) {
    .info-bubble {
        display: none;
    }
    
    h1 {
        font-size: 3.5rem;
        margin-bottom: 20px;
    }
    
    body {
        padding: 20px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .game-header {
        flex-shrink: 0;
    }
    
    #gameContainer {
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide any remaining mission briefing elements on desktop */
    #instructions {
        display: none !important;
    }
}

/* Game State Colors */
.status-playing {
    color: var(--pink);
    text-shadow: 0 0 15px rgba(232, 122, 220, 0.6);
}

.status-game-over {
    color: var(--flare);
    text-shadow: 0 0 20px rgba(232, 78, 106, 0.8);
    animation: pulse-red 1s ease-in-out infinite;
}

.status-success {
    color: var(--arc);
    text-shadow: 0 0 20px rgba(78, 120, 232, 0.7);
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    filter: blur(1px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

/* Mode Selector Styles - LEGACY (now in navbar) */
.mode-selector {
    display: none !important;
}

.mode-btn {
    display: none !important;
}

/* Daily Challenge Info - REMOVED */

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Status success style */
.status-success {
    color: var(--arc) !important;
    text-shadow: 0 0 20px rgba(78, 120, 232, 0.7) !important;
}

/* ============================================
   MOBILE LANDSCAPE - FULLSCREEN GAME EXPERIENCE
   ============================================ */

/* Hide mobile HUD on desktop and portrait */
.mobile-hud,
.mobile-menu,
.mobile-menu-overlay {
    display: none;
}

/* Mobile Landscape Mode - Complete Overhaul */
@media screen and (max-width: 932px) and (orientation: landscape),
       screen and (max-height: 500px) and (orientation: landscape) {

    /* Prevent ALL scrolling */
    html, body {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        touch-action: none;
    }

    body {
        background: #000 !important;
    }

    body::before {
        display: none !important;
    }

    /* Hide desktop UI completely - but NOT game container */
    .navbar,
    .game-header-section,
    .game-controls-bar,
    .info-bubble,
    #dailyInfo {
        display: none !important;
    }

    /* Reset main-content for mobile - it contains the game container */
    .main-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        top: 44px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1;
    }

    /* Show mobile HUD */
    .mobile-hud {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 44px;
        background: rgba(0, 0, 0, 0.9);
        border-bottom: 1px solid rgba(78, 120, 232, 0.3);
        z-index: 100;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px;
        backdrop-filter: blur(10px);
    }

    .mobile-hud-left,
    .mobile-hud-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .mobile-hud-center {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    /* Hamburger Button */
    .hamburger-btn {
        width: 36px;
        height: 36px;
        background: rgba(78, 120, 232, 0.15);
        border: 1px solid rgba(78, 120, 232, 0.4);
        border-radius: 8px;
        color: var(--arc);
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .hamburger-btn:active {
        background: rgba(78, 120, 232, 0.3);
        transform: scale(0.95);
    }

    /* Mobile Timer */
    .mobile-timer {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(78, 120, 232, 0.4);
        border-radius: 20px;
    }

    .mobile-timer i {
        color: var(--arc);
        font-size: 16px;
    }

    .mobile-timer span {
        font-family: 'JetBrains Mono', monospace;
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--arc);
        text-shadow: 0 0 10px rgba(78, 120, 232, 0.5);
        min-width: 50px;
    }

    /* Mobile Launch & Reset Buttons */
    .mobile-launch-btn,
    .mobile-reset-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .mobile-launch-btn {
        background: linear-gradient(135deg, var(--flare), #c43a54);
        color: white;
        box-shadow: 0 2px 10px rgba(232, 78, 106, 0.4);
    }

    .mobile-launch-btn:active:not(.disabled) {
        transform: scale(0.95);
        box-shadow: 0 1px 5px rgba(232, 78, 106, 0.3);
    }

    .mobile-launch-btn.disabled {
        background: rgba(100, 100, 100, 0.4);
        color: rgba(255, 255, 255, 0.4);
        cursor: not-allowed;
        box-shadow: none;
    }

    .mobile-reset-btn {
        background: rgba(78, 120, 232, 0.3);
        border: 1px solid rgba(78, 120, 232, 0.5);
        color: var(--arc);
    }

    .mobile-reset-btn:active {
        background: rgba(78, 120, 232, 0.5);
        transform: scale(0.95);
    }

    /* Game Container - Fullscreen with aspect ratio */
    #gameContainer {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: #000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    #gameCanvas {
        /* Maintain exact 800x600 (4:3) aspect ratio */
        display: block !important;
        width: auto !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        touch-action: none !important;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay:not(.hidden) {
        opacity: 1;
    }

    /* Mobile Slide-out Menu */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 80vw;
        height: 100%;
        background: var(--card-bg);
        border-right: 1px solid var(--border-glow);
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .mobile-menu.open {
        transform: translateX(0);
    }

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 1px solid rgba(78, 120, 232, 0.3);
        background: rgba(0, 0, 0, 0.3);
    }

    .mobile-menu-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 1.2rem;
        font-weight: 700;
        margin: 0;
        background: linear-gradient(135deg, var(--pink), var(--arc));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: 3px;
    }

    .mobile-menu-close {
        width: 32px;
        height: 32px;
        background: rgba(255, 51, 102, 0.2);
        border: 1px solid rgba(255, 51, 102, 0.4);
        border-radius: 8px;
        color: var(--danger-red);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-content {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
    }

    .mobile-menu-section {
        margin-bottom: 20px;
    }

    .mobile-menu-label {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--text-secondary);
        letter-spacing: 2px;
        margin-bottom: 10px;
        text-transform: uppercase;
    }

    /* Mobile Mode Selector */
    .mobile-mode-selector {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Mobile Menu Items */
    .mobile-menu-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 14px 15px;
        background: transparent;
        border: 1px solid rgba(78, 120, 232, 0.15);
        border-radius: 10px;
        color: var(--text-primary);
        font-family: 'Space Grotesk', sans-serif;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        margin-bottom: 8px;
    }

    .mobile-menu-item i {
        font-size: 20px;
        color: var(--arc);
    }

    .mobile-menu-item:active {
        background: rgba(78, 120, 232, 0.15);
        transform: scale(0.98);
    }

    /* Rules modal adjustments for mobile */
    .rules-modal {
        display: flex !important;
    }

    .rules-content {
        max-height: 90vh;
        width: 95%;
        max-width: 400px;
        padding: 20px;
    }

    .instruction-header {
        font-size: 1.2rem;
    }

    .instruction-item {
        font-size: 0.95rem;
        padding: 6px 0;
    }

    /* Compact modals on mobile */
    .compact-modal {
        padding: 16px !important;
        max-width: 260px !important;
        width: 85% !important;
        overflow: hidden !important;
    }

    .compact-modal .instruction-header {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
    }

    .compact-score {
        text-align: center;
        margin-bottom: 15px;
    }

    .compact-score .score-value {
        font-size: 2.2rem !important;
        margin-bottom: 8px;
    }

    .compact-score .performance-rating {
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .compact-score .performance-rating.perfect {
        color: #FFD700;
        text-shadow: 0 0 10px #FFD700;
    }

    .compact-modal {
        overflow: hidden !important;
    }

    .compact-modal .modal-buttons {
        gap: 4px !important;
    }

    .compact-modal .modal-buttons button,
    .compact-modal .modal-buttons .btn-primary,
    .compact-modal .modal-buttons .btn-secondary {
        padding: 10px 11px !important;
        font-size: 15px !important;
    }

    /* Snapshot modal on mobile */
    .snapshot-modal {
        max-width: 340px !important;
        width: 92% !important;
    }

    .snapshot-header {
        padding: 6px 10px;
    }

    .snapshot-header .score-value {
        font-size: 1.5rem !important;
        margin-bottom: 3px !important;
    }

    .snapshot-header .performance-rating {
        font-size: 0.65rem;
    }

    .snapshot-container {
        aspect-ratio: 4 / 3;
    }

    .snapshot-modal .modal-buttons {
        padding: 5px 8px;
        gap: 5px;
    }

    .snapshot-modal .modal-buttons .btn-primary,
    .snapshot-modal .modal-buttons .btn-secondary {
        font-size: 0.55rem;
        padding: 5px 10px;
    }
}

/* Tablet landscape - slightly different breakpoint */
@media screen and (min-width: 933px) and (max-width: 1024px) and (orientation: landscape) {
    .mobile-hud,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}