/* ==========================================================================
   Music Experiments: "Silveramp", a Winamp 2.x-inspired player.
   Artwork from WIN-ASS (copied to images/winamp/; equalizer-panel.svg is unused
   since the EQ window was removed). This is the one place on
   the site that is intentionally retro.
   ========================================================================== */

.music-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 62rem) {
  .music-layout { grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); }
}

/* A dark "desktop" behind the player windows */
.desktop {
  --metal-ink: #1c201d;
  display: grid;
  gap: 6px;
  padding: clamp(.6rem, 2.5vw, 1.25rem);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 30% 0%, rgb(255 255 255 / .06), transparent 60%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / .025) 0 1px, transparent 1px 4px),
    #26302c;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .4), var(--shadow);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--metal-ink);
  -webkit-tap-highlight-color: transparent;
}
.desktop :focus-visible { outline: 2px solid #f2ff7a; outline-offset: 1px; border-radius: 2px; }

/* ---------- Window chrome ---------- */
.wa-window {
  background: #c6c8c6 url(../images/winamp/brushed-metal.svg) center / cover;
  border: 1px solid #2b2f2c;
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / .75),
    inset -1px -1px 0 rgb(0 0 0 / .35),
    0 6px 18px rgb(0 0 0 / .45);
  border-radius: 3px;
  overflow: hidden;
}
.wa-window[hidden] { display: none; }

.wa-titlebar {
  display: flex; align-items: center; gap: 8px;
  height: 22px;
  padding: 0 6px;
  background: linear-gradient(#3d4440, #1b1f1d);
  border-bottom: 1px solid #0c0e0d;
}
.wa-tb-grip {
  flex: 1; height: 8px;
  background: repeating-linear-gradient(#c9b77a 0 1px, #5a5035 1px 2px, transparent 2px 3px);
  opacity: .8;
}
.wa-tb-title {
  font: bold 11px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .25em;
  color: #e9e2c4;
  text-shadow: 0 1px 0 #000;
}
.wa-tb-btns { display: flex; gap: 3px; }
.wa-tb-btns i {
  width: 10px; height: 10px; display: block;
  background: linear-gradient(#d9dbd9, #8f938f);
  border: 1px solid #111;
}

.wa-body { padding: 8px 10px 10px; display: grid; gap: 8px; }

.wa-lbl {
  font: bold 10px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .12em;
  color: #2a2e2b;
  text-shadow: 0 1px 0 rgb(255 255 255 / .6);
}

/* ---------- LCD (lcd-display.svg) ---------- */
/* The SVG is scaled by height and anchored left, so its built-in "MUSIC EXPERIMENTS"
   label stays sharp and in place. The live clock sits over the SVG's "00:00". */
.lcd {
  position: relative;
  container-type: size;
  width: 100%;
  aspect-ratio: 5 / 1;
  min-height: 5.75rem;
  border-radius: 5px;
  background: #041a0c url(../images/winamp/lcd-display.svg) left top / auto 100% no-repeat;
  box-shadow: inset 0 0 0 2px #161b17, 0 1px 0 rgb(255 255 255 / .7);
  color: #a6ffad;
  font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden;
}

.lcd-time {
  position: absolute;
  left: 13cqh; top: 45cqh;
  width: 112cqh; height: 42cqh;
  display: flex; align-items: center; gap: 6cqh;
  padding: 0 6cqh;
  margin: 0;
  border: 1px solid rgb(122 255 140 / .14);
  border-radius: 3px;
  background: linear-gradient(#0a2c15, #05200e);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lcd-state { font-size: 13cqh; width: 12cqh; text-align: center; color: #79ff8b; text-shadow: 0 0 4px rgb(121 255 139 / .7); }
.lcd-state.is-paused { animation: lcd-blink 1s steps(2, start) infinite; }
@keyframes lcd-blink { to { visibility: hidden; } }

.lcd-digits { position: relative; font-size: 28cqh; font-weight: bold; letter-spacing: .02em; line-height: 1; }
.lcd-digits > span:last-child { position: relative; color: #b6ffbb; text-shadow: 0 0 6px rgb(121 255 139 / .65); }
.lcd-ghost { position: absolute; inset: 0; color: rgb(121 255 139 / .08); text-shadow: none; }
.lcd-time.is-remaining .lcd-digits > span:last-child::before { content: "-"; position: absolute; right: 100%; }

.lcd-right {
  position: absolute;
  left: 162cqh; right: 6cqh; top: 11cqh; bottom: 10cqh;
  display: flex; flex-direction: column; gap: 3cqh;
  min-width: 0;
}
.lcd-marquee {
  height: 20cqh;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14cqh; font-weight: bold; line-height: 20cqh;
  color: #b6ffbb;
  text-shadow: 0 0 4px rgb(121 255 139 / .5);
  background: rgb(0 0 0 / .22);
  border-radius: 2px;
  padding: 0 3cqh;
}
.lcd-marquee span { display: inline-block; padding-left: 100%; animation: lcd-scroll 16s linear infinite; }
.lcd-marquee.is-static span { padding-left: 0; animation: none; }
@keyframes lcd-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.lcd-info { margin: 0; display: flex; gap: 8cqh; font-size: 10cqh; line-height: 1.2; color: rgb(166 255 173 / .75); white-space: nowrap; overflow: hidden; }
.lcd-info b { color: #b6ffbb; }
.lcd-led { opacity: .3; }
.lcd-led.is-on { opacity: 1; color: #b6ffbb; }

.lcd-vis { flex: 1; min-height: 0; width: 100%; display: block; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .lcd-marquee span { padding-left: 0; animation: none !important; text-overflow: ellipsis; }
}

/* ---------- Rows & sliders ---------- */
.wa-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wa-row-sliders { justify-content: space-between; }
.wa-slider { display: flex; align-items: center; gap: 6px; }
.wa-vol { flex: 1 1 9rem; }
.wa-vol input { flex: 1; min-width: 5rem; }
.wa-bal input { width: 4.5rem; }
.wa-toggles { display: flex; gap: 4px; margin-left: auto; }

/* Range inputs: groove + rectangular thumb */
.desktop input[type="range"] {
  -webkit-appearance: none; appearance: none;
  background: transparent;
  height: 22px; margin: 0;
  cursor: pointer;
}
.desktop input[type="range"]::-webkit-slider-runnable-track {
  height: 7px; border-radius: 1px;
  background: linear-gradient(#202421, #4a514c);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / .6), 0 1px 0 rgb(255 255 255 / .6);
}
.desktop input[type="range"]::-moz-range-track {
  height: 7px; border-radius: 1px;
  background: linear-gradient(#202421, #4a514c);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / .6), 0 1px 0 rgb(255 255 255 / .6);
}
.desktop input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 16px; margin-top: -5px;
  border: 1px solid #1c201d; border-radius: 2px;
  background: linear-gradient(#f4f5f3, #a9adaa);
  box-shadow: inset 1px 1px 0 #fff;
}
.desktop input[type="range"]::-moz-range-thumb {
  width: 14px; height: 16px;
  border: 1px solid #1c201d; border-radius: 2px;
  background: linear-gradient(#f4f5f3, #a9adaa);
  box-shadow: inset 1px 1px 0 #fff;
}
.desktop input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }

/* Seek bar: wider, with a filled portion (set by JS via --p) */
.wa-seek input { width: 100%; --p: 0%; }
.wa-seek input::-webkit-slider-runnable-track {
  height: 10px;
  background:
    linear-gradient(90deg, #7fd37f 0 var(--p), transparent var(--p)),
    linear-gradient(#1b1f1c, #3b423d);
}
.wa-seek input::-moz-range-track {
  height: 10px;
  background:
    linear-gradient(90deg, #7fd37f 0 var(--p), transparent var(--p)),
    linear-gradient(#1b1f1c, #3b423d);
}
.wa-seek input::-webkit-slider-thumb { width: 28px; height: 14px; margin-top: -2px; }
.wa-seek input::-moz-range-thumb { width: 28px; height: 12px; }

/* ---------- Buttons ---------- */
.wa-btn, .wa-tbtn {
  font: bold 10px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .08em;
  color: #1c201d;
  border: 1px solid #262a27;
  border-radius: 2px;
  background: linear-gradient(#f1f2f0, #b8bbb8 60%, #a3a7a4);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgb(0 0 0 / .25);
  cursor: pointer;
  padding: 0;
  -webkit-user-select: none; user-select: none;
}
.wa-btn:active, .wa-tbtn:active {
  background: linear-gradient(#a3a7a4, #c9ccc9);
  box-shadow: inset 1px 1px 2px rgb(0 0 0 / .45);
}

.wa-transport { display: flex; gap: 3px; }
.wa-btn { width: 44px; height: 36px; display: grid; place-items: center; }
.wa-btn svg { width: 18px; height: 18px; }
.wa-btn-eject { margin-left: 8px; width: 38px; }
.wa-btn-play.is-active svg, .wa-btn.is-active svg { filter: drop-shadow(0 0 2px rgb(110 255 120 / .9)); }

.wa-tbtn {
  min-width: 34px; height: 24px; padding: 0 7px;
  display: inline-flex; align-items: center; gap: 5px;
}
.wa-tbtn::before {
  content: ""; width: 6px; height: 6px; border-radius: 1px;
  background: #3e4a3f; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .4);
}
.wa-tbtn[aria-pressed="true"]::before { background: #6dff7a; box-shadow: 0 0 5px #6dff7a, inset 0 0 0 1px rgb(0 0 0 / .2); }
.wa-tbtn:not([aria-pressed])::before { display: none; }
.wa-info-btn { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; min-width: 30px; justify-content: center; }

/* ---------- Playlist window (playlist-titlebar.svg) ---------- */
/* border-image keeps the "PLAYLIST EDITOR" text and the X button at their native size
   while the middle of the bar stretches to fit. */
.pl-titlebar {
  position: relative;
  height: 34px;
  border-style: solid;
  border-width: 0 40px 0 150px;
  border-image: url(../images/winamp/playlist-titlebar.svg) 0 40 0 150 fill / 0 40px 0 150px stretch;
}
.pl-close {
  position: absolute;
  right: -29px; top: 7px;
  width: 27px; height: 20px;
  border: 0; padding: 0;
  background: transparent;
  cursor: pointer;
}
.pl-close:hover { background: rgb(255 255 255 / .25); }

.pl-list {
  list-style: none; margin: 0; padding: 4px 0;
  max-height: 17.5rem;
  overflow-y: auto;
  background: #000;
  border-top: 1px solid #0c0e0d;
  font: 13px/1.25 Arial, Helvetica, sans-serif;
  color: #00e000;
  scrollbar-color: #6b716d #111;
}
.pl-list:focus-visible { outline: 2px solid #f2ff7a; outline-offset: -2px; }
.pl-item {
  display: flex; gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.pl-item .pl-num { flex: none; min-width: 1.8em; text-align: right; opacity: .9; }
.pl-item .pl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item .pl-dur { flex: none; font-variant-numeric: tabular-nums; }
.pl-item:hover { background: #0b1a0b; }
.pl-item[aria-selected="true"] { background: #0000c6; }
.pl-item.is-current { color: #fff; }
.pl-item.is-current .pl-name::after { content: "  \25C0"; font-size: 10px; }
.pl-list.is-focused .pl-item.is-cursor { outline: 1px dotted #8ea0ff; outline-offset: -2px; }

.pl-bottom {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid #0c0e0d;
}
.pl-hint { font-size: 10px; color: #3b403c; flex: 1; text-align: center; }
.pl-total {
  font: bold 11px/1 "Courier New", monospace;
  color: #a6ffad;
  background: #062010;
  padding: 5px 7px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #000;
  font-variant-numeric: tabular-nums;
}

/* ---------- Notes column ---------- */
.music-notes { position: relative; }
.notes-card { padding: 1.4rem 1.5rem; }
.notes-card h2 { font-size: 1.35rem; }
.notes-card h3 { margin-top: 1.25rem; font-size: 1rem; }
.notes-card ul { padding-left: 1.1rem; margin: 0; }
.notes-card li { margin-bottom: .45rem; }
.kbd-list { margin: 0; color: var(--muted); font-size: .95rem; }
kbd {
  font-family: var(--font-mono); font-size: .8rem;
  padding: .05rem .4rem;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
}
.notes-disc {
  display: block;
  width: 7rem; margin: 1.5rem auto 0;
  opacity: .9;
}
.is-playing .notes-disc, .w98-disc.is-spinning { animation: disc-spin 3.2s linear infinite; }
@keyframes disc-spin { to { transform: rotate(360deg); } }

/* ---------- Retro "Track Information" popup ---------- */
.w98 {
  width: min(31rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  background: #c3c3c3;
  color: #000;
  font: 13px/1.45 Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
  box-shadow:
    inset -1px -1px 0 #0a0a0a,
    inset 1px 1px 0 #dfdfdf,
    inset -2px -2px 0 #808080,
    inset 2px 2px 0 #fff,
    0 12px 40px rgb(0 0 0 / .45);
  overflow: auto;
}
.w98::backdrop { background: rgb(10 20 15 / .45); }
.w98-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 3px 3px 0;
  padding: 3px 3px 3px 6px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  position: sticky; top: 0;
}
.w98-x {
  width: 20px; height: 18px; padding: 0;
  display: grid; place-items: center;
  background: #c3c3c3; color: #000;
  border: 0;
  box-shadow: inset -1px -1px 0 #0a0a0a, inset 1px 1px 0 #fff, inset -2px -2px 0 #808080, inset 2px 2px 0 #dfdfdf;
  cursor: pointer;
}
.w98-x svg { width: 9px; height: 9px; }
.w98-body { padding: 12px 14px 14px; }
.w98-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.w98-disc { width: 64px; height: 64px; flex: none; }
.w98-h { font: bold 17px/1.25 Tahoma, Verdana, Arial, sans-serif; margin: 0 0 2px; }
.w98-artist { margin: 0; color: #303030; }
/* Etched Windows-98 group box. A real border (not box-shadow) lets the
   legend cut a clean gap so the label isn't struck through. */
.w98-group {
  margin: 0 0 10px;
  padding: 6px 10px 10px;
  border: 2px groove #f4f4f4;
  border-color: #808080 #ffffff #ffffff #808080;
  border-style: groove;
}
.w98-group legend { padding: 0 5px; background: #c3c3c3; font-weight: bold; }
.w98-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.w98-dl dt { color: #404040; }
.w98-dl dd { margin: 0; word-break: break-word; }
.w98-desc p { margin: 0 0 .6em; }
.w98-desc p:last-child { margin: 0; }
.w98-actions { display: flex; justify-content: flex-end; }
.w98-btn {
  min-width: 84px; height: 28px;
  font: inherit;
  background: #c3c3c3; color: #000;
  border: 0;
  box-shadow: inset -1px -1px 0 #0a0a0a, inset 1px 1px 0 #fff, inset -2px -2px 0 #808080, inset 2px 2px 0 #dfdfdf;
  cursor: pointer;
}
.w98-btn:active { box-shadow: inset 1px 1px 0 #0a0a0a, inset -1px -1px 0 #fff, inset 2px 2px 0 #808080; }
.w98 :focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- Small screens ---------- */
@media (max-width: 30rem) {
  .wa-body { padding: 7px 7px 8px; }
  .wa-btn { width: 40px; height: 40px; }
  .wa-btn-eject { width: 36px; margin-left: 4px; }
  .wa-transport { flex: 1 1 100%; justify-content: space-between; }
  .wa-row-transport .wa-toggles { margin-left: 0; flex: 1; justify-content: space-between; }
  .wa-tbtn { height: 32px; }
  .wa-tbtn-wide { flex: 1; justify-content: center; }
  .pl-hint { display: none; }
  .pl-bottom { justify-content: space-between; }
  .pl-item { padding: 9px 8px; }
}
