:root {
    --bg-color: #050510;
    --text-color: #e0e0e0;
    --accent-color: #00ffcc; /* Cyan */
    --accent-glow: rgba(0, 255, 204, 0.6);
    --secondary-color: #ff00ff; /* Magenta */
    --secondary-glow: rgba(255, 0, 255, 0.6);
    --grid-bg: #1a1a2e;
    --light-off: #2a2a40;
    --light-on: #00ffcc;
    --font-main: 'Orbitron', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling on mobile */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-glow);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 10px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 80px;
    flex: 1;
}

.label {
    font-size: 0.7rem;
    color: #aaa;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-glow);
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-area {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--grid-bg);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

canvas {
    display: block;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

button, select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 12px 20px;
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    flex: 1;
    text-align: center;
    outline: none;
}

button:hover, select:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ffcc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

select:hover {
     background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23050510' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

option {
    background: var(--bg-color);
    color: var(--accent-color);
}

footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(8px);
}

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

.overlay-content {
    background: rgba(26, 26, 46, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 40px var(--secondary-glow);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 90%;
    max-width: 400px;
}

.overlay-content h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    text-shadow: 0 0 15px var(--secondary-glow);
}

.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 400px) {
    h1 { font-size: 2rem; }
    .stat-box { min-width: 60px; padding: 5px 10px; }
    .value { font-size: 1rem; }
    button, select { padding: 10px 15px; font-size: 0.8rem; }
    .overlay-content { padding: 20px; }
    .overlay-content h2 { font-size: 1.5rem; }
}
