:root {
  --bg: #1c1c22;
  --panel: #26262e;
  --panel-edge: #33333d;
  --text: #ffffff;
  --muted: #a4a4b0;
  --faint: #6c6c78;
  --red: #e01e29;
  --stale: #ff5a5f;
  font-size: 1vh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

body { display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 10rem;
  padding: 0 4rem;
  border-bottom: 0.5rem solid var(--red);
}
.logo { height: 6.5rem; border-radius: 0.6rem; }
.title { flex: 1; font-size: 5rem; font-weight: 800; letter-spacing: 0.02em; }
.title small, .en { color: var(--muted); font-weight: 400; font-size: 0.6em; }
.meta { display: flex; align-items: baseline; gap: 3rem; }
.clock { font-size: 5rem; font-weight: 700; }
.updated { font-size: 2.2rem; color: var(--faint); }
.updated.stale { color: var(--stale); font-weight: 700; }

.view { flex: 1; display: flex; flex-direction: column; padding: 3rem 4rem; gap: 3rem; min-height: 0; }

.section-title { display: flex; align-items: baseline; gap: 2rem; font-size: 4.4rem; font-weight: 800; }
.section-title .date { margin-left: auto; font-size: 3.4rem; font-weight: 600; color: var(--muted); }
.page-dots { font-size: 2.4rem; color: var(--faint); letter-spacing: 0.4em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.6rem;
  border-radius: 99rem;
  font-size: 2.4rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge.live { background: var(--red); }
.badge.bezig { background: var(--panel-edge); color: var(--muted); font-weight: 600; }
.badge.muted { background: transparent; border: 0.25rem solid var(--panel-edge); color: var(--muted); font-weight: 600; }
.dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.team { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.team.club { color: var(--text); font-weight: 800; }
.team.club::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.4em; background: var(--red); border-radius: 0.15em; vertical-align: -0.05em; }

/* Live: one card per occupied home court, away strip below. */
.courts { display: grid; gap: 3rem; flex: 1 1 0; min-height: 0; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 3rem;
  background: var(--panel);
  border-radius: 2rem;
  border-top: 0.8rem solid var(--panel-edge);
  min-width: 0;
  overflow: hidden;
  --scale: 1;
}
.card.live { border-top-color: var(--red); }
.courts.few .card { --scale: 1.35; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; white-space: nowrap; font-size: calc(3.6rem * var(--scale)); font-weight: 800; }
.card-head .badge { font-size: calc(2.2rem * var(--scale)); }
.card-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 1.5rem; column-gap: 2rem; align-items: center; font-size: calc(3.2rem * var(--scale)); }
.card-teams .team { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
.card-teams .sets { font-size: 1.7em; font-weight: 800; min-width: 1.2em; text-align: right; }
.current { margin-top: auto; text-align: center; white-space: nowrap; font-size: calc(9rem * var(--scale)); font-weight: 800; line-height: 1; }
.current .label { display: block; font-size: 2.4rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; }
.setlist { text-align: center; font-size: calc(2.8rem * var(--scale)); color: var(--muted); }
.card .waiting { margin-top: auto; text-align: center; font-size: 3rem; color: var(--faint); }

.away { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.courts + .away .row { height: 6.4rem; }
.away .section-title { font-size: 3.4rem; }

/* Rows: schedule, results and the away strip. */
.rows { display: flex; flex-direction: column; gap: 1.2rem; }
.row {
  display: grid;
  grid-template-columns: 11rem 30rem minmax(0, 1fr) 14rem minmax(0, 1fr) 34rem;
  align-items: center;
  gap: 2rem;
  height: 7.4rem;
  padding: 0 2.5rem;
  background: var(--panel);
  border-radius: 1.2rem;
  font-size: 3.6rem;
}
.row.live { box-shadow: inset 0.8rem 0 0 var(--red); }
.row .time { font-weight: 700; }
.row .where { font-size: 2.6rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .where strong { color: var(--text); font-size: 3rem; }
.row .score { text-align: center; font-weight: 800; font-size: 4.2rem; }
.row .score .loser { color: var(--faint); }
.row .team.away-team { text-align: left; }
.row .team.home-team { text-align: right; }
.row .extra { text-align: right; font-size: 2.4rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .extra .current-set { color: var(--text); font-size: 3.6rem; font-weight: 800; }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3rem; text-align: center; }
.empty img { height: 28rem; border-radius: 2rem; }
.empty p { font-size: 5rem; font-weight: 700; }
.empty .en { display: block; font-size: 3.4rem; margin-top: 1rem; }
