:root {
  --yellow: #f5c518;
  --green: #1db954;
  --ink: #0c0b08;
  --white: #fffdf5;
  --card: rgba(12, 11, 8, 0.62);
  --stroke: rgba(255, 253, 245, 0.14);
  font-size: 16px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- background video ---------- */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  /* Push the footage back so it reads as ambient atmosphere, not a foreground video. */
  filter: brightness(0.5) saturate(0.9);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.6) 0%,
      rgba(0,0,0,0.4) 30%,
      rgba(0,0,0,0.4) 60%,
      rgba(0,0,0,0.72) 100%);
  pointer-events: none;
}

/* ---------- hidden YouTube engine ---------- */
#yt-holder {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
  z-index: 0;
}

/* ---------- tap gate ---------- */
#gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 2, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.6s ease, visibility 0.6s;
}

#gate.gone { opacity: 0; visibility: hidden; }

.gate-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 253, 245, 0.5);
}
.gate-credit a {
  color: rgba(255, 253, 245, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gate-credit a:hover { color: var(--yellow); }

.gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  /* Equal vertical rhythm between wordmark, button, and hint. */
  gap: 26px;
}

.gate-logo {
  font-family: "Teko", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}

.gate-logo .fm, .wordmark .fm { color: var(--yellow); }

/* Devanagari "रिक्शा" - bold condensed to sit next to Anton's FM. */
.rik {
  font-family: "Teko", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
}
.gate-logo, .wordmark { display: inline-flex; align-items: baseline; gap: 0.16em; }

.gate-sub {
  margin-top: 10px;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  line-height: 1.5;
  color: rgba(255, 253, 245, 0.85);
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}

#start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  border: none;
  border-radius: 999px;
  padding: 16px 34px;
  cursor: pointer;
  box-shadow: 0 8px 40px rgba(245, 197, 24, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#start-btn:hover { transform: scale(1.04); box-shadow: 0 10px 48px rgba(245, 197, 24, 0.5); }
#start-btn:active { transform: scale(0.97); }
.btn-glyph { display: inline-flex; align-items: center; }
.btn-glyph svg { display: block; }

.gate-hint {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 253, 245, 0.55);
}

/* ---------- chrome ---------- */
.chrome { position: fixed; z-index: 10; }

.top {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 22px 0 22px;
}

.wordmark {
  font-family: "Teko", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0,0,0,0.7);
}

.pills { display: flex; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--white);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s ease, transform 0.1s ease;
}

.pill:hover { background: rgba(30, 28, 20, 0.85); }
.pill:active { transform: scale(0.96); }

/* ---------- now playing ---------- */
#now-playing {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  /* Fixed width so the card never resizes/shifts when the song changes;
     long titles truncate with an ellipsis instead of widening the card. */
  width: min(540px, calc(100vw - 44px));
  animation: np-in 0.5s ease;
  overflow: hidden;
}

/* Seek bar pinned to the card's bottom edge. */
#np-seek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(255, 253, 245, 0.16);
  cursor: pointer;
  touch-action: none;
  transition: height 0.12s ease;
}
#now-playing:hover #np-seek { height: 8px; }
#np-seek-fill {
  height: 100%;
  width: 0%;
  background: var(--yellow);
  pointer-events: none;
}

@keyframes np-in {
  from { transform: translate(-50%, 16px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

#np-cover {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

.np-meta { min-width: 0; flex: 1; }

.np-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--yellow);
}

.np-label.paused { color: rgba(255,253,245,0.45); }

.np-title {
  margin-top: 3px;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  margin-top: 1px;
  font-size: 0.82rem;
  color: rgba(255, 253, 245, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.np-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.np-controls button:hover { background: rgba(255, 253, 245, 0.12); }
.np-controls button:active { transform: scale(0.92); }

#btn-play {
  width: 44px;
  height: 44px;
  background: var(--yellow);
  color: var(--ink);
}

#btn-play:hover { background: #ffd23d; }

/* ---------- eq meter ---------- */
.bottom-right {
  right: 22px;
  bottom: max(26px, env(safe-area-inset-bottom));
}

.meter { display: flex; align-items: flex-end; gap: 3px; height: 18px; }

.meter i {
  width: 4px;
  border-radius: 2px;
  background: var(--yellow);
  opacity: 0.9;
  animation: eq 1s ease-in-out infinite;
  height: 30%;
}

.meter i:nth-child(1) { animation-delay: 0s; }
.meter i:nth-child(2) { animation-delay: 0.25s; }
.meter i:nth-child(3) { animation-delay: 0.5s; }
.meter i:nth-child(4) { animation-delay: 0.12s; }

.meter.paused i { animation-play-state: paused; height: 20%; }

@keyframes eq {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .top { padding-left: 16px; padding-right: 16px; }
  .pill span { display: none; }
  .pill { padding: 9px; }
  #now-playing {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    /* Pinned full-width on mobile - cancel the desktop centering transform. */
    transform: none;
    animation: np-in-mobile 0.5s ease;
  }
  .bottom-right { display: none; }
}

@keyframes np-in-mobile {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
