/* FM Taktik-Hub — design tokens and components. No external assets. */
:root {
  --bg: #07100b;
  --bg-2: #0b1510;
  --panel: #101c15;
  --panel-2: #14221a;
  --panel-3: #182a20;
  --line: #263b2e;
  --line-strong: #385344;
  --text: #eef6ef;
  --muted: #9db2a4;
  --faint: #6e8577;
  --brand: #b9f24a;
  --brand-2: #77d957;
  --brand-ink: #101f08;
  --brand-soft: rgba(185, 242, 74, .12);
  --danger: #ff7777;
  --danger-soft: rgba(255, 119, 119, .12);
  --warning: #ffc857;
  --warning-soft: rgba(255, 200, 87, .12);
  --info: #7cc8ff;
  --info-soft: rgba(124, 200, 255, .12);
  --success: #7be0a4;
  --success-soft: rgba(123, 224, 164, .12);
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  --max: 1240px;
}

[data-theme="light"] {
  --bg: #f3f7ef;
  --bg-2: #eaf1e4;
  --panel: #ffffff;
  --panel-2: #f8fbf5;
  --panel-3: #eef5e9;
  --line: #d6e1d0;
  --line-strong: #b9cbb2;
  --text: #142019;
  --muted: #5b6e60;
  --faint: #7a8c7e;
  --brand: #2f7d36;
  --brand-2: #4da34b;
  --brand-ink: #ffffff;
  --brand-soft: rgba(47, 125, 54, .10);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, .09);
  --warning: #9a6700;
  --warning-soft: rgba(154, 103, 0, .10);
  --info: #0969a8;
  --info-soft: rgba(9, 105, 168, .09);
  --success: #1f7a3f;
  --success-soft: rgba(31, 122, 63, .10);
  --shadow: 0 18px 50px rgba(31, 61, 38, .12);
  --shadow-soft: 0 8px 24px rgba(31, 61, 38, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(119, 217, 87, .10), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(185, 242, 74, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand); color: var(--brand-ink); }
a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--brand-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 12px; }
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .55em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.grow-1 { flex: 1; min-width: 170px; }
.grow-2 { flex: 2; min-width: 220px; }
.align-end { align-self: end; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Header */
.bug-report-button { position: fixed; right: 20px; bottom: 20px; z-index: 35; box-shadow: var(--shadow-soft); }
.version-notice { position: fixed; left: 16px; bottom: 16px; z-index: 45; max-width: min(620px, calc(100% - 32px)); box-shadow: var(--shadow-soft); }
.version-notice[hidden] { display: none; }
.version-notice button { margin-left: 12px; }
.bug-report { min-width: 0; }
.bug-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-images { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.bug-images a { display: block; width: min(220px, 100%); }
.bug-images img { display: block; width: 100%; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  min-height: 74px; display: flex; align-items: center; gap: 12px;
}
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(119, 217, 87, .25);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; }
.brand-text strong { color: var(--brand); }
.brand-small .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand-small .brand-mark svg { width: 20px; height: 20px; }

.primary-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.primary-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 9px 11px; border-radius: var(--radius-pill);
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.header-search { display: flex; align-items: center; gap: 4px; margin-left: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 4px 3px 12px; min-width: 210px; }
.header-search input { border: 0; background: transparent; color: var(--text); outline: 0; width: 100%; min-width: 0; padding: 7px 0; }
.header-search input::placeholder { color: var(--faint); }
.language-switch { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); }
.language-switch a { display: grid; place-items: center; width: 32px; min-height: 30px; border-radius: var(--radius-pill); color: var(--muted); font-size: .72rem; font-weight: 700; text-decoration: none; }
.language-switch a:hover { color: var(--text); }
.language-switch a[aria-current="page"] { color: var(--brand); background: var(--panel-3); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 50%; text-decoration: none;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid transparent; font-weight: 700; text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button-small { min-height: 36px; padding: 7px 14px; font-size: .86rem; }
.button-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); box-shadow: 0 8px 22px rgba(119, 217, 87, .18); }
.button-primary:hover { color: var(--brand-ink); filter: brightness(1.04); }
.button-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.button-secondary { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.button-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.button-block { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: var(--panel-3); color: var(--brand);
  border: 1px solid var(--line-strong); font-weight: 800; font-size: .82rem;
  cursor: pointer;
}
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; z-index: 50;
}
.user-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 2px; }
.user-menu-panel a, .menu-link {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; background: none; border: 0; font-size: .92rem;
}
.user-menu-panel a:hover, .menu-link:hover { background: var(--panel-2); }

/* Messages */
.messages { margin-top: 18px; display: grid; gap: 8px; }
.message {
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel); font-size: .92rem;
}
.message-success { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); background: var(--success-soft); }
.message-error, .message-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }
.message-warning { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); background: var(--warning-soft); }
.message-info { border-color: color-mix(in srgb, var(--info) 45%, var(--line)); background: var(--info-soft); }

main { padding: 34px 0 72px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 38px 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 28px; align-items: start; }
.site-footer nav { display: grid; gap: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-note { margin: 0; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 64px);
  background:
    linear-gradient(110deg, rgba(185, 242, 74, .13), transparent 35%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(185, 242, 74, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 242, 74, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(120deg, transparent 20%, black 100%);
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px;
  border: 2px solid rgba(185, 242, 74, .18); border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(185, 242, 74, .03), 0 0 0 120px rgba(185, 242, 74, .02);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.5fr .9fr; gap: 36px; align-items: end; }
.hero h1 { max-width: 14ch; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-lead { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-panel { border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 80%, transparent); border-radius: var(--radius); padding: 20px; }
.hero-panel .stat { border-bottom: 1px solid var(--line); padding: 12px 0; }
.hero-panel .stat:last-child { border-bottom: 0; }
.hero-panel .stat strong { display: block; font-size: 1.7rem; font-family: var(--font-display); color: var(--brand); }
.hero-community {
  display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
}
.hero-community-label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--brand); text-transform: uppercase; letter-spacing: .12em;
  font-size: .68rem; font-weight: 800;
}
.hero-community-label::before { content: ""; width: 18px; height: 2px; background: var(--brand); }
.hero-community p { margin: 0; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 72ch; }
.hero-community a {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text); font-weight: 700; text-decoration: none;
}
.hero-community a:hover { color: var(--brand); }
.hero-community a svg { opacity: .65; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--brand);
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand); }

/* Section headings */
.section { margin-top: 46px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-head h2 { margin: 0; }
.link-more { font-size: .9rem; font-weight: 700; text-decoration: none; }

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-soft);
}
.card:hover { border-color: var(--line-strong); }
.card-flat { box-shadow: none; }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 12px; }
.card-title { margin: 0; font-size: 1.35rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.card-body { color: var(--muted); font-size: .93rem; }
.card-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }

.tactic-card { display: flex; flex-direction: column; min-height: 100%; }
.tactic-card .formation-badge { margin-left: auto; }
.tactic-card .card-title { max-width: 19ch; }
.tactic-card .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; }
.mini-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.mini-stat span { display: block; color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.mini-stat strong { font-family: var(--font-display); font-size: 1.18rem; }
.pitch-line { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--brand), transparent); margin-bottom: 16px; }

/* Badges and pills */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); font-size: .74rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.badge-brand, .pill-brand { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--brand); }
.badge-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 40%, var(--line)); color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 40%, var(--line)); color: var(--warning); }
.badge-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); }
.badge-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 40%, var(--line)); color: var(--info); }
.formation-badge { font-family: var(--font-display); letter-spacing: .06em; color: var(--brand); }
.form-pill { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 92px; }
.form-pill span { height: 22px; border-radius: 4px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; background: var(--panel-3); color: var(--muted); }
.form-pill .w { background: var(--success-soft); color: var(--success); }
.form-pill .d { background: var(--warning-soft); color: var(--warning); }
.form-pill .l { background: var(--danger-soft); color: var(--danger); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.run-card { min-width: 0; }
.run-card .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.run-card .stat-card { min-width: 0; }
.run-card .stat-card .value { font-size: clamp(1.25rem, 2.1vw, 1.9rem); overflow-wrap: anywhere; }
.run-card .stat-card .stat-pair { display: flex; flex-wrap: wrap; gap: 0 3px; }
.run-card .table-wrap { max-width: 100%; }
.assessment { border-top: 1px solid var(--line); padding-top: 16px; }
.assessment h5 { margin: 18px 0 0; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.assessment-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: .9rem; }
.assessment-list strong { color: var(--text); }
.assessment-list .insight-positive strong { color: var(--success); }
.assessment-list .insight-warning strong { color: var(--warning); }
.detail-side { min-width: 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-card .label { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.stat-card .value { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; margin-top: 4px; }
.stat-card .sub { color: var(--muted); font-size: .78rem; }
.stat-good { color: var(--success); }
.stat-bad { color: var(--danger); }
.stat-brand { color: var(--brand); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: var(--panel-2); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data .positive { color: var(--success); }
table.data .negative { color: var(--danger); }
.table-note { color: var(--faint); font-size: .78rem; padding: 10px 4px 0; }

/* W/D/L bar */
.wdl { width: 100%; height: 12px; display: block; border-radius: 8px; overflow: hidden; background: var(--panel-3); }
.wdl rect { height: 12px; }
.wdl-w { fill: var(--success); }
.wdl-d { fill: var(--warning); }
.wdl-l { fill: var(--danger); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .78rem; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.legend .w { background: var(--success); }
.legend .d { background: var(--warning); }
.legend .l { background: var(--danger); }

/* Tactic detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 24px; align-items: start; }
.detail-main { min-width: 0; }
.detail-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.tactic-header { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 24px; }
.tactic-header h1 { margin-bottom: 10px; }
.tactic-header .row { color: var(--muted); font-size: .9rem; }
.prose { color: var(--text); font-size: 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose blockquote { border-left: 3px solid var(--brand); margin: 16px 0; padding: 6px 0 6px 16px; color: var(--muted); }
.prose code { background: var(--panel-3); padding: 2px 5px; border-radius: 5px; font-size: .88em; }
.prose pre { background: var(--panel-3); padding: 14px; border-radius: var(--radius-sm); overflow: auto; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.side-list { display: grid; gap: 12px; }
.side-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.side-item:last-child { border-bottom: 0; }
.side-item span { color: var(--muted); }

/* Forum */
.thread-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.post { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--panel-3); border: 1px solid var(--line); color: var(--brand); font-weight: 800; }
.post-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.post-head strong { font-size: .95rem; }
.post-head time { color: var(--faint); font-size: .76rem; }
.post-body { color: var(--text); font-size: .96rem; }
.post-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.post-actions a, .post-actions button { background: none; border: 0; padding: 0; color: var(--faint); font-size: .76rem; text-decoration: none; }
.post-actions a:hover, .post-actions button:hover { color: var(--text); }
.post-deleted { opacity: .55; font-style: italic; }
.reply-box { margin-top: 24px; }
.reply-box textarea { min-height: 150px; }
.report-inline { display: inline; }

/* Forms */
.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > label, .label { font-weight: 700; font-size: .86rem; }
.field .help { color: var(--faint); font-size: .78rem; }
.field .errors { color: var(--danger); font-size: .8rem; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 13px; min-height: 44px;
}
.textarea { resize: vertical; min-height: 130px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.checkbox { width: 18px; height: 18px; accent-color: var(--brand); }
.check-row { display: flex; gap: 10px; align-items: start; }
.check-row label { font-size: .88rem; color: var(--muted); }
.auth-card form p { display: grid; gap: 6px; margin: 0 0 14px; }
.auth-card form p label { font-weight: 700; font-size: .86rem; }
.auth-card form p input {
  width: 100%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 13px; min-height: 44px;
}
.auth-card form p input:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.auth-card form p .helptext, .auth-card form p .help { color: var(--faint); font-size: .78rem; }
.auth-card ul.errorlist { color: var(--danger); font-size: .8rem; margin: 0; padding-left: 18px; }
details summary { cursor: pointer; color: var(--brand-2); font-weight: 700; }
details summary:hover { color: var(--brand); }
.table-scroll { max-height: 430px; overflow: auto; }
.form-card { max-width: 720px; }
.form-card-wide { max-width: 980px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.narrow { max-width: 480px; margin: 0 auto; }
.auth-card { max-width: 480px; margin: 20px auto; }
.auth-card h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.contact-page { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.contact-intro { padding-top: 12px; }
.contact-intro h1 { margin-bottom: 16px; }
.contact-intro .hero-sub { max-width: 42ch; }
.contact-direct { display: grid; gap: 4px; margin: 26px 0 18px; padding-left: 16px; border-left: 3px solid var(--brand); }
.contact-direct a { font-family: var(--font-display); font-size: 1.25rem; color: var(--brand); text-decoration: none; }
.contact-direct a:hover { text-decoration: underline; }
.contact-form { padding: clamp(20px, 3vw, 28px); }
.contact-form .card-title { margin-bottom: 4px; }
@media (max-width: 820px) {
  .contact-page { grid-template-columns: 1fr; gap: 24px; }
  .contact-intro { padding-top: 0; }
}
.auth-footer { color: var(--muted); font-size: .88rem; margin-top: 18px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Moderation */
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mod-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--panel); margin-bottom: 10px; }
.mod-item:last-child { margin-bottom: 0; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.author-assignment { display: grid; gap: 8px; min-width: 220px; max-width: 280px; }
table.data .author-column { text-align: left; }
.author-assignment .select { min-width: 0; }
.author-assignment .button { justify-self: start; }
.mod-actions .button { min-height: 34px; padding: 5px 10px; font-size: .78rem; }
.mod-actions .input { flex: 1; min-width: 160px; width: auto; }
.inline-form { display: inline; }
.inline-form input, .inline-form select { display: inline-block; width: auto; }

/* Empty states and pagination */
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--muted); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .86rem;
}
.pagination a:hover, .pagination .current { color: var(--text); border-color: var(--brand); background: var(--brand-soft); }

/* Misc */
.kpi-bar { display: grid; gap: 10px; }
.kpi-bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: .82rem; }
.kpi-bar-row .track { height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.kpi-bar-row .fill { height: 8px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 6px; }
.meter { height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 8px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.source-note { border-left: 3px solid var(--line-strong); padding-left: 12px; color: var(--muted); font-size: .82rem; }
.notice { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); }
.notice-warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); background: var(--warning-soft); }
.notice-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.upload-file-summary { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--panel-2); }
.upload-side { align-self: start; }
.waitlist { display: grid; gap: 10px; }
.waitlist-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.waitlist-item:last-child { border-bottom: 0; }
.waitlist-item a { text-decoration: none; font-weight: 700; }
.test-lab-grid { align-items: start; }
.queue-card .waitlist { gap: 0; }
.queue-list .waitlist-item { gap: 10px; align-items: flex-start; }
.queue-position { flex: 0 0 26px; color: var(--muted); font-family: var(--font-display); font-size: 1rem; text-align: right; font-variant-numeric: tabular-nums; }
.queue-main { flex: 1 1 auto; min-width: 0; }
.queue-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.queue-title a { overflow-wrap: anywhere; }
.waitlist-item.is-own { padding-left: 8px; padding-right: 8px; border-left: 3px solid var(--brand); border-radius: 6px; background: rgba(126, 217, 87, .08); }
.queue-separator { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: var(--muted); font-size: .95rem; line-height: 1; }
.queue-separator::before, .queue-separator::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.queue-own-note { padding: 10px 4px 2px; color: var(--muted); font-size: .85rem; text-align: center; }
.hero-sub { color: var(--muted); font-size: 1.05rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.list-clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* Results / ranking table */
.forum-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.forum-heading, .forum-topic { display: grid; grid-template-columns: minmax(0, 1fr) 100px minmax(220px, 32%); gap: 24px; align-items: center; padding: 18px 24px; }
.forum-heading { background: var(--panel-2); color: var(--muted); font-size: .75rem; font-weight: 700; }
.forum-topic { border-top: 1px solid var(--line); }
.forum-topic:hover { background: var(--panel-2); }
.forum-topic h2 { margin: 0 0 8px; font-size: 1rem; overflow-wrap: anywhere; }
.forum-topic a { text-decoration: none; }
.forum-topic a:hover { text-decoration: underline; }
.forum-comment-count { display: grid; gap: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.forum-heading > :nth-child(2) { text-align: center; }
.forum-comment-count > span { display: none; }
.forum-latest { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.forum-latest p { margin: 0; }
@media (max-width: 640px) {
  .forum-heading { display: none; }
  .forum-topic { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px; }
  .forum-topic:first-of-type { border-top: 0; }
  .forum-comment-count > span { display: block; }
  .forum-latest { grid-column: 1 / -1; }
}

.results-page { display: grid; gap: 20px; min-width: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--info); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { color: var(--faint); }
.results-head h1 { margin: 0 0 4px; font-size: clamp(1.9rem, 3vw, 2.5rem); }
.results-head p { margin: 0; }
.results-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.results-tabs a { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; padding: 10px 16px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; }
.results-tabs a:hover { color: var(--text); }
.results-tabs a[aria-current="page"] { border-bottom-color: var(--brand); color: var(--text); }
.results-scope h2 { margin: 0 0 4px; font-size: 1rem; }
.results-scope p { margin: 0; }
.results-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.results-toolbar > .button { white-space: normal; text-align: center; }
.results-toolbar .button svg { flex: 0 0 auto; }
.results-filter { position: relative; }
.results-filter > summary { list-style: none; cursor: pointer; }
.results-filter > summary::-webkit-details-marker { display: none; }
.results-filter[open] > summary { background: var(--panel-2); border-color: var(--line-strong); }
.results-filter-panel {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
  width: min(340px, calc(100vw - 40px)); padding: 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.results-filter-panel .form-actions { margin-top: 12px; }
.results-toolbar .button.is-active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.results-table-wrap { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--panel-2); }
.results-table-wrap::-webkit-scrollbar { height: 8px; }
.results-table-wrap::-webkit-scrollbar-track { background: var(--panel-2); }
.results-table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
table.results-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
table.results-table th, table.results-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.results-table th[data-stat], table.results-table td[data-stat] { border-left: 1px solid var(--line); }
table.results-table thead th { background: var(--panel-2); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: right; }
table.results-table th.results-identity, table.results-table td.results-tactic { text-align: left; }
table.results-table .results-formation, table.results-table .results-download { text-align: center; }
table.results-table .results-groups th[scope="colgroup"] { padding-top: 8px; padding-bottom: 8px; text-align: center; color: var(--text); }
.results-groups th span { color: var(--muted); font-weight: 600; }
.results-group-start { border-left: 1px solid var(--line); }
table.results-table .results-tactic { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
table.results-table thead .results-tactic { z-index: 2; background: var(--panel-2); }
table.results-table tbody tr:hover .results-tactic { background: var(--panel-2); }
table.results-table .results-rank {
  position: sticky; left: 0; z-index: 1;
  width: 60px; min-width: 60px; text-align: center;
  background: var(--panel); color: var(--muted);
  font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 1px 0 0 var(--line);
}
table.results-table thead .results-rank { z-index: 2; background: var(--panel-2); }
table.results-table tbody tr:hover .results-rank { background: var(--panel-2); }
table.results-table .results-tactic { left: 60px; }
table.results-table th a { position: relative; color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
table.results-table th a:hover { color: var(--text); }
table.results-table th.is-sorted a { color: var(--text); }
table.results-table .sort-caret { position: absolute; right: -12px; top: 50%; transform: translateY(-50%); font-size: .62rem; color: var(--brand); }
table.results-table tbody tr:hover { background: var(--panel-2); }
table.results-table tbody tr:last-child td { border-bottom: 0; }
.results-stat { text-align: right; font-variant-numeric: tabular-nums; }
.results-stat strong { color: var(--text); }
table.results-table .positive { color: var(--success); }
table.results-table .negative { color: var(--danger); }
.results-thread { min-width: 210px; }
.results-thread > a { color: var(--brand-2); font-weight: 700; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.results-thread > a:hover { color: var(--brand); text-decoration: underline; }
.formation-cell { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pitch-mini {
  display: block; flex: 0 0 auto;
  width: 38px; height: 52px; overflow: hidden; border-radius: 4px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .07) 0 7px, rgba(0, 0, 0, 0) 7px 14px),
    linear-gradient(180deg, #3f9c4a, #2c7a39);
}
.pitch-unavailable { display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); }
.pitch-mini-line { fill: none; stroke: rgba(255, 255, 255, .68); stroke-width: 1; }
.pitch-mini-goal { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: .8; }
.pitch-mini-dot { fill: #fff; stroke: rgba(0, 0, 0, .2); stroke-width: .5; }
.results-owner { display: flex; align-items: center; gap: 5px; margin: 4px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.results-owner a { color: inherit; text-decoration: none; }
.results-owner a:hover { color: var(--brand); text-decoration: underline; }
.results-download-content { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.results-download-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.results-download-link:hover { text-decoration: underline; }
.results-download-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.avatar-xs { width: 26px; height: 26px; min-width: 26px; font-size: .62rem; cursor: default; }
.results-footer { position: sticky; left: 0; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .8rem; }
.results-note { margin: 0; color: var(--faint); font-size: .78rem; }

/* Responsive */
@media (max-width: 1280px) {
  .header-row { flex-wrap: wrap; padding: 10px 0; }
  .primary-nav {
    order: 6; flex: 0 0 100%; overflow-x: auto; margin-left: 0;
    padding-bottom: 6px; scrollbar-width: thin;
  }
  .primary-nav a { white-space: nowrap; }
}
@media (max-width: 1100px) {
  .header-search { min-width: 150px; }
  .primary-nav a { padding: 8px; }
}
@media (max-width: 960px) {
  .hero-grid, .detail-grid, .footer-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header-search { margin-left: auto; }
  .mod-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .header-search { order: 5; flex: 1 1 calc(100% - 82px); width: auto; margin-left: 0; }
  .language-switch { order: 5; }
}
@media (max-width: 640px) {
  .results-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; overflow: visible; }
  .results-tabs a { padding: 10px 4px; font-size: .8rem; }
  .shell { width: min(var(--max), calc(100% - 24px)); }
  .header-row { min-height: 64px; gap: 10px; flex-wrap: wrap; padding: 10px 0; }
  .header-search { order: 5; width: calc(100% - 82px); margin-left: 0; }
  .language-switch { order: 5; }
  .brand-text { font-size: 1rem; }
  .grid-3, .grid-4, .grid-2, .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { gap: 18px; }
  .post { grid-template-columns: 1fr; }
  .post-avatar { width: 36px; height: 36px; border-radius: 10px; }
  table.data th, table.data td { padding: 10px 9px; }
  .tactic-header h1 { font-size: 2.1rem; }
  .hero { padding: 24px 18px; }
  .hero-actions .button { width: 100%; }
}
@media (max-width: 420px) {
  .header-actions .button-ghost { display: none; }
  .brand-text { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .hero-actions, .tabs, .reply-box { display: none; }
  body { background: #fff; color: #111; }
  .card, .table-wrap { border-color: #ccc; box-shadow: none; }
}
