/* Zero Samples: a synthwave night. Dark-only page. */
:root {
  color-scheme: dark;
  --bg: #0a0620;
  --ink: #f6f0ff;
  --ink2: #cfc3ea;
  --ink3: #a597cf;
  --panel: rgba(26, 12, 58, .74);
  --edge: rgba(255, 79, 216, .42);
  --edge-soft: rgba(255, 79, 216, .2);
  --rule: rgba(207, 195, 234, .13);
  --field: rgba(10, 5, 28, .55);
  --field-edge: rgba(207, 195, 234, .22);
  --magenta: #ff4fd8;
  --yellow: #ffd23f;
  --cyan: #3ee6ff;
  --cyan-ink: #aef4ff;
  --focus: #7df3ff;
  --sunset: linear-gradient(90deg, #4a1a8f 0%, #a0249c 24%, #ff3d9a 52%, #ff8a3d 78%, #ffd23f 100%);
  --hot: linear-gradient(100deg, #ff3d9a 0%, #ff5f7a 45%, #ff9a3c 100%);
  --display: 'Orbitron', 'Eurostile', 'Michroma', 'Arial Black', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --gutter: 40px;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  background: radial-gradient(90% 60% at 50% 100%, rgba(120, 30, 140, .22), transparent 70%), var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.k { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .26em; color: var(--ink3); margin: 0; text-transform: uppercase; }

/* ---------- scanlines (decorative) ---------- */
.scan { position: fixed; inset: 0; z-index: 30; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .09) 0 1px, transparent 1px 3px); }

/* ---------- hero: sky, stars, sun, horizon, grid floor ---------- */
.hero { position: relative; z-index: 0; background: linear-gradient(180deg, #05021a 0%, #0c0630 30%, #1b0a45 58%, #3a0e5e 82%, #6c1573 100%); }
.hero::after { /* the horizon line */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; z-index: 1;
  background: linear-gradient(90deg, rgba(255, 79, 216, 0), #ff6ad5 18%, #ffd3f4 50%, #ff6ad5 82%, rgba(255, 79, 216, 0));
  box-shadow: 0 0 14px 1px rgba(255, 79, 216, .7), 0 0 44px 6px rgba(255, 61, 154, .35);
}
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; --sun: 340px; --sun-x: calc(50% + 350px); }
.stars {
  position: absolute; inset: 0; opacity: .75;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='300'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='14' cy='22' r='1'/%3E%3Ccircle cx='96' cy='70' r='.7' opacity='.6'/%3E%3Ccircle cx='171' cy='18' r='.8' opacity='.8'/%3E%3Ccircle cx='230' cy='122' r='.6' opacity='.5'/%3E%3Ccircle cx='302' cy='46' r='1.1'/%3E%3Ccircle cx='366' cy='160' r='.7' opacity='.6'/%3E%3Ccircle cx='48' cy='188' r='.8' opacity='.7'/%3E%3Ccircle cx='140' cy='240' r='.6' opacity='.5'/%3E%3Ccircle cx='258' cy='214' r='.9' opacity='.8'/%3E%3Ccircle cx='398' cy='262' r='.6' opacity='.5'/%3E%3Ccircle cx='330' cy='102' r='.5' opacity='.5'/%3E%3Ccircle cx='70' cy='122' r='.5' opacity='.45'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='290' height='230'%3E%3Cg fill='%23e8dcff'%3E%3Ccircle cx='40' cy='60' r='.6' opacity='.55'/%3E%3Ccircle cx='190' cy='30' r='.7' opacity='.6'/%3E%3Ccircle cx='250' cy='150' r='.5' opacity='.5'/%3E%3Ccircle cx='120' cy='170' r='.8' opacity='.7'/%3E%3Ccircle cx='20' cy='210' r='.5' opacity='.45'/%3E%3C/g%3E%3C/svg%3E");
  background-position: 0 0, 137px 71px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 88%); mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 88%);
}
.glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(calc(var(--sun) * .95) calc(var(--sun) * .62) at var(--sun-x) 100%, rgba(255, 138, 61, .42), rgba(255, 61, 154, .16) 55%, transparent 100%),
    radial-gradient(75% 55% at 50% 100%, rgba(255, 61, 154, .36), rgba(160, 36, 156, .12) 55%, transparent 100%);
}
.sun {
  position: absolute; bottom: 0; left: calc(var(--sun-x) - var(--sun) / 2); width: var(--sun); height: var(--sun);
  transform: translateY(42%); border-radius: 50%;
  background: linear-gradient(180deg, #ffe66e 4%, #ffb347 19%, #ff7a45 33%, #ff3d9a 47%, #d81fc4 58%);
  -webkit-mask-image: linear-gradient(180deg, #000 33%, transparent 33% 34.2%, #000 34.2% 38%, transparent 38% 39.6%, #000 39.6% 43%, transparent 43% 45%, #000 45% 48%, transparent 48% 50.6%, #000 50.6% 53.2%, transparent 53.2% 56.2%, #000 56.2%);
          mask-image: linear-gradient(180deg, #000 33%, transparent 33% 34.2%, #000 34.2% 38%, transparent 38% 39.6%, #000 39.6% 43%, transparent 43% 45%, #000 45% 48%, transparent 48% 50.6%, #000 50.6% 53.2%, transparent 53.2% 56.2%, #000 56.2%);
}
.floor {
  position: absolute; top: 100%; left: 0; right: 0; height: 600px; overflow: hidden; pointer-events: none;
  perspective: 340px; perspective-origin: 50% 36px;
  background: linear-gradient(180deg, #1c0838 0%, rgba(10, 6, 32, 0) 80%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%); mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%);
}
.plane {
  position: absolute; left: -150%; right: -150%; bottom: -120px; height: 3600px; transform-origin: 50% 100%;
  background-image: linear-gradient(90deg, rgba(255, 79, 216, .62) 2px, transparent 2px), linear-gradient(180deg, rgba(255, 79, 216, .62) 2px, transparent 2px);
  background-size: 90px 90px; background-position: 50% 100%;
  transform: rotateX(84deg); animation: drive 2.4s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%); mask-image: linear-gradient(180deg, transparent 0%, #000 55%);
}
@keyframes drive { from { transform: rotateX(84deg) translateY(0); } to { transform: rotateX(84deg) translateY(90px); } }
.hero.still .plane { animation-play-state: paused; }

.hero-in { position: relative; z-index: 2; padding-top: 26px; padding-bottom: 76px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; margin-left: -10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--ink2);
  border-radius: 999px; border: 1px solid transparent; transition: border-color .15s ease, color .15s ease;
}
.back svg { width: 15px; height: 15px; }
.back:hover { color: var(--ink); border-color: var(--edge-soft); }
.meta { font-family: var(--mono); font-size: 13px; letter-spacing: .24em; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 6px 34px; margin: 22px 0 0; }
.meta b { color: var(--yellow); font-weight: 500; }
h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(46px, 7.4vw, 96px); line-height: 1; letter-spacing: .03em;
  text-transform: uppercase; margin: 16px 0 24px -3px; max-width: 12em;
}
h1 .w1 { color: #fff3fd; text-shadow: 0 0 3px #ff9be8, 0 0 12px rgba(255, 79, 216, .95), 0 0 30px rgba(255, 61, 154, .6), 0 0 60px rgba(255, 61, 154, .3); }
h1 .w2 {
  background: linear-gradient(180deg, #ffffff 8%, #d5eeff 34%, #8fd3ff 49%, #6d4bff 51%, #ff58cf 55%, #ff9fe0 76%, #ffe8f7 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(62, 230, 255, .28)) drop-shadow(0 3px 0 rgba(22, 4, 44, .85));
}
.lede { font-size: 17.5px; line-height: 1.6; color: var(--ink2); max-width: 36em; margin: 0; }
.lede strong { color: var(--ink); font-weight: 700; }

/* ---------- panels ---------- */
.main { position: relative; z-index: 1; padding-top: 38px; padding-bottom: 40px; }
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 28px rgba(255, 79, 216, .14), 0 26px 60px rgba(3, 1, 12, .5);
  -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15);
}
.panel + .panel { margin-top: 40px; }
.player { overflow: hidden; scroll-margin-top: 16px; }
.player:focus { outline: none; }
.player:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--magenta)); box-shadow: 0 0 8px var(--c-glow, rgba(255, 79, 216, .5)); flex: none; }

/* now playing */
.now { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 22px 15px; border-bottom: 1px solid var(--rule); }
.now-info { min-width: 0; }
.now-title { font-family: var(--sans); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 5px 0 3px; color: var(--ink); overflow-wrap: anywhere; }
.now-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; color: var(--ink2); }
.genre { display: inline-flex; align-items: center; gap: 8px; color: var(--c-ink, var(--ink2)); }
.now-album:empty { display: none; }
.now-act { display: flex; gap: 10px; flex: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; background: none; font-weight: 700; font-size: 14.5px; letter-spacing: .01em;
  white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, filter .15s ease, transform .12s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--hot); color: #1c0520; box-shadow: 0 0 20px rgba(255, 61, 154, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary svg { width: 15px; height: 15px; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07) saturate(1.05); }
.btn.ghost { border-color: rgba(62, 230, 255, .5); color: var(--cyan-ink); background: rgba(62, 230, 255, .04); }
.btn.ghost:hover:not(:disabled) { background: rgba(62, 230, 255, .12); border-color: rgba(62, 230, 255, .8); }
.btn:active:not(:disabled) { transform: scale(.97); }
.linkish { background: none; border: 0; padding: 8px 4px; min-height: 40px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--ink3); text-transform: uppercase; }
.linkish:hover { color: var(--ink); }

/* transport */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 16px 22px 16px 20px; }
.play {
  font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .1em;
  display: inline-flex; align-items: center; gap: 12px; height: 50px; min-width: 150px; justify-content: center; padding: 0 26px 0 22px;
  border: 0; border-radius: 999px; background: var(--hot); color: #1c0520;
  box-shadow: 0 0 24px rgba(255, 61, 154, .45), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .12s ease, filter .12s ease, box-shadow .2s ease;
}
.play svg { width: 16px; height: 16px; flex: none; }
.play:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 0 32px rgba(255, 61, 154, .6), inset 0 1px 0 rgba(255, 255, 255, .4); }
.play:active:not(:disabled) { transform: scale(.97); }
.play:disabled { opacity: .45; cursor: progress; box-shadow: none; }
.prog { min-width: 0; }
.bar { height: 6px; border-radius: 3px; background: rgba(207, 195, 234, .12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--sunset); background-size: var(--full, 100%) 100%; box-shadow: 0 0 10px rgba(255, 61, 154, .6); }
.status { font-family: var(--mono); font-size: 13.5px; color: var(--ink2); margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status b { color: var(--ink); font-weight: 500; }
.vol { display: flex; align-items: center; gap: 14px; min-height: 40px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--ink2); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 40px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--magenta) var(--p, 50%), rgba(207, 195, 234, .18) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--magenta) var(--p, 50%), rgba(207, 195, 234, .18) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--magenta); box-shadow: 0 0 10px rgba(255, 79, 216, .7); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--magenta); box-shadow: 0 0 10px rgba(255, 79, 216, .7); }
input[type=range]:focus-visible { outline-offset: 0; }
input[type=range]:disabled { cursor: default; }
input[type=range]:disabled::-webkit-slider-runnable-track { background: rgba(207, 195, 234, .14); }
input[type=range]:disabled::-moz-range-track { background: rgba(207, 195, 234, .14); }
input[type=range]:disabled::-webkit-slider-thumb { background: #5b4f7c; border-color: #7d70a3; box-shadow: none; }
input[type=range]:disabled::-moz-range-thumb { background: #5b4f7c; border-color: #7d70a3; box-shadow: none; }
.vol input { width: 112px; }

/* timeline */
.timeline { border-top: 1px solid var(--rule); position: relative; }
.labels { position: relative; height: 27px; }
.lab {
  position: absolute; top: 0; bottom: 0; padding: 5px 0 0 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink3);
  white-space: nowrap; overflow: hidden; text-overflow: clip; border: 0; background: none; text-align: left;
}
.lab::after { content: ""; position: absolute; left: 1px; right: 1px; bottom: 0; height: 3px; background: var(--c); opacity: .85; }
.lab:hover, .lab.on { color: var(--ink); }
.lab.on::after { opacity: 1; box-shadow: 0 0 8px var(--c); }
.lab:focus-visible { outline-offset: -2px; }
.spec-wrap { position: relative; height: 150px; background: #07030f; cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.spec-wrap:focus-visible { outline-offset: -2px; }
.spec-wrap canvas { display: block; width: 100%; height: 100%; }
.playhead { position: absolute; top: -5px; bottom: 0; width: 0; left: 0; pointer-events: none; will-change: transform; }
.playhead::before { content: ""; position: absolute; top: 5px; bottom: 0; left: -1px; width: 2px; background: #e9fdff; box-shadow: 0 0 8px rgba(62, 230, 255, .9), 0 0 2px #fff; }
.playhead::after { content: ""; position: absolute; top: 0; left: -6px; border: 6px solid transparent; border-top: 7px solid #e9fdff; border-bottom: 0; filter: drop-shadow(0 0 4px rgba(62, 230, 255, .9)); }

/* readouts */
.bottom { display: grid; grid-template-columns: 22fr 29fr 49fr; border-top: 1px solid var(--rule); min-height: 132px; }
.cell { padding: 17px 20px 15px; min-width: 0; }
.cell + .cell { border-left: 1px solid var(--rule); }
/* .big names are shrunk to fit by app.js; the fixed line height keeps the cell from moving */
.big { font-family: var(--display); font-weight: 800; font-size: 29px; line-height: 31px; letter-spacing: .03em; margin: 9px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-family: var(--mono); font-size: 13px; line-height: 17px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.beats { display: flex; gap: 6px; margin-top: 11px; }
.beats span { width: 10px; height: 10px; border-radius: 2px; background: rgba(207, 195, 234, .14); }
.beats span.on { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.desc { font-size: 14.5px; color: var(--ink2); margin: 2px 0 0; }
.cell.fft { padding: 0; position: relative; }
.cell.fft canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.foot { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding: 13px 20px; font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.foot b { color: var(--ink2); font-weight: 500; }

/* ---------- album ---------- */
.album { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; padding: 28px; align-items: start; }
.cover { aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 79, 216, .45), 0 0 36px rgba(255, 61, 154, .22), 0 20px 44px rgba(0, 0, 0, .5); }
.cover svg { display: block; width: 100%; height: 100%; }
.album-info { margin-top: 22px; }
.album h2 { font-family: var(--sans); font-weight: 700; font-size: 23px; line-height: 1.25; margin: 8px 0 8px; color: var(--ink); }
.album h2 span { display: block; font-weight: 400; font-style: italic; color: #ffb8ec; }
.album-by { margin: 0 0 18px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; color: var(--ink2); }
.album-by span { white-space: nowrap; }
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li + li { border-top: 1px solid var(--rule); }
.trk {
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr) 11.5em 3.4em; align-items: center; gap: 12px; width: 100%; min-height: 48px;
  padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; position: relative;
  transition: background-color .15s ease;
}
.trk:hover { background: rgba(207, 195, 234, .06); }
.trk-n { font-family: var(--mono); font-size: 13px; color: var(--ink3); display: flex; align-items: center; height: 16px; }
.trk-t { font-weight: 500; font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-g { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--c-ink, var(--ink2)); white-space: nowrap; overflow: hidden; }
.trk-d { font-family: var(--mono); font-size: 13px; color: var(--ink2); text-align: right; font-variant-numeric: tabular-nums; }
.trk-d.busy { color: var(--cyan-ink); } /* render progress, not a duration */
.trk[aria-current="true"] { background: linear-gradient(90deg, rgba(255, 79, 216, .16), rgba(255, 79, 216, .04)); }
.trk[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.trk[aria-current="true"] .trk-n { color: var(--magenta); }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--magenta); border-radius: 1px; height: 40%; animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; height: 90%; }
.eq i:nth-child(3) { animation-delay: -.6s; height: 60%; }
@keyframes eq { from { height: 25%; } to { height: 100%; } }
.trk.playing .eq { display: flex; }
.trk.playing .trk-num { display: none; }

/* ---------- generator ---------- */
.maker { padding: 28px; }
.maker-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: 22px; }
.maker h2 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .06em; text-transform: uppercase; margin: 0; color: var(--ink); }
.maker-note { margin: 0; font-size: 15px; color: var(--ink2); max-width: 44em; }
.gen fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.gen legend { padding: 0; margin-bottom: 10px; }
.gen label.k { display: block; margin-bottom: 10px; }
.genre-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.face {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--field-edge); background: var(--field); color: var(--ink2); transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.choice:hover .face { border-color: rgba(207, 195, 234, .45); color: var(--ink); }
.choice input:focus-visible + .face { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:checked + .face { color: var(--ink); border-color: var(--c-ink, var(--magenta)); background: var(--c-soft, rgba(255, 79, 216, .14)); box-shadow: inset 0 0 0 1px var(--c-ink, var(--magenta)), 0 0 18px var(--c-glow, rgba(255, 79, 216, .3)); }
.choice input:disabled { cursor: not-allowed; }
.choice input:disabled + .face { opacity: .38; }
.gface { min-height: 58px; }
.gface .gname { font-weight: 700; font-size: 15px; line-height: 1.2; }
.gface .gbpm { display: block; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .04em; color: var(--ink3); margin-top: 2px; }
.blurb { margin: 12px 0 0; min-height: 1.5em; font-size: 15px; color: var(--ink2); }
.blurb b { color: var(--c-ink, var(--ink)); font-weight: 700; }
.opts { display: grid; grid-template-columns: 180px minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "key mood tempo" "len len energy"; gap: 22px 26px; margin-top: 26px; }
.opt-key { grid-area: key; } .opt-mood { grid-area: mood; } .opt-tempo { grid-area: tempo; } .opt-len { grid-area: len; } .opt-energy { grid-area: energy; }
.seg { display: flex; gap: 8px; }
.seg .choice { flex: 1 1 0; min-width: 0; }
.seg .face { justify-content: center; text-align: center; padding: 6px 8px; font-weight: 500; font-size: 14.5px; flex-direction: column; gap: 0; line-height: 1.2; }
.seg .face small { font-family: var(--mono); font-size: 11px; color: var(--ink3); font-weight: 400; letter-spacing: .02em; }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(45deg); pointer-events: none; }
.select select {
  -webkit-appearance: none; appearance: none; width: 100%; min-height: 44px; padding: 0 38px 0 14px; border-radius: 10px;
  border: 1px solid var(--field-edge); background: var(--field); color: var(--ink); font-size: 15px; cursor: pointer;
}
.select select:hover { border-color: rgba(207, 195, 234, .45); }
.select select option { background: #1a0c3a; color: var(--ink); }
.tempo { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.tempo input[type=range] { flex: 1 1 auto; min-width: 0; height: 44px; }
.tempo output { font-family: var(--mono); font-size: 13px; color: var(--ink); min-width: 5.6em; text-align: right; white-space: nowrap; }
.tempo output.auto { color: var(--ink3); }
.check { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; position: relative; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; flex: none; }
.check input { position: absolute; z-index: 1; left: 0; top: 50%; width: 22px; height: 22px; margin: -11px 0 0; opacity: 0; cursor: pointer; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(207, 195, 234, .5); background: var(--field); display: grid; place-items: center; }
.check .box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid #1c0520; border-bottom: 2px solid #1c0520; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked + .box { background: var(--magenta); border-color: var(--magenta); box-shadow: 0 0 10px rgba(255, 79, 216, .5); }
.check input:checked + .box::after { opacity: 1; }
.check input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.gen-act { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.big-btn { min-height: 48px; padding: 0 26px; font-size: 15.5px; }
.mine { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); }
.mine-head { display: flex; align-items: center; justify-content: space-between; }
.mine-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mine-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; width: 100%; min-height: 52px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--field-edge); background: var(--field); text-align: left; transition: border-color .15s ease;
}
.mine-item:hover { border-color: rgba(207, 195, 234, .45); }
.mine-item[aria-current="true"] { border-color: var(--c-ink, var(--magenta)); box-shadow: inset 0 0 0 1px var(--c-ink, var(--magenta)); }
.mine-item .dot { grid-row: span 2; }
.mine-t { font-weight: 700; font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-g { font-family: var(--mono); font-size: 11.5px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- footer ---------- */
.site-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; padding-top: 0; padding-bottom: 36px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink3); }
.site-foot a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink2); text-decoration-color: rgba(207, 195, 234, .4); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink); }

/* ---------- narrower screens ---------- */
@media (max-width: 1000px) {
  .sky { --sun: 300px; --sun-x: calc(100% - 150px); }
  .hero-in { padding-bottom: 72px; }
  .lede { max-width: 30em; }
  .status { white-space: normal; line-height: 1.45; }
  .time .sep { display: none; }
  #secBar { display: block; }
  .album { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .trk { grid-template-columns: 2.4em minmax(0, 1fr) 3.4em; grid-template-areas: "n t d" "n g d"; row-gap: 1px; column-gap: 10px; min-height: 56px; }
  .trk-n { grid-area: n; } .trk-t { grid-area: t; } .trk-g { grid-area: g; font-size: 11.5px; } .trk-d { grid-area: d; }
  .trk-g .dot { width: 7px; height: 7px; }
  .genre-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "key tempo" "mood mood" "len energy"; }
}
@media (max-width: 900px) {
  :root { --gutter: 28px; }
  .sky { --sun: 240px; --sun-x: calc(100% - 130px); }
  .hero-in { padding-bottom: 96px; }
  .lede { font-size: 16.5px; max-width: 27em; }
  .bottom { grid-template-columns: 1fr 1fr; }
  .cell.fft { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); height: 120px; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .sky { --sun: 210px; --sun-x: 50%; }
  .hero-in { padding-top: 14px; padding-bottom: 146px; }
  /* two fixed rows (BPM, key / bars, samples) so a long key such as F♯ HARMONIC MINOR never adds a line */
  .meta { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 22px; font-size: 11.5px; letter-spacing: .16em; margin-top: 14px; }
  h1 { margin: 12px 0 16px -2px; }
  .lede { font-size: 16px; }
  .main { padding-top: 34px; }
  .panel { border-radius: 16px; }
  .panel + .panel { margin-top: 28px; }
  .now { flex-direction: column; align-items: stretch; padding: 16px 14px 14px; }
  .now-title { font-size: 20px; }
  .now-act .btn { flex: 1 1 0; padding: 0 12px; }
  .top { grid-template-columns: auto 1fr; padding: 14px; gap: 12px 16px; }
  .status { font-size: 12.5px; line-height: 1.5; }
  .time { font-size: 12px; }
  .prog { grid-column: 1 / -1; grid-row: 2; }
  .vol { justify-self: end; }
  .vol input { width: 96px; }
  .lab { font-size: 10px; padding-left: 4px; letter-spacing: .02em; }
  .spec-wrap { height: 118px; }
  .bottom { grid-template-columns: 1fr 1fr; }
  .cell { padding: 15px 14px 13px; }
  .big { font-size: 21px; line-height: 23px; }
  .desc { font-size: 13.5px; line-height: 1.45; }
  .cell.fft { height: 116px; }
  .foot { padding: 11px 14px; font-size: 11px; }
  .album { grid-template-columns: 1fr; gap: 18px; padding: 16px 12px 12px; }
  .album-side { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; padding: 0 4px; }
  .album-info { margin-top: 0; }
  .album h2 { font-size: 18px; margin-top: 4px; }
  .album-by { margin-bottom: 12px; font-size: 11.5px; }
  .album-info .btn { min-height: 42px; padding: 0 16px; }
  .trk { grid-template-columns: 2em minmax(0, 1fr) 3em; padding: 9px 8px; }
  .trk-t { font-size: 15px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
  .trk-g { font-size: 11px; } .trk-d { font-size: 12px; }
  .maker { padding: 20px 14px; }
  .maker h2 { font-size: 18px; }
  .maker-note { font-size: 14.5px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gface { min-height: 54px; padding: 8px 10px; }
  .opts { grid-template-columns: minmax(0, 1fr); grid-template-areas: "key" "mood" "tempo" "len" "energy"; gap: 20px; }
  .seg { flex-wrap: wrap; gap: 6px; }
  .opt-mood .seg .choice { flex: 1 1 28%; }
  .gen-act .btn { flex: 1 1 0; }
  .mine-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  h1 { font-size: 42px; }
  .play { min-width: 128px; padding: 0 20px 0 18px; }
  .vol { gap: 10px; letter-spacing: .12em; }
  .vol input { width: 84px; }
}
/* With a mouse, the Ready hint wraps to two lines on narrower screens: keep room for both so the panel does not move. */
@media (max-width: 1000px) and (pointer: fine) {
  .status { min-height: 3em; min-height: 2lh; }
}
@media (prefers-reduced-motion: reduce) {
  .plane, .eq i { animation: none; }
  .btn, .play, .face, .trk, .back { transition: none; }
}
