/* ==========================================================================
   CazeTV Player – Premium Glassmorphism Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font: 'Outfit', sans-serif;
  
  /* Color Palette - Cyber Dark & Neon */
  --bg: #05060f;
  --bg-gradient: linear-gradient(135deg, #05060f 0%, #0b0c1e 100%);
  --surface: rgba(15, 17, 35, 0.45);
  --surface-hover: rgba(23, 26, 52, 0.6);
  --surface-solid: #0d0f22;
  --border: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(139, 92, 246, 0.2);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  
  /* Accents */
  --accent-primary: #ff0055;
  --accent-primary-rgb: 255, 0, 85;
  --accent-secondary: #8b5cf6;
  --accent-secondary-rgb: 139, 92, 246;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-green-rgb: 16, 185, 129;
  
  /* Properties */
  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 30px rgba(139, 92, 246, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-gradient: linear-gradient(135deg, #f4f6fa 0%, #e9ecf3 100%);
  --surface: rgba(255, 255, 255, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(139, 92, 246, 0.15);
  --text: #0f172a;
  --text-muted: #64748b;
  --shadow-premium: 0 20px 40px rgba(15, 23, 42, 0.06);
  --shadow-neon: 0 0 25px rgba(139, 92, 246, 0.08);
}

/* ── Reset & Globals ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Dynamic Ambient Blobs ── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: blobFloat 12s ease-in-out infinite alternate;
}

.blob1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.blob2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  bottom: 10%;
  right: -100px;
  animation-delay: 4s;
}

.blob3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: 8s;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); opacity: 0.12; }
  100% { transform: translate(30px, -40px) scale(1.1); opacity: 0.22; }
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  background: rgba(5, 6, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.75rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(255, 0, 85, 0.4));
}

.logo-text span {
  background: linear-gradient(135deg, #fff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text .accent {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #ff4b82 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glowing Live Badge */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 12px 4px 9px;
  border-radius: 100px;
  text-transform: uppercase;
  transition: var(--transition);
}

.live-badge.online {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quality-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 100px;
  box-shadow: 0 6px 20px rgba(255, 0, 85, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Main Layout ── */
main {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── Player Card ── */
.player-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-premium), var(--shadow-neon);
  margin-bottom: 2.5rem;
  transition: var(--transition);
}

.player-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: var(--shadow-premium), 0 0 40px rgba(139, 92, 246, 0.2);
}

/* Contêiner de vídeo 16:9 extremamente rigoroso */
.player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  overflow: hidden;
}

/* CRITICAL FIX: Garante que o elemento de vídeo caiba perfeitamente no contêiner */
.player-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  background: #000;
  z-index: 2;
  border: none;
  outline: none;
}

/* Estados do Player (Loading / Error overlays) */
.player-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #070814 0%, #0d0e22 100%);
  z-index: 10;
  transition: var(--transition);
}

.state-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 80%;
  padding: 2rem;
}

.state-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
}

.state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.state-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Animação do anel de pulso no Loading */
.pulse-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
  animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

.btn-retry {
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #d80047 100%);
  color: #fff;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.7rem 1.8rem;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
  transition: var(--transition);
  outline: none;
}

.btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 0, 85, 0.5);
}

.btn-retry:active {
  transform: translateY(0);
}

/* ── Info Bar ── */
.info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-top: 1px solid var(--border);
  background: rgba(10, 11, 26, 0.5);
  backdrop-filter: blur(10px);
}

.info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1rem 1.5rem;
  border-right: 1px solid var(--border);
  transition: var(--transition);
}

.info-col:hover {
  background: rgba(255, 255, 255, 0.02);
}

.info-col:last-child {
  border-right: none;
}

.inf-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.inf-val {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── M3U Section ── */
.m3u-section {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  transition: var(--transition);
}

.m3u-section:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.m3u-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 26, 0.4);
}

.m3u-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.m3u-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.m3u-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-secondary) 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  font-family: var(--font);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.65rem 1.5rem;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  transition: var(--transition);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-download.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
  box-shadow: none;
}

.btn-download.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: #c084fc;
  transform: translateY(-2px);
}

.m3u-preview {
  position: relative;
  background: rgba(5, 6, 15, 0.6);
}

.m3u-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: rgba(10, 11, 26, 0.8);
  border-bottom: 1px solid var(--border);
}

.m3u-filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  font-family: monospace;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-copy.copied {
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.m3u-code {
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #a5b4fc;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: auto;
  white-space: pre;
  background: transparent;
  user-select: all;
  max-height: 250px;
}

/* Custom Scrollbar for Code Block */
.m3u-code::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.m3u-code::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.m3u-code::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.m3u-code::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Bento Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-premium), 0 0 25px rgba(255, 0, 85, 0.05);
  border-color: rgba(255, 0, 85, 0.25);
}

.card-icon {
  font-size: 2.25rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(5, 6, 15, 0.4);
}

footer a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

footer a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ── Utilities ── */
.hidden {
  display: none !important;
}

/* ── Responsive Styling ── */
@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }
  
  .header-inner {
    justify-content: center;
    text-align: center;
  }
  
  .header-meta {
    width: 100%;
    justify-content: center;
  }
  
  main {
    padding: 1.5rem 1rem 4rem;
  }
  
  .player-card {
    border-radius: var(--r-md);
  }
  
  .info-bar {
    grid-template-columns: 1fr 1fr;
  }
  
  .info-col {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .info-col:nth-child(even) {
    border-right: none;
  }
  
  .info-col:last-child {
    border-bottom: none;
  }
  
  .m3u-header {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .m3u-btns {
    width: 100%;
  }
  
  .btn-download {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .info-bar {
    grid-template-columns: 1fr;
  }
  
  .info-col {
    border-right: none !important;
  }
  
  .logo {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Custom Video Player Controls
   ========================================================================== */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(5, 6, 15, 0.95) 0%, rgba(5, 6, 15, 0.4) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Exibe controles ao passar o mouse no player */
.player-wrap:hover .custom-controls,
.player-wrap:focus-within .custom-controls,
.custom-controls.active {
  opacity: 1;
  pointer-events: auto;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: var(--transition);
  outline: none;
}

.ctrl-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* Volume Slider */
.volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  height: 4px;
  border-radius: 2px;
  outline: none;
  accent-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.volume-container:hover .volume-slider,
.volume-container:focus-within .volume-slider {
  width: 70px;
  opacity: 1;
}

/* Quality Dropdown Selector */
.quality-selector-container {
  position: relative;
}

#ctrl-quality-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
}

#ctrl-quality-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

#ctrl-data-saver {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

#ctrl-data-saver:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

#ctrl-data-saver.eco-active {
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

#ctrl-data-saver.eco-active:hover {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.15);
}

.quality-dropdown {
  position: absolute;
  bottom: 45px;
  right: 0;
  background: rgba(10, 11, 26, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.quality-option {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.quality-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.quality-option.selected {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
}

.live-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
  animation: blink 1.5s infinite;
}

.player-card, .m3u-section, .card, .tool-card {
  transition: var(--transition), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-secondary);
  transform: rotate(15deg) scale(1.05);
}

.theme-toggle-btn svg {
  transition: transform 0.5s ease;
}

[data-theme="light"] .logo-text span {
  background: linear-gradient(135deg, #0f172a 40%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .m3u-title {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .m3u-preview {
  background: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .m3u-code {
  color: #4338ca;
}

[data-theme="light"] .m3u-top-bar {
  background: rgba(233, 236, 243, 0.8);
}

[data-theme="light"] .live-badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .bg-blob {
  opacity: 0.07;
}

[data-theme="light"] .player-state {
  background: linear-gradient(135deg, #e4e7eb 0%, #f0f2f5 100%);
}

/* ── Central de Ferramentas (Bento Grid) ── */
.tools-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.tools-header {
  margin-bottom: 1.5rem;
}

.tools-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tools-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tools-bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: var(--transition);
}

.tool-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-premium), var(--shadow-neon);
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tool-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tool-tip-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Equalizer Preset Buttons */
.eq-preset-selector {
  display: flex;
  gap: 0.5rem;
}

.eq-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.eq-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-secondary);
}

.eq-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-secondary);
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .eq-btn.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-secondary);
}

/* Quick Actions */
.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.tool-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tool-action-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.tool-action-btn.btn-full {
  width: 100%;
}

/* Sleep Selector */
.sleep-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sleep-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sleep-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-cyan);
}

.sleep-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

[data-theme="light"] .sleep-btn.active {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
}

.sleep-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 2px;
}

/* Speed Test Gauge */
.speedtest-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.speedtest-result {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

[data-theme="light"] .speedtest-result {
  background: rgba(0, 0, 0, 0.03);
}

.speedtest-gauge {
  background: rgba(255, 255, 255, 0.05);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="light"] .speedtest-gauge {
  background: rgba(0, 0, 0, 0.05);
}

.speedtest-fill {
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-cyan));
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.speedtest-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}

#speedtest-val {
  color: var(--text);
}

/* HUD Switch */
.hud-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hud-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid var(--border);
}

[data-theme="light"] .slider {
  background-color: rgba(0, 0, 0, 0.05);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent-secondary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: white;
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Mini Stats Grid */
.stats-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-mini {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

[data-theme="light"] .stat-mini {
  background: rgba(0, 0, 0, 0.02);
}

.stat-mini-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-mini-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

/* Schedule Card */
.schedule-card {
  grid-column: span 1;
}

@media (min-width: 1024px) {
  .schedule-card {
    grid-column: span 2;
  }
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.schedule-list::-webkit-scrollbar {
  width: 4px;
}
.schedule-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: var(--transition);
}

[data-theme="light"] .schedule-item {
  background: rgba(0, 0, 0, 0.02);
}

.schedule-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-glow);
}

.live-item {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="light"] .live-item {
  background: rgba(16, 185, 129, 0.04);
}

.sch-time-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  min-width: 60px;
  height: 50px;
  flex-shrink: 0;
}

.sch-time {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.sch-date {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sch-info {
  flex-grow: 1;
  min-width: 0;
}

.sch-match-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sch-match-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.sch-countdown {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 3px;
}

.live-text {
  color: var(--accent-green);
  animation: blink 1.5s infinite;
}

.sch-action {
  flex-shrink: 0;
}

.btn-remind {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-remind:hover {
  background: var(--accent-secondary);
  color: #fff;
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.live-pulse-badge {
  background: var(--accent-green);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  animation: pulseBg 2s infinite;
}

@keyframes pulseBg {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── HUD de Estatísticas (Overlay no Player) ── */
.player-hud {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 260px;
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 0.75rem;
  color: #fff;
  z-index: 100;
  font-size: 0.75rem;
  font-family: monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

[data-theme="light"] .player-hud {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

[data-theme="light"] .hud-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.hud-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.hud-close:hover {
  color: var(--accent-primary);
}

.hud-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-row {
  display: flex;
  justify-content: space-between;
}

.hud-row span:first-child {
  color: #94a3b8;
}

[data-theme="light"] .hud-row span:first-child {
  color: #475569;
}

.hud-row span:last-child {
  font-weight: bold;
  color: var(--accent-cyan);
}

/* ── Fallback State for Empty/Post-Cup Schedule ── */
.schedule-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  gap: 0.75rem;
}

.empty-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.empty-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

.btn-empty-action {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-empty-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

/* ── Mobile Sync Card styling ── */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  width: 130px;
  height: 130px;
  margin: 0 auto;
}

.qr-code-img {
  width: 115px;
  height: 115px;
  border-radius: 4px;
  background: #fff;
  padding: 4px;
}

.mobile-link-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.mobile-link-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  word-break: break-all;
  transition: var(--transition);
}

.mobile-link-text:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ==========================================================================
   Sofascore Live Match Centre Styling
   ========================================================================== */
.sofascore-section {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-premium);
  transition: var(--transition);
  z-index: 1;
}

.sofascore-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-cyan) 100%);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.sofascore-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 480px) {
  .sofascore-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.sofascore-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.match-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.8rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .match-title-wrap {
    width: auto;
    margin-left: 1rem;
  }
}

.current-match-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-primary, #ff0055);
  box-shadow: 0 0 8px var(--accent-primary, #ff0055);
  flex-shrink: 0;
}

.live-indicator-dot.pulsing {
  animation: pulseRed 1.5s infinite alternate;
}

@keyframes pulseRed {
  0% { transform: scale(0.9); box-shadow: 0 0 2px rgba(255, 0, 85, 0.4); }
  100% { transform: scale(1.1); box-shadow: 0 0 10px rgba(255, 0, 85, 0.9); }
}

.live-tracking-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
}

.live-tracking-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseGreen 1.5s infinite alternate;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--accent-green); }
}

/* Placar */
.sofascore-match-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.scoreboard-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33%;
  text-align: center;
}

.team-logo-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.home-team .team-logo-wrapper {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.away-team .team-logo-wrapper {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-secondary) 100%);
}

.team-logo-placeholder {
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.team-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34%;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.score-val {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.score-divider {
  color: var(--text-muted);
  font-size: 1.2rem;
  opacity: 0.5;
}

.match-time-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 0, 85, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(255, 0, 85, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
  animation: pulseRedBorder 2s infinite;
}

@keyframes pulseRedBorder {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.2); }
  70% { box-shadow: 0 0 0 6px rgba(255, 0, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

.match-meta-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-icon {
  font-size: 0.75rem;
}

/* Abas */
.sofascore-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}

.sofascore-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.25rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

@media (min-width: 480px) {
  .sofascore-tab-btn {
    flex-direction: row;
    font-size: 0.78rem;
    padding: 0.5rem 0.5rem;
    gap: 0.3rem;
  }
}

.sofascore-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.sofascore-tab-btn.active {
  color: #fff;
  background: var(--surface-hover);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.sofascore-tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.sofascore-tab-content.active {
  display: block;
}

/* Estatísticas Sub-abas */
.stats-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.stats-subtab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.stats-subtab-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.stats-subtab-btn.active {
  color: #fff;
  border-color: var(--accent-secondary);
  background: rgba(139, 92, 246, 0.15);
}

/* Estatísticas Linhas */
.stats-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-val {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.stat-val.dominant {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-compare-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  overflow: hidden;
  display: flex;
  width: 100%;
}

.stat-compare-bar-fill {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.stat-compare-bar-fill.home {
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.stat-compare-bar-fill.away {
  background: linear-gradient(90deg, var(--accent-secondary) 0%, var(--accent-cyan) 100%);
}

.stat-compare-bar-divider {
  width: 2px;
  background: var(--bg);
  height: 100%;
}

/* Campo Tático & Escalações */
.lineups-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.pitch-container {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.soccer-pitch {
  aspect-ratio: 0.75;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  width: 100%;
}

.pitch-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
}

.penalty-area {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 18%;
  border: 1px solid #fff;
}

.home-penalty {
  top: 0;
  border-top: none;
}

.away-penalty {
  bottom: 0;
  border-bottom: none;
}

.center-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #fff;
}

.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  aspect-ratio: 1;
  border: 1px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-players {
  position: absolute;
  inset: 0;
}

/* Marcadores de Jogador */
.player-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-dot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 10;
}

.player-dot.home {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: 1px solid rgba(255,255,255,0.8);
}

.player-dot.away {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-secondary) 100%);
  border: 1px solid rgba(255,255,255,0.8);
}

.player-rating-badge {
  position: absolute;
  bottom: -7px;
  right: -7px;
  font-size: 0.5rem;
  font-weight: 800;
  color: #fff;
  padding: 1px 2px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.rating-high { background-color: var(--accent-green); }
.rating-mid { background-color: #ff9900; }
.rating-low { background-color: var(--accent-primary); }

.player-dot-name {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.8);
  padding: 1px 3px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
}

.player-dot:hover .player-dot-name {
  opacity: 1;
}

.pitch-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.legend-color {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-color.home-color { background: var(--accent-primary); }
.legend-color.away-color { background: var(--accent-cyan); }

/* Listas de Escalações */
.lineups-lists-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .lineups-lists-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.lineup-column {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.lineup-column-title {
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  color: #fff;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.player-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.4rem;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.01);
  transition: var(--transition);
}

.player-list-item:hover {
  background: rgba(255,255,255,0.03);
}

.player-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.player-shirt-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 12px;
}

.player-list-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.player-rating-val {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  padding: 2px 4px;
  border-radius: 3px;
  min-width: 24px;
  text-align: center;
}

.coach-row {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}

.coach-label {
  color: var(--text-muted);
  font-weight: 600;
}

.coach-name {
  font-weight: 700;
  color: #fff;
}

/* Destaque do Melhor Jogador */
.best-player-spotlight {
  background: linear-gradient(135deg, rgba(23, 26, 52, 0.4) 0%, rgba(15, 17, 35, 0.5) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.best-player-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffae00 100%);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 0.15rem 0.4rem;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.best-player-photo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-cyan) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.best-player-info {
  flex: 1;
  min-width: 0;
}

.best-player-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.best-player-team {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
}

.best-player-stats {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.best-player-stat-item {
  display: flex;
  flex-direction: column;
}

.best-player-stat-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.best-player-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.best-player-rating-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-green);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.best-rating-num {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.best-rating-label {
  font-size: 0.4rem;
  font-weight: 800;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
}

/* Linha do Tempo */
.timeline-container {
  position: relative;
  max-width: 100%;
  margin: 0.5rem auto;
  padding: 0.75rem 0;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--border);
}

.timeline-event {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1rem;
  width: 100%;
  position: relative;
  padding-left: 40px;
  box-sizing: border-box;
}

.timeline-event.event-home {
  flex-direction: row;
}

.timeline-side-block {
  width: auto;
  flex-grow: 1;
  text-align: left !important;
}

.timeline-event-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-md);
  display: inline-block;
  max-width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  box-sizing: border-box;
}

.timeline-event-detail {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-event-detail strong {
  font-weight: 800;
  color: #fff;
}

.timeline-event-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.timeline-center-badge {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 2px solid var(--border);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.timeline-event.event-home .timeline-center-badge {
  border-color: var(--accent-primary);
}

.timeline-event.event-away .timeline-center-badge {
  border-color: var(--accent-cyan);
}

.timeline-event-icon {
  font-size: 0.75rem;
}

.timeline-event + .timeline-side-block {
  display: none; /* remove redundant right-aligned blocks on mobile */
}

/* Gráfico de Momentum */
.momentum-container {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.momentum-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.momentum-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.momentum-svg-wrapper {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.35rem;
  margin-top: 0.25rem;
}

#momentum-svg {
  width: 100%;
  height: 100px;
  display: block;
}

.momentum-grid-line {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
  stroke-dasharray: 3;
}

.momentum-grid-line.center {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.2;
  stroke-dasharray: 0;
}

.momentum-axis-label {
  fill: var(--text-muted);
  font-family: var(--font);
  font-size: 7px;
  font-weight: 700;
}

.momentum-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.65rem;
  margin-top: 0.4rem;
  font-weight: 600;
}

.home-legend { color: var(--accent-primary); }
.away-legend { color: var(--accent-cyan); }




