/* ============================================================
   ROOT VARIABLES
============================================================ */
:root {
    --bg-gradient: radial-gradient(circle at top, #ff00ff 0, #12002b 40%, #05010a 100%);
    --accent-pink: #ff4fd8;
    --accent-cyan: #00f6ff;
    --accent-yellow: #ffe66d;
    --card-bg: rgba(5, 1, 20, 0.9);
    --text-main: #fdfdfd;
    --text-muted: #b3a9ff;
    --neon-shadow: 0 0 14px rgba(0,246,255,0.7), 0 0 28px rgba(255,79,216,0.6);
}

/* ============================================================
   GLOBAL RESET
============================================================ */
* {
    box-sizing: border-box;
    font-family: "Montserrat", system-ui, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

/* ============================================================
   FRAME WRAPPER
============================================================ */
.frame {
    max-width: 960px;
    width: 100%;
    background: linear-gradient(145deg, rgba(10,0,40,0.95), rgba(5,0,20,0.98));
    border-radius: 18px;
    padding: 24px 24px 28px;
    border: 2px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

.frame::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 10% 0, rgba(255,79,216,0.25), transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(0,246,255,0.25), transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

.frame-inner {
    position: relative;
    z-index: 1;
}

/* ============================================================
   HEADER
============================================================ */
.header {
    text-align: center;
    margin-bottom: 18px;
}

.tagline {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--accent-yellow);
}

.event-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0,246,255,0.8);
}

.event-sub {
    font-size: 1rem;
    color: var(--accent-pink);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.event-meta {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.divider {
    margin: 18px auto 16px;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-pink), transparent);
}

/* ============================================================
   GRID LAYOUTS
============================================================ */
.content-grid,
.results-grid {
    display: grid;
    gap: 20px;
}

.content-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.results-grid {
    grid-template-columns: 1fr auto;
}

@media (max-width: 800px) {
    .content-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CARD COMPONENT
============================================================ */
.card,
.results-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px 18px 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 18px rgba(0,0,0,0.7);
    position: relative;
}

/* ============================================================
   SONG OPTIONS
============================================================ */
.song-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s ease, transform 0.1s ease;
    cursor: pointer;
}

.song-option:hover {
    background: rgba(255,255,255,0.04);
    transform: translateX(2px);
}

.song-option input[type="radio"] {
    accent-color: var(--accent-cyan);
    transform: scale(1.1);
}

/* ============================================================
   RESULTS TABLE
============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 0.9rem;
    table-layout: fixed;
}

th, td {
    padding: 6px 4px;
    text-align: left;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

/* Column widths */
.results-card th:nth-child(1),
.results-card td:nth-child(1) { width: 40px; text-align: center; }

.results-card th:nth-child(2),
.results-card td:nth-child(2) { width: 360px; padding-right: 10px; }

.results-card th:nth-child(3),
.results-card td:nth-child(3),
.results-card th:nth-child(4),
.results-card td:nth-child(4) {
    width: 60px;
    text-align: center;
}

.results-card th:nth-child(5),
.results-card td:nth-child(5) {
    width: auto;
    padding-left: 6px;
}

/* Level bar */
.bar {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
    box-shadow: var(--neon-shadow);
}

/* ============================================================
   #1 SONG HIGHLIGHT
============================================================ */
.top-song {
    background: rgba(255,230,109,0.12) !important;
    box-shadow: 0 0 14px rgba(255,230,109,0.6);
}

.top-song .song-name {
    position: relative;
    padding-left: 28px;
    color: var(--accent-yellow);
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255,230,109,0.8);
}

.top-song .song-name::before {
    content: "★ #1";
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-yellow);
    font-size: 0.85rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255,230,109,1);
}
/* ============================================================
   RUNNER-UP HIGHLIGHT (#2–4)
============================================================ */
.runner-up {
    background: rgba(0,246,255,0.06); /* soft cyan glow */
    box-shadow: 0 0 10px rgba(0,246,255,0.25);
}

.runner-up .song-name {
    color: var(--accent-cyan);
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0,246,255,0.6);
}

/* ============================================================
   SIDEBAR (FLYER + LOGOS)
============================================================ */
.flyer-wrapper {
    margin: 10px auto;
    text-align: center;
}

.flyer-img {
    width: 100%;
    max-width: 180px;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0,246,255,0.4);
    border: 1px solid rgba(255,255,255,0.15);
}

.stack-logo {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 16px auto 0;
    overflow: hidden;
    border-radius: 50%;
}

.stack-logo img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: stackFade 12s infinite, neonPulse 12s infinite;
    pointer-events: none;
}

.stack-logo img:nth-child(1) { animation-delay: 0s, 0s; }
.stack-logo img:nth-child(2) { animation-delay: 4s, 4s; }
.stack-logo img:nth-child(3) { animation-delay: 8s, 8s; }

@keyframes stackFade {
    0% { opacity: 0; }
    8% { opacity: 1; }
    25% { opacity: 1; }
    33% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes neonPulse {
    0% { box-shadow: 0 0 0px rgba(0, 246, 255, 0); }
    8% { box-shadow: var(--neon-shadow); }
    16% { box-shadow: 0 0 22px rgba(0,246,255,0.9), 0 0 40px rgba(255,79,216,0.8); }
    25% { box-shadow: var(--neon-shadow); }
    33% { box-shadow: 0 0 0px rgba(0, 246, 255, 0); }
    100% { box-shadow: 0 0 0px rgba(0, 246, 255, 0); }
}

/* ============================================================
   NAVIGATION — DESKTOP
============================================================ */
.top-nav {
    width: 100%;
    margin: 0 auto 20px;
    text-align: center;
}

.top-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 0;
    margin: 0;
}

.top-nav a {
    padding: 10px 18px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-decoration: none;
    background: rgba(5,1,20,0.7);
    border: 1px solid rgba(0,246,255,0.4);
    box-shadow: 0 0 10px rgba(0,246,255,0.4);
    transition: 0.2s ease;
}

.top-nav a:hover {
    color: var(--accent-pink);
    border-color: rgba(255,79,216,0.7);
    box-shadow: 0 0 16px rgba(255,79,216,0.8);
    transform: translateY(-2px);
}

.top-nav a.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    color: #05010a;
    box-shadow: 0 0 18px rgba(255,79,216,0.9);
}

/* ============================================================
   HAMBURGER MENU — NEON EDITION
============================================================ */
.hamburger {
    display: none;
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 8px;
    background: rgba(5,1,20,0.8);
    border: 1px solid rgba(0,246,255,0.4);
    box-shadow: 0 0 12px rgba(0,246,255,0.6);
    cursor: pointer;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 50%;
    width: 22px;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 3px;
    transform: translateX(-50%);
    transition: 0.3s ease;
}

.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 20px; }
.hamburger span:nth-child(3) { top: 28px; }

/* Active (X) state */
.hamburger.active span:nth-child(1) {
    top: 20px;
    transform: translateX(-50%) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    top: 20px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Mobile nav dropdown */
.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(5,1,20,0.7);
    border: 1px solid rgba(0,246,255,0.4);
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(0,246,255,0.4);
    transition: 0.2s ease;
}

.mobile-nav a:hover {
    color: var(--accent-pink);
    border-color: rgba(255,79,216,0.7);
    box-shadow: 0 0 16px rgba(255,79,216,0.8);
}

/* ============================================================
   MOBILE BEHAVIOR
============================================================ */
@media (max-width: 600px) {
    .top-nav ul {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-nav.show {
        display: flex;
    }
}
/* retro Winamp-style spectrum bar */
.cd-bar-wrapper {
    background: rgba(5, 1, 20, 0.95);
    border-radius: 0 0 12px 12px;
    padding: 6px 10px 10px;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.7);
}

#cd-bar-spectrum {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 22px;
}

.cd-segment {
    flex: 1;
    height: 22px;   /* ← THIS FIXES EVERYTHING */
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.cd-segment::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-pink));
    opacity: 0;
    transform: translateY(100%);
    transition: 0.18s ease-out;
}

.cd-segment.active::before {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    margin-top: 40px;
    padding: 20px 0 10px;
    text-align: center;
    color: var(--text-muted);
}

.footer-divider {
    width: 80%;
    height: 2px;
    margin: 0 auto 10px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-pink), transparent);
    box-shadow: 0 0 10px rgba(0,246,255,0.6);
}

.footer-bottom {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.brand-link {
    color: var(--accent-cyan);
    font-weight: 700;
    text-decoration: none;
}

.brand-link:hover {
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(255,79,216,0.8);
}

.neon-icon {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0,246,255,0.8);
}
.neon-cyan {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0,246,255,0.7);
}

.neon-pink {
    color: var(--accent-pink);
    text-shadow: 0 0 8px rgba(255,79,216,0.7);
}

.neon-yellow {
    color: var(--accent-yellow);
    text-shadow: 0 0 8px rgba(255,230,109,0.7);
}

.neon-muted {
    color: var(--text-muted);
}
/* ============================================================
   NEON TEXT OVERRIDES (higher specificity)
============================================================ */

.card .neon-cyan,
.results-card .neon-cyan,
.neon-cyan {
    color: var(--accent-cyan) !important;
    text-shadow: 0 0 8px rgba(0,246,255,0.7);
}

.card .neon-pink,
.results-card .neon-pink,
.neon-pink {
    color: var(--accent-pink) !important;
    text-shadow: 0 0 8px rgba(255,79,216,0.7);
}

.card .neon-yellow,
.results-card .neon-yellow,
.neon-yellow {
    color: var(--accent-yellow) !important;
    text-shadow: 0 0 8px rgba(255,230,109,0.7);
}

.card .neon-muted,
.results-card .neon-muted,
.neon-muted {
    color: var(--text-muted) !important;
}
