﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #08080a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 50px 24px;
    overflow-x: hidden;
    position: relative;
}

#butterchurn-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    display: block;
    filter: blur(35px) brightness(0.35);
}

.visualizer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(20, 20, 25, 0.4) 0%, rgba(8, 8, 10, 0.9) 100%);
    z-index: -2;
    pointer-events: none;
}

.snake-frame-container {
    position: relative;
    width: 100%;
    max-width: 490px;
    transition: transform 0.06s ease-out;
}

.snake-svg-border {
    position: absolute;
    top: -16px;
    left: -16px;
    width: calc(100% + 32px);
    height: calc(100% + 32px);
    pointer-events: none;
    overflow: visible;
    z-index: 10;
}

.dashed-border-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 3;
    stroke-dasharray: 14, 10;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    transition: stroke-width 0.06s ease-out;
}

.master-container {
    position: relative;
    width: 100%;
    background: rgba(20, 20, 24, 0.75);
    backdrop-filter: blur(30px) saturate(140%);
    -webkit-backdrop-filter: blur(30px) saturate(140%);
    border-radius: 36px;
    padding: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.15), inset 0 -1px 1px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

    .master-container::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -150%;
        width: 20%;
        height: 200%;
        background: linear-gradient(115deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.015) 45%, rgba(255, 255, 255, 0.04) 65%, rgba(255, 255, 255, 0.015) 75%, rgba(255, 255, 255, 0) 100%);
        transform: rotate(25deg);
        pointer-events: none;
        animation: shine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    }

@keyframes shine {
    0%, 30% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

.visualizer-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    width: 100%;
    height: 360px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#butterchurn-center-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.player-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.track-info {
    text-align: center;
    margin-bottom: 12px;
}

.track-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.track-artist {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 6px;
    transition: height 0.15s;
}

    .progress-bar:hover {
        height: 6px;
    }

.progress-filled {
    height: 100%;
    background: linear-gradient(90deg, #cbd5e1, #ffffff);
    width: 0%;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

    .progress-filled::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 6px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 0 8px #ffffff;
    }

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

button {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

    button svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
        opacity: 0.8;
        transition: opacity 0.2s, transform 0.2s;
    }

    button:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

        button:hover svg {
            opacity: 1;
            transform: scale(1.05);
        }

    button:active {
        transform: translateY(0);
    }

    button.active-mode {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
        color: #ffffff;
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
    }

        button.active-mode svg {
            opacity: 1;
            fill: #ffffff;
        }

.external-like-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    width: 100%;
}

.btn-like-external {
    background: rgba(20, 20, 24, 0.75);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 20px;
    border-radius: 16px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

    .btn-like-external svg {
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), fill 0.2s, stroke 0.2s;
        stroke: #94a3b8;
    }

    .btn-like-external:hover {
        background: rgba(255, 0, 86, 0.15);
        border-color: rgba(255, 0, 86, 0.4);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 0, 86, 0.25);
    }

        .btn-like-external:hover svg {
            stroke: #ff0056;
        }

    .btn-like-external.liked {
        background: rgba(255, 0, 86, 0.25);
        border-color: rgba(255, 0, 86, 0.6);
        box-shadow: 0 0 20px rgba(255, 0, 86, 0.4);
    }

        .btn-like-external.liked svg {
            fill: #ff0056;
            stroke: #ff0056;
            transform: scale(1.15);
            animation: heartPulse 0.3s ease;
        }

button.btn-like-external.cooldown {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes heartPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

.btn-play {
    background: linear-gradient(135deg, #e2e8f0, #ffffff);
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.4);
    padding: 8px 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

    .btn-play:hover {
        background: linear-gradient(135deg, #ffffff, #cbd5e1);
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
    }

.preset-selector-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.preset-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: #94a3b8;
    padding: 0 2px;
}

.preset-select {
    width: 100%;
    background: rgba(10, 10, 14, 0.85);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    outline: none;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .preset-select:hover {
        border-color: rgba(255, 255, 255, 0.3);
    }

    .preset-select option {
        background: #141418;
        color: #f8fafc;
    }

.preset-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
}

    .preset-controls button {
        padding: 4px 10px;
        font-size: 0.72rem;
        background: rgba(255, 255, 255, 0.04);
    }

.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 6px;
}

.volume-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    fill: #94a3b8;
    transition: fill 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

    .volume-icon:hover {
        fill: #f8fafc;
        transform: scale(1.05);
    }

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

    .volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #ffffff;
        cursor: pointer;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        transition: transform 0.15s;
    }

        .volume-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }
