/* ==================================================================
   Lumix Fibra CS2 — Design System
   Tokens + componentes compartilhados por todas as páginas.
   ================================================================== */

:root {
  /* Tipografia fluida */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Espaçamento */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;

  /* Raio */
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
  --radius-xl: 1rem; --radius-full: 9999px;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Rajdhani", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --container: 1280px;
}

[data-theme="dark"] {
  --color-bg: #0d0e10;
  --color-surface: #141518;
  --color-surface-2: #1a1b1f;
  --color-surface-offset: #1f2025;
  --color-surface-dynamic: #2a2c32;
  --color-divider: #22242a;
  --color-border: #2e3038;
  --color-text: #e2e4ec;
  --color-text-muted: #7a7d8a;
  --color-text-faint: #3d404a;
  --color-text-inverse: #0d0e10;
  --color-primary: #ff4d2e;
  --color-primary-hover: #e03f22;
  --color-primary-active: #c23118;
  --color-primary-highlight: #2a1c18;
  --color-success: #4caf6e;
  --color-success-highlight: #1a2d22;
  --color-warning: #f0a030;
  --color-warning-highlight: #2a2010;
  --color-error: #e04060;
  --color-error-highlight: #2c1820;
  --color-gold: #f0c040;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  color-scheme: dark;
}

[data-theme="light"] {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-surface-2: #f9fafb;
  --color-surface-offset: #f0f2f5;
  --color-surface-dynamic: #e8eaef;
  --color-divider: #e0e2e8;
  --color-border: #d4d6dd;
  --color-text: #1a1c22;
  --color-text-muted: #6b6e7d;
  --color-text-faint: #b0b3c0;
  --color-text-inverse: #ffffff;
  --color-primary: #d63a1e;
  --color-primary-hover: #b82e14;
  --color-primary-active: #99220c;
  --color-primary-highlight: #ffe8e3;
  --color-success: #2e7d50;
  --color-success-highlight: #e0f4ea;
  --color-warning: #c47c10;
  --color-warning-highlight: #fff4d4;
  --color-error: #c0304a;
  --color-error-highlight: #fbe6ea;
  --color-gold: #b08000;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 260 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 260 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 260 / 0.12);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; }
a, button, [role="button"] {
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Logo ---------- */
.brand-mark svg { color: var(--color-primary); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-rows: auto 1fr; min-height: 100dvh; }
.container { max-width: var(--container); width: 100%; margin: 0 auto; padding: 0 var(--space-6); }
.main-content { padding: var(--space-8) var(--space-6); max-width: var(--container); width: 100%; margin: 0 auto; }
.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; letter-spacing: 0.02em; }
.page-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.section-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-4); letter-spacing: 0.02em; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); position: sticky; top: 0; z-index: 100;
}
.topbar-logo {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; letter-spacing: 0.04em; color: var(--color-text); text-decoration: none;
}
.topbar-logo svg { color: var(--color-primary); }
.topbar-nav { display: flex; gap: var(--space-1); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }
.nav-btn {
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted);
}
.nav-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.nav-btn.active { color: var(--color-primary); background: var(--color-primary-highlight); }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.icon-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: 0 4px 14px oklch(from var(--color-primary) l c h / 0.3); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--color-surface-offset); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-surface-dynamic); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-offset); }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-highlight); transform: translateY(-1px); }
.btn-danger { background: var(--color-error); color: #fff; border-color: var(--color-error); }
.btn-danger:hover { opacity: 0.88; }
.btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { opacity: 0.88; }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: var(--space-6); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.02em; }
.card-accent { background: linear-gradient(135deg, var(--color-surface), oklch(from var(--color-primary) l c h / 0.08)); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.02em; }
.badge-primary { background: var(--color-primary-highlight); color: var(--color-primary); }
.badge-success { background: var(--color-success-highlight); color: var(--color-success); }
.badge-warning { background: var(--color-warning-highlight); color: var(--color-warning); }
.badge-neutral { background: var(--color-surface-offset); color: var(--color-text-muted); }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.form-label { font-size: var(--text-sm); font-weight: 600; }
.form-input {
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  font-size: var(--text-base); color: var(--color-text); width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15); }
.form-input::placeholder { color: var(--color-text-faint); }
.form-input[readonly] { opacity: 0.65; }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.form-error { font-size: var(--text-sm); color: var(--color-error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.input-with-action { display: flex; gap: var(--space-2); }
.input-with-action .form-input { flex: 1; }
.separator { height: 1px; background: var(--color-divider); margin: var(--space-6) 0; }

/* ---------- Status banner ---------- */
.status-banner { padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-6); display: flex; align-items: center; gap: var(--space-3); }
.status-banner.open { background: var(--color-success-highlight); color: var(--color-success); border: 1px solid oklch(from var(--color-success) l c h / 0.3); }
.status-banner.closed { background: var(--color-warning-highlight); color: var(--color-warning); border: 1px solid oklch(from var(--color-warning) l c h / 0.3); }
.status-banner.started { background: var(--color-primary-highlight); color: var(--color-primary); border: 1px solid oklch(from var(--color-primary) l c h / 0.3); }
.status-banner.champion { background: linear-gradient(135deg, oklch(from var(--color-gold) l c h / 0.15), oklch(from var(--color-primary) l c h / 0.1)); color: var(--color-gold); border: 1px solid var(--color-gold); }

/* ---------- Stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.stat-card.featured { border-color: oklch(from var(--color-primary) l c h / 0.4); }
.stat-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.stat-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.stat-value.sm { font-size: var(--text-lg); }
.stat-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ---------- Teams ---------- */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.team-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.team-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.team-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.team-info { flex: 1; min-width: 0; }
.team-name { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Card de time expansível (visão pública) — clique mostra o elenco. */
.team-pub { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.team-pub:hover { border-color: var(--color-primary); }
.team-pub > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.team-pub > summary::-webkit-details-marker { display: none; }
.team-pub[open] > summary { border-bottom: 1px solid var(--color-border); }
.team-pub[open] .ml-caret { transform: rotate(180deg); }
.team-roster { list-style: none; margin: 0; padding: var(--space-3) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.team-roster li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.team-actions { display: flex; gap: var(--space-1); }

/* ---------- Empty state ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-20) var(--space-8); color: var(--color-text-muted); }
.empty-state-icon { width: 56px; height: 56px; margin-bottom: var(--space-4); color: var(--color-text-faint); }
.empty-state h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--color-text); margin-bottom: var(--space-2); }
.empty-state p { max-width: 40ch; font-size: var(--text-sm); margin-bottom: var(--space-6); }

/* ---------- Bloco de seção ---------- */
.block-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.02em; margin-bottom: var(--space-4); }

/* ---------- Avatar mini ---------- */
.avatar-mini { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ---------- Classificação ---------- */
.standings-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.standings { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 520px; }
.standings th, .standings td { padding: var(--space-3); text-align: center; }
.standings thead th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); font-weight: 700; border-bottom: 1px solid var(--color-border); }
.standings th.st-team-h, .standings td.st-team { text-align: left; }
.standings tbody tr { border-bottom: 1px solid var(--color-divider); }
.standings tbody tr:last-child { border-bottom: none; }
.standings tr.qualified { background: var(--color-success-highlight); }
.standings tr.qualified .st-pos { color: var(--color-success); }
.st-pos { font-family: var(--font-display); font-weight: 700; color: var(--color-text-muted); width: 36px; }
.st-team { display: flex; align-items: center; gap: var(--space-2); }
.st-name { font-weight: 600; white-space: nowrap; }
.st-flag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-success); background: oklch(from var(--color-success) l c h / 0.15); padding: 1px 6px; border-radius: var(--radius-full); margin-left: var(--space-1); }
.st-strong { font-weight: 700; }
.st-muted { color: var(--color-text-muted); }
.st-pts { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); color: var(--color-primary); }

/* ---------- Jogos ---------- */
.round-group { margin-bottom: var(--space-5); }
.round-label { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-2); }
.match-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.match-row.clickable { cursor: pointer; }
.match-row.clickable:hover { border-color: var(--color-primary); }
.match-row.played { background: var(--color-surface-2); }
.match-team { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.match-team.left { justify-content: flex-end; }
.match-team.right { justify-content: flex-start; }
.match-team .mt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: var(--text-sm); }
.match-team.win { color: var(--color-success); }
.match-team.win .mt-name { font-weight: 700; }
.match-team.lose { opacity: 0.55; }
.match-score { font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.match-score i { color: var(--color-text-faint); font-style: normal; font-size: 0.8em; }
.match-score b { min-width: 14px; text-align: center; }

/* ---------- Final ---------- */
.final-block { margin: var(--space-8) 0; }
.final-head { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.final-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-4); padding: var(--space-5); background: linear-gradient(135deg, oklch(from var(--color-gold) l c h / 0.12), oklch(from var(--color-primary) l c h / 0.06)); border: 1px solid var(--color-gold); border-radius: var(--radius-xl); }
.final-match.clickable { cursor: pointer; }
.final-match.clickable:hover { box-shadow: var(--shadow-md); }
.final-team { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); min-width: 0; }
.final-team > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.final-team.right { justify-content: flex-end; }
.final-team.win { color: var(--color-gold); }
.final-team.lose { opacity: 0.5; }
.final-score { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); display: flex; align-items: center; gap: var(--space-2); }
.final-score i { color: var(--color-text-faint); font-style: normal; font-size: 0.7em; }
.final-waiting { padding: var(--space-6); text-align: center; color: var(--color-text-muted); border: 1px dashed var(--color-border); border-radius: var(--radius-xl); font-size: var(--text-sm); }

/* ---------- Champion ---------- */
.champion-banner { background: linear-gradient(135deg, oklch(from var(--color-gold) l c h / 0.15), oklch(from var(--color-primary) l c h / 0.1)); border: 1px solid var(--color-gold); border-radius: var(--radius-xl); padding: var(--space-8); text-align: center; margin-bottom: var(--space-8); }
.champion-crown { font-size: 3rem; margin-bottom: var(--space-3); }
.champion-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; color: var(--color-gold); letter-spacing: 0.04em; }
.champion-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-2); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: oklch(0 0 0 / 0.7); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: var(--space-4); opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-8); max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform var(--transition); max-height: 90dvh; overflow-y: auto; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }
.modal-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.modal-close:hover { background: var(--color-surface-offset); color: var(--color-text); }
.modal-footer { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6); flex-wrap: wrap; }

/* ---------- Score input ---------- */
.score-input-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-4); }
.score-input-row .vs { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-text-faint); text-align: center; }
.score-number { text-align: center; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; }

/* ---------- Player rows ---------- */
.player-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.player-num { width: 26px; height: 26px; border-radius: var(--radius-full); background: var(--color-surface-offset); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); flex-shrink: 0; }
.player-row .form-input { flex: 1; }
.player-chip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--color-surface-2); border-radius: var(--radius-md); font-size: var(--text-sm); }
.stat-edit-row { display: grid; grid-template-columns: 1fr 52px 52px 52px; gap: var(--space-2); margin-bottom: 6px; }
.stat-edit-head { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.stat-edit-head span { text-align: center; }
.stat-edit-head span:first-child { text-align: left; }
.stat-num { padding: var(--space-2) 4px; text-align: center; }

/* ---------- Mapas da série ---------- */
.match-card { display: flex; flex-direction: column; gap: 4px; }
.map-lines { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding-left: var(--space-2); }
.map-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 4px var(--space-3); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-xs); }
.map-line.clickable { cursor: pointer; }
.map-line.clickable:hover { border-color: var(--color-primary); }
.map-line .ml-map { font-weight: 600; }
.map-line .ml-score { font-family: var(--font-display); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.map-line .ml-score i { color: var(--color-text-faint); font-style: normal; }
.map-line .ml-score b.win { color: var(--color-success); }
.map-add { align-self: flex-start; font-size: var(--text-xs); font-weight: 600; color: var(--color-primary); padding: 4px var(--space-3); border: 1px dashed var(--color-border); border-radius: var(--radius-md); background: transparent; cursor: pointer; }
.map-add:hover { border-color: var(--color-primary); }
.map-stats-team { margin-top: var(--space-5); }
.map-stats-team h4 { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); }
.modal-lg { max-width: 680px; }
.map-line .ml-map { flex: 1; }

/* ---------- Status do confronto (horário / W.O.) ---------- */
.match-meta { display: flex; gap: var(--space-2); padding-left: var(--space-2); font-size: var(--text-xs); }
.match-meta .live-tag { color: var(--color-error); font-weight: 700; }
.match-meta .badge-wo { color: var(--color-warning); font-weight: 600; }
.match-meta .sched { color: var(--color-text-muted); }
.match-actions { display: flex; justify-content: flex-end; }
.match-opt { font-size: var(--text-xs); color: var(--color-text-muted); padding: 2px var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: transparent; cursor: pointer; }
.match-opt:hover { border-color: var(--color-primary); color: var(--color-text); }

/* ---------- Scoreboard por mapa (público, expansível) ---------- */
.map-det { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2); overflow: hidden; }
.map-det > summary { list-style: none; cursor: pointer; }
.map-det > summary::-webkit-details-marker { display: none; }
.map-det > summary.map-line { border: none; background: transparent; border-radius: 0; }
.map-det[open] > summary.map-line { border-bottom: 1px solid var(--color-border); }
.ml-caret { color: var(--color-text-faint); font-size: 0.8em; transition: transform var(--transition); }
.map-det[open] .ml-caret { transform: rotate(180deg); }
/* Times empilhados na vertical: o card vive numa coluna estreita do grid de
   jogos, então 2 colunas cortariam o segundo time. */
.map-sb-wrap { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-3); }
.map-sb-name { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: var(--text-xs); margin-bottom: 4px; }
.map-sb { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.map-sb th { text-align: center; color: var(--color-text-muted); font-weight: 600; padding: 2px 4px; }
.map-sb th:first-child { text-align: left; }
.map-sb td { text-align: center; padding: 3px 4px; border-top: 1px solid var(--color-border); }
.map-sb td.sb-nick { text-align: left; font-weight: 600; }
.mvp-star { font-size: 0.85em; }

/* ---------- Payment ---------- */
.payment-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: start; }
@media (min-width: 640px) { .payment-grid { grid-template-columns: 240px 1fr; } }
.qr-wrap { background: #fff; padding: var(--space-4); border-radius: var(--radius-lg); display: flex; justify-content: center; }
.qr-wrap img { width: 100%; max-width: 220px; height: auto; }

/* ---------- Hero (páginas públicas) ---------- */
.hero { text-align: center; padding: var(--space-12) var(--space-6) var(--space-8); background: radial-gradient(ellipse at 50% 0%, oklch(from var(--color-primary) l c h / 0.1) 0%, transparent 65%); border-bottom: 1px solid var(--color-divider); }
.hero-tag { display: inline-flex; align-items: center; gap: var(--space-1); background: var(--color-primary-highlight); color: var(--color-primary); border-radius: var(--radius-full); padding: 3px var(--space-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; margin-bottom: var(--space-4); }
.hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; letter-spacing: 0.03em; line-height: 1.1; margin-bottom: var(--space-3); }
.hero-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-6); }

/* ---------- Live badge ---------- */
.live-badge { display: flex; align-items: center; gap: var(--space-1); background: var(--color-primary-highlight); color: var(--color-primary); border-radius: var(--radius-full); padding: 3px var(--space-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- CTA banner ---------- */
.cta-inner { background: linear-gradient(135deg, var(--color-primary-highlight), oklch(from var(--color-primary) l c h / 0.05)); border: 1px solid oklch(from var(--color-primary) l c h / 0.3); border-radius: var(--radius-xl); padding: var(--space-6) var(--space-8); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.cta-text { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.cta-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }

/* ---------- Login ---------- */
.auth-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--space-6); background-image: radial-gradient(ellipse at 20% 30%, oklch(from var(--color-primary) l c h / 0.07) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, oklch(from var(--color-primary) l c h / 0.04) 0%, transparent 50%); }
.auth-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-10) var(--space-8); max-width: 400px; width: 100%; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); text-align: center; }
.auth-logo-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--color-primary), #ff7a5c); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px oklch(from var(--color-primary) l c h / 0.4); }
.auth-logo-icon svg { color: #fff; }
.auth-logo h1 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.04em; }
.auth-logo p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: var(--space-8); left: 50%; transform: translateX(-50%) translateY(20px); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: var(--space-3) var(--space-5); font-size: var(--text-sm); font-weight: 600; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[data-type="warning"] { border-color: var(--color-warning); color: var(--color-warning); }
.toast[data-type="error"] { border-color: var(--color-error); color: var(--color-error); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: var(--space-8) var(--space-6); border-top: 1px solid var(--color-divider); color: var(--color-text-faint); font-size: var(--text-xs); }
.site-footer a { color: var(--color-text-muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--color-primary); }

/* ---------- Mobile nav ---------- */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-2) var(--space-4); gap: var(--space-1); z-index: 100; }
.mobile-nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2); border-radius: var(--radius-md); font-size: 10px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.mobile-nav-btn.active { color: var(--color-primary); background: var(--color-primary-highlight); }
.mobile-nav-btn svg { width: 20px; height: 20px; }

/* ---------- Utilities ---------- */
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.ml-auto { margin-left: auto; }
.mt-6 { margin-top: var(--space-6); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* ---------- Skeleton (carregamento) ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--color-surface-offset); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, oklch(from var(--color-text) l c h / 0.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); flex-shrink: 0; }
.skeleton-line { height: 12px; border-radius: var(--radius-full); }

/* ---------- Contagem regressiva ---------- */
.countdown { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 auto var(--space-6); padding: var(--space-3) var(--space-5); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.countdown-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }
.countdown-value { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.countdown-value b { color: var(--color-primary); }
.countdown-value small { color: var(--color-text-muted); font-size: 0.7em; font-weight: 500; }

/* ---------- Preview do sorteio ---------- */
#draw-teams-preview { max-height: 320px; overflow-y: auto; }

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
  .topbar-nav { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .main-content { padding: var(--space-6) var(--space-4) calc(72px + var(--space-6)); }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .mobile-nav { display: flex; }
  .cta-inner { flex-direction: column; text-align: center; }
}
