@import url('https://fonts.googleapis.com/css2?family=Anek+Devanagari:wght@400;500;600;700;800;900&family=Familjen+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --shade: #1c130d;
  --cream: #fffdf5;
  --sand: #e6dac8;
  --sand-dim: #bdae99;
  --bhojpuri-gold: #fbbf24;
  --bhojpuri-amber: #d97706;
}

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

body {
  background-color: var(--shade);
  color: var(--cream);
  font-family: 'Familjen Grotesk', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Backdrop Layer */
.saloon-backdrop-container {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
}

.saloon-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition: opacity 0.5s ease;
}

.saloon-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(28, 19, 13, 0.45) 0%, rgba(28, 19, 13, 0.8) 55%, rgba(28, 19, 13, 0.98) 100%);
}

.saloon-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 85% at 50% 40%, transparent 20%, rgba(28, 19, 13, 0.9) 100%);
  pointer-events: none;
}

.saloon-grain {
  position: absolute;
  inset: 0;
  background-image: repeating-radial-gradient(circle at 17% 33%, rgba(28, 19, 13, 0.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: soft-light;
  opacity: 0.5;
  background-size: 3px 3px;
  pointer-events: none;
}

/* Typography */
.font-display {
  font-family: 'Anek Devanagari', system-ui, sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism Classes */
.saloon-glass {
  background: rgba(36, 24, 16, 0.78);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 253, 245, 0.18);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.85);
}

.saloon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  background: rgba(28, 19, 13, 0.7);
  border: 1px solid rgba(255, 253, 245, 0.2);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.saloon-chip:hover, .saloon-chip.active {
  background: rgba(217, 119, 6, 0.4);
  border-color: rgba(251, 191, 36, 0.7);
  color: #fff;
  transform: translateY(-1px);
}

.saloon-icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 253, 245, 0.1);
  border: 1px solid rgba(255, 253, 245, 0.2);
  color: var(--cream);
  cursor: pointer;
  transition: all 0.18s ease;
}

.saloon-icon-btn:hover {
  background: rgba(255, 253, 245, 0.25);
  transform: scale(1.08);
  color: #fff;
}

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

.saloon-play-btn {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0f07;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(217, 119, 6, 0.7);
  transition: all 0.2s ease;
}

.saloon-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px -2px rgba(251, 191, 36, 0.9);
}

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

/* Custom Range Slider */
.saloon-range {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #fbbf24 0%, #fbbf24 var(--progress, 0%), rgba(255, 253, 245, 0.22) var(--progress, 0%), rgba(255, 253, 245, 0.22) 100%);
  border-radius: 9999px;
  height: 4px;
  cursor: pointer;
  outline: none;
}

.saloon-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fef08a;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.9);
  transition: transform 0.1s;
}

.saloon-range::-webkit-slider-thumb:hover {
  transform: scale(1.4);
}

/* Equalizer Wave Animation */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq-bar {
  width: 3px;
  background: #fbbf24;
  border-radius: 1px;
  animation: eq-anim 1s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { height: 50%; animation-delay: 0.4s; }

.paused .eq-bar {
  animation-play-state: paused;
  height: 25% !important;
}

@keyframes eq-anim {
  0% { height: 20%; }
  50% { height: 95%; }
  100% { height: 40%; }
}

/* Vinyl Spin */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-spin {
  animation: spin-slow 14s linear infinite;
}

.vinyl-paused {
  animation-play-state: paused;
}

/* Layout Utilities */
.container-max {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
}

.view-section {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-section.active-view {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Song row item */
.song-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(255, 253, 245, 0.08);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 0.5rem;
}

.song-row:hover {
  background: rgba(255, 253, 245, 0.08);
}

.song-row.is-current {
  background: rgba(217, 119, 6, 0.22);
  border-color: rgba(251, 191, 36, 0.4);
}

/* Card grids */
.rotation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.rotation-card {
  border-radius: 1.25rem;
  padding: 1.25rem;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 253, 245, 0.14);
  cursor: pointer;
}

.rotation-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 12px 30px -10px rgba(217, 119, 6, 0.35);
}

.rotation-card.active-rotation {
  border-color: #fbbf24;
  background: rgba(45, 28, 18, 0.9);
  box-shadow: 0 0 25px -5px rgba(251, 191, 36, 0.4);
}
