/* FM Taktik-Hub — "Taktiktafel" design system.
   Light: whiteboard (squared paper, marker ink, blue magnets, red annotations).
   Dark: chalkboard (slate green, chalk lines, chalk-blue magnets).
   Self-hosted fonts only (privacy, CSP). */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --bg-2: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f4f7fa;
  --panel-3: #e8edf3;
  --line: #d7dee7;
  --line-strong: #aab6c4;
  --ink: #1c2430;
  --pop: #1c2430;
  --text: #1c2430;
  --muted: #4e5a6a;
  --faint: #667183;
  --brand: #1d4ed8;
  --brand-2: #1d4ed8;
  --brand-deep: #1e3a8a;
  --brand-ink: #ffffff;
  --brand-soft: rgba(29, 78, 216, .09);
  --marker: #c9372e;
  --highlight: #fde68a;
  --highlight-soft: rgba(253, 224, 120, .6);
  --row-hover: #fffbea;
  --grid-line: #e6ebf1;
  --pitch-bg: #e6f2e7;
  --pitch-line: #2b5a36;
  --pitch-dot: #1d4ed8;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, .08);
  --warning: #8a5a00;
  --warning-soft: rgba(217, 150, 0, .12);
  --info: #0e6b8a;
  --info-soft: rgba(14, 107, 138, .09);
  --success: #166534;
  --success-soft: rgba(22, 101, 52, .10);
  --paypal: #0070ba;
  --paypal-2: #005ea6;
  --paypal-text: #005ea6;
  --paypal-ink: #ffffff;
  --shadow: 0 16px 40px rgba(28, 36, 48, .12);
  --shadow-soft: 0 6px 18px rgba(28, 36, 48, .08);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --border: 2px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --max: 1240px;
}

/* Chalkboard tokens: shared by the OS preference and the explicit toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17211e; --bg-2: #131b18; --panel: #1e2a26; --panel-2: #23312c; --panel-3: #2a3a34;
    --line: #34463f; --line-strong: #52685f; --ink: #d6e0da; --pop: #0a0f0d;
    --text: #eef3f0; --muted: #b0beb7; --faint: #8f9e97;
    --brand: #8fb5ff; --brand-2: #a6c4ff; --brand-deep: #c4d8ff; --brand-ink: #0f1d3d; --brand-soft: rgba(143, 181, 255, .14);
    --marker: #ff9086; --highlight: #f2d56b; --highlight-soft: rgba(242, 213, 107, .24); --row-hover: rgba(242, 213, 107, .07);
    --grid-line: rgba(255, 255, 255, .035);
    --pitch-bg: #1d3a2c; --pitch-line: rgba(238, 243, 240, .78); --pitch-dot: #f2d56b;
    --danger: #ff9086; --danger-soft: rgba(255, 144, 134, .13);
    --warning: #f2c66d; --warning-soft: rgba(242, 198, 109, .13);
    --info: #7fd0e3; --info-soft: rgba(127, 208, 227, .12);
    --success: #7fd9a0; --success-soft: rgba(127, 217, 160, .13);
    --paypal-text: #8cc8ff;
    --shadow: 0 18px 44px rgba(0, 0, 0, .4); --shadow-soft: 0 8px 22px rgba(0, 0, 0, .28);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17211e; --bg-2: #131b18; --panel: #1e2a26; --panel-2: #23312c; --panel-3: #2a3a34;
  --line: #34463f; --line-strong: #52685f; --ink: #d6e0da; --pop: #0a0f0d;
  --text: #eef3f0; --muted: #b0beb7; --faint: #8f9e97;
  --brand: #8fb5ff; --brand-2: #a6c4ff; --brand-deep: #c4d8ff; --brand-ink: #0f1d3d; --brand-soft: rgba(143, 181, 255, .14);
  --marker: #ff9086; --highlight: #f2d56b; --highlight-soft: rgba(242, 213, 107, .24); --row-hover: rgba(242, 213, 107, .07);
  --grid-line: rgba(255, 255, 255, .035);
  --pitch-bg: #1d3a2c; --pitch-line: rgba(238, 243, 240, .78); --pitch-dot: #f2d56b;
  --danger: #ff9086; --danger-soft: rgba(255, 144, 134, .13);
  --warning: #f2c66d; --warning-soft: rgba(242, 198, 109, .13);
  --info: #7fd0e3; --info-soft: rgba(127, 208, 227, .12);
  --success: #7fd9a0; --success-soft: rgba(127, 217, 160, .13);
  --paypal-text: #8cc8ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, .4); --shadow-soft: 0 8px 22px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--highlight); color: #1c2430; }
a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); }
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);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 .55em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
h3 { font-size: 1.15rem; font-weight: 750; }
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: 2px dashed var(--line); margin: 24px 0; }
.hand { font-family: var(--font-hand); font-weight: 700; }

/* Floating helpers */
.bug-report-button { position: fixed; right: 20px; bottom: 20px; z-index: 35; box-shadow: 3px 3px 0 var(--pop); }
.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); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: var(--border) solid var(--ink);
}
.site-header .shell { width: min(1480px, calc(100% - 40px)); }
.header-row { min-height: 72px; display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: var(--brand);
  background: var(--panel); border: var(--border) solid var(--ink);
  transform: rotate(-4deg);
  transition: transform .2s ease;
}
.brand:hover .brand-mark { transform: rotate(3deg); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -.01em; }
.brand-text strong { font-family: var(--font-hand); font-size: 1.6rem; line-height: 1; color: var(--marker); margin-right: 1px; }
.brand-small .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.brand-small .brand-mark svg { width: 18px; height: 18px; }

.primary-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; flex-shrink: 0; }
.primary-nav a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: 8px 9px; border-radius: var(--radius-sm); white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.primary-nav a:hover { color: var(--text); background: var(--panel-2); }
.primary-nav a[aria-current="page"] {
  color: var(--brand); text-decoration: underline wavy var(--brand) 1.5px; text-underline-offset: 7px;
}
.primary-nav a.nav-support {
  color: var(--paypal-ink); border: var(--border) solid var(--paypal); background: var(--paypal);
  padding: 6px 12px; margin-left: 4px; text-decoration: none;
}
.primary-nav a.nav-support:hover { color: var(--paypal-ink); background: var(--paypal-2); border-color: var(--paypal-2); }
.primary-nav a.nav-support[aria-current="page"] { color: var(--paypal-ink); background: var(--paypal); border-color: var(--ink); }
.header-search {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  background: var(--panel); border: var(--border) solid var(--line-strong); border-radius: var(--radius-pill);
  padding: 2px 3px 2px 14px; flex: 0 1 230px; min-width: 140px; transition: border-color .15s ease;
}
.header-search:focus-within { border-color: var(--ink); }
.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); }
.header-search .icon-button { border: 0; background: transparent; }
.language-switch { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 2px; border: var(--border) solid var(--line-strong); 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: 800; text-decoration: none; }
.language-switch a:hover { color: var(--text); }
.language-switch a[aria-current="page"] { color: var(--brand-ink); background: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: var(--border) solid var(--line-strong); background: var(--panel); color: var(--muted);
  border-radius: 50%; text-decoration: none; transition: color .15s ease, border-color .15s ease;
}
.icon-button:hover { color: var(--text); border-color: var(--ink); }
.theme-icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }

/* Buttons: marker outline + offset shadow, like a magnet lifted off the board */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px; border-radius: 10px;
  border: var(--border) solid var(--ink); font-weight: 800; text-decoration: none;
  background: var(--panel); color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.button:hover { color: var(--text); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pop); }
.button:active { transform: translate(1px, 1px); box-shadow: none; }
.button-small { min-height: 36px; padding: 6px 13px; font-size: .86rem; }
.button-primary { background: var(--brand); border-color: var(--ink); color: var(--brand-ink); box-shadow: 3px 3px 0 var(--pop); }
.button-primary:hover { color: var(--brand-ink); box-shadow: 4px 4px 0 var(--pop); }
.button-paypal { background: var(--paypal); border-color: var(--ink); color: var(--paypal-ink); box-shadow: 3px 3px 0 var(--pop); }
.button-paypal:hover { color: var(--paypal-ink); background: var(--paypal-2); box-shadow: 4px 4px 0 var(--pop); }
.button-ghost { background: transparent; border-color: var(--ink); color: var(--text); }
.button-secondary { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover { border-color: var(--ink); }
.button-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.button-danger:hover { color: var(--danger); }
.button-block { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 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(--brand); color: var(--brand-ink);
  border: var(--border) solid var(--ink); font-weight: 800; font-size: .8rem;
  cursor: pointer;
}
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--panel); border: var(--border) solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--pop); padding: 8px; z-index: 50;
}
.user-menu-head { padding: 10px 12px 12px; border-bottom: 1px dashed var(--line-strong); 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; font-weight: 600;
}
.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);
  border-left: 5px solid var(--line-strong); background: var(--panel); font-size: .92rem;
}
.message-success { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); border-left-color: var(--success); background: var(--success-soft); }
.message-error, .message-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); border-left-color: var(--danger); background: var(--danger-soft); }
.message-warning { border-color: color-mix(in srgb, var(--warning) 40%, var(--line)); border-left-color: var(--warning); background: var(--warning-soft); }
.message-info { border-color: color-mix(in srgb, var(--info) 40%, var(--line)); border-left-color: var(--info); background: var(--info-soft); }

main { padding: 36px 0 72px; min-height: 60vh; }
.site-footer { border-top: var(--border) solid var(--ink); background: var(--panel-2); padding: 40px 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; font-weight: 600; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer a.brand { color: var(--text); }
.site-footer a.support-link { color: var(--paypal-text); font-weight: 700; }
.site-footer a.support-link:hover { color: var(--paypal-text); }
.footer-note { margin: 0; }

/* Hero: the tactics board */
.hero {
  position: relative; overflow: hidden;
  border: var(--border) solid var(--ink); border-radius: var(--radius-lg);
  padding: clamp(24px, 4.5vw, 56px);
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: 6px 6px 0 var(--pop);
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.hero h1 { max-width: 18ch; margin-bottom: 18px; }
.hero h1 em, .highlight {
  font-style: normal; color: var(--brand);
  background: linear-gradient(transparent 58%, var(--highlight-soft) 58%, var(--highlight-soft) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 .08em;
}
.hero-lead { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.15rem); max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-board { display: grid; gap: 14px; min-width: 0; }
.board-sketch { display: block; width: 100%; height: auto; }
.board-sketch .bs-pitch { fill: var(--pitch-bg); stroke: var(--pitch-line); stroke-width: 2; }
.board-sketch .bs-line { fill: none; stroke: var(--pitch-line); stroke-width: 1.6; }
.board-sketch .bs-spot { fill: var(--pitch-line); }
.board-sketch .bs-own { fill: var(--pitch-dot); stroke: var(--ink); stroke-width: 1.5; }
.board-sketch .bs-opp { fill: none; stroke: var(--marker); stroke-width: 2.4; stroke-linecap: round; }
.board-sketch .bs-run { fill: none; stroke: var(--marker); stroke-width: 2; stroke-dasharray: 5 5; stroke-linecap: round; }
.board-sketch .bs-pass { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; }
.board-sketch .bs-head-run { fill: var(--marker); }
.board-sketch .bs-head-pass { fill: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
  .board-sketch .bs-pass { stroke-dasharray: 160; animation: bs-draw 1.4s .3s ease-out both; }
}
@keyframes bs-draw { from { stroke-dashoffset: 160; } to { stroke-dashoffset: 0; } }
.hero-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-panel .stat {
  background: var(--panel); border: var(--border) solid var(--ink); border-radius: 12px;
  padding: 10px 14px; display: grid; gap: 0;
}
.hero-panel .stat:nth-child(odd) { transform: rotate(-.6deg); }
.hero-panel .stat:nth-child(even) { transform: rotate(.6deg); }
.hero-panel .stat strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; color: var(--brand); font-variant-numeric: tabular-nums; }
.hero-community {
  display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 18px; border-top: 2px dashed var(--line-strong);
}
.hero-community-label { font-family: var(--font-hand); font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--marker); transform: rotate(-2deg); }
.hero-community p { margin: 0; color: var(--muted); font-size: 1rem; max-width: 72ch; }
.hero-community a { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 800; text-decoration: none; }
.hero-community a:hover { color: var(--brand); text-decoration: underline; }
.hero-community a svg { opacity: .65; }
.eyebrow {
  display: inline-block; color: var(--marker);
  font-family: var(--font-hand); font-size: 1.45rem; font-weight: 700; line-height: 1.1;
  margin-bottom: 10px; transform: rotate(-2deg); transform-origin: left center;
}

/* Section headings */
.section { margin-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.section-head h2 {
  display: inline; margin: 0;
  background: linear-gradient(transparent 60%, var(--highlight-soft) 60%, var(--highlight-soft) 94%, transparent 94%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .1em;
}
.section-head > div > h2 + p { margin-top: 8px; }
.link-more { font-size: .92rem; font-weight: 800; text-decoration: none; }
.link-more:hover { text-decoration: underline wavy; text-underline-offset: 5px; }

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--panel);
  border: var(--border) solid var(--ink); border-radius: var(--radius);
  padding: 20px;
}
.card-flat { border-width: 1.5px; border-color: var(--line-strong); }
.card-flat:hover { border-color: var(--ink); }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 12px; }
.card-title { margin: 0; font-size: 1.2rem; font-weight: 800; }
.card-title a, a.card-title { color: var(--text); text-decoration: none; }
.card-title a:hover, a.card-title:hover { color: var(--brand); }
a.card-title { font-size: 1.05rem; font-weight: 800; }
.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: 2px dashed var(--line); padding-top: 14px; margin-top: 16px; }

.tactic-card { display: flex; flex-direction: column; min-height: 100%; transition: transform .2s ease, box-shadow .2s ease; }
.tactic-card:hover { transform: translate(-2px, -2px) rotate(-.3deg); box-shadow: 5px 5px 0 var(--pop); }
.tactic-card .formation-badge { margin-left: auto; }
.tactic-card .card-title { max-width: 22ch; }
.tactic-card .card-footer { margin-top: auto; }
.tactic-card .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.mini-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.mini-stat span { display: block; color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.mini-stat strong { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Pitch line: a dashed run arrow drawn in marker */
.pitch-line { position: relative; width: 64px; height: 0; border-top: 2px dashed var(--marker); margin: 2px 0 16px; }
.pitch-line::after {
  content: ""; position: absolute; right: -2px; top: -6px;
  border-left: 8px solid var(--marker); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}

/* Badges and pills */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--line-strong);
  background: var(--panel); color: var(--muted); font-size: .74rem; font-weight: 800;
  text-decoration: none; white-space: nowrap;
}
.badge-brand, .pill-brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.badge-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 50%, var(--line)); color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 50%, var(--line)); color: var(--warning); }
.badge-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); color: var(--danger); }
.badge-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 50%, var(--line)); color: var(--info); }
.formation-badge { letter-spacing: .03em; color: var(--brand); }
.step-badge {
  width: 44px; height: 44px; padding: 0; justify-content: center;
  font-family: var(--font-hand); font-size: 1.45rem; font-weight: 700;
  border: var(--border) solid var(--ink); transform: rotate(-4deg);
}
.form-pill { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 92px; }
.form-pill span { height: 22px; border-radius: 5px; 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.8rem); 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: 2px dashed 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); }
.support-cta { width: 100%; justify-content: center; margin-top: 14px; gap: 8px; }
.detail-side { min-width: 0; }
.stat-card { background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 14px 16px; }
.stat-card .label { color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.stat-card .value { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .sub { color: var(--muted); font-size: .78rem; }
.stat-good { color: var(--success); }
.stat-bad { color: var(--danger); }
.stat-brand { color: var(--brand); font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 11px 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: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
table.data tbody tr:hover { background: var(--row-hover); }
table.data tr:last-child td { border-bottom: 0; }
table.data .positive { color: var(--success); }
table.data .negative { color: var(--danger); }
.assessment-comparison table.data tr.is-best td { background: var(--success-soft); }
.assessment-comparison table.data tr.is-best:hover td { background: rgba(123, 224, 164, .2); }
.assessment-comparison table.data tr.is-worst td { background: var(--danger-soft); }
.assessment-comparison table.data tr.is-worst:hover td { background: rgba(255, 119, 119, .2); }
.assessment-comparison table.data tr.is-best .position-cell { color: var(--success); font-weight: 700; }
.assessment-comparison table.data tr.is-worst .position-cell { color: var(--danger); font-weight: 700; }
.assessment-report table.data tr.is-best td { background: var(--success-soft); }
.assessment-report table.data tr.is-best:hover td { background: rgba(123, 224, 164, .2); }
.assessment-report table.data tr.is-worst td { background: var(--danger-soft); }
.assessment-report table.data tr.is-worst:hover td { background: rgba(255, 119, 119, .2); }
.assessment-report table.data tr.is-best .position-cell { color: var(--success); font-weight: 700; }
.assessment-report table.data tr.is-worst .position-cell { color: var(--danger); font-weight: 700; }
.assessment-report table.data tr.is-neutral-high td,
.assessment-report table.data tr.is-neutral-low td { background: var(--info-soft); }
.assessment-comparison table.data tr.is-neutral-high td { background: var(--info-soft); }
.assessment-comparison table.data tr.is-neutral-low td { background: var(--info-soft); }
.assessment-list li.is-strong {
  border-left: 3px solid color-mix(in srgb, var(--success) 55%, transparent);
  background: var(--success-soft);
  padding: 6px 8px;
  border-radius: 4px;
}
.assessment-list li.is-weak {
  border-left: 3px solid color-mix(in srgb, var(--danger) 55%, transparent);
  background: var(--danger-soft);
  padding: 6px 8px;
  border-radius: 4px;
}
.assessment-list li.is-best {
  border-left: 4px solid var(--success);
  padding-left: 8px;
  background: color-mix(in srgb, var(--success) 18%, transparent);
}
.assessment-list li.is-worst {
  border-left: 4px solid var(--danger);
  padding-left: 8px;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}
.assessment-list li.is-best strong { color: var(--success); }
.assessment-list li.is-worst strong { color: var(--danger); }
.assessment-list li.is-strong strong { color: var(--success); }
.assessment-list li.is-weak strong { color: var(--danger); }
.recommendation-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.recommendation { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; padding: 10px 12px; background: var(--panel-2); }
.recommendation.priority-p1 { border-left-color: var(--warning); }
.recommendation.priority-p2 { border-left-color: var(--info); }
.recommendation.priority-p3 { border-left-color: var(--line-strong); }
.recommendation-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.recommendation-head strong { color: var(--text); }
.priority-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; padding: 1px 6px; border-radius: 4px; background: var(--panel-3); color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.recommendation.priority-p1 .priority-badge { background: var(--warning-soft); color: var(--warning); }
.recommendation.priority-p2 .priority-badge { background: var(--info-soft); color: var(--info); }
.recommendation p { margin: 4px 0 0; }
.table-note { color: var(--faint); font-size: .78rem; padding: 10px 4px 0; }
.archive-table a { color: var(--brand-2); font-weight: 700; text-decoration: none; }
.archive-table a:hover { color: var(--brand-deep); text-decoration: underline; }
.archive-table th:first-child, .archive-table td:first-child { width: 56px; }

/* 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: 28px; align-items: start; }
.detail-main { min-width: 0; }
.detail-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.tactic-header { border-bottom: 2px dashed var(--line-strong); 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; max-width: 75ch; }
.prose p:last-child { margin-bottom: 0; }
.support-copy h2 { margin: 34px 0 10px; }
.support-copy h2:first-child { margin-top: 0; }
.support-copy .assessment-list { margin-top: 10px; }
.prose blockquote { border-left: 3px solid var(--marker); 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: 2px solid var(--line); margin: 26px 0 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; margin-bottom: -2px; color: var(--muted); text-decoration: none; font-weight: 800; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--brand); 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 dashed var(--line-strong); font-size: .88rem; }
.side-item:last-child { border-bottom: 0; }
.side-item span { color: var(--muted); }

/* Principles: long-form report with a sticky table of contents */
.principles-head { max-width: 75ch; margin-bottom: 28px; }
.principles-head h1 { margin-bottom: 0; }
.principles-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.principles-toc {
  position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto;
  border: var(--border) solid var(--ink); border-radius: var(--radius); background: var(--panel); padding: 16px;
}
.principles-toc h2 { margin: 0 0 6px; font-family: var(--font-hand); font-size: 1.5rem; font-weight: 700; letter-spacing: 0; color: var(--marker); }
.principles-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.principles-toc a { display: block; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-size: .86rem; font-weight: 600; line-height: 1.35; text-decoration: none; }
.principles-toc a:hover { color: var(--text); background: var(--row-hover); }
.principles-body { max-width: 880px; min-width: 0; }
.principles-body > p:first-child {
  border: var(--border) solid var(--ink); border-radius: var(--radius); background: var(--panel);
  padding: 18px 20px; box-shadow: 5px 5px 0 var(--pop);
}
.principles-body h2 { scroll-margin-top: 96px; margin: 48px 0 14px; padding-top: 28px; border-top: 2px dashed var(--line-strong); }
.principles-body h3 { margin: 28px 0 10px; font-size: 1.12rem; }
.principles-body p, .principles-body li { overflow-wrap: anywhere; }
.principles-body ul, .principles-body ol { padding-left: 22px; }
.principles-body li + li { margin-top: 6px; }
.principles-body .markdown-table { margin: 18px 0; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.principles-body table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .85rem; }
.principles-body th, .principles-body td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; overflow-wrap: normal; }
.principles-body th { background: var(--panel-2); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.principles-body tbody tr:last-child td { border-bottom: 0; }
.principles-body tbody tr:hover { background: var(--row-hover); }
@media (max-width: 960px) {
  .principles-layout { grid-template-columns: 1fr; gap: 24px; }
  .principles-toc { position: static; max-height: none; }
}

/* 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 dashed var(--line-strong); }
.post:last-child { border-bottom: 0; }
.post-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); border: var(--border) solid var(--ink); color: var(--brand-ink); font-weight: 800; font-size: .85rem; }
.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; max-width: 75ch; }
.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; font-weight: 700; text-decoration: none; }
.post-actions a:hover, .post-actions button:hover { color: var(--text); }
.post-deleted { opacity: .55; font-style: italic; }
/* Thread opening post: the tactic itself, always first */
.post-opening { border-bottom: 2px solid var(--ink); padding-top: 4px; padding-bottom: 24px; }
.post-opening-main { min-width: 0; }
.post-opening .tactic-badges { margin-top: 4px; }
.post-opening-title { margin: 12px 0 4px; font-size: 1.4rem; }
.post-opening-title a { color: var(--text); text-decoration: none; }
.post-opening-title a:hover { color: var(--brand); text-decoration: underline; }
.post-opening-section { margin: 24px 0 12px; font-size: 1.05rem; }
.post-opening-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.reply-box { margin-top: 24px; }
.reply-box textarea { min-height: 150px; }
.forum-reply-form { display: grid; gap: 14px; }
.forum-editor { min-width: 0; border: var(--border) solid var(--ink); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.forum-editor [hidden] { display: none !important; }
.forum-editor:focus-within, .forum-editor.is-dragging { border-color: var(--brand); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.editor-tool-group { display: flex; align-items: center; gap: 1px; border-right: 1px solid var(--line); padding-right: 4px; }
.editor-tool-group:last-child { border-right: 0; padding-right: 0; }
.editor-tools-end { margin-left: auto; }
.editor-tool { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font: 700 1rem var(--font); cursor: pointer; }
.editor-tool:hover:not(:disabled), .editor-tool[aria-pressed="true"] { color: var(--brand); background: var(--brand-soft); }
.editor-tool:disabled { opacity: .3; cursor: default; }
.editor-tool:focus-visible, .editor-discard:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.editor-preview-toggle { font-size: .82rem; padding-inline: 12px; }
.forum-editor .editor-input, .editor-preview { min-height: 220px; padding: 18px 20px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: .96rem/1.7 var(--font); }
.forum-editor .editor-input:focus { outline: none; box-shadow: none; border: 0; }
.editor-input { display: block; resize: vertical; }
.editor-preview { overflow-wrap: anywhere; max-height: 650px; overflow-y: auto; }
.editor-preview > :first-child { margin-top: 0; }
.editor-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 16px; color: var(--muted); font-size: .72rem; }
.editor-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor-meta-actions { display: flex; align-items: center; gap: 14px; }
.editor-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.editor-attach-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-attach-actions svg { flex-shrink: 0; }
.editor-post-actions { display: flex; gap: 10px; margin-left: auto; }
.editor-discard { background: none; border: 0; color: var(--muted); min-height: 44px; font-size: .75rem; cursor: pointer; }
.editor-discard:hover { color: var(--danger); }
.editor-help { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: .73rem; line-height: 1.6; }
.editor-error { padding: 12px 16px; color: var(--danger); background: var(--danger-soft); font-size: .85rem; }
.editor-attachments, .editor-new-images { display: flex; gap: 12px; flex-wrap: wrap; }
.editor-attachments { margin: 0 16px; }
.editor-attachment { display: flex; flex-direction: column; gap: 5px; width: 120px; margin: 8px 0 14px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: .7rem; overflow-wrap: anywhere; }
.editor-attachment img { display: block; width: 100%; height: 70px; object-fit: cover; border-radius: 4px; }
.editor-attachment button { background: none; color: var(--danger); border: 0; min-height: 44px; cursor: pointer; font-size: .7rem; }
.editor-attachment:has(input:checked) { opacity: .45; }
.editor-attachment input { accent-color: var(--brand); }
.forum-post-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.forum-post-images a { display: block; max-width: min(100%, 280px); }
.forum-post-images img { display: block; width: auto; max-width: 100%; height: auto; max-height: 220px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.markdown-table { max-width: 100%; overflow-x: auto; margin-block: 16px; }
.markdown-table table { min-width: 280px; }
.editor-dialog { width: min(520px, calc(100% - 32px)); max-height: 80vh; padding: 20px; color: var(--text); background: var(--panel); border: var(--border) solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--pop); }
.editor-dialog::backdrop { background: rgb(0 0 0 / .6); }
.editor-dialog .field { margin-bottom: 16px; }
.editor-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.editor-dialog-head h3 { margin: 0; font-size: 1.05rem; }
.editor-emojis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.editor-emojis button { font-size: 1.5rem; }
.editor-tactic-results { display: grid; gap: 6px; min-height: 80px; max-height: 330px; overflow-y: auto; margin: 12px 0 16px; color: var(--muted); font-size: .85rem; }
.editor-tactic-option { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.editor-tactic-option:hover, .editor-tactic-option:focus-visible { border-color: var(--brand); }
.editor-tactic-option span { color: var(--muted); font-size: .75rem; }
.forum-editor.is-expanded { position: fixed; inset: 16px; z-index: 1200; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow-y: auto; }
.forum-editor.is-expanded .editor-input, .forum-editor.is-expanded .editor-preview { flex: 1; max-height: none; resize: none; }
.forum-editor-expanded { overflow: hidden; }
.forum-editor-expanded .bug-report-button { display: none; }
@media (max-width: 640px) {
  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .editor-tool-group { flex-shrink: 0; }
  .editor-tools-end { margin-left: 0; }
  .forum-editor .editor-input, .editor-preview { padding: 14px; }
  .editor-meta { font-size: .68rem; }
  .editor-attach-actions { width: 100%; }
  .editor-attach-actions .button { flex: 1; }
  .forum-editor.is-expanded { inset: 6px; }
}
.report-inline { display: inline; }

/* Forms */
.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > label, .label { font-weight: 800; font-size: .86rem; }
.field .help { color: var(--faint); font-size: .78rem; }
.field .errors { color: var(--danger); font-size: .8rem; font-weight: 700; }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; min-height: 44px;
  transition: border-color .15s ease;
}
.textarea { resize: vertical; min-height: 130px; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink); }
.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: 800; font-size: .86rem; }
.auth-card form p input {
  width: 100%; border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 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: 800; }
details summary:hover { color: var(--brand-deep); }
.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; box-shadow: 5px 5px 0 var(--pop); }
.auth-card h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.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(--marker); }
.contact-direct a { font-size: 1.2rem; font-weight: 800; color: var(--brand); text-decoration: none; }
.contact-direct a:hover { text-decoration: underline; }
.contact-form { padding: clamp(20px, 3vw, 28px); box-shadow: 5px 5px 0 var(--pop); }
.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: 1.5px solid var(--line-strong); 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: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--muted); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 8px;
  border: 1.5px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--panel); text-decoration: none; font-size: .86rem; font-weight: 800;
}
.pagination a:hover { color: var(--text); border-color: var(--ink); }
.pagination .current { color: var(--brand-ink); border-color: var(--ink); background: var(--brand); }

/* 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: var(--brand); border-radius: 6px; }
.meter { height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 8px; background: var(--brand); }
.source-note { border-left: 3px solid var(--line-strong); padding-left: 12px; color: var(--muted); font-size: .82rem; }
.notice { border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: 16px; background: var(--panel); }
.notice-warning { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); background: var(--warning-soft); }
.notice-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }
.upload-file-summary { border: 1.5px solid var(--line-strong); 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 dashed var(--line-strong); }
.waitlist-item:last-child { border-bottom: 0; }
.waitlist-item a { text-decoration: none; font-weight: 800; }
.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 28px; color: var(--marker); font-family: var(--font-hand); font-size: 1.35rem; font-weight: 700; line-height: 1.1; 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: 4px solid var(--brand); border-radius: 6px; background: var(--brand-soft); }
.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: 2px 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; max-width: 65ch; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.list-clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* Discussions list */
.forum-list { border: var(--border) solid var(--ink); 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: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.forum-topic { border-top: 1px solid var(--line); transition: background-color .15s ease; }
.forum-topic:hover { background: var(--row-hover); }
.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-comment-count strong { font-size: 1.15rem; }
.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 / ranking */
.results-page { display: grid; gap: 22px; min-width: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--brand-2); font-weight: 700; text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-deep); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { color: var(--faint); }
.results-head h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.results-head p { margin: 0; }
.results-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 2px solid var(--line); }
.results-tabs a { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; padding: 10px 16px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 800; text-decoration: none; }
.results-tabs a:hover { color: var(--text); }
.results-tabs a[aria-current="page"] { border-bottom-color: var(--brand); color: var(--brand); }
.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(--ink); }
.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: var(--border) solid var(--ink);
  border-radius: var(--radius); box-shadow: 4px 4px 0 var(--pop);
}
.results-filter-panel .form-actions { margin-top: 12px; }
.results-toolbar .button.is-active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.ranking-podium-heading h2 { margin: 0 0 4px; font-size: 1.2rem; }
.ranking-podium-heading p { margin: 0; }
.ranking-podium-places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 0; list-style: none; margin: 32px auto 0; padding: 0; max-width: 900px; border-bottom: 3px solid var(--ink); }
.ranking-podium-place { --medal: #a9b8ca; --step-height: 140px; display: flex; flex-direction: column; min-width: 0; text-align: center; }
.ranking-podium-place-1 { --medal: #e9b730; --step-height: 200px; grid-column: 2; grid-row: 1; }
.ranking-podium-place-2 { grid-column: 1; grid-row: 1; }
.ranking-podium-place-3 { --medal: #c7865a; --step-height: 100px; grid-column: 3; grid-row: 1; }
.ranking-podium-tactic { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 16px 18px; min-width: 0; }
.ranking-podium-name { text-decoration: none; display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--text); font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; max-width: 100%; }
a.ranking-podium-name:hover { color: var(--brand); text-decoration: underline; }
.ranking-podium-formation { color: var(--muted); font-size: .8rem; }
.ranking-podium-score { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.ranking-podium-score strong { font-size: 1.5rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.ranking-podium-score span { color: var(--muted); font-size: .75rem; }
.ranking-podium-step {
  display: flex; align-items: flex-start; justify-content: center; height: var(--step-height); padding-top: 18px;
  border: var(--border) solid var(--ink); border-bottom: 0; border-top: 6px solid var(--medal);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 26%, var(--panel)), var(--panel));
}
.ranking-podium-place-2 .ranking-podium-step { border-right: 0; }
.ranking-podium-place-3 .ranking-podium-step { border-left: 0; }
.ranking-podium-step span { color: var(--text); font: 700 4.4rem/1 var(--font-hand); }
@media (max-width: 600px) {
  .ranking-podium-place { --step-height: 100px; }
  .ranking-podium-place-1 { --step-height: 150px; }
  .ranking-podium-place-3 { --step-height: 70px; }
  .ranking-podium-tactic { padding: 0 5px 12px; }
  .ranking-podium-name { font-size: .85rem; }
  .ranking-podium-tactic .small, .ranking-podium-formation { font-size: .7rem; overflow-wrap: anywhere; max-width: 100%; }
  .ranking-podium-score strong { font-size: 1.2rem; }
  .ranking-podium-score span { font-size: .65rem; }
  .ranking-podium-step { padding-top: 12px; }
  .ranking-podium-step span { font-size: 2.8rem; }
}
.results-table-wrap { min-width: 0; overflow-x: auto; border: var(--border) solid var(--ink); 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: .07em; 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 td.results-formation { min-width: 164px; }
table.results-table .results-patch { text-align: left; min-width: 118px; border-left: 1px solid var(--line); }
.results-patch-engine { display: block; font-weight: 800; white-space: nowrap; }
.results-patch-build { display: block; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
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); border-right: 1px solid var(--line-strong); }
table.results-table thead .results-tactic { z-index: 2; 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(--marker);
  font: 700 1.35rem/1 var(--font-hand); font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--line-strong);
}
table.results-table thead .results-rank { z-index: 2; background: var(--panel-2); color: var(--muted); font: 800 .7rem var(--font); }
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(--brand); }
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,
table.results-table tbody tr:hover .results-tactic,
table.results-table tbody tr:hover .results-rank { background: var(--row-hover); }
table.results-table tbody tr:hover .results-tactic,
table.results-table tbody tr:hover .results-rank { background: color-mix(in srgb, var(--highlight) 14%, var(--panel)); }
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: 800; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.results-thread > a:hover { color: var(--brand-deep); text-decoration: underline; }
.formation-cell { display: flex; align-items: center; justify-content: center; gap: 8px; }
/* Mini formation board: whiteboard pitch with magnets (chalkboard in dark mode) */
.pitch-mini {
  display: block; flex: 0 0 auto;
  width: 60px; height: 81px; max-width: none; overflow: hidden; border-radius: 6px;
  background: var(--pitch-bg); border: 1.5px solid var(--pitch-line);
}
.pitch-unavailable { display: grid; place-items: center; border: 1px dashed var(--line-strong); background: var(--panel-2); color: var(--muted); }
.pitch-mini-line { fill: none; stroke: var(--pitch-line); stroke-width: .7; opacity: .75; }
.pitch-mini-goal { fill: none; stroke: var(--pitch-line); stroke-width: .6; opacity: .6; }
.pitch-mini-dot { fill: var(--pitch-dot); stroke: var(--panel); 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-date { margin-top: 2px; color: var(--faint); font-size: .72rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.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: 800; 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: .6rem; border-width: 1.5px; 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: 1519px) {
  .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; }
  .hero-board { max-width: 560px; }
  .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, .site-header .shell { width: min(var(--max), calc(100% - 32px)); }
  .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; }
  table.data th, table.data td { padding: 10px 9px; }
  .tactic-header h1 { font-size: 1.9rem; }
  .hero { padding: 22px 18px; box-shadow: 4px 4px 0 var(--pop); }
  .hero-actions .button { width: 100%; }
  .hero-panel .stat strong { font-size: 1.35rem; }
  main { padding-top: 24px; }
}
@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; }
  .tactic-card:hover, .button:hover { transform: none; }
}
@media print {
  .site-header, .site-footer, .hero-actions, .tabs, .reply-box { display: none; }
  body { background: #fff; color: #111; }
  .card, .table-wrap, .hero { border-color: #ccc; box-shadow: none; }
}
