/* ── Broadcast popup — shared across all games ── */
/* Uses CSS var fallbacks so games don't need to define --font-led / --led-color */

/* ---- Broadcast footer button ---- */

.broadcast-footer {
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-broadcast {
  color: #e05555;
  text-decoration: none;
  font-size: 0.62rem;
  padding: 8px 20px;
  border: 1px solid rgba(224, 85, 85, 0.4);
  border-radius: 4px;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-led, 'Courier New', monospace);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(224, 85, 85, 0.07);
  box-shadow: 0 0 12px rgba(224, 85, 85, 0.12);
  cursor: pointer;
}

.btn-broadcast::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e05555;
  box-shadow: 0 0 6px #e05555;
  flex-shrink: 0;
  animation: onair-pulse 1.8s ease-in-out infinite;
}

@keyframes onair-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #e05555; }
  50%       { opacity: 0.2; box-shadow: none; }
}

.btn-broadcast:hover {
  color: #f07070;
  border-color: rgba(224, 85, 85, 0.7);
  background: rgba(224, 85, 85, 0.13);
  box-shadow: 0 0 18px rgba(224, 85, 85, 0.25);
}

/* ---- Popup overlay ---- */

.bsp-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bsp-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(3px);
}

.bsp-panel {
  position: relative;
  background: #080808;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  width: min(400px, 92vw);
  overflow: hidden;
  box-shadow:
    0 0 0 1px #050505,
    0 0 50px rgba(192, 57, 43, 0.08),
    0 32px 80px rgba(0, 0, 0, 0.92);
  animation: bsp-enter 0.18s ease-out;
}

@keyframes bsp-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bsp-rail {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #c0392b, rgba(192, 57, 43, 0.15));
  z-index: 2;
}

.bsp-texture {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 3px,
    rgba(0, 0, 0, 0.18) 3px, rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ---- Header ---- */

.bsp-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 12px 20px;
  border-bottom: 1px solid #161616;
  background: #050505;
}

.bsp-onair-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.bsp-onair-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0392b;
  box-shadow: 0 0 8px #c0392b, 0 0 20px rgba(192, 57, 43, 0.6);
  animation: bsp-onair 1.2s ease-in-out infinite;
}

@keyframes bsp-onair {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #c0392b, 0 0 20px rgba(192,57,43,0.6); }
  50%       { opacity: 0.12; box-shadow: none; }
}

.bsp-onair-label {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.38rem;
  letter-spacing: 0.2em;
  color: #c0392b;
}

.bsp-header-text { flex: 1; min-width: 0; }

.bsp-title {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: #c0392b;
  text-shadow: 0 0 12px rgba(192, 57, 43, 0.5);
  margin: 0;
}

.bsp-subtitle {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.44rem;
  letter-spacing: 0.1em;
  color: #2d2d2d;
  margin: 4px 0 0;
}

.bsp-close,
.bsp-minimize {
  background: none;
  border: 1px solid #222;
  color: #333;
  cursor: pointer;
  font-size: 0.8rem;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.bsp-close:hover    { color: #c0392b; border-color: rgba(192,57,43,0.4); }
.bsp-minimize:hover { color: var(--led-color, #ff9500); border-color: rgba(255,149,0,0.35); }

/* ---- Mini QR widget (visible when minimized) ---- */

.bsp-mini-widget {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 3500;
  background: #080808;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #050505, 0 8px 24px rgba(0,0,0,0.8), 0 0 20px rgba(192,57,43,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bsp-enter 0.15s ease-out;
}

.bsp-mini-qr {
  width: 128px;
  height: 128px;
  overflow: hidden;
  background: #f2f2f2;
  line-height: 0;
}

.bsp-mini-qr canvas {
  display: block !important;
  width: 128px !important;
  height: 128px !important;
  image-rendering: pixelated;
}

.bsp-mini-qr img { display: none !important; }

.bsp-mini-expand {
  width: 100%;
  background: #050505;
  border: none;
  border-top: 1px solid #161616;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.55rem;
  font-family: var(--font-led, 'Courier New', monospace);
  letter-spacing: 0.2em;
  padding: 5px 0 4px;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}
.bsp-mini-expand:hover { background: #0d0d0d; color: #e74c3c; }

/* ---- QR Section ---- */

.bsp-qr-section {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 20px 14px;
  gap: 12px;
}

.bsp-qr-frame {
  position: relative;
  padding: 14px;
  background: #f2f2f2;
  border-radius: 3px;
  line-height: 0;
}

.bsp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
}
.bsp-tl { top: -2px; left: -2px; border-top: 2px solid #c0392b; border-left: 2px solid #c0392b; }
.bsp-tr { top: -2px; right: -2px; border-top: 2px solid #c0392b; border-right: 2px solid #c0392b; }
.bsp-bl { bottom: -2px; left: -2px; border-bottom: 2px solid #c0392b; border-left: 2px solid #c0392b; }
.bsp-br { bottom: -2px; right: -2px; border-bottom: 2px solid #c0392b; border-right: 2px solid #c0392b; }

.bsp-qr-container {
  display: block;
  width: 160px;
  height: 160px;
  overflow: hidden;
  line-height: 0;
}

.bsp-qr-container canvas {
  display: block !important;
  width: 160px !important;
  height: 160px !important;
  image-rendering: pixelated;
}

.bsp-qr-container img { display: none !important; }

.bsp-qr-label {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.46rem;
  letter-spacing: 0.2em;
  color: #252525;
  margin: 0;
  text-transform: uppercase;
}

/* ---- URL Copy ---- */

.bsp-url-section {
  position: relative;
  z-index: 2;
  padding: 0 18px 18px;
}

.bsp-url-btn {
  width: 100%;
  background: #050505;
  border: 1px solid #222;
  border-radius: 3px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}
.bsp-url-btn:hover { border-color: var(--led-color, #ff9500); }
.bsp-url-btn.bsp-copied { border-color: #27ae60; }

.bsp-url-text {
  font-family: var(--font-digits, 'Courier New', monospace);
  font-size: 0.72rem;
  color: var(--led-color, #ff9500);
  text-shadow: 0 0 8px rgba(255, 149, 0, 0.45);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  transition: color 0.2s, text-shadow 0.2s;
}
.bsp-url-btn.bsp-copied .bsp-url-text {
  color: #27ae60;
  text-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.bsp-copy-badge {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.48rem;
  letter-spacing: 0.18em;
  color: #2d2d2d;
  border: 1px solid #222;
  padding: 3px 8px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.bsp-url-btn:hover .bsp-copy-badge { color: var(--led-color, #ff9500); border-color: rgba(255,149,0,0.35); }
.bsp-url-btn.bsp-copied .bsp-copy-badge { color: #27ae60; border-color: rgba(39,174,96,0.35); }

/* ---- Open TV view link ---- */

.bsp-open-tv-row {
  position: relative;
  z-index: 2;
  padding: 0 18px 14px;
  text-align: center;
}

.bsp-open-tv-link {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--led-color, #ff9500);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.bsp-open-tv-link:hover { opacity: 1; text-decoration: underline; }

/* ---- Send to TV row ---- */

.bsp-tv-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 14px;
  gap: 10px;
}

.bsp-tv-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-led, monospace);
}

.bsp-tv-btn {
  padding: 6px 16px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
  color: #4ade80;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.bsp-tv-btn:hover {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.6);
}

/* ---- Footer signal bars ---- */

.bsp-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  border-top: 1px solid #131313;
  background: #040404;
}

.bsp-signal { display: flex; align-items: flex-end; gap: 2px; }

.bsp-bar {
  width: 3px;
  height: var(--h, 8px);
  background: var(--led-color, #ff9500);
  opacity: 0.25;
  border-radius: 1px;
  animation: bsp-sig 1.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes bsp-sig {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.75; }
}

.bsp-footer-text {
  font-family: var(--font-led, 'Courier New', monospace);
  font-size: 0.4rem;
  letter-spacing: 0.14em;
  color: #1e1e1e;
  margin: 0;
  text-align: center;
}
