:root {
  --bg: #0b0c10;
  --panel: rgba(20, 22, 30, 0.78);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --stroke: rgba(255, 255, 255, 0.14);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  --radius: 16px;
  --radius-sm: 12px;

  --bar-height: 78px;
  --bar-max: 860px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --topbar-height: 64px;
}

* { box-sizing: border-box; }

@font-face {
  font-family: Helvetica; src: url('helvetica.woff');
}

body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--text);
  background: darkgreen;
  min-height: 95vh;
}

.page {
  width: min(var(--bar-max), 100%);
  max-width: 860px;
  /*max-width: 95%;*/
  /* margin: 0 auto; */
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  padding: 28px 18px 60px;
  /*gap: 12px;*/
  margin-top: 12px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 180px;
}

a {
  color: green;
}

div.content {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 95%;
}

.header-image {
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.2px;
}

.header p {
  margin: 0;
  color: var(--muted);
}

hr {
  color: var(--stroke);
  margin-top: 30px;
  margin-bottom: 30px;
}

.songs {
  /* display: grid; */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.song-btn {
  appearance: none;
  width: 360px;
  margin-top: 10px;;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.song-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
}

.song-btn:active {
  transform: translateY(0px);
}

/* ===== Floating Top Box ===== */

body {
  /* Make room so the fixed bar doesn’t cover your content */
  padding-top: calc(var(--topbar-height) + 12px);
}

.top-float {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 60; /* higher than .player-wrap (50) */
  padding: 12px 14px;

  pointer-events: none; /* so only the inner box catches clicks */
}

.top-float__inner {
  pointer-events: auto;

  width: min(var(--bar-max), 100%);
  margin-left: auto;
  margin-right: auto;

  height: var(--topbar-height);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);

  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);

  /* center everything */
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;
  text-align: center;
}

.top-float__left {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.top-float__sep {
  color: var(--muted);
}

.top-float__inner a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.top-float__inner a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.top-float__cta {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.top-float__cta:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Mobile */
@media (max-width: 620px) {
  :root { --topbar-height: 72px; }

  .top-float__inner {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
    gap: 8px;
  }

  body {
    padding-top: 96px; /* simple mobile-friendly spacing */
  }
}

/* ===== Player Bar ===== */

.player-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 14px calc(14px + var(--safe-bottom));
  pointer-events: none;
  z-index: 50;
}

.player {
  pointer-events: auto;
  width: min(var(--bar-max), 100%);
  margin: 0 auto;
  height: var(--bar-height);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);

  display: grid;
  grid-template-columns: 56px 1fr 140px;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;

  /* start off-screen */
  transform: translateY(calc(100% + 22px));
  opacity: 0;

  /* 1 second slide-in */
  transition: transform 1000ms ease, opacity 1000ms ease;
}

.player.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* Left: play/pause */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.icon-btn:active {
  transform: translateY(0px);
}

.icon {
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.92);
}

/* Middle: title + scrub */
.player-mid {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.track-title {
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.scrub {
  position: relative;
  height: 10px;
  display: grid;
  align-items: center;
}

.scrub input[type="range"] {
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.scrub input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.scrub input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.scrub input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  margin-top: -3px;
}

.scrub input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
}

.scrub .fill {
  position: absolute;
  left: 0;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  width: 0%;
}

/* Right: volume */
.player-right {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.vol-label {
  color: var(--muted);
  font-size: 12px;
}

.volume {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.volume .icon {
  width: 16px;
  height: 16px;
  fill: rgba(255, 255, 255, 0.72);
}

.volume input[type="range"] {
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.volume input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.volume input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.volume input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  margin-top: -3px;
}

.volume input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
}

@media (max-width: 620px) {
  :root { --topbar-height: 84px; }

  body {
    padding-top: calc(var(--topbar-height) + 12px);
  }

  .page {
    max-width: 93%;
  }

  .top-float__inner {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
    gap: 8px;
  }

  .player {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding: 12px;
  }

  .player-right {
    grid-column: 1 / -1;
    justify-items: stretch;
  }

  .song-btn {
    max-width: 93%;
  }
}

