/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1923;
  --surface:  #1a2535;
  --border:   #2a3a50;
  --accent:   #5865f2;
  --text:     #e2e8f0;
  --muted:    #8899aa;
  --ok:       #22c55e;
  --partial:  #eab308;
  --miss:     #ef4444;
  --highlight:#2a3a5a;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Nav ---- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-brand { font-weight: 700; font-size: 1rem; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-user { color: var(--muted); font-size: 0.85rem; }

/* ---- Main ---- */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

h2 { font-size: 1.3rem; margin-bottom: 1rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.subtitle { color: var(--muted); font-size: 0.85rem; }
.page-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header a { font-size: 0.85rem; }
.header-actions { display: flex; gap: 0.75rem; align-items: center; margin-left: auto; flex-wrap: wrap; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-card { flex: 1; min-width: 140px; text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

/* ---- Login ---- */
.login-card { max-width: 380px; margin: 4rem auto; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.login-card .subtitle { margin-bottom: 1.5rem; display: block; }
.dev-warning {
  background: #3a2a00;
  border: 1px solid #7a5a00;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: var(--partial);
  margin-bottom: 1.25rem;
}
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; margin-top: 0.75rem; }
input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}
input[type="text"]:focus { outline: 2px solid var(--accent); }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; margin-top: 0.75rem; }
.checkbox-label input { width: auto; }
button, .btn {
  display: inline-block;
  margin-top: 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { opacity: 0.9; text-decoration: none; }

/* ---- Flash ---- */
.flash {
  background: #3a2a00;
  border: 1px solid var(--partial);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  color: var(--partial);
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
tr:hover td { background: rgba(255,255,255,0.02); }
.row-highlight td { background: var(--highlight); }
.row-miss td { background: rgba(239,68,68,0.05); }
tfoot td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: none; }

/* ---- Missed attacks table ---- */
.scroll-x { overflow-x: auto; }
.missed-table { min-width: max-content; }
.missed-table .player-name { white-space: nowrap; font-weight: 600; position: sticky; left: 0; background: var(--bg); z-index: 1; }
.missed-table tr:hover .player-name { background: var(--surface); }
.day-header { text-align: center; font-size: 0.75rem; min-width: 48px; }
.day-header span { color: var(--muted); }
.day-cell { text-align: center; padding: 0.3rem 0.25rem; }

/* ---- Pills ---- */
.pill {
  display: inline-block;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}
.pill-sm { padding: 0.1rem 0.3rem; font-size: 0.72rem; }
.pill-ok      { background: rgba(34,197,94,0.2);  color: var(--ok); }
.pill-partial { background: rgba(234,179,8,0.2);  color: var(--partial); }
.pill-miss    { background: rgba(239,68,68,0.2);  color: var(--miss); }

/* ---- Miss count ---- */
.miss-count { color: var(--miss); font-weight: 600; }

/* ---- Season selector ---- */
.season-select-form { display: flex; align-items: center; gap: 0.5rem; }
select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

/* ---- Legend ---- */
.legend { margin-bottom: 1rem; font-size: 0.85rem; color: var(--muted); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: 0.5rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
