/* Scorekeepr — hand-written application styles (no framework). */

:root {
  --ink: #1f2a33;
  --muted: #6b7a87;
  --bg: #f6f8f9;
  --surface: #ffffff;
  --line: #dde4e9;
  --accent: #1f6f54;
  --accent-dark: #175743;
  --notice-bg: #e6f4ee;
  --alert-bg: #fdeceb;
  --alert-ink: #8f2c24;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

.container { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }

main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav form { display: inline; }

/* Impersonation banner (docs/DOMAIN.md § Impersonation): shown on every page
   while a super admin is acting as a member. */
.impersonation-banner { background: var(--alert-bg); color: var(--alert-ink); border-bottom: 1px solid #f2c6c2; }
.impersonation-banner__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.impersonation-notice { font-weight: 600; }

/* Flash messages */
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin: 0 0 1rem; }
.flash--notice { background: var(--notice-bg); color: var(--accent-dark); border: 1px solid #bfe3d4; }
.flash--alert { background: var(--alert-bg); color: var(--alert-ink); border: 1px solid #f2c6c2; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Tables (scoreboards etc.) */
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); }
thead th {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border-bottom: 2px solid var(--line);
}
tbody tr:nth-child(odd) { background: #fbfcfd; }
tbody tr:hover { background: #f0f5f3; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
form label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.9rem 0 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  display: block; width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
}
input:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

button, input[type="submit"] {
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  font: inherit; font-weight: 600;
  color: #fff; background: var(--accent);
  border: 0; border-radius: 6px;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover { background: var(--accent-dark); }

.nav-button {
  margin-top: 0; padding: 0.3rem 0.75rem;
  font-weight: 500; font-size: 0.9rem;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 6px;
}
.nav-button:hover { background: var(--bg); color: var(--ink); }

/* Register-match form (matches slice): two sides next to each other and a
   compact side-by-side score entry, all on one screen. */
.match-form fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 0 0.9rem 0.9rem; }
.match-form fieldset legend { font-weight: 600; padding: 0 0.3rem; }
.match-form .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 0.9rem; }
.score-entry { display: flex; gap: 0.75rem; align-items: flex-end; max-width: 18rem; }
.score-entry input[type="number"] { font-size: 1.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.score-entry__dash { font-size: 1.3rem; color: var(--muted); padding-bottom: 0.4rem; }

/* League page (scoreboards slice): open/closed badge and recent matches. */
.badge {
  display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.55rem;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; border-radius: 999px;
}
.badge--open { color: var(--accent-dark); background: var(--notice-bg); border: 1px solid #bfe3d4; }
.badge--closed { color: var(--alert-ink); background: var(--alert-bg); border: 1px solid #f2c6c2; }
.recent-matches { margin: 0; padding-left: 1.25rem; }
.recent-matches li { padding: 0.15rem 0; }

/* TV dashboard (scoreboards slice): dark full-screen wall display. */
body.tv { background: #10181f; color: #e8eef2; }
body.tv .tv-container { max-width: 72rem; padding: 2rem 1.5rem; }
body.tv .card { background: #1b2630; border-color: #2c3a47; }
body.tv h1, body.tv h2 { color: #e8eef2; }
body.tv .muted { color: #9fb0bd; }
.tv-header h1 { font-size: 3rem; margin: 0; }
.tv-header .tv-game { font-size: 1.3rem; margin: 0.25rem 0 0; }
.tv-spotlights { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.tv-spotlight-title { font-size: 1.8rem; font-weight: 700; margin: 0; }
.tv-spotlight-detail { font-size: 1.2rem; margin: 0.35rem 0 0; }
body.tv table { background: transparent; font-size: 1.4rem; }
body.tv th, body.tv td { border-color: #2c3a47; }
body.tv thead th { color: #9fb0bd; }
body.tv tbody tr:nth-child(odd), body.tv tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.tv-recent ol { margin: 0; padding-left: 1.5rem; font-size: 1.2rem; }
.tv-recent li { padding: 0.15rem 0; }

/* Player page (statistics slice): match-history pager. */
.pagination {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 0.75rem; font-size: 0.9rem;
}

/* Utilities */
.muted { color: var(--muted); }
.actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.actions form { display: inline; }
.actions button { margin-top: 0; }
