/* ============================================
   NEON PATH ROLLER - STYLES
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Neon Theme */
    --neon-cyan: #00f5ff;
    --neon-pink: #ff00ff;
    --neon-purple: #9d00ff;
    --neon-green: #39ff14;
    --neon-yellow: #ffff00;
    --neon-orange: #ff6600;
    
    /* Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-elevated: #252535;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    /* Accents */
    --accent-primary: var(--neon-cyan);
    --accent-secondary: var(--neon-pink);
    --accent-success: var(--neon-green);
    --accent-warning: var(--neon-yellow);
    --accent-danger: #ff3366;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-neon: 0 0 20px var(--accent-primary), 0 0 40px var(--accent-primary);
    --shadow-neon-pink: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Screen Management */
.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* Loading Screen */
#loading-screen {
    z-index: 100;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.loading-content {
    text-align: center;
    padding: var(--space-xl);
}

.logo-container {
    margin-bottom: var(--space-2xl);
}

.neon-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
}

.logo-ball {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--neon-cyan) 30%, var(--neon-purple) 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-neon);
    animation: pulse-glow 2s ease-in-out infinite;
}

.logo-trail {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--neon-cyan);
    border-radius: 50%;
    opacity: 0.3;
    animation: rotate 3s linear infinite;
}

.logo-trail::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 2px solid var(--neon-pink);
    border-radius: 50%;
    opacity: 0.5;
    animation: rotate-reverse 2s linear infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.game-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
    letter-spacing: 0.15em;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-md);
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    border-radius: var(--radius-full);
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; margin-left: 0; }
    50% { width: 100%; margin-left: 0; }
    100% { width: 0%; margin-left: 100%; }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* Main Menu */
#main-menu {
    background: var(--bg-primary);
}

.menu-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.neon-grid {
    position: absolute;
    inset: -50%;
    background-image: 
        linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

.menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-lg);
}

.logo-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
}

.mini-ball {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.logo-small span {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.menu-btn:hover, .menu-btn:focus {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.menu-btn.primary {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-color: transparent;
}

.menu-btn.primary:hover, .menu-btn.primary:focus {
    box-shadow: var(--shadow-neon);
    transform: translateX(4px) scale(1.02);
}

.menu-btn.large {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.1rem;
}

.menu-btn.danger {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.menu-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
}

.mute-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mute-btn:hover, .mute-btn:focus {
    background: var(--bg-elevated);
    transform: scale(1.1);
}

.currency-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-weight: 600;
}

.coin-icon {
    font-size: 1.1rem;
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.screen-header.compact {
    padding: var(--space-sm) var(--space-md);
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn:hover, .back-btn:focus {
    background: var(--bg-elevated);
    transform: translateX(-2px);
}

.screen-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.header-spacer {
    width: 40px;
}

/* Level Select */
#level-select {
    background: var(--bg-primary);
}

.level-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-md);
    padding: var(--space-lg);
    overflow-y: auto;
}

.level-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.level-card:hover:not(.locked) {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.level-card.current {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.level-card.completed {
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(57, 255, 20, 0.1));
    border-color: var(--neon-green);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.level-card.completed .level-number {
    color: var(--neon-green);
}

.level-stars {
    display: flex;
    gap: 2px;
    margin-top: var(--space-xs);
}

.level-stars .star {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.level-stars .star.filled {
    color: var(--neon-yellow);
}

.level-difficulty {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 600;
}

.level-difficulty.easy {
    background: rgba(57, 255, 20, 0.2);
    color: var(--neon-green);
}

.level-difficulty.medium {
    background: rgba(255, 255, 0, 0.2);
    color: var(--neon-yellow);
}

.level-difficulty.hard {
    background: rgba(255, 51, 102, 0.2);
    color: var(--accent-danger);
}

/* Garage */
#garage {
    background: var(--bg-primary);
}

.garage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vehicle-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.preview-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.preview-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 245, 255, 0.1) 0%, transparent 70%);
}

.preview-vehicle {
    width: 100px;
    height: 100px;
    position: relative;
    z-index: 1;
}

.vehicle-orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.vehicle-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.stat-bar {
    text-align: center;
}

.stat-bar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stat-bar-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.vehicle-list {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    overflow-x: auto;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
}

.vehicle-item {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vehicle-item:hover, .vehicle-item.selected {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.vehicle-item.locked {
    opacity: 0.5;
}

.vehicle-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.vehicle-name {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.vehicle-status {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Start Game Screen */
#start-game {
    background: var(--bg-primary);
}

.start-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    overflow-y: auto;
}

.level-badge {
    text-align: center;
}

.level-badge .difficulty {
    display: block;
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.level-badge .level-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-pink);
}

.vehicle-showcase {
    width: 120px;
    height: 120px;
    margin: var(--space-xl) 0;
}

.objectives-panel {
    width: 100%;
    max-width: 320px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.objectives-panel h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.objectives-panel ul {
    list-style: none;
}

.objectives-panel li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.9rem;
}

.objectives-panel li::before {
    content: '○';
    color: var(--neon-cyan);
    font-weight: bold;
}

.stats-panel {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

/* Game Screen */
#game-screen {
    background: var(--bg-primary);
}

.game-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.pause-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.game-info {
    flex: 1;
}

.level-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-top: var(--space-xs);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.game-stats {
    display: flex;
    gap: var(--space-md);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-display);
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 0.8rem;
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    flex: 1;
    width: 100%;
    display: block;
}

.game-controls {
    display: none;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
}

.control-btn {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    touch-action: manipulation;
}

.control-btn:hover, .control-btn:focus {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.control-btn:active {
    transform: scale(0.95);
    background: var(--accent-primary);
}

.control-row {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.hint-btn {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    z-index: 10;
}

.hint-btn:hover, .hint-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--neon-yellow);
}

.hint-icon {
    font-size: 1.5rem;
}

.hint-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-danger);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 50;
    padding: var(--space-lg);
}

.overlay.active {
    display: flex;
}

.overlay-content {
    width: 100%;
    max-width: 360px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    animation: slide-up 0.3s ease;
}

.overlay-content.compact {
    max-width: 320px;
    padding: var(--space-lg);
}

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

.overlay-content h2, .overlay-content h3 {
    font-family: var(--font-display);
    margin-bottom: var(--space-lg);
}

.overlay-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.overlay-nav.horizontal {
    flex-direction: row;
    justify-content: center;
}

/* Pause Menu */
#pause-menu .overlay-content {
    max-width: 280px;
}

/* Success Screen */
#success-screen {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(57, 255, 20, 0.1) 100%);
}

.success-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.success-content h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: var(--space-xl);
    background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rewards-panel {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.reward {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.reward-icon {
    font-size: 1.5rem;
}

.reward-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.score-breakdown {
    width: 100%;
    max-width: 280px;
    margin-bottom: var(--space-xl);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 600;
    color: var(--neon-cyan);
}

.star-rating {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.star-rating .star {
    font-size: 2rem;
    color: var(--text-muted);
}

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

.success-nav {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* Failure Screen */
#failure-screen {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(255, 51, 102, 0.1) 100%);
}

.failure-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.failure-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-danger);
    border-radius: 50%;
    font-size: 2.5rem;
    color: white;
    margin-bottom: var(--space-lg);
}

.failure-content h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: var(--space-md);
    color: var(--accent-danger);
}

.failure-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.failure-nav {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* Hint Dialog */
.hint-preview {
    width: 120px;
    height: 120px;
    margin: var(--space-lg) auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.hint-fallback {
    margin-top: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hint-fallback span {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* Settings Screen */
#settings {
    background: var(--bg-primary);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.setting-group {
    margin-bottom: var(--space-xl);
}

.setting-group h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.setting-item span {
    font-size: 0.95rem;
}

.setting-item input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--neon-cyan);
    border-radius: 50%;
    cursor: pointer;
}

.setting-item.toggle input[type="checkbox"] {
    width: 48px;
    height: 24px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
}

.setting-item.toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all var(--transition-fast);
}

.setting-item.toggle input[type="checkbox"]:checked {
    background: rgba(0, 245, 255, 0.3);
}

.setting-item.toggle input[type="checkbox"]:checked::after {
    background: var(--neon-cyan);
    left: 26px;
}

.version-info, .credits {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-xs);
}

/* Help Screen */
#help {
    background: var(--bg-primary);
}

.help-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.help-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.help-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.help-section h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.help-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Ad Blocker Notice */
#adblock-notice .notice-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.notice-alt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--space-md);
}

/* Mock Ad */
.mock-ad-content {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.mock-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
}

.mock-ad-header span {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.mock-ad-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.mock-ad-body {
    padding: var(--space-2xl);
}

.mock-ad-placeholder {
    text-align: center;
}

.mock-ad-placeholder span {
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-md);
}

.mock-ad-placeholder p {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.mock-ad-placeholder small {
    color: var(--text-muted);
}

.mock-ad-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--bg-tertiary);
}

/* Responsive Design */
@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        padding: var(--space-sm) var(--space-md);
    }
    
    .level-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 768px) {
    .game-controls {
        display: none !important;
    }
    
    #game-canvas {
        cursor: pointer;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .game-controls {
        display: block;
    }
    
    .menu-btn, .control-btn, .hint-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .neon-grid {
        animation: none;
    }
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}