/* Overlay Base Styles — 1920x1080 transparent canvas */

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

@font-face {
  font-family: 'Vela Sans';
  src: url('/fonts/VelaSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vela Sans';
  src: url('/fonts/VelaSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vela Sans';
  src: url('/fonts/VelaSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: transparent;
  font-family: 'Vela Sans', 'Inter', sans-serif;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#overlay-root {
  position: relative;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}

/* Base overlay element — hidden by default */
.overlay-element {
  position: absolute;
  display: none;
  opacity: 0;
  will-change: transform, opacity;
}

.overlay-element.visible {
  display: block;
}

/* ============================
   Multi-channel overlay system
   ============================ */
.overlay-channel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  pointer-events: none;
  z-index: var(--channel-z, 1);
}

/* JSON title layers */
.json-title {
  position: absolute;
  pointer-events: none;
}

.title-layer {
  position: absolute;
  pointer-events: none;
}

.title-layer-text {
  white-space: pre-wrap;
  overflow: hidden;
}

.title-layer-rect {
  overflow: hidden;
}

.title-layer-image {
  overflow: hidden;
}

.title-layer-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.title-layer-group {
  position: relative;
}

/* CSS custom properties for team colors */
:root {
  --home-bg: #14162A;
  --home-text: #ffffff;
  --away-bg: #4B2FA3;
  --away-text: #ffffff;
  --accent: #4B2FA3;
  --overlay-bg: rgba(20, 22, 42, 0.85);
  --overlay-bg-solid: #14162A;
  --overlay-border: rgba(75, 47, 163, 0.4);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
}

/* Premium dark glass panel */
.overlay-panel {
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--overlay-border);
  border-radius: 8px;
}

/* Typography scale */
.text-score { font-size: 64px; font-weight: 700; line-height: 1; }
.text-team { font-size: 28px; font-weight: 600; line-height: 1.2; }
.text-player { font-size: 24px; font-weight: 500; line-height: 1.3; }
.text-timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.text-label { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.text-caption { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.text-title { font-size: 48px; font-weight: 700; line-height: 1.1; }
.text-subtitle { font-size: 20px; font-weight: 500; line-height: 1.3; }

/* Connection indicator — shown only during disconnect */
#connection-indicator {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: none;
  z-index: 9999;
}

#connection-indicator.disconnected {
  display: block;
  background: #ef4444;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================
   Sport-specific: Hockey
   ============================ */
body.sport-hockey {
  --accent: #1e88e5;
  --overlay-border: rgba(30, 136, 229, 0.4);
}

body.sport-hockey .overlay-panel {
  border-color: rgba(30, 136, 229, 0.35);
}

/* Lower third positioning */
.lower-third {
  position: absolute;
  bottom: 80px;
  left: 60px;
}

/* Fullscreen overlay positioning */
.fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  display: flex;
  align-items: center;
  justify-content: center;
}
