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

body {
    font-family: 'Comfortaa', cursive;
    overflow: hidden;
    background: #1a0a12;
    color: #fce4ec;
    -webkit-user-select: none;
    user-select: none;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
    padding: 16px 20px 12px;
    background: linear-gradient(180deg, rgba(60, 10, 30, 0.85) 0%, rgba(60, 10, 30, 0) 100%);
    pointer-events: none;
}

#header h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #f8bbd0, #ffcc80, #f8bbd0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 1px;
}

#header .subtitle {
    font-size: 12px;
    font-weight: 300;
    color: #ce93d8;
    margin-top: 2px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#controls-panel {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(40, 10, 25, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(248, 187, 208, 0.2);
    border-radius: 24px;
    padding: 20px 24px;
    width: 340px;
    max-width: 92vw;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(248, 187, 208, 0.3) transparent;
}

#controls-panel::-webkit-scrollbar {
    width: 4px;
}

#controls-panel::-webkit-scrollbar-thumb {
    background: rgba(248, 187, 208, 0.3);
    border-radius: 2px;
}

.control-group {
    margin-bottom: 16px;
}

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

.control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #f8bbd0;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #4a1942, #880e4f, #ff6f00);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #ffcc80, #e65100);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(255, 111, 0, 0.5);
    cursor: grab;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
    cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #ffcc80, #e65100);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(255, 111, 0, 0.5);
    cursor: grab;
}

.value-display {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    color: #ffcc80;
    text-shadow: 0 0 10px rgba(255, 111, 0, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(248, 187, 208, 0.5);
    margin-top: 4px;
    padding: 0 2px;
}

#rpm-gauge {
    display: flex;
    justify-content: center;
}

#rpm-canvas {
    max-width: 100%;
}

#comfort-meter {
    position: relative;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(248, 187, 208, 0.15);
}

#comfort-fill {
    height: 100%;
    width: 30%;
    border-radius: 14px;
    background: linear-gradient(90deg, #42a5f5, #f48fb1, #e91e63);
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

#comfort-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.toggle-group {
    display: flex;
    gap: 6px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid rgba(248, 187, 208, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #f8bbd0;
    border-radius: 12px;
    font-family: 'Comfortaa', cursive;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-btn:hover {
    background: rgba(248, 187, 208, 0.1);
}

.toggle-btn.active {
    background: linear-gradient(135deg, rgba(136, 14, 79, 0.6), rgba(233, 30, 99, 0.4));
    border-color: #f48fb1;
    color: #fff;
    font-weight: 600;
    transform: scale(1.03);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.3);
}

.small-controls {
    display: flex;
    gap: 8px;
}

.icon-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid rgba(248, 187, 208, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #ce93d8;
    border-radius: 12px;
    font-family: 'Comfortaa', cursive;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(248, 187, 208, 0.1);
    color: #f8bbd0;
}

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

.icon-btn.active {
    background: rgba(206, 147, 216, 0.2);
    border-color: #ce93d8;
}

#music-notes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.music-note {
    position: absolute;
    font-size: 24px;
    animation: floatUp 2.5s ease-out forwards;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1) rotate(-10deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-180px) scale(0.3) rotate(30deg);
    }
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: rgba(206, 147, 216, 0.5);
    z-index: 10;
    background: linear-gradient(0deg, rgba(26, 10, 18, 0.8) 0%, transparent 100%);
    pointer-events: none;
}

#footer a {
    color: rgba(244, 143, 177, 0.6);
    text-decoration: none;
    pointer-events: auto;
}

#footer a:hover {
    color: #f48fb1;
}

@media (max-width: 480px) {
    #header h1 {
        font-size: 22px;
    }
    #controls-panel {
        width: 94vw;
        padding: 16px 16px;
        bottom: 44px;
        max-height: 50vh;
    }
    .toggle-btn {
        font-size: 10px;
        padding: 7px 4px;
    }
}

@media (max-height: 600px) {
    #controls-panel {
        max-height: 45vh;
    }
}