* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

:root {
    --primary: #00f3ff;
    --secondary: #ff00ea;
    --bg-color: #0a0a0f;
    --text-color: #ffffff;
    --glow-primary: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 40px var(--primary);
    --glow-secondary: 0 0 10px var(--secondary), 0 0 20px var(--secondary), 0 0 40px var(--secondary);
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Orbitron', sans-serif;
    color: var(--text-color);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#bg-canvas {
    z-index: 1;
}

#game-canvas {
    z-index: 2;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    pointer-events: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

#screen-hud {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.logo-container {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 6rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: var(--glow-primary);
    letter-spacing: 10px;
    margin: 0;
}

.sub-logo {
    font-size: 2rem;
    color: var(--secondary);
    text-shadow: var(--glow-secondary);
    letter-spacing: 5px;
}

h2 {
    font-size: 3rem;
    color: var(--primary);
    text-shadow: var(--glow-primary);
    margin-bottom: 2rem;
    letter-spacing: 5px;
}

.btn {
    background: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    margin: 0.5rem;
    border-radius: 5px;
    min-width: 250px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    letter-spacing: 2px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.btn.primary {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.btn.primary:hover {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: var(--glow-primary);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 120px;
}

.mode-btn .material-icons {
    font-size: 2rem;
}

/* Customization */
.custom-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    font-family: 'Orbitron';
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    opacity: 0.5;
}

.tab-btn.active {
    opacity: 1;
    border-bottom-color: var(--primary);
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.custom-content {
    width: 80%;
    max-width: 800px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 2rem;
    /* Custom Scrollbar */
}
.custom-content::-webkit-scrollbar {
    width: 8px;
}
.custom-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.custom-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.custom-content.hidden {
    display: none;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.skin-item {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.skin-item:hover {
    background: rgba(255,255,255,0.1);
}

.skin-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.skin-preview {
    width: 100%;
    height: 60px;
    background: #333;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

/* Stats */
.stats-container {
    width: 80%;
    max-width: 600px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1.2rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-val {
    color: var(--primary);
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary);
}

/* HUD */
.score-board {
    position: absolute;
    top: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.score {
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transition: transform 0.1s ease;
}

.score-divider {
    font-size: 2rem;
    color: rgba(255,255,255,0.3);
}

.powerup-notify {
    position: absolute;
    top: 20%;
    width: 100%;
    text-align: center;
    font-size: 2rem;
    color: var(--secondary);
    text-shadow: var(--glow-secondary);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
}

.powerup-notify.show {
    opacity: 1;
    transform: translateY(0);
}

.mobile-controls {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.touch-zone {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
}

.touch-zone.left { left: 0; }
.touch-zone.right { right: 0; }

@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }
    
    .logo { font-size: 4rem; }
    .sub-logo { font-size: 1.5rem; }
    h2 { font-size: 2rem; }
    
    .modes-grid {
        grid-template-columns: 1fr;
    }
    
    .score { font-size: 3rem; }
}

/* CRT Scanlines */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 20;
    pointer-events: none;
    opacity: 0.3;
}

#result-title {
    font-size: 4rem;
}
#result-score {
    font-size: 3rem;
    margin-bottom: 1rem;
}
#result-xp {
    font-size: 2rem;
    color: var(--secondary);
    text-shadow: var(--glow-secondary);
    margin-bottom: 2rem;
}
