/* ──────────────────────────────────────────────────────────
   billboard.css – Times Square billboard display
   Layout: top bar (80px) / arena (flex) / queue bar (72px)
   ────────────────────────────────────────────────────────── */

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

html, body {
  overflow: hidden;
}

body {
  background: #0A0A0A;
  font-family: 'Inter', sans-serif;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
  cursor: none;
  color: #fff;
}

/* ─── Top bar ─────────────────────────────────────────── */
#top-bar {
  height: 80px;
  background: #0D0D0D;
  border-bottom: 3px solid #CC0000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
  z-index: 10;
}

#top-title {
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: 48px;
  letter-spacing: 4px;
  line-height: 1;
}

#title-line span { display: inline-block; margin: 0 6px; }

.title-bugs  { color: #A8C5D6; text-shadow: 2px 2px 0 #000; }
.title-vs    { color: #CC0000; text-shadow: 2px 2px 0 #FFD700, 0 0 12px rgba(255, 215, 0, 0.5); }
.title-daffy { color: #E8923A; text-shadow: 2px 2px 0 #000; }

#subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

#subtitle em { color: #E8923A; font-style: italic; font-weight: 700; }

#top-left, #top-right {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  color: #555;
  letter-spacing: 3px;
  min-width: 140px;
}

#top-right { text-align: right; }

/* ─── Arena ───────────────────────────────────────────── */
#arena {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.character-slot {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.bugs-slot  { background: linear-gradient(135deg, #0D1B2A 0%, #1B2E40 100%); }
.daffy-slot { background: linear-gradient(135deg, #0A0F0A 0%, #0F1A10 100%); }

/* Fallback art (visible when no video is loaded) */
.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.bugs-fallback  { background: radial-gradient(ellipse at center, #1a2f45 0%, #0D1B2A 100%); }
.daffy-fallback { background: radial-gradient(ellipse at center, #1a2d1a 0%, #0A0F0A 100%); }

.fallback-inner {
  text-align: center;
  color: white;
  animation: idlePulse 4s ease-in-out infinite;
}

@keyframes idlePulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%      { transform: scale(1.03); opacity: 1; }
}

.fallback-char-name {
  font-family: 'Bangers', cursive;
  font-size: 72px;
  letter-spacing: 6px;
  text-shadow: 3px 3px 0 #000;
}

.bugs-fallback  .fallback-char-name { color: #A8C5D6; }
.daffy-fallback .fallback-char-name { color: #E8923A; }

.fallback-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: #888;
  font-style: italic;
}

.fallback-icon {
  font-size: 80px;
  margin: 12px 0;
}

/* ─── Video layers (double-buffered idle + clip) ─────── */
.character-slot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

.character-slot .clip-vid { z-index: 3; }

.character-slot.idle-playing .idle-vid { opacity: 1; }
.character-slot.clip-playing .clip-vid { opacity: 1; }
.character-slot.clip-playing .idle-vid { opacity: 0; }

/* ─── Voter name overlay ──────────────────────────────── */
.name-overlay {
  position: absolute;
  z-index: 10;
  bottom: 28%;
  font-family: 'Bangers', cursive;
  font-size: 56px;
  letter-spacing: 2px;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 2px 2px 0 #000;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.65);
  padding: 8px 20px;
  border-radius: 40px;
  border: 3px solid #FFD700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.35);
  opacity: 0;
  transform: scale(0.5) translateY(30px);
}

.name-overlay:empty { display: none; }

#bugs-name-overlay  { left: 8%;  transform-origin: left bottom; }
#daffy-name-overlay { right: 8%; text-align: right; transform-origin: right bottom; }

.name-overlay.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.name-overlay.hide {
  opacity: 0;
  transform: scale(0.8) translateY(-20px);
  transition: all 0.4s ease-in;
}

/* ─── Vote count badges ───────────────────────────────── */
.vote-count-badge {
  position: absolute;
  top: 16px;
  z-index: 11;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid;
  border-radius: 8px;
  padding: 6px 16px;
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
}

.vote-count-badge span {
  font-size: 32px;
  margin-left: 8px;
  display: inline-block;
}

.bugs-badge  { left: 16px;  border-color: #A8C5D6; color: #A8C5D6; }
.daffy-badge { right: 16px; border-color: #E8923A; color: #E8923A; }

.vote-count-badge.pop span {
  animation: countPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Simulated clip (no video file) – energetic pulse */
.video-fallback.playing .fallback-inner {
  animation: clipPulse 0.5s ease-in-out infinite alternate;
}

@keyframes clipPulse {
  from { transform: scale(1);    filter: brightness(1); }
  to   { transform: scale(1.08); filter: brightness(1.3); }
}

/* ─── Center divider ──────────────────────────────────── */
#center-divider {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0D0D0D 0%, #111 100%);
  border-left: 3px solid #CC0000;
  border-right: 3px solid #CC0000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 16px 0;
  position: relative;
  z-index: 5;
}

#vs-container {
  position: relative;
  text-align: center;
}

#vs-text {
  position: relative;
  z-index: 1;
  font-family: 'Bangers', cursive;
  font-size: 96px;
  color: #CC0000;
  line-height: 1;
  text-shadow: 0 0 30px rgba(204, 0, 0, 0.7), 0 0 60px rgba(204, 0, 0, 0.4), 3px 3px 0 #FFD700;
  animation: vsGlow 2s ease-in-out infinite alternate;
}

#vs-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 0, 0, 0.35) 0%, transparent 70%);
  z-index: 0;
}

@keyframes vsGlow {
  from { text-shadow: 0 0 30px rgba(204, 0, 0, 0.7), 3px 3px 0 #FFD700; }
  to   { text-shadow: 0 0 50px rgba(204, 0, 0, 1), 0 0 80px rgba(255, 215, 0, 0.4), 3px 3px 0 #FFD700; }
}

#qr-section {
  text-align: center;
  padding: 12px;
}

#qr-label {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  color: #FFD700;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

#qr-image {
  width: 150px;
  height: 150px;
  border: 4px solid #FFD700;
  border-radius: 8px;
  background: white;
  display: block;
  margin: 0 auto;
}

#qr-url {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #555;
  margin-top: 6px;
  word-break: break-all;
  max-width: 180px;
  text-align: center;
}

#divider-top-accent,
#divider-bottom-accent {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #FFD700, transparent);
}

/* ─── Queue bar ───────────────────────────────────────── */
#queue-bar {
  height: 72px;
  background: rgba(0, 0, 0, 0.9);
  border-top: 3px solid #CC0000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

#queue-label {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: #CC0000;
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

#queue-items {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

#queue-items:empty { display: none; }

.queue-item {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: white;
  white-space: nowrap;
  border-left: 3px solid;
  animation: slideIn 0.3s ease;
  flex-shrink: 0;
}

.queue-item.bugs  { border-color: #A8C5D6; }
.queue-item.daffy { border-color: #E8923A; }
.queue-item.more  { border-color: #555; color: #888; font-style: italic; }

.q-num  { color: #888; font-size: 12px; }
.q-name { font-weight: 700; }

#queue-empty {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #444;
  font-style: italic;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Tease overlay ───────────────────────────────────── */
#tease-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.6s ease;
}

#tease-overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#tease-inner { text-align: center; }

#tease-title {
  font-family: 'Bangers', cursive;
  font-size: 80px;
  color: #FFD700;
  letter-spacing: 6px;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
  animation: pulseTease 1.5s ease-in-out infinite alternate;
}

@keyframes pulseTease {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

#tease-qr {
  width: 280px;
  height: 280px;
  margin: 24px auto;
  display: block;
  border: 8px solid #FFD700;
  border-radius: 12px;
  background: white;
}

#tease-cta {
  font-family: 'Bangers', cursive;
  font-size: 32px;
  color: white;
  letter-spacing: 4px;
}

/* ─── Demo hint ───────────────────────────────────────── */
#demo-hint {
  position: fixed;
  bottom: 80px;
  right: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 200;
  line-height: 2;
  white-space: pre;
}

/* ─── Smaller screens (laptop preview) ────────────────── */
@media (max-width: 1100px) {
  .fallback-char-name { font-size: 52px; }
  .name-overlay       { font-size: 40px; }
  #top-title          { font-size: 38px; }
  #top-left, #top-right { font-size: 18px; min-width: 100px; }
}
