:root {
  --bg: #0e1118;
  --panel: #151a25;
  --panel-2: #1d2432;
  --text: #f4f7fb;
  --muted: #a8b3c7;
  --line: #2b3548;
  --red: #ef4444;
  --red-2: #b91c1c;
  --green: #22c55e;
  --yellow: #f59e0b;
  --blue: #38bdf8;
  --purple: #a78bfa;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(239, 68, 68, 0.24), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(167, 139, 250, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.1rem clamp(1rem, 4vw, 3rem) 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  font-size: 0.76rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  letter-spacing: -0.04em;
}

h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.subtitle {
  margin: 0.85rem 0 0;
  max-width: 60rem;
  color: var(--muted);
  font-size: 1rem;
}

.hero-card {
  min-width: 16rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(21, 26, 37, 0.72);
  box-shadow: var(--shadow);
}

.hero-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.tabs {
  display: flex;
  gap: 0.6rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 17, 24, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active,
.tab:hover {
  border-color: rgba(239, 68, 68, 0.62);
  background: linear-gradient(135deg, var(--red-2), var(--red));
}

main {
  padding: 1.4rem clamp(1rem, 4vw, 3rem) 2.5rem;
}

.view { display: none; }
.view.active { display: block; }

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: rgba(21, 26, 37, 0.88);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.kpi {
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi span {
  color: var(--muted);
  font-weight: 700;
}

.kpi strong {
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

.kpi small { color: var(--muted); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: rgba(21, 26, 37, 0.78);
}

th, td {
  text-align: left;
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

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

tr:hover td { background: rgba(255, 255, 255, 0.025); }

.tag {
  display: inline-block;
  color: #d8def0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
  font-weight: 800;
}

.badge.good { color: #d9ffe7; background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.22); }
.badge.warn { color: #fff4d6; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.22); }
.badge.bad { color: #ffe2e2; background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.24); }
.badge.info { color: #dff6ff; background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.22); }

.search {
  width: min(34rem, 100%);
  border: 1px solid var(--line);
  background: rgba(21, 26, 37, 0.9);
  color: var(--text);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  outline: none;
  font-size: 1rem;
}

.search:focus { border-color: rgba(239, 68, 68, 0.8); }

.progress {
  height: 0.55rem;
  width: 7rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
}

.notice {
  border: 1px solid rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.12);
  color: #fff7dd;
  padding: 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.hidden { display: none; }

.player-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: start;
}

.player-name { font-weight: 900; font-size: 1.05rem; }

.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.week-pill {
  padding: 0.35rem 0.45rem;
  border-radius: 0.55rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.week-pill.perfect { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.22); }
.week-pill.missed { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.22); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
}

@media (max-width: 900px) {
  .hero { align-items: stretch; flex-direction: column; }
  .hero-card { min-width: 0; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .footer { flex-direction: column; }
}
