:root {
  /* tema claro */
  --bg: #f4f1e8;
  --bg-2: #ece7d8;
  --surface: #ffffff;
  --surface-2: #fbf9f3;
  --ink: #16221b;
  --ink-soft: #33433a;
  --muted: #6a766e;
  --faint: #97a097;
  --line: #e7e1d2;
  --line-strong: #d8d1bd;
  --green: #0b7a43;
  --green-700: #076233;
  --green-900: #053d21;
  --green-tint: #e7f3eb;
  --accent: #d8392b;
  --accent-soft: #fbeae6;
  --accent-2: #e59a2e;
  --gold: #e7b53c;

  --r-sm: 10px;
  --r-base: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --sh-sm: 0 1px 3px rgba(20, 40, 28, 0.05);
  --sh-base: 0 6px 20px -8px rgba(20, 40, 28, 0.18);
  --sh-lg: 0 24px 60px -22px rgba(11, 61, 33, 0.4);

  --container: 1180px;

  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====================== TopBar ====================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 241, 232, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-700) 45%, var(--accent) 100%);
  box-shadow: var(--sh-base);
}
.brand-text {
  min-width: 0;
}
.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}
@media (max-width: 640px) {
  .topbar-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .topbar-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }
  .brand-text h1 {
    font-size: 15px;
  }
  .brand-text p {
    font-size: 10.5px;
  }
  .topbar-right {
    gap: 6px;
  }
}

/* ====================== Layout ====================== */
.page-shell {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 24px 26px 48px;
  flex: 1;
}

/* ====================== Hero ====================== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 30px 32px;
  margin-bottom: 22px;
  color: #fff;
  background:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 9px),
    linear-gradient(104deg, #053d21 0%, #0b7a43 40%, #c23a2c 100%);
  box-shadow: var(--sh-lg);
}
.hero-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 160%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-badge-ended {
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--gold);
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}
.hero-badge-ended .hero-badge-dot {
  background: var(--gold);
}

/* === Champion Banner === */
.champion-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 18px 22px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: var(--r-lg);
  text-align: center;
}
.champion-crown {
  font-size: 36px;
  line-height: 1;
}
.champion-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 215, 0, 0.8);
}
.champion-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
}
.champion-points {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}
.hero-main h2 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(27px, 3.4vw, 40px);
  line-height: 1.1;
}
.hero-main p {
  margin: 0;
  max-width: 52ch;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}
.hero-retro-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--gold);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.25);
  border: 2px solid transparent;
}
.hero-retro-link:hover {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
  transform: translateY(-1px);
}
.hero-retro-link svg {
  flex-shrink: 0;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 18px;
  border-radius: var(--r-base);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 27px;
  line-height: 1;
}

/* ====================== Context line ====================== */
.context-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.context-welcome {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--green-tint);
  color: var(--green-700);
  font-size: 13.5px;
  font-weight: 600;
}
.context-pill strong {
  color: var(--green-900);
}

/* ====================== Tabs ====================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 15px;
  margin-bottom: 22px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-base);
}
.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tab-button svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 640px) {
  .tab-button {
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
  }
  .tab-button svg {
    width: 14px;
    height: 14px;
  }
}
.tab-button:hover {
  color: var(--ink);
}
.tab-button.active {
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(11, 122, 67, 0.55);
}

/* ====================== Panels / fade ====================== */
.panel {
  animation: fadeUp 0.35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.section-head .count {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

/* ====================== MatchCard grid ====================== */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.finalized-summary {
  display: grid;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(34, 106, 72, 0.95), rgba(24, 78, 51, 0.98));
  border: 1px solid rgba(47, 164, 114, 0.38);
  border-radius: var(--r-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}
.finalized-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.finalized-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: center;
}
.finalized-left {
  display: grid;
  gap: 10px;
}
.finalized-label {
  color: #d7d88f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.finalized-champion {
  color: #fff;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.05;
}
.finalized-meta {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 600;
}
.finalized-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.finalized-team-block {
  display: grid;
  gap: 10px;
  justify-items: center;
}
.finalized-flag {
  width: 48px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}
.finalized-team-block span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finalized-result {
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 900;
  color: var(--gold);
  text-align: center;
}
.finalized-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
}
.finalized-note {
  margin: 0;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
}
.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.match-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-base);
}
.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.phase-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-700);
}
.weight-pill {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--green-tint);
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
}
.match-date {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
}
.status-pill.open {
  background: var(--green-tint);
  color: var(--green-700);
}
.status-pill.closed {
  background: #eef0ec;
  color: var(--muted);
}
.status-pill.in-progress {
  background: #fff3e0;
  color: #b76e1a;
}
.status-pill.in-progress .status-dot {
  background: #e59a2e;
}
.status-pill.in-progress .status-dot.live-pulse {
  animation: livePulse 1.2s infinite;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.status-pill.open .status-dot {
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 122, 67, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(11, 122, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 122, 67, 0); }
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 154, 46, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(229, 154, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 154, 46, 0); }
}

.score-cols {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
  margin-bottom: 6px;
  padding-right: 2px;
}
.score-cols span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  width: 46px;
  text-align: center;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.team-row + .team-row {
  border-top: 1px dashed var(--line-strong);
}
.team-flag {
  width: 46px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.team-flag.sm {
  width: 26px;
  height: 20px;
}
.standings-table tr.qualify td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.team-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
}
.team-scores {
  display: flex;
  align-items: center;
  gap: 12px;
}
.score-input {
  width: 54px;
  height: 48px;
  text-align: center;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.score-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint);
}
.score-box {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
}
.score-box.official {
  background: var(--ink);
  color: var(--surface-2);
}
.score-box.guess {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.match-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.match-foot-note {
  font-size: 13px;
  color: var(--muted);
}
.match-foot-note strong {
  color: var(--ink);
}
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 16px -6px rgba(11, 122, 67, 0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-save:hover {
  transform: translateY(-1px);
}

/* points banner */
.points-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-base);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.points-seal {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
}
.points-seal.gold {
  background: linear-gradient(135deg, var(--gold), var(--accent-2));
  color: #fff;
}
.points-seal.zero {
  background: #eef0ec;
  color: var(--muted);
}
.points-cat {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ====================== Results ====================== */
.summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
  background: var(--green-tint);
  border: 1px solid rgba(11, 122, 67, 0.18);
}
.summary-check {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.summary-card strong {
  display: block;
  font-size: 15px;
  color: var(--green-900);
}
.summary-card span {
  font-size: 13.5px;
  color: var(--green-700);
}
.result-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  width: 100%;
}
.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: var(--r-base);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  box-shadow: var(--sh-sm);
  flex-wrap: wrap;
}
.result-card.scored {
  border-left-color: var(--gold);
}
.result-main {
  min-width: 0;
}
.result-score-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.result-score-line .score {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--green-700);
  font-size: 18px;
}
.result-meta {
  font-size: 13px;
  color: var(--muted);
}
.result-meta strong {
  color: var(--ink);
}
.result-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.mini-tag {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ====================== Ranking ====================== */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 28px;
  padding-top: 10px
}
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-base);
  text-align: center;
}
.podium-card.first {
  transform: translateY(-12px);
  border-color: var(--gold);
  box-shadow: 0 24px 50px -20px rgba(231, 181, 60, 0.6);
}
.podium-card.first::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 40%;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(180deg, rgba(231, 181, 60, 0.16), transparent);
  pointer-events: none;
}
.medal {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  color: var(--ink);
}
.medal.gold { background: linear-gradient(135deg, #f3cf5e, #d99a1f); }
.medal.silver { background: linear-gradient(135deg, #d7dade, #a7adb4); }
.medal.bronze { background: linear-gradient(135deg, #e0a874, #b9763d); }
.podium-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}
.podium-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.podium-points {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
}
.podium-points small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.rank-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
table.rank-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}
.rank-table thead th {
  text-align: left;
  padding: 6px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.rank-table tbody td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.rank-table tbody tr:last-child td {
  border-bottom: none;
}
.rank-table tbody tr.me {
  background: var(--green-tint);
  box-shadow: inset 4px 0 0 var(--green);
}
.pos-badge {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}
.pos-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  padding-left: 4px;
}
.rank-part {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rank-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
}
.rank-name {
  font-weight: 600;
  font-size: 13px;
}
.you-badge {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.rank-points {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  min-width: 30px;
}
.btn-ghost {
  padding: 4px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green-700);
}
.btn-solid {
  padding: 4px 8px;
  border-radius: var(--r-pill);
  border: none;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ====================== Drawer ====================== */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 30, 20, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  animation: scrimIn 0.25s forwards;
}
@keyframes scrimIn { to { opacity: 1; } }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 100%);
  z-index: 95;
  background: var(--bg);
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  animation: drawerIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes drawerIn { to { transform: translateX(0); } }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-head .rank-avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
}
.drawer-head h3 {
  margin: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 800;
}
.drawer-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}
.drawer-close:hover { color: var(--ink); }
.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 24px;
}
.drawer-stat {
  padding: 12px;
  border-radius: var(--r-base);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.drawer-stat .label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.drawer-stat .val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}
.drawer-table {
  width: 100%;
  border-collapse: collapse;
}
.drawer-table th {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: left;
  padding: 10px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.drawer-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.drawer-table .center { text-align: center; }
.drawer-table .muted { color: var(--faint); font-style: italic; }
.drawer-table .pts {
  font-family: var(--font-display);
  font-weight: 800;
}

/* ====================== Rules ====================== */
.rules-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  align-items: start;
}
.rules-grid .full { grid-column: 1 / -1; }
.rule-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-sm);
}
.rule-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}
.rule-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rule-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.rule-seal {
  flex: none;
  min-width: 40px;
  padding: 5px 8px;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}
.rule-seal.gold { background: linear-gradient(135deg, var(--gold), var(--accent-2)); color: #fff; }
.rule-seal.green { background: var(--green-tint); color: var(--green-700); }
.rule-seal.red { background: var(--accent-soft); color: var(--accent); }
.rule-seal.gray { background: #eef0ec; color: var(--muted); }

.mult-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.mult-row .nm {
  width: 130px;
  font-size: 13.5px;
  font-weight: 600;
}
.mult-bar {
  flex: 1;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  overflow: hidden;
}
.mult-bar > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green), var(--gold));
}
.mult-pill {
  min-width: 34px;
  text-align: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--green-tint);
  color: var(--green-700);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
}
.rule-example {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-base);
  background: var(--green-tint);
  border: 1px solid rgba(11, 122, 67, 0.18);
  font-size: 13.5px;
  color: var(--green-900);
}
.tiebreak {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: tb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tiebreak li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  counter-increment: tb;
}
.tiebreak li::before {
  content: counter(tb);
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
}

/* ====================== Forms / entry / shared ====================== */
.entry-card {
  max-width: 460px;
  margin: 8px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--sh-base);
}
.banner {
  padding: 14px 16px;
  border-radius: var(--r-base);
  margin-bottom: 16px;
  background: var(--green-tint);
  border: 1px solid rgba(11, 122, 67, 0.18);
  color: var(--green-900);
  font-weight: 600;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
label {
  font-weight: 600;
  font-size: 14px;
}
input, select, textarea {
  font: inherit;
  font-family: var(--font-ui);
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint);
}
button {
  font-family: var(--font-ui);
  cursor: pointer;
}
.btn-primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 16px -6px rgba(11, 122, 67, 0.5);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.link-muted {
  color: var(--green-700);
  text-decoration: underline;
  font-size: 13.5px;
  cursor: pointer;
}
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  padding: 12px 14px;
  border-radius: var(--r-base);
  border: 1px solid var(--line);
  background: var(--surface);
}
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.small { font-size: 13px; color: var(--muted); }
.small-btn {
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.status { min-height: 22px; margin-bottom: 14px; font-weight: 700; font-size: 14px; }
.status.success { color: var(--green-700); }
.status.error { color: var(--accent); }
.status.info { color: var(--accent-2); }
.loading, .empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* ====================== Modal ====================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 30, 20, 0.5);
  backdrop-filter: blur(4px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--sh-lg);
}
.modal-card h3 { margin: 0 0 10px; font-size: 19px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}
.modal-actions button {
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
}
button.secondary {
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}
button.danger {
  background: linear-gradient(135deg, var(--accent), #b8281c);
  color: #fff;
}

/* ====================== Footer ====================== */
.site-footer {
  margin-top: auto;
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 26px 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

/* ====================== Responsive ====================== */
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .game-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .podium {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
  }
  .podium-card {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    gap: 4px;
  }
  .podium-card.first {
    transform: translateY(-6px);
  }
  .podium-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
  .podium-points {
    font-size: 18px;
  }
  .podium-name {
    font-size: 11px;
  }
  .medal {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
  .rank-table tbody td {
    padding: 4px 4px;
  }
  .rank-name {
    font-size: 12px;
  }
  .rank-points {
    font-size: 12px;
    min-width: 26px;
  }
  .pos-num {
    font-size: 12px;
  }
  .rank-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  .btn-ghost, .btn-solid {
    padding: 3px 6px;
    font-size: 10px;
  }
  .you-badge {
    font-size: 8px;
    padding: 1px 4px;
  }
  .rank-delta {
    font-size: 9px;
    margin-left: 3px;
  }
  .engagement-countdown {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .engagement-countdown .engagement-clock {
    font-size: 20px;
  }
  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .result-score-line {
    font-size: 14px;
    gap: 6px;
  }
  .result-score-line .team-flag.sm {
    width: 20px;
    height: 14px;
  }
  .result-right {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .result-right .btn-historic {
    width: 100%;
    text-align: center;
    justify-content: center;
    margin-top: 2px !important;
  }
  .brand-text p { display: none; }
  .hero { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-value { font-size: 20px; }
  .topbar-inner, .page-shell, .footer-inner { padding-left: 16px; padding-right: 16px; }
}

/* ====================== Mobile: match-card compacto ====================== */
@media (max-width: 640px) {
  .match-card {
    padding: 14px;
  }
  .match-top {
    margin-bottom: 10px;
  }
  .match-top .phase-tag {
    font-size: 10px;
  }
  .match-top .match-date {
    font-size: 11px;
  }
  .team-row {
    padding: 8px 0;
    gap: 8px;
  }
  .team-flag {
    width: 32px;
    height: 24px;
  }
  .team-name {
    font-size: 13px;
  }
  .team-scores {
    gap: 8px;
  }
  .score-input {
    width: 44px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }
  .score-box {
    width: 38px;
    height: 34px;
    font-size: 16px;
  }
  .score-cols {
    gap: 18px;
  }
  .score-cols span {
    width: 38px;
    font-size: 9.5px;
  }
  .finalized-content {
    grid-template-columns: 1fr;
  }
  .finalized-score {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .finalized-team-block {
    gap: 8px;
  }
  .finalized-flag {
    width: 44px;
    height: 30px;
  }
  .finalized-team-block span {
    max-width: 100%;
    white-space: normal;
  }
  .finalized-badge {
    width: 100%;
    justify-content: center;
  }
  .finalized-left {
    text-align: center;
  }
  .finalized-date,
  .finalized-note {
    font-size: 14px;
  }
  .match-foot {
    margin-top: 10px;
    padding-top: 10px;
    gap: 8px;
  }
  .match-foot-note {
    font-size: 12px;
  }
  .btn-save {
    padding: 8px 14px;
    font-size: 13px;
  }
  .points-banner {
    padding: 8px 12px;
    margin-top: 10px;
  }
  .points-seal {
    font-size: 12px;
    padding: 4px 9px;
  }
  .points-cat {
    font-size: 12px;
  }
  .status-pill {
    font-size: 11px;
    padding: 4px 9px;
  }
  .match-history-toggle {
    font-size: 11.5px !important;
  }
}

/* ====================== Scroll to Top ====================== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  box-shadow: var(--sh-base);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, box-shadow 0.2s;
  will-change: opacity, transform;
  -webkit-tap-highlight-color: transparent;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(11, 122, 67, 0.55);
}
.scroll-top svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
@media (max-width: 600px) {
  .scroll-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
  .scroll-top svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ====================== Compat (painel admin) ====================== */
:root {
  --text: var(--ink);
  --border: var(--line);
  --secondary: var(--accent);
  --primary: var(--green);
  --primary-strong: var(--green-700);
  --surface-strong: var(--surface-2);
  --admin: #8a05be;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 241, 232, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .brand-block > div h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.site-header .brand-block > div p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.header-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-base);
}
.card button {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--green), var(--green-700));
  color: #fff;
  font-weight: 700;
}
.card button.admin { background: linear-gradient(135deg, var(--admin), #6d1aa3); }
.card button.secondary { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line-strong); }
.card button.danger { background: linear-gradient(135deg, var(--accent), #b8281c); color: #fff; }
.hero > h2 {
  margin: 8px 0 10px;
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}
.hero > p {
  margin: 0;
  max-width: 60ch;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   Roadmap: widget de engajamento (item 2)
   ============================================================ */
.engagement-widget {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  box-shadow: var(--sh-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.engagement-progress { flex: 1 1 280px; }
.engagement-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.engagement-label strong { font-family: var(--font-display); font-size: 14.5px; }
.engagement-bar {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  overflow: hidden;
}
.engagement-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green), var(--green-700));
  transition: width 0.6s ease;
}
.engagement-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 150px;
}
.engagement-next { font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.engagement-clock {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Roadmap: delta de posição no ranking (5.1)
   ============================================================ */
.rank-delta {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  vertical-align: middle;
}
.rank-delta.up { color: var(--green); }
.rank-delta.down { color: var(--accent); }
.rank-delta.same { color: var(--faint); }

/* ============================================================
   Roadmap: exportação do ranking (item 5)
   ============================================================ */
.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   Roadmap: tabela do torneio (rascunho 3)
   ============================================================ */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}
.standings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  padding: 16px;
  box-shadow: var(--sh-sm);
}
.standings-card h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 15px;
}
.standings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings-table th {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 4px;
  text-align: center;
}
.standings-table th.left, .standings-table td.left { text-align: left; }
.standings-table td {
  padding: 7px 4px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.standings-table tr.qualify td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.bracket {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.bracket-col { min-width: 230px; flex: 1; }
.bracket-col h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 14px;
  text-align: center;
  color: var(--ink-soft);
}
.bracket-match {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: var(--sh-sm);
}
.bracket-match.decided { border-color: var(--line-strong); }
.bracket-team {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  font-size: 13px;
}
.bracket-team .nm { flex: 1; }
.bracket-team .sc { font-family: var(--font-display); font-weight: 800; }
.bracket-team.winner .nm, .bracket-team.winner .sc { color: var(--green-700); font-weight: 700; }
.bracket-date { text-align: right; color: var(--faint); margin-top: 4px; }

/* ============================================================
   Mata-mata — chaveamento FIFA 2026 (32 seleções)
   ============================================================ */
.ko-banner {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.ko-scroll-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 2px 10px;
}
.ko-bracket {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  -webkit-overflow-scrolling: touch;
}
.ko-col {
  min-width: 188px;
  display: flex;
  flex-direction: column;
}
.ko-col-head {
  font-family: var(--font-display);
  font-size: 13px;
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ko-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}
.ko-match {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px;
  box-shadow: var(--sh-sm);
}
.ko-match.decided { border-color: var(--line-strong); }
.ko-match.projected { border-style: dashed; opacity: 0.94; }
.ko-penalty-note {
  font-size: 10.5px;
  color: var(--accent-2);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.ko-team {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
  font-size: 12.5px;
}
.ko-team + .ko-team { border-top: 1px solid var(--line); }
.ko-team .nm {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ko-team .sc { font-family: var(--font-display); font-weight: 800; }
.ko-team.winner .nm, .ko-team.winner .sc { color: var(--green-700); font-weight: 700; }
.ko-team.tbd .nm { color: var(--muted); }
.ko-tbd { font-style: italic; font-size: 11.5px; }
.ko-flag-tbd {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 10px;
  color: var(--muted);
}
.ko-date {
  text-align: center;
  color: var(--faint);
  font-size: 11px;
  margin-top: 5px;
}
.ko-thirdplace {
  margin-top: 18px;
  max-width: 250px;
}
.ko-grp {
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}

/* Dash navigation from participant panel */
.dash-nav-info {
  margin: 12px 0;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.dash-nav-info a {
  color: var(--green-700);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dash-nav-info a:hover {
  text-decoration: underline;
}
a.btn-historic,
.btn-historic {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.btn-historic:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-sair {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}
.btn-sair:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ──────────────────────────────────────────────
   Save All — Botão Flutuante
   ────────────────────────────────────────────── */
.save-all-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  animation: slideUpFab 0.3s ease-out;
}

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

.btn-save-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #0B7A43, #0A6A3A);
  color: #FFFFFF;
  border: none;
  border-radius: 50px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-save-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #0C8A4A, #0B7A43);
}

.btn-save-all:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-save-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.save-all-icon {
  display: flex;
  align-items: center;
}

.save-all-badge {
  background: #FFD700;
  color: #16221B;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .save-all-fab {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .btn-save-all {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    padding: 16px 20px;
  }
}

/* ===== Dash Accordion ===== */
.dash-accordion {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  margin-bottom: 14px;
  overflow: hidden;
}
.dash-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: var(--surface-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-appearance: none;
}
.dash-accordion-toggle:hover {
  background: var(--line);
}
.dash-accordion-arrow {
  transition: transform 0.2s ease;
}
.dash-accordion-arrow.open {
  transform: rotate(180deg);
}
.dash-accordion-body {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.dash-accordion-body.open {
  display: block;
}
.dash-accordion-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ===== Dash Rounds Filter ===== */
.dash-rounds-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-rounds-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.dash-rounds-select {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-width: 70px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%236a766e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}
.dash-rounds-select:hover {
  border-color: var(--green);
}
.dash-rounds-select:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 2px var(--green-tint);
}
.dash-rounds-info {
  font-size: 12px;
  color: var(--muted);
}

/* ====================== Welcome Modal ====================== */
.welcome-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeUp 0.35s ease;
}

.welcome-header {
  padding: 28px 28px 0;
  flex: none;
}
.welcome-header h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.welcome-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.welcome-grid {
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}

.welcome-feature {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-base);
  border: 1px solid var(--line);
  background: var(--surface-2);
  align-items: flex-start;
}

.welcome-feature-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--green-tint);
  color: var(--green-700);
}
.welcome-feature-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-feature-body {
  min-width: 0;
}
.welcome-feature-body h4 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.welcome-feature-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.welcome-footer {
  padding: 16px 28px 24px;
  flex: none;
  border-top: 1px solid var(--line);
  text-align: center;
}
.welcome-footer .btn-primary {
  width: auto;
  min-width: 140px;
  padding: 11px 28px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .welcome-grid {
    grid-template-columns: 1fr;
    padding: 18px 20px;
  }
  .welcome-header {
    padding: 22px 20px 0;
  }
  .welcome-footer {
    padding: 14px 20px 20px;
  }
}

/* ====================== Filter bar (palpites) ====================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--r-base);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.filter-bar-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.filter-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.filter-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====================== Today highlight ====================== */
.today-tag {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.match-card.today {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, #fffcf0, #fff8e0);
}

/* ====================== Team History (Feature v3.0) ====================== */
.match-history {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.match-history-toggle {
  font-size: 12.5px !important;
  cursor: pointer;
  width: 100%;
  text-align: center;
  justify-content: center;
}
.match-history-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  opacity: 0;
  margin-top: 0;
}
.match-history-body.open {
  max-height: 500px;
  opacity: 1;
  margin-top: 12px;
}
.history-empty {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  padding: 10px 0;
  font-style: italic;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  flex-wrap: wrap;
}
.history-item:last-child {
  border-bottom: none;
}
.history-teams {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.history-score {
  font-weight: normal;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--muted);
  margin-left: auto;
}
.history-phase {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 9.5px;
  color: var(--faint);
  display: none; /* oculta fase no mobile para evitar overflow */
}
.history-date {
  font-weight: 500;
  white-space: nowrap;
}
.team-flag.micro {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .history-phase {
    display: inline;
  }
  .history-score {
    font-size: 13px;
  }
  .history-item {
    font-size: 12.5px;
  }
}

/* ====================== Results Filters (Feature v3.0) ====================== */
.results-filters {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
}
.results-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.results-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.results-filter-group label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.results-filter-group select,
.results-filter-group input[type="date"] {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  cursor: pointer;
}
.results-filter-group select:focus,
.results-filter-group input[type="date"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.results-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.results-active-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--green-tint);
  border: 1px solid rgba(11, 122, 67, 0.2);
  color: var(--green-700);
  font-size: 12px;
  font-weight: 600;
}
.results-active-filters .btn-ghost {
  font-size: 11.5px;
  padding: 4px 10px;
}
@media (max-width: 640px) {
  .results-filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  .results-filter-group {
    min-width: 0;
  }
}
