/* =========================================================
   STATISTIK 01B · SPELSCHEMA
========================================================= */

.stats-schedule {
  margin-top: 18px;
}

.stats-section-number--sub {
  font-size: 9px;
  letter-spacing: 0.35px;
}

.stats-schedule .stats-panel__body {
  padding: 18px 22px 22px;
}

.stats-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-schedule-loading,
.stats-schedule-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 92px;
  padding: 20px;
  color: var(--stats-slate);
  border: 1px dashed rgba(36, 118, 173, 0.2);
  border-radius: 15px;
  background: rgba(36, 118, 173, 0.035);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.stats-schedule-loading i,
.stats-match-modal__loading i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(36, 118, 173, 0.18);
  border-top-color: var(--stats-blue);
  border-radius: 50%;
  animation: stats-schedule-spin 720ms linear infinite;
}

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

.stats-game-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 76px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 74px;
  padding: 10px 11px;
  overflow: hidden;
  color: var(--stats-ink);
  border: 1px solid rgba(17, 24, 32, 0.09);
  border-radius: 15px;
  background: rgba(248, 251, 253, 0.96);
  box-shadow: 0 5px 14px rgba(20, 32, 44, 0.045);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.stats-game-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--stats-blue);
  content: "";
}

.stats-game-card:hover {
  z-index: 1;
  border-color: rgba(36, 118, 173, 0.25);
  background: #fff;
  box-shadow: 0 12px 26px rgba(20, 32, 44, 0.11);
  transform: translateY(-2px);
}

.stats-game-card:focus-visible {
  outline: 3px solid rgba(36, 118, 173, 0.28);
  outline-offset: 2px;
}

.stats-game-card__number {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 50px;
  border: 1px solid rgba(36, 118, 173, 0.12);
  border-radius: 11px;
  background: rgba(36, 118, 173, 0.055);
  line-height: 1;
}

.stats-game-card__number small {
  color: var(--stats-slate);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.stats-game-card__number b {
  color: var(--stats-blue-deep);
  font-family: var(--thl-display-font);
  font-size: 16px;
}

.stats-game-card__team {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--stats-ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.stats-game-card__team > span:not(.stats-team-logo) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-game-card__team--home {
  justify-content: flex-end;
  text-align: right;
}

.stats-game-card__score {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
}

.stats-game-card__score strong {
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.stats-game-card__score strong i {
  margin-inline: 5px;
  color: var(--stats-slate);
  font-style: normal;
  font-weight: 500;
}

.stats-game-card__score small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--stats-slate);
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.stats-game-card__score small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stats-gold);
}

.stats-game-card__score .status-finished i { background: var(--stats-green); }
.stats-game-card__score .status-live i { background: var(--stats-red); }

.stats-game-card__open {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--stats-blue-deep);
  background: rgba(36, 118, 173, 0.08);
}

.stats-game-card__open svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.stats-team-logo {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 32, 0.09);
  border-radius: 10px;
  background: #fff;
}

.stats-team-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.stats-team-logo--empty {
  color: var(--stats-blue-deep);
  font-family: var(--thl-display-font);
  font-size: 7px;
  font-weight: 800;
}

.stats-team-logo--tiny {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  padding: 3px;
  border-radius: 8px;
}

.stats-team-logo--small {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
  padding: 4px;
  border-radius: 9px;
}

/* =========================================================
   MATCHMODAL · STATISTIK DNA
========================================================= */

.stats-match-modal[hidden] {
  display: none;
}

.stats-match-modal {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.stats-match-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 13, 19, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stats-match-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  color: var(--stats-ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: #edf2f5;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 170ms ease, transform 170ms ease;
  scrollbar-width: thin;
}

.stats-match-modal.is-open .stats-match-modal__dialog {
  opacity: 1;
  transform: none;
}

.stats-match-modal__dialog:focus {
  outline: none;
}

.stats-match-modal__close {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.stats-match-modal__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.stats-match-modal__close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.stats-match-hero {
  position: relative;
  padding: 25px 72px 24px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% -35%, rgba(36, 118, 173, 0.5), transparent 48%),
    linear-gradient(145deg, #101a24, #223446);
}

.stats-match-hero::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--stats-blue) 0 76%, var(--stats-orange) 76%);
  content: "";
}

.stats-match-hero__eyebrow {
  margin-bottom: 4px;
  color: #78c8f5;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.25px;
  text-transform: uppercase;
}

.stats-match-hero h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1px;
}

.stats-match-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  max-width: 850px;
  margin: 18px auto 0;
}

.stats-match-scoreboard__team {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.stats-team-logo--hero {
  flex-basis: 86px;
  width: 86px;
  height: 86px;
  padding: 9px;
  border-color: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
}

.stats-match-scoreboard__team > strong {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-family: var(--thl-display-font);
  font-size: 20px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-match-scoreboard__result {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  place-items: center;
}

.stats-match-scoreboard__result span {
  color: #fff;
  font-family: var(--thl-display-font);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}

.stats-match-scoreboard__result i {
  margin-inline: 10px;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--thl-display-font);
  font-size: 28px;
  font-style: normal;
}

.stats-match-scoreboard__result small {
  grid-column: 1 / -1;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stats-match-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 17px;
}

.stats-match-hero__meta span {
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
  font-weight: 650;
}

.stats-match-modal__body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.stats-match-section {
  min-width: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 32, 0.09);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(20, 32, 44, 0.055);
}

.stats-match-section--compact {
  height: 100%;
}

.stats-match-section__title {
  margin-bottom: 13px;
}

.stats-match-section__title small {
  display: block;
  margin-bottom: 2px;
  color: var(--stats-blue);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}

.stats-match-section__title h3 {
  margin: 0;
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 19px;
  font-weight: 750;
}

.stats-match-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 13px;
}

.stats-match-period-table,
.stats-match-events {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.stats-match-period-table {
  min-width: 650px;
}

.stats-match-period-table th,
.stats-match-period-table td {
  height: 52px;
  padding: 8px 10px;
  border-right: 1px solid rgba(17, 24, 32, 0.07);
  border-bottom: 1px solid rgba(17, 24, 32, 0.07);
  text-align: center;
}

.stats-match-period-table thead th {
  height: 34px;
  color: var(--stats-slate);
  background: rgba(36, 118, 173, 0.06);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}

.stats-match-period-table thead th:first-child {
  width: 210px;
  text-align: left;
}

.stats-match-period-table tbody th {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--stats-ink-soft);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.stats-match-period-table td strong {
  display: block;
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 17px;
  font-weight: 800;
}

.stats-match-period-table td small {
  display: block;
  margin-top: 2px;
  color: var(--stats-slate);
  font-size: 8px;
  white-space: nowrap;
}

.stats-match-period-table td.is-total {
  background: rgba(36, 118, 173, 0.08);
}

.stats-match-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
}

.stats-match-compare {
  display: grid;
  gap: 7px;
}

.stats-match-compare__row {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(36, 118, 173, 0.045);
  text-align: center;
}

.stats-match-compare__row strong {
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 14px;
  font-weight: 800;
}

.stats-match-compare__row span {
  color: var(--stats-slate);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.stats-match-goalie-grid,
.stats-match-scorers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-match-goalie,
.stats-match-scorers__team {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(36, 118, 173, 0.1);
  border-radius: 13px;
  background: rgba(36, 118, 173, 0.035);
}

.stats-match-goalie__team,
.stats-match-scorers__title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--stats-ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.stats-match-goalie h4 {
  margin: 10px 0;
  overflow: hidden;
  color: var(--stats-ink);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-match-goalie__numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.stats-match-goalie__numbers span {
  display: grid;
  gap: 3px;
  padding: 7px 4px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.stats-match-goalie__numbers b {
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.stats-match-goalie__numbers small {
  color: var(--stats-slate);
  font-size: 7px;
  font-weight: 700;
}

.stats-match-scorers__title {
  margin-bottom: 9px;
}

.stats-match-scorer-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 48px 34px;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 6px;
  border-top: 1px solid rgba(17, 24, 32, 0.065);
  color: var(--stats-ink-soft);
  font-size: 11px;
}

.stats-match-scorer-row .number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 25px;
  border-radius: 7px;
  color: var(--stats-blue-deep);
  background: rgba(36, 118, 173, 0.08);
  font-weight: 800;
}

.stats-match-scorer-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-match-scorer-row strong {
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.stats-match-scorer-row small {
  color: var(--stats-slate);
  font-size: 9px;
  text-align: right;
}

.stats-match-events {
  min-width: 800px;
}

.stats-match-events th,
.stats-match-events td {
  height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(17, 24, 32, 0.075);
  color: var(--stats-ink-soft);
  font-size: 11px;
  text-align: left;
}

.stats-match-events thead th {
  height: 36px;
  color: var(--stats-slate);
  background: rgba(36, 118, 173, 0.06);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.stats-match-events th:nth-child(1) { width: 72px; text-align: center; }
.stats-match-events th:nth-child(2) { width: 68px; text-align: center; }
.stats-match-events th:nth-child(3) { width: 145px; }
.stats-match-events th:nth-child(6) { width: 78px; text-align: center; }
.stats-match-events td:nth-child(1),
.stats-match-events td:nth-child(2),
.stats-match-events td:nth-child(6) { text-align: center; }

.stats-period-pill {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 25px;
  border-radius: 8px;
  color: var(--stats-blue-deep);
  background: rgba(36, 118, 173, 0.09);
  font-family: var(--thl-display-font);
  font-size: 9px;
  font-weight: 800;
}

.stats-event-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stats-event-team > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-event-score {
  color: var(--stats-ink);
  font-family: var(--thl-display-font);
  font-size: 13px;
}

.stats-match-empty {
  margin: 8px 0 0;
  color: var(--stats-slate);
  font-size: 11px;
}

.stats-match-empty--boxed {
  margin: 0;
  padding: 20px;
  border: 1px dashed rgba(36, 118, 173, 0.17);
  border-radius: 12px;
  background: rgba(36, 118, 173, 0.03);
  text-align: center;
}

.stats-match-officials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  padding: 4px 0 2px;
}

.stats-match-officials span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--stats-ink-soft);
  background: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.stats-match-officials small {
  color: var(--stats-slate);
  font-size: 8px;
  text-transform: uppercase;
}

.stats-match-modal__loading {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--stats-slate);
  background: #fff;
  font-size: 13px;
}

@media (max-width: 900px) {
  .stats-schedule-grid {
    grid-template-columns: 1fr;
  }

  .stats-match-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .stats-match-modal {
    padding: 10px;
  }

  .stats-match-modal__dialog {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .stats-match-hero {
    padding: 24px 50px 20px;
  }

  .stats-match-scoreboard {
    grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr);
    gap: 10px;
  }

  .stats-team-logo--hero {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
    border-radius: 15px;
  }

  .stats-match-scoreboard__team > strong {
    font-size: 15px;
  }

  .stats-match-scoreboard__result span {
    font-size: 38px;
  }

  .stats-match-modal__body {
    padding: 10px;
  }

  .stats-match-section {
    padding: 13px;
    border-radius: 14px;
  }

  .stats-match-goalie-grid,
  .stats-match-scorers {
    grid-template-columns: 1fr;
  }

  .stats-match-events {
    min-width: 0;
  }

  .stats-match-events thead {
    display: none;
  }

  .stats-match-events,
  .stats-match-events tbody,
  .stats-match-events tr,
  .stats-match-events td {
    display: block;
    width: 100%;
  }

  .stats-match-events tbody {
    display: grid;
    gap: 9px;
    padding: 9px;
  }

  .stats-match-events tr {
    padding: 7px 10px;
    border: 1px solid rgba(17, 24, 32, 0.08);
    border-radius: 11px;
    background: rgba(36, 118, 173, 0.025);
  }

  .stats-match-events td,
  .stats-match-events td:nth-child(1),
  .stats-match-events td:nth-child(2),
  .stats-match-events td:nth-child(6) {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    min-height: 32px;
    height: auto;
    padding: 5px 0;
    border: 0;
    text-align: left;
  }

  .stats-match-events td::before {
    color: var(--stats-slate);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    content: attr(data-label);
  }
}

@media (max-width: 560px) {
  .stats-schedule .stats-panel__body {
    padding: 12px;
  }

  .stats-game-card {
    grid-template-columns: 42px minmax(0, 1fr) 68px 24px;
    grid-template-rows: 1fr 1fr;
    gap: 5px 8px;
    min-height: 92px;
    padding: 9px;
  }

  .stats-game-card__number {
    grid-row: 1 / 3;
  }

  .stats-game-card__team {
    grid-column: 2;
    justify-content: flex-start;
    text-align: left;
  }

  .stats-game-card__team--home {
    grid-row: 1;
    flex-direction: row-reverse;
  }

  .stats-game-card__team--away {
    grid-row: 2;
  }

  .stats-game-card__score {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .stats-game-card__open {
    grid-column: 4;
    grid-row: 1 / 3;
    width: 24px;
    height: 34px;
  }

  .stats-game-card__team {
    font-size: 11px;
  }

  .stats-team-logo {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .stats-game-card__score strong {
    font-size: 18px;
  }

  .stats-game-card__score small {
    font-size: 7px;
  }

  .stats-match-modal__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .stats-match-hero {
    padding: 54px 12px 18px;
  }

  .stats-match-scoreboard {
    grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
    margin-top: 14px;
  }

  .stats-team-logo--hero {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
    padding: 6px;
  }

  .stats-match-scoreboard__team > strong {
    font-size: 13px;
    white-space: normal;
  }

  .stats-match-scoreboard__result span {
    font-size: 32px;
  }

  .stats-match-hero__meta {
    gap: 5px;
  }

  .stats-match-hero__meta span {
    padding: 4px 7px;
    font-size: 8px;
  }
}
