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

body {
    overflow: hidden;
    background: #05010d;
    font-family: 'Outfit', sans-serif;
    cursor: crosshair;
    touch-action: none;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

#title {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: clamp(28px, 6vw, 64px);
    letter-spacing: 0.25em;
    color: #fff;
    text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
    animation: hueTitle 8s linear infinite, fadeTitle 4s 3s forwards;
    pointer-events: none;
    z-index: 10;
    user-select: none;
}

@keyframes hueTitle {
    0%   { color: hsl(0, 100%, 70%); }
    16%  { color: hsl(60, 100%, 70%); }
    33%  { color: hsl(120, 100%, 70%); }
    50%  { color: hsl(180, 100%, 70%); }
    66%  { color: hsl(240, 100%, 70%); }
    83%  { color: hsl(300, 100%, 70%); }
    100% { color: hsl(360, 100%, 70%); }
}

@keyframes fadeTitle {
    to { opacity: 0.12; }
}

#controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(10, 5, 20, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 22px;
    z-index: 20;
    min-width: 240px;
    transition: opacity 0.6s ease, transform 0.6s ease;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

#controls.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    min-width: 44px;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 100, 255, 0.6);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 100, 255, 0.6);
    cursor: pointer;
    border: none;
}

.mode-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
}

.mode-btn {
    flex: 1;
    padding: 5px 2px;
    font-size: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 12px rgba(200, 100, 255, 0.2);
}

.btn-row {
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 8px 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 0 16px rgba(180, 80, 255, 0.25);
}

#remix-link {
    position: fixed;
    bottom: 12px;
    right: 16px;
    color: rgba(255, 255, 255, 0.18);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.06em;
    text-decoration: none;
    z-index: 20;
    transition: color 0.4s;
    animation: hueLink 12s linear infinite;
}

@keyframes hueLink {
    0%   { color: hsla(0, 70%, 70%, 0.25); }
    33%  { color: hsla(120, 70%, 70%, 0.25); }
    66%  { color: hsla(240, 70%, 70%, 0.25); }
    100% { color: hsla(360, 70%, 70%, 0.25); }
}

#remix-link:hover {
    color: rgba(255, 255, 255, 0.7) !important;
}

@media (max-width: 600px) {
    #controls {
        bottom: 12px;
        left: 12px;
        right: 12px;
        min-width: unset;
        padding: 14px 16px;
    }

    .mode-btn {
        padding: 8px 2px;
        font-size: 11px;
    }

    .action-btn {
        padding: 10px 6px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
}