/* =============================================================================
 * Darts League — shared styles
 * Dartboard-inspired theme (dark surface, red/green/cream accents).
 * No external fonts or CDNs so it works offline / from file://.
 * ============================================================================= */

:root {
  --bg:        #14181d;
  --surface:   #1c222a;
  --surface-2: #232b35;
  --border:    #2e3845;
  --text:      #eef1f4;
  --muted:     #93a1b1;
  --cream:     #f4e9c1;
  --red:       #d7263d;
  --green:     #1f9e5a;
  --gold:      #f0b429;
  --radius:    10px;
  --maxw:      900px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }

/* --- Header / nav ------------------------------------------------------- */
.site-header {
  background: linear-gradient(180deg, #1b232c 0%, #161b21 100%);
  border-bottom: 3px solid var(--red);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0;
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
}

.brand__dot {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--cream) 0 22%, var(--red) 22% 44%,
                    var(--green) 44% 66%, var(--cream) 66% 82%, #0c0f13 82% 100%);
  box-shadow: 0 0 0 2px #0c0f13;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 1.2rem;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.nav a {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 3px solid transparent;
}

.nav a:hover { color: var(--text); }

.nav a.is-active {
  color: var(--text);
  background: var(--surface);
  border-bottom-color: var(--gold);
}

/* --- Layout ------------------------------------------------------------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.page-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.55rem;
}

.page-subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

/* --- Table -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.standings {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

.standings th,
.standings td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.standings th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.standings td.num,
.standings th.num { text-align: center; }

.standings td.pts { font-weight: 800; color: var(--cream); }

.standings tr:last-child td { border-bottom: none; }

.standings tbody tr.is-leader td { background: rgba(240, 180, 41, 0.10); }

.pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.is-leader .pos { background: var(--gold); color: #14181d; }

/* --- Match lists (fixtures & results) ----------------------------------- */
.match-list { list-style: none; margin: 0; padding: 0; }

.match {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
}

.match__date {
  flex: 0 0 5.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.match__meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.match__meta--right {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.match__teams {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.match__player { font-weight: 600; }
.match__player.is-winner { color: var(--green); }
.match__player.is-loser { color: var(--muted); }

.match__vs {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.date-heading {
  margin: 1.4rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--cream);
  border-left: 3px solid var(--red);
  padding-left: 0.6rem;
}
.date-heading:first-child { margin-top: 0; }

.results-filter {
  margin-bottom: 1rem;
}

/* --- Form --------------------------------------------------------------- */
.form-group { margin-bottom: 1.25rem; }
.form-group--compact { margin-bottom: 0; }

label.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

select.input,
input.input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

input.input::placeholder { color: var(--muted); }
input.input:focus,
select.input:focus { outline: none; border-color: var(--gold); }

select.input:disabled { opacity: 0.55; }

.field-hint { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }

/* --- Roster (players admin page) ---------------------------------------- */
.roster { list-style: none; margin: 0; padding: 0; }

.roster li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid var(--border);
}
.roster li:last-child { border-bottom: none; }
.roster .roster__num { color: var(--muted); font-size: 0.8rem; min-width: 1.6rem; }
.roster .roster__name { font-weight: 600; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: #b91f33; }
.btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.alert--success { background: rgba(31, 158, 90, 0.16); border: 1px solid var(--green); color: #b6f0cf; }
.alert--error { background: rgba(215, 38, 61, 0.16); border: 1px solid var(--red); color: #f6c2c9; }

/* --- Misc --------------------------------------------------------------- */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

.hint { color: var(--muted); font-size: 0.85rem; }

footer.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 520px) {
  .site-header__inner {
    padding-bottom: 0.85rem;
  }

  .site-header__top {
    min-height: 3.25rem;
  }

  .brand {
    margin-bottom: 0;
    font-size: 1.15rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.9rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--border);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
  }

  .nav a.is-active {
    border-bottom-color: transparent;
  }

  .match { flex-wrap: wrap; }
  .match__date { flex-basis: 100%; }
}
