@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&family=Oswald:wght@500;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=Chakra+Petch:wght@600;700;800&display=swap');

:root {
  --bg-dark: #07090e;
  --panel-bg: #0e121b;
  --card-bg: #141926;
  --border-color: #232c40;
  --primary: #ea580c;
  --primary-hover: #f97316;
  --accent-pink: #ec4899;
  --accent-blue: #0284c7;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --header-grad: linear-gradient(135deg, #ff007a 0%, #ff6600 50%, #ffaa00 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --shadow-glow: 0 0 25px rgba(234, 88, 12, 0.25);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism & UI Utilities */
.glass {
  background: rgba(14, 18, 27, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grad-text {
  background: var(--header-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-live {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.5s infinite;
}

.badge-offline {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-ws {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-ws::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

/* Painel de Controle Layout */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--header-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 122, 0.4);
}

.brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Master On-Air Switch */
.master-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  margin-bottom: 24px;
  gap: 16px;
}

.btn-onair {
  padding: 12px 28px;
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-onair.off {
  background: #202738;
  color: #94a3b8;
  border: 1px solid #334155;
}
.btn-onair.off:hover {
  background: #334155;
  color: #fff;
}

.btn-onair.live {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 25px rgba(220, 38, 38, 0.6);
  border: 1px solid #f87171;
  animation: pulse-onair 1.8s infinite;
}

@keyframes pulse-onair {
  0%, 100% { box-shadow: 0 0 25px rgba(220, 38, 38, 0.6); }
  50% { box-shadow: 0 0 40px rgba(220, 38, 38, 0.9); }
}

/* Botões Padrão */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: #ea580c;
  color: #ffffff;
}
.btn-primary:hover {
  background: #f97316;
  box-shadow: 0 0 16px rgba(234, 88, 12, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-accent {
  background: var(--header-grad);
  color: #000;
  font-weight: 900;
}
.btn-accent:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.btn-success {
  background: #059669;
  color: #fff;
}
.btn-success:hover { background: #10b981; }

.btn-danger {
  background: #b91c1c;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

/* Grid e Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f1f5f9;
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.3);
}

/* Mini Scoreboard Controller */
.teams-controller {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.team-box {
  background: #0b0f19;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.team-score-input {
  font-family: 'Oswald', sans-serif;
  font-size: 42px;
  font-weight: 900;
  width: 80px;
  text-align: center;
  background: #000;
  color: #fff;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  margin: 10px auto;
  display: block;
}

.score-stepper {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.btn-step {
  width: 36px;
  height: 36px;
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-step:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.vs-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #64748b;
}

/* Timer Control Box */
.timer-display {
  font-family: 'Chakra Petch', monospace;
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  background: #000;
  border: 1px solid #273549;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: #38bdf8;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

/* Mini Preview Iframe */
.preview-container {
  aspect-ratio: 16 / 9;
  background: repeating-conic-gradient(#1a202c 0% 25%, #111827 0% 50%) 50% / 20px 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid #232c40;
  position: relative;
}
.preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* Evita que controles e cartões disputem a mesma camada em telas estreitas. */
@media (max-width: 760px) {
  header.app-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  header.app-header > div:last-child { width: 100%; flex-wrap: wrap; }
  .master-bar { align-items: stretch; flex-direction: column; padding: 14px; }
  .master-bar > div { flex-wrap: wrap; }
  .card-header { align-items: flex-start; }
}

/* ========================================================= */
/* CSS DOS OVERLAYS TRANSMISSÃO (1920x1080 Full HD vMix/OBS) */
/* ========================================================= */

.broadcast-canvas {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  background: transparent !important;
  user-select: none;
}

/* Base Pack: Paulistão 2026 */
.pack-paulistao {
  --pk-bg: linear-gradient(90deg, #0d1644 0%, #150934 100%);
  --pk-accent: #ff007a;
  --pk-accent-glow: #ec4899;
  --pk-border: #ff007a;
  --pk-font: 'Oswald', sans-serif;
}

/* Base Pack: SporTV / Premiere */
.pack-sportv {
  --pk-bg: #091326;
  --pk-accent: #00b2e8;
  --pk-accent-glow: #38bdf8;
  --pk-border: #00b2e8;
  --pk-font: 'Montserrat', sans-serif;
}

/* Base Pack: Globo Broadcast */
.pack-globo {
  --pk-bg: #ffffff;
  --pk-text: #0f172a;
  --pk-accent: #ef4444;
  --pk-accent-glow: #dc2626;
  --pk-border: #e2e8f0;
  --pk-font: 'Montserrat', sans-serif;
}

/* Customizações de cada Pack */
.pack-globo .scorebug-league {
  background: #dc2626 !important;
  color: #fff !important;
  border-right: none !important;
}
.pack-globo .scorebug-team {
  background: #ffffff !important;
}
.pack-globo .scorebug-team .team-name {
  color: #0f172a !important;
}
.pack-globo .scorebug-team .fouls-badge {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #475569 !important;
}
.pack-globo .scorebug-score {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-left: 1px solid #cbd5e1 !important;
  border-right: 1px solid #cbd5e1 !important;
}
.pack-globo .scorebug-timer {
  background: #0f172a !important;
}

.pack-sportv .scorebug-league {
  background: #0284c7 !important;
  color: #fff !important;
  border-right: 2px solid #38bdf8 !important;
}
.pack-sportv .scorebug-team {
  background: #091326 !important;
}
.pack-sportv .scorebug-score {
  background: #030814 !important;
  border-left: 1px solid #1e293b !important;
  border-right: 1px solid #1e293b !important;
}

/* Scorebug Bar Futebol */
.scorebug-container {
  position: absolute;
  top: 40px;
  left: 60px;
  display: flex;
  align-items: stretch;
  /* reduzido para melhorar performance */
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  font-family: var(--pk-font, 'Oswald'), sans-serif;
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.scorebug-container.active {
  opacity: 1;
  transform: translateY(0);
}

.scorebug-league {
  background: #000;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-right: 2px solid var(--pk-accent, #ea580c);
}

.scorebug-team {
  display: flex;
  align-items: center;
  background: #0c111d;
  padding: 0 16px;
  gap: 12px;
  min-width: 130px;
}
.scorebug-team.home {
  border-left: 4px solid var(--home-color, #c51d24);
}
.scorebug-team.away {
  border-right: 4px solid var(--away-color, #1a1a1a);
}

.scorebug-team .team-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.scorebug-team .team-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.scorebug-score {
  background: #000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 28px;
  font-weight: 900;
  min-width: 70px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.scorebug-timer {
  background: var(--pk-bg, #111827);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 18px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  min-width: 90px;
}

.scorebug-timer .time-clock {
  font-family: 'Chakra Petch', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.scorebug-timer .time-period {
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 1px;
}

/* Gol Overlay Animado */
.goal-banner {
  position: absolute;
  top: 140px;
  left: 60px;
  background: linear-gradient(90deg, #ea580c 0%, #dc2626 100%);
  padding: 14px 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 40px rgba(234, 88, 12, 0.6);
  opacity: 0;
  transform: translateX(-100px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Oswald', sans-serif;
  color: #fff;
}
.goal-banner.active {
  opacity: 1;
  transform: translateX(0);
}
.goal-text {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  animation: pulse-goal 1s infinite alternate;
}
@keyframes pulse-goal {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Lower Third de Texto */
.lower-third-sports {
  position: absolute;
  bottom: 80px;
  left: 80px;
  background: rgba(10, 15, 26, 0.95);
  border-left: 6px solid var(--pk-accent, #ea580c);
  padding: 16px 30px;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.4s ease;
}
.lower-third-sports.active {
  opacity: 1;
  transform: translateY(0);
}
.lower-third-sports .lt-title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}
.lower-third-sports .lt-sub {
  font-size: 16px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 4px;
}

/* ========================================================= */
/* CSS ELEIÇÕES 2026 OVERLAY (Ticker, Cards e Vitória)       */
/* ========================================================= */

.election-ticker {
  position: absolute;
  bottom: 40px;
  left: 60px;
  right: 60px;
  height: 84px;
  background: rgba(11, 16, 29, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.election-ticker.active {
  opacity: 1;
  transform: translateY(0);
}

.election-brand-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  border-right: 2px solid #38bdf8;
  min-width: 170px;
}
.election-brand-badge .eb-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1px;
}
.election-brand-badge .eb-cargo {
  font-size: 11px;
  font-weight: 700;
  color: #bae6fd;
  text-transform: uppercase;
}

.election-urnas-progress {
  padding: 0 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 160px;
}
.election-urnas-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}
.election-urnas-value {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #38bdf8;
}

.election-candidates-strip {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 20px;
  gap: 28px;
  overflow-x: auto;
}

.candidate-strip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid var(--cand-color, #0284c7);
  padding-left: 10px;
}
.candidate-strip-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}
.candidate-strip-info .c-name {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}
.candidate-strip-info .c-meta {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.candidate-strip-percent {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  margin-left: 8px;
}

/* Top 2 Head to Head Card Lateral */
.election-top2-card {
  position: absolute;
  top: 140px;
  right: 80px;
  width: 440px;
  background: rgba(10, 15, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.election-top2-card.active {
  opacity: 1;
  transform: translateX(0);
}
.top2-header {
  background: linear-gradient(90deg, #1e3a8a 0%, #0369a1 100%);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}
.top2-header .t2-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}
.top2-candidate-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 16px;
}
.top2-candidate-row img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 2px solid var(--c-color, #0284c7);
}
.top2-c-details {
  flex: 1;
}
.top2-c-name {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}
.top2-c-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.top2-bar-wrapper {
  margin-top: 6px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.top2-bar-fill {
  height: 100%;
  background: var(--c-color, #0284c7);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.top2-c-score {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
}

/* Breaking News Urgente Banner */
.election-breaking {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  background: #b91c1c;
  color: #ffffff;
  padding: 16px 36px;
  border-radius: 12px;
  border: 2px solid #ef4444;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: all 0.45s ease;
  z-index: 100;
}
.election-breaking.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.breaking-tag {
  background: #000;
  color: #f87171;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.breaking-headline {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
}
