/* AI CONTEXT: Komponenty typera
   PURPOSE: Odliczanie, wiersze meczów, herby, punkty, pasek zapisu i tabele klasyfikacji.
   DEPENDENCIES: public/base.css */

/* Odliczanie do zamkniecia kolejki */

.deadline {
  text-align: right;
}

.deadline__label {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 560;
}

.deadline__clock {
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.25rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.deadline__when {
  color: var(--faint);
  font-size: var(--text-sm);
}

/* Ostatnia doba przed zamknieciem: zegar na czerwono */
.deadline.cd--urgent .deadline__label,
.deadline.cd--urgent .deadline__clock {
  color: var(--danger);
}

/* Po terminie duzy staje sie komunikat, a data schodzi do podpisu */
.deadline.cd--closed .deadline__label {
  font-size: clamp(1.375rem, 1rem + 1.6vw, 1.875rem);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--danger);
}

.deadline.cd--closed .deadline__clock {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
}

@media (max-width: 620px) {
  .deadline {
    text-align: left;
  }
}

/* Wiersz meczu */

.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 0;
}

.fixture + .fixture {
  border-top: 1px solid var(--line);
}

.fixture__team {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 560;
  line-height: 1.25;
}

/* Herby flankują wynik: gospodarz od prawej, gość od lewej */
.fixture__team--home {
  justify-content: flex-end;
  text-align: right;
}

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

.crest {
  flex: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

@media (max-width: 560px) {
  .fixture__team {
    gap: 7px;
  }

  .crest {
    width: 20px;
    height: 20px;
  }
}

.score {
  display: flex;
  align-items: center;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}

.score input {
  width: 3.1rem;
  padding: 8px 4px;
  text-align: center;
  font-weight: 640;
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}

.score__sep {
  color: var(--faint);
  font-weight: 600;
}

.score--static {
  justify-content: center;
  min-width: 4.5rem;
  font-size: var(--text-md);
  font-weight: 660;
  letter-spacing: -0.01em;
}

.score--pending {
  color: var(--faint);
  font-weight: 540;
}

.fixture__verdict {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .fixture {
    gap: 6px 10px;
    font-size: var(--text-sm);
  }

  .score input {
    width: 2.6rem;
  }
}

/* Typy wszystkich zawodnikow, odslaniane po zamknieciu kolejki */

.picks {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.picks__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-inline: auto;
  padding: 4px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

/* Domyslny trojkacik przegladarki zastapiony wlasnym daszkiem */
.picks__toggle::-webkit-details-marker {
  display: none;
}

.picks__toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.picks__chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.picks[open] .picks__chevron {
  transform: rotate(45deg);
}

.picks__count {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-weight: 620;
}

.picks__list {
  max-width: 320px;
  margin: 4px auto 6px;
  padding: 4px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.picks__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: var(--text-sm);
}

.picks__row + .picks__row {
  border-top: 1px solid var(--line);
}

.picks__val {
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}

.picks__row--none .picks__who,
.picks__row--none .picks__val {
  color: var(--faint);
  font-weight: 400;
}

/* Punkty */

.pts {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: var(--faint);
}

.pts--hit {
  background: var(--surface-2);
  color: var(--muted);
}

.pts--exact {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Pasek zapisu */

.savebar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Tabele klasyfikacji */

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 14px 8px 10px;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
}

.table td {
  padding: 12px 8px;
  border-top: 1px solid var(--line);
}

.table th:first-child,
.table td:first-child {
  padding-left: 0;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table .right {
  text-align: right;
}

.table__rank {
  width: 2.75rem;
  color: var(--muted);
  font-weight: 620;
}

.table__rank--lead {
  color: var(--accent);
}

.table__points {
  font-size: var(--text-md);
  font-weight: 660;
}

.tag {
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

@media (max-width: 560px) {
  .table .hide-sm {
    display: none;
  }
}
