/* ==========================================================================
   MUSIC PAGE STYLES. Loads after style.css, so it reuses your dark theme.
   Everything here starts with .mx- so it cannot clash with the home page.
   ========================================================================== */

.mx-wrap { padding-bottom: 70px; }
.mx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero ---------- */
.mx-hero { padding: clamp(40px, 6vw, 70px) 0 clamp(26px, 4vw, 40px); }
.mx-hero h1 {
    font-size: clamp(36px, 5.2vw, 64px);
    line-height: 1.08;
    letter-spacing: -2.6px;
    font-weight: 500;
    margin: 18px 0;
}
.mx-lede { max-width: 560px; color: #a4a9b8; font-size: 16px; line-height: 1.7; margin: 0; }

/* React Bits style: SplitText */
.mx-word { display: inline-block; white-space: nowrap; }
.mx-split span { display: inline-block; }
.mx-split .mx-word > span {
    opacity: 0;
    transform: translateY(.7em) rotate(7deg);
    animation: mxSplit .65s cubic-bezier(.2, .9, .3, 1.25) forwards;
    animation-delay: calc(var(--i) * 38ms + 150ms);
}
@keyframes mxSplit { to { opacity: 1; transform: none; } }

/* React Bits style: ShinyText */
.mx-shiny {
    background: linear-gradient(110deg, #8cecff 38%, #ffffff 50%, #8cecff 62%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: mxShine 3.2s linear infinite;
}
@keyframes mxShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---------- layout ---------- */
.mx-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mx-side { display: grid; gap: 20px; min-width: 0; }
.mx-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 22px;
    background: rgba(255, 255, 255, .055);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 48px rgba(0, 0, 0, .22);
}
.mx-deck { display: grid; gap: 16px; }
@media (max-width: 900px) { .mx-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- LED marquee (old school ticker) ---------- */
.mx-led {
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 170, 60, .35);
    background: radial-gradient(rgba(255, 160, 40, .18) 1px, transparent 1.5px) 0 0 / 4px 4px, #0b0603;
    font: 700 14px/1 'Courier New', monospace;
    letter-spacing: 3px;
    color: #ffb347;
    text-shadow: 0 0 6px rgba(255, 150, 30, .9);
}
.mx-led span { display: inline-block; padding-left: 100%; animation: mxLed 22s linear infinite; }
@keyframes mxLed { to { transform: translateX(-100%); } }

/* ---------- CRT television ---------- */
.mx-crt {
    padding: 14px 14px 10px;
    border-radius: 26px;
    background: linear-gradient(160deg, #2a2d38, #12141b);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .08), 0 20px 50px rgba(0, 0, 0, .5);
}
.mx-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 18px / 22px;
    background: #000;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, .9), 0 0 0 4px #07080c, 0 0 28px rgba(0, 190, 255, .18);
}
.mx-yt { position: absolute; inset: 0; }
.mx-yt iframe { display: block; width: 100%; height: 100%; border: 0; }
.mx-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }

/* scanlines + vignette + a slow rolling light band */
.mx-scan {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .6) 100%);
}
.mx-scan::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 22%;
    background: linear-gradient(to bottom, transparent, rgba(140, 236, 255, .08), transparent);
    animation: mxRoll 5.5s linear infinite;
}
@keyframes mxRoll { from { transform: translateY(-110%); } to { transform: translateY(480%); } }

/* TV static flash every time the channel changes */
.mx-static {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background-color: #888;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: mxStatic .6s steps(6) 1;
}
@keyframes mxStatic {
    0%   { opacity: 1; background-position: 0 0; }
    25%  { opacity: .9; background-position: -40px 30px; }
    50%  { opacity: .65; background-position: 30px -50px; }
    75%  { opacity: .35; background-position: -20px 60px; }
    100% { opacity: 0; background-position: 50px 10px; }
}

/* VCR style on-screen text */
.mx-osd {
    position: absolute;
    left: 14px; right: 14px; top: 10px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    font: 700 clamp(11px, 1.9vw, 15px)/1 'Courier New', monospace;
    letter-spacing: 2px;
    color: #7cff8a;
    text-shadow: 0 0 6px rgba(124, 255, 138, .9), 2px 0 0 rgba(255, 0, 80, .35), -2px 0 0 rgba(0, 200, 255, .35);
}
.mx-osd .blink { animation: mxBlink 1s steps(2) infinite; }
@keyframes mxBlink { 50% { opacity: 0; } }
.mx-boot {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    background: #000;
    color: #7cff8a;
    font: 700 13px 'Courier New', monospace;
    letter-spacing: 3px;
    animation: mxBlink 1.1s steps(2) infinite;
}

.mx-crt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 2px; }
.mx-power { width: 9px; height: 9px; border-radius: 50%; background: #5a1f1f; box-shadow: 0 0 0 2px #0b0c10; transition: background .3s, box-shadow .3s; }
.mx-power.on { background: #6dff8c; box-shadow: 0 0 0 2px #0b0c10, 0 0 12px #6dff8c; }
.mx-brandplate { font: 9px 'Courier New', monospace; letter-spacing: 3px; color: #7c8296; }
.mx-knobs { display: flex; gap: 8px; }
.mx-knobs i {
    width: 18px; height: 18px; border-radius: 50%;
    background: conic-gradient(#5a5f72, #20232d, #5a5f72, #20232d, #5a5f72);
    box-shadow: 0 2px 0 #08090d, inset 0 0 0 2px #1a1d26;
}
.mx-knobs i:nth-child(2) { transform: rotate(40deg); }

/* ---------- arcade buttons and controls ---------- */
.mx-controls { display: grid; gap: 14px; }
.mx-btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.mx-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 48px;
    height: 44px;
    padding: 0 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: linear-gradient(#3a3f52, #232634);
    color: #f5f7ff;
    font: 700 11px 'Courier New', monospace;
    letter-spacing: 1.5px;
    box-shadow: 0 5px 0 #0d0f16, 0 10px 18px rgba(0, 0, 0, .4);
    transition: transform .08s, box-shadow .08s, background .2s, border-color .2s;
}
.mx-btn:hover { background: linear-gradient(#46506b, #2a2f42); border-color: rgba(140, 236, 255, .6); }
.mx-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0d0f16, 0 3px 8px rgba(0, 0, 0, .4); }
.mx-btn.main { background: linear-gradient(#27d2ff, #0a86c0); color: #001018; border-color: rgba(190, 245, 255, .7); }
.mx-btn.main:hover { background: linear-gradient(#5fe0ff, #0f96d4); }
.mx-dot { width: 8px; height: 8px; border-radius: 50%; background: #444a5e; transition: background .2s, box-shadow .2s; }
.mx-btn[aria-pressed="true"] { border-color: rgba(140, 236, 255, .8); }
.mx-btn[aria-pressed="true"] .mx-dot { background: #6dff8c; box-shadow: 0 0 10px #6dff8c; }

.mx-seekrow, .mx-volrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.mx-time { min-width: 38px; font: 11px 'Courier New', monospace; color: #a4a9b8; text-align: center; }
.mx-mini {
    appearance: none;
    min-width: 52px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .06);
    font: 700 10px 'Courier New', monospace;
    letter-spacing: 1.5px;
}
.mx-mini[aria-pressed="true"] { border-color: rgba(255, 120, 120, .7); color: #ff9c9c; }

/* range sliders with a chunky square thumb */
.mx-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    margin: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, #8cecff var(--p, 0%), rgba(255, 255, 255, .14) var(--p, 0%));
    cursor: pointer;
}
.mx-range:disabled { opacity: .45; cursor: default; }
.mx-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 22px;
    border-radius: 3px;
    background: linear-gradient(#f5f7ff, #aeb6cc);
    border: 1px solid #0b0c10;
    box-shadow: 0 2px 0 #0b0c10;
}
.mx-range::-moz-range-thumb {
    width: 14px; height: 22px;
    border-radius: 3px;
    background: linear-gradient(#f5f7ff, #aeb6cc);
    border: 1px solid #0b0c10;
}

/* ---------- 8-bit equalizer ---------- */
.mx-eq { display: flex; align-items: flex-end; gap: 4px; height: 74px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .1); }
.mx-eq i {
    flex: 1;
    height: 8%;
    min-width: 0;
    color: hsl(calc(175 + var(--n) * 4) 100% 66%);
    background: repeating-linear-gradient(to top, currentColor 0 5px, transparent 5px 7px);
    box-shadow: 0 0 10px currentColor;
}
.mx-eq.on i { animation: mxEq var(--d) steps(9) infinite alternate; animation-delay: var(--dl); }
@keyframes mxEq { from { height: 8%; } to { height: 100%; } }

/* ---------- vinyl record ---------- */
.mx-vinyl-card { display: flex; align-items: center; gap: 22px; }
.mx-turntable { position: relative; flex: 0 0 auto; width: 190px; height: 170px; }
.mx-record {
    position: relative;
    width: 160px; height: 160px;
    border-radius: 50%;
    background:
        conic-gradient(from 20deg, transparent 0 18%, rgba(255, 255, 255, .13) 25%, transparent 32% 68%, rgba(255, 255, 255, .1) 75%, transparent 82%),
        repeating-radial-gradient(circle at center, #08080b 0 2px, #1a1a21 2px 3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 4px #0c0c10;
}
.mx-record.spin { animation: mxSpin 2.8s linear infinite; }
@keyframes mxSpin { to { transform: rotate(360deg); } }
.mx-label {
    position: absolute;
    left: 50%; top: 50%;
    width: 58px; height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #d4ff63;
    background: #222;
}
.mx-spindle { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #0a0a0e; box-shadow: 0 0 0 1px #555; }
.mx-arm {
    position: absolute;
    top: 4px; right: 12px;
    width: 8px; height: 118px;
    border-radius: 6px;
    background: linear-gradient(90deg, #dfe5f3, #7b8499);
    transform-origin: 50% 7px;
    transform: rotate(-26deg);
    transition: transform .8s cubic-bezier(.3, 1.25, .5, 1);
}
.mx-arm::before { content: ""; position: absolute; left: -8px; top: -6px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(#e8edf8, #6c7388); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.mx-arm::after { content: ""; position: absolute; left: -3px; bottom: -8px; width: 14px; height: 16px; border-radius: 3px; background: #1d2029; border: 1px solid #8a92a8; }
.mx-arm.on { transform: rotate(14deg); }

.mx-np { min-width: 0; }
.mx-np h2 { font-size: clamp(20px, 3vw, 26px); letter-spacing: -.8px; margin: 8px 0 4px; overflow-wrap: anywhere; line-height: 1.2; }
.mx-np p { margin: 0; color: #a4a9b8; font-size: 13px; overflow-wrap: anywhere; }
.mx-np .eyebrow { color: #8cecff; }

/* ---------- tracklist ---------- */
.mx-h2 { font-size: 26px; margin: 0 0 14px; }
.mx-add { display: flex; gap: 10px; align-items: center; }
.mx-add input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; font-size: 13px; }
.mx-add .mx-btn { flex: 0 0 auto; white-space: nowrap; }
.mx-msg { min-height: 18px; margin: 8px 2px 4px; font-size: 12px; color: #ffb37a; line-height: 1.5; }
.mx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.mx-chip {
    appearance: none;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .05);
    font: 11px 'Courier New', monospace;
    letter-spacing: .5px;
    transition: transform .15s, background .2s, border-color .2s;
}
.mx-chip:hover { transform: translateY(-2px); border-color: rgba(140, 236, 255, .6); }
.mx-chip[aria-pressed="true"] { background: rgba(0, 190, 255, .22); border-color: rgba(140, 236, 255, .8); color: #fff; }
.mx-search { width: 100%; height: 40px; padding: 0 14px; margin-bottom: 12px; border-radius: 12px; font-size: 13px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .16); }

.mx-list { display: grid; gap: 8px; max-height: 430px; overflow: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(140, 236, 255, .4) transparent; }
.mx-empty { margin: 8px 2px; color: #a4a9b8; font-size: 13px; }
.mx-row { position: relative; }

/* React Bits style: SpotlightCard glow follows the mouse */
.mx-track {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px 9px 9px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    text-align: left;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.mx-row:has(.mx-del) .mx-track { padding-right: 44px; }
.mx-track::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 190, 255, .24), transparent 65%);
}
.mx-track:hover::before { opacity: 1; }
.mx-track:hover { transform: translateX(4px); border-color: rgba(140, 236, 255, .5); }
.mx-track:active { transform: translateX(4px) scale(.985); }
.mx-track.on { border-color: rgba(140, 236, 255, .85); background: rgba(0, 190, 255, .12); }
.mx-track img { flex: 0 0 48px; width: 48px; height: 36px; object-fit: cover; border-radius: 6px; background: #111; }
.mx-track-text { display: grid; min-width: 0; flex: 1; position: relative; }
.mx-track-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-track-text small { font-size: 11px; color: #a4a9b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-tag { position: relative; font: 9px 'Courier New', monospace; letter-spacing: 1px; color: #8cecff; text-transform: uppercase; }
.mx-now { position: relative; margin-right: 4px; }
.mx-del {
    appearance: none;
    position: absolute;
    right: 8px; top: 50%;
    width: 28px; height: 28px;
    margin-top: -14px;
    z-index: 2;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .35);
    font-size: 16px;
    line-height: 1;
}
.mx-del:hover { border-color: rgba(255, 120, 120, .8); color: #ff9c9c; }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
    .mx-panel { padding: 14px; border-radius: 18px; }
    .mx-vinyl-card { flex-direction: column; align-items: flex-start; }
    .mx-add { flex-direction: column; align-items: stretch; }
    .mx-btnrow .mx-btn { flex: 1 1 calc(50% - 10px); }
    .mx-eq { gap: 2px; }
}

/* ---------- respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .mx-split .mx-word > span { animation: none; opacity: 1; transform: none; }
    .mx-shiny, .mx-led span, .mx-scan::after, .mx-static, .mx-record.spin, .mx-osd .blink, .mx-boot { animation: none; }
    .mx-eq.on i { animation: none; height: 45%; }
    .mx-arm, .mx-track, .mx-btn, .mx-chip { transition: none; }
}

/* Music-only synthwave backdrop: teal + violet, independent of the home aurora */
body:has(#music-app) { position:relative; isolation:isolate; background:#070812; }
body:has(#music-app) #music-app, body:has(#music-app) footer { position:relative; z-index:2; }
body:has(#music-app) { overflow-x:hidden; }
body:has(#music-app) header { z-index:20; top:0 !important; margin-top:0 !important; }
body:has(#music-app) #react-bits-bg { display:none!important; }
.mx-wrap { position:relative; isolation:isolate; }
.mx-scene { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none; background:#070812; }
.mx-scene-canvas { display:block; width:100%; height:100%; opacity:.97; }
.mx-scene::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(7,8,18,.12),rgba(7,8,18,.32) 48%,rgba(7,8,18,.76)),radial-gradient(ellipse at 50% 30%,transparent 8%,rgba(5,6,15,.42) 80%); }
.mx-hero,.mx-grid { position:relative; z-index:1; }
.mx-panel { background:rgba(10,12,27,.69); border-color:rgba(115,230,225,.18); box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 18px 48px rgba(0,0,0,.32),0 0 28px rgba(71,45,151,.09); }
.mx-led { border-color:rgba(94,247,233,.28); background:radial-gradient(rgba(54,226,215,.15) 1px,transparent 1.5px) 0 0/4px 4px,#080a18; color:#73f7e9; text-shadow:0 0 8px rgba(65,239,222,.72); }
.mx-btn.main { background:linear-gradient(135deg,#72f6e7,#5a9eff 55%,#a67aff); border-color:rgba(195,255,251,.62); color:#070916; }
.mx-btn.main:hover { background:linear-gradient(135deg,#a0fff4,#79b8ff 55%,#c49aff); }
.mx-range { background:linear-gradient(90deg,#55e9d9 var(--p,0%),#9d76ff var(--p,0%),rgba(255,255,255,.12) var(--p,0%)); }
.mx-range::-webkit-slider-thumb { background:linear-gradient(#f4fffe,#80e8df); }
.mx-range::-moz-range-thumb { background:linear-gradient(#f4fffe,#80e8df); }
.mx-chip[aria-pressed="true"] { background:rgba(91,232,218,.15); border-color:rgba(111,247,232,.68); }
.mx-track::before { background:radial-gradient(220px circle at var(--mx,50%) var(--my,50%),rgba(78,226,215,.17),rgba(133,90,255,.12) 38%,transparent 68%); }
.mx-track:hover { border-color:rgba(113,239,226,.43); }
.mx-track.on { border-color:rgba(105,242,229,.65); background:rgba(75,210,201,.09); }
.mx-tag,.mx-np .eyebrow { color:#7af4e7; }
.mx-eq { background:rgba(4,7,18,.64); border-color:rgba(106,232,224,.15); }
.mx-eq i { color:hsl(calc(174 + var(--n)*3.4) 95% 67%); }
.mx-record { background:conic-gradient(from 20deg,transparent 0 18%,rgba(121,95,255,.18) 25%,transparent 32% 68%,rgba(78,237,222,.12) 75%,transparent 82%),repeating-radial-gradient(circle at center,#070811 0 2px,#19182a 2px 3px); box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 4px #0b0c16,0 0 24px rgba(105,73,218,.18); }
.mx-label { border-color:#70f2e5; }

/* ==========================================================================
   3D night drive + DJ deck
   ========================================================================== */
.mx-scene { background: linear-gradient(#12062e, #ff7a59 44%, #10052a 44%); }
.mx-scene::after { background: linear-gradient(180deg, rgba(7,8,18,0), rgba(7,8,18,.16) 45%, rgba(7,8,18,.6)); }
.mx-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: #fff; opacity: 0; mix-blend-mode: screen; }
.mx-flash.on { animation: mxStrobe .14s steps(1) 9; }
@keyframes mxStrobe { 0% { opacity: .7; } 50% { opacity: 0; } }

.mx-dj { display: grid; gap: 16px; --beat: 0; }
.mx-dj-top { display: flex; align-items: center; gap: 22px; }
.mx-dj .mx-turntable { flex: 0 0 auto; width: 232px; height: 214px; perspective: 620px; }
.mx-plinth {
    position: absolute; inset: 0;
    transform: rotateX(30deg);
    transform-style: preserve-3d;
    border-radius: 18px;
    background: linear-gradient(145deg, #2b2d45, #12131f);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 26px 34px rgba(0, 0, 0, .55), 0 0 calc(10px + var(--beat) * 34px) rgba(94, 247, 233, calc(.1 + var(--beat) * .3));
}
.mx-platter-hit { position: absolute; left: 28px; top: 19px; width: 176px; height: 176px; border-radius: 50%; transform: translateZ(14px); cursor: grab; touch-action: none; user-select: none; }
.mx-platter-hit:active { cursor: grabbing; }
.mx-dj .mx-record { width: 100%; height: 100%; will-change: transform; }
.mx-dj .mx-label { pointer-events: none; }
.mx-dj .mx-arm { transform: translateZ(30px) rotate(-26deg); }
.mx-dj .mx-arm.on { transform: translateZ(30px) rotate(14deg); }

.mx-bpm { margin-top: 10px; font: 11px 'Courier New', monospace; letter-spacing: 2px; color: #a4a9b8; }
.mx-bpm b { margin-right: 8px; font-size: 28px; letter-spacing: 0; color: #7af4e7; text-shadow: 0 0 calc(4px + var(--beat) * 16px) #5ef7e9; }

.mx-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mx-pad {
    appearance: none; height: 46px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: linear-gradient(#2d2a4d, #17142b);
    color: #f5f7ff; font: 700 11px 'Courier New', monospace; letter-spacing: 1.5px;
    box-shadow: 0 5px 0 #0a0818, inset 0 -3px 0 var(--c, #5ef7e9);
    transition: transform .08s, box-shadow .08s;
}
.mx-pad:nth-child(1) { --c: #ff4fa3; } .mx-pad:nth-child(2) { --c: #ffe45e; }
.mx-pad:nth-child(3) { --c: #5ef7e9; } .mx-pad:nth-child(4) { --c: #9d76ff; }
.mx-pad:active { transform: translateY(4px); box-shadow: 0 1px 0 #0a0818, inset 0 -3px 0 var(--c), 0 0 18px var(--c); }
.mx-dj-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.mx-hint { margin: 0; font-size: 11px; line-height: 1.5; color: #8a90a6; }

@media (max-width: 600px) { .mx-dj-top { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .mx-flash.on { animation: none; } .mx-pad { transition: none; } }

/* ==========================================================================
   STAGE MODE: once a song starts, the cards slide to the two sides, the
   effect buttons flank the road, and the car gets the middle of the screen.
   ========================================================================== */
.mx-fx { display: none; }
.mx-hero { max-height: 420px; transition: max-height .7s cubic-bezier(.2, .8, .2, 1), opacity .45s, padding .7s; }
.is-stage { --dx: 26vw; }
.is-stage .mx-hero { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; pointer-events: none; }
.is-stage .mx-grid {
    grid-template-columns: minmax(0, 1.1fr) 96px minmax(120px, .6fr) 96px minmax(0, 1.1fr);
    width: calc(100vw - 40px);
    margin-inline: calc(50% - 50vw + 20px);
}
.is-stage .mx-deck { grid-column: 1; animation: mxToLeft .95s cubic-bezier(.2, .9, .25, 1.06) both; }
.is-stage .mx-side { grid-column: 5; animation: mxToRight .95s cubic-bezier(.2, .9, .25, 1.06) both; }
.is-stage .mx-fx { display: flex; flex-direction: column; align-items: center; gap: 22px; position: sticky; top: 34vh; align-self: start; margin-top: 18vh; }
.is-stage .mx-fx.left { grid-column: 2; }
.is-stage .mx-fx.right { grid-column: 4; }
@keyframes mxToLeft  { from { opacity: .2; filter: blur(12px); transform: translateX(var(--dx)) scale(.92); } to { opacity: 1; filter: none; transform: none; } }
@keyframes mxToRight { from { opacity: .2; filter: blur(12px); transform: translateX(calc(var(--dx) * -1)) scale(.92); } to { opacity: 1; filter: none; transform: none; } }

/* round effect buttons with a spinning border (React Bits StarBorder idea) */
.mx-fxbtn {
    appearance: none; position: relative;
    width: 88px; height: 88px; padding: 0;
    border: 0; border-radius: 50%;
    background: none; color: #fff;
    cursor: pointer; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), filter .2s;
    animation: mxPopIn .75s cubic-bezier(.3, 1.6, .5, 1) both;
    animation-delay: calc(.4s + var(--i) * .12s);
}
.mx-fxring { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; box-shadow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
.mx-fxring::before { content: ""; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent 0 55%, var(--c) 100%); animation: mxRing 2.6s linear infinite; }
.mx-fxring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a2552, #0e0b22); }
.mx-fxin { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; height: 100%; font: 700 10px 'Courier New', monospace; letter-spacing: 1.5px; }
.mx-fxin b { font-size: 24px; line-height: 1; margin-bottom: 4px; color: var(--c); text-shadow: 0 0 12px var(--c); }
.mx-fxbtn:hover { transform: scale(1.1) rotate(-4deg); }
.mx-fxbtn:active { transform: scale(.9); }
.mx-fxbtn.hot .mx-fxring { box-shadow: 0 0 46px var(--c); }
.mx-fxbtn.hot .mx-fxin b { transform: scale(1.35); transition: transform .15s; }
@keyframes mxRing { to { transform: rotate(360deg); } }
@keyframes mxPopIn { from { opacity: 0; transform: scale(.2) rotate(-90deg); } to { opacity: 1; transform: none; } }

/* ClickSpark */
.mx-spark { position: absolute; left: 50%; top: 50%; width: 4px; height: 14px; margin: -7px 0 0 -2px; border-radius: 3px; background: var(--c); pointer-events: none; animation: mxSpark .55s ease-out forwards; }
@keyframes mxSpark {
    from { opacity: 1; transform: rotate(var(--a)) translateY(-46px) scaleY(.4); }
    to   { opacity: 0; transform: rotate(var(--a)) translateY(-84px) scaleY(1); }
}

/* narrow screens: the car gets the top of the screen, effects sit in a row under it */
@media (max-width: 1100px) {
    .is-stage { --dx: 0vw; }
    .is-stage .mx-grid { grid-template-columns: minmax(0, 1fr); width: auto; margin-inline: 0; padding-top: 30vh; }
    .is-stage .mx-deck, .is-stage .mx-side, .is-stage .mx-fx.left, .is-stage .mx-fx.right { grid-column: 1; }
    .is-stage .mx-fx { flex-direction: row; justify-content: center; position: static; margin-top: 0; }
    .is-stage .mx-fx.left { order: 1; margin-bottom: -6px; }
    .is-stage .mx-fx.right { order: 2; }
    .is-stage .mx-deck { order: 3; } .is-stage .mx-side { order: 4; }
    .mx-fxbtn { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
    .is-stage .mx-deck, .is-stage .mx-side, .mx-fxbtn, .mx-fxring::before, .mx-spark { animation: none; }
    .mx-hero { transition: none; }
}

/* ==========================================================================
   PHONES: compact header, car in the upper half, effect buttons in one row
   ========================================================================== */
@media (max-width: 1100px) {
    .is-stage .mx-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: 38vh; gap: 16px; }
    .is-stage .mx-fx.left { grid-column: 1; justify-content: flex-end; }
    .is-stage .mx-fx.right { grid-column: 2; justify-content: flex-start; }
    .is-stage .mx-fx { gap: 12px; margin-bottom: 0; }
    .is-stage .mx-deck, .is-stage .mx-side { grid-column: 1 / -1; }
    .mx-fxbtn { width: 64px; height: 64px; }
    .mx-fxin { font-size: 8px; letter-spacing: 1px; }
    .mx-fxin b { font-size: 19px; margin-bottom: 2px; }
}
@media (max-width: 700px) {
    body:has(#music-app) header { padding: 10px 14px !important; gap: 8px !important; }
    body:has(#music-app) header .brand { font-size: 18px; }
    body:has(#music-app) header nav { display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: none; }
    body:has(#music-app) header nav::-webkit-scrollbar { display: none; }
    body:has(#music-app) header nav a { flex: 0 0 auto; padding: 7px 11px !important; font-size: 13px !important; white-space: nowrap; }
    .mx-hero { padding-top: 24px; }
    .mx-hero h1 { letter-spacing: -1.6px; }
}

/* hold-to-turbo: no text selection, scrolling or long-press menu on the buttons */
.mx-fxbtn { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
