/* ==========================================================================
   CLV — Componentes compartilhados entre o site público e o painel
   ========================================================================== */

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--accent);
  color: var(--clv-white);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--clv-white);
}

.btn--ghost {
  background: var(--bg-surface);
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-strong);
  border-color: var(--clv-gray-400);
}

.btn--outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: var(--clv-white);
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--clv-white);
}

.btn--danger {
  background: var(--clv-loss);
  color: var(--clv-white);
}

.btn--danger:hover {
  background: #b91c1c;
  color: var(--clv-white);
}

.btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn--sm svg {
  width: 15px;
  height: 15px;
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-md);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card--pad {
  padding: var(--space-6);
}

.card--link {
  display: block;
  color: inherit;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease);
}

.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--clv-gray-300);
  color: inherit;
}

/* --------------------------------------------------------------------------
   Cabeçalho de seção — título à esquerda, link "ver tudo" à direita
   -------------------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.section-head__title {
  font-size: var(--text-2xl);
}

/* Ícones dentro de rótulos herdam um tamanho previsível. */
.badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.section-head__eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section--dark .section-head__eyebrow {
  color: var(--clv-blue-400);
}

.section-head__eyebrow--live {
  color: var(--text-strong);
}

.section-head__link {
  font-size: var(--text-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.section-head__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur) var(--ease);
}

.section-head__link:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--blue {
  background: var(--accent-soft);
  color: var(--clv-blue-600);
}

.badge--win {
  background: var(--clv-win-bg);
  color: #15803d;
}

.badge--loss {
  background: var(--clv-loss-bg);
  color: #b91c1c;
}

.badge--warn {
  background: var(--clv-warn-bg);
  color: #b45309;
}

.badge--gray {
  background: var(--clv-gray-100);
  color: var(--clv-gray-600);
}

.badge--gold {
  background: var(--clv-gold-bg);
  color: #a16207;
}

.badge--live {
  background: var(--clv-loss);
  color: var(--clv-white);
}

.badge--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: clv-pulse 1.6s var(--ease) infinite;
}

@keyframes clv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --------------------------------------------------------------------------
   Filtros em pílula (categoria, rodada, galeria)
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.pill-group {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--clv-gray-100);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.pill {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.pill:hover {
  color: var(--text-strong);
}

.pill.is-active {
  background: var(--bg-surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}

.pill-group--dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.pill-group--dark .pill {
  color: var(--text-on-dark-muted);
}

.pill-group--dark .pill.is-active {
  background: var(--clv-white);
  color: var(--clv-navy);
}

/* Select nativo estilizado, usado no filtro de rodada. */
.select {
  appearance: none;
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}

.select:hover {
  border-color: var(--clv-gray-400);
}

/* --------------------------------------------------------------------------
   Tabela de classificação
   -------------------------------------------------------------------------- */

.standings-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .standings .col-sp,
  .standings .col-sc {
    display: none;
  }
}

@media (max-width: 480px) {
  .standings .col-ss {
    display: none;
  }
}

.standings thead th {
  background: var(--clv-navy);
  color: var(--text-on-dark-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-align: center;
  padding: var(--space-3) var(--space-2);
  white-space: nowrap;
}

.standings thead th:first-child {
  text-align: center;
  padding-left: var(--space-4);
}

.standings thead th.is-team {
  text-align: left;
}

.standings tbody td {
  padding: var(--space-3) var(--space-2);
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  white-space: nowrap;
}

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

.standings tbody tr {
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.standings tbody tr:hover {
  background: var(--clv-gray-100);
  transform: translateX(2px);
}

/* Posição e time acompanham a rolagem horizontal. */
.standings .col-pos,
.standings .col-team {
  position: sticky;
  background: var(--bg-surface);
  z-index: 1;
}

.standings .col-pos {
  left: 0;
  width: 52px;
  padding-left: var(--space-4);
}

.standings .col-team {
  left: 52px;
  text-align: left;
  min-width: 190px;
  /* Sombra sutil marcando onde o conteúdo passa por baixo. */
  box-shadow: 8px 0 8px -8px rgba(15, 23, 42, 0.12);
}

.standings thead .col-pos,
.standings thead .col-team {
  background: var(--clv-navy);
  z-index: 2;
}

.standings tbody tr:hover .col-pos,
.standings tbody tr:hover .col-team {
  background: var(--clv-gray-100);
}

.standings .pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--clv-gray-100);
}

/* Zona de classificação: os quatro primeiros. */
.standings tr.is-qualified .pos {
  background: var(--accent-soft);
  color: var(--clv-blue-600);
}

.standings tr.is-leader .pos {
  background: var(--clv-gold);
  color: var(--clv-white);
}

.standings__team {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-strong);
  font-weight: 600;
}

.standings__team:hover {
  color: var(--accent);
}

.standings__crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.standings .col-points {
  font-weight: 800;
  color: var(--text-strong);
  font-size: var(--text-md);
  background: var(--clv-gray-100);
}

.standings .num-pos {
  color: var(--clv-win);
  font-weight: 600;
}

.standings .num-neg {
  color: var(--clv-loss);
  font-weight: 600;
}

/* Legenda abaixo da tabela. */
.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--clv-gray);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.standings-legend dt {
  display: inline;
  font-weight: 700;
  color: var(--text-body);
}

.standings-legend dd {
  display: inline;
  margin: 0 var(--space-3) 0 var(--space-1);
}

/* --------------------------------------------------------------------------
   Card de jogo
   -------------------------------------------------------------------------- */

.match {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.match.js-match-card {
  cursor: pointer;
  position: relative;
}

.match:hover,
.match.js-match-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clv-gray-300);
  transform: translateY(-2px);
}

.match.js-match-card:active {
  transform: scale(0.995);
}

.match__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--clv-gray);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.match__round {
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.match__body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
}

.match__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  color: var(--text-strong);
  min-width: 0;
}

.match__crest {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.match__name {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-snug);
  /* Nome longo quebra em duas linhas em vez de estourar o card. */
  overflow-wrap: anywhere;
}

.match__team.is-winner .match__name {
  color: var(--clv-win);
}

.match__score {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

.match__score-sep {
  color: var(--clv-gray-300);
  font-weight: 400;
}

.match__score .is-loser {
  color: var(--clv-gray-400);
}

/* Jogo ainda sem resultado: mostra o horário no lugar do placar. */
.match__time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-inline: var(--space-2);
}

.match__time strong {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.match__time span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
}

.match__foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.match__foot svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--clv-gray-400);
}

.match__highlight {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--clv-gold-bg);
  border-top: 1px solid var(--clv-gold);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--clv-gold);
}

.match__highlight strong {
  color: var(--text-strong);
  font-weight: 700;
}

.match__highlight svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Grade de jogos. */
.match-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .match-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .match-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Card de time
   -------------------------------------------------------------------------- */

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  gap: var(--space-3);
}

.team-card__crest {
  width: 76px;
  height: 76px;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card--link:hover .team-card__crest {
  transform: scale(1.07);
}

.team-card__name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-strong);
  line-height: var(--leading-snug);
}

.team-card__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.team-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

/* --------------------------------------------------------------------------
   Card de notícia
   -------------------------------------------------------------------------- */

.news-card__media {
  aspect-ratio: 16 / 9;
  background: var(--clv-gray-100);
  overflow: hidden;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card--link:hover .news-card__media img {
  transform: scale(1.05);
}

.news-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.news-card__date {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
}

.news-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-strong);
  line-height: var(--leading-snug);
}

.news-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

.news-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

/* --------------------------------------------------------------------------
   Galeria
   -------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--clv-gray-100);
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-6) var(--space-3) var(--space-3);
  background: linear-gradient(to top, rgba(15, 23, 42, 0.88), transparent);
  color: var(--clv-white);
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.gallery-item:hover .gallery-item__caption,
.gallery-item:focus-visible .gallery-item__caption {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox.is-open {
  display: flex;
  animation: clv-fade var(--dur) var(--ease);
}

@keyframes clv-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 84vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.lightbox__caption {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: var(--clv-white);
  font-size: var(--text-sm);
  text-align: center;
  max-width: 90vw;
}

.lightbox__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--clv-white);
  transition: background var(--dur) var(--ease);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--clv-white);
  transition: background var(--dur) var(--ease);
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox__nav--prev { left: var(--space-4); }
.lightbox__nav--next { right: var(--space-4); }

/* --------------------------------------------------------------------------
   Estado vazio
   -------------------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty svg {
  width: 40px;
  height: 40px;
  color: var(--clv-gray-300);
}

.empty__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-strong);
}

.empty p {
  font-size: var(--text-sm);
  max-width: 42ch;
}

/* --------------------------------------------------------------------------
   Alertas / flash
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert--success {
  background: var(--clv-win-bg);
  border-color: #86efac;
  color: #14532d;
}

.alert--error {
  background: var(--clv-loss-bg);
  border-color: #fca5a5;
  color: #7f1d1d;
}

.alert--info {
  background: var(--accent-soft);
  border-color: #bfdbfe;
  color: #1e3a8a;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-strong);
}

.field__label .req {
  color: var(--clv-loss);
  margin-left: 2px;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.field__error {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clv-loss);
}

.input,
.textarea,
.field select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-strong);
  font-size: var(--text-base);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--clv-gray-400);
}

.input:focus,
.textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.input.has-error,
.textarea.has-error,
.field select.has-error {
  border-color: var(--clv-loss);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--leading-normal);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 16px;
  padding-right: var(--space-10);
  cursor: pointer;
}

.field-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .field-row--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-row--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Campo de arquivo com pré-visualização. */
.filefield {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.filefield__preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--clv-gray-100);
  object-fit: contain;
  flex-shrink: 0;
}

.filefield__input {
  flex: 1;
  min-width: 200px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.filefield__input::file-selector-button {
  padding: var(--space-2) var(--space-4);
  margin-right: var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.filefield__input::file-selector-button:hover {
  background: var(--bg-subtle);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
}

/* --------------------------------------------------------------------------
   Paginação
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-body);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.pagination a:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.pagination .is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--clv-white);
}

.pagination .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Estado de carregamento dos blocos atualizados por fetch
   -------------------------------------------------------------------------- */

.is-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--clv-gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: clv-spin 0.7s linear infinite;
  margin-inline: auto;
}

@keyframes clv-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Toast Notifications (Feedback Popups)
   -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-strong);
  font-size: var(--text-sm);
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-out) forwards, toast-out var(--dur-slow) var(--ease-in) 4s forwards;
  max-width: 350px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
    margin-top: -60px; /* Collapse space */
  }
}

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast--success {
  border-left: 4px solid var(--clv-green);
}
.toast--success svg {
  color: var(--clv-green);
}

.toast--error {
  border-left: 4px solid var(--clv-red);
}
.toast--error svg {
  color: var(--clv-red);
}

.toast--info {
  border-left: 4px solid var(--clv-blue);
}
.toast--info svg {
  color: var(--clv-blue);
}

/* --------------------------------------------------------------------------
   Modal Público da Partida
   -------------------------------------------------------------------------- */
.pub-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  animation: clv-fade var(--dur) var(--ease);
}

.pub-modal-backdrop[hidden] {
  display: none;
}

.pub-modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: score-modal-in var(--dur-slow) var(--ease-out);
}

.pub-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
}

.pub-modal__meta {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.pub-modal__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-body);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pub-modal__close:hover {
  background: var(--clv-gray-200);
  color: var(--text-strong);
}
.pub-modal__close svg {
  width: 18px;
  height: 18px;
}

.pub-modal__body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pub-modal__scoreboard {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: var(--space-2) var(--space-6) var(--space-6);
}

.pub-modal__team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  width: 30%;
}

.pub-modal__crest {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

.pub-modal__team-name {
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--text-strong);
  line-height: var(--leading-tight);
}

.pub-modal__score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  width: 40%;
}

.pub-modal__final-score {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pub-modal__set-digit {
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pub-modal__score-sep {
  font-size: var(--text-2xl);
  color: var(--text-muted);
  font-weight: 300;
}

.pub-modal__details {
  background: var(--bg-body);
  padding: var(--space-6);
  border-top: 1px solid var(--border);
  flex: 1;
}

.pub-modal__section-title {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-4) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pub-modal__section-title svg {
  color: var(--text-muted);
  width: 14px;
  height: 14px;
}

.pub-modal__sets-panel {
  margin-bottom: var(--space-6);
}

.pub-modal__sets-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pub-modal__set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  color: var(--text-strong);
}

.pub-modal__set-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.pub-modal__set-points {
  display: flex;
  gap: var(--space-4);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pub-modal__set-points span.is-winner {
  color: var(--accent);
}
.pub-modal__set-points span.is-loser {
  color: var(--text-muted);
  font-weight: 500;
}

.pub-modal__highlight-panel {
  margin-bottom: 0;
}

.pub-modal__highlight-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.pub-modal__hl-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-body);
}

.pub-modal__hl-info {
  display: flex;
  flex-direction: column;
}

.pub-modal__hl-name {
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--text-strong);
}

.pub-modal__hl-team {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}
