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

body {
    background: #000;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    width: 100vw;
    height: 100vh;
    position: relative;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: pointer;
}

/* Landing Screen */
.landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10,10,30,0.95) 0%, rgba(0,0,0,0.99) 100%);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.landing.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.landing-content {
    text-align: center;
    padding: 2rem;
}

.title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(4rem, 15vw, 10rem);
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #00f0ff 0%, #ff00ff 50%, #ff3366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.4)) drop-shadow(0 0 60px rgba(255, 0, 255, 0.2));
    line-height: 1;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.4)) drop-shadow(0 0 60px rgba(255, 0, 255, 0.2)); }
    50% { filter: drop-shadow(0 0 50px rgba(0, 240, 255, 0.6)) drop-shadow(0 0 80px rgba(255, 0, 255, 0.4)); }
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 1.2rem);
    letter-spacing: 0.6em;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.5rem;
    margin-bottom: 3rem;
}

.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-wrapper input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: #fff;
    text-align: center;
    letter-spacing: 0.1em;
    width: min(90vw, 400px);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05), inset 0 0 20px rgba(0, 240, 255, 0.02);
}

.input-wrapper input:focus {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 30px rgba(0, 240, 255, 0.05);
}

.explode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background: linear-gradient(135deg, rgba(255, 0, 100, 0.8), rgba(255, 50, 0, 0.8));
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    letter-spacing: 0.15em;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(255, 50, 50, 0.3), 0 4px 20px rgba(0,0,0,0.4);
    animation: btnPulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.explode-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 52px;
    background: linear-gradient(135deg, #ff0066, #ff3300, #ff00ff, #00f0ff);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.explode-btn:hover::before {
    opacity: 1;
}

.explode-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(255, 50, 50, 0.5), 0 8px 30px rgba(0,0,0,0.5);
}

.explode-btn:active {
    transform: scale(0.95);
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 50, 50, 0.3), 0 4px 20px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 0 60px rgba(255, 50, 50, 0.5), 0 4px 30px rgba(0,0,0,0.5); }
}

.btn-icon {
    font-size: 1.4em;
    animation: iconShake 0.5s ease-in-out infinite;
}

@keyframes iconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.instructions {
    margin-top: 2rem;
    font-size: clamp(0.6rem, 1.5vw, 0.85rem);
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.05em;
    line-height: 1.5;
}

/* Controls */
.controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 2rem 1rem 1.2rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.controls.hidden {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.controls-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

.control-group input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    color: #fff;
    width: 100px;
    outline: none;
    letter-spacing: 0.05em;
}

.control-group input[type="text"]:focus {
    border-color: rgba(0, 240, 255, 0.4);
}

.control-group input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.control-group input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.control-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    cursor: pointer;
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: rgba(0, 240, 255, 0.3);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Rec indicator */
.rec-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: rgba(255, 50, 50, 0.6);
}

.rec-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3333;
    animation: recBlink 1s ease-in-out infinite;
}

@keyframes recBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Footer */
.footer-link {
    position: fixed;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.12);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.3s, opacity 0.4s;
}

.footer-link:hover {
    color: rgba(0, 240, 255, 0.4);
}

@media (max-width: 600px) {
    .controls-inner {
        gap: 0.8rem;
    }
    .control-group input[type="text"] {
        width: 70px;
        font-size: 0.8rem;
    }
    .control-group input[type="range"] {
        width: 60px;
    }
}