/* ================================
   DESIGN TOKENS — Koalas Lacrosse
   ================================ */
:root, [data-theme="light"] {
  --color-bg: #fafaf8;
  --color-surface: #ffffff;
  --color-surface-2: #f3f2ed;
  --color-surface-3: #eae8e1;
  --color-border: #e0ddd7;
  --color-border-light: #eceae5;
  --color-text: #1a1a1a;
  --color-text-secondary: #3a3a3a;
  --color-text-muted: #6b6b6b;
  --color-text-faint: #999;
  --color-accent: #1b5e20;
  --color-accent-light: #2e7d32;
  --color-accent-subtle: #e8f5e9;
  --color-accent-border: #a5d6a7;
  --color-gold: #c49000;
  --color-gold-subtle: #fef9ec;
  --color-gold-border: #efd98c;
  --color-win: #2e7d32;
  --color-loss: #9e9e9e;
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
  --radius: 8px;
  --radius-lg: 12px;
}

[data-theme="dark"] {
  --color-bg: #111111;
  --color-surface: #1a1a1a;
  --color-surface-2: #222222;
  --color-surface-3: #2a2a2a;
  --color-border: #2e2e2e;
  --color-border-light: #262626;
  --color-text: #e2e2e0;
  --color-text-secondary: #b0b0ae;
  --color-text-muted: #808080;
  --color-text-faint: #555;
  --color-accent: #66bb6a;
  --color-accent-light: #81c784;
  --color-accent-subtle: #1a2e1a;
  --color-accent-border: #2e4a2e;
  --color-gold: #ffd54f;
  --color-gold-subtle: #1f1a0d;
  --color-gold-border: #3d3010;
  --color-win: #66bb6a;
  --color-loss: #666;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111111;
    --color-surface: #1a1a1a;
    --color-surface-2: #222222;
    --color-surface-3: #2a2a2a;
    --color-border: #2e2e2e;
    --color-border-light: #262626;
    --color-text: #e2e2e0;
    --color-text-secondary: #b0b0ae;
    --color-text-muted: #808080;
    --color-text-faint: #555;
    --color-accent: #66bb6a;
    --color-accent-light: #81c784;
    --color-accent-subtle: #1a2e1a;
    --color-accent-border: #2e4a2e;
    --color-gold: #ffd54f;
    --color-gold-subtle: #1f1a0d;
    --color-gold-border: #3d3010;
    --color-win: #66bb6a;
    --color-loss: #666;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  }
}

/* ================================
   BASE
   ================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; background: none; border: none; color: var(--color-text); }
table { border-collapse: collapse; width: 100%; }

/* ================================
   LAYOUT
   ================================ */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ================================
   HEADER
   ================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.logo svg { flex-shrink: 0; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-record {
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

[data-theme-toggle] {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 150ms ease;
}
[data-theme-toggle]:hover { background: var(--color-surface-2); }

/* ================================
   TOC / NAV
   ================================ */
.toc {
  position: sticky;
  top: 55px;
  z-index: 90;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.toc-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.toc-link {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 150ms ease;
}
.toc-link:hover { color: var(--color-text); text-decoration: none; }
.toc-link.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.toc-external {
  margin-left: auto;
  color: var(--color-accent-light);
  font-weight: 600;
}

/* ================================
   HERO / TITLE AREA
   ================================ */
.issue-hero {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--color-border-light);
}

.issue-hero .part-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.issue-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.issue-hero .subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Record badge in hero */
.record-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.record-badge .conf {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 13px;
  padding-left: 8px;
  border-left: 1px solid var(--color-border);
}

/* ================================
   CALLOUTS
   ================================ */
.callout {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.callout-highlights {
  border-left: 4px solid var(--color-gold);
  background: var(--color-gold-subtle);
  border-color: var(--color-gold-border);
  border-left-color: var(--color-gold);
}

.callout-highlights .callout-label {
  color: var(--color-gold);
}

.callout-inaugural {
  border-left: 4px solid var(--color-accent);
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-border);
  border-left-color: var(--color-accent);
}

.callout-inaugural .callout-label {
  color: var(--color-accent);
  font-size: 12px;
  letter-spacing: 2px;
}

.callout-inaugural p {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  font-style: italic;
}

.callout-stats {
  border-left: 4px solid var(--color-accent);
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-border);
  border-left-color: var(--color-accent);
}

.callout-stats .callout-label {
  color: var(--color-accent);
}

.callout-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  color: var(--color-text-muted);
}

.callout p, .callout li {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--color-text-secondary);
}

.callout ul {
  padding-left: 18px;
  margin-top: 6px;
}

.callout li { margin-bottom: 4px; }

/* ================================
   STAT GRID (At-a-Glance)
   ================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ================================
   SECTION CONTEXT
   ================================ */
.section-context {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  margin-top: -8px;
  max-width: 60ch;
  font-style: italic;
}

/* ================================
   SECTION HEADERS
   ================================ */
.section-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 36px 0 20px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

/* ================================
   DATA TABLES
   ================================ */
.data-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.data-table {
  font-size: 13.5px;
  line-height: 1.5;
}

.data-table thead {
  background: var(--color-surface-2);
}

.data-table th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--color-border-light);
  vertical-align: top;
  color: var(--color-text-secondary);
}

.data-table tbody tr:first-child td { border-top: none; }

.data-table tbody tr:hover {
  background: var(--color-surface-2);
}

.player-name {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

/* Result badges */
.result-w {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-accent-subtle);
  color: var(--color-win);
  letter-spacing: 0.5px;
}

.result-l {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-surface-2);
  color: var(--color-loss);
  letter-spacing: 0.5px;
}

.result-upcoming {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-gold-subtle);
  color: var(--color-gold);
  letter-spacing: 0.5px;
}

.score-win {
  font-weight: 700;
  color: var(--color-win);
}

/* Position badges */
.pos-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  letter-spacing: 0.3px;
}

/* Numeric cells */
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ================================
   CONTENT SECTIONS
   ================================ */
.content-section {
  padding: 32px 0;
}

.content-section p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.content-section ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.content-section li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

/* ================================
   FOOTER
   ================================ */
.site-footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--color-border-light);
  margin-top: 8px;
}

.footer-links {
  font-size: 13px;
  margin-bottom: 16px;
}

.footer-links a { color: var(--color-text-muted); }
.footer-links a:hover { color: var(--color-accent); }

.footer-sep {
  margin: 0 10px;
  color: var(--color-text-faint);
}

.data-source {
  font-size: 12px;
  color: var(--color-text-faint);
  font-style: italic;
  max-width: 55ch;
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-sig {
  font-size: 12px;
  color: var(--color-text-faint);
}

/* ================================
   GOKOALAS BAR
   ================================ */
.gokoalas-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin: 36px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 200ms ease;
}

.gokoalas-bar:hover {
  border-color: var(--color-accent);
}

.gokoalas-bar svg { flex-shrink: 0; color: var(--color-accent); }

.gokoalas-bar span {
  font-size: 14px;
  color: var(--color-text-muted);
  flex: 1;
}

.gokoalas-bar a {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
  text-decoration: none;
}
.gokoalas-bar a:hover { text-decoration: underline; }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 480px) {
  .header-inner { padding: 12px 16px; }
  .logo a span { font-size: 15px; }
  .header-record { display: none; }
  .container { padding: 0 16px; }
  .callout { padding: 18px 20px; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }
  .issue-hero { padding: 36px 0 28px; }
  .gokoalas-bar { padding: 14px 18px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
}