/* Battle Barge — Warhammer 40,000 (Phalanx) theme + screen styles.
   Scoped under [data-universe="40k"] for the theme tokens; the .fk-* component
   classes are self-contained so they render correctly regardless of which bb
   base sheet loaded first. */

[data-universe="40k"] {
  --fk-bg: #0c0d10;
  --fk-surface: #15171c;
  --fk-surface-2: #1d2027;
  --fk-line: #2b2f38;
  --fk-text: #e8e6df;
  --fk-muted: #8b9099;
  --fk-accent: #c9a227;        /* imperial gold */
  --fk-accent-2: #4ea1a3;      /* cold tech teal */
  --fk-danger: #b5462f;
  --fk-radius: 10px;
}

/* Component vars fall back to the universe tokens, with hard defaults so the
   40K screens never render unstyled even outside the data-universe scope. */
.fk-screen {
  --c-bg: var(--fk-bg, #0c0d10);
  --c-surface: var(--fk-surface, #15171c);
  --c-surface-2: var(--fk-surface-2, #1d2027);
  --c-line: var(--fk-line, #2b2f38);
  --c-text: var(--fk-text, #e8e6df);
  --c-muted: var(--fk-muted, #8b9099);
  --c-accent: var(--fk-accent, #c9a227);
  --c-accent-2: var(--fk-accent-2, #4ea1a3);
  --c-danger: var(--fk-danger, #b5462f);
  --c-radius: var(--fk-radius, 10px);
  color: var(--c-text);
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 14px 96px;
  font-family: var(--font-body, "Rajdhani", "Segoe UI", system-ui, sans-serif);
}

.fk-title { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.01em; margin: 0; }
.fk-sub { color: var(--c-muted); margin: 2px 0 0; font-size: 0.85rem; }
.fk-muted { color: var(--c-muted); }

.fk-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  padding: 14px;
  margin: 12px 0;
}

/* ---------- Setup form ---------- */
.fk-setup-head { margin-bottom: 8px; }
.fk-form .fk-label { display: block; margin: 10px 0; font-size: 0.8rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.fk-input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 11px;
  background: var(--c-surface-2); color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: 8px;
  font-size: 1rem; font-family: inherit;
}
.fk-input:focus { outline: none; border-color: var(--c-accent); }
.fk-fieldset { border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 12px 12px; margin: 0; }
.fk-fieldset legend { color: var(--c-accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 6px; }
.fk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fk-castra-import { padding-bottom: 8px; border-bottom: 1px solid var(--c-line); }
.fk-import-status { margin: 8px 0; color: var(--c-danger); font-size: 0.82rem; }
.fk-mission-desc { color: var(--c-muted); font-size: 0.85rem; margin: 4px 2px 0; min-height: 1em; }

.fk-segment { display: flex; gap: 0; margin-top: 5px; border: 1px solid var(--c-line); border-radius: 8px; overflow: hidden; }
.fk-seg-btn { flex: 1; padding: 10px; background: var(--c-surface-2); color: var(--c-muted); border: 0; font-family: inherit; font-size: 0.95rem; cursor: pointer; }
.fk-seg-btn.is-active { background: var(--c-accent); color: #1a1500; font-weight: 700; }

/* ---------- Buttons ---------- */
.fk-btn { padding: 11px 16px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-surface-2); color: var(--c-text); font-family: inherit; font-size: 0.98rem; font-weight: 600; cursor: pointer; }
.fk-btn:hover { border-color: var(--c-accent); }
.fk-btn:disabled { opacity: 0.5; cursor: default; }
.fk-btn-primary { background: var(--c-accent); color: #1a1500; border-color: var(--c-accent); }
.fk-btn-danger { background: transparent; color: var(--c-danger); border-color: var(--c-danger); }
.fk-btn-block { display: block; width: 100%; margin-top: 14px; }
.fk-btn-grow { flex: 1; }
.fk-btn-ghost { background: transparent; }
.fk-btn-small { padding: 7px 13px; font-size: 0.85rem; }

/* Mission generator (setup) — Force Dispositions -> primaries + layout. */
.fk-mission { margin-top: 4px; }
.fk-label-inline { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); white-space: nowrap; }
.fk-mission-hint { margin: 0 0 10px; font-size: 0.82rem; line-height: 1.4; }
.fk-mission-result { margin-top: 10px; }
.fk-mission-primaries { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.fk-mission-primaries > div { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 10px; font-size: 0.92rem; }
.fk-mission-primaries .fk-muted { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.fk-mission-layouts-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.fk-mission-layouts-head .fk-segment { margin-top: 0; flex: 0 0 auto; }
.fk-mission-layouts-head .fk-seg-btn { flex: 0 0 auto; padding: 7px 16px; }
/* Terrain layout image — scale to fit the screen: never wider than its
   container, never taller than most of the viewport. width/height auto keeps
   the aspect ratio while both max constraints bound it. */
.fk-mission-layout-preview { display: block; text-align: center; }
.fk-mission-layout-preview img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid var(--c-line); }

/* Terrain layout image in the battle mission briefing. */
.fk-briefing-layout { display: block; margin-bottom: 12px; text-align: center; }
.fk-briefing-layout img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid var(--c-line); }

.fk-label-narrow { max-width: 180px; }

/* ---------- Battle briefing (setup review) ---------- */
.fk-review { display: flex; flex-direction: column; gap: 18px; }
.fk-review-block { display: block; }
.fk-review-h { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-accent); }
.fk-review-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.fk-review-side { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.fk-review-name { display: block; font-weight: 700; font-size: 1.02rem; color: var(--c-text); }
.fk-review-army { display: block; font-size: 0.85rem; color: var(--c-muted); margin-bottom: 6px; }
.fk-review-dets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.fk-review-dets li { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; }
.fk-review-det-dp { color: var(--c-accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fk-review-vs-sep { align-self: center; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); }
.fk-review-mission { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; color: var(--c-text); }
.fk-review-obj { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.fk-review-obj > div { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 10px; font-size: 0.92rem; }
.fk-review-obj .fk-muted { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.fk-obj-desc { font-size: 0.74rem; line-height: 1.4; color: var(--c-muted); margin: 4px 0 0; max-height: 220px; overflow-y: auto; }
.fk-review-explain { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--c-text); }
.fk-review-help { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 12px 14px; }
.fk-review-steps { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; line-height: 1.45; }
.fk-review-help-note { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.fk-review-first { max-width: 100%; }
.fk-review-first .fk-seg-btn { flex: 1; }
.fk-review-first-note { margin: 8px 0 0; font-size: 0.85rem; line-height: 1.45; }
.fk-review-actions { display: flex; gap: 10px; margin-top: 4px; }
.fk-review-actions .fk-btn-ghost { flex: 0 0 auto; }
.fk-review-actions .fk-btn-primary { flex: 1; }

@media (max-width: 520px) {
  .fk-review-vs { grid-template-columns: 1fr; }
  .fk-review-vs-sep { justify-self: center; padding: 2px 0; }
}

/* ---------- Battle tracker ---------- */
.fk-battle-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fk-round { text-align: right; line-height: 1.1; }
.fk-round-num { display: block; font-size: 1.25rem; font-weight: 700; color: var(--c-accent); }
.fk-round-of { font-size: 0.75rem; color: var(--c-muted); }
.fk-active-banner { margin: 12px 0 0; padding: 10px 12px; background: var(--c-surface-2); border-left: 3px solid var(--c-accent); border-radius: 6px; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fk-cp-quick { margin-left: auto; background: var(--c-surface); border: 1px solid var(--c-accent); color: var(--c-accent); border-radius: 6px; padding: 4px 10px; font-family: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fk-cp-quick:hover { background: var(--c-accent); color: #1a1500; }

/* Admin map-correction mode */
.fk-adm { margin-top: 10px; border: 1px solid var(--c-line, #2b2f38); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fk-adm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fk-adm-nav { display: flex; align-items: center; gap: 10px; }
.fk-adm-pos { font-size: 0.8rem; color: var(--c-muted, #8b9099); }
.fk-adm-done { color: #8fe3a8; font-weight: 700; }
.fk-adm-todo { color: var(--c-accent, #c9a227); font-weight: 700; }
.fk-adm-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fk-adm-palette { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.fk-adm-chip { min-width: 38px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--c-line, #2b2f38); background: var(--c-surface, #16181d); color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer; }
.fk-adm-chip.is-active { border-color: var(--c-accent, #c9a227); color: var(--c-accent, #c9a227); background: rgba(201,162,39,0.12); }
.fk-adm-free { width: 64px; padding: 5px 8px; font-size: 0.78rem; text-transform: uppercase; }
#fk-adm-canvas { width: 100%; height: auto; border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; background: var(--c-bg, #0e0f12); cursor: crosshair; }
.fk-adm-actions { display: flex; align-items: center; gap: 10px; }

/* Map key (layout markings legend) */
.fk-mapkey { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 4px; }
.fk-mapkey-sm { margin-top: 6px; }
.fk-mk { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--c-muted, #8b9099); }
.fk-mk-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.25); }
.fk-mk-icon { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; font-size: 0.6rem; font-weight: 800; font-style: normal; }
.fk-mk-home { background: #f2f0e8; color: #00786e; border: 1px solid #00786e; }
.fk-mk-central { background: #1e2226; color: #eafaf5; border: 1px solid #00aa9b; }
.fk-mk-exp { background: #00786e; color: #eafaf5; transform: rotate(45deg); border-radius: 2px; }
.fk-mk-exp { font-size: 0.55rem; }

/* Tournament terrain layouts (11e-style: terrain + buildings + deployment) */
.fk-gwl-card { display: flex; flex-direction: column; gap: 6px; }
.fk-gwl-canvas { width: 100%; height: auto; border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; background: var(--c-bg, #0e0f12); }
.fk-gwl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fk-gwl-name { font-size: 0.8rem; font-weight: 700; }
.fk-gwl-deplabel { margin-top: 8px; max-width: 280px; }

/* Measured deployment diagrams */
.fk-map-dimline { stroke: rgba(255, 224, 130, 0.85); stroke-width: 0.45; stroke-dasharray: 1.6 1; }
.fk-map-dimtext { fill: #ffe082; font-size: 3.2px; font-family: inherit; font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,0.65); stroke-width: 0.7px; }
.fk-map-cut { fill: var(--c-bg, #0e0f12); stroke: rgba(255, 224, 130, 0.85); stroke-width: 0.45; stroke-dasharray: 1.6 1; }
.fk-map-approx { fill: var(--c-muted, #8b9099); font-size: 2.6px; font-family: inherit; font-style: italic; }
.fk-depref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 10px; }
.fk-depref-card { display: flex; flex-direction: column; gap: 4px; }
.fk-depref-name { font-size: 0.8rem; font-weight: 700; }
.fk-depref-approx { font-size: 0.66rem; font-weight: 600; color: var(--c-muted, #8b9099); font-style: italic; }
.fk-depref-desc { margin: 0; font-size: 0.7rem; color: var(--c-muted, #8b9099); line-height: 1.35; }

/* Imported army list (dock viewer + setup paste box) */
.fk-roster { margin: 0 0 10px; border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 8px 10px; }
.fk-roster summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; }
.fk-roster-group { margin-top: 8px; }
.fk-roster-cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted, #8b9099); border-bottom: 1px solid var(--c-line, #2b2f38); padding-bottom: 2px; margin-bottom: 4px; }
.fk-roster-unit { margin-bottom: 6px; }
.fk-roster-line { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; }
.fk-roster-pts { color: var(--c-accent, #c9a227); font-variant-numeric: tabular-nums; }
.fk-roster-opt { font-size: 0.7rem; color: var(--c-muted, #8b9099); padding-left: 10px; }
.fk-army-ta { width: 100%; box-sizing: border-box; margin-top: 6px; font-size: 0.72rem; font-family: monospace; }
.fk-army-paste-row { display: flex; gap: 8px; margin-top: 6px; }

/* Setup explainers ("what's this?") + fixed-secondary picker */
.fk-explain { margin-top: 10px; border: 1px dashed var(--c-line, #2b2f38); border-radius: 8px; padding: 8px 12px; }
.fk-explain summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--c-accent-2, #7fb2d9); }
.fk-explain p { margin: 8px 0 2px; font-size: 0.78rem; color: var(--c-muted, #8b9099); line-height: 1.45; }
.fk-explain strong { color: var(--c-text, #e8e6df); }
.fk-fixed-pick { margin-top: 12px; border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.fk-fixed-pick-head { font-size: 0.8rem; font-weight: 700; }
.fk-fixed-count { color: var(--c-accent, #c9a227); margin-left: 6px; }
.fk-fixed-card { align-items: flex-start; font-size: 0.78rem; line-height: 1.35; }
.fk-fixed-card .fk-muted { font-weight: 400; }
.fk-fixed-card input:disabled + span { opacity: 0.45; }

/* Device linking (share code + join form) */
.fk-share { margin-top: 8px; }
.fk-share-toggle { background: none; border: 1px dashed var(--c-line, #2b2f38); color: var(--c-muted, #8b9099); border-radius: 6px; padding: 4px 10px; font-family: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.fk-share.is-open .fk-share-toggle, .fk-share-toggle:hover { color: var(--c-accent-2, #7fb2d9); border-color: var(--c-accent-2, #7fb2d9); }
.fk-share-body { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; background: var(--c-surface, #16181d); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fk-share-code { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.18em; color: var(--c-accent, #c9a227); font-variant-numeric: tabular-nums; }
.fk-share-hint { flex-basis: 100%; margin: 0; font-size: 0.72rem; color: var(--c-muted, #8b9099); line-height: 1.35; }
.fk-join { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-line, #2b2f38); text-align: left; }
.fk-recent-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-line, #2b2f38); text-align: left; }
.fk-recent-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fk-recent-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--c-surface, #16181d); border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 9px 12px; color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.82rem; cursor: pointer; text-align: left; }
.fk-recent-row:hover { border-color: var(--c-accent-2, #7fb2d9); }
.fk-recent-name { font-weight: 600; }
.fk-recent-meta { font-size: 0.72rem; color: var(--c-muted, #8b9099); white-space: nowrap; }
.fk-recent-live { color: #8fe3a8; }
.fk-join-h { margin: 0 0 4px; font-size: 0.9rem; }
.fk-join-row { display: flex; gap: 8px; margin-top: 8px; }
.fk-join-input { flex: 1; min-width: 0; background: var(--c-bg, #0e0f12); border: 1px solid var(--c-line, #2b2f38); border-radius: 6px; padding: 8px 10px; color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.9rem; letter-spacing: 0.12em; text-transform: uppercase; }
.fk-join-input:focus { outline: none; border-color: var(--c-accent-2, #7fb2d9); }

/* Round-by-round score history */
.fk-rh { padding: 0; overflow: hidden; }
.fk-rh-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.86rem; font-weight: 700; padding: 12px 14px; cursor: pointer; }
.fk-rh-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.fk-rh-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.fk-rh-table th, .fk-rh-table td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--c-line, #2b2f38); }
.fk-rh-table thead th { color: var(--c-muted, #8b9099); font-weight: 700; font-size: 0.72rem; }
.fk-rh-sub th { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; }
.fk-rh-table td:first-child, .fk-rh-table th:first-child { text-align: left; color: var(--c-muted, #8b9099); }
.fk-rh-table th:nth-child(2), .fk-rh-sub th:nth-child(4), .fk-rh-table td:nth-child(4) { border-right: 1px solid var(--c-line, #2b2f38); }
.fk-rh-total { font-weight: 700; color: var(--c-accent, #c9a227); }
.fk-rh-table tr.is-current td { background: rgba(201, 162, 39, 0.07); }
.fk-rh-note { font-size: 0.7rem; color: var(--c-muted, #8b9099); margin: 0; }
.fk-score-chart { width: 100%; height: auto; }
.fk-chart-axis { stroke: var(--c-line, #2b2f38); stroke-width: 1; }
.fk-chart-lb { fill: var(--c-muted, #8b9099); font-size: 9px; font-family: inherit; }
.fk-chart-legend { display: flex; gap: 14px; font-size: 0.72rem; color: var(--c-muted, #8b9099); }
.fk-chart-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.fk-result-history { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; text-align: left; }

.fk-phase-card { padding: 12px 10px; }
.fk-phase-strip { display: flex; justify-content: space-between; gap: 4px; }
.fk-phase { flex: 1; text-align: center; opacity: 0.45; transition: opacity 0.15s; }
.fk-phase-dot { display: block; width: 12px; height: 12px; margin: 0 auto 6px; border-radius: 50%; background: var(--c-line); }
.fk-phase-name { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.fk-phase.is-done { opacity: 0.8; }
.fk-phase.is-done .fk-phase-dot { background: var(--c-accent-2); }
.fk-phase.is-current { opacity: 1; }
.fk-phase.is-current .fk-phase-dot { background: var(--c-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 30%, transparent); }
.fk-phase.is-current .fk-phase-name { color: var(--c-accent); font-weight: 700; }

.fk-scores { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 12px 0; }
@media (min-width: 640px) { .fk-scores { grid-template-columns: 1fr 1fr; } }
.fk-score { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--c-radius); padding: 12px; text-align: left; }
.fk-score.is-active { border-color: var(--c-accent); }
.fk-score-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fk-score-id { min-width: 0; }
.fk-score-name { display: block; font-weight: 700; }
.fk-score-faction { display: block; font-size: 0.72rem; color: var(--c-muted); }
.fk-score-vp { flex-shrink: 0; font-size: 1.5rem; font-weight: 800; color: var(--c-accent); line-height: 1; font-variant-numeric: tabular-nums; }
.fk-score-vp small { font-size: 0.58rem; color: var(--c-muted); font-weight: 700; margin-left: 1px; }
/* Primary / Secondary mission blocks */
.fk-mblock { margin-top: 8px; }
.fk-mblock-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.fk-mblock-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); }
.fk-mblock-vp { font-size: 0.95rem; font-weight: 800; color: var(--c-accent); font-variant-numeric: tabular-nums; }
.fk-primary-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 10px; }
.fk-primary-name { font-size: 0.84rem; font-weight: 600; color: var(--c-text); line-height: 1.2; }
.fk-primary-card.fk-empty { color: var(--c-muted); font-size: 0.78rem; }
.fk-primary-score { flex-shrink: 0; background: var(--c-accent); color: #1a1500; border: none; border-radius: 6px; padding: 6px 10px; font-family: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fk-primary-score:disabled { opacity: 0.45; cursor: default; background: var(--c-surface); color: var(--c-muted); }
.fk-primary-score.is-scored { background: #1f3d2a; color: #8fe3a8; border: 1px solid #2f6a45; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 5px 10px; }
.fk-primary-score.is-scored:disabled { opacity: 0.5; background: var(--c-surface); color: var(--c-muted); border-color: var(--c-line); }
.fk-primary-score.is-scored .fk-undo-hint { font-size: 0.6rem; font-weight: 600; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.04em; }
.fk-sec-open { width: 100%; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 8px; color: var(--c-accent-2); font-family: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.fk-sec-open:hover { border-color: var(--c-accent-2); }
.fk-score-primary-desc { text-align: left; margin: 6px 0 0; }
.fk-score-primary-desc > summary { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-accent-2); cursor: pointer; list-style: revert; }
.fk-score-primary-desc > p { margin: 4px 0 0; font-size: 0.68rem; line-height: 1.35; color: var(--c-muted); max-height: 150px; overflow-y: auto; }
.fk-score-btns { display: flex; gap: 5px; justify-content: center; }
.fk-vp-btn { flex: 1; padding: 8px 0; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 6px; color: var(--c-text); font-family: inherit; font-size: 0.9rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.fk-vp-btn:hover { border-color: var(--c-accent); }

.fk-controls { display: flex; gap: 10px; margin: 14px 0 8px; }

.fk-result { text-align: center; }
.fk-result-title { color: var(--c-accent); margin: 0 0 12px; }
.fk-result-scores { display: flex; justify-content: center; gap: 32px; margin-bottom: 10px; }
.fk-result-scores strong { display: block; font-size: 1.8rem; color: var(--c-text); }
.fk-empty { text-align: center; }

/* ---------- Missions ---------- */
.fk-mission-grid { display: grid; gap: 12px; }
.fk-mission-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fk-mission-head h3 { margin: 0; font-size: 1.1rem; }
.fk-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-accent); border: 1px solid var(--c-line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.fk-mission-meta { margin: 8px 0 0; }
.fk-mission-meta div { margin: 6px 0; }
.fk-mission-meta dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); }
.fk-mission-meta dd { margin: 2px 0 0; font-size: 0.9rem; }
.fk-mission-foot { margin-top: 8px; font-size: 0.72rem; }

/* ---------- Deployment map + briefing ---------- */
.fk-map { display: block; border-radius: 6px; }
.fk-map-board { fill: var(--c-bg, #0c0d10); stroke: var(--c-line, #2b2f38); stroke-width: 1; }
.fk-map-zone { fill-opacity: 0.55; stroke-width: 0; }
.fk-map-zone-1 { fill: var(--c-accent, #c9a227); }
.fk-map-zone-2 { fill: var(--c-accent-2, #4ea1a3); }
.fk-deploy-preview { display: flex; align-items: center; gap: 12px; margin: 4px 2px 0; }
.fk-deploy-preview:empty { display: none; }
.fk-deploy-desc { font-size: 0.8rem; color: var(--c-muted, #8b9099); margin: 0; }

/* Deployment maps gallery (Maps screen). */
.fk-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.fk-map-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fk-map-card-art { display: flex; justify-content: center; }
.fk-map-card-name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.fk-map-card-body { display: flex; flex-direction: column; gap: 4px; }

/* Section sub-heads on the Maps screen (gold .fk-ref-h look) with
   separation between the deployment and terrain blocks. */
.fk-maps-h { margin-top: 24px; }

/* Terrain layouts: mission-pairing selector + official layout images. */
.fk-terrain-select { width: 100%; max-width: 420px; margin: 4px 0 6px; }
.fk-terrain-missions { margin: 2px 0 10px; }
.fk-terrain-card { text-decoration: none; color: inherit; }
.fk-terrain-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--c-line, #2b2f38);
}

.fk-briefing { padding: 0; overflow: hidden; }
.fk-briefing-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: none; border: 0; color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.95rem; cursor: pointer; text-align: left; }
.fk-briefing-chev { color: var(--c-muted, #8b9099); }
.fk-briefing-body { padding: 0 14px 14px; }
.fk-briefing-primary { font-size: 0.85rem; line-height: 1.4; margin: 0 0 10px; }
.fk-briefing-map { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fk-brief-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fk-brief-side { background: var(--c-surface-2, #1d2027); border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 10px; }
.fk-brief-side-head { font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.fk-brief-line { font-size: 0.82rem; margin: 3px 0; }
.fk-brief-scoring { font-size: 0.76rem; color: var(--c-muted, #8b9099); margin: 6px 0 0; line-height: 1.35; max-height: 240px; overflow-y: auto; }

/* ---------- Setup: detachments ---------- */
.fk-det-grid { align-items: start; }
.fk-det-col { background: var(--c-surface-2, #1d2027); border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 10px; }
.fk-det-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fk-det-title { margin: 0; font-size: 0.85rem; }
.fk-dp-meter { font-size: 0.78rem; color: var(--c-muted, #8b9099); white-space: nowrap; }
.fk-dp-meter strong { color: var(--c-accent, #c9a227); }
.fk-dp-meter.is-full strong { color: var(--c-danger, #b5462f); }
.fk-det-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fk-det-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; cursor: pointer; }
.fk-det-name { flex: 1; }
.fk-det-dp { font-size: 0.72rem; color: var(--c-muted, #8b9099); }
.fk-det-primary { width: 100%; margin-top: 4px; }

/* ---------- Deployment map + briefing ---------- */

/* ---------- New-player guidance + setup checkbox ---------- */
.fk-guide { border-left: 3px solid var(--c-accent-2, #4ea1a3); }
.fk-guide-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fk-guide-badge { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--c-accent-2, #4ea1a3); color: #04201f; padding: 2px 7px; border-radius: 999px; font-weight: 700; }
.fk-guide-intro { font-size: 0.85rem; margin: 0 0 8px; }
.fk-guide-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.fk-guide-steps li { font-size: 0.82rem; line-height: 1.4; }
.fk-check { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 0.88rem; color: var(--c-text); cursor: pointer; }
.fk-check input { margin-top: 3px; }

/* ---------- Secondary mission dock (left) ---------- */
.fk-dock {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px; max-width: 86vw;
  background: var(--c-surface, #15171c);
  border-right: 1px solid var(--c-line, #2b2f38);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 60;
  display: flex; flex-direction: column;
}
.fk-dock.is-open { transform: translateX(0); box-shadow: 8px 0 28px rgba(0,0,0,0.45); }
.fk-dock-tab {
  position: absolute; top: 50%; right: -34px; transform: translateY(-50%);
  width: 34px; padding: 14px 0;
  background: var(--c-accent, #c9a227); color: #1a1500;
  border: 0; border-radius: 0 8px 8px 0; cursor: pointer;
  font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em;
}
.fk-dock-tab-label { writing-mode: vertical-rl; text-orientation: mixed; }
.fk-dock-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; overflow-y: auto; height: 100%; }
.fk-dock-head { display: flex; flex-direction: column; gap: 8px; }
.fk-dock-head > strong { color: var(--c-accent, #c9a227); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; }
.fk-dock-players { display: flex; gap: 6px; }
.fk-dock-pbtn { flex: 1; padding: 7px 4px; font-size: 0.78rem; background: var(--c-surface-2, #1d2027); color: var(--c-muted, #8b9099); border: 1px solid var(--c-line, #2b2f38); border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fk-dock-pbtn.is-active { background: var(--c-accent, #c9a227); color: #1a1500; font-weight: 700; border-color: var(--c-accent, #c9a227); }
/* Army Rules drawer — second left dock; tab sits above the Secondaries tab. */
.fk-rules-tab { top: calc(50% - 112px); background: var(--c-accent-2, #4ea1a3); color: #04201f; }
.fk-rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.fk-rule-det { background: var(--c-surface-2, #1d2027); border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 10px 12px; }
.fk-rule-det-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fk-rule-det-name { font-weight: 700; font-size: 0.95rem; color: var(--c-accent, #c9a227); }
.fk-rule-dp { font-size: 0.72rem; color: var(--c-muted, #8b9099); white-space: nowrap; }
.fk-rule-text { font-size: 0.8rem; line-height: 1.4; margin: 0 0 4px; color: var(--c-text, #e8e6df); }
.fk-rule-missing { font-size: 0.78rem; line-height: 1.4; margin: 0; color: var(--c-muted, #8b9099); font-style: italic; }
.fk-rule-sec { margin-top: 8px; }
.fk-rule-h { margin: 0 0 4px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-accent-2, #4ea1a3); }
.fk-rule-item { margin-bottom: 6px; }
.fk-rule-item-name { display: block; font-weight: 600; font-size: 0.82rem; }
.fk-rule-cp { font-weight: 700; color: var(--c-accent, #c9a227); }
.fk-rule-item p { margin: 1px 0 0; font-size: 0.78rem; line-height: 1.38; color: var(--c-muted, #8b9099); }

.fk-dock-cap { font-size: 0.8rem; color: var(--c-muted, #8b9099); text-align: center; padding: 6px; border: 1px dashed var(--c-line, #2b2f38); border-radius: 6px; }
.fk-dock-cap strong { color: var(--c-text, #e8e6df); }
.fk-dock-cap.is-maxed { border-color: var(--c-accent, #c9a227); color: var(--c-accent, #c9a227); }
.fk-dock-cap.is-maxed strong { color: var(--c-accent, #c9a227); }
.fk-dock-draw { margin: 0; flex: 1; }
.fk-dock-drawrow { display: flex; gap: 8px; align-items: stretch; }
.fk-dock-search-toggle { margin: 0; white-space: nowrap; font-size: 0.74rem; }
.fk-dock-search-toggle.is-open { background: var(--c-surface-2); color: var(--c-accent-2); border-color: var(--c-accent-2); }
.fk-deck-picker { border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--c-surface, #16181d); }
.fk-deck-q { width: 100%; box-sizing: border-box; background: var(--c-bg, #0e0f12); border: 1px solid var(--c-line, #2b2f38); border-radius: 6px; padding: 7px 9px; color: var(--c-text, #e8e6df); font-family: inherit; font-size: 0.82rem; }
.fk-deck-q:focus { outline: none; border-color: var(--c-accent-2); }
.fk-deck-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 240px; overflow-y: auto; }
.fk-deck-add { width: 100%; text-align: left; background: var(--c-surface-2, #1c1f26); border: 1px solid var(--c-line, #2b2f38); border-radius: 6px; padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--c-text, #e8e6df); font-family: inherit; }
.fk-deck-add:hover { border-color: var(--c-accent-2); background: var(--c-surface, #16181d); }
.fk-deck-add-name { font-weight: 700; font-size: 0.8rem; color: var(--c-accent-2); }
.fk-deck-add-scoring { font-size: 0.7rem; color: var(--c-muted, #8b9099); line-height: 1.25; }
.fk-deck-loading, .fk-deck-empty { font-size: 0.78rem; color: var(--c-muted, #8b9099); text-align: center; padding: 8px; margin: 0; }
.fk-sec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fk-sec-empty { color: var(--c-muted, #8b9099); font-size: 0.85rem; text-align: center; padding: 16px 8px; }
.fk-sec-card { background: var(--c-surface-2, #1d2027); border: 1px solid var(--c-line, #2b2f38); border-radius: 8px; padding: 10px; }
.fk-sec-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fk-sec-name { font-weight: 700; font-size: 0.9rem; }
.fk-sec-discard { background: none; border: 0; color: var(--c-muted, #8b9099); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.fk-sec-discard:hover { color: var(--c-danger, #b5462f); }
.fk-sec-scoring { font-size: 0.76rem; color: var(--c-muted, #8b9099); margin: 6px 0 8px; line-height: 1.35; }
.fk-sec-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fk-sec-vp { font-weight: 700; color: var(--c-accent, #c9a227); font-size: 0.85rem; }
.fk-sec-btns { display: flex; gap: 4px; }
.fk-sec-score { min-width: 28px; padding: 5px 0; background: var(--c-bg, #0c0d10); color: var(--c-text, #e8e6df); border: 1px solid var(--c-line, #2b2f38); border-radius: 5px; font-size: 0.78rem; cursor: pointer; }
.fk-sec-score:hover { border-color: var(--c-accent, #c9a227); }

/* ---------- Toast ---------- */
.fk-toast { background: var(--fk-surface-2, #1d2027); color: var(--fk-text, #e8e6df); border: 1px solid var(--fk-line, #2b2f38); border-left: 3px solid var(--fk-accent, #c9a227); border-radius: 6px; padding: 10px 14px; margin-top: 8px; font-size: 0.9rem; box-shadow: 0 6px 20px rgba(0,0,0,0.4); transition: opacity 0.3s; }
.fk-toast-error { border-left-color: var(--fk-danger, #b5462f); }
.fk-toast-success { border-left-color: #4e9a5a; }
.fk-toast-out { opacity: 0; }

@media (max-width: 420px) {
  .fk-grid2 { grid-template-columns: 1fr; }
  .fk-phase-name { font-size: 0.62rem; }
}

/* ---- Score Primary button + manual adjust row ---- */
.fk-score-primary-btn { margin: 8px 0 6px; }
.fk-score-adjust { display: flex; align-items: center; gap: 5px; }
.fk-score-adjust-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); margin-right: 2px; }
.fk-score-adjust .fk-vp-btn { flex: 0 1 auto; min-width: 40px; padding: 5px 8px; font-size: 0.78rem; }

/* ---- Score Mission card (primary scoring sheet) ---- */
.fk-pc-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.66); backdrop-filter: blur(2px); }
@media (min-width: 640px) { .fk-pc-overlay { align-items: center; } }
.fk-pc-sheet { width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
@media (min-width: 640px) { .fk-pc-sheet { border-radius: 14px; } }
.fk-pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 16px 10px; border-bottom: 1px solid var(--c-line); }
.fk-pc-title { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent); }
.fk-pc-mission { font-size: 1.05rem; font-weight: 700; color: var(--c-text); margin-top: 2px; }
.fk-pc-x { background: none; border: none; color: var(--c-muted); font-size: 1.2rem; cursor: pointer; padding: 2px 6px; line-height: 1; }
.fk-pc-x:hover { color: var(--c-text); }
.fk-pc-note { margin: 10px 16px 0; padding: 8px 10px; font-size: 0.7rem; line-height: 1.4; color: var(--c-muted); background: var(--c-surface-2); border-radius: 8px; border-left: 2px solid var(--c-accent-2); }
.fk-pc-body { overflow-y: auto; padding: 12px 16px 4px; }
.fk-pc-block { margin-bottom: 14px; }
.fk-pc-block.is-offround { opacity: 0.5; }
.fk-pc-block-head { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text); background: var(--c-surface-2); padding: 6px 10px; border-radius: 6px; }
.fk-pc-offround { color: var(--c-muted); font-weight: 600; }
.fk-pc-block-sub { font-size: 0.66rem; color: var(--c-accent-2); margin: 5px 0 6px; padding-left: 2px; }
.fk-pc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.fk-pc-label { font-size: 0.8rem; line-height: 1.3; color: var(--c-text); }
.fk-pc-vp { display: inline-block; font-weight: 800; color: var(--c-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fk-pc-each { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); }
.fk-pc-step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fk-pc-dec, .fk-pc-inc { width: 32px; height: 32px; border-radius: 6px; background: var(--c-surface-2); border: 1px solid var(--c-line); color: var(--c-text); font-size: 1.05rem; line-height: 1; cursor: pointer; }
.fk-pc-dec:hover, .fk-pc-inc:hover { border-color: var(--c-accent); }
.fk-pc-count { min-width: 20px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.fk-pc-flat { cursor: pointer; }
.fk-pc-check { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--c-accent); cursor: pointer; }
.fk-pc-choice { flex-direction: column; align-items: stretch; }
.fk-pc-opts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.fk-pc-opt { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--c-text); cursor: pointer; padding: 3px 0; }
.fk-pc-radio { accent-color: var(--c-accent); cursor: pointer; }
.fk-pc-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.fk-pc-foot .fk-btn-ghost { flex: 0 0 auto; }

/* ---- Command Points tracker ---- */
.fk-cp { margin: 6px 0 10px; padding: 8px 10px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; }
.fk-cp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fk-cp-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); }
.fk-cp-cur { font-size: 1.15rem; font-weight: 800; color: var(--c-accent-2); font-variant-numeric: tabular-nums; }
.fk-cp-cur::after { content: ' CP'; font-size: 0.58rem; color: var(--c-muted); font-weight: 600; }
.fk-cp-rows { display: flex; gap: 8px; }
.fk-cp-row { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.fk-cp-rl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); }
.fk-cp-btn { width: 26px; height: 26px; border-radius: 6px; background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-text); font-size: 0.95rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.fk-cp-btn:hover { border-color: var(--c-accent); }
.fk-cp-n { min-width: 16px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Secondary card actions (discard vs shuffle-back) ---- */
.fk-sec-actions { display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; }
.fk-sec-discard-btn { background: transparent; border: 1px solid var(--c-danger); color: var(--c-danger); border-radius: 5px; padding: 3px 8px; font-family: inherit; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; }
.fk-sec-discard-btn:hover { background: var(--c-danger); color: #fff; }
.fk-sec-shuffle { background: transparent; border: 1px solid var(--c-line); color: var(--c-muted); border-radius: 5px; width: 26px; height: 24px; font-size: 0.85rem; line-height: 1; cursor: pointer; }
.fk-sec-shuffle:hover { border-color: var(--c-accent); color: var(--c-text); }

/* ---- Tappable secondary card (opens the Score Secondary sheet) ---- */
.fk-sec-scoring.fk-sec-tap { display: block; width: 100%; text-align: left; background: transparent; border: 1px dashed var(--c-line); border-radius: 6px; padding: 7px 9px; color: var(--c-muted); font-family: inherit; font-size: 0.78rem; line-height: 1.35; cursor: pointer; }
.fk-sec-scoring.fk-sec-tap:hover { border-color: var(--c-accent-2); color: var(--c-text); }
.fk-sec-tap-hint { display: block; margin-top: 4px; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-accent-2); }
.fk-sec-openbtn { background: var(--c-accent); color: #1a1500; border: none; border-radius: 6px; padding: 6px 12px; font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fk-sec-openbtn:hover { filter: brightness(1.08); }

/* Per-card secondary cap hint on the score sheet */
.fk-pc-cap { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-accent-2); white-space: nowrap; }

/* Tactical / Fixed mode switch on the secondary score sheet */
.fk-sc-modes { display: flex; gap: 0; margin: 10px 16px 4px; border: 1px solid var(--c-line); border-radius: 8px; overflow: hidden; }
.fk-sc-mode { flex: 1; padding: 8px; background: var(--c-surface-2); color: var(--c-muted); border: none; font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.fk-sc-mode.is-active { background: var(--c-accent); color: #1a1500; }

/* ---------- Setup wizard ---------- */
.fk-wz-progress { display: flex; align-items: center; gap: 4px; margin: 4px 0 14px; }
.fk-wz-step { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.fk-wz-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c-surface-2); border: 1px solid var(--c-line); color: var(--c-muted); font-size: 0.78rem; font-weight: 800; }
.fk-wz-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); }
.fk-wz-step.is-current .fk-wz-dot { background: var(--c-accent); border-color: var(--c-accent); color: #1a1500; }
.fk-wz-step.is-current .fk-wz-label { color: var(--c-text); }
.fk-wz-step.is-done .fk-wz-dot { background: var(--c-accent-2); border-color: var(--c-accent-2); color: #04201f; }
.fk-wz-bar { flex: 1 1 auto; height: 1px; background: var(--c-line); min-width: 8px; }
@media (max-width: 520px) { .fk-wz-label { display: none; } .fk-wz-bar { min-width: 4px; } }
.fk-wz-nav { display: flex; gap: 10px; margin: 14px 0 8px; }
.fk-check-block { display: flex; align-items: center; gap: 8px; align-self: end; padding: 10px 0; font-size: 0.9rem; }

/* Layout picker cards (Create Battlefield) */
.fk-layout-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .fk-layout-cards { grid-template-columns: repeat(3, 1fr); } }
.fk-layout-card { display: flex; flex-direction: column; padding: 0; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden; cursor: pointer; text-align: left; }
.fk-layout-card img { width: 100%; height: auto; display: block; background: #fff; }
.fk-layout-card.is-active { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
.fk-layout-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; }
.fk-layout-badge { font-size: 0.56rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-accent-2); }
.fk-layout-name { font-size: 0.8rem; font-weight: 700; color: var(--c-text); }

/* Primary mission detail (full structured scoring) in setup */
.fk-mission-cardset { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .fk-mission-cardset { grid-template-columns: 1fr 1fr; } }
.fk-primary-detail { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 10px; padding: 10px 12px; }
.fk-primary-detail-head { font-size: 1rem; margin-bottom: 6px; }
.fk-primary-detail-head .fk-muted { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.fk-pscore-block { margin-top: 6px; }
.fk-pscore-head { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-accent-2); margin-bottom: 3px; }
.fk-pscore-block ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.fk-pscore-block li { font-size: 0.74rem; line-height: 1.3; color: var(--c-text); display: flex; justify-content: space-between; gap: 8px; }
.fk-pscore-vp { color: var(--c-accent); white-space: nowrap; }
.fk-pscore-opts { color: var(--c-muted); }
.fk-pscore-opts strong { color: var(--c-accent); }

/* Battle-ready (+10 VP) */
.fk-check-inline { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.85rem; color: var(--c-text); cursor: pointer; }
.fk-vp-bonus { color: var(--c-accent); font-weight: 700; font-size: 0.78rem; }
.fk-ready-chip { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 8px; padding: 3px 8px; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--c-accent-2); background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 6px; }
.fk-ready-chip strong { color: var(--c-accent); }

/* Setup roll-off helper text + briefing roles line */
.fk-mini { font-size: 0.72rem; margin: 0 0 6px; }
.fk-brief-roles { font-size: 0.8rem; margin: 4px 0 8px; color: var(--c-text); }

/* ---- Our own battlefield layout maps (replace the GW layout JPGs) ---- */
.fk-lm { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; border-radius: 8px; border: 1px solid var(--c-line); }
.fk-lm-board { fill: #e9e7df; stroke: var(--c-line); stroke-width: 0.6; }
.fk-lm-nml { fill: #e9e7df; }
.fk-lm-red { fill: #b5462f; fill-opacity: 0.8; stroke: #7e2e1f; stroke-width: 0.5; }
.fk-lm-blue { fill: #33597a; fill-opacity: 0.85; stroke: #21384d; stroke-width: 0.5; }
.fk-lm-centre { stroke: #2b2f38; stroke-width: 0.4; stroke-dasharray: 2 2; }
.fk-lm-obj { fill: #fff; stroke: #14110b; stroke-width: 0.8; }
.fk-layout-card .fk-lm { max-width: 100%; border: none; border-radius: 0; }

/* Design-your-own battlefield (map-builder integration) */
.fk-design-bf { margin-top: 10px; text-align: center; }
.fk-bf-canvas { display: block; width: 100%; max-width: 300px; height: auto; margin: 8px auto 0; border: 1px solid var(--c-line); border-radius: 8px; background: #1a1a2e; }

/* My Battlefields (maps tab library) */
.fk-maps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.fk-maps-head .fk-maps-h { margin: 0; }
.fk-bf-card { overflow: hidden; }
.fk-bf-thumb { display: block; width: 100%; height: auto; background: #1a1a2e; }
.fk-bf-thumb-empty { display: grid; place-items: center; aspect-ratio: 3 / 2; color: var(--c-muted); font-size: 0.75rem; background: var(--c-surface-2); }
.fk-bf-actions { display: flex; gap: 6px; margin-top: 6px; }
