:root{ color-scheme: dark; }
*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 30% -10%, rgba(70,120,220,.28) 0%, rgba(10,14,24,0) 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(210,80,255,.18) 0%, rgba(10,14,24,0) 55%),
    linear-gradient(180deg, #05060b 0%, #05060b 100%);
  color:#e8e8e8;
}

.wrap{
  max-width: 840px;
  margin: 18px auto 30px;
  padding: 0 12px;
}

.amp{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.62);
  background: linear-gradient(180deg, #1a1f2b 0%, #0b0e17 100%);
}

/* ============ Top bar ============ */
.topbar{
  display:flex;
  gap:12px;
  align-items:stretch;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.04) 45%, rgba(0,0,0,0) 100%),
    linear-gradient(180deg, #2a2f3c 0%, #141826 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lcd{
  flex:1;
  border-radius: 10px;
  padding: 10px 12px;
  background:
    radial-gradient(100% 140% at 30% 0%, rgba(0,255,150,.25) 0%, rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(0,255,150,.16) 0%, rgba(0,0,0,.62) 85%);
  border: 1px solid rgba(0,255,150,.22);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
  position: relative;
  overflow:hidden;
}

.lcd::after{
  content:"";
  position:absolute;
  inset:-60px -80px auto -80px;
  height:120px;
  transform: rotate(-12deg);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.10) 45%, transparent 100%);
  opacity:.35;
  pointer-events:none;
}

.lcdLine1{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  letter-spacing: .06em;
  color: #7CFFB6;
  text-shadow: 0 0 10px rgba(124,255,182,.22);
  font-size: 14px;
}

.marquee{ overflow:hidden; white-space:nowrap; position:relative; }
.marquee span{ display:inline-block; padding-right: 48px; will-change: transform; }
.marquee.scroll span{ animation: marquee var(--marqueeDur, 10s) linear infinite; }
@keyframes marquee{
  0%{ transform:translateX(0); }
  100%{ transform:translateX(calc(-1 * var(--marqueeShift, 240px))); }
}

.lcdLine2{
  margin-top: 6px;
  display:flex;
  justify-content: space-between;
  gap:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: rgba(124,255,182,.85);
  font-variant-numeric: tabular-nums;
}

/* Equalizer: keep visible on mobile (shrink instead of hide) */
.eq{
  width: 160px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
  padding: 8px;
  background:
    radial-gradient(120px 80px at 30% 10%, rgba(124,255,182,.12) 0%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, #10142a 0%, #070912 100%);
  border: 1px solid rgba(0,0,0,.65);
  display:flex;
  gap:6px;
  align-items:flex-end;
  justify-content:center;
}

.bar{
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #7CFFB6 0%, #1ecf7b 60%, #0aa35d 100%);
  box-shadow: 0 0 10px rgba(124,255,182,.14);
  opacity:.9;
}

/* ============ Panel header (playlist/download) ============ */
.panel{ padding: 12px; }
.plistHead{ display:flex; gap:10px; align-items:stretch; }

/* ============ Buttons ============ */
button.btn{
  -webkit-tap-highlight-color: transparent;
  appearance:none;
  border: 1px solid rgba(0,0,0,.75);
  background:
    linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.06) 48%, rgba(0,0,0,.08) 100%),
    linear-gradient(180deg, #2d3242 0%, #141827 100%);
  color: #eaeaea;
  border-radius: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 10px 22px rgba(0,0,0,.40);
  user-select:none;
}

button.btn{ height: 44px; min-width: 44px; padding: 0 12px; }
button.btn.wide{ min-width: 210px; text-align:left; line-height: 1.1; }

button.btn.primary{
  background:
    linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.08) 50%, rgba(0,0,0,.08) 100%),
    linear-gradient(180deg, #3a3f53 0%, #171b2a 100%);
}

/* Active state: thicker + brighter pressed look */
button.btn.on{
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.45),
    inset 0 10px 22px rgba(0,0,0,.58),
    inset 0 2px 0 rgba(255,255,255,.65),
    0 14px 34px rgba(0,0,0,.62);
  filter: brightness(1.10) contrast(1.06);
}

button.btn:active{ transform: translateY(1px); }

button.btn:focus,
button.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 2px rgba(124,255,182,.22),
    inset 0 1px 0 rgba(255,255,255,.14),
    0 10px 22px rgba(0,0,0,.40);
}

button.btn:disabled{ opacity:.45; cursor:not-allowed; }
.caret{ opacity:.85; }

button.btn.danger{
  background:
    linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.06) 48%, rgba(0,0,0,.10) 100%),
    linear-gradient(180deg, #3b2c33 0%, #1a1016 100%);
}

/* ============ Controls block ============ */
.controls{ padding: 0 12px 14px; }

.controlsInner{
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(900px 260px at 30% -20%, rgba(124,255,182,.08) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(180deg, #1a1f2b 0%, #0b0e17 100%);
  box-shadow: 0 16px 60px rgba(0,0,0,.45);
}

/* Symmetric button grid */
.btnGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items:center;
}

.btnGrid > button{ width:100%; }

.btnGrid #back15{ grid-column: 1 / span 1; }
.btnGrid #shuffle{ grid-column: 2 / span 2; justify-self: stretch; }
.btnGrid #fwd15{ grid-column: 4 / span 1; }

.sliders{ margin-top: 12px; }

input[type="range"]{
  width: 100%;
  accent-color: #7CFFB6;
}

.time{
  margin-top: 10px;
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  opacity: .92;
}

.tName{
  flex: 1;
  min-width: 0;
  text-align:center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 900;
}

/* Visualizer card */
.vizCard{
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  padding: 10px;
}

.vizHeader{
  display:flex;
  justify-content: space-between;
  gap:10px;
  align-items: baseline;
  padding: 2px 2px 8px;
}

.vizTitle{
  font-weight: 1000;
  letter-spacing: .02em;
  opacity:.95;
}

.vizHint{
  font-family: ui-monospace, monospace;
  font-size: 11px;
  opacity: .68;
}

.vizScreen{
  position: relative;
  border-radius: 10px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(420px 220px at 30% -20%, rgba(124,255,182,.10) 0%, rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #111528 0%, #070911 100%);
  height: 170px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.vizScreen img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* maximal groß, ohne Verzerrung */
  display: block;
  image-rendering: auto;
}

.vizOffOverlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: ui-monospace, monospace;
  font-weight: 1000;
  letter-spacing: .18em;
  color: rgba(124,255,182,.55);
  background: rgba(0,0,0,.35);
  text-shadow: 0 0 14px rgba(124,255,182,.18);
  opacity: 0;
  pointer-events:none;
  transition: opacity .16s ease;
}

.vizOffOverlay.on{ opacity: 1; }

.vizControls{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 10px;
}

.vizBtn{ height: 42px; }

/* Toast feedback */
.toast{
  margin-top: 10px;
  min-height: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .18s ease, transform .18s ease;
  color: rgba(232,232,232,.86);
}
.toast.show{ opacity:.92; transform: translateY(0); }

/* ============ Playlist overlay ============ */
.plOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 50;
}
.plOverlay.hidden{ display:none; }

.plWindow{
  width: min(760px, 96vw);
  max-height: min(78vh, 720px);
  display:flex;
  flex-direction: column;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(124,255,182,.10) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(180deg, #20263a 0%, #0f1220 100%);
  box-shadow: 0 30px 90px rgba(0,0,0,.70);
}

.plTitleRow{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.plTitle{ font-weight: 1000; letter-spacing: .02em; opacity: .95; }

.plList{
  padding: 10px;
  overflow:auto;
  overscroll-behavior: contain;
  outline:none;
}

.track{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.12);
  margin-bottom: 10px;
  cursor:pointer;
}
.track:hover{ background: rgba(0,0,0,.18); }
.track.active{
  border-color: rgba(124,255,182,.32);
  box-shadow: 0 0 0 2px rgba(124,255,182,.10) inset;
}

.tmain{ flex:1; min-width:0; }
.t1{ font-weight: 950; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.t2{ margin-top: 4px; opacity:.75; font-family: ui-monospace, monospace; font-size: 12px; }

.badge{
  flex: 0 0 auto;
  font-family: ui-monospace, monospace;
  font-weight: 900;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  opacity: .95;
}
.badge.resume{ border-color: rgba(124,255,182,.22); }

/* Lock background scroll when modal is open */
body.modalOpen{
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* Mobile tweaks: keep EQ visible but smaller */
@media (max-width: 520px){
  button.btn.wide{ min-width: 0; flex: 1; }
  .plistHead{ flex-direction: row; }
  .eq{ width: 118px; height: 66px; padding: 7px; gap: 5px; }
  .bar{ width: 8px; border-radius: 2px; }
  .vizScreen{ height: 160px; }
}


/* Playlist title marquee (only on overflow) */
.track .t1{
  overflow:hidden;
  white-space:nowrap;
}
.track .t1 .t1s{
  display:inline-block;
  will-change: transform;
  padding-right: 36px; /* gap when looping */
}
/* Playlist title auto-marquee (mobile-friendly: always scroll when too long) */
.t1{
  overflow: hidden;
  white-space: nowrap;
}
.t1 .t1s{
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}
.t1.marq .t1s{
  animation: plmarquee var(--dur, 14s) linear infinite;
}

@keyframes plmarquee{
  0%, 15%{ transform: translateX(0); }
  85%, 100%{ transform: translateX(var(--dx, 0px)); }
}

/* GIF fullscreen modal */
#gifModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
#gifModal.open{ display: block; }

#gifModal .gifModalBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#gifModal .gifModalPanel{
  position: absolute;
  inset: 16px;
  border-radius: 18px;
  background: rgba(14,18,28,.82);
  box-shadow: 0 20px 80px rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 16px;
}

#gifModal .gifModalClose{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  font-size: 18px;
}

#gifModal img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

body.modalOpen{
  overflow: hidden;
  touch-action: none;
}
/* Playlist Schriftgröße */
/* Playlist: einheitliche Größen */
/* Playlist: alles wirklich gleich groß */
.plOverlay .plWindow .track { font-size: 12px; }

.plOverlay .plWindow .t1{
  font-size: 12px !important;
  font-weight: 600 !important;   /* <- statt 950, sonst wirkt’s größer */
  line-height: 1.2 !important;
}

.plOverlay .plWindow .t2{
  font-size: 12px !important;
  font-family: inherit !important; /* <- wenn du auch die Mono-Schrift loswerden willst */
  line-height: 1.2 !important;
  opacity: .85; /* optional: etwas näher an t1 */
}

.plOverlay .plWindow .badge{
  font-size: 11px !important;
}