:root {
  color-scheme: dark;
  --bg: #11111a;
  --panel: #1a1a26;
  --line: #333144;
  --text: #fbf7ef;
  --muted: #c0bbce;
  --gold: #f6cd8c;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
main, .topbar { width: min(76rem, 100% - 2rem); margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4rem; border-bottom: 1px solid var(--line); }
a { color: var(--gold); }
.wordmark { text-decoration: none; font-weight: 900; letter-spacing: .1em; }
nav { display: flex; flex-wrap: wrap; gap: .9rem; }
nav a { color: var(--text); text-decoration: none; }
.page-title { padding-block: 2.25rem 1.5rem; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.045em; line-height: 1.05; margin-bottom: .65rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; }
p, .bonuses li { color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17.5rem, .58fr); gap: 1rem; align-items: start; padding-bottom: 2rem; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(.85rem, 2vw, 1.35rem); }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; margin-bottom: .9rem; }
.board-head p, .board-foot p, .scope { font-size: .88rem; }
.board-head label { display: grid; gap: .2rem; font-size: .84rem; }
#level { width: 5rem; }
.formation { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .38rem; }
.slot { min-width: 0; min-height: 4.5rem; overflow-wrap: anywhere; border-radius: .55rem; position: relative; padding: .4rem .25rem; }
.slot.fighter { border-color: #78674d; background: #2c2631; }
.slot[aria-pressed="true"] { border-color: var(--gold); outline: 1px solid var(--gold); }
.slot-name { display: block; font-weight: 675; font-size: clamp(.67rem, 1.3vw, .88rem); line-height: 1.25; }
.slot-kind { display: block; color: var(--muted); font-size: .68rem; margin-top: .28rem; }
.connector { position: absolute; width: .34rem; height: .34rem; border-radius: 50%; }
.connector-0 { top: .13rem; left: calc(50% - .17rem); }
.connector-1 { top: calc(50% - .17rem); right: .12rem; }
.connector-2 { bottom: .13rem; left: calc(50% - .17rem); }
.connector-3 { top: calc(50% - .17rem); left: .12rem; }
.color-1 { background: #ff888b; } .color-2 { background: #8bb2ff; }
.color-3 { background: #92dead; } .color-4 { background: #f3cc76; }
.board-foot { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .85rem; }
.board-foot p { flex: 1 1 16rem; }
input, select, button { font: inherit; color: inherit; border: 1px solid var(--line); background: #151520; border-radius: .55rem; padding: .43rem .58rem; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.button { font-size: .86rem; font-weight: 700; min-height: 2.5rem; }
.primary { background: var(--gold); color: #18131a; border-color: var(--gold); }
.quiet { color: var(--muted); }
.picker { grid-column: 2; grid-row: span 2; }
.picker form, .suggestions { display: grid; gap: .42rem; margin-top: .65rem; }
.picker label { color: var(--muted); font-size: .85rem; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.suggestions { border-top: 1px solid var(--line); padding-top: .85rem; margin-top: 1rem; }
.suggestion-note { font-size: .82rem; }
.recommendations { margin: .3rem 0 0; padding-inline-start: 1.3rem; }
.recommendations li + li { margin-top: .35rem; }
.recommendations button { display: flex; justify-content: space-between; align-items: start; gap: .65rem; text-align: left; width: 100%; font-size: .83rem; }
.recommendations strong { color: var(--gold); white-space: nowrap; }
.stat-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .8rem; }
.stat-totals div { background: #14141e; padding: .45rem; border-radius: .5rem; }
dt { color: var(--muted); font-size: .76rem; }
dd { margin: 0; font-weight: 740; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .48rem .4rem; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
.bonuses { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-block: 1rem; }
.bonuses ul { padding-inline-start: 1.15rem; margin: .3rem 0 0; font-size: .86rem; }
.scope { border-top: 1px solid var(--line); padding-top: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 48rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .picker { grid-column: auto; grid-row: auto; }
  .slot { min-height: 4.35rem; }
}
