@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    min-height: 100vh;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(120, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 255, 180, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 50, 100, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.95), rgba(10, 10, 15, 0.85));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

button {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

button:hover {
    border-color: #00ffb4;
    box-shadow: 0 0 20px rgba(0, 255, 180, 0.3);
}

button:hover::before {
    left: 100%;
}

button.active {
    background: linear-gradient(135deg, rgba(112, 0, 255, 0.3), rgba(0, 255, 180, 0.3));
    border-color: #00ffb4;
}

#canvas-container {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    bottom: 40px;
    z-index: 10;
}

canvas {
    display: block;
}

.stats-panel {
    position: fixed;
    bottom: 30px;
    right: 40px;
    z-index: 100;
    text-align: right;
    display: none;
}

.stat {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #fff;
    min-width: 60px;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95), rgba(10, 10, 15, 0.85));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.mode-indicator {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.debug-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    white-space: nowrap;
    display: none;
}

.debug-toggle input {
    accent-color: #00ffb4;
}

@media (max-width: 600px) {
    header {
        padding: 10px 12px;
        gap: 8px;
    }

    h1 {
        font-size: 0.85rem;
        letter-spacing: 0.15em;
    }

    .controls {
        gap: 8px;
    }

    button {
        font-size: 0.6rem;
        padding: 8px 12px;
    }

    .debug-toggle {
        font-size: 0.6rem;
    }

    .debug-toggle span {
        display: none;
    }

    .debug-toggle::after {
        content: 'Debug';
        font-size: 0.6rem;
    }

    footer {
        height: 36px;
    }

    .mode-indicator {
        font-size: 0.55rem;
        letter-spacing: 0.1em;
    }

    #canvas-container {
        top: 50px;
        bottom: 36px;
    }
}