:root {
  --roster-paper: #e7dfcf;
  --roster-paper-light: #f4f0e7;
  --roster-ink: #171713;
  --roster-ink-soft: #2a2822;
  --roster-blood: #84251c;
  --roster-blood-live: #b33a2d;
  --roster-line: rgba(23, 23, 19, .19);
  --roster-muted: rgba(23, 23, 19, .61);
  --roster-label: "Arial Narrow", Arial, sans-serif;
}

::selection { color: var(--roster-paper-light); background: var(--roster-blood); }

.roster-body {
  min-width: 320px;
  color: var(--roster-ink);
  background: var(--roster-paper);
}

.roster-main {
  min-height: 100dvh;
  padding-top: var(--header-height);
}

.roster-app { min-height: calc(100dvh - var(--header-height)); }
.roster-app button, .roster-app input, .roster-app select { font: inherit; }
.roster-app button { cursor: pointer; }
.roster-app button:disabled { cursor: not-allowed; opacity: .42; }
.roster-app :focus-visible { outline: 3px solid var(--roster-blood-live); outline-offset: 3px; }

.builder-head {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(410px, 1fr);
  gap: 32px;
  align-items: end;
  padding: 38px clamp(18px, 3vw, 46px) 28px;
  color: var(--roster-paper-light);
  background: var(--roster-ink);
  border-bottom: 1px solid rgba(244, 240, 231, .2);
}

.builder-title-row { display: flex; gap: 18px; align-items: end; }
.builder-title-copy { min-width: 0; flex: 1; }
.builder-title-copy label,
.field-label,
.panel-heading,
.summary-cell span,
.fighter-count,
.unit-meta,
.status-label,
.game-label,
.equipment-option span,
.play-stat dt {
  font-family: var(--roster-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.builder-title-copy label { display: block; margin-bottom: 7px; color: rgba(244, 240, 231, .5); }
.warband-name {
  width: 100%;
  padding: 0 0 5px;
  color: var(--roster-paper-light);
  font-family: var(--display);
  font-size: clamp(36px, 4vw, 58px);
  line-height: .92;
  letter-spacing: -.025em;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(244, 240, 231, .25);
}
.warband-name::placeholder { color: rgba(244, 240, 231, .35); }

.prototype-stamp {
  flex: none;
  margin-bottom: 8px;
  padding: 7px 9px;
  color: #e5a89f;
  font-family: var(--roster-label);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid rgba(229, 168, 159, .42);
}

.builder-head-meta { margin: 14px 0 0; max-width: 68ch; color: rgba(244, 240, 231, .57); font-size: 13px; line-height: 1.5; }
.builder-head-meta strong { color: rgba(244, 240, 231, .9); font-weight: 400; }

.builder-summary { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)) auto; gap: 1px; background: rgba(244, 240, 231, .2); border: 1px solid rgba(244, 240, 231, .2); }
.summary-cell { min-height: 74px; padding: 12px 14px; background: var(--roster-ink); }
.summary-cell span { display: block; color: rgba(244, 240, 231, .46); }
.summary-cell strong { display: block; margin-top: 7px; color: var(--roster-paper-light); font-family: var(--display); font-size: 29px; font-weight: 400; line-height: 1; }
.summary-cell:nth-child(3) strong { font-size: 20px; line-height: .96; }
.summary-cell strong small { color: rgba(244, 240, 231, .44); font-family: var(--roster-label); font-size: 10px; }

.start-game {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  min-width: 146px;
  min-height: 74px;
  padding: 0 18px;
  color: var(--roster-paper-light);
  font-family: var(--roster-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .065em;
  text-transform: uppercase;
  background: var(--roster-blood);
  border: 0;
  transition: background-color 160ms ease, transform 140ms cubic-bezier(.23, 1, .32, 1);
}
.start-game svg { width: 19px; height: 19px; fill: currentColor; }
.start-game:active { transform: scale(.98); }

.builder-commandbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: stretch;
  padding: 0 clamp(18px, 3vw, 46px);
  background: var(--roster-paper-light);
  border-bottom: 1px solid var(--roster-line);
}
.command-button,
.sandbox-toggle {
  min-height: 44px;
  padding: 0 15px;
  color: var(--roster-ink);
  font-family: var(--roster-label);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .065em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--roster-line);
}
.command-button:first-child { border-left: 1px solid var(--roster-line); }
.command-button:hover { color: var(--roster-blood); background: rgba(132, 37, 28, .055); }
.command-button.danger { margin-left: auto; color: var(--roster-muted); border-left: 1px solid var(--roster-line); }

.sandbox-toggle { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }
.sandbox-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.toggle-track { position: relative; width: 31px; height: 16px; flex: none; background: rgba(23, 23, 19, .16); border: 1px solid rgba(23, 23, 19, .27); }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: var(--roster-ink); transition: transform 180ms cubic-bezier(.23, 1, .32, 1), background-color 180ms ease; }
.sandbox-toggle input:checked + .toggle-track::after,
.sandbox-mini input:checked + .toggle-track::after { background: var(--roster-blood-live); transform: translateX(15px); }
.sandbox-toggle input:focus-visible + .toggle-track,
.sandbox-mini input:focus-visible + .toggle-track { outline: 3px solid var(--roster-blood-live); outline-offset: 3px; }

.sandbox-banner {
  display: none;
  padding: 10px clamp(18px, 3vw, 46px);
  color: var(--roster-paper-light);
  font-size: 12px;
  line-height: 1.45;
  background: var(--roster-blood);
}
.roster-app[data-sandbox="true"] .sandbox-banner { display: block; }
.sandbox-banner strong { font-family: var(--roster-label); letter-spacing: .06em; text-transform: uppercase; }

.builder-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(360px, 1fr) minmax(300px, 390px);
  min-height: 720px;
  background: var(--roster-line);
  gap: 1px;
}

.builder-panel { min-width: 0; background: var(--roster-paper); }
.recruit-panel, .detail-panel { background: var(--roster-paper-light); }
.panel-top { display: flex; gap: 18px; align-items: end; justify-content: space-between; min-height: 68px; padding: 16px 18px; border-bottom: 1px solid var(--roster-line); }
.panel-heading { margin: 0; color: var(--roster-muted); }
.panel-top p { margin: 5px 0 0; color: var(--roster-muted); font-size: 12px; line-height: 1.35; }
.fighter-count { flex: none; color: var(--roster-blood); }

.unit-catalogue { padding-bottom: 28px; }
.catalogue-group-title { margin: 0; padding: 14px 18px 8px; color: var(--roster-blood); font-family: var(--roster-label); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--roster-line); }
.catalogue-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  width: 100%;
  min-height: 82px;
  padding: 14px 14px 13px 18px;
  color: var(--roster-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--roster-line);
  transition: background-color 150ms ease;
}
.catalogue-unit:hover { background: rgba(132, 37, 28, .06); }
.catalogue-unit.is-at-limit:not(:disabled) { color: var(--roster-muted); }
.catalogue-unit-name { min-width: 0; font-family: var(--display); font-size: 22px; line-height: 1; }
.catalogue-unit-count { align-self: start; color: var(--roster-blood); font-family: var(--roster-label); font-size: 10px; font-weight: 700; }
.catalogue-unit p { grid-column: 1 / -1; margin: 0; color: var(--roster-muted); font-size: 11px; line-height: 1.4; }

.roster-panel { background-color: var(--roster-paper); background-image: linear-gradient(rgba(231, 223, 207, .91), rgba(231, 223, 207, .95)), url("assets/parchment-aged.webp"); background-size: cover; }
.roster-status { padding: 12px 18px 0; }
.validation-list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--roster-line); border: 1px solid var(--roster-line); }
.validation-list:empty { display: none; }
.validation-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 11px; color: var(--roster-muted); font-size: 11px; line-height: 1.4; background: rgba(244, 240, 231, .8); }
.validation-mark { width: 8px; height: 8px; margin-top: 3px; background: #98773f; }
.validation-item[data-level="error"] .validation-mark { background: var(--roster-blood-live); }
.validation-item[data-level="ok"] .validation-mark { background: #52684d; }

.roster-list { display: grid; gap: 8px; padding: 14px 18px 46px; }
.roster-empty { min-height: 380px; display: grid; place-items: center; padding: 44px; text-align: center; border: 1px dashed rgba(23, 23, 19, .28); }
.roster-empty svg { width: 58px; height: 58px; margin-bottom: 20px; fill: none; stroke: var(--roster-blood); stroke-width: 1.4; }
.roster-empty h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 4vw, 50px); font-weight: 400; line-height: .94; }
.roster-empty p { max-width: 36ch; margin: 14px auto 0; color: var(--roster-muted); font-size: 13px; line-height: 1.5; }

.roster-fighter {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 8px 12px 8px 8px;
  color: var(--roster-ink);
  text-align: left;
  background: rgba(244, 240, 231, .82);
  border: 1px solid var(--roster-line);
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms cubic-bezier(.23, 1, .32, 1);
}
.roster-fighter:hover { background: var(--roster-paper-light); border-color: rgba(132, 37, 28, .4); }
.roster-fighter:active { transform: scale(.995); }
.roster-fighter.is-selected { background: var(--roster-paper-light); border-color: var(--roster-blood); }
.fighter-thumb { width: 58px; height: 58px; overflow: hidden; background: var(--roster-ink-soft); }
.fighter-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: var(--image-position, center); filter: grayscale(.45) saturate(.7) contrast(1.08); }
.fighter-main { min-width: 0; }
.fighter-main strong { display: block; overflow: hidden; font-family: var(--display); font-size: 24px; font-weight: 400; line-height: 1.03; text-overflow: ellipsis; white-space: nowrap; }
.unit-meta { display: block; margin-top: 6px; color: var(--roster-muted); font-size: 11px; }
.fighter-equipment { display: block; margin-top: 4px; overflow: hidden; color: var(--roster-muted); font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.fighter-vitals { display: grid; grid-template-columns: repeat(2, auto); gap: 5px 10px; align-items: center; color: var(--roster-muted); font-family: var(--roster-label); font-size: 9px; text-align: right; text-transform: uppercase; }
.fighter-vitals strong { color: var(--roster-ink); font-family: var(--display); font-size: 18px; font-weight: 400; }

.detail-empty { display: grid; min-height: 540px; place-items: center; padding: 34px; color: var(--roster-muted); text-align: center; }
.detail-empty p { max-width: 29ch; margin: 0; font-size: 13px; line-height: 1.5; }
.fighter-editor { padding-bottom: 38px; }
.editor-portrait { position: relative; height: 142px; overflow: hidden; color: var(--roster-paper-light); background: var(--roster-ink); }
.editor-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: var(--image-position, center); filter: grayscale(.42) saturate(.66) contrast(1.08); opacity: .63; }
.editor-portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 23, 19, .06), rgba(23, 23, 19, .88)); }
.editor-portrait-copy { position: absolute; z-index: 1; inset: auto 18px 15px; }
.editor-portrait-copy span { display: block; color: rgba(244, 240, 231, .58); font-family: var(--roster-label); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.editor-portrait-copy strong { display: block; margin-top: 3px; font-family: var(--display); font-size: 30px; font-weight: 400; line-height: .94; }

.editor-form { padding: 18px; }
.editor-field { display: grid; gap: 7px; margin-bottom: 22px; }
.field-label { color: var(--roster-muted); }
.editor-field input[type="text"] { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--roster-ink); background: rgba(255, 255, 255, .28); border: 1px solid var(--roster-line); }
.editor-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 24px; background: var(--roster-line); border: 1px solid var(--roster-line); }
.editor-facts div { min-width: 0; padding: 9px 7px; text-align: center; background: var(--roster-paper-light); }
.editor-facts dt { color: var(--roster-muted); font-family: var(--roster-label); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.editor-facts dd { margin: 4px 0 0; font-family: var(--display); font-size: 20px; }
.fighter-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin: -14px 0 24px; }
.fighter-keywords span { padding: 5px 7px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; background: var(--roster-ink-soft); }

.equipment-list { display: grid; gap: 1px; margin-top: 8px; background: var(--roster-line); border: 1px solid var(--roster-line); }
.equipment-option { position: relative; display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 42px; padding: 8px 10px; background: var(--roster-paper-light); cursor: pointer; }
.equipment-option input { width: 15px; height: 15px; accent-color: var(--roster-blood); }
.equipment-option span { color: var(--roster-ink); font-size: 11px; letter-spacing: .035em; }
.equipment-option small { display: block; margin-top: 3px; color: var(--roster-muted); font-size: 11px; line-height: 1.32; }
.equipment-option.is-disabled { cursor: not-allowed; opacity: .46; }
.editor-note { margin: 18px 0; padding-top: 13px; color: var(--roster-muted); font-size: 11px; line-height: 1.5; border-top: 1px solid var(--roster-line); }
.editor-note strong { color: var(--roster-blood); font-family: var(--roster-label); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--roster-line); border: 1px solid var(--roster-line); }
.editor-actions button { min-height: 40px; padding: 0 10px; color: var(--roster-ink); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--roster-paper-light); border: 0; }
.editor-actions button:hover { color: var(--roster-blood); }
.editor-actions .remove-fighter { color: var(--roster-blood); }

.game-view { display: none; min-height: calc(100dvh - var(--header-height)); color: var(--roster-paper-light); background: #11100d; }
.roster-app[data-mode="game"] .builder-view { display: none; }
.roster-app[data-mode="game"] .game-view { display: block; }

.game-head {
  position: sticky;
  z-index: 12;
  top: var(--header-height);
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 9px clamp(12px, 2.4vw, 34px);
  background: #171713;
  border-bottom: 1px solid rgba(244, 240, 231, .18);
}
.game-title { min-width: 0; }
.game-title .game-label { display: block; margin-top: 4px; color: rgba(244, 240, 231, .5); font-size: 9px; }
.game-title strong { display: block; overflow: hidden; font-family: var(--display); font-size: 28px; font-weight: 400; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.game-round { display: flex; gap: 16px; align-items: center; }
.round-value { font-family: var(--display); font-size: 30px; }
.round-progress { color: rgba(244, 240, 231, .56); font-family: var(--roster-label); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.game-head-actions { display: flex; gap: 1px; }
.game-head-actions button { min-height: 42px; padding: 0 13px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: transparent; border: 1px solid rgba(244, 240, 231, .22); }
.game-head-actions button:hover { background: rgba(244, 240, 231, .08); }
.game-head-actions .next-round { color: #fff; background: var(--roster-blood); border-color: var(--roster-blood); }

.game-shell { display: grid; grid-template-columns: minmax(210px, 280px) minmax(0, 1fr); min-height: calc(100dvh - var(--header-height) - 68px); }
.fighter-switcher { padding: 16px 12px 44px; background: #181713; border-right: 1px solid rgba(244, 240, 231, .16); }
.fighter-switcher-title { margin: 0 8px 12px; color: rgba(244, 240, 231, .45); font-family: var(--roster-label); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.fighter-switch-list { display: grid; gap: 5px; }
.fighter-switch {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 53px;
  padding: 6px 8px;
  color: var(--roster-paper-light);
  text-align: left;
  background: transparent;
  border: 1px solid rgba(244, 240, 231, .13);
}
.fighter-switch::after { content: ""; position: absolute; inset: auto 7px 4px; height: 1px; background: #c14a3c; transform: scaleX(0); transform-origin: left; transition: transform 320ms cubic-bezier(.23, 1, .32, 1); }
.fighter-switch.is-activated::after { transform: scaleX(1); }
.fighter-switch:hover { background: rgba(244, 240, 231, .05); }
.fighter-switch.is-selected { background: rgba(132, 37, 28, .23); border-color: #ad4438; }
.fighter-switch.is-activated { opacity: .5; }
.fighter-switch img { width: 38px; height: 38px; object-fit: cover; object-position: var(--image-position, center); filter: grayscale(.55) saturate(.65); }
.fighter-switch strong { display: block; overflow: hidden; font-family: var(--display); font-size: 16px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.fighter-switch small { display: block; margin-top: 2px; color: rgba(244, 240, 231, .5); font-family: var(--roster-label); font-size: 7px; letter-spacing: .05em; text-transform: uppercase; }
.fighter-switch-hp { color: #e47b6d; font-family: var(--display); font-size: 17px; }

.game-stage { min-width: 0; padding: clamp(14px, 3vw, 34px); background: #11100d; }
.play-card { width: min(1050px, 100%); margin: 0 auto; overflow: hidden; color: #211e18; background-color: #e9e5dc; background-image: linear-gradient(rgba(244, 242, 236, .92), rgba(224, 220, 211, .95)), url("assets/parchment-aged.webp"); background-size: cover; border: 1px solid #403c35; box-shadow: 0 18px 54px rgba(0, 0, 0, .42); }
.play-card[data-activated="true"] { filter: saturate(.62); }
.play-card[data-wounded="true"] { border-color: #a74336; box-shadow: 0 18px 54px rgba(0, 0, 0, .42), 0 8px 24px rgba(132, 37, 28, .22); }

.play-card-head { display: grid; grid-template-columns: minmax(220px, 1fr) 144px repeat(4, 84px); min-height: 98px; color: var(--roster-paper-light); background: #211f1c; border-bottom: 2px solid var(--roster-blood-live); }
.play-name { display: flex; min-width: 0; flex-direction: column; justify-content: end; padding: 13px 17px; }
.play-name h1 { margin: 0; overflow: hidden; font-family: var(--display); font-size: clamp(34px, 4vw, 50px); font-weight: 400; line-height: .84; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.play-name span { margin-top: 6px; color: rgba(244, 240, 231, .52); font-family: var(--roster-label); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.play-model { position: relative; margin: 0; overflow: hidden; border-left: 1px solid rgba(244, 240, 231, .16); }
.play-model img { width: 100%; height: 100%; object-fit: cover; object-position: var(--image-position, center); filter: grayscale(.4) saturate(.65) contrast(1.08); }
.play-model::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(33, 31, 28, .3), transparent 50%); }
.play-stats { display: contents; margin: 0; }
.play-stat { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; border-left: 1px solid rgba(244, 240, 231, .2); }
.play-stat dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.play-stat dd { display: flex; gap: 5px; align-items: baseline; margin: 0; font-family: var(--display); font-size: 27px; }
.play-stat sup { color: #de6454; font-family: var(--roster-label); font-size: 11px; }
.stat-icon { width: 15px; height: 15px; color: #df5846; }
.stat-icon svg { display: block; width: 100%; height: 100%; fill: currentColor; stroke: currentColor; stroke-width: 1.6; }
.play-keyword-strip { display: flex; flex-wrap: wrap; gap: 7px 14px; align-items: center; min-height: 34px; padding: 6px 13px; color: rgba(244, 240, 231, .75); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #292620; border-bottom: 1px solid rgba(244, 240, 231, .16); }
.play-keyword-strip > strong { color: #e46c5d; }
.play-keyword-strip .play-keywords { display: flex; flex-wrap: wrap; gap: 7px 14px; }

.weapon-table { padding: 7px 13px 8px; border-bottom: 1px solid rgba(33, 30, 24, .35); }
.weapon-head, .weapon-row { display: grid; grid-template-columns: 29px minmax(150px, 1fr) 56px 48px 48px minmax(100px, .8fr); gap: 7px; align-items: center; }
.weapon-head { min-height: 21px; color: rgba(33, 30, 24, .55); font-family: var(--roster-label); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--roster-blood-live); }
.weapon-head span:not(:first-child), .weapon-row > span:not(.weapon-kind) { text-align: center; }
.weapon-row { min-height: 35px; border-bottom: 1px solid rgba(33, 30, 24, .19); }
.weapon-row:last-child { border-bottom: 0; }
.weapon-row strong { overflow: hidden; font-family: var(--roster-label); font-size: 11px; letter-spacing: .015em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.weapon-row > span:not(.weapon-kind) { font-family: var(--display); font-size: 18px; }
.weapon-row small { color: rgba(33, 30, 24, .58); font-size: 9px; text-align: center; }
.weapon-kind { display: grid; width: 25px; height: 25px; place-items: center; color: var(--roster-blood); }
.weapon-kind svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.play-card-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 1px; background: rgba(33, 30, 24, .22); }
.play-information { min-width: 0; padding: 12px 13px; background: rgba(239, 235, 226, .82); }
.play-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.play-info-grid article { padding-top: 7px; border-top: 1px solid rgba(33, 30, 24, .25); }
.play-info-grid h2 { margin: 0 0 3px; color: var(--roster-blood); font-family: var(--roster-label); font-size: 9px; letter-spacing: .035em; text-transform: uppercase; }
.play-info-grid p { margin: 0; color: rgba(33, 30, 24, .75); font-size: 9px; line-height: 1.38; }
.play-rule-list { display: contents; }
.play-rule-list article strong { display: block; margin-bottom: 3px; color: var(--roster-blood); font-family: var(--roster-label); font-size: 9px; letter-spacing: .035em; text-transform: uppercase; }
.effect-list { display: flex; flex-wrap: wrap; gap: 5px; min-height: 23px; margin-top: 11px; padding-top: 9px; border-top: 1px solid rgba(33, 30, 24, .25); }
.effect-chip { display: inline-flex; gap: 6px; align-items: center; min-height: 22px; padding: 3px 6px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--roster-blood); }
.effect-chip button { padding: 0; color: inherit; background: none; border: 0; }
.effect-chip button { min-width: 18px; min-height: 18px; }
.effect-chip.effect-auto { color: #fff4e6; background: #a43629; }
.effect-chip.effect-auto small { color: rgba(255, 244, 230, .66); font-size: 7px; letter-spacing: .035em; }
.effect-form { display: grid; grid-template-columns: 1fr auto; margin-top: 7px; }
.effect-form select { min-width: 0; height: 34px; padding: 4px 30px 4px 8px; color: var(--roster-ink); background: rgba(255, 255, 255, .44); border: 1px solid rgba(33, 30, 24, .25); }
.effect-form button { padding: 0 9px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--roster-ink-soft); border: 0; }

.play-controls { padding: 12px; color: var(--roster-paper-light); background: #282521; }
.vital-control { display: grid; grid-template-columns: 34px 1fr 34px; gap: 1px; margin-bottom: 8px; background: rgba(244, 240, 231, .15); }
.vital-control button { min-height: 36px; color: var(--roster-paper-light); background: rgba(244, 240, 231, .05); border: 0; }
.vital-control button:hover { background: rgba(244, 240, 231, .12); }
.vital-readout { display: grid; place-items: center; background: #201e1a; }
.vital-readout span { color: rgba(244, 240, 231, .48); font-family: var(--roster-label); font-size: 7px; letter-spacing: .06em; text-transform: uppercase; }
.vital-readout strong { font-family: var(--display); font-size: 21px; font-weight: 400; }
.hp-track { height: 3px; margin-bottom: 11px; background: rgba(244, 240, 231, .13); }
.hp-track span { display: block; height: 100%; background: var(--roster-blood-live); }
.activation-button { grid-column: 1 / -1; color: #fff !important; background: var(--roster-blood) !important; }
.apl-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(244, 240, 231, .15); }
.apl-controls button { min-height: 42px; padding: 6px 8px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 9px; font-weight: 700; line-height: 1.2; letter-spacing: .035em; text-transform: uppercase; background: #201e1a; border: 0; }
.apl-controls button:hover { background: #37332d; }
.apl-controls .activation-button { grid-column: 1 / -1; }
.play-log { min-height: 34px; margin: 8px 0 0; color: rgba(244, 240, 231, .57); font-size: 9px; line-height: 1.42; }

.play-card-foot { display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 39px; padding: 7px 13px; color: var(--roster-paper-light); background: #211f1c; border-top: 1px solid var(--roster-blood-live); }
.play-keywords { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--roster-label); font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.play-keywords strong { color: #e46c5d; }
.play-keywords span { color: rgba(244, 240, 231, .75); }
.play-base { flex: none; font-family: var(--roster-label); font-size: 10px; font-weight: 700; }
.play-base span { color: #e46c5d; font-family: var(--display); font-size: 17px; }

.roster-footer { padding: 18px clamp(18px, 3vw, 46px); color: var(--roster-muted); background: var(--roster-paper-light); border-top: 1px solid var(--roster-line); }
.roster-footer p { margin: 0; font-size: 11px; line-height: 1.5; }
.roster-footer a { color: var(--roster-blood); text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .start-game:hover { background: #a53226; }
}

@media (max-width: 1180px) {
  .builder-workspace { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
  .detail-empty { min-height: 160px; }
  .fighter-editor { display: grid; grid-template-columns: 280px minmax(0, 1fr); padding: 18px; gap: 18px; }
  .editor-portrait { height: 100%; min-height: 250px; }
  .editor-form { padding: 0; }
}

@media (max-width: 900px) {
  .builder-head { grid-template-columns: 1fr; gap: 24px; }
  .builder-summary { grid-template-columns: repeat(3, 1fr) auto; }
  .game-shell { grid-template-columns: 1fr; }
  .fighter-switcher { position: sticky; z-index: 10; top: calc(var(--header-height) + 68px); padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(244, 240, 231, .16); }
  .fighter-switcher-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fighter-switch-list { display: flex; width: max-content; }
  .fighter-switch { width: 190px; flex: none; }
}

@media (max-width: 760px) {
  body:has(.roster-app[data-mode="game"]) .site-header { display: none; }
  body:has(.roster-app[data-mode="game"]) .roster-main { padding-top: 0; }
  .builder-head { padding: 26px 15px 20px; }
  .builder-title-row { align-items: start; }
  .prototype-stamp { margin-top: 2px; }
  .warband-name { font-size: clamp(32px, 10vw, 44px); }
  .builder-summary { grid-template-columns: repeat(3, 1fr); }
  .summary-cell { min-height: 61px; padding: 10px; }
  .summary-cell strong { font-size: 24px; }
  .start-game { grid-column: 1 / -1; min-height: 54px; }
  .builder-commandbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; overflow: visible; }
  .command-button, .sandbox-toggle { width: 100%; min-width: 0; border-right: 1px solid var(--roster-line); border-bottom: 1px solid var(--roster-line); }
  .command-button:first-child { border-left: 0; }
  .command-button.danger { grid-column: 1 / -1; margin-left: 0; border-left: 0; }
  .command-button[data-save-status] { grid-column: 1 / -1; min-height: 34px; color: var(--roster-muted); }
  .sandbox-banner { padding-inline: 15px; }
  .builder-workspace { display: block; }
  .recruit-panel, .roster-panel, .detail-panel { border-bottom: 1px solid var(--roster-line); }
  .unit-catalogue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0; }
  .catalogue-group-title { grid-column: 1 / -1; }
  .catalogue-unit { min-height: 94px; padding: 12px; border-right: 1px solid var(--roster-line); }
  .roster-list { padding-inline: 12px; }
  .roster-status { padding-inline: 12px; }
  .detail-empty { min-height: 150px; }
  .fighter-editor { display: block; padding: 0 0 24px; }
  .editor-portrait { min-height: 138px; height: 138px; }
  .editor-form { padding: 16px 15px 0; }
  .game-head { grid-template-columns: minmax(0, 1fr) auto; top: 0; min-height: 54px; padding: 6px 10px; }
  .game-title strong { font-size: 24px; }
  .game-title .game-label, .game-label { font-size: 10px; }
  .game-round { gap: 7px; }
  .round-progress { display: none; }
  .game-head-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .game-head-actions button { min-height: 31px; }
  .fighter-switcher { top: 86px; padding-block: 6px; }
  .fighter-switch small { font-size: 9px; }
  .game-stage { padding: 10px 6px 24px; }
  .play-card-head { grid-template-columns: minmax(0, 1fr) 92px; min-height: 0; }
  .play-name { min-height: 76px; padding: 10px 11px; }
  .play-name h1 { font-size: clamp(28px, 8vw, 34px); }
  .play-name span { font-size: 9px; }
  .play-model { min-height: 76px; }
  .play-stats { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .play-stat { min-height: 49px; border-top: 1px solid rgba(244, 240, 231, .2); }
  .play-stat:first-child { border-left: 0; }
  .play-stat dd { font-size: 22px; }
  .play-keyword-strip { padding-inline: 9px; font-size: 8.5px; }
  .weapon-table { padding-inline: 7px; }
  .weapon-head, .weapon-row { grid-template-columns: 25px minmax(102px, 1fr) 38px 34px 34px; gap: 3px; }
  .weapon-head > :last-child, .weapon-row > :last-child { display: none; }
  .weapon-head { font-size: 9px; }
  .weapon-row strong { font-size: 10px; }
  .weapon-row > span:not(.weapon-kind) { font-size: 16px; }
  .play-card-body { grid-template-columns: 1fr; }
  .play-information { padding: 10px; }
  .play-info-grid { gap: 8px 10px; }
  .play-info-grid h2 { font-size: 10px; }
  .play-info-grid p { font-size: 10px; line-height: 1.35; }
  .play-controls { padding: 9px; }
  .apl-controls button { min-height: 44px; font-size: 10px; letter-spacing: .02em; }
  .effect-chip { font-size: 9px; }
  .effect-form button, .play-log { font-size: 10px; }
  .play-card-foot { align-items: end; padding: 7px 9px; }
  .play-keywords { gap: 3px 8px; font-size: 8.5px; }
}

@media (max-width: 430px) {
  .prototype-stamp { display: none; }
  .builder-head-meta { font-size: 11px; }
  .summary-cell span { font-size: 8px; }
  .summary-cell strong { font-size: 22px; }
  .unit-catalogue { grid-template-columns: 1fr; }
  .catalogue-unit { min-height: 76px; border-right: 0; }
  .roster-fighter { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 9px; }
  .fighter-thumb { width: 48px; height: 48px; }
  .fighter-main strong { font-size: 21px; }
  .fighter-vitals { grid-template-columns: auto; gap: 2px; }
  .fighter-vitals span:first-child, .fighter-vitals span:nth-child(3) { display: none; }
  .editor-facts dd { font-size: 18px; }
  .fighter-switch { width: 168px; }
  .play-info-grid article:nth-child(4) { display: block; grid-column: 1 / -1; }
}

/* Entry flow and hierarchical roster */
.roster-entry { display: none; min-height: calc(100dvh - var(--header-height)); color: var(--roster-paper-light); background: #141411; }
.roster-app[data-mode="entry"] .roster-entry { display: block; }
.roster-app[data-mode="entry"] .builder-view,
.roster-app[data-mode="entry"] .game-view { display: none; }
.entry-shell {
  position: relative;
  display: grid;
  min-height: calc(100dvh - var(--header-height));
  align-content: center;
  padding: clamp(38px, 7vw, 96px) clamp(18px, 6vw, 88px);
  overflow: hidden;
  background-image: linear-gradient(90deg, rgba(20, 20, 17, .98) 0%, rgba(20, 20, 17, .9) 56%, rgba(20, 20, 17, .5) 100%), url("assets/pilgrims.png");
  background-position: center, 78% 45%;
  background-size: cover;
}
.entry-shell::after { content: ""; position: absolute; inset: 18px; pointer-events: none; border: 1px solid rgba(244, 240, 231, .16); }
.entry-shell > * { position: relative; z-index: 1; }
.entry-heading { max-width: 760px; }
.entry-heading h1 { max-width: 13ch; margin: 0; font-family: var(--display); font-size: clamp(50px, 7vw, 104px); font-weight: 400; line-height: .86; letter-spacing: -.035em; text-wrap: balance; }
.entry-heading p { max-width: 58ch; margin: 24px 0 0; color: rgba(244, 240, 231, .66); font-size: 16px; line-height: 1.55; }
.entry-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(920px, 100%); margin-top: clamp(42px, 7vw, 86px); border: 1px solid rgba(244, 240, 231, .24); }
.entry-paths button { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 5px 18px; align-items: center; min-height: 146px; padding: 24px 28px; color: var(--roster-paper-light); text-align: left; background: rgba(20, 20, 17, .82); border: 0; }
.entry-paths button + button { border-left: 1px solid rgba(244, 240, 231, .24); }
.entry-paths button:hover { background: var(--roster-blood); }
.entry-path-mark { display: grid; grid-row: 1 / 3; width: 48px; height: 48px; place-items: center; color: #e36a5b; border: 1px solid currentColor; }
.entry-paths button:hover .entry-path-mark { color: var(--roster-paper-light); }
.entry-path-mark svg { width: 23px; height: 23px; fill: currentColor; stroke: currentColor; stroke-width: 1.7; }
.entry-paths strong { font-family: var(--display); font-size: clamp(25px, 2.5vw, 36px); font-weight: 400; line-height: 1; }
.entry-paths small { color: rgba(244, 240, 231, .58); font-size: 12px; line-height: 1.4; }
.entry-paths button:hover small { color: rgba(244, 240, 231, .8); }
.entry-back { width: fit-content; margin-bottom: 42px; padding: 10px 0; color: rgba(244, 240, 231, .68); font-family: var(--roster-label); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; background: none; border: 0; border-bottom: 1px solid rgba(244, 240, 231, .32); }
.entry-back:hover { color: var(--roster-paper-light); border-color: #e36a5b; }
.entry-selection { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; width: min(900px, 100%); margin-top: 44px; padding: 26px 28px; background: rgba(244, 240, 231, .94); color: var(--roster-ink); border-top: 2px solid var(--roster-blood-live); }
.entry-selection h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 4vw, 50px); font-weight: 400; line-height: .95; }
.entry-selection p { margin: 10px 0 0; color: var(--roster-muted); font-size: 13px; line-height: 1.45; }
.entry-selection div > span { display: block; margin-top: 14px; color: var(--roster-blood); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.entry-selection > button { min-height: 56px; padding: 0 24px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 10px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; background: var(--roster-blood); border: 0; }
.entry-selection > button:hover { background: var(--roster-blood-live); }
.faction-selection { grid-template-columns: 148px minmax(0, 1fr) auto; }
.faction-selection figure { height: 112px; margin: 0; overflow: hidden; background: var(--roster-ink); }
.faction-selection img { width: 100%; height: 100%; object-fit: cover; object-position: var(--image-position, center); filter: grayscale(.5) saturate(.65); }
.faction-selection[data-faction="last_teutonic_order"] figure { background: #f4f0e7; }
.faction-selection[data-faction="last_teutonic_order"] img { object-fit: contain; filter: none; }

/* The Order uses existing concept portraits; unknown game values stay unassigned. */
[data-roster-app][data-faction="last_teutonic_order"] .editor-portrait { height: 320px; background: #f4f0e7; color: var(--roster-ink); }
[data-roster-app][data-faction="last_teutonic_order"] .editor-portrait img { object-fit: contain; padding-bottom: 65px; opacity: 1; filter: none; }
[data-roster-app][data-faction="last_teutonic_order"] .editor-portrait::after,
[data-roster-app][data-faction="last_teutonic_order"] .editor-portrait-copy > span,
[data-roster-app][data-faction="last_teutonic_order"] .play-model::after { display: none; }
[data-roster-app][data-faction="last_teutonic_order"] .fighter-thumb,
[data-roster-app][data-faction="last_teutonic_order"] .play-model { background: #f4f0e7; }
[data-roster-app][data-faction="last_teutonic_order"] .fighter-thumb img,
[data-roster-app][data-faction="last_teutonic_order"] .fighter-switch img,
[data-roster-app][data-faction="last_teutonic_order"] .play-model img { object-fit: contain; filter: none; }
.identity-unassigned { margin: 16px 0 0; font-size: 18px; }
.order-faction-rules .order-return { margin-top: 18px; border-top: 1px solid rgba(244, 240, 231, .28); }
.order-return summary { padding: 16px 0; font-size: 17px; line-height: 1.4; cursor: pointer; }
.order-return summary:focus-visible { outline: 2px solid #e57b6c; outline-offset: 3px; }
.faction-rules.order-faction-rules p { max-width: 72ch; font-size: 15px; line-height: 1.5; color: #ded7ca; }
.order-faction-rules a { color: #f4f0e7; text-underline-offset: .2em; }
.order-faction-rules strong { line-height: 1.15; }
.game-stage > .order-faction-rules { margin-top: 24px; }
[data-faction="last_teutonic_order"] .roster-identity > header p { display: none; }
[data-faction="last_teutonic_order"] .start-game { padding-inline: 12px; font-size: 14px; letter-spacing: .025em; }
[data-faction="last_teutonic_order"] .play-info-grid > article:last-of-type { grid-column: 1 / -1; }
[data-faction="last_teutonic_order"] .play-info-grid p { font-size: 13px; line-height: 1.4; }
[data-faction="last_teutonic_order"] .weapon-table[hidden],
[data-faction="last_teutonic_order"] .vital-control,
[data-faction="last_teutonic_order"] .hp-track,
[data-faction="last_teutonic_order"] [data-apl-delta] { display: none; }
@media (max-width: 760px) {
  [data-faction="last_teutonic_order"] .roster-identity > div { grid-template-columns: 1fr 1fr; }
  [data-faction="last_teutonic_order"] .identity-field:first-child { grid-column: 1 / -1; }
}

.faction-line { margin: 9px 0 0; color: rgba(244, 240, 231, .56); font-family: var(--roster-label); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.builder-summary { grid-template-columns: repeat(4, minmax(82px, 1fr)) auto; }
.summary-cell:nth-child(3) strong { font-size: 29px; line-height: 1; }
.summary-cell:nth-child(4) strong { overflow: hidden; font-family: var(--roster-label); font-size: 11px; font-weight: 700; line-height: 1.15; letter-spacing: .035em; text-overflow: ellipsis; text-transform: uppercase; }
.builder-workspace { grid-template-columns: minmax(470px, 1.08fr) minmax(440px, .92fr); }
.roster-panel { min-width: 0; }
.detail-panel { min-width: 0; }
.roster-list { gap: 14px; padding: 18px 18px 54px; }
.roster-empty { min-height: 210px; margin-bottom: 3px; padding: 30px; grid-template-columns: 66px minmax(0, 1fr); gap: 22px; place-items: center start; text-align: left; }
.roster-empty svg { margin: 0; }
.roster-empty h2 { font-size: clamp(30px, 3vw, 44px); }
.roster-empty p { margin: 9px 0 0; }
.roster-rank { overflow: hidden; border: 1px solid var(--roster-line); background: rgba(244, 240, 231, .62); }
.roster-rank > header { display: flex; min-height: 52px; align-items: stretch; justify-content: space-between; background: rgba(244, 240, 231, .86); border-bottom: 1px solid var(--roster-line); }
.roster-rank > header > div { display: flex; gap: 10px; align-items: baseline; padding: 11px 14px; }
.roster-rank h3 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 400; line-height: 1; }
.roster-rank > header span { color: var(--roster-blood); font-family: var(--roster-label); font-size: 11px; font-weight: 700; }
.rank-add { display: grid; width: 54px; place-items: center; color: var(--roster-ink); background: transparent; border: 0; border-left: 1px solid var(--roster-line); }
.rank-add:hover, .rank-add[aria-expanded="true"] { color: var(--roster-paper-light); background: var(--roster-blood); }
.rank-add svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; }
.rank-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--roster-line); border-bottom: 1px solid var(--roster-line); }
.rank-picker > button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 84px; padding: 13px 14px; color: var(--roster-ink); text-align: left; background: #e5ddce; border: 0; }
.rank-picker > button:hover { background: var(--roster-paper-light); }
.rank-picker strong { display: block; font-family: var(--display); font-size: 22px; font-weight: 400; line-height: 1; }
.rank-picker small { display: block; margin-top: 6px; color: var(--roster-muted); font-size: 12px; line-height: 1.35; }
.rank-picker-stats { display: flex; flex-direction: column; gap: 5px; align-items: end; color: var(--roster-muted); font-family: var(--roster-label); font-size: 10px; text-transform: uppercase; }
.rank-picker-stats b { font-weight: 700; white-space: nowrap; }
.rank-fighters { display: grid; gap: 1px; background: var(--roster-line); }
.rank-fighters > p { margin: 0; padding: 12px 14px; color: var(--roster-muted); font-size: 13px; background: rgba(244, 240, 231, .72); }
.roster-fighter { grid-template-columns: 56px minmax(170px, 1fr) minmax(300px, auto); min-height: 72px; border: 0; }
.fighter-profile { display: grid; grid-template-columns: repeat(4, minmax(44px, auto)) minmax(82px, auto); gap: 1px; align-self: stretch; background: var(--roster-line); }
.fighter-profile > span { display: grid; min-width: 50px; padding: 7px 8px; place-content: center; text-align: center; background: rgba(244, 240, 231, .74); }
.fighter-profile small { color: var(--roster-muted); font-family: var(--roster-label); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fighter-profile b { margin-top: 3px; font-family: var(--display); font-size: 19px; font-weight: 400; }
.silver-price { display: inline-flex !important; flex-direction: row !important; gap: 5px !important; align-items: center; justify-content: center; color: var(--roster-blood); font-family: var(--roster-label); text-transform: uppercase; }
.silver-price svg { width: 14px; height: 14px; flex: none; stroke: currentColor; stroke-width: 1.7; }
.silver-price strong { margin: 0 !important; color: inherit; font-family: var(--display) !important; font-size: 17px !important; font-weight: 400 !important; }
.silver-price > span { color: inherit !important; font-size: 7px !important; letter-spacing: .05em; }
.editor-portrait { height: 164px; }
.fighter-editor[data-sculpt="true"] .editor-portrait { height: 340px; background: #fff; color: var(--roster-ink); }
.fighter-editor[data-sculpt="true"] .editor-portrait img { object-fit: contain; opacity: 1; filter: none; padding-bottom: 62px; }
.fighter-editor[data-sculpt="true"] .editor-portrait::after { display: none; }
.fighter-editor[data-sculpt="true"] .editor-portrait-copy span { color: var(--roster-muted); }
.play-card[data-sculpt="true"] .play-model { background: #fff; }
.play-card[data-sculpt="true"] .play-model img { object-fit: contain; filter: none; }
.play-card[data-sculpt="true"] .play-model::after { display: none; }
.editor-field select { width: 100%; min-height: 42px; padding: 8px; color: var(--roster-ink); background: var(--roster-paper-light); border: 1px solid var(--roster-line); font: inherit; }
.editor-cost { position: absolute; z-index: 2; top: 12px; right: 14px; padding: 6px 8px; color: var(--roster-paper-light); background: rgba(23, 23, 19, .76); border: 1px solid rgba(244, 240, 231, .25); }
.editor-cost .silver-price { color: var(--roster-paper-light); }
.editor-facts { grid-template-columns: repeat(4, 1fr); }
.editor-facts div:nth-child(n+5) { background: #e3dac9; }
.ability-block { margin: 24px 0 0; }
.ability-list { display: grid; gap: 1px; margin-top: 8px; background: rgba(244, 240, 231, .16); }
.ability-block article { margin: 0; padding: 12px 13px; color: var(--roster-paper-light); background: var(--roster-ink-soft); border-top: 1px solid rgba(244, 240, 231, .16); }
.ability-block article:first-child { border-top: 2px solid var(--roster-blood-live); }
.ability-block strong { font-family: var(--display); font-size: 21px; font-weight: 400; }
.ability-block p { margin: 7px 0 0; color: rgba(244, 240, 231, .76); font-size: 13px; line-height: 1.42; }
.ability-block small { display: block; margin-top: 9px; color: rgba(244, 240, 231, .52); font-size: 11px; line-height: 1.4; }
.equipment-list { display: grid; gap: 12px; margin-top: 8px; background: none; border: 0; }
.equipment-group { background: var(--roster-line); border: 1px solid var(--roster-line); }
.equipment-group h4 { margin: 0; padding: 9px 10px; color: var(--roster-paper-light); font-family: var(--roster-label); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; background: var(--roster-ink-soft); }
.equipment-option { grid-template-columns: 17px minmax(0, 1fr); min-height: 58px; border-bottom: 1px solid var(--roster-line); }
.equipment-option:last-child { border-bottom: 0; }
.equipment-copy { min-width: 0; }
.equipment-name { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.equipment-name > strong { font-family: var(--roster-label); font-size: 12px; letter-spacing: .035em; text-transform: uppercase; }
.equipment-option .silver-price > span { display: none; }
.equipment-profile { display: grid; grid-template-columns: repeat(3, auto) minmax(0, 1fr); gap: 5px 9px; align-items: center; margin-top: 6px; color: var(--roster-muted); }
.equipment-profile b { color: var(--roster-ink); font-family: var(--display); font-size: 16px; font-weight: 400; }
.equipment-profile small { margin: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.summary-status { position: relative; min-width: 126px; padding-bottom: 31px; }
.sandbox-mini { position: absolute; inset: auto 12px 8px; display: flex; gap: 7px; align-items: center; color: rgba(244, 240, 231, .58); cursor: pointer; }
.sandbox-mini input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sandbox-mini .toggle-track { width: 31px; height: 16px; background: rgba(244, 240, 231, .13); border-color: rgba(244, 240, 231, .28); }
.sandbox-mini .toggle-track::after { background: rgba(244, 240, 231, .76); }
.sandbox-mini em { font-family: var(--roster-label); font-size: 9px; font-style: normal; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.validation-silent { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.roster-identity { overflow: hidden; background: rgba(244, 240, 231, .9); border: 1px solid var(--roster-line); border-top: 3px solid var(--roster-blood); }
.roster-identity > header { display: flex; gap: 18px; align-items: baseline; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--roster-line); }
.roster-identity h2, .faction-rules h2 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1; }
.roster-identity > header p { margin: 0; color: var(--roster-muted); font-size: 12px; line-height: 1.35; }
.roster-identity > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--roster-line); }
.identity-field { display: grid; align-content: start; padding: 13px 14px; background: rgba(244, 240, 231, .9); }
.identity-field > span, .faction-rules article > span { color: var(--roster-blood); font-family: var(--roster-label); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.identity-field select { width: 100%; min-height: 42px; margin-top: 7px; padding: 0 32px 0 10px; color: var(--roster-ink); font-family: var(--display); font-size: 19px; background: rgba(255, 255, 255, .32); border: 1px solid var(--roster-line); }
.identity-field small { display: block; margin-top: 8px; color: var(--roster-muted); font-size: 11px; line-height: 1.4; }

.faction-rules { margin-top: 8px; padding: 18px; color: var(--roster-paper-light); background: var(--roster-ink-soft); border-top: 3px solid var(--roster-blood-live); }
.faction-rules > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin-top: 14px; background: rgba(244, 240, 231, .16); }
.faction-rules article { padding: 14px; background: var(--roster-ink-soft); }
.faction-rules article > span { color: #e57b6c; }
.faction-rules strong { display: block; margin-top: 7px; font-family: var(--display); font-size: 21px; font-weight: 400; line-height: 1; }
.faction-rules p { margin: 8px 0 0; color: rgba(244, 240, 231, .7); font-size: 12px; line-height: 1.45; }

.game-head-actions .game-back { display: grid; width: 44px; padding: 0; place-items: center; }
.game-back svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; }
.fighter-switch small { font-size: 9px; }
.weapon-head { font-size: 9px; }
.weapon-row strong { font-size: 12px; }
.weapon-row small { font-size: 10px; }
.play-info-grid h2 { font-size: 10px; }
.play-info-grid p { font-size: 11px; line-height: 1.42; }
.apl-controls button { font-size: 10px; }
.play-log { font-size: 11px; }
.play-keywords { font-size: 10px; }

@media (max-width: 1180px) {
  .builder-workspace { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { grid-column: auto; }
  .fighter-editor { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .entry-shell { background-position: center, 68% 45%; }
  .entry-paths { grid-template-columns: 1fr; }
  .entry-paths button + button { border-top: 1px solid rgba(244, 240, 231, .24); border-left: 0; }
  .builder-summary { grid-template-columns: repeat(2, 1fr); }
  .start-game { grid-column: 1 / -1; }
  .roster-fighter { grid-template-columns: 54px minmax(0, 1fr); }
  .fighter-profile { grid-column: 1 / -1; }
  .roster-identity > div, .faction-rules > div { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .entry-shell { min-height: calc(100dvh - var(--header-height)); align-content: end; padding: 34px 15px 28px; background-image: linear-gradient(180deg, rgba(20, 20, 17, .28), rgba(20, 20, 17, .98) 55%), url("assets/pilgrims.png"); background-position: center, 58% 32%; }
  .entry-shell::after { inset: 8px; }
  .entry-heading h1 { font-size: clamp(48px, 15vw, 68px); }
  .entry-heading p { margin-top: 16px; font-size: 14px; }
  .entry-paths { margin-top: 30px; }
  .entry-paths button { min-height: 112px; padding: 18px; }
  .entry-back { margin-bottom: 28px; }
  .entry-selection, .faction-selection { grid-template-columns: 1fr; gap: 18px; margin-top: 28px; padding: 18px; }
  .faction-selection figure { height: 120px; }
  .entry-selection > button { width: 100%; }
  .builder-head { gap: 20px; }
  .builder-summary { grid-template-columns: repeat(2, 1fr); }
  .summary-status { min-width: 0; }
  .roster-identity > header { display: block; }
  .roster-identity > header p { margin-top: 7px; }
  .identity-field small { font-size: 12px; }
  .rank-picker { grid-template-columns: 1fr; }
  .roster-list { padding-inline: 10px; }
  .roster-empty { grid-template-columns: 1fr; text-align: center; place-items: center; }
  .roster-empty p { margin-inline: auto; }
  .roster-rank h3 { font-size: 24px; }
  .fighter-profile { grid-template-columns: repeat(5, 1fr); }
  .fighter-profile > span { min-width: 0; padding-inline: 4px; }
  .fighter-profile .silver-price > span { display: none !important; }
  .fighter-editor { display: block; }
  .editor-facts { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 430px) {
  .entry-paths button { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 13px; }
  .entry-path-mark { width: 40px; height: 40px; }
  .entry-paths strong { font-size: 25px; }
  .entry-paths small { font-size: 11px; }
  .roster-fighter { grid-template-columns: 48px minmax(0, 1fr); }
  .fighter-profile { grid-template-columns: repeat(4, 1fr); }
  .fighter-profile .silver-price { grid-column: 1 / -1; min-height: 32px; }
  .fighter-profile .silver-price > span { display: inline !important; }
  .editor-facts { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .roster-app *, .roster-app *::before, .roster-app *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
