:root {
    --primary: #4ade80;
    --secondary: #6366f1;
    --dark: #0f172a;
    --text: #f8fafc;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    user-select: none;
}

canvas {
    display: block;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 0.3s;
}

h1.title {
    font-size: 4rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #4ade80, #3b82f6);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 10px 30px rgba(74, 222, 128, 0.3);
    text-align: center;
}

button.btn-main {
    padding: 15px 40px;
    font-size: 1.2rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #10b981);
    color: var(--dark);
    border: none;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(74, 222, 128, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 10px;
}

button.btn-main:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 25px rgba(74, 222, 128, 0.6);
}

button.btn-main:active {
    transform: translateY(1px);
}

button.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

button:focus, button.gamepad-focus, input[type="range"]:focus, input[type="range"].gamepad-focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
    transition: all 0.2s;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 300;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1e293b;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    margin-top: 0;
    color: var(--primary);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Effects */
#flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    transition: opacity 0.1s;
    opacity: 0;
    background: white;
}

#dim-alert {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 40;
    pointer-events: none;
    touch-action: none;
}

.mob-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.1s, transform 0.1s;
}

@media (orientation: portrait) {
    h1.title { font-size: 3rem; }
    button.btn-main { padding: 12px 20px; font-size: 1rem; }
    .hud { font-size: 1.2rem; }
}
