/* ==========================================================================
   Programma (speelavonden, hal met velden, mijn team) en standen
   ========================================================================== */

.programma {
  background:
    radial-gradient(ellipse 70% 50% at 85% 0%, rgb(43 72 114 / 0.45), transparent 70%),
    var(--night-900);
}

.programma__tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  align-items: center;
}

/* --- Team-kiezer -------------------------------------------------------- */

.team-picker {
  display: grid;
  gap: 0.3rem;
}

.team-picker__label {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--petrol-300);
}

.team-picker select {
  min-width: 15rem;
  min-height: 2.9rem;
  padding: 0.5rem 2.6rem 0.5rem 1rem;
  border: 1.5px solid rgb(250 252 254 / 0.25);
  border-radius: var(--radius-pill);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6f648' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.9rem center / 1.1rem,
    var(--night-800);
  color: var(--white);
  font-weight: 600;
  appearance: none;
}

.team-picker select:focus-visible {
  outline: 3px solid var(--lime-400);
}

/* --- Speelavonden-kiezer ----------------------------------------------- */

.nights {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-xs);
  align-items: center;
  margin-bottom: var(--space-l);
}

.nights__arrow {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1.5px solid rgb(250 252 254 / 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  transition: background-color var(--dur-fast) linear, color var(--dur-fast) linear;
}

.nights__arrow:hover:not(:disabled) {
  background: var(--lime-400);
  color: var(--night-900);
}

.nights__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.nights__scroller {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0.35rem 0.2rem;
  mask-image: linear-gradient(90deg, transparent 0, #000 1.5rem, #000 calc(100% - 1.5rem), transparent 100%);
}

.nights__scroller::-webkit-scrollbar {
  display: none;
}

.night-chip {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 0.45rem;
  align-items: baseline;
  min-width: 5.6rem;
  min-height: 3.5rem;
  padding: 0.45rem 0.8rem;
  border: 1.5px solid rgb(250 252 254 / 0.16);
  border-radius: var(--radius-m);
  background: var(--night-800);
  color: var(--white);
  scroll-snap-align: center;
  text-align: left;
  transition: background-color var(--dur-fast) linear, border-color var(--dur-fast) linear, color var(--dur-fast) linear;
}

.night-chip__nr {
  grid-row: span 2;
  align-self: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 70%;
  font-size: var(--step-2);
  line-height: 1;
  color: var(--petrol-300);
}

.night-chip__day {
  font-size: var(--step--2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--petrol-200);
}

.night-chip__date {
  grid-column: 2;
  font-weight: 700;
  font-size: var(--step--1);
  white-space: nowrap;
}

.night-chip.is-past {
  opacity: 0.55;
}

.night-chip.is-next::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--lime-400);
}

.night-chip.is-live::after {
  background: var(--signal);
  animation: pulse 1.6s var(--ease-out-quart) infinite;
}

.night-chip.has-mine {
  border-color: rgb(198 246 72 / 0.55);
}

.night-chip[aria-selected="true"] {
  background: var(--lime-400);
  border-color: var(--lime-400);
  color: var(--night-900);
  opacity: 1;
}

.night-chip[aria-selected="true"] .night-chip__nr,
.night-chip[aria-selected="true"] .night-chip__day {
  color: var(--night-900);
}

.night-chip[aria-selected="true"]::after {
  background: var(--night-900);
}

/* --- Paneel van één avond ---------------------------------------------- */

.night-panel__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  margin-bottom: var(--space-m);
}

.night-panel__title h3 {
  font-size: var(--step-3);
  font-style: italic;
  font-weight: 900;
  font-stretch: 75%;
  text-transform: uppercase;
}

.night-panel__meta {
  margin-top: 0.35rem;
  color: var(--petrol-200);
  font-weight: 500;
}

.night-panel__meta strong {
  color: var(--white);
}

.night-panel__note {
  margin-top: var(--space-s);
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-m);
  background: rgb(198 246 72 / 0.12);
  border: 1px solid rgb(198 246 72 / 0.35);
  color: var(--white);
}

/* --- De hal ------------------------------------------------------------ */

.hall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  padding: clamp(1rem, 2.5vw, 2rem);
  border-radius: var(--radius-l);
  background:
    linear-gradient(100deg, transparent 30%, rgb(226 73 66 / 0.18) 30%, rgb(226 73 66 / 0.18) 30.25%, transparent 30.25%),
    linear-gradient(80deg, transparent 72%, rgb(48 114 208 / 0.22) 72%, rgb(48 114 208 / 0.22) 72.3%, transparent 72.3%),
    var(--night-800);
  border: 1px solid rgb(127 203 222 / 0.14);
}

.hall > .state {
  grid-column: 1 / -1;
}

.court {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  min-width: 0;
}

.court__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.court__nr {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 80%;
  font-size: var(--step-1);
  text-transform: uppercase;
  line-height: 1;
}

.court__floor {
  --line: rgb(250 252 254 / 0.42);
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  aspect-ratio: 1 / 1.55;
  border: 2px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(to bottom, transparent calc(33.3% - 1px), var(--line) calc(33.3% - 1px), var(--line) 33.3%, transparent 33.3%),
    linear-gradient(to bottom, transparent 66.7%, var(--line) 66.7%, var(--line) calc(66.7% + 1px), transparent calc(66.7% + 1px)),
    rgb(4 12 32 / 0.45);
  transition: box-shadow var(--dur-base) var(--ease-out-expo), border-color var(--dur-base) linear;
}

.court__side {
  display: grid;
  place-items: center;
  padding: 0.6rem;
  text-align: center;
}

.court__team {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-stretch: 85%;
  font-size: var(--step-1);
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.court__team--placeholder {
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-size: var(--step--1);
  text-transform: none;
  color: var(--petrol-200);
}

.court__net {
  position: relative;
  display: grid;
  place-items: center;
  height: 0;
}

.court__net::before {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  height: 4px;
  background: var(--white);
  box-shadow: 0 0 0 1px rgb(4 12 32 / 0.6);
}

.court__vs {
  position: relative;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-s);
  background: var(--night-900);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: var(--step--1);
  color: var(--lime-400);
}

.court__ref {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.6rem;
  font-size: var(--step--1);
  color: var(--petrol-200);
}

.court__ref .icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--petrol-300);
}

.court__ref strong {
  color: var(--white);
  font-weight: 600;
}

.court__note {
  font-size: var(--step--2);
  color: var(--petrol-200);
}

/* Vrij veld en lege velden */
.court--free .court__floor {
  border-style: dashed;
  border-color: rgb(198 246 72 / 0.55);
  background: rgb(198 246 72 / 0.06);
}

.court--free .court__floor,
.court--empty .court__floor {
  display: grid;
  place-items: center;
  grid-template-rows: 1fr;
}

.court__free {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.75rem;
  text-align: center;
}

.court__free b {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 80%;
  font-size: var(--step-2);
  text-transform: uppercase;
  color: var(--lime-400);
  line-height: 1;
}

.court__free a {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--petrol-200);
}

.court--empty .court__floor {
  opacity: 0.45;
}

.court--empty .court__free b {
  color: var(--petrol-200);
  font-size: var(--step-0);
}

/* Mijn team */
.court.is-mine .court__floor {
  border-color: var(--lime-400);
  box-shadow: 0 0 0 4px rgb(198 246 72 / 0.25), 0 0 40px rgb(198 246 72 / 0.25);
}

.court__team.is-mine {
  color: var(--lime-400);
}

.court.is-refduty .court__ref,
.court.is-refduty .court__ref strong {
  color: var(--lime-400);
}

.hall__note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-s);
  color: var(--petrol-200);
  font-size: var(--step--1);
}

.hall__note .icon {
  color: var(--petrol-300);
}

/* --- Mijn seizoen ------------------------------------------------------ */

.my-season {
  margin-top: var(--space-xl);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--radius-l);
  background: var(--night-950);
  border: 1px solid rgb(198 246 72 / 0.3);
}

.my-season__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  margin-bottom: var(--space-m);
}

.my-season__head h3 {
  font-size: var(--step-2);
  font-style: italic;
  font-weight: 900;
  font-stretch: 78%;
  text-transform: uppercase;
}

.my-season__head h3 span {
  color: var(--lime-400);
}

.my-season__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.6rem;
}

.agenda-item {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-m);
  background: var(--night-800);
}

.agenda-item.is-past {
  opacity: 0.5;
}

.agenda-item.is-next {
  outline: 2px solid var(--lime-400);
}

.agenda-item__date {
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: var(--radius-s);
  background: var(--night-700);
  line-height: 1;
}

.agenda-item__date b {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 70%;
  font-size: var(--step-3);
}

.agenda-item__date small {
  font-size: var(--step--2);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--petrol-200);
}

.agenda-item ul {
  display: grid;
  gap: 0.25rem;
  align-content: center;
  font-size: var(--step--1);
}

.agenda-item li {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.agenda-item .tag {
  flex: none;
  min-width: 3.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--lime-400);
}

.agenda-item .tag--duty {
  color: var(--petrol-300);
}

.programma__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
  margin-top: var(--space-xl);
}

.programma__links .link-arrow {
  border-bottom-color: rgb(198 246 72 / 0.6);
}

/* --- Standen ----------------------------------------------------------- */

.standen__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}

.standings {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

.standings__caption {
  margin-bottom: var(--space-s);
  font-weight: 600;
  color: var(--ink-2);
}

.standings__empty {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: var(--space-m);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-m);
  background: var(--paper-2);
  font-weight: 500;
}

.standings .table td.rank {
  width: 3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 75%;
  font-size: var(--step-2);
  line-height: 1;
  color: var(--ink-2);
}

.standings .table tr:first-child td.rank {
  color: var(--lime-700);
}

.standings .table td.team {
  font-weight: 700;
}

.standings .table td.points {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 80%;
  font-size: var(--step-1);
}

.standings .table tbody tr {
  transition: background-color var(--dur-fast) linear;
}

.standings .table tbody tr:hover {
  background: var(--paper-2);
}

.standings .table tr.is-mine td {
  background: rgb(198 246 72 / 0.25);
}

.results {
  display: grid;
  gap: 0.5rem;
}

.results__title {
  font-size: var(--step-1);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-m);
  background: var(--white);
  box-shadow: var(--shadow-1);
}

.result__team {
  font-weight: 600;
}

.result__team--away {
  text-align: right;
}

.result__score {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
}

.result__sets {
  grid-column: 1 / -1;
  font-size: var(--step--2);
  color: var(--ink-2);
  text-align: center;
}

.standings__side {
  display: grid;
  gap: var(--space-l);
}

.rules-card {
  display: grid;
  gap: var(--space-s);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: var(--radius-l);
  background: var(--night-900);
  color: var(--white);
}

.rules-card h3 {
  font-size: var(--step-2);
  font-style: italic;
  font-weight: 900;
  font-stretch: 80%;
  text-transform: uppercase;
  color: var(--lime-400);
}

.rules-card ul {
  display: grid;
  gap: 0.6rem;
}

.rules-card li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--petrol-200);
  line-height: 1.5;
}

.rules-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--lime-400);
}

.rules-card strong {
  color: var(--white);
}

.rules-card .link-arrow {
  justify-self: start;
  color: var(--lime-400);
}

.penalties {
  margin-top: var(--space-s);
  font-size: var(--step--1);
  color: var(--ink-2);
}

/* --- Responsief -------------------------------------------------------- */

@media (max-width: 980px) {
  .standen__tools {
    align-items: flex-start;
  }

  .hall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .court__floor {
    grid-template-rows: none;
    /* Het net krijgt een eigen kolom, zodat lange teamnamen nooit onder "vs" vallen */
    grid-template-columns: minmax(0, 1fr) 2.6rem minmax(0, 1fr);
    aspect-ratio: 2 / 1;
    background:
      linear-gradient(to right, transparent calc(33.3% - 1px), var(--line) calc(33.3% - 1px), var(--line) 33.3%, transparent 33.3%),
      linear-gradient(to right, transparent 66.7%, var(--line) 66.7%, var(--line) calc(66.7% + 1px), transparent calc(66.7% + 1px)),
      rgb(4 12 32 / 0.45);
  }

  .court--free .court__floor,
  .court--empty .court__floor {
    grid-template-columns: minmax(0, 1fr);
  }

  .court__net {
    width: auto;
    height: auto;
  }

  .court__net::before {
    left: calc(50% - 2px);
    right: auto;
    top: -8%;
    bottom: -8%;
    width: 4px;
    height: auto;
  }

  .standings {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hall {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.75rem;
  }

  .court__floor {
    aspect-ratio: 2.3 / 1;
  }

  .court__team {
    font-size: var(--step-0);
  }

  .team-picker,
  .team-picker select {
    width: 100%;
  }

  .programma__tools {
    width: 100%;
  }

  .night-panel__bar {
    align-items: start;
  }

  .nights__arrow {
    display: none;
  }

  .nights {
    grid-template-columns: minmax(0, 1fr);
  }

  .nights__scroller {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    mask-image: none;
  }
}

@media (max-width: 420px) {
  .court__floor {
    aspect-ratio: 2 / 1;
  }

  .court__side {
    padding: 0.4rem;
  }

  .my-season__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .standings .table .hide-xs {
    display: none;
  }
}
