/* ===== 90s DJ SET — retro styling ===== */
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap");

:root {
  --neon-pink: #ff00c8;
  --neon-cyan: #00f0ff;
  --neon-lime: #c6ff00;
  --neon-purple: #9b00ff;
  --win-gray: #c0c0c0;
  --win-dark: #808080;
  --win-face: #d4d0c8;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "VT323", monospace;
  color: #fff;
  cursor: crosshair;
}

body {
  background:
    radial-gradient(circle at 50% 50%, #1a0030 0%, #000 80%),
    repeating-linear-gradient(0deg, rgba(255,0,200,.04) 0 2px, transparent 2px 4px);
}

/* ---- CRT overlays ---- */
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.25) 2px 3px);
  mix-blend-mode: multiply;
}
.crt-flicker {
  position: fixed; inset: 0; z-index: 51; pointer-events: none;
  background: rgba(18, 16, 16, 0.06);
  animation: flicker .12s infinite;
}
@keyframes flicker { 0%{opacity:.9} 50%{opacity:.78} 100%{opacity:.92} }

/* ---- Overall layout: hero crawl on top, video + player row at bottom ---- */
.layout {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  gap: 14px; padding: 14px;
}
.bottom-row {
  display: flex; gap: 14px;
  height: 42vh; min-height: 220px;
}

/* ---- Video stage ---- */
.stage-win {
  flex: 1 1 60%; min-width: 0;
  display: flex; flex-direction: column;
}
.stage-body { flex: 1; min-height: 0; padding: 0; }
.stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; }
#video {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.3) contrast(1.1) hue-rotate(-6deg);
}
/* grey curtain that fades out when the set starts, morphing grey -> video */
.video-fade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: #8a8a8a;
  opacity: 1;
  transition: opacity 2.2s ease-in-out;
}
.stage.playing .video-fade { opacity: 0; }
.video-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 180px 40px rgba(0,0,0,.8);
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(0,0,0,.4) 100%);
}

/* ---- "press play" onboarding hints (hidden once the set starts) ---- */
.start-hint {
  position: absolute; z-index: 30;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none; text-align: right;
  font-family: "Press Start 2P", monospace;
  text-shadow: 2px 2px 0 #000, 0 0 10px var(--neon-pink);
}
.video-hint {
  top: 50%; right: 14px; transform: translateY(-50%);
  color: var(--neon-cyan);
}
.crawl-hint {
  bottom: 10px; right: 12px;
  color: var(--neon-lime);
}
.hint-blink { font-size: 14px; animation: hintBlink 1s steps(2, start) infinite; }
.hint-arrow {
  font-size: 18px; color: var(--neon-pink); letter-spacing: -2px;
  animation: hintSlide 1.1s ease-in-out infinite;
}
.hint-sub { font-size: 9px; opacity: .85; }
@keyframes hintBlink { 50% { opacity: 0; } }
@keyframes hintSlide { 0%,100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.started .start-hint { display: none; }


.win {
  position: relative; z-index: 20;
  background: var(--win-face);
  border: 2px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: 3px 3px 0 #000, 0 0 24px rgba(0,240,255,.35);
  color: #000;
}
.win-title {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 6px;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 9px; letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
  user-select: none;
}
.win-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-dots { display: inline-flex; gap: 3px; }
.win-dots i { width: 7px; height: 7px; background: var(--neon-cyan); border: 1px solid #000; display: block; }
.win-btns { display: inline-flex; gap: 3px; }
.win-btns b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 14px;
  background: var(--win-face); color: #000;
  border: 1px solid #fff; border-right-color: #404040; border-bottom-color: #404040;
  font-family: monospace; font-weight: bold; font-size: 10px; cursor: pointer;
}
.win-btns b:active { border-color: #404040; border-right-color: #fff; border-bottom-color: #fff; }
.win-body { padding: 8px; }

/* ---- Vertical crawl window (HERO, top) ---- */
.crawl-win {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  box-shadow: 3px 3px 0 #000, 0 0 36px rgba(198,255,0,.35);
}
.crawl-win .win-body {
  flex: 1; min-height: 0; padding: 0;
  position: relative;
}
.crawl {
  position: relative; height: 100%; overflow: hidden;
  background: #000; border: 2px inset #808080;
  /* fade top & bottom edges */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.crawl-track {
  position: absolute; left: 0; right: 0; top: 0;
  padding: 0 6%;
  font-family: "VT323", monospace;
  font-size: clamp(32px, 4.4vw, 72px); line-height: 1.3;
  color: var(--neon-lime);
  text-shadow: 0 0 8px var(--neon-lime), 0 0 20px rgba(198,255,0,.6);
  text-align: center;
  will-change: transform;
}
.crawl-track .line { margin: 0 0 .4em; white-space: pre-wrap; word-break: break-word; }
.crawl-track .sep { color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink); }

/* ---- Music player window (bottom row, beside video) ---- */
.player-win {
  flex: 1 1 40%; min-width: 280px; max-width: 420px;
  display: flex; flex-direction: column;
}
.player-win .win-body { overflow-y: auto; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.player-screen {
  background: #06130a;
  border: 2px inset #0a3;
  padding: 8px; margin-bottom: 8px;
  position: relative; overflow: hidden;
}
.viz {
  display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-bottom: 6px;
}
.viz span {
  flex: 1; background: linear-gradient(to top, var(--neon-lime), var(--neon-cyan));
  height: 8%; align-self: flex-end;
  transition: height .08s linear;
}
.viz.playing span { animation: none; }
@keyframes bounce { 0%,100%{height:15%} 50%{height:95%} }

.track-name {
  font-size: 20px; color: var(--neon-cyan); white-space: nowrap; overflow: hidden;
  text-shadow: 0 0 6px rgba(0,240,255,.7);
}
.time-row { display: flex; justify-content: space-between; font-size: 16px; color: var(--neon-lime); }

/* sliders */
.seek, .vol {
  -webkit-appearance: none; appearance: none;
  height: 6px; background: #000; border: 1px solid #fff; outline: none;
}
.seek { width: 100%; margin-bottom: 8px; }
.seek::-webkit-slider-thumb, .vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 16px;
  background: var(--neon-pink); border: 1px solid #fff; cursor: pointer;
}
.seek::-moz-range-thumb, .vol::-moz-range-thumb {
  width: 12px; height: 16px; background: var(--neon-pink); border: 1px solid #fff; cursor: pointer;
}

.controls { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ctrl {
  background: var(--win-face); color: #000;
  border: 2px solid #fff; border-right-color: #404040; border-bottom-color: #404040;
  font-size: 14px; padding: 4px 8px; cursor: pointer; font-family: monospace;
}
.ctrl:active { border-color: #404040; border-right-color: #fff; border-bottom-color: #fff; }
.ctrl.play { background: var(--neon-lime); font-weight: bold; }
.ctrl.mini { padding: 1px 6px; font-size: 11px; }
.vol-wrap { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.vol { width: 70px; }
.vol-ico { font-size: 13px; }

.playlist {
  list-style: none; max-height: 150px; overflow-y: auto;
  background: #000; border: 2px inset #808080; padding: 2px;
}
.playlist li {
  font-size: 18px; color: var(--neon-cyan); padding: 2px 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.playlist li:hover { background: #10203a; }
.playlist li.active { background: var(--neon-pink); color: #000; text-shadow: none; }
.playlist li .num { color: var(--neon-lime); margin-right: 6px; }

/* pixel Brazilian flag at the bottom of the player */
.flag-wrap {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  margin-top: 8px;
  cursor: pointer;
}
.flag {
  width: 92px; height: auto; display: block;
  image-rendering: pixelated;
  border: 2px solid #fff;
  border-right-color: #404040; border-bottom-color: #404040;
  box-shadow: 2px 2px 0 #000, 0 0 8px rgba(0,151,57,.6);
  transition: transform .1s ease, box-shadow .1s ease;
}
.flag-wrap:hover .flag { box-shadow: 2px 2px 0 #000, 0 0 12px rgba(0,151,57,.9); }
.flag-wrap:active .flag { transform: translate(1px, 1px); }

/* collapsed state */
.player-win.collapsed .win-body { display: none; }
.collapsed-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; font-size: 18px; color: var(--neon-cyan);
}
.eq-mini { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq-mini i { width: 3px; background: var(--neon-lime); height: 40%; }
.eq-mini.playing i { animation: bounce .6s ease-in-out infinite; }
.eq-mini i:nth-child(2){ animation-delay:.2s } .eq-mini i:nth-child(3){ animation-delay:.35s }
#collapsedName { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* empty notes */
.empty-note {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 10; font-family: "Press Start 2P", monospace; font-size: 14px;
  color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink);
  animation: blink 1s step-start infinite;
}
.empty-note.small { position: static; transform: none; font-size: 10px; margin-top: 6px; text-align: center; }
@keyframes blink { 50% { opacity: 0; } }

.hidden { display: none !important; }

/* scrollbar retro */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--neon-purple); border: 1px solid #fff; }
