/* musik.rsbad.de – Demo-Pitch. Schwarz, Weiss, Neongelb. */

:root {
  --bg: #000;
  --yellow: #ffe600;
  --glow: 255, 214, 0;
  --text: #fff;
  --dim: rgba(255, 255, 255, .56);
  --faint: rgba(255, 255, 255, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --btn: clamp(92px, 24vmin, 136px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.frame {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(env(safe-area-inset-top), 22px)
    max(env(safe-area-inset-right), 22px)
    max(env(safe-area-inset-bottom), 22px)
    max(env(safe-area-inset-left), 22px);
  animation: fade-in 1.4s var(--ease) both;
}

/* ---------- Kopf ---------- */

.top { text-align: center; padding-top: 6px; }

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .6em;
  padding-left: .6em;
  text-transform: uppercase;
  color: var(--dim);
}

.kicker::before {
  content: "";
  display: block;
  width: 1px;
  height: 22px;
  margin: 0 auto 14px;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(var(--glow), .9), 0 0 20px rgba(var(--glow), .5);
}

/* ---------- Mitte: Play-Knopf ---------- */

.center {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}

.aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(150vmin, 1100px);
  height: min(150vmin, 1100px);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(var(--glow), .22), rgba(var(--glow), .07) 46%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.play {
  position: relative;
  z-index: 2;
  width: var(--btn);
  height: var(--btn);
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 calc(var(--btn) * .09) #000, 0 0 64px rgba(255, 255, 255, .14);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  touch-action: manipulation;
}

.play::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  animation: pulse 2.8s var(--ease) infinite;
  pointer-events: none;
}

.play:hover { transform: scale(1.04); box-shadow: 0 0 0 calc(var(--btn) * .09) #000, 0 0 80px rgba(255, 255, 255, .24); }
.play:active { transform: scale(.95); }
.play:focus-visible { outline: 2px solid var(--yellow); outline-offset: 7px; }

.ic { width: 40%; height: 40%; fill: currentColor; grid-area: 1 / 1; }
.ic-pause { display: none; }

.is-playing .ic-play { display: none; }
.is-playing .ic-pause { display: block; }
.is-playing .play::before,
.is-loading .play::before,
.is-error .play::before { animation: none; opacity: 0; }

.ring {
  position: absolute;
  inset: -22px;
  width: calc(100% + 44px);
  height: calc(100% + 44px);
  fill: none;
  stroke: var(--yellow);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 60 242;
  filter: drop-shadow(0 0 3px rgba(var(--glow), .9));
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.is-loading .ring { opacity: 1; animation: spin 1.1s linear infinite; }

.msg {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--btn) / 2 + 34px);
  transform: translateX(-50%);
  width: min(88vw, 420px);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--dim);
}

.msg[hidden] { display: none; }

.retry {
  display: block;
  margin: 10px auto 0;
  padding: 11px 22px;
  min-height: 44px;
  border: 1px solid rgba(var(--glow), .7);
  border-radius: 999px;
  color: var(--yellow);
  font-size: 13px;
  letter-spacing: .08em;
  box-shadow: 0 0 14px rgba(var(--glow), .25);
}

.retry:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------- Fuss: Titel und Fortschritt ---------- */

.bottom { text-align: center; padding-bottom: 4px; }

.title {
  font-size: clamp(18px, 4.6vw, 28px);
  font-weight: 300;
  letter-spacing: .46em;
  padding-left: .46em;
  text-transform: uppercase;
  line-height: 1.3;
  text-shadow: 0 0 18px #000, 0 0 6px #000;
}

.meter {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 10px auto 0;
}

.time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  color: var(--dim);
}

.time:first-child { text-align: right; }
.time:last-child { text-align: left; }

.seek {
  position: relative;
  height: 44px;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.seek::before,
.seek-buf,
.seek-fill {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
}

.seek::before { right: 0; background: var(--faint); }
.seek-buf { width: 0; background: rgba(255, 255, 255, .26); }

.seek-fill {
  width: 0;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(var(--glow), .85), 0 0 20px rgba(var(--glow), .45);
}

.seek-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(var(--glow), .95), 0 0 24px rgba(var(--glow), .5);
  transform: scale(.8);
  transition: transform .2s var(--ease);
}

.seek:hover .seek-fill::after,
.seek:focus-visible .seek-fill::after,
.seeking .seek-fill::after { transform: scale(1.5); }

.seek:focus-visible { outline: 1px dashed rgba(var(--glow), .6); outline-offset: 2px; border-radius: 4px; }

.noscript { position: fixed; left: 0; right: 0; bottom: 20%; z-index: 5; text-align: center; padding: 0 20px; }
.noscript p { margin-bottom: 14px; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; }
.noscript audio { width: min(420px, 90vw); }

/* ---------- Kleine Hoehen (Handy quer) ---------- */

@media (max-height: 480px) {
  :root { --btn: clamp(64px, 26vmin, 96px); }
  .kicker::before { height: 10px; margin-bottom: 8px; }
  .title { font-size: 15px; letter-spacing: .36em; }
  .meter { margin-top: 2px; }
  .seek { height: 38px; }
}

/* ---------- Bewegung ---------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { transform: scale(1); opacity: .7; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .frame { animation: none; }
  .play::before { animation: none; opacity: 0; }
  .play, .seek-fill::after { transition: none; }
}
