:root {
  color-scheme: light;
  --background: #f6f7f8;
  --surface: #ffffff;
  --surface-alt: #eef2f4;
  --border: #d6dde2;
  --border-strong: #aeb9c2;
  --text: #17212b;
  --muted: #5d6975;
  --accent: #0f6b5f;
  --accent-strong: #0a4d45;
  --danger: #a33131;
  --warning: #8a5a00;
  --shadow: 0 16px 45px rgba(23, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

main {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 40px 20px;
}

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.controls {
  display: block;
  padding: 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

select:focus,
input:focus,
.download-link:focus {
  outline: 3px solid rgba(15, 107, 95, 0.25);
  outline-offset: 2px;
}

.download-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 0 14px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.download-link:hover {
  background: var(--accent-strong);
}

.download-link[hidden] {
  display: none;
}

.status {
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.no-darts {
  color: var(--warning);
  font-weight: 700;
}

.fixture {
  font-weight: 700;
}

@media (max-width: 760px) {
  main {
    padding: 28px 14px;
  }

  header {
    display: block;
  }

  h1 {
    margin-bottom: 8px;
    font-size: 1.65rem;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    padding: 10px 5px;
    font-size: 0.95rem;
  }

  th {
    font-size: 0.72rem;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 38%;
    padding-left: 8px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 20%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 42%;
  }

  .fixture {
    overflow-wrap: anywhere;
  }
}
