:root {
  --bg:     #111111;
  --fg:     #e0e0e0;
  --muted:  #666666;
  --dim:    #3a3a3a;
  --border: #2a2a2a;
  --green:  #4ade80;
  --red:    #e05555;
  --amber:  #d4a017;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 106.25%;
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  min-height: 100vh;
}

.page {
  max-width: 58rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 1.5rem);
}

.hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hdr h1 {
  margin: 0;
  font-size: clamp(1.35rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
  white-space: nowrap;
}

.verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.25rem) 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.verdict-word {
  margin: 0;
  font-size: clamp(4.25rem, 16vw, 8rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.verdict-word.open { color: var(--amber); }
.verdict-word.yes  { color: var(--green); }
.verdict-word.no   { color: var(--red); }

.verdict-subline {
  margin: 0.35rem 0 0;
  color: var(--dim);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.section-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.standings {
  width: 100%;
  max-width: 42rem;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0 auto 1.25rem;
}

.standings th {
  text-align: right;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.5rem 0.5rem;
  font-weight: 400;
}

.standings th:first-child,
.standings th:nth-child(2) { text-align: left; }

.standings td {
  padding: 0.45rem 0.45rem;
  text-align: right;
  border-top: 1px solid var(--border);
  color: #b0b0b0;
  white-space: nowrap;
}

.standings td:first-child { text-align: left; color: var(--muted); font-size: 0.65rem; }
.standings td:nth-child(2) { text-align: left; color: var(--fg); }
.standings td:nth-child(3) { color: var(--fg); font-weight: 700; }

.standings tr.legia td { background: #1a1a1a; }
.standings tr.legia td:nth-child(2) { color: var(--amber); }
.standings tr.europe td:first-child { color: var(--green); }
.standings tr.no-europe td:first-child { color: var(--dim); }

.standings-team {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 100%;
  vertical-align: middle;
}

.standings-team-logo {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.standings-team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings th:first-child,
.standings td:first-child {
  width: 3.2rem;
  padding-right: 0.25rem;
}

.rank-pos { display: inline-block; min-width: 0.95rem; }

.euro-label {
  display: inline-block;
  margin-left: 0.22rem;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.euro-lm { color: #c7ddff; }
.euro-le { color: var(--green); }
.euro-lke { color: var(--amber); }

.fixture-group { margin-bottom: 1.5rem; }

.fixture-group-lbl {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 0.35rem;
}

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

.fixture-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--border);
}

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

.fixture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 0;
}

.fixture--mid { background: #181818; }
.fixture--legia { background: #202020; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: #9a9a9a;
  font-size: 0.62rem;
}

.github-link {
  display: inline-flex;
  color: var(--muted);
  transition: color 0.1s;
}

.github-link:hover { color: var(--fg); }

.github-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.fixture-list .fixture:nth-child(3n) { border-right: none; }
.fixture-list-2 .fixture:nth-child(2n) { border-right: none; }
.fixture-list-2 .fixture:nth-child(3n) { border-right: 1px solid var(--border); }

.site-image {
  display: block;
  width: min(100%, 42rem);
  height: auto;
  margin: 2.25rem auto 0;
  border: 1px solid var(--border);
}

.fixture-teams {
  font-size: 0.74rem;
  color: var(--fg);
  line-height: 1.3;
}

.score-picker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.18rem;
  flex-shrink: 0;
  width: 100%;
}

.score-column {
  display: flex;
  flex-direction: column;
  flex: 0 0 5.8rem;
  gap: 0.35rem;
  min-width: 0;
}

.score-column-home,
.score-column-away { align-items: center; }

.score-team {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  max-width: 100%;
  overflow: hidden;
  color: var(--fg);
  font-size: 0.76rem;
  line-height: 1.2;
}

.score-team-home { justify-content: flex-end; }
.score-team-away { justify-content: flex-start; }

.score-team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-team-logo {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.score-side {
  display: flex;
  gap: 0.1rem;
}

.sbtn {
  padding: 0.18rem 0.32rem;
  font-size: 0.7rem;
  font-family: inherit;
  border: 1px solid var(--dim);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-width: 1.38rem;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}

.sbtn:hover { border-color: #555; color: var(--fg); }
.sbtn.sbtn-active { border-color: var(--amber); color: var(--amber); background: #2a2010; }

.score-dash {
  color: var(--dim);
  font-size: 0.72rem;
  padding: 0 0.04rem 0.18rem;
}

.score-clear {
  padding: 0.18rem 0.16rem;
  font-size: 0.65rem;
  font-family: inherit;
  border: 1px solid transparent;
  background: transparent;
  color: #3a3a3a;
  cursor: pointer;
  transition: color 0.1s;
}

.score-clear:hover { color: var(--red); }

.conditions {
  max-width: 42rem;
  margin-bottom: 1.75rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.conditions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: decimal;
  list-style-position: inside;
  font-size: 0.72rem;
  color: #9a9a9a;
  line-height: 1.6;
}

.conditions-list li { min-width: 0; }

.sim-verdict {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  width: fit-content;
  margin: 0 auto 1.5rem;
  display: block;
}
.sim-pending  { color: var(--muted); border-color: var(--border); }
.sim-yes      { color: var(--green); border-color: var(--green); }
.sim-no       { color: var(--red);   border-color: var(--red); }
.sim-open     { color: var(--amber); border-color: var(--amber); }

.h2h-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.h2h-block {
  min-width: 13rem;
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
}

.h2h-block--duel {
  display: flex;
  flex-direction: column;
}

.h2h-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 0.6rem;
}

.h2h-duel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.h2h-block--duel .h2h-duel { margin-top: auto; }

.h2h-duel-team {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  gap: 0.42rem;
  flex: 0 1 8.4rem;
  min-width: 0;
}

.h2h-duel-team-r {
  justify-content: flex-start;
  text-align: left;
}

.h2h-duel-team-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.h2h-duel-logo {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.h2h-duel-name { font-size: 0.72rem; color: var(--fg); overflow-wrap: break-word; }
.h2h-duel-pts  { font-size: 0.6rem; color: var(--muted); }

.h2h-leader .h2h-duel-name { color: var(--green); }
.h2h-leader .h2h-duel-pts  { color: var(--green); opacity: 0.75; }
.h2h-trailer .h2h-duel-name { color: var(--dim); }

.h2h-duel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 3.2rem;
}

.h2h-duel-agg {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg);
}

.h2h-duel-agg-label {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.h2h-legs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.67rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
  line-height: 1.5;
  text-align: center;
}

.h2h-block--duel .h2h-legs { margin-bottom: auto; }
.h2h-leg-result { display: inline-block; white-space: nowrap; }

.h2h-venue  { color: var(--dim); }
.h2h-pending { color: var(--dim); }
.h2h-w       { color: var(--green); }
.h2h-d       { color: var(--amber); }
.h2h-l       { color: var(--red); }

.h2h-summary-table {
  border-collapse: collapse;
  font-size: 0.7rem;
  margin: 0 auto 0.5rem;
}

.h2h-summary-table th {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.7rem 0.3rem;
  text-align: right;
}

.h2h-summary-table th:first-child { text-align: left; }

.h2h-summary-table td {
  padding: 0.2rem 0.7rem;
  text-align: right;
  color: #b0b0b0;
  border-top: 1px solid #1e1e1e;
}

.h2h-team { text-align: left !important; color: var(--fg) !important; white-space: nowrap; }
.h2h-row-leader .h2h-team { color: var(--green) !important; }

.h2h-note {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  line-height: 1.5;
}


@media (max-width: 54rem) {
  .fixture-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fixture-list .fixture:nth-child(3n) { border-right: 1px solid var(--border); }
  .fixture-list .fixture:nth-child(2n) { border-right: none; }
}

@media (max-width: 36rem) {
  .hdr { flex-direction: column; align-items: flex-start; }
  .hdr-meta { text-align: left; }
  .conditions-list,
  .fixture-list,
  .fixture-list-2,
  .h2h-blocks { grid-template-columns: 1fr; }
  .fixture,
  .fixture-list .fixture:nth-child(3n),
  .fixture-list-2 .fixture:nth-child(3n) { border-right: none; }
  .fixture { padding: 0.75rem 0.55rem; }
  .score-picker { gap: 0.08rem; }
  .score-column {
    flex: 1 1 0;
    gap: 0.3rem;
  }
  .score-team { font-size: 0.72rem; }
  .sbtn {
    min-width: 1.28rem;
    padding: 0.16rem 0.26rem;
  }
  .standings th:nth-child(n+5) { display: none; }
  .standings td:nth-child(n+5) { display: none; }
}
