* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.audorasleep-player-body {
    font-family: "Arial", sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #172a74 0%, #21a9af 100%);
    padding: 20px;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

.player-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 2;
}

.wave-field {
    position: absolute;
    inset: -20vh -20vw;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
}

.wave-field::before,
.wave-field::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translate3d(0, 0, 0) scale(1.05);
    animation: wave-drift 9s ease-in-out infinite;
}

.wave-field::before {
    background-image:
        radial-gradient(
            60% 18% at 10% 55%,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.15) 40%,
            transparent 65%
        ),
        radial-gradient(
            55% 16% at 70% 45%,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.13) 45%,
            transparent 70%
        ),
        radial-gradient(
            70% 20% at 35% 75%,
            rgba(255, 255, 255, 0.28) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%
        );
    filter: blur(6px);
}

.wave-field::after {
    background-image:
        repeating-linear-gradient(
            110deg,
            rgba(255, 255, 255, 0.125) 0 2px,
            transparent 2px 24px
        ),
        radial-gradient(
            60% 18% at 85% 65%,
            rgba(255, 255, 255, 0.225) 0%,
            rgba(255, 255, 255, 0.09) 45%,
            transparent 70%
        );
    filter: blur(8px);
    opacity: 0.9;
    animation-duration: 13.5s;
    animation-direction: reverse;
}

@keyframes wave-drift {
    0%,
    100% {
        transform: translate3d(-2%, 1.2%, 0) scale(1.03);
    }
    50% {
        transform: translate3d(2%, -2.4%, 0) scale(1.07);
    }
}

.buttons-container {
    display: flex;
    gap: 40px;
}

.player-container {
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    border: 8px solid rgba(255, 255, 255, 0.3);
}

.quadrant {
    position: absolute;
    width: 50%;
    height: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.quadrant.active {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.quadrant-binaural {
    top: 0;
    left: 0;
    transform: rotate(-45deg);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.quadrant-music {
    top: 0;
    right: 0;
    transform: rotate(45deg);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.quadrant-voice {
    bottom: 0;
    left: 0;
    transform: rotate(45deg);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.quadrant-ambiance {
    bottom: 0;
    right: 0;
    transform: rotate(-45deg);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.toggle-switch {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-switch:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.4);
}

.toggle-switch.active {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

.toggle-switch::before {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.toggle-switch.active::before {
    background: #fff;
}

.toggle-top-left {
    top: 20px;
    left: 20px;
}

.toggle-top-right {
    top: 20px;
    right: 20px;
}

.toggle-bottom-left {
    bottom: 20px;
    left: 20px;
}

.toggle-bottom-right {
    bottom: 20px;
    right: 20px;
}

.center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 6px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.center-play:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.35);
}

.center-play.playing {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
}

.center-play::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 25px 0 25px 45px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
    margin-left: 8px;
    transition: all 0.3s ease;
}

.center-play.playing::before {
    border-style: double;
    border-width: 0 0 0 40px;
    border-color: transparent transparent transparent #fff;
    height: 50px;
    margin-left: 0;
}

.timer-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 135%;
    height: 135%;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-box: fill-box;
    transform-origin: center;
    z-index: 19;
    pointer-events: none;
}

.timer-ring-background {
    stroke: rgba(255, 255, 255, 0.3);
}

.timer-ring-progress {
    stroke: #fff;
    transition: stroke-dashoffset 1s linear;
}

.side-button {
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    padding: 15px 30px;
    font-size: 17px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border-radius: 10px;
}

.side-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.indicator-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.timer-modal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 30px 40px;
    min-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.timer-modal h2 {
    text-align: center;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.timer-display {
    text-align: center;
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    margin: 20px 0;
    text-transform: uppercase;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.slider-label {
    font-size: 28px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
    text-align: center;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
}
.slider:disabled {
    opacity: 0.5;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-top: -8px; /* Center thumb on track */
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-top: -8px; /* Center thumb on track */
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.slider::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 10px;
}

.mixer-modal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 30px;
    min-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.mixer-modal h2 {
    text-align: center;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.mixer-content {
    display: flex;
    gap: 30px;
}

.mixer-sliders {
    display: flex;
    gap: 20px;
    flex: 1;
}

.channel-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.channel-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.channel-knob:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.channel-knob::after {
    content: "";
    width: 0;
    height: 0;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    opacity: 0;
}

.channel-knob.active {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.9);
}

.channel-knob.active::after {
    width: 18px;
    height: 18px;
    opacity: 1;
}

.slider-wrapper {
    width: 40px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.vertical-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 180px;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transform: rotate(-90deg);
    cursor: pointer;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.vertical-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.vertical-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.vertical-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.channel-label {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ambiance-list {
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ambiance-item {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 15px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ambiance-item:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.ambiance-item.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.ambiance-item.active::before {
    content: "◆";
    font-size: 16px;
}

.ambiance-item:not(.active)::before {
    content: "○";
    font-size: 16px;
}

.binaural-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.binaural-options .side-button {
    padding: 10px 20px;
    font-size: 12px;
    min-width: 100px;
}

.modal-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
    text-align: center;
}

.track-selection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.track-selection-options .side-button {
    padding: 10px 15px;
    min-width: 80px;
    font-size: 12px;
}

/* Responsive overrides for smaller screens */
.player-container {
    width: min(500px, 90vw);
    height: min(500px, 90vw);
}

.quadrant {
    font-size: clamp(14px, 3.2vw, 28px);
}

.toggle-switch {
    width: clamp(34px, 7vw, 50px);
    height: clamp(34px, 7vw, 50px);
}

.toggle-switch::before {
    width: clamp(14px, 3.5vw, 20px);
    height: clamp(14px, 3.5vw, 20px);
}

.center-play {
    width: clamp(90px, 24vw, 140px);
    height: clamp(90px, 24vw, 140px);
}

.buttons-container {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.side-button {
    padding: 12px 20px;
    font-size: clamp(12px, 3.5vw, 17px);
}

.modal-overlay {
    padding: 20px;
}

.timer-modal {
    width: min(92vw, 520px);
    min-width: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.timer-modal h2 {
    font-size: clamp(20px, 5vw, 32px);
}

.timer-display {
    font-size: clamp(28px, 8vw, 48px);
}

.slider-container {
    flex-wrap: wrap;
    justify-content: center;
}

.slider-label {
    font-size: clamp(16px, 5vw, 28px);
    min-width: 48px;
}

.slider {
    height: 10px;
    min-width: 200px;
}

.mixer-modal {
    width: min(92vw, 720px);
    min-width: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.mixer-modal h2 {
    font-size: clamp(20px, 5vw, 32px);
}

.mixer-content {
    flex-wrap: wrap;
    justify-content: center;
}

.mixer-sliders {
    flex-wrap: wrap;
    justify-content: center;
}

.slider-wrapper {
    height: 180px;
}

.vertical-slider {
    width: 160px;
}

.ambiance-list {
    width: min(92vw, 280px);
}

.modal-text {
    font-size: clamp(14px, 4vw, 16px);
}

@media (max-width: 600px) {
    .audorasleep-player-body {
        padding: 12px;
        gap: 20px;
    }

    .player-wrapper {
        gap: 20px;
    }

    .player-container {
        border-radius: 28px;
        border-width: 6px;
    }

    .toggle-top-left {
        top: 12px;
        left: 12px;
    }

    .toggle-top-right {
        top: 12px;
        right: 12px;
    }

    .toggle-bottom-left {
        bottom: 12px;
        left: 12px;
    }

    .toggle-bottom-right {
        bottom: 12px;
        right: 12px;
    }

    .center-play {
        border-width: 4px;
    }

    .timer-modal,
    .mixer-modal {
        padding: 20px;
    }

    .mixer-modal {
        width: 100%;
    }

    .mixer-content {
        flex-direction: column;
        align-items: center;
    }

    .mixer-sliders {
        width: 100%;
        gap: 14px;
    }

    .channel-slider {
        flex: 1 1 40%;
    }

    .slider {
        min-width: 160px;
    }

    .ambiance-list {
        width: 100%;
    }

    .binaural-options,
    .track-selection-options {
        gap: 10px;
    }

    .binaural-options .side-button,
    .track-selection-options .side-button {
        width: 100%;
        max-width: 220px;
    }
}

@media (max-width: 420px) {
    .slider-wrapper {
        height: 160px;
    }

    .vertical-slider {
        width: 140px;
    }
}

#helpModal .modal-text p {
    color: #fff;
}
