/* Naacho Yaar — styles */

:root {
  --brown-warm: #5A1B10;
  --brown-dark: #200906;
  --cream: #FFE9D6;
  --white: #FFFFFF;
  --muted: rgba(255, 235, 220, 0.72);
  --online-color: #4ADE80;

  --red-accent: #FF4D2E;
  --orange-accent: #FF9142;
  --glow: rgba(255, 90, 46, 0.55);

  --player-bg: rgba(60, 18, 12, 0.42);
  --player-border: rgba(255, 200, 160, 0.25);

  --radius-lg: 999px;
  --radius-panel: 30px;
  --radius-md: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  background: var(--brown-dark);
  color: var(--white);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

/* ============ SCENE / BACKGROUND ============ */

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background-image: url('assets/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      120% 70% at 50% 30%,
      rgba(255, 77, 46, 0.16) 0%,
      rgba(20, 6, 4, 0) 60%
    ),
    linear-gradient(
      to bottom,
      rgba(20, 5, 3, 0.6) 0%,
      rgba(30, 8, 5, 0.22) 24%,
      rgba(25, 6, 4, 0.4) 58%,
      rgba(12, 3, 2, 0.85) 100%
    );
  pointer-events: none;
}

/* ============ TOP BAR ============ */

.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 22px 28px;
}

.topbar-left {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-center {
  text-align: center;
}

.topbar-right {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
}

.clock {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.about-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  opacity: 0.8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.about-link:hover,
.about-link:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.online-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--online-color);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.online-dot.offline {
  background: #8a8a8a;
  animation: none;
  box-shadow: none;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.online-label {
  font-size: 19px;
  font-weight: 600;
  color: var(--muted);
}

.music-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  opacity: 0.92;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.music-link:hover,
.music-link:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.music-link-icon {
  width: 16px;
  height: 16px;
}

.ext-icon {
  font-size: 12px;
  opacity: 0.85;
}

.fullscreen-btn {
  width: 42px;
  height: 42px;
  color: var(--white);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 200, 160, 0.22);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.fullscreen-btn:hover {
  opacity: 1;
  background: rgba(255, 145, 66, 0.22);
}

/* ============ BRANDING ============ */

.brand {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 62vh;
  padding: 0 20px;
}

.brand-title {
  margin: 0;
  font-family: 'Yatra One', cursive;
  color: var(--cream);
  line-height: 0.98;
  text-shadow:
    0 4px 30px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(0, 0, 0, 0.3),
    0 0 46px var(--glow);
  animation: brand-fade-in 1.1s var(--ease) both;
  letter-spacing: 1px;
}

.brand-line {
  display: block;
  font-size: clamp(56px, 13vw, 168px);
}

@keyframes brand-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ============ HIDDEN YOUTUBE CONTAINER ============ */

.yt-hidden-container {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

/* ============ MUSIC PLAYER ============ */

.player {
  position: fixed;
  left: 50%;
  bottom: 10vh;
  transform: translateX(-50%);
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 14px;

  width: min(660px, 92vw);
  min-height: 100px;
  padding: 14px 24px 14px 14px;

  background:
    linear-gradient(155deg, rgba(255, 210, 180, 0.16) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(20deg, rgba(255, 90, 46, 0.10), rgba(255, 145, 66, 0.04)),
    var(--player-bg);
  background-blend-mode: overlay, screen, normal;

  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);

  border: 1px solid var(--player-border);
  border-radius: var(--radius-lg);

  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 50px -14px var(--glow),
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 -18px 40px rgba(0, 0, 0, 0.18) inset;

  isolation: isolate;

  animation: player-in 0.8s 0.15s var(--ease) both;
}

.player::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    155deg,
    rgba(255, 220, 190, 0.4),
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0) 70%,
    rgba(255, 145, 66, 0.2)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

@keyframes player-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.playlist-toggle {
  flex-shrink: 0;
}

.album-art-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(255, 210, 180, 0.4);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.4),
    0 0 0 3px rgba(255, 90, 46, 0.18);
  transition: box-shadow 0.35s var(--ease);
}

.album-art-wrap.spinning {
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(255, 90, 46, 0.55),
    0 0 34px 2px var(--glow);
}

/* YouTube playlist thumbnails are often a square image padded with
   black letterbox/pillarbox bars to fit the 480x360 (4:3) file. This
   layer zooms in just enough to crop those bars out so the circular
   art shows only the actual cover, no borders. Kept as a separate
   element from .album-art so it doesn't fight the rotate animation. */
.album-art-zoom {
  width: 100%;
  height: 100%;
  transform: scale(1.36);
  transform-origin: 50% 50%;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  animation: vinyl-spin 7s linear infinite;
  animation-play-state: paused;
}

.album-art.fade {
  opacity: 0;
  transform: scale(0.94);
}

.album-art.spinning {
  animation-play-state: running;
}

.album-art-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--brown-dark);
  border: 1px solid rgba(255, 210, 180, 0.5);
  pointer-events: none;
  z-index: 1;
}

@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.track-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 32px;
}

#time-duration {
  text-align: right;
}

.progress-bar {
  position: relative;
  flex: 1;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 220, 200, 0.22);
}

.progress-fill {
  position: absolute;
  left: 0;
  height: 3px;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red-accent), var(--orange-accent));
}

.progress-handle {
  position: absolute;
  left: 0%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 8px rgba(255, 145, 66, 0.5);
  transform: translateX(-50%);
  transition: transform 0.15s var(--ease);
}

.progress-bar:hover .progress-handle,
.progress-bar:focus-visible .progress-handle {
  transform: translateX(-50%) scale(1.2);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease), transform 0.15s var(--ease), background 0.2s var(--ease);
}

.icon-btn:hover {
  opacity: 1;
  background: rgba(255, 145, 66, 0.14);
}

.icon-btn:active {
  transform: scale(0.9);
}

.shuffle-btn.active {
  color: var(--orange-accent);
  opacity: 1;
  background: rgba(255, 145, 66, 0.16);
}

.icon-btn:focus-visible,
.play-btn:focus-visible,
.progress-bar:focus-visible {
  outline: 2px solid var(--orange-accent);
  outline-offset: 2px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(155deg, var(--orange-accent), var(--red-accent));
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 77, 46, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(255, 77, 46, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.play-btn:active {
  transform: scale(0.92);
}

/* nudge play icon so it looks visually centered */
#icon-play {
  margin-left: 2px;
}

.player-status {
  position: fixed;
  left: 50%;
  bottom: calc(10vh - 26px);
  transform: translateX(-50%);
  z-index: 9;
  font-size: 12px;
  color: var(--muted);
  background: rgba(35, 10, 6, 0.55);
  backdrop-filter: blur(10px);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ============ PLAYLIST PANEL ============ */

.playlist-panel {
  position: fixed;
  left: 50%;
  bottom: calc(10vh + 118px);
  transform: translateX(-50%) translateY(12px);
  z-index: 11;

  width: min(660px, 92vw);
  max-height: 46vh;

  background:
    linear-gradient(155deg, rgba(255, 210, 180, 0.12) 0%, rgba(255, 255, 255, 0) 30%),
    var(--player-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--player-border);
  border-radius: var(--radius-panel);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 40px -16px var(--glow),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.playlist-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.playlist-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.playlist-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: var(--white);
  transition: background 0.18s var(--ease);
}

.playlist-item:hover {
  background: rgba(255, 145, 66, 0.12);
}

.playlist-item.active {
  background: rgba(255, 90, 46, 0.2);
}

.playlist-item-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.playlist-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.36);
  transform-origin: 50% 50%;
}

.playlist-item-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.playlist-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-artist {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-indicator {
  margin-left: auto;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange-accent);
  opacity: 0;
}

.playlist-item.active .playlist-item-indicator {
  opacity: 1;
}

/* scrollbar */
.playlist-list::-webkit-scrollbar {
  width: 6px;
}

.playlist-list::-webkit-scrollbar-thumb {
  background: rgba(255, 145, 66, 0.35);
  border-radius: 6px;
}

/* ============ ABOUT PAGE ============ */

.about-page {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88vh;
  padding: 40px 20px;
}

.about-card {
  width: min(620px, 100%);
  background:
    linear-gradient(155deg, rgba(255, 210, 180, 0.12) 0%, rgba(255, 255, 255, 0) 30%),
    var(--player-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--player-border);
  border-radius: var(--radius-panel);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 40px -16px var(--glow),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
  padding: 40px clamp(24px, 5vw, 48px);
  color: var(--white);
}

.about-title {
  font-family: 'Yatra One', cursive;
  font-size: clamp(40px, 7vw, 64px);
  margin: 0 0 6px;
  color: var(--cream);
  text-shadow: 0 0 30px var(--glow);
}

.about-tagline {
  margin: 0 0 24px;
  font-weight: 600;
  color: var(--muted);
}

.about-card p {
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.about-card h2 {
  font-size: 18px;
  margin: 28px 0 10px;
  color: var(--cream);
}

.about-card a {
  color: var(--orange-accent);
}

.about-back {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--white);
  transition: transform 0.2s var(--ease);
}

.about-back:hover {
  transform: translateX(3px);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 720px) {
  .topbar {
    padding: 16px 16px;
  }

  .topbar-right {
    gap: 10px;
  }

  .music-link span:not(.ext-icon) {
    display: none;
  }

  .music-link {
    gap: 2px;
  }

  .brand {
    min-height: 56vh;
  }

  .player {
    bottom: 4vh;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 22px;
    flex-wrap: wrap;
  }

  .album-art-wrap {
    width: 52px;
    height: 52px;
  }

  .player-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
  }

  .player-info {
    order: 2;
  }

  .playlist-panel {
    bottom: calc(4vh + 150px);
    max-height: 40vh;
  }

  .player-status {
    bottom: calc(4vh - 24px);
  }
}

@media (max-width: 380px) {
  .brand-line {
    font-size: clamp(52px, 16vw, 84px);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .brand-title,
  .player,
  .online-dot {
    animation: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
