:root {
    color-scheme: dark;
    --black: #020304;
    --ink: #081014;
    --panel: rgba(7, 14, 18, 0.78);
    --panel-strong: rgba(11, 20, 25, 0.94);
    --white: #f7fbff;
    --muted: #a7b6bd;
    --cyan: #00eaff;
    --magenta: #ff2b9f;
    --acid: #c8ff2d;
    --amber: #ffbc31;
    --red: #ff3b3b;
    --line: rgba(255, 255, 255, 0.16);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    --field: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 43, 159, 0.24), transparent 28rem),
        radial-gradient(circle at 80% 10%, rgba(0, 234, 255, 0.22), transparent 30rem),
        radial-gradient(circle at 62% 92%, rgba(200, 255, 45, 0.14), transparent 26rem),
        linear-gradient(135deg, #020304 0%, #071117 52%, #030305 100%);
    color: var(--white);
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", Arial, sans-serif;
    letter-spacing: 0;
}

body[data-theme="light"] {
    color-scheme: light;
    --black: #f5f8fb;
    --ink: #f9fcff;
    --panel: rgba(255, 255, 255, 0.8);
    --panel-strong: rgba(245, 249, 252, 0.95);
    --white: #10161a;
    --muted: #53626b;
    --cyan: #007d8d;
    --magenta: #cc1673;
    --acid: #436f00;
    --amber: #a56700;
    --red: #c42f31;
    --line: rgba(7, 18, 24, 0.18);
    --shadow: 0 24px 70px rgba(24, 44, 55, 0.18);
    --field: rgba(0, 0, 0, 0.05);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 43, 159, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 10%, rgba(0, 234, 255, 0.18), transparent 30rem),
        radial-gradient(circle at 62% 92%, rgba(200, 255, 45, 0.18), transparent 26rem),
        linear-gradient(135deg, #f6fbff 0%, #dfeef3 52%, #fff7fb 100%);
}

button,
input,
label {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

#stage-canvas {
    position: fixed;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0.13;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 18px clamp(18px, 4vw, 54px);
    backdrop-filter: blur(18px);
    background: rgba(2, 3, 4, 0.76);
    border-bottom: 1px solid var(--line);
}

body[data-theme="light"] .topbar {
    background: rgba(248, 252, 255, 0.82);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 2px solid var(--cyan);
    background: var(--black);
    color: var(--acid);
    box-shadow: 0 0 22px rgba(0, 234, 255, 0.48);
}

.brand strong,
.brand small {
    display: block;
    line-height: 0.92;
}

.brand strong {
    font-size: clamp(1.35rem, 2.5vw, 2.1rem);
}

.brand small {
    color: var(--cyan);
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 28px);
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 0.83rem;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--white);
}

.theme-toggle {
    min-height: 42px;
    background: var(--field);
    border-color: var(--line);
    color: var(--white);
    white-space: nowrap;
}

.command-deck {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: clamp(18px, 3vw, 36px);
    width: min(1680px, calc(100% - 36px));
    min-height: calc(100vh - 96px);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 54px) 0 34px;
    align-items: stretch;
}

.video-bay,
.status-card,
.track-list-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)), var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.video-bay {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(18px, 3vw, 36px);
    overflow: hidden;
}

.video-bay::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-top: 5px solid var(--cyan);
    box-shadow: inset 0 0 90px rgba(0, 234, 255, 0.1);
}

.section-kicker {
    color: var(--acid);
    font-family: Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

h1 {
    max-width: 12ch;
    margin: 7px 0 8px;
    font-size: clamp(4.4rem, 11vw, 12rem);
    line-height: 0.78;
    text-transform: uppercase;
    text-shadow:
        0 0 18px rgba(0, 234, 255, 0.62),
        5px 5px 0 rgba(255, 43, 159, 0.74),
        -4px -2px 0 rgba(200, 255, 45, 0.42);
}

.intro {
    max-width: 760px;
    margin: 0 0 clamp(18px, 3vw, 32px);
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 700;
    line-height: 1.45;
}

.video-shell {
    width: 100%;             /* Or any width you prefer, e.g., 800px */
    aspect-ratio: 16 / 9;    /* Forces the 16:9 shape */
    position: relative;      /* Keeps your .video-glow aligned correctly */
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* Prevents black bars by cropping slightly, or use 'contain' to show full video with bars */
}

}

.video-picker-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    font-family: Arial, sans-serif;
    font-weight: 900;
    text-transform: uppercase;
}

.video-picker-row label {
    color: var(--acid);
    font-size: 0.78rem;
}

select {
    min-width: 0;
    min-height: 46px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--white);
    padding: 0 14px;
    font: inherit;
    text-transform: uppercase;
}

select:focus,
button:focus-visible,
.upload-button:focus-visible,
.range:focus-visible {
    outline: 3px solid rgba(0, 234, 255, 0.45);
    outline-offset: 3px;
}

.video-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(transparent 50%, rgba(255, 255, 255, 0.05) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.08), rgba(0, 255, 255, 0.05));
    background-size: 100% 5px, 100% 100%;
    mix-blend-mode: screen;
}

.video-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

button,
.upload-button {
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0 18px;
    color: var(--white);
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover,
.upload-button:hover {
    transform: translateY(-2px);
    border-color: var(--white);
}

.primary-action {
    background: linear-gradient(90deg, var(--magenta), var(--red));
    box-shadow: 0 0 25px rgba(255, 43, 159, 0.35);
}

.ghost-action,
.audio-actions button,
.audio-tools button,
.upload-button {
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
}

#video-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.control-bay {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
}

.status-card,
.track-list-card {
    padding: 18px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.card-head b {
    color: var(--acid);
}

.hero-card img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.meter-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
    margin-top: 14px;
}

.meter-grid span {
    height: 34px;
    background: linear-gradient(to top, var(--cyan), var(--acid), var(--amber));
    transform-origin: bottom;
    animation: meter 900ms ease-in-out infinite alternate;
}

.meter-grid span:nth-child(3n) {
    animation-duration: 640ms;
}

.meter-grid span:nth-child(4n) {
    animation-duration: 1180ms;
}

@keyframes meter {
    from { transform: scaleY(0.2); opacity: 0.45; }
    to { transform: scaleY(1); opacity: 1; }
}

.now-playing {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.now-playing img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border: 1px solid rgba(0, 234, 255, 0.55);
}

.now-playing p {
    margin: 0 0 5px;
    color: var(--cyan);
    font-family: Arial, sans-serif;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.now-playing h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 0.98;
}

.audio-actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.audio-visualizer {
    display: block;
    width: 100%;
    height: 150px;
    margin-top: 16px;
    border: 1px solid rgba(0, 234, 255, 0.38);
    background:
        linear-gradient(180deg, rgba(0, 234, 255, 0.14), transparent),
        rgba(0, 0, 0, 0.38);
    box-shadow: inset 0 0 32px rgba(0, 234, 255, 0.14);
}

.audio-actions button {
    padding: 0 10px;
}

.audio-actions #play-track {
    background: var(--cyan);
    color: #001114;
}

.volume-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 54px;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 900;
}

.volume-row button {
    min-height: 40px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
}

.volume-row button[aria-pressed="true"] {
    background: var(--amber);
    color: #160d00;
}

.volume-row .range {
    margin-top: 0;
}

.volume-row span {
    text-align: right;
}

.range {
    width: 100%;
    margin-top: 16px;
    accent-color: var(--magenta);
}

.time-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
}

.audio-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.audio-tools button {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.audio-tools button[aria-pressed="true"] {
    background: var(--acid);
    color: var(--black);
}

.track-list-card {
    min-height: 360px;
    overflow: hidden;
}

.track-list {
    display: grid;
    gap: 8px;
    max-height: min(56vh, 620px);
    overflow: auto;
    padding-right: 4px;
}

.track-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
}

.track-item:hover,
.track-item.active {
    border-color: var(--cyan);
    background: rgba(0, 234, 255, 0.12);
}

.track-item.locked {
    border-color: rgba(255, 188, 49, 0.34);
}

.track-item.unlocked {
    border-color: rgba(0, 234, 255, 0.18);
}

.track-item.unlocked .track-meta {
    color: var(--cyan);
}

.track-duration {
    display: block;
    margin-top: 3px;
    color: var(--amber);
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.track-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.track-lock,
.track-download {
    display: inline-grid;
    min-width: 82px;
    min-height: 28px;
    place-items: center;
    border: 1px solid rgba(255, 188, 49, 0.45);
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 950;
    padding: 0 8px;
}

.track-lock {
    color: var(--amber);
    background: rgba(255, 188, 49, 0.08);
}

.track-download {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.track-number {
    color: var(--magenta);
}

.track-name {
    display: block;
    overflow-wrap: anywhere;
    font-family: Arial, sans-serif;
    font-size: 0.83rem;
    font-weight: 900;
    line-height: 1.24;
    text-transform: uppercase;
}

.track-meta {
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
}

.marquee {
    width: 100%;
    overflow: hidden;
    border-block: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--acid);
    font-family: Arial, sans-serif;
    font-weight: 950;
    text-transform: uppercase;
}

.marquee div {
    display: flex;
    width: max-content;
    gap: 36px;
    padding: 14px 0;
    animation: ticker 22s linear infinite;
}

.marquee span {
    white-space: nowrap;
}

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(14px);
}

.login-overlay[hidden] {
    display: none;
}

.login-popout {
    position: relative;
    width: min(460px, 100%);
    border: 1px solid rgba(0, 234, 255, 0.55);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
        var(--panel-strong);
    box-shadow:
        0 0 0 8px rgba(0, 0, 0, 0.32),
        0 32px 120px rgba(0, 234, 255, 0.25);
    padding: clamp(22px, 4vw, 34px);
    animation: popout 220ms ease-out both;
}

.login-popout h2 {
    margin: 6px 0 8px;
    font-size: clamp(2.4rem, 8vw, 4.4rem);
    line-height: 0.85;
    text-transform: uppercase;
}

.login-popout p {
    margin: 0 0 18px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-weight: 800;
    line-height: 1.4;
}

.login-popout form {
    display: grid;
    gap: 10px;
}

.login-popout label {
    color: var(--acid);
    font-family: Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.login-popout input {
    min-height: 46px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--white);
    padding: 0 14px;
    font: inherit;
}

.login-popout input:focus {
    outline: 3px solid rgba(0, 234, 255, 0.45);
    outline-offset: 3px;
}

.login-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    min-height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
}

.login-error {
    min-height: 20px;
    color: var(--red) !important;
    font-size: 0.82rem;
}

.download-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 52;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(14px);
}

.download-confirm-overlay[hidden] {
    display: none;
}

.download-confirm {
    width: min(520px, 100%);
    border: 1px solid rgba(200, 255, 45, 0.58);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
        var(--panel-strong);
    box-shadow:
        0 0 0 8px rgba(0, 0, 0, 0.32),
        0 30px 110px rgba(200, 255, 45, 0.2);
    padding: clamp(22px, 4vw, 34px);
}

.download-confirm h2 {
    margin: 6px 0 10px;
    font-size: clamp(2.4rem, 8vw, 4.4rem);
    line-height: 0.85;
    text-transform: uppercase;
}

.download-confirm p {
    margin: 0 0 18px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-weight: 800;
    line-height: 1.4;
}

.download-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.unauthorized-page {
    display: grid;
    min-height: calc(100vh - 84px);
    place-items: center;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(28px, 6vw, 72px) 0;
}

.unauthorized-panel {
    width: min(860px, 100%);
    border: 1px solid rgba(255, 59, 59, 0.6);
    background:
        linear-gradient(145deg, rgba(255, 59, 59, 0.16), rgba(255, 255, 255, 0.04)),
        var(--panel-strong);
    box-shadow: var(--shadow);
    padding: clamp(24px, 5vw, 52px);
}

.unauthorized-panel h1 {
    max-width: none;
    margin: 8px 0 12px;
    font-size: clamp(3rem, 10vw, 8rem);
}

.unauthorized-panel h2 {
    margin: 0 0 14px;
    color: var(--red);
    font-size: clamp(1.8rem, 5vw, 4rem);
    line-height: 0.92;
    text-transform: uppercase;
}

.unauthorized-panel p {
    margin: 6px 0;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 900;
}

.safety-link {
    display: inline-grid;
    min-height: 46px;
    place-items: center;
    margin-top: 22px;
    border: 1px solid rgba(0, 234, 255, 0.5);
    background: rgba(0, 234, 255, 0.1);
    color: var(--white);
    padding: 0 18px;
    font-family: Arial, sans-serif;
    font-weight: 950;
    text-transform: uppercase;
}

@keyframes popout {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ticker {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100%); }
}

@media (max-width: 1020px) {
    .command-deck {
        grid-template-columns: 1fr;
    }

    .control-bay {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto;
    }

    .track-list-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .theme-toggle {
        width: 100%;
    }

    .command-deck {
        width: min(100% - 24px, 1680px);
        padding-top: 18px;
    }

    h1 {
        font-size: clamp(3.5rem, 22vw, 6rem);
    }

    .video-shell {
        min-height: 260px;
    }

    .video-picker-row {
        grid-template-columns: 1fr;
    }

    .control-bay {
        grid-template-columns: 1fr;
    }
}
