:root{
  --bg:#050505;
  --panel:rgba(255,255,255,0.06);
  --text:#fff;
  --muted:rgba(255,255,255,0.7);
  --green:#1db954;
  --red:#ff3b30;
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  height:100%;
  overflow:hidden;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.hidden{ display:none !important; }

/* ===== Screens ===== */
.screen{
  height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:20px;
}

/* ===== Start ===== */
.brand{
  display:flex;
  gap:14px;
  align-items:center;
  padding:14px 20px;
  background:var(--panel);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:16px;
  backdrop-filter:blur(10px);
}
.brand__logo{
  width:44px;height:44px;
  border-radius:12px;
  display:flex;
  justify-content:center;
  align-items:center;
  font-weight:900;
  background:linear-gradient(135deg,#1db954,#ff3b30);
}
.brand__title{ font-size:26px; font-weight:900; }
.brand__subtitle{ font-size:14px; color:var(--muted); margin-top:2px; }

.btn-primary{
  padding:16px 28px;
  border-radius:14px;
  border:none;
  font-size:18px;
  font-weight:900;
  background:var(--green);
  color:#07110b;
  cursor:pointer;
}

/* ===== Player layout ===== */
#playerScreen{
  position:fixed;
  inset:0;
  padding:0;
  justify-content:flex-start;
  align-items:stretch;
}

.topbar{
  height:58px;
  display:flex;
  align-items:center;
  padding:0 16px;
  background:rgba(0,0,0,0.18);
border-bottom:1px solid rgba(255,255,255,0.06);
backdrop-filter:blur(4px);

  position:absolute;
  top:0;
  left:0;
  right:0;
  z-index:80;
  pointer-events:none;

}
.topbar__left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.pill{
  background:rgba(255,59,48,0.20);
  border:1px solid rgba(255,59,48,0.45);
  padding:4px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
}
.topbar__title{
  font-size:14px;
  opacity:.9;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Stage */
.stage{
  position:absolute;
  inset:0;
  background:#000;
  overflow:hidden;
}

/* YouTube host */
#player{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:#000;
}
#player iframe{
  position:absolute;
  inset:0;
  width:100% !important;
  height:100% !important;
  display:block !important;
  background:#000 !important;
}

/* Curtain: döljer “blink” tills PLAYING */
.curtain{
  position:absolute;
  inset:0;
  background:#000;
  z-index:55;
}
.curtain.hidden{ display:none !important; }

/* Loading overlay */
.loading{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  background:rgba(0,0,0,0.55);
  z-index:50;
}
.loading.hidden{ display:none !important; }

.spinner{
  width:40px;height:40px;
  border-radius:50%;
  border:4px solid rgba(255,255,255,0.2);
  border-top-color:#fff;
  animation:spin 1s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* Intro/Jingle overlay */
#mcOverlay{
  position:fixed;
  inset:0;
  background:#000;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
}
#mcOverlay.hidden{ display:none !important; }
#mcOverlayVideo{
  width:100vw;
  height:100vh;
  object-fit:contain;
}

/* Mouse shield – blockerar hover-UI på desktop */
.mouseShield{
  position:absolute;
  inset:0;
  z-index:40;
  background:transparent;
  pointer-events:auto;
}

/* På touch-enheter: stäng av shield så det inte stör */
@media (hover: none) and (pointer: coarse) {
  .mouseShield{ pointer-events:none; }
}

/* iOS Tap overlay */
.tapOverlay{
  position:absolute;
  inset:0;
  z-index:60;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.35);
  backdrop-filter:blur(2px);
}
.tapOverlay.hidden{ display:none !important; }
.tapBtn{
  padding:16px 22px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.2);
  background:rgba(0,0,0,0.6);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

/* Lower third */
.lowerThird{
  position:absolute;
  left:18px;
  bottom:18px;
  z-index:45;
  background:rgba(0,0,0,0.60);
  border:1px solid rgba(255,255,255,0.14);
  backdrop-filter:blur(10px);
  border-radius:14px;
  padding:12px 14px;
  max-width:min(720px, 88vw);
  transform:translateY(12px);
  opacity:0;
  transition:opacity .25s ease, transform .25s ease;
}
.lowerThird.show{ opacity:1; transform:translateY(0); }
.lowerThird.hidden{ display:none !important; }
.lowerThird__channel{ font-size:12px; font-weight:900; opacity:.75; margin-bottom:4px; }

.lowerThird__title{
  font-size:16px;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* iPhone: 2 rader + safe-area */
@supports (padding: env(safe-area-inset-bottom)) {
  .lowerThird{ bottom: calc(28px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 520px) {
  .lowerThird__title{
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    line-height:1.2;
    max-height: calc(1.2em * 2);
  }
}
