:root {
  --color-sand: #e8dcc8;
  --color-cream: #f4ebd8;
  --color-shade: #2b1a12;
  --color-live: #ff3333;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-shade);
  color: var(--color-sand);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Anek Devanagari', sans-serif;
}

/* Background Layers */
.bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1s ease-in-out;
}

.saloon-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
}

.saloon-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  opacity: 0.15;
  mix-blend-mode: overlay;
}

@keyframes ken-burns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-2%, -1%); }
}

.animate-ken-burns {
  animation: ken-burns 40s ease-in-out infinite alternate;
}

/* Layout */
.app-layout {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.est-text {
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.live-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.pulse-indicator {
  position: relative;
  display: flex;
  width: 0.5rem;
  height: 0.5rem;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--color-live);
  opacity: 0.7;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-dot {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--color-live);
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.opacity-70 { opacity: 0.7; }

/* Odometer */
.odometer {
  display: flex;
  gap: 2px;
  background-color: #111;
  padding: 3px;
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.2);
  border: 1px solid #333;
}
.digit {
  width: 16px;
  height: 22px;
  background: linear-gradient(to bottom, #222 0%, #111 40%, #000 50%, #111 60%, #222 100%);
  color: #fff;
  font-family: monospace;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.digit-val {
  position: absolute;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.digit-val.roll-up {
  animation: rollUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.digit-val.roll-down {
  animation: rollDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rollUp {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes rollDown {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.listener-info {
  display: flex;
  flex-direction: column;
  font-size: 0.6rem;
  line-height: 1.2;
}
.listener-city {
  color: var(--color-live);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chips */
.saloon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: var(--color-cream);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.saloon-chip:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.desktop-only { display: none; }
@media (min-width: 640px) { .desktop-only { display: inline; } }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15vh;
  text-align: center;
  padding-inline: 1rem;
}

.title {
  font-family: 'Anek Devanagari', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-cream);
  line-height: 1;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
@media (min-width: 640px) { .title { font-size: 6rem; } }
@media (min-width: 768px) { .title { font-size: 8rem; } }

.block { display: block; }

.subtitle {
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--color-cream);
  opacity: 0.8;
  text-transform: uppercase;
}

.spacer { flex: 1; }

/* Stations */
.stations-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem 1rem;
}

.stations-title {
  font-family: monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.stations-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.station-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background-color: rgba(30, 20, 15, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-cream);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.station-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.station-btn.active {
  background-color: var(--color-cream);
  color: var(--color-shade);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- NEW 90S FEATURES --- */

/* 1. VHS Overlay */
.vhs-effect {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 3px 100%;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
  animation: flicker 0.15s infinite;
}
.vhs-effect.hidden {
  display: none;
}
@keyframes flicker {
  0% { opacity: 0.95; }
  50% { opacity: 0.9; }
  100% { opacity: 0.95; }
}
body.vhs-on {
  text-shadow: 2px 0 red, -2px 0 blue;
}

/* 2. Tape Flip */
.tape-flip {
  animation: flip-anim 1s ease-in-out;
}
@keyframes flip-anim {
  0% { transform: perspective(1000px) rotateX(0deg); opacity: 1; }
  50% { transform: perspective(1000px) rotateX(90deg); opacity: 0.2; }
  100% { transform: perspective(1000px) rotateX(0deg); opacity: 1; }
}

/* 3. Dialogues */
.dialogue-container {
  max-width: 32rem;
  margin: 2rem auto;
  text-align: center;
  font-family: 'Anek Devanagari', serif;
  font-size: 1.25rem;
  font-style: italic;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  padding: 0 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.dialogue-container.show {
  opacity: 0.9;
}

/* 4. Visualizer */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-right: 0.5rem;
}
.visualizer .bar {
  width: 3px;
  height: 2px;
  background-color: var(--color-live);
  transition: height 0.1s ease;
}
.visualizer.playing .bar {
  animation: bounce 0.5s infinite alternate ease-in-out;
}
.visualizer.playing .bar:nth-child(1) { animation-duration: 0.4s; }
.visualizer.playing .bar:nth-child(2) { animation-duration: 0.6s; }
.visualizer.playing .bar:nth-child(3) { animation-duration: 0.5s; }
.visualizer.playing .bar:nth-child(4) { animation-duration: 0.7s; }

@keyframes bounce {
  0% { height: 2px; }
  100% { height: 12px; }
}

/* 5. Dedication Ticker */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background-color: rgba(20, 10, 5, 0.9);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  white-space: nowrap;
  z-index: 50;
}
.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-anim 25s linear infinite;
}
.ticker-item {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--color-sand);
  padding: 0 2rem;
  text-transform: uppercase;
}
@keyframes ticker-anim {
  0% { transform: translate3d(100vw, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Footer */
.footer {
  border-top: 1px solid rgba(244, 235, 216, 0.1);
  background-color: rgba(43, 26, 18, 0.8);
  padding: 2rem 2rem 10rem 2rem;
  backdrop-filter: blur(12px);
}

.footer-content {
  max-width: 48rem;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--color-cream);
  color: var(--color-shade);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-family: 'Anek Devanagari', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-cream);
}

.brand-tag {
  font-family: monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.7;
}

.footer-desc {
  margin-top: 1.5rem;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-bottom {
  margin-top: 3rem;
  font-size: 0.75rem;
  opacity: 0.5;
}
.copyright {
  margin-top: 0.5rem;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6rem;
}

/* Player Bar */
.player-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2rem;
  z-index: 40;
  padding: 1rem;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
@media (min-width: 640px) { .player-wrapper { padding: 2rem; } }

.player-container {
  width: 100%;
  max-width: 36rem;
  pointer-events: auto;
}

.saloon-glass {
  background-color: rgba(30, 20, 15, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
}

.album-art {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  background-color: rgba(244, 235, 216, 0.2);
  flex-shrink: 0;
}
.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.track-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-cream);
}

.track-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  opacity: 0.7;
}

.progress-wrapper {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.saloon-range {
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  height: 4px;
  width: 100%;
  cursor: pointer;
}

.saloon-range::-webkit-slider-runnable-track {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--color-cream) var(--progress), transparent var(--progress));
}
.saloon-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
}

.live-badge {
  font-family: monospace;
  font-size: 0.6rem;
  opacity: 0.6;
  flex-shrink: 0;
}

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

.saloon-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-cream);
  cursor: pointer;
  transition: background-color 0.2s;
}
.saloon-icon-btn:hover { background-color: rgba(255, 255, 255, 0.1); }

.saloon-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background-color: var(--color-cream);
  color: var(--color-shade);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.saloon-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
