/* Karaoke Zabava — Stage Player (FULLSCREEN ONLY)
 * Čist fullscreen video prikaz + transition countdown.
 * Nema thumbnila, nema info panela — samo video i overlay.
 * URL: /karaoke-stage/?slug=event-slug
 */
:root {
  --kz-accent: #FFEA00;
  --kz-primary: #FF2D7D;
  --kz-secondary: #00D2FF;
  --kz-text: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--kz-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stageRoot {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

/* ============ CLEAN BLACK (no overlay, just black) ============ */
.kz-stage-clean-black {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  z-index: 0;
}

/* ============ FULLSCREEN VIDEO (playing) ============ */
.kz-stage-video-fullscreen {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000;
  overflow: hidden;
  z-index: 1;
}
.kz-stage-video-fullscreen iframe,
.kz-stage-video-fullscreen #stageYtPlayer {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  object-fit: cover;
  display: block;
  margin: 0;
  padding: 0;
  background: #000;
}
/* YouTube embed iframe forsiraj fullscreen */
.kz-stage-video-fullscreen iframe {
  inset: 0 !important;
  transform: none !important;
  min-width: 100% !important;
  min-height: 100% !important;
}

/* Audio mod: tamna pozadina sa thumbnom u centru */
.kz-stage-audio-fullscreen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a0d2e 0%, #060912 70%);
}
.kz-stage-audio-fullscreen .kz-stage-thumb {
  width: min(40vh, 40vw);
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1a0d2e, #0F1424) center/cover no-repeat;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ============ Overlay (top bar) ============ */
.kz-stage-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  pointer-events: none;
}
.kz-stage-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 45, 125, 0.15);
  color: var(--kz-primary);
  border: 1px solid rgba(255, 45, 125, 0.3);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.kz-stage-live-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--kz-primary);
  border-radius: 50%;
  animation: kzStageLivePulse 1.6s ease-in-out infinite;
}
@keyframes kzStageLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 125, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(255, 45, 125, 0); }
}
.kz-stage-event-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  text-align: center;
  flex: 1;
  padding: 0 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kz-stage-conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.kz-stage-conn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: kzStageLivePulse 2s ease-in-out infinite;
}
.kz-stage-conn.error .dot {
  background: #fca5a5;
  box-shadow: 0 0 8px rgba(252, 165, 165, 0.6);
}

/* ============ Song info overlay (dole-levo) ============ */
.kz-stage-songinfo {
  position: absolute;
  bottom: 32px;
  left: 32px;
  z-index: 10;
  max-width: 50%;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.5));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  pointer-events: none;
  animation: kzStageFadeIn 0.4s ease;
}
@keyframes kzStageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.kz-stage-songinfo-performer {
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--kz-accent);
  text-shadow: 0 0 20px rgba(255, 234, 0, 0.4);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kz-stage-songinfo-title {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.kz-stage-songinfo-artist {
  font-size: clamp(12px, 1.2vw, 15px);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  margin-top: 2px;
}

/* ============ TRANSITION (pauza) - fullscreen countdown ============ */
.kz-stage-transition-fullscreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: radial-gradient(ellipse at center, rgba(26, 13, 46, 0.4) 0%, rgba(6, 9, 18, 0.95) 70%);
  z-index: 5;
  animation: kzStageFadeIn 0.4s ease;
}
.kz-stage-transition-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.kz-stage-transition-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: var(--kz-primary);
  filter: blur(150px);
  opacity: 0.25;
  border-radius: 50%;
  top: -200px;
  left: -100px;
  animation: kzStageBlobRotate 30s linear infinite;
}
.kz-stage-transition-bg::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: var(--kz-secondary);
  filter: blur(180px);
  opacity: 0.2;
  border-radius: 50%;
  bottom: -250px;
  right: -150px;
  animation: kzStageBlobRotate 40s linear infinite reverse;
}
@keyframes kzStageBlobRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.kz-stage-transition-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  max-width: 100%;
}
.kz-stage-transition-label {
  font-size: clamp(13px, 1.5vw, 18px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 3px;
}
.kz-stage-transition-time {
  font-size: clamp(140px, 22vw, 280px);
  font-weight: 900;
  line-height: 0.9;
  color: var(--kz-accent);
  text-shadow: 0 0 100px rgba(255, 234, 0, 0.5);
  font-variant-numeric: tabular-nums;
  animation: kzStageTransitionPulse 1s ease-in-out infinite;
  letter-spacing: -0.02em;
}
@keyframes kzStageTransitionPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.92; }
}
.kz-stage-transition-next-card {
  margin-top: 8px;
  padding: 20px 36px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  min-width: 360px;
  max-width: 90vw;
}
.kz-stage-transition-next-label {
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kz-secondary);
  margin-bottom: 8px;
}
.kz-stage-transition-next-performer {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kz-accent);
  margin-bottom: 6px;
  text-shadow: 0 0 30px rgba(255, 234, 0, 0.3);
}
.kz-stage-transition-next-title {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.kz-stage-transition-next-artist {
  font-size: clamp(13px, 1.3vw, 17px);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}
.kz-stage-transition-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(13px, 1.4vw, 17px);
  font-style: italic;
  padding: 12px 0;
}

/* ============ Empty (red prazan) ============ */
.kz-stage-empty-fullscreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(ellipse at center, #1a0d2e 0%, #060912 70%);
  text-align: center;
  padding: 24px;
  z-index: 5;
}
.kz-stage-empty-fullscreen svg {
  width: clamp(70px, 9vw, 120px);
  height: clamp(70px, 9vw, 120px);
  color: rgba(255, 255, 255, 0.25);
  animation: kzStageFloat 3s ease-in-out infinite;
}
@keyframes kzStageFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.kz-stage-empty-fullscreen h2 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.3px;
}
.kz-stage-empty-fullscreen p {
  font-size: clamp(14px, 1.5vw, 18px);
  color: rgba(255, 255, 255, 0.5);
  max-width: 420px;
  line-height: 1.5;
}

/* ============ Finished ============ */
.kz-stage-finished-fullscreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, #1a0d2e 0%, #060912 70%);
  text-align: center;
  z-index: 5;
}
.kz-stage-finished-fullscreen h1 {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--kz-accent), var(--kz-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kz-stage-finished-fullscreen p {
  font-size: clamp(16px, 1.8vw, 22px);
  color: rgba(255, 255, 255, 0.6);
}

/* ============ F7: NEXT-UP PREVIEW (5s pre kraja pesme) ============ */
.kz-stage-nextup-preview {
  position: absolute;
  bottom: 80px;
  right: 32px;
  z-index: 12;
  max-width: 380px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255, 45, 125, 0.18), rgba(255, 234, 0, 0.12));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 45, 125, 0.4);
  border-radius: 18px;
  pointer-events: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 32px rgba(255, 45, 125, 0.25);
  animation: kzStageNextupFadeIn 0.4s ease;
  overflow: hidden;
}
.kz-stage-nextup-preview[hidden] { display: none; }
@keyframes kzStageNextupFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.kz-stage-nextup-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: rgba(255, 234, 0, 0.9);
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(255, 234, 0, 0.4);
}
.kz-stage-nextup-performer {
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kz-stage-nextup-title {
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kz-stage-nextup-artist {
  font-size: clamp(11px, 1.2vw, 14px);
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kz-stage-nextup-progress {
  height: 3px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 99px;
  overflow: hidden;
}
.kz-stage-nextup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF2D7D, #FFEA00);
  width: 0%;
  border-radius: 99px;
  transition: width 5s linear;
}
@media (max-width: 768px) {
  .kz-stage-nextup-preview {
    bottom: 70px;
    right: 18px;
    left: 18px;
    max-width: none;
    padding: 14px 18px;
  }
  .kz-stage-nextup-performer { font-size: 16px; }
  .kz-stage-nextup-title { font-size: 14px; }
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .kz-stage-topbar { padding: 16px 18px; }
  .kz-stage-event-title { display: none; }
  .kz-stage-songinfo { left: 18px; right: 18px; max-width: none; bottom: 18px; }
  .kz-stage-transition-next-card { min-width: 280px; padding: 16px 24px; }
  .kz-stage-transition-time { font-size: clamp(100px, 32vw, 200px); }
}

/* ============ F9: TRANSITION (admin.live overlay) ============ */
.kz-stage-transition{position:absolute;inset:0;background:radial-gradient(ellipse at center,#1a0d2e 0%,#060912 70%);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;animation:kzStageTransitionFadeIn 0.4s ease-out}
.kz-stage-transition-label{font-size:14px;font-weight:600;color:rgba(255,255,255,0.5);text-transform:uppercase;letter-spacing:4px;margin-bottom:8px}
.kz-stage-transition-time{font-family:'Inter',sans-serif;font-weight:900;font-size:clamp(120px,28vw,220px);line-height:1;color:rgba(255,255,255,0.92);text-shadow:0 0 60px rgba(255,45,125,0.45);animation:kzStageTransitionPulse 1s ease-in-out infinite;font-variant-numeric:tabular-nums}
.kz-stage-transition-total{font-size:13px;color:rgba(255,255,255,0.45);margin-top:-12px;margin-bottom:18px;font-weight:500}
.kz-stage-transition-bar{width:min(70%,380px);height:5px;background:rgba(255,255,255,0.08);border-radius:99px;overflow:hidden;margin-bottom:36px}
.kz-stage-transition-fill{height:100%;width:0%;background:linear-gradient(90deg,#FF2D7D,#00D2FF);border-radius:99px;transition:width 0.25s linear}
.kz-stage-transition-next{display:flex;align-items:center;gap:18px;background:rgba(0,0,0,0.4);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,0.12);border-radius:18px;padding:16px 24px;max-width:min(560px,90vw)}
.kz-stage-transition-thumb{width:64px;height:64px;border-radius:12px;background:#1a0d2e;background-size:cover;background-position:center;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:32px;color:rgba(255,255,255,0.6);box-shadow:0 4px 12px rgba(0,0,0,0.5)}
.kz-stage-transition-info{flex:1;min-width:0}
.kz-stage-transition-tag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:2px;color:#00D2FF;margin-bottom:6px}
.kz-stage-transition-name{font-size:18px;font-weight:800;color:#fff;line-height:1.2;margin-bottom:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kz-stage-transition-song{font-size:13px;color:rgba(255,255,255,0.7);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kz-stage-transition-song span{color:rgba(255,255,255,0.5)}
@keyframes kzStageTransitionFadeIn{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}
@keyframes kzStageTransitionPulse{0%,100%{opacity:1;text-shadow:0 0 60px rgba(255,45,125,0.45)}50%{opacity:0.85;text-shadow:0 0 30px rgba(255,45,125,0.3)}}
@media (max-width:768px){.kz-stage-transition-next{padding:12px 16px;gap:12px}.kz-stage-transition-thumb{width:48px;height:48px;font-size:24px}.kz-stage-transition-name{font-size:16px}.kz-stage-transition-song{font-size:12px}.kz-stage-transition-bar{width:84%;margin-bottom:24px}}
