/* style.css */
:root {
    --bg: #070711;
    --panel: rgba(13, 15, 35, 0.86);
    --panel-strong: rgba(22, 24, 52, 0.94);
    --text: #f5f7ff;
    --muted: #aab2d8;
    --neon: #65fff2;
    --neon-2: #ff4fd8;
    --neon-3: #ffe66b;
    --danger: #ff426a;
    --line: rgba(101, 255, 242, 0.25);
    --shadow: 0 0 32px rgba(101, 255, 242, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 79, 216, 0.18), transparent 36%),
        radial-gradient(circle at 20% 100%, rgba(101, 255, 242, 0.18), transparent 30%),
        linear-gradient(180deg, #09091c, #02020a 70%);
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -4;
    background-size: cover;
    background-position: center;
    opacity: 0.26;
    filter: saturate(1.3) contrast(1.1);
    transition: background-image 0.35s ease, opacity 0.35s ease;
}

.bg-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(101, 255, 242, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 79, 216, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(500px) rotateX(62deg) translateY(20vh) scale(1.8);
    transform-origin: bottom center;
    opacity: 0.7;
}

.scanlines,
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.scanlines {
    z-index: 20;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.035) 0px,
        rgba(255,255,255,0.035) 1px,
        transparent 2px,
        transparent 5px
    );
    mix-blend-mode: overlay;
}

.vignette {
    z-index: 19;
    box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.82);
}

.site-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.hero-panel,
.player-panel,
.dance-stage-wrap,
.library-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow), inset 0 0 36px rgba(255, 79, 216, 0.06);
    backdrop-filter: blur(10px);
}

.hero-panel {
    text-align: center;
    padding: 32px 22px;
    border-radius: 24px;
    margin-bottom: 18px;
}

.mini-label,
.tiny-title {
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
}

.hero-panel h1 {
    margin: 8px 0 8px;
    font-size: clamp(2rem, 6vw, 4.6rem);
    line-height: 0.95;
    color: var(--text);
    text-shadow:
        0 0 12px rgba(101, 255, 242, 0.75),
        0 0 32px rgba(255, 79, 216, 0.55);
}

.hero-panel p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.6;
}

.player-panel {
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.track-title {
    font-size: clamp(1.15rem, 3vw, 2rem);
    font-weight: 800;
    text-shadow: 0 0 14px rgba(255, 79, 216, 0.42);
}

.equalizer-icon {
    display: flex;
    align-items: end;
    gap: 4px;
    width: 48px;
    height: 48px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
}

.equalizer-icon span {
    width: 6px;
    height: 14px;
    background: var(--neon);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(101, 255, 242, 0.9);
    animation: idleBars 0.8s infinite alternate ease-in-out;
}

.equalizer-icon span:nth-child(2) { animation-delay: 0.1s; height: 22px; }
.equalizer-icon span:nth-child(3) { animation-delay: 0.2s; height: 34px; background: var(--neon-2); }
.equalizer-icon span:nth-child(4) { animation-delay: 0.3s; height: 20px; }
.equalizer-icon span:nth-child(5) { animation-delay: 0.4s; height: 28px; background: var(--neon-3); }

@keyframes idleBars {
    from { transform: scaleY(0.55); }
    to { transform: scaleY(1.15); }
}

.controls,
.stage-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button,
input[type="search"] {
    font: inherit;
}

button {
    border: 1px solid rgba(101, 255, 242, 0.4);
    background: linear-gradient(180deg, rgba(101, 255, 242, 0.12), rgba(255, 79, 216, 0.08));
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: inset 0 0 18px rgba(255,255,255,0.05), 0 0 16px rgba(101,255,242,0.09);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

button:hover,
button.active {
    transform: translateY(-1px);
    border-color: var(--neon);
    background: linear-gradient(180deg, rgba(101, 255, 242, 0.23), rgba(255, 79, 216, 0.16));
}

button.primary {
    border-color: rgba(255, 79, 216, 0.8);
    background: linear-gradient(180deg, rgba(255, 79, 216, 0.34), rgba(101, 255, 242, 0.16));
}

.radio-deck {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    position: relative;
}

.radio-now-card {
    border: 1px solid rgba(103, 255, 242, 0.13);
    border-radius: 10px;
    background: rgba(5, 7, 18, 0.42);
    padding: 9px 10px;
}

.radio-caption {
    color: rgba(255, 230, 107, 0.9);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.radio-subcaption {
    margin-top: 3px;
    color: rgba(247, 248, 255, 0.62);
    font-size: 0.72rem;
}

.radio-row {
    display: grid;
    gap: 7px;
    align-items: stretch;
}

.radio-row-transport {
    grid-template-columns: 0.78fr 1.28fr 0.78fr;
}

.radio-row-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radio-row button,
.radio-popover button {
    min-width: 0;
    min-height: 40px;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.radio-play-button {
    border-color: rgba(255, 79, 216, 0.78);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 230, 107, 0.20), transparent 58%),
        linear-gradient(180deg, rgba(255, 79, 216, 0.36), rgba(101, 255, 242, 0.15));
    box-shadow: inset 0 0 18px rgba(255,255,255,0.08), 0 0 22px rgba(255,79,216,0.18);
}

.radio-row button.active,
#moveModeBtn.active {
    color: #ffffff;
    border-color: rgba(103, 255, 242, 0.88);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 230, 107, 0.20), transparent 60%),
        linear-gradient(180deg, rgba(103, 255, 242, 0.30), rgba(255, 79, 216, 0.18));
    box-shadow: inset 0 0 18px rgba(255,255,255,0.08), 0 0 20px rgba(103,255,242,0.18);
}

.radio-popover {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid rgba(255, 230, 107, 0.22);
    border-radius: 12px;
    background: rgba(7, 9, 22, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), 0 0 22px rgba(255, 79, 216, 0.10);
    padding: 9px;
}

.radio-popover.open {
    display: grid;
}

.radio-popover-wide {
    grid-template-columns: 1fr;
}

.radio-popover-title {
    color: rgba(255, 230, 107, 0.9);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.radio-popover button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.volume-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 10px;
    color: var(--muted);
}

.volume-row input {
    width: min(340px, 100%);
}

#visualizer {
    display: block;
    width: 100%;
    height: 180px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.09);
    background:
        radial-gradient(circle at center, rgba(101, 255, 242, 0.10), transparent 48%),
        rgba(0,0,0,0.28);
}

.dance-stage-wrap {
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 18px;
}

.stage-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.dance-stage {
    position: relative;
    height: 270px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        radial-gradient(circle at 50% 100%, rgba(255, 79, 216, 0.2), transparent 42%),
        rgba(0, 0, 0, 0.32);
}

.dance-stage::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -90px;
    width: 80%;
    height: 170px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(101,255,242,0.23), transparent 68%);
    filter: blur(4px);
}

.dancing-head {
    position: absolute;
    width: var(--size, 92px);
    height: var(--size, 92px);
    left: var(--x, 50%);
    bottom: var(--base-y, 18px);
    transform: translate(-50%, 0) rotate(0deg) scale(1);
    transform-origin: 50% 85%;
    object-fit: contain;
    image-rendering: auto;
    filter:
        drop-shadow(0 0 12px rgba(101, 255, 242, 0.7))
        drop-shadow(0 10px 6px rgba(0, 0, 0, 0.45));
    user-select: none;
    pointer-events: none;
    will-change: transform, filter;
}

.dancing-head.big-center {
    z-index: 5;
}

.library-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 18px;
}

.library-card {
    border-radius: 22px;
    padding: 18px;
    min-width: 0;
}

.library-card h2 {
    margin: 0 0 12px;
    color: var(--neon-3);
    text-shadow: 0 0 12px rgba(255, 230, 107, 0.38);
}

.search-wrap {
    margin-bottom: 12px;
}

input[type="search"] {
    width: 100%;
    border: 1px solid rgba(101, 255, 242, 0.32);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    outline: none;
}

input[type="search"]:focus {
    border-color: var(--neon);
    box-shadow: 0 0 18px rgba(101, 255, 242, 0.15);
}

.track-list,
.background-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.track-item,
.bg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.045);
    cursor: pointer;
}

.track-item:hover,
.track-item.active,
.bg-item:hover,
.bg-item.active {
    border-color: rgba(101,255,242,0.55);
    background: rgba(101, 255, 242, 0.09);
}

.track-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-badge {
    flex: 0 0 auto;
    color: var(--neon);
    font-size: 0.8rem;
}

.empty-note {
    color: var(--muted);
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 14px;
    line-height: 1.5;
}

@media (max-width: 800px) {
    .site-shell {
        width: min(100% - 18px, 1120px);
        padding-top: 12px;
    }

    .hero-panel {
        padding: 24px 16px;
    }

    .stage-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dance-stage {
        height: 230px;
    }

    .dancing-head {
        width: calc(var(--size, 92px) * 0.82);
        height: calc(var(--size, 92px) * 0.82);
    }

    .library-grid {
        grid-template-columns: 1fr;
    }

    .radio-row-transport,
    .radio-row-main,
    .radio-popover {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .radio-row button,
    .radio-popover button {
        min-height: 38px;
        font-size: 0.68rem;
        padding: 7px 6px;
    }
}
