/* LyricBingo V2 — TV venue display (board + fullscreen overlays) */

html:has(.v2-venue-tv),
body:has(.v2-venue-tv),
#lb-v2-root:has(.v2-venue-tv) {
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden !important;
  background: #05030b;
}

.v2-venue-tv {
  --tv-pad: clamp(14px, 1.6vw, 28px);
  --tv-gap: clamp(12px, 1.4vw, 24px);
  --tv-lime: #b8ff2b;
  --tv-pink: #ff2fd0;
  --tv-cyan: #18d9ff;
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 20% 15%, rgba(233, 28, 255, 0.2), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(21, 216, 255, 0.16), transparent 36%),
    linear-gradient(155deg, #06040f 0%, #100818 50%, #041018 100%);
}

/* ── Base board (between songs) ── */
.v2-venue-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--tv-gap);
  height: 100%;
  padding: var(--tv-pad);
  box-sizing: border-box;
}

.v2-tv-top {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(0, 2fr) auto;
  gap: var(--tv-gap);
  align-items: center;
}

.v2-tv-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.v2-tv-brand img {
  width: clamp(140px, 14vw, 220px);
  height: auto;
  display: block;
}
.v2-tv-brand small {
  color: #c4b8dc;
  font-size: clamp(11px, 0.9vw, 15px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-tv-room {
  text-align: center;
  padding: clamp(10px, 1vw, 16px) clamp(16px, 1.4vw, 24px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}
.v2-tv-room span {
  display: block;
  color: #b0a6c8;
  font-size: clamp(9px, 0.7vw, 11px);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.v2-tv-room strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(28px, 3.5vw, 52px);
  line-height: 1;
  color: var(--tv-lime);
  text-shadow: 0 0 24px rgba(184, 255, 43, 0.3);
}

.v2-tv-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 0.8vw, 14px);
  min-width: 0;
}
.v2-tv-stats > div {
  text-align: center;
  padding: clamp(10px, 1vw, 16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 10, 26, 0.7);
}
.v2-tv-stats span {
  display: block;
  color: #b0a6c8;
  font-size: clamp(9px, 0.7vw, 11px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.v2-tv-stats strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(20px, 2.2vw, 38px);
  line-height: 1;
}
.v2-tv-stats strong[data-display-players] {
  color: var(--tv-lime);
}

.v2-tv-fs-btn {
  white-space: nowrap;
  border-radius: 14px;
  padding: clamp(10px, 1vw, 14px) clamp(14px, 1.2vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(233, 37, 255, 0.9), rgba(21, 206, 255, 0.9));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.v2-tv-fs-msg {
  position: absolute;
  right: var(--tv-pad);
  bottom: calc(var(--tv-pad) - 4px);
  margin: 0;
  color: #f6b3ff;
  font-size: 11px;
  z-index: 25;
}

/* Main: QR + recap */
.v2-tv-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(0, 1.45fr);
  gap: var(--tv-gap);
  align-items: stretch;
}

.v2-tv-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vh, 14px);
  padding: clamp(14px, 1.4vw, 22px);
  border-radius: clamp(18px, 1.5vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 10, 26, 0.72);
  text-align: center;
}
.v2-tv-qr .v2-qr-frame {
  border-radius: 16px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 0 40px rgba(21, 206, 255, 0.28);
}
.v2-tv-qr .v2-qr-frame img {
  display: block;
  width: min(18vw, 22vh, 200px);
  aspect-ratio: 1;
}
.v2-tv-qr-label {
  margin: 0;
  font-weight: 900;
  font-size: clamp(13px, 1.1vw, 18px);
  color: #fff;
}
.v2-tv-qr-url {
  margin: 0;
  color: #c4b8dc;
  font-size: clamp(11px, 0.95vw, 15px);
  word-break: break-all;
  line-height: 1.2;
}

/* Last 5 songs — hero section */
.v2-tv-recap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vh, 18px);
  padding: clamp(16px, 1.6vw, 28px);
  border-radius: clamp(20px, 1.8vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 8, 22, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.v2-tv-recap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.v2-tv-recap-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 42px);
  line-height: 1;
  letter-spacing: 0.02em;
}
.v2-tv-recap-head p {
  margin: 0;
  color: var(--tv-lime);
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 800;
}
.v2-venue-tv.is-countdown .v2-tv-recap-head p {
  animation: v2TvPulse 1s ease-in-out infinite;
}

.v2-tv-recap-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vh, 14px);
  justify-content: center;
}

.v2-recap-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(12px, 1.2vw, 20px);
  align-items: center;
  padding: clamp(12px, 1.2vw, 20px) clamp(16px, 1.6vw, 28px);
  border-radius: clamp(14px, 1.2vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  animation: v2TvSlideIn 0.45s ease both;
}
.v2-recap-num {
  display: grid;
  place-items: center;
  width: clamp(36px, 3.5vw, 52px);
  height: clamp(36px, 3.5vw, 52px);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tv-pink), var(--tv-cyan));
  color: #fff;
  font-weight: 1000;
  font-size: clamp(16px, 1.6vw, 24px);
  flex-shrink: 0;
}
.v2-recap-card strong {
  display: block;
  font-size: clamp(22px, 2.6vw, 48px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.v2-recap-card em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: #c4b8dc;
  font-size: clamp(14px, 1.3vw, 24px);
  font-weight: 600;
}

.v2-recap-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #a89cbd;
  text-align: center;
}
.v2-recap-empty span {
  font-size: clamp(48px, 8vw, 96px);
  opacity: 0.5;
}
.v2-recap-empty p {
  margin: 0;
  font-size: clamp(18px, 2vw, 32px);
  font-weight: 800;
}

/* Footer sponsors */
.v2-tv-foot {
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.v2-venue-tv .v2-venue-sponsor-bar {
  flex: 1;
  max-width: 100%;
  padding: clamp(10px, 1vw, 16px) clamp(14px, 1.4vw, 24px);
  border-radius: clamp(16px, 1.3vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 8, 22, 0.8);
}
.v2-venue-tv .v2-show-sponsors-label span {
  font-size: clamp(10px, 0.8vw, 12px);
}
.v2-venue-tv .v2-show-sponsor {
  font-size: clamp(14px, 1.2vw, 20px);
}
.v2-venue-tv .v2-show-sponsor img {
  width: clamp(40px, 4vw, 64px);
  height: clamp(40px, 4vw, 64px);
}

/* ── Phase visibility (no flicker from hidden toggles) ── */
.v2-venue-tv .v2-venue-scrim {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.v2-venue-tv .v2-venue-overlay {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.2, 1.2, 0.2, 1), visibility 0.45s ease;
}
.v2-venue-tv.v2-phase-hints .v2-venue-scrim,
.v2-venue-tv.v2-phase-reveal .v2-venue-scrim {
  opacity: 1;
  visibility: visible;
}
.v2-venue-tv.v2-phase-hints .v2-venue-overlay--hints {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.v2-venue-tv.v2-phase-reveal .v2-venue-overlay--reveal {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Ambient sparks */
.v2-venue-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.v2-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--tv-lime);
  box-shadow: 0 0 16px var(--tv-lime);
  animation: v2TvSpark 4s ease-in-out infinite;
}
.v2-spark--1 { left: 12%; top: 20%; animation-delay: 0s; }
.v2-spark--2 { right: 18%; top: 30%; background: var(--tv-pink); box-shadow: 0 0 16px var(--tv-pink); animation-delay: -1.4s; }
.v2-spark--3 { left: 44%; bottom: 22%; background: var(--tv-cyan); box-shadow: 0 0 16px var(--tv-cyan); animation-delay: -2.6s; }

/* Sponsor dock — always visible at bottom */
.v2-tv-sponsor-dock {
  position: absolute;
  left: var(--tv-pad);
  right: var(--tv-pad);
  bottom: var(--tv-pad);
  z-index: 18;
  pointer-events: none;
}
.v2-tv-sponsor-dock .v2-venue-sponsor-bar,
.v2-tv-sponsor-dock .v2-sponsor-placeholder {
  animation: v2TvSponsorIn 0.6s ease both;
}
.v2-sponsor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: clamp(12px, 1.2vw, 18px);
  border-radius: clamp(16px, 1.3vw, 22px);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(10, 8, 22, 0.85);
  color: #a89cbd;
  font-size: clamp(13px, 1.1vw, 17px);
}
.v2-sponsor-placeholder span {
  color: var(--tv-lime);
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(10px, 0.85vw, 12px);
}
.v2-sponsor-placeholder em {
  font-style: normal;
  font-weight: 700;
}

/* Pad board so sponsor dock doesn't overlap recap */
.v2-venue-tv .v2-venue-board {
  padding-bottom: calc(var(--tv-pad) + clamp(72px, 9vh, 110px));
}

/* ── Dark scrim + overlays ── */
.v2-venue-scrim {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: rgba(4, 2, 10, 0.9);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.v2-venue-scrim[hidden] {
  display: block !important;
}

.v2-venue-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vh, 36px);
  padding: var(--tv-pad);
  padding-bottom: calc(var(--tv-pad) + clamp(80px, 10vh, 120px));
  text-align: center;
  pointer-events: none;
}
.v2-venue-overlay[hidden] {
  display: flex !important;
}

.v2-overlay-kicker {
  margin: 0;
  color: var(--tv-lime);
  font-size: clamp(14px, 1.2vw, 22px);
  font-weight: 1000;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* Hint bubbles — huge emojis */
.v2-venue-hints-pop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 40px);
  max-width: min(92vw, 1400px);
}
.v2-hint-bubble {
  display: grid;
  place-items: center;
  min-width: clamp(80px, 12vw, 180px);
  min-height: clamp(80px, 12vw, 180px);
  padding: clamp(12px, 1.5vw, 24px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 80px rgba(255, 47, 208, 0.35),
    0 0 0 0 rgba(184, 255, 43, 0.4),
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: clamp(56px, 10vw, 140px);
  line-height: 1;
  animation: v2TvHintPop 0.65s cubic-bezier(0.2, 1.5, 0.2, 1) both;
}
.v2-hint-bubble--new {
  animation: v2TvHintBurst 0.75s cubic-bezier(0.15, 1.6, 0.2, 1) both;
}
.v2-hint-bubble--wait {
  animation: v2TvPulse 1.2s ease-in-out infinite;
}

/* Song reveal */
.v2-venue-overlay--reveal .v2-reveal-title {
  margin: 0;
  max-width: min(92vw, 1200px);
  font-size: clamp(42px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow:
    0 0 60px rgba(255, 47, 208, 0.45),
    0 4px 0 rgba(0, 0, 0, 0.3);
  animation: v2TvRevealTitle 0.6s cubic-bezier(0.2, 1.3, 0.2, 1) both;
}
.v2-venue-overlay--reveal .v2-reveal-artist {
  margin: 0;
  max-width: min(80vw, 900px);
  color: #e8e0f8;
  font-size: clamp(22px, 3.2vw, 56px);
  font-weight: 700;
  animation: v2TvRevealArtist 0.6s 0.12s cubic-bezier(0.2, 1.2, 0.2, 1) both;
}

/* Player pop */
.v2-tv-stats .is-pop strong {
  animation: v2TvPop 0.55s ease;
  color: var(--tv-lime);
}

/* Validation burst stays on top */
.v2-venue-tv .v2-validation-display {
  z-index: 20;
}

/* Responsive */
@media (max-width: 900px) {
  .v2-tv-top {
    grid-template-columns: 1fr 1fr;
  }
  .v2-tv-stats {
    grid-column: 1 / -1;
  }
  .v2-tv-fs-btn {
    grid-column: 2;
    grid-row: 1;
  }
  .v2-tv-main {
    grid-template-columns: 1fr;
  }
  .v2-tv-qr {
    flex-direction: row;
    text-align: left;
  }
}

@media (max-height: 700px) {
  .v2-recap-card strong {
    font-size: clamp(18px, 2vw, 32px);
  }
  .v2-recap-card em {
    font-size: clamp(12px, 1vw, 18px);
  }
  .v2-hint-bubble {
    min-width: 64px;
    min-height: 64px;
    font-size: clamp(40px, 8vw, 80px);
  }
}

@keyframes v2TvScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes v2TvOverlayIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
.v2-venue-tv .v2-show-sponsor {
  animation: v2TvSponsorGlow 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes v2TvSpark {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); }
  20%, 80% { opacity: 1; transform: translateY(-30px) scale(1.2); }
}
@keyframes v2TvHintPop {
  from { opacity: 0; transform: scale(0.4) translateY(40px); }
  to { opacity: 1; transform: none; }
}
@keyframes v2TvHintBurst {
  0% { opacity: 0; transform: scale(0.2) rotate(-12deg); filter: blur(6px); }
  55% { opacity: 1; transform: scale(1.12) rotate(4deg); filter: blur(0); box-shadow: 0 0 100px rgba(184, 255, 43, 0.5), 0 24px 60px rgba(0,0,0,.45); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes v2TvSponsorIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes v2TvSponsorGlow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 rgba(184,255,43,0); transform: scale(1); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 32px rgba(184,255,43,.2); transform: scale(1.02); }
}
@keyframes v2TvRevealTitle {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes v2TvRevealArtist {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes v2TvSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes v2TvPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}
@keyframes v2TvPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .v2-venue-tv *,
  .v2-venue-scrim,
  .v2-venue-overlay {
    animation: none !important;
    transition: none !important;
  }
}
