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

/* ================= SCENE ================= */
.scene {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #171018;
}

.scene .sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 78% 18%, rgba(244,163,0,0.55) 0%, rgba(244,163,0,0.15) 35%, transparent 60%),
    linear-gradient(180deg, #211527 0%, #3a2130 38%, #6b3a2e 62%, #a85a35 78%, #3a2130 100%);
}

.stars {
  position: absolute;
  inset: 0 0 55% 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 25% 45%, #fff6, transparent),
    radial-gradient(1px 1px at 40% 15%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 60% 30%, #fff5, transparent),
    radial-gradient(1px 1px at 75% 12%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 90% 40%, #fff6, transparent),
    radial-gradient(1px 1px at 15% 60%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 50% 55%, #fff6, transparent);
  opacity: 0.8;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to   { opacity: 0.95; }
}

.hills {
  position: absolute;
  left: -8%;
  right: -8%;
  height: 22vh;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hills-back {
  bottom: 16vh;
  background: #241827;
  opacity: 0.85;
}

.hills-front {
  bottom: 12vh;
  height: 16vh;
  background: #1a1017;
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12vh;
  background: linear-gradient(180deg, #100a10 0%, #050305 100%);
  border-top: 2px solid #3a2a35;
}

.scenery {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7vh;
  height: 160px;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20900%20220%22%20width%3D%22900%22%20height%3D%22220%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%22900%22%20height%3D%22220%22%20fill%3D%22none%22%2F%3E%20%3C!--%20left%20forest%20cluster%20--%3E%20%3Cg%20fill%3D%22%2316261c%22%3E%20%3Cellipse%20cx%3D%2245%22%20cy%3D%22204%22%20rx%3D%2216%22%20ry%3D%227%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%2241%22%20y%3D%22168%22%20width%3D%228%22%20height%3D%2230%22%20fill%3D%22%23241a17%22%2F%3E%20%3Cpolygon%20points%3D%2217%2C168%2073%2C168%2045%2C120%22%2F%3E%20%3Cpolygon%20points%3D%2223%2C146%2067%2C146%2045%2C102%22%2F%3E%20%3Cpolygon%20points%3D%2229%2C126%2061%2C126%2045%2C86%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%2316261c%22%3E%20%3Cellipse%20cx%3D%22105%22%20cy%3D%22207%22%20rx%3D%2214%22%20ry%3D%226%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%22101%22%20y%3D%22176%22%20width%3D%227%22%20height%3D%2226%22%20fill%3D%22%23241a17%22%2F%3E%20%3Cpolygon%20points%3D%2280%2C176%20130%2C176%20105%2C132%22%2F%3E%20%3Cpolygon%20points%3D%2285%2C156%20125%2C156%20105%2C116%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%231c2f22%22%3E%20%3Cellipse%20cx%3D%22165%22%20cy%3D%22205%22%20rx%3D%2215%22%20ry%3D%226%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%22161%22%20y%3D%22170%22%20width%3D%228%22%20height%3D%2228%22%20fill%3D%22%232a1e19%22%2F%3E%20%3Cpolygon%20points%3D%22139%2C170%20191%2C170%20165%2C124%22%2F%3E%20%3Cpolygon%20points%3D%22145%2C150%20185%2C150%20165%2C108%22%2F%3E%20%3Cpolygon%20points%3D%22151%2C130%20179%2C130%20165%2C94%22%2F%3E%20%3C%2Fg%3E%20%3C!--%20station%20--%3E%20%3Cg%3E%20%3Crect%20x%3D%22330%22%20y%3D%22185%22%20width%3D%22240%22%20height%3D%2215%22%20fill%3D%22%233a2a35%22%2F%3E%20%3Crect%20x%3D%22330%22%20y%3D%22183%22%20width%3D%22240%22%20height%3D%223%22%20fill%3D%22%23f4a300%22%20opacity%3D%220.85%22%2F%3E%20%3Crect%20x%3D%22322%22%20y%3D%22132%22%20width%3D%22256%22%20height%3D%228%22%20fill%3D%22%23241827%22%2F%3E%20%3Crect%20x%3D%22336%22%20y%3D%22140%22%20width%3D%227%22%20height%3D%2248%22%20fill%3D%22%23241827%22%2F%3E%20%3Crect%20x%3D%22557%22%20y%3D%22140%22%20width%3D%227%22%20height%3D%2248%22%20fill%3D%22%23241827%22%2F%3E%20%3Crect%20x%3D%22390%22%20y%3D%2292%22%20width%3D%22120%22%20height%3D%2248%22%20fill%3D%22%23241827%22%2F%3E%20%3Cpolygon%20points%3D%22378%2C92%20522%2C92%20505%2C68%20395%2C68%22%20fill%3D%22%23180e16%22%2F%3E%20%3Ccircle%20cx%3D%22450%22%20cy%3D%22114%22%20r%3D%2210%22%20fill%3D%22%2312202c%22%20stroke%3D%22%23ffcf6b%22%20stroke-width%3D%221.6%22%2F%3E%20%3Cline%20x1%3D%22450%22%20y1%3D%22114%22%20x2%3D%22450%22%20y2%3D%22107%22%20stroke%3D%22%23ffcf6b%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%2F%3E%20%3Cline%20x1%3D%22450%22%20y1%3D%22114%22%20x2%3D%22455%22%20y2%3D%22116%22%20stroke%3D%22%23ffcf6b%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%2F%3E%20%3Cline%20x1%3D%22334%22%20y1%3D%2296%22%20x2%3D%22334%22%20y2%3D%22140%22%20stroke%3D%22%233a2a35%22%20stroke-width%3D%224%22%2F%3E%20%3Ccircle%20cx%3D%22334%22%20cy%3D%2290%22%20r%3D%2215%22%20fill%3D%22%23ffd98a%22%20opacity%3D%220.22%22%2F%3E%20%3Ccircle%20cx%3D%22334%22%20cy%3D%2290%22%20r%3D%226%22%20fill%3D%22%23ffd98a%22%2F%3E%20%3Cline%20x1%3D%22566%22%20y1%3D%2296%22%20x2%3D%22566%22%20y2%3D%22140%22%20stroke%3D%22%233a2a35%22%20stroke-width%3D%224%22%2F%3E%20%3Ccircle%20cx%3D%22566%22%20cy%3D%2290%22%20r%3D%2215%22%20fill%3D%22%23ffd98a%22%20opacity%3D%220.22%22%2F%3E%20%3Ccircle%20cx%3D%22566%22%20cy%3D%2290%22%20r%3D%226%22%20fill%3D%22%23ffd98a%22%2F%3E%20%3C%2Fg%3E%20%3C!--%20right%20forest%20cluster%20--%3E%20%3Cg%20fill%3D%22%231c2f22%22%3E%20%3Cellipse%20cx%3D%22735%22%20cy%3D%22205%22%20rx%3D%2215%22%20ry%3D%226%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%22731%22%20y%3D%22170%22%20width%3D%228%22%20height%3D%2228%22%20fill%3D%22%232a1e19%22%2F%3E%20%3Cpolygon%20points%3D%22709%2C170%20761%2C170%20735%2C124%22%2F%3E%20%3Cpolygon%20points%3D%22715%2C150%20755%2C150%20735%2C108%22%2F%3E%20%3Cpolygon%20points%3D%22721%2C130%20749%2C130%20735%2C94%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%2316261c%22%3E%20%3Cellipse%20cx%3D%22800%22%20cy%3D%22207%22%20rx%3D%2214%22%20ry%3D%226%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%22796%22%20y%3D%22176%22%20width%3D%227%22%20height%3D%2226%22%20fill%3D%22%23241a17%22%2F%3E%20%3Cpolygon%20points%3D%22775%2C176%20825%2C176%20800%2C132%22%2F%3E%20%3Cpolygon%20points%3D%22780%2C156%20820%2C156%20800%2C116%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%2316261c%22%3E%20%3Cellipse%20cx%3D%22860%22%20cy%3D%22204%22%20rx%3D%2216%22%20ry%3D%227%22%20opacity%3D%220.7%22%2F%3E%20%3Crect%20x%3D%22856%22%20y%3D%22168%22%20width%3D%228%22%20height%3D%2230%22%20fill%3D%22%23241a17%22%2F%3E%20%3Cpolygon%20points%3D%22832%2C168%20888%2C168%20860%2C120%22%2F%3E%20%3Cpolygon%20points%3D%22838%2C146%20882%2C146%20860%2C102%22%2F%3E%20%3Cpolygon%20points%3D%22844%2C126%20876%2C126%20860%2C86%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E");
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 620px auto;
  opacity: 0.95;
}

.scene.playing .scenery {
  animation: sceneryScroll 12s linear infinite;
}

@keyframes sceneryScroll {
  from { background-position-x: 0; }
  to   { background-position-x: -620px; }
}

.ground-rails {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5.5vh;
  height: 6px;
  background-image: linear-gradient(90deg, #5a4a55 0 16px, transparent 16px 34px);
  background-size: 34px 6px;
  background-repeat: repeat-x;
  opacity: 0.8;
}

.scene.playing .ground-rails {
  animation: railsScroll 0.5s linear infinite;
}

@keyframes railsScroll {
  from { background-position-x: 0; }
  to   { background-position-x: -34px; }
}

/* ================= HERO TOP ================= */
.hero-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 44px);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hero-brand-name {
  margin: 0;
  font-family: var(--font-hi);
  font-weight: 700;
  font-size: 0.95rem;
}

.hero-route {
  margin: 1px 0 0;
  font-size: 0.68rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hero-stats {
  text-align: right;
}

.hero-clock {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.hero-clock #clockSec {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 2px;
}

.hero-aboard {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.hero-aboard .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ================= HERO CENTER ================= */
.hero-center {
  position: absolute;
  top: 16%;
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  padding: 0 16px;
}

.kicker {
  margin: 0 0 26px;
  font-size: 0.72rem;
  letter-spacing: 4px;
  color: var(--amber-soft);
  text-transform: uppercase;
  font-family: var(--font-en);
  font-weight: 600;
}

.hero-title {
  margin: 0;
  font-family: var(--font-hi);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: 0.98;
  letter-spacing: -1px;
  color: var(--text);
  text-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.hero-subtitle {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
  font-family: var(--font-hi);
  font-size: 0.85rem;
  letter-spacing: 2px;
}

.hero-subtitle .line {
  width: 34px;
  height: 1px;
  background: var(--card-border);
}

.horn-chip {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(20,14,20,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 8px 18px 8px 14px;
  cursor: pointer;
  color: var(--text);
}

.horn-chip:hover {
  border-color: var(--amber);
}

.horn-icon {
  font-size: 1.1rem;
}

.horn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.horn-text strong {
  font-family: var(--font-hi);
  font-size: 0.82rem;
  font-weight: 600;
}

.horn-text em {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

/* ================= TRAIN ================= */
.train-wrap {
  position: absolute;
  left: 50%;
  bottom: 10vh;
  width: min(1100px, 94vw);
  transform: translateX(-50%);
  z-index: 3;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,0.45));
  animation: trainBob 2.6s ease-in-out infinite;
  animation-play-state: paused;
}

.scene.playing .train-wrap {
  animation-play-state: running;
}

@keyframes trainBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-5px); }
}

.train-svg {
  width: 100%;
  height: auto;
  display: block;
  transform: scaleX(-1);
}

.train-svg .wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: wheelSpin 0.7s linear infinite;
  animation-play-state: paused;
}

.scene.playing .train-svg .wheel {
  animation-play-state: running;
}

@keyframes wheelSpin {
  to { transform: rotate(360deg); }
}

.train-svg .puff {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: puffRise 2.4s ease-out infinite;
  animation-play-state: paused;
}

.scene.playing .train-svg .puff {
  animation-play-state: running;
}

.train-svg .puff-2 { animation-delay: 0.6s; }
.train-svg .puff-3 { animation-delay: 1.2s; }

@keyframes puffRise {
  0%   { transform: translateY(0) scale(0.5); opacity: 0; }
  20%  { opacity: 0.7; }
  100% { transform: translateY(-46px) scale(1.6); opacity: 0; }
}

/* ================= DOCK (player bar + shortcuts) ================= */
.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 10;
  width: min(760px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.player-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(38,24,20,0.85), rgba(16,10,12,0.85));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.pb-art {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
}

.pb-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.pb-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-artist {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}

.pb-time {
  font-size: 0.65rem;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 26px;
}

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

.pb-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-btn:hover {
  background: rgba(255,255,255,0.08);
}

.pb-btn.active {
  color: var(--amber);
}

.pb-play {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #1a1200;
  font-size: 1.05rem;
}

.pb-play:hover {
  background: var(--amber-soft);
}

.pb-volume {
  display: none;
  align-items: center;
}

@media (min-width: 640px) {
  .pb-volume {
    display: flex;
  }
  .pb-volume input[type="range"] {
    width: 60px;
    accent-color: var(--amber);
  }
}

@media (max-width: 639px) {
  .pb-artist { display: none; }
  .pb-title { font-size: 0.78rem; }
}

.shortcuts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-hi);
}

.key-chip {
  background: rgba(20,14,18,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.key-chip b {
  color: var(--amber-soft);
  font-family: var(--font-en);
  margin-right: 4px;
}

@media (max-width: 639px) {
  .shortcuts-row { display: none; }
}

/* ================= QUEUE PANEL ================= */
.queue-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,3,5,0.6);
  z-index: 19;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.queue-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.queue-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: var(--card);
  border-left: 1px solid var(--card-border);
  z-index: 20;
  padding: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.queue-panel.open {
  transform: translateX(0);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.queue-header h2 {
  margin: 0;
  font-family: var(--font-hi);
  font-size: 1.05rem;
}

.queue-close {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.queue-close:hover {
  color: var(--red);
  border-color: var(--red);
}

.queue-panel .playlist {
  max-height: none;
}

.queue-panel .admin-link {
  display: block;
  text-align: center;
  margin-top: 18px;
}
