/* cards.css — Design system dos cards (portado do webscrap-futebol)
 * Carregado DEPOIS de styles.css; vence nas classes em comum (.game, .badge…).
 * Os cards são sempre escuros (design webscrap), independente do tema do bolão. */

:root {
  --c-bg-secondary: #16211D;
  --c-bg-tertiary: #1E2B25;
  --c-border: #33433C;
  --c-text-main: #E8F0EC;
  --c-text-muted: #9AAAA2;
  --c-accent-blue: #1B9E6B;
  --c-accent-green: #1B9E6B;
  --c-accent-red: #E5484D;
  --c-accent-yellow: #F4C430;
  --c-bumper-mint: #6ff5d6;
  --c-bumper-blue: #315cf6;
  --c-bumper-lime: #a7e33b;
  --c-card-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
  --c-transition: all .15s ease-in-out;
}

.hidden { display: none !important; }

/* ───────────── navegação no header ───────────── */
.header-nav {
  display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px;
  position: relative; z-index: 1;
}
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.7);
  text-decoration: none; font-family: Oswald, sans-serif; font-size: 15px;
  text-transform: uppercase; font-weight: 500; letter-spacing: .05em;
  padding: 6px 14px; border-radius: 8px; border: 1px solid transparent; transition: var(--c-transition);
}
.nav-link svg { stroke-width: 2.2; width: 16px; height: 16px; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: var(--c-accent-yellow); background: rgba(244,196,48,.15); border: 1px solid rgba(244,196,48,.3); }

/* ───────────── selo CazéTV ───────────── */
.cazetv-mark {
  display: inline-flex; align-items: center; justify-content: center; min-height: 18px;
  padding: 2px 6px; border-radius: 5px; background: #f7f0dd; color: #121212;
  border: 1px solid rgba(255,255,255,.45); font-family: Oswald, sans-serif; font-weight: 800;
  font-size: 11px; line-height: 1; text-transform: uppercase; vertical-align: middle;
}
.cazetv-mark::after {
  content: ""; width: 5px; height: 5px; margin-left: 5px; border-radius: 50%;
  background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.18);
}
.cazetv-mark--mini { min-height: 16px; padding: 1px 5px; font-size: 9px; }

/* ───────────── filtros (chaveamento) ───────────── */
.filters-container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.filters-bar { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.filter-btn {
  background: var(--c-bg-secondary); border: 1px solid var(--c-border); color: var(--c-text-muted);
  padding: .5rem 1rem; border-radius: 9999px; font: 600 .85rem Inter, sans-serif; cursor: pointer;
  white-space: nowrap; display: flex; align-items: center; gap: .5rem; transition: var(--c-transition);
}
.filter-btn:hover { border-color: var(--c-text-muted); color: var(--c-text-main); }
.filter-btn.active { background: var(--c-accent-blue); color: #fff; border-color: var(--c-accent-blue); }

.rounds-filter-bar { display: flex; gap: .5rem; overflow-x: auto; flex-wrap: wrap; }
.round-tab-btn {
  background: transparent; border: 1px solid var(--c-border); color: var(--c-text-muted);
  padding: .4rem .85rem; border-radius: 8px; font: 600 .8rem Inter, sans-serif; cursor: pointer;
  white-space: nowrap; transition: var(--c-transition);
}
.round-tab-btn:hover { color: var(--c-text-main); border-color: var(--c-text-muted); }
.round-tab-btn.active { background: rgba(244,196,48,.15); color: var(--c-accent-yellow); border-color: rgba(244,196,48,.3); }

/* ───────────── estados ───────────── */
.loading-state, .error-state, .empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 4rem 2rem; background: var(--c-bg-secondary); border: 1px solid var(--c-border); border-radius: 1rem; gap: 1rem;
  color: var(--c-text-main);
}
.spinner { width: 40px; height: 40px; border: 4px solid var(--c-border); border-top-color: var(--c-accent-blue); border-radius: 50%; animation: c-spin 1s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }
.error-icon { font-size: 3rem; }
.empty-icon { font-size: 3.5rem; opacity: .4; }
.btn-retry { background: var(--c-accent-blue); color: #fff; border: none; padding: .5rem 1.25rem; border-radius: .5rem; font-weight: 600; cursor: pointer; }

/* ───────────── grade de partidas ───────────── */
.matches-grid-container { display: flex; flex-direction: column; gap: 2.5rem; }
.group-section { display: flex; flex-direction: column; gap: 1.25rem; }
.group-header {
  font-family: Oswald, sans-serif; text-transform: uppercase; letter-spacing: .04em; font-size: 1.2rem; font-weight: 600;
  color: var(--c-text-main); border-left: 4px solid var(--c-accent-blue); padding: 0 0 .5rem .75rem;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--c-border);
}
.group-header-meta { font-size: .8rem; font-weight: 400; color: var(--c-text-muted); }
.matches-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .matches-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .matches-grid { grid-template-columns: 1fr; } }

/* ───────────── card de partida ───────────── */
.game {
  background:
    radial-gradient(circle at 12% 0%, rgba(244,196,48,.12), transparent 32%),
    linear-gradient(160deg, #0B1F1A 0%, #16211D 100%);
  color: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--c-card-shadow);
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--c-border); transition: var(--c-transition);
  position: relative; overflow: hidden; min-height: 300px;
}
.game::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 62%, rgba(111,245,214,.08) 62.2% 64%, transparent 64.2%),
    linear-gradient(135deg, rgba(255,255,255,.06), transparent 42%);
}
.game::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px; pointer-events: none; opacity: .9;
  background: linear-gradient(90deg, var(--c-bumper-mint), var(--c-bumper-blue) 34%, var(--c-accent-red) 67%, var(--c-bumper-lime));
}
.game > * { position: relative; z-index: 1; }
.game:has(.match-scorers-container), .game:has(.match-card-cards), .game:has(.live-stream-player:not(.hidden)) { min-height: 320px; }
@media (max-width: 480px) { .game { min-height: auto; } }
.game:hover { transform: translateY(-2px); border-color: rgba(27,158,107,.4); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.game.live-card { border-color: rgba(229,72,77,.4); }

.game-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.game-meta { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .06em; color: #9DBBAE; }
.game-meta .grp { color: var(--c-accent-yellow); font-weight: 600; }
.game-meta .round-label { color: #c5e1a5; font-weight: 500; }

.badge { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.live { background: rgba(229,72,77,.18); color: #FF9C9E; display: inline-flex; align-items: center; gap: 6px; }
.badge.post { background: rgba(157,187,174,.16); color: #B9D2C6; }
.badge.pre { background: rgba(244,196,48,.14); color: var(--c-accent-yellow); }

.matchup-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 66px;
  background:
    linear-gradient(135deg, rgba(52,238,196,.85), rgba(91,79,240,.75) 18%, transparent 18.5% 81.5%, rgba(148,211,44,.88) 82%),
    #030403;
  border: 1px solid rgba(255,255,255,.16); border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.62), 0 12px 24px rgba(0,0,0,.22);
  padding: 6px 10px; margin-bottom: 8px; overflow: hidden;
}
.team-block { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; height: 100%; }
.team-block.home { justify-content: flex-start; }
.team-block.away { justify-content: flex-end; }
.team-emblem {
  width: 40px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px;
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px rgba(0,0,0,.28);
  overflow: hidden; color: var(--c-accent-yellow); font-family: "JetBrains Mono", monospace; font-size: 16px; font-weight: 800;
}
.team-emblem img { width: 100%; height: 100%; object-fit: contain; padding: 3px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.team-emblem--fallback, .team-emblem__fallback { line-height: 1; }
.team-block .team-name {
  font-family: Oswald, sans-serif; font-size: clamp(15px, 1.55vw, 20px); font-weight: 800; color: #f9faf6;
  text-shadow: 0 2px 0 rgba(0,0,0,.78), 0 0 12px rgba(0,0,0,.62); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.match-score-center {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 122px; height: 56px; padding: 0 8px; border-radius: 18px;
  background: linear-gradient(180deg, #78f4d7, #45debd); border: 1px solid rgba(255,255,255,.45);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.36), inset 0 -3px 0 rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.25);
}
.match-score-center .score-val { font-family: Oswald, sans-serif; font-size: 34px; font-weight: 800; line-height: 1; min-width: 26px; color: #06100c; text-align: center; text-shadow: 0 1px 0 rgba(255,255,255,.22); }
.match-score-center .score-val.empty { color: #335; opacity: .55; }
.match-score-center .vs-divider { font-family: "JetBrains Mono", monospace; font-size: 11px; color: #06100c; background: rgba(255,255,255,.55); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.score-trophy {
  width: 34px; height: 46px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 4px;
  background: #020202; border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 4px 8px rgba(0,0,0,.3);
}
.score-trophy img { width: 100%; height: 100%; object-fit: contain; }
.matchup-bar .qualified-badge { display: none; }

@media (max-width: 480px) {
  .matchup-bar { gap: 6px; min-height: 58px; padding: 5px 7px; }
  .team-block .team-name { font-size: 14px; }
  .match-score-center { min-width: 110px; height: 50px; padding: 0 7px; border-radius: 15px; }
  .match-score-center .score-val { font-size: 30px; min-width: 22px; }
}

/* artilheiros */
.match-scorers-container {
  display: flex; justify-content: space-between; align-items: flex-start; font-size: .75rem; color: var(--c-text-muted);
  background: rgba(255,255,255,.015); border-top: 1px dashed rgba(255,255,255,.06); border-bottom: 1px dashed rgba(255,255,255,.06);
  padding: .5rem .25rem; margin: -.1rem 0 .25rem; gap: .5rem;
}
.home-scorers, .away-scorers { width: 42%; display: flex; flex-direction: column; gap: .15rem; }
.home-scorers { text-align: right; align-items: flex-end; }
.away-scorers { text-align: left; align-items: flex-start; }
.scorers-icon { width: 16%; text-align: center; font-size: .75rem; opacity: .4; align-self: center; }
.scorer-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* cartões */
.match-card-cards { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px 10px; font-size: 10px; color: #A3C0B3; margin-top: 6px; border: 1px solid rgba(255,255,255,.03); }
.team-cards { display: flex; flex-direction: column; gap: 3.5px; width: 45%; }
.team-cards.home-cards { align-items: flex-start; }
.team-cards.away-cards { align-items: flex-end; }
.cards-separator { font-size: 11px; opacity: .25; color: #fff; }
.player-card { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card-mini { display: inline-block; width: 8px; height: 11px; border-radius: 1.5px; flex-shrink: 0; }
.card-mini.yellow { background: #ffd700; border: 1px solid #cca100; box-shadow: 0 0 6px rgba(255,215,0,.4); }
.card-mini.red { background: #ff3b30; border: 1px solid #d32f2f; box-shadow: 0 0 6px rgba(255,59,48,.4); }
.card-player-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* posse de bola */
.match-card-stats { background: rgba(255,255,255,.02); border-top: 1px dashed var(--c-border); padding-top: .75rem; margin-top: .25rem; }
.stat-row { display: flex; flex-direction: column; gap: .25rem; font-size: .75rem; font-weight: 600; }
.stat-labels { display: flex; justify-content: space-between; color: var(--c-text-muted); }
.stat-title { color: var(--c-text-main); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.stat-bar-container { height: 6px; background: var(--c-bg-tertiary); border-radius: 9999px; overflow: hidden; display: flex; }
.stat-bar-left { height: 100%; background: var(--c-accent-blue); transition: width .5s ease-out; }
.stat-bar-right { height: 100%; background: var(--c-accent-red); transition: width .5s ease-out; }

/* fonte / estádio */
.source { margin-top: 9px; font-size: 11px; color: #9DBBAE; font-family: "JetBrains Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }

/* CazéTV embed */
.cazetv-embed-container { margin-top: .5rem; display: flex; flex-direction: column; gap: .5rem; width: 100%; }
.btn-watch-live { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; border: none; padding: .5rem 1rem; border-radius: .5rem; font-weight: 700; font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 40px; transition: var(--c-transition); }
.btn-watch-live:hover { background: linear-gradient(135deg, #f43f5e, #e11d48); transform: translateY(-1px); }
.btn-watch-live.is-open { background: linear-gradient(135deg, #1b2430, #0b1118); border: 1px solid rgba(255,255,255,.16); }
.pulse-indicator-small { width: 8px; height: 8px; background: #fff; border-radius: 50%; display: inline-block; animation: pulse-white 1.5s infinite; }
@keyframes pulse-white { 0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255,255,255,0); } 100% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.live-stream-player { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; border-radius: .5rem; overflow: hidden; border: 1px solid var(--c-border); background: #000; }
.live-stream-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ───────────── chaveamento (bracket) ───────────── */
.bracket-tree-container {
  position: relative; overflow: auto; border: 1px solid var(--c-border); border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(244,196,48,.05), transparent 28%, transparent 72%, rgba(244,196,48,.05)),
    radial-gradient(circle at center top, rgba(27,158,107,.18), transparent 36%), #0B1411;
  box-shadow: var(--c-card-shadow); padding: 16px; cursor: grab;
}
.bracket-tree-container.dragging { cursor: grabbing; }
.drag-hint { display: inline-flex; align-items: center; margin-bottom: 14px; padding: 7px 11px; border: 1px solid rgba(244,196,48,.28); border-radius: 999px; background: rgba(244,196,48,.08); color: #ffe49b; font-family: "JetBrains Mono", monospace; font-size: 11px; max-width: 100%; }
.bracket-tree-wrapper {
  position: relative; width: 100%; min-width: 780px; display: grid;
  grid-template-columns: 132px minmax(160px, 1fr) minmax(150px, .9fr) minmax(140px, .82fr) minmax(190px, 1.05fr);
  gap: 14px; align-items: center; padding: 8px 4px 18px;
}
.bracket-side-hidden { display: none !important; }
.bracket-group-rail { display: flex; flex-direction: column; gap: 12px; align-self: stretch; justify-content: space-around; position: relative; z-index: 1; min-height: 1240px; }
.bracket-group-card { position: relative; overflow: hidden; border-radius: 14px; background: rgba(8,14,37,.82); border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); padding: 10px 10px 10px 14px; }
.bracket-group-card::before { content: ""; position: absolute; inset: 32px auto 8px 0; width: 5px; border-radius: 0 6px 6px 0; background: linear-gradient(180deg, var(--c-bumper-mint), var(--c-accent-yellow), var(--c-accent-red), var(--c-bumper-blue)); }
.bracket-group-card h4 { margin: 0 0 7px; color: rgba(232,240,236,.58); font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 800; }
.bracket-group-teams { display: flex; flex-direction: column; gap: 5px; }
.bracket-group-team { color: #f4f7ff; font-family: Oswald, sans-serif; font-size: 16px; font-weight: 800; line-height: 1; }
.bracket-group-team:nth-child(4) { opacity: .52; }
.bracket-connectors { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.bracket-connector-path { fill: none; stroke: rgba(164,173,198,.42); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bracket-column { display: flex; flex-direction: column; gap: 14px; min-height: 100%; position: relative; z-index: 1; }
.round-title { position: sticky; top: 0; z-index: 2; margin: 0; padding: 8px 10px; border: none; border-radius: 8px; background: rgba(70,83,132,.62); color: rgba(255,255,255,.82); font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .08em; text-align: center; }
.bracket-matches { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; height: 100%; }
.round-16-col .bracket-matches { min-height: 1240px; }
.round-8-col .bracket-matches { min-height: 880px; }
.round-4-col .bracket-matches { min-height: 540px; }

.compact-game-card { position: relative; overflow: hidden; background: rgba(8,14,37,.86); border: 1px solid rgba(255,255,255,.055); border-left: 5px solid rgba(111,245,214,.6); border-radius: 14px; padding: 7px 8px; box-shadow: 0 10px 18px rgba(0,0,0,.18); }
.compact-live { border-left-color: var(--c-accent-red); }
.compact-header { display: flex; justify-content: space-between; color: var(--c-text-muted); font-family: "JetBrains Mono", monospace; font-size: 10px; text-transform: uppercase; margin-bottom: 5px; min-height: 12px; }
.compact-post-header { color: #cfe3d9; }
.compact-live-header { color: #ffb5b7; }
.compact-teams { display: flex; flex-direction: column; gap: 0; }
.compact-team-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 26px; gap: 6px; align-items: center; min-height: 27px; padding: 3px 4px; }
.compact-team-row + .compact-team-row { border-top: 1px solid rgba(164,173,198,.5); }
.compact-team-row.winner { background: rgba(16,185,129,.13); color: #eafff5; }
.compact-team-row.loser { opacity: .58; }
.compact-team-logo { width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(27,158,107,.1)); border: 1px solid rgba(255,255,255,.2); overflow: hidden; color: var(--c-accent-yellow); font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 800; }
.compact-team-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.compact-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f2f5ff; font-family: Oswald, sans-serif; font-size: 15px; font-weight: 700; text-transform: uppercase; }
.compact-score { color: rgba(232,240,236,.74); font-family: "JetBrains Mono", monospace; font-size: 14px; font-weight: 800; text-align: right; }

.final-container { display: flex; flex-direction: column; justify-content: center; gap: 22px; min-height: 560px; }
.final-box { border: 1px solid rgba(244,196,48,.28); border-radius: 14px; padding: 10px; background: rgba(244,196,48,.06); }
.final-trophy-wrap { width: 92px; height: 150px; margin: -2px auto 10px; }
.final-trophy-wrap img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 7px 10px rgba(0,0,0,.44)); }
.third-place-box { border-color: rgba(157,187,174,.24); background: rgba(157,187,174,.06); }
.badge-final { margin-bottom: 9px; color: var(--c-accent-yellow); font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: center; }
.badge-final.bronze { color: #c7d8d0; }

.bracket-list-container .matches-grid-container { gap: 0; }

@media (max-width: 768px) {
  .bracket-tree-wrapper { min-width: 720px; grid-template-columns: 110px 150px 140px 130px 176px; }
  .bracket-group-rail { min-height: 1180px; }
  .compact-team-name { font-size: 13px; }
}
