/* Dark-only, function over form: one small sheet, no framework, no webfonts, no animation. */
:root {
    --bg: #101318;
    --panel: #181d24;
    --panel2: #1f2630;
    --line: #2a323d;
    --text: #d7dde4;
    --muted: #8b95a1;
    --accent: #62c47f;
    --accent2: #d9a94a;
    --bad: #d06a5f;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* sticky footer: short pages pin the footer to the viewport bottom instead of hugging the content */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* width:100% matters: main/footer are flex items whose auto margins would otherwise cancel stretch (shrink-wrap) */
/* 1440: the simulator's player-state row needs >=1408 to stay on one line */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header { border-bottom: 1px solid var(--line); background: var(--panel); }
header nav { display: flex; gap: 18px; align-items: center; height: 52px; }
header nav a { color: var(--text); }
header nav a:hover { color: var(--accent); text-decoration: none; }
.brand { font-weight: 700; font-size: 17px; margin-right: 12px; }
.brand span { color: var(--accent); }

main { flex: 1; padding: 36px 16px 48px; }
footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 14px 16px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
footer a { color: var(--muted); }

h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p, li { color: var(--text); max-width: 75ch; }
.muted { color: var(--muted); }
small, .small { font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 16px; }
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card h3 { margin: 0; font-size: 16px; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: var(--panel2);
    border: 1px solid var(--line);
    color: var(--muted);
    white-space: nowrap;
}
.badge.mode { color: var(--accent); border-color: var(--accent); }
.badge.off { color: var(--bad); border-color: var(--bad); }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #0c1210;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: 0;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }

code[title] { text-decoration: underline dotted var(--muted); cursor: help; }
code, kbd, .connect {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 6px;
}
.connect { display: inline-block; padding: 5px 10px; user-select: all; }

table { border-collapse: collapse; width: 100%; margin: 10px 0 20px; }
.tablewrap { overflow-x: auto; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.notice {
    background: var(--panel);
    border: 1px solid var(--accent2);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    margin: 12px 0;
}
.notice.err { border-color: var(--bad); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

/* ---- theory curves (small multiples; recessive grid, 2px series, shared crosshair) ---- */
figure { margin: 16px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
svg.panel { display: block; width: 100%; height: auto; touch-action: none; }
.panel .grid { stroke: var(--line); stroke-width: 1; }
.panel .grid.one { stroke-dasharray: 4 4; stroke: var(--muted); opacity: 0.6; }
.panel .series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.panel .cross { stroke: var(--text); stroke-width: 1; opacity: 0.45; }
.panel .ptitle { fill: var(--text); font-size: 12px; font-weight: 600; }
.panel .tick { fill: var(--muted); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.panel .tick.mid { text-anchor: middle; }
.readout { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-bottom: 10px; font-variant-numeric: tabular-nums; }
.readout input[type="range"] { width: 220px; accent-color: var(--accent); vertical-align: middle; }
.readout .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
figcaption { text-align: center; padding-top: 6px; }
.panel .simt { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 3; }

/* ---- simulator ---- */
.sim input[type="number"] {
    width: 78px;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    padding: 3px 6px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sim input[type="checkbox"] { accent-color: var(--accent); }
.sim fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    margin: 0 0 16px;
    padding: 10px 14px 14px;
}
.sim legend { color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 6px; }
.sim .fields { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.sim .fields label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.simout {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    align-items: baseline;
    background: var(--panel);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 16px;
    font-variant-numeric: tabular-nums;
}
.simout b { font-size: 18px; }
.simout .lbl { color: var(--muted); font-size: 12px; display: block; }
.sim td input[type="number"] { width: 64px; }
.sim .modified { outline: 1px solid var(--accent2); }

/* handicap knobs: semantic groups as a grid of boxes; inside each, label|input rows */
.kgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.kgroup { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 10px; }
.kgroup h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kgroup label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; font-size: 14px; }
