/* ────────────────────────────────────────────────────────────────────────────
   Beifall.tv – style.css
   Dark, premium aesthetic. Full-viewport layouts.
──────────────────────────────────────────────────────────────────────────── */

/* ── Self-hosted Inter font ────────────────────────────────────────────────── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-300-normal.woff2') format('woff2'),
       url('/fonts/inter-latin-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-400-normal.woff2') format('woff2'),
       url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-500-normal.woff2') format('woff2'),
       url('/fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-600-normal.woff2') format('woff2'),
       url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-700-normal.woff2') format('woff2'),
       url('/fonts/inter-latin-700-normal.woff2') format('woff2');
}

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

:root {
  --bg: #0a0a0a;
  --surface: #111;
  --surface-2: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f0;
  --text-muted: rgba(255, 255, 255, 0.45);
  --accent: #e8b84b;
  --accent-dim: rgba(232, 184, 75, 0.15);
  --red: #e84b4b;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}

.hidden {
  display: none !important;
}

/* ── Start Screen ──────────────────────────────────────────────────────────── */

#start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#start-screen.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Subtle grid background */
.start-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

.start-content {
  position: relative;
  text-align: center;
  max-width: 560px;
  padding: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}


.logo h1 {
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.logo-dot {
  color: var(--accent);
}

.tagline {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.sub-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2.4rem;
  line-height: 1.5;
}

/* Clip stats — shown after playlist loads */
#clip-stats {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

/* Start Button */
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #111;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 2.2rem;
  border-radius: 100px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 0 0 0 rgba(232, 184, 75, 0.4);
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(232, 184, 75, 0.35);
}

.start-btn:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 0.95em;
}

/* Start footer */
.start-footer {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

.start-footer button {
  color: var(--text-muted);
  font-size: inherit;
  transition: color var(--transition);
}

.start-footer button:hover {
  color: var(--text);
}

.optv-link {
  color: var(--accent);
  font-weight: 500;
}

.footer-sep {
  opacity: 0.4;
}

/* ── Player Screen ─────────────────────────────────────────────────────────── */

#player-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 5;
}

.video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.video-el.active {
  opacity: 1;
}

/* Lower Third (TV Style) */
.lt-container {
  position: absolute;
  bottom: 8%;
  left: 5%;
  display: flex;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.lt-hidden {
  transform: translateX(-30px);
  opacity: 0;
}

.lt-accent-bar {
  width: 4px;
  background: var(--party-color, var(--accent));
  align-self: stretch;
  border-radius: 2px;
  margin-right: 12px;
  box-shadow: 0 0 15px color-mix(in srgb, var(--party-color, var(--accent)) 50%, transparent);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.lt-content {
  display: flex;
  flex-direction: column;
}

.lt-speaker {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.lt-meta {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin-top: 2px;
}

.lt-link {
  color: var(--accent);
  text-decoration: none;
  pointer-events: auto;
  margin-left: 8px;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.2s ease;
}

.lt-link:hover {
  border-bottom: 1px solid var(--accent);
}

/* Controls */
#controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 20;
  pointer-events: all;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Attribution bar */
#attr-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1.5rem;
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  z-index: 30;
  pointer-events: all;
}

#attr-bar a {
  color: rgba(255, 255, 255, 0.65);
}

#attr-bar a:hover {
  color: var(--accent);
}

#attr-bar button {
  color: rgba(255, 255, 255, 0.45);
  font-size: inherit;
  transition: color var(--transition);
}

#attr-bar button:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Loader */
.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  background: rgba(0, 0, 0, 0.4);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error */
#error-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  z-index: 30;
  text-align: center;
}

/* ── Modals ────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.2rem;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.modal h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.4rem 0 0.5rem;
}

.modal p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.modal a {
  color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Scrollbar for modal */
.modal::-webkit-scrollbar {
  width: 5px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .start-content {
    padding: 1.5rem;
  }

  /* Lower third: smaller text, clear of the attr-bar */
  .lt-container {
    left: 4%;
    bottom: calc(36px + 1.5rem);
  }

  .lt-speaker {
    font-size: 1.1rem;
  }

  .lt-meta {
    font-size: 0.78rem;
  }

  /* Larger tap targets for controls */
  .ctrl-btn {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  #controls {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Full-height modal on small screens */
  .modal {
    padding: 1.5rem 1.2rem;
    max-height: 92vh;
    border-radius: 12px;
  }

  #attr-bar {
    font-size: 0.68rem;
    padding: 0.4rem 1rem;
  }
}
