:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f8fafc 0%, #eef2ff 40%, #f1f5f9 100%);
  color: #0f172a;
}

.app-shell {
  max-width: 1024px;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2rem);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dbe5f4;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #1d4ed8;
}

#page-title {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
}

.subtitle {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

select, input, button {
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

select:focus-visible, input:focus-visible, button:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

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

button.secondary,
.suggestion-btn {
  background: #fff;
  color: #0f172a;
}

.status {
  margin: 0.75rem 0;
  color: #334155;
  padding-left: 0.25rem;
}
.status.error { color: #b91c1c; }

.standings-shell {
  background: #fff;
  border: 1px solid #dbe5f4;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.standings-head {
  display: grid;
  grid-template-columns: 3rem minmax(140px, 1fr) repeat(5, minmax(2.5rem, auto));
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.head-rank,
.head-total,
.head-today,
.head-yesterday,
.head-week,
.head-month {
  text-align: center;
}

.head-team {
  text-align: left;
}

.standings {
  background: #fff;
}

.standing-row { border-bottom: 1px solid #e5e7eb; }
.standing-row:last-child { border-bottom: 0; }

.team-toggle {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 3rem minmax(140px, 1fr) repeat(5, minmax(2.5rem, auto));
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  align-items: center;
}

.rank { color: #64748b; font-weight: 700; }
.team-name { font-weight: 700; }
.team-total { font-weight: 700; color: #1e3a8a; }
.team-yesterday,
.team-week,
.team-month,
.team-today,
.team-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-list {
  padding: 0 1rem 0.85rem 4rem;
  background: #fcfdff;
}
.player-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(5, minmax(2.5rem, auto));
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  border-top: 1px dashed #e5e7eb;
  color: #334155;
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  min-width: 0;
}

.player-logo {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  object-fit: contain;
}

.player-metric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin { margin-top: 1rem; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.card {
  background: #fff;
  border: 1px solid #dbe5f4;
  border-radius: 0.75rem;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.roster-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roster-slot {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.roster-slot-label {
  font-size: 0.78rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}

.suggestions li { border-bottom: 1px solid #f3f4f6; }
.suggestions li:last-child { border-bottom: 0; }

.suggestion-btn {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
}

.hidden { display: none; }

@media (max-width: 720px) {
  .controls > * {
    flex: 1 1 calc(50% - 0.6rem);
    min-width: 0;
  }

  .standings-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.75rem;
  }

  .head-rank {
    flex: 0 0 2rem;
  }

  .head-team {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
  }

  .head-total,
  .head-today,
  .head-yesterday,
  .head-week,
  .head-month {
    flex: 0 0 1.9rem;
    text-align: right;
  }

  .team-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.75rem;
    overflow: hidden;
  }

  .rank {
    flex: 0 0 2rem;
  }

  .team-total,
  .team-today,
  .team-yesterday,
  .team-week,
  .team-month {
    flex: 0 0 1.9rem;
  }

  .team-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .team-total {
    justify-self: end;
    font-size: 0.95rem;
  }

  .team-yesterday,
  .team-week,
  .team-month,
  .team-today {
    justify-self: end;
    font-size: 0.88rem;
    color: #475569;
  }

  .player-list {
    padding: 0 1rem 0.75rem;
  }

  .player-row {
    grid-template-columns: minmax(96px, 1fr) repeat(5, minmax(1.6rem, 1.9rem));
    gap: 0.35rem;
    font-size: 0.88rem;
  }

  .player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
