:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0d1b2d;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f6f8fb;
  --muted: #aebbd0;
  --accent: #45d483;
  --accent-2: #5bbcff;
  --warning: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(69, 212, 131, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(91, 188, 255, 0.22), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.hero {
  padding: 1.25rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand::before {
  width: 0.75rem;
  height: 0.75rem;
  content: "";
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(69, 212, 131, 0.7);
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
}

.hero-content {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(2.7rem, 8vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}

.intro {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.button:hover,
.chip:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101c;
  font-weight: 800;
}

.button.ghost,
.chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(69, 212, 131, 0.18);
}

.chip.muted {
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 4rem auto 0;
}

.stats article,
.toolbar,
.match-card,
.results-summary,
.broadcast-info,
.empty-state {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.stats article {
  border-radius: 1.5rem;
  padding: 1.35rem;
}

.stats strong {
  display: block;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 4rem;
}

.toolbar {
  position: static;
  z-index: 10;
  display: grid;
  gap: 1rem;
  border-radius: 2rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.toolbar-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
}

.section-heading {
  min-width: 0;
}

.section-heading h2 {
  max-width: 16ch;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(140px, 1fr));
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.82rem 0.95rem;
  outline: none;
  background: rgba(4, 11, 21, 0.72);
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(69, 212, 131, 0.14);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.filters-panel {
  display: none;
}

.toolbar.filters-open .filters-panel {
  display: block;
}

.filters-toggle {
  display: inline-flex;
  border-color: rgba(91, 188, 255, 0.45);
  background: rgba(91, 188, 255, 0.12);
  color: #d8f1ff;
}

.filters-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(69, 212, 131, 0.18);
  color: #d9ffe8;
}

.time-mode-compact {
  display: grid;
  flex: 0 0 auto;
  gap: 0.45rem;
  width: min(100%, 13rem);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.time-mode-compact select {
  min-height: 2.75rem;
  padding: 0.75rem 0.9rem;
}

.results-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  border-radius: 1.25rem;
  padding: 1rem 1.15rem;
  color: var(--muted);
}

.results-summary p {
  margin: 0;
}

.results-summary strong {
  color: var(--text);
}

.broadcast-info {
  margin: 0 0 1rem;
  border-radius: 1.25rem;
  padding: 1rem 1.15rem;
  color: var(--muted);
  line-height: 1.6;
}

.broadcast-info strong {
  color: var(--text);
}

.schedule {
  display: grid;
  gap: 1.4rem;
}

.date-group {
  display: grid;
  gap: 0.75rem;
}

.date-heading {
  position: static;
  z-index: 2;
  width: fit-content;
  margin: 0;
  border: 1px solid rgba(69, 212, 131, 0.35);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(7, 17, 31, 0.92);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.match-card {
  display: grid;
  gap: 0.85rem;
  border-radius: 1.35rem;
  padding: 1rem 1.15rem;
}

.match-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem 1.15rem;
  align-items: start;
}

.match-number {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(69, 212, 131, 0.18), rgba(91, 188, 255, 0.18));
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 900;
}

.match-info {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.teams-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  margin: 0.1rem 0 0.15rem;
}

.teams-row--placeholder {
  display: block;
}

.teams-placeholder-text {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.team-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.team-flag {
  display: block;
  flex-shrink: 0;
  width: 2.35rem;
  height: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.28rem;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.team-flag--placeholder {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 1.6rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.team-name {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.team-vs {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.group {
  border-color: rgba(91, 188, 255, 0.45);
  color: #bce5ff;
}

.venue {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.broadcast {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.broadcast-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.channel {
  border: 1px solid rgba(69, 212, 131, 0.35);
  border-radius: 999px;
  padding: 0.32rem 0.6rem;
  background: rgba(69, 212, 131, 0.1);
  color: #d9ffe8;
  font-size: 0.78rem;
  font-weight: 900;
}

.channel.pending {
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.1);
  color: #ffe7a3;
}

.broadcast-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  min-width: 10.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  text-align: right;
}

.time-main {
  display: grid;
  gap: 0.15rem;
}

.time {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.date-small,
.time-context {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.calendar-button {
  width: 100%;
  margin-top: 0;
  border: 1px solid rgba(91, 188, 255, 0.4);
  border-radius: 0.95rem;
  padding: 0.7rem 0.8rem;
  background: rgba(91, 188, 255, 0.12);
  color: #d8f1ff;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.calendar-button:hover {
  transform: translateY(-1px);
  border-color: rgba(91, 188, 255, 0.8);
  background: rgba(91, 188, 255, 0.2);
}

.empty-state {
  border-radius: 1.5rem;
  padding: 2rem;
  text-align: center;
}

footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 2.5rem;
  }

  .stats article {
    padding: 0.85rem;
    text-align: center;
  }

  .stats strong {
    font-size: 1.55rem;
  }

  .stats span {
    font-size: 0.78rem;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .filters label:first-child {
    grid-column: 1 / -1;
  }

  .toolbar {
    position: static;
    top: auto;
    gap: 0.85rem;
    padding: 0.85rem;
  }

  .toolbar-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .section-heading {
    display: none;
  }

  .toolbar.filters-open .section-heading {
    display: block;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
  }

  .toolbar.filters-open .section-heading h2 {
    max-width: none;
  }

  .quick-actions {
    order: -1;
  }

  .toolbar.filters-open .filters-panel {
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
  }

  .time-mode-compact {
    width: 100%;
  }

  .date-heading {
    position: static;
    top: auto;
  }
}

@media (min-width: 901px) {
  .filters-toggle {
    display: none;
  }

  .filters-panel {
    display: block;
  }

  .quick-actions {
    padding-top: 0.25rem;
    border-top: 1px solid var(--line);
  }

  .stats article {
    text-align: left;
  }

  .match-number {
    width: 2.85rem;
    height: 2.85rem;
  }

  .teams-row {
    gap: 0.75rem 1rem;
    margin: 0.15rem 0 0.2rem;
  }

  .team-flag,
  .team-flag--placeholder {
    width: 2.85rem;
    height: 1.9rem;
    border-radius: 0.32rem;
  }

  .team-name {
    font-size: 1.35rem;
  }

  .team-vs {
    font-size: 0.78rem;
  }

  .broadcast {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
  }

  .broadcast-note {
    flex: 1 1 14rem;
    min-width: 0;
  }

  .calendar-button {
    width: auto;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 680px) {
  .hero {
    padding-inline: 1rem;
  }

  .topbar {
    margin-bottom: 2.5rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 2rem;
  }

  .stats article {
    border-radius: 1rem;
    padding: 0.7rem 0.75rem;
    text-align: center;
  }

  .stats strong {
    font-size: 1.35rem;
  }

  .stats span {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .section-heading,
  .filters {
    grid-template-columns: 1fr;
  }

  .match-card {
    padding: 0.9rem;
    gap: 0.7rem;
  }

  .match-layout {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "number meta"
      "teams teams"
      "venue venue"
      "time time";
    gap: 0.55rem 0.75rem;
  }

  .match-info {
    display: contents;
  }

  .match-number {
    grid-area: number;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.85rem;
  }

  .match-meta {
    grid-area: meta;
    align-self: center;
  }

  .teams-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-area: teams;
    align-items: center;
    gap: 0.45rem 0.55rem;
    width: 100%;
    margin: 0.35rem 0 0.25rem;
    padding: 0.35rem 0;
  }

  .teams-row--placeholder {
    display: block;
    grid-template-columns: 1fr;
  }

  .teams-placeholder-text {
    font-size: 1.1rem;
    text-align: left;
  }

  .team-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    text-align: center;
  }

  .team-flag,
  .team-flag--placeholder {
    width: 3.25rem;
    height: 2.15rem;
    border-radius: 0.35rem;
  }

  .team-name {
    max-width: 100%;
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .team-vs {
    align-self: center;
    padding: 0 0.1rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .venue {
    grid-area: venue;
    font-size: 0.8rem;
    text-align: center;
  }

  .time-block {
    grid-area: time;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.65rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .time-main {
    flex: 1;
    min-width: 0;
  }

  .time {
    font-size: 1.35rem;
  }

  .date-small,
  .time-context {
    font-size: 0.78rem;
  }

  .calendar-button {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .broadcast {
    padding-top: 0.65rem;
  }

  .broadcast-note {
    font-size: 0.78rem;
  }

  .results-summary {
    display: grid;
  }

}

@media (max-width: 400px) {
  .time-block {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}
