/* ============================================================
   TORNEIO DAS PEDREIRAS 2026/3 — DESIGN SYSTEM & MOBILE UX
   ============================================================ */

:root {
  --bg-primary: #080b11;
  --bg-surface: #101522;
  --bg-surface-elevated: #182032;
  --bg-glass: rgba(16, 21, 34, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.4);
  --border-glow: rgba(245, 158, 11, 0.2);

  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  
  --accent-emerald: #10b981;
  --accent-ruby: #ef4444;
  --accent-indigo: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.2);
}

/* ============================================================
   TEMA CLARO (LIGHT MODE)
   ============================================================ */
html[data-theme="light"] {
  color-scheme: light;

  --bg-primary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(217, 119, 6, 0.45);
  --border-glow: rgba(217, 119, 6, 0.15);

  --accent-gold: #d97706;
  --accent-gold-light: #b45309;
  --accent-gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);

  --accent-emerald: #059669;
  --accent-ruby: #dc2626;
  --accent-indigo: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(217, 119, 6, 0.12);
}

html[data-theme="light"] body {
  background: 
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
    var(--bg-primary);
}

html[data-theme="light"] .brand-logo-badge {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.3);
}

html[data-theme="light"] .icon-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .icon-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: #fefce8;
}

html[data-theme="light"] .nav-tabs {
  background: #e2e8f0;
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .tab-btn {
  color: #475569;
}

html[data-theme="light"] .tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.35);
}

html[data-theme="light"] .standings-card,
html[data-theme="light"] .match-card,
html[data-theme="light"] .stat-box,
html[data-theme="light"] .squad-card {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .standings-header-row,
html[data-theme="light"] .legend-card,
html[data-theme="light"] .match-meta-bar,
html[data-theme="light"] .events-summary,
html[data-theme="light"] .roster-stats-strip {
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .standings-table th {
  background: #f8fafc;
  color: #64748b;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .standings-row:hover {
  background: rgba(0, 0, 0, 0.025);
}

html[data-theme="light"] .round-pill {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

html[data-theme="light"] .round-pill.active {
  background: var(--accent-gold);
  color: #ffffff;
  border-color: var(--accent-gold);
}

html[data-theme="light"] .roster-team-pill {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

html[data-theme="light"] .roster-team-pill.active {
  background: var(--accent-gold);
  color: #ffffff;
  border-color: var(--accent-gold);
}

html[data-theme="light"] .score-display {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .player-card {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .stat-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer {
  background: #f8fafc;
}

html[data-theme="light"] .modal-img-container {
  background: #f1f5f9;
}

html[data-theme="light"] .btn-modal-secondary {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

html[data-theme="light"] .btn-modal-secondary:hover {
  background: #cbd5e1;
}

html[data-theme="light"] .app-toast {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
}

html {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 10% 30%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    var(--bg-primary);
  background-attachment: fixed;
  overflow-x: hidden;
  padding-bottom: 40px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.app-header, .nav-tabs-wrapper, .standings-card, .match-card, .stat-box, .squad-card, .tab-btn, .round-pill, .roster-team-pill, .icon-btn {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ============================================================
   APP BAR / HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-badge {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover, .icon-btn:active {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: scale(1.05);
}

.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   SEGMENTED NAVIGATION TABS (MOBILE OPTIMIZED)
   ============================================================ */
.nav-tabs-wrapper {
  position: sticky;
  top: 66px;
  z-index: 90;
  padding: 10px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.tab-btn.active {
  color: #080b11;
  background: var(--accent-gold-gradient);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

/* ============================================================
   MAIN CONTAINER & SECTIONS
   ============================================================ */
.main-content {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
  flex: 1;
}

.tab-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TAB 1: CLASSIFICAÇÃO (STANDINGS)
   ============================================================ */
.standings-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.standings-header-row {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.standings-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: center;
}

.standings-table th {
  padding: 12px 10px;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.standings-table th.th-team {
  text-align: left;
  padding-left: 18px;
}

.standings-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.standings-row:last-child td {
  border-bottom: none;
}

.standings-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  margin-right: 8px;
}

.pos-1 {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold-light);
  border: 1px solid var(--accent-gold);
}

.pos-2 {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.pos-other {
  color: var(--text-muted);
}

.team-cell {
  text-align: left;
  padding-left: 18px !important;
}

.team-cell-wrap {
  display: flex;
  align-items: center;
}

.team-crest {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 10px;
  border-radius: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.team-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.points-badge {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.legend-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid var(--border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.legend-dot.gold { background: var(--accent-gold); }
.legend-dot.emerald { background: var(--accent-emerald); }

/* ============================================================
   BOTÃO EXPANDIR / RECOLHER TABELA
   ============================================================ */
.btn-toggle-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-toggle-expand:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-gold-light);
  transform: translateY(-1px);
}

.btn-toggle-expand.expanded {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
}

.btn-toggle-expand .expand-icon {
  font-size: 0.95rem;
  line-height: 1;
}

html[data-theme="light"] .btn-toggle-expand {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

html[data-theme="light"] .btn-toggle-expand:hover,
html[data-theme="light"] .btn-toggle-expand.expanded {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

/* ============================================================
   TABELA EXPANDIDA (Todas as colunas, escudo no topo, nome embaixo)
   ============================================================ */
.standings-expanded .pos-badge {
  display: none !important;
}

.standings-expanded .standings-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.standings-expanded .standings-table th,
.standings-expanded .standings-table td {
  padding: 8px 3px !important;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* Forçar exibição de todas as colunas mesmo em telas mobile */
.standings-expanded .col-optional {
  display: table-cell !important;
}

/* Coluna EQUIPE: 24% da tabela */
.standings-expanded .standings-table th.th-team,
.standings-expanded .standings-table td.team-cell {
  width: 24% !important;
  text-align: center !important;
  padding: 6px 2px !important;
}

/* Demais 8 colunas de dados (PT, J, V, E, D, GM, GS, SG): 9.5% cada (76% total) */
.standings-expanded .standings-table th:not(.th-team),
.standings-expanded .standings-table td:not(.team-cell) {
  width: 9.5% !important;
  text-align: center !important;
}

.standings-expanded .team-cell-wrap {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 3px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.standings-expanded .team-crest {
  width: 26px !important;
  height: 26px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

.standings-expanded .team-name {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  max-width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;
  color: var(--text-primary) !important;
}

.standings-expanded .points-badge {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #f59e0b !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  display: inline !important;
}

.standings-expanded .legend-expanded {
  justify-content: center;
}

html[data-theme="light"] .standings-expanded .standings-table th,
html[data-theme="light"] .standings-expanded .standings-table td {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .standings-expanded .points-badge {
  color: #d97706 !important;
}

/* Responsividade mobile específica para a tabela expandida */
@media (max-width: 640px) {
  .standings-expanded .standings-table th,
  .standings-expanded .standings-table td {
    padding: 6px 1px !important;
    font-size: 0.74rem !important;
  }

  .standings-expanded .standings-table th.th-team,
  .standings-expanded .standings-table td.team-cell {
    padding: 5px 1px !important;
  }

  .standings-expanded .team-crest {
    width: 22px !important;
    height: 22px !important;
  }

  .standings-expanded .team-name {
    font-size: 0.66rem !important;
  }

  .standings-expanded .points-badge {
    font-size: 0.85rem !important;
  }

  .standings-expanded .table-responsive {
    overflow-x: hidden;
  }
}

@media (max-width: 360px) {
  .standings-expanded .standings-table th,
  .standings-expanded .standings-table td {
    padding: 5px 0.5px !important;
    font-size: 0.68rem !important;
  }

  .standings-expanded .team-name {
    font-size: 0.60rem !important;
  }
}

/* ============================================================
   TAB 2 — PRÓXIMAS PARTIDAS (JOGOS AGENDADOS)
   ============================================================ */
.upcoming-section:empty {
  display: none;
}

.upcoming-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

/* Faixa azul lateral que diferencia o bloco de futuro do bloco de resultados */
.upcoming-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #60a5fa 0%, #6366f1 100%);
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.upcoming-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.upcoming-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  white-space: nowrap;
}

.upcoming-list,
.upcoming-future {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Lista dos demais jogos futuros — fechada por padrão */
.upcoming-future {
  display: none;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.upcoming-future.open {
  display: flex;
}

.upcoming-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: var(--transition-smooth);
}

.upcoming-card.is-destaque {
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.10) 0%, rgba(99, 102, 241, 0.06) 100%);
}

.upcoming-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.upcoming-when {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.upcoming-countdown {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  white-space: nowrap;
}

.upcoming-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.upcoming-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upcoming-team.home {
  justify-content: flex-end;
  text-align: right;
}

.upcoming-team.away {
  justify-content: flex-start;
  text-align: left;
}

.upcoming-team-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.upcoming-crest {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.upcoming-vs {
  font-size: 0.72rem;
  font-weight: 900;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.upcoming-round-tag {
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.upcoming-toggle {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.upcoming-toggle:hover {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.45);
}

.upcoming-toggle svg {
  transition: transform 0.25s ease;
}

.upcoming-toggle.open svg {
  transform: rotate(180deg);
}

/* Tema Claro */
html[data-theme="light"] .upcoming-card.is-destaque {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, rgba(79, 70, 229, 0.05) 100%);
}

html[data-theme="light"] .upcoming-countdown,
html[data-theme="light"] .upcoming-vs {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

html[data-theme="light"] .upcoming-toggle:hover {
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* ============================================================
   TAB 2: JOGOS & RODADAS (MATCHES)
   ============================================================ */
.rounds-selector-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rounds-selector-bar::-webkit-scrollbar {
  display: none;
}

.round-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.round-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.round-pill.active {
  background: var(--accent-gold);
  color: #080b11;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* Rodada que ainda vai acontecer */
.round-pill.is-agendada {
  border-style: dashed;
  border-color: rgba(96, 165, 250, 0.45);
  color: #60a5fa;
}

.round-pill.is-agendada.active {
  background: #3b82f6;
  border-style: solid;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

html[data-theme="light"] .round-pill.is-agendada {
  color: #1d4ed8;
  border-color: #bfdbfe;
}

html[data-theme="light"] .round-pill.is-agendada.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.match-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

.match-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.badge-status-wo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="light"] .badge-status-wo {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Partida agendada (ainda sem placar) */
.match-card-agendado {
  border-style: dashed;
  border-color: rgba(96, 165, 250, 0.35);
}

.badge-status-agendado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.match-scheduled-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 14px 16px;
  padding: 8px 12px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #93c5fd;
  line-height: 1.35;
}

.match-score-pill-vs {
  box-shadow: none;
  border-color: rgba(96, 165, 250, 0.35);
  border-style: dashed;
}

.score-vs {
  font-size: 1.05rem;
  font-weight: 900;
  color: #60a5fa;
  letter-spacing: 0.08em;
  min-width: 48px;
  text-align: center;
}

html[data-theme="light"] .badge-status-agendado {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

html[data-theme="light"] .match-scheduled-notice {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

html[data-theme="light"] .score-vs {
  color: #2563eb;
}

.match-wo-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 14px 16px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.80rem;
  color: #fca5a5;
  line-height: 1.35;
}

.match-wo-notice .wo-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

html[data-theme="light"] .match-wo-notice {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.match-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 16px;
  gap: 12px;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-team.home {
  justify-content: flex-end;
  text-align: right;
}

.match-team.away {
  justify-content: flex-start;
  text-align: left;
}

.match-team-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.match-team-crest {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.match-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.score-num {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
}

.score-num.highlight {
  color: var(--accent-emerald);
}

.score-divider {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Detalhes de Eventos (Accordion) */
.match-events-toggle {
  width: 100%;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.015);
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.match-events-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-gold);
}

.match-events-toggle svg {
  transition: transform 0.25s ease;
}

.match-events-toggle.open svg {
  transform: rotate(180deg);
}

.match-events-drawer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 0.82rem;
}

.events-col.home {
  text-align: right;
  border-right: 1px solid var(--border-subtle);
  padding-right: 14px;
}

.events-col.away {
  text-align: left;
  padding-left: 4px;
}

.event-entry {
  margin-bottom: 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.events-col.home .event-entry {
  justify-content: flex-end;
}

.event-entry strong {
  color: var(--text-primary);
}

/* ============================================================
   TAB 3: ESTATÍSTICAS (LEADERS & STATS)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.stat-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.stat-box-header {
  padding: 14px 18px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-box-icon {
  font-size: 1.3rem;
}

.stat-box-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-list {
  list-style: none;
  padding: 8px 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-rank {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 20px;
}

.stat-rank.top-1 { color: var(--accent-gold); }
.stat-rank.top-2 { color: #cbd5e1; }
.stat-rank.top-3 { color: #d97706; }

.stat-player-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.stat-count {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  white-space: nowrap;
}

.stat-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Badge de contagem total no header do card */
.stat-badge-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

html[data-theme="light"] .stat-badge-count {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
}

/* Mini escudo do time na lista de estatísticas */
.stat-player-crest {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  border-radius: 4px;
}

/* Gaveta extra de estatísticas (abaixo do top 5) */
.stat-extra-wrapper {
  border-top: 1px dashed var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.2s ease;
}

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

.stat-extra-list {
  padding: 4px 16px 8px 16px;
}

/* Botão de expandir ranking completo */
.stat-expand-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-surface-elevated);
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.stat-expand-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--accent-gold);
}

.stat-expand-btn .stat-chevron {
  transition: transform 0.25s ease;
}

.stat-expand-btn.open .stat-chevron {
  transform: rotate(180deg);
}

/* Barra de busca nas estatísticas */
.stats-header-bar {
  margin-bottom: 16px;
}

.stats-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.stats-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.stats-search-input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.stats-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.stats-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.stats-search-clear:hover {
  color: var(--text-primary);
}

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  margin: 16px 0;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
  font-weight: 600;
}

.empty-subtext {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   TAB 4: ELENCOS DOS TIMES (ROSTERS)
   ============================================================ */
.roster-teams-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.roster-teams-bar::-webkit-scrollbar {
  display: none;
}

.team-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.team-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.team-pill.active {
  background: var(--accent-gold);
  color: #080b11;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.team-pill-crest {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
  flex-shrink: 0;
}

.squad-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.squad-header {
  padding: 20px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 16px;
}

.squad-crest {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  flex-shrink: 0;
}

.squad-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.squad-count-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.squad-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 16px;
}

.squad-player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.squad-player-item:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.player-main-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-number {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  min-width: 22px;
}

.player-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.role-capitao {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold-light);
  border: 1px solid var(--accent-gold);
}

.role-goleiro {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.role-coringa {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid #6366f1;
}

.role-atleta {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.role-inativo {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

/* ============================================================
   SEÇÃO DE HISTÓRICO DE ATLETAS (DESATIVADOS / EX-ATLETAS)
   ============================================================ */

.squad-history-section {
  border-top: 1px dashed var(--border-subtle);
  background: rgba(0, 0, 0, 0.16);
  padding: 20px;
}

html[data-theme="light"] .squad-history-section {
  background: rgba(0, 0, 0, 0.025);
}

.squad-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.squad-history-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.squad-history-icon {
  font-size: 1.3rem;
}

.squad-history-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.squad-history-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.squad-player-historico {
  opacity: 0.78;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
}

.squad-player-historico:hover {
  opacity: 1;
  border-color: var(--accent-gold);
}

/* ============================================================
   RESPONSIVIDADE MOBILE (SMARTPHONES)
   ============================================================ */
@media (max-width: 600px) {
  .brand-title {
    font-size: 0.95rem;
  }
  
  .brand-logo-badge {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .nav-tabs-wrapper {
    padding: 6px 10px;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 7px 2px;
    gap: 4px;
  }

  .main-content {
    padding: 14px 12px;
  }

  .match-team-name {
    font-size: 0.88rem;
  }

  .match-team-crest {
    width: 36px;
    height: 36px;
  }

  .score-num {
    font-size: 1.4rem;
  }

  .match-scoreboard {
    padding: 16px 10px;
    gap: 8px;
  }

  .squad-list {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  /* Compactar colunas menos críticas na tabela mobile se necessário */
  .col-optional {
    display: none;
  }
}

/* ============================================================
   BOTÃO DE EXPORTAÇÃO (PNG / WHATSAPP)
   ============================================================ */

.btn-export-png {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  color: var(--accent-gold-light);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.btn-export-png:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.45) 100%);
  border-color: var(--accent-gold);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

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

.btn-export-icon-only {
  padding: 6px 10px;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.btn-export-png.loading {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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

html[data-theme="light"] .btn-export-png {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.15);
}

html[data-theme="light"] .btn-export-png:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  color: #78350f;
  border-color: #d97706;
}

@media (max-width: 480px) {
  .standings-header-row {
    padding: 12px 14px;
    gap: 8px;
  }
  
  .section-title {
    font-size: 1rem;
  }

  .btn-export-png {
    padding: 7px 10px;
    font-size: 0.76rem;
    gap: 6px;
  }

  /* Próximas partidas em telas estreitas */
  .upcoming-panel {
    padding: 12px 10px;
  }

  .upcoming-team-name {
    font-size: 0.8rem;
  }

  .upcoming-crest {
    width: 26px;
    height: 26px;
  }

  .upcoming-card-top {
    font-size: 0.68rem;
  }

  .badge-status-agendado {
    font-size: 0.62rem;
    padding: 2px 5px;
  }

  .match-meta-bar {
    gap: 8px;
  }
}

/* ============================================================
   BOTÃO FLUTUANTE DE EXPORTAÇÃO (RODAPÉ / FAB)
   ============================================================ */

.floating-export-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
  pointer-events: auto;
}

.floating-export-container.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.92);
  pointer-events: none;
}

.fab-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.42), 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.01em;
  user-select: none;
  -webkit-user-select: none;
}

.fab-export-btn .fab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.fab-export-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.55), 0 4px 10px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #fcd34d 0%, #b45309 100%);
}

.fab-export-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.fab-export-btn.loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

/* Modo escuro - FAB contrastante e vibrante */
html[data-theme="dark"] .fab-export-btn {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #090d16;
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .fab-export-btn:hover {
  box-shadow: 0 12px 35px rgba(245, 158, 11, 0.7), 0 4px 12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
  .floating-export-container {
    bottom: 18px;
    right: 16px;
  }

  .fab-export-btn {
    padding: 11px 18px;
    font-size: 0.86rem;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
  }
}

/* ============================================================
   MODAL DE PRÉVIA & COMPARTILHAMENTO
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-gold-light);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

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

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-img-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-card);
}

.modal-img-container img {
  display: block;
  width: 100%;
  height: auto;
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

.modal-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-modal-primary {
  flex: 1 1 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  background: #25d366; /* WhatsApp brand color */
  color: #06230f;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-modal-primary:hover {
  background: #20ba59;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.btn-modal-secondary {
  flex: 1 1 calc(50% - 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-modal-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="light"] .btn-modal-secondary {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .btn-modal-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(16, 21, 34, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  text-align: center;
}

.app-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

