:root {
  --ink: #07140c;
  --night: #0c1f14;
  --panel: #12301f;
  --panel-2: #173b27;
  --line: #26563b;
  --ice: #c4efcf;
  --ice-dim: #8fbf9f;
  --text: #dfece2;
  --blood: #d2301f;
  --blood-dark: #8e1b11;
  --gold: #f0b93a;
  --bone: #f1e8d3;
  --radius: 14px;
  --side: 290px;
  --side-r: 250px;
  --head: 'Oswald', 'Impact', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, #1f5a34 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #2a1218 0%, transparent 55%),
    var(--ink);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
a { color: var(--ice); }
strong { color: #fff; }
em { color: var(--ice); }
::selection { background: var(--blood); color: #fff; }

/* ---------- top bar (mobile) ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 60px;
  display: none; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(7, 20, 12, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font: 700 24px var(--head); letter-spacing: .08em; text-transform: uppercase; color: #fff; text-decoration: none; }
.topbar .brand b { color: var(--blood); }
.burger {
  margin-left: auto; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.burger svg { width: 22px; height: 22px; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0b1d12, #07140c);
  border-right: 1px solid var(--line);
}

.search { position: relative; margin: 18px 16px 10px; }
.search input {
  width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: #fff; padding: 0 12px 0 38px; font: inherit; font-size: 15px;
}
.search input:focus { outline: 2px solid var(--ice); outline-offset: 1px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 20px; height: 20px; color: var(--ice-dim); pointer-events: none; }
.results {
  position: absolute; left: 0; right: 0; top: 48px; max-height: 60vh; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; z-index: 5;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); display: none;
}
.results.open { display: block; }
.results a { display: block; padding: 10px 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.results a:last-child { border: 0; }
.results a:hover, .results a:focus { background: var(--panel); }
.results small { display: block; color: var(--gold); font: 600 11px var(--body); letter-spacing: .1em; text-transform: uppercase; }
.results mark { background: var(--blood); color: #fff; border-radius: 3px; padding: 0 2px; }
.results .none { padding: 12px; color: var(--ice-dim); font-size: 14px; }

.toc { flex: 1; overflow: auto; padding: 4px 10px 24px; }
.toc a {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 9px;
  color: var(--ice-dim); text-decoration: none; font-size: 15px; border-left: 3px solid transparent;
}
.toc a i { font: 600 12px var(--head); font-style: normal; color: var(--line); min-width: 20px; letter-spacing: .06em; }
.toc a:hover { background: var(--panel); color: #fff; }
.toc a.active { background: var(--panel); color: #fff; border-left-color: var(--blood); }
.toc a.active i { color: var(--gold); }
.side-foot { padding: 6px 12px 10px; text-align: center; border-top: 1px solid var(--line); }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 55; display: none; }

/* ---------- main ---------- */
main { margin-left: var(--side); margin-right: var(--side-r); position: relative; }
.hero-bg {
  position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,20,12,.92) 0%, rgba(7,20,12,.6) 45%, rgba(7,20,12,.25) 100%),
    linear-gradient(180deg, rgba(7,20,12,0) 45%, var(--ink) 100%),
    url(../assets/hero.jpg) center 20% / cover no-repeat;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 32px; }

.hero { padding: 64px 0 40px; position: relative; }
.hero .kicker { font: 600 14px var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.hero h1 {
  font: 700 clamp(64px, 12vw, 140px)/.9 var(--head); letter-spacing: .04em; text-transform: uppercase;
  margin: 10px 0 18px; color: #fff;
  text-shadow: 0 4px 0 var(--blood-dark), 0 14px 40px rgba(210,48,31,.35);
}
.hero h1 b { color: var(--blood); font-weight: 700; }
.hero .tag { font-size: clamp(18px, 2.4vw, 24px); color: var(--bone); max-width: 640px; font-style: italic; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 10px;
  font: 600 16px var(--head); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--blood); color: #fff; box-shadow: 0 6px 0 var(--blood-dark); }
.btn.gold { background: var(--gold); color: #1b1303; box-shadow: 0 6px 0 #a87a12; }
.btn.gold svg { flex: none; }
.side-dl {
  display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 16px 7px; min-height: 32px;
  border-radius: 8px; background: var(--gold); color: #1b1303; text-decoration: none;
  font: 600 13px var(--head); letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 2px 0 #a87a12;
}
.side-dl svg { width: 15px; height: 15px; flex: none; }
.sidebar .side-dl:last-child { margin-bottom: 16px; }
.side-dl:hover { transform: translateY(-1px); }
.btn.ghost { border-color: var(--line); color: var(--ice); background: rgba(18,48,31,.6); }

.lane { margin-top: 36px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0b2414; }
.lane svg { display: block; width: 100%; height: auto; }

/* quick strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 28px 0 8px; }
.strip div { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.strip b { display: block; font: 700 34px/1 var(--head); color: var(--gold); }
.strip span { font-size: 13px; color: var(--ice-dim); letter-spacing: .04em; }

/* ---------- sections ---------- */
section.rule { padding: 56px 0 8px; border-top: 1px dashed var(--line); margin-top: 48px; }
section.rule:first-of-type { margin-top: 24px; }
.sec-num { font: 600 14px var(--head); letter-spacing: .3em; color: var(--blood); text-transform: uppercase; }
h2 { font: 700 clamp(34px, 5vw, 52px)/1.05 var(--head); text-transform: uppercase; letter-spacing: .03em; margin: 4px 0 18px; color: #fff; }
h3 { font: 600 22px var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--ice); margin: 28px 0 8px; }
p { margin: 0 0 14px; }
ul { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 8px; }
li::marker { color: var(--blood); }
.lead { font-size: 20px; color: var(--bone); }

.callout {
  background: linear-gradient(90deg, rgba(210,48,31,.16), rgba(210,48,31,.04));
  border-left: 4px solid var(--blood); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; margin: 18px 0;
}
.callout.ice { background: linear-gradient(90deg, rgba(196,239,207,.12), rgba(196,239,207,.03)); border-left-color: var(--ice); }
.callout.gold { background: linear-gradient(90deg, rgba(240,185,58,.15), rgba(240,185,58,.03)); border-left-color: var(--gold); }
.callout p:last-child { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.card h4 { margin: 0 0 4px; font: 700 26px var(--head); text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.card .n { position: absolute; top: 10px; right: 14px; font: 700 40px/1 var(--head); color: rgba(255,255,255,.07); }
.card p { font-size: 15px; margin: 0; color: var(--text); }
.card .role { font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

.score { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.score .s { text-align: center; border-radius: var(--radius); padding: 20px 10px; border: 1px solid var(--line); background: var(--panel); }
.score .s b { display: block; font: 700 64px/1 var(--head); }
.score .s span { font: 600 14px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--ice-dim); }
.score .s.a b { color: #6fe0a1; } .score .s.b b { color: var(--gold); } .score .s.c b { color: var(--blood); } .score .s.d b { color: var(--ice); }
.score .s.d { border-color: var(--ice); background: linear-gradient(180deg, #1b4a2e, var(--panel)); }

.tablewrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th { background: var(--panel-2); font: 600 14px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); text-align: left; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(odd) { background: rgba(18,48,31,.5); }
td:first-child { font-weight: 600; color: #fff; white-space: nowrap; }
.sq { font: 700 22px var(--head); color: var(--gold); white-space: nowrap; }
.cost { font: 700 18px var(--head); color: var(--gold); white-space: nowrap; }

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blood); color: #fff; display: grid; place-items: center; font: 700 16px var(--head);
}

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 20px 8px; }

.playtest li { padding: 2px 0; }
.changelog { font-size: 14px; color: var(--ice-dim); }
.changelog b { color: var(--gold); }

footer { margin: 80px 0 0; padding: 32px 0 60px; border-top: 1px solid var(--line); color: var(--ice-dim); font-size: 14px; text-align: center; }
footer p { margin: 4px 0; }

.totop {
  position: fixed; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--blood); color: #fff; cursor: pointer; z-index: 40;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.totop.show { opacity: 1; pointer-events: auto; }
.totop svg { width: 22px; height: 22px; }

.lore-head { display: flex; gap: 28px; align-items: center; margin: 8px 0 8px; }
.lore-head img { width: 300px; height: auto; flex: none; filter: drop-shadow(0 12px 24px rgba(0,0,0,.5)); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .topbar { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: min(86vw, 330px); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  body.nav-open { overflow: hidden; }
  main { margin-left: 0; padding-top: 60px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 36px; }
  .hero-bg { height: 760px; background-image: linear-gradient(180deg, rgba(7,20,12,.78) 0%, rgba(7,20,12,.5) 50%, var(--ink) 100%), url(../assets/hero-small.jpg); background-position: center top; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .lore-head { flex-direction: column; text-align: left; }
  .lore-head img { width: min(280px, 80%); align-self: center; }
  th, td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.note { font-size: 14px; color: var(--ice-dim); font-style: italic; margin-top: 12px; }
.tablewrap td:nth-child(2) { white-space: nowrap; }
@media (max-width: 960px) { .tablewrap td:nth-child(2) { white-space: normal; } }

/* grouped, collapsible TOC */
.toc-group { margin: 0 0 6px; }
.toc-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 9px; user-select: none;
  font: 600 14px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.toc-group > summary::-webkit-details-marker { display: none; }
.toc-group > summary::before {
  content: ''; width: 7px; height: 7px; flex: none; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 4px;
}
.toc-group[open] > summary::before { transform: rotate(45deg); }
.toc-group > summary:hover { background: var(--panel); }
.toc-group .gname { flex: 1; }
.toc-group .gcount { font: 600 12px var(--body); letter-spacing: 0; color: var(--ice-dim); background: var(--panel); border-radius: 99px; padding: 1px 8px; }
.toc-group > a { margin-left: 8px; }

.side-dl.alt { background: transparent; color: var(--gold); border: 1px solid var(--gold); box-shadow: none; }
.side-dl.alt:hover { background: rgba(240,185,58,.12); }

/* long first column: let it wrap instead of scrolling */
.tablewrap table.wrapfirst { min-width: 0; table-layout: auto; }
table.wrapfirst td:first-child { white-space: normal; font-weight: 500; color: var(--text); }
table.wrapfirst td:nth-child(2) { white-space: nowrap; }
table.wrapfirst td:last-child { min-width: 7em; }


/* modal popup */
.modal { border: 1px solid var(--line); border-radius: 16px; background: var(--night); color: var(--text); padding: 0;
  width: min(720px, 92vw); max-height: 86vh; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.modal-inner { position: relative; padding: 30px 34px 26px; max-height: 86vh; overflow: auto; }
.modal-inner h2 { margin-top: 2px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: #fff; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--blood); }
body.modal-open { overflow: hidden; }
@media (max-width: 600px) { .modal-inner { padding: 24px 18px 20px; } }

/* coach's board: keep it readable on narrow screens by letting it scroll sideways */
.lane { overflow-x: auto; }
.lane svg { min-width: 760px; }


/* sidebar scrollbar */
.toc { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.toc::-webkit-scrollbar { width: 8px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.toc::-webkit-scrollbar-thumb:hover { background: #3c7a57; background-clip: padding-box; }

/* ---------- right sidebar: the Federation ---------- */
.sidebar-r { left: auto; right: 0; width: var(--side-r); border-right: 0; border-left: 1px solid var(--line); }
.r-emblem { display: block; padding: 26px 24px 8px; text-align: center; }
.r-emblem img { width: 100%; max-width: 170px; height: auto; filter: drop-shadow(0 10px 20px rgba(0,0,0,.55)); }
.rtab, .rburger { display: none; }
.rtab {
  position: fixed; right: 0; top: 40%; z-index: 45; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px;
  background: var(--panel); color: var(--gold); cursor: pointer; font: 600 12px var(--head); letter-spacing: .14em; text-transform: uppercase;
}
.rtab:hover { background: var(--panel-2); }

@media (max-width: 1179px) {
  main { margin-right: 0; }
  .sidebar-r { transform: translateX(100%); transition: transform .25s; width: min(86vw, 300px); }
  /* the right menu is also a .sidebar: the left menu's open state must not open it too */
  body.nav-open .sidebar-r { transform: translateX(100%); }
  body.rnav-open .sidebar-r { transform: none; }
  body.rnav-open .scrim { display: block; }
  body.rnav-open { overflow: hidden; }
  .rtab { display: flex; }
}
@media (max-width: 960px) {
  .rtab { display: none; }
  .rburger { display: grid; margin-left: 0; }
}

.foot-link { background: none; border: 0; border-radius: 9px; cursor: pointer; padding: 10px 14px; width: 100%;
  font: 600 14px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.foot-link:hover { background: var(--panel); color: #fff; }

/* ---------- print: the whole rulebook as a clean A4 document ---------- */
.print-only { display: none; }
@page { size: A4; margin: 16mm 14mm 18mm; @bottom-center { content: "Skurling Rulebook v1.6  -  page " counter(page); font: 8pt sans-serif; color: #666; } }
@media print {
  :root { --ink: #fff; --night: #fff; --panel: #f2f4f2; --panel-2: #e3e8e3; --line: #9aa59d; --ice: #222; --ice-dim: #444; --text: #111; --gold: #7a5200; --bone: #222; --blood: #b3241a; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html { scroll-behavior: auto; }
  body { background: #fff !important; font-size: 10pt; line-height: 1.45; }
  body, body * { color: #111 !important; text-shadow: none !important; }
  .sidebar, .topbar, .rtab, .scrim, .totop, .hero-bg, .cta, dialog, .modal { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  a { text-decoration: none; }

  /* cover */
  .print-only { display: block; }
  .print-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
  .print-brand img { width: 26mm; height: auto; }
  .print-brand p { margin: 0; font-size: 9.5pt; letter-spacing: .08em; text-transform: uppercase; }
  .hero { padding: 0 0 10mm; break-after: page; }
  .hero .kicker { color: #7a5200 !important; }
  .hero h1 { font-size: 54pt; margin: 4mm 0 4mm; text-shadow: none; }
  .hero h1 b, .sec-num { color: var(--blood) !important; }
  .hero .tag { font-size: 13pt; max-width: none; }
  .lane { border: 1px solid #777; border-radius: 6px; overflow: visible; background: #0b2414; }
  .lane svg { min-width: 0; }
  .lane svg text, .lane svg g { color: initial !important; }
  .strip div { border: 1px solid #aab3ab; }
  .strip b { color: #7a5200 !important; }

  /* sections */
  section.rule { padding: 8mm 0 0; margin-top: 0; border: 0; break-inside: auto; }
  section.rule.group-start { break-before: page; padding-top: 0; }
  h2 { font-size: 22pt; margin: 1mm 0 4mm; break-after: avoid; }
  h3 { font-size: 13pt; margin: 6mm 0 2mm; break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .lead { font-size: 12pt; }
  .tablewrap { overflow: visible; border: 1px solid #777; margin: 3mm 0 4mm; break-inside: avoid; }
  table { min-width: 0 !important; width: 100%; }
  th, td { padding: 4px 7px; font-size: 9pt; border-bottom: 1px solid #b5beb7; }
  th { background: #dfe6df !important; color: #4d3500 !important; }
  tbody tr:nth-child(odd) { background: #f4f6f4 !important; }
  tr { break-inside: avoid; }
  td:first-child, .tablewrap td:nth-child(2) { white-space: normal !important; }
  .sq, .cost { color: #4d3500 !important; white-space: nowrap !important; }
  td.sq { width: 1%; }
  .callout { background: #f1f4f1 !important; border-left: 3px solid #555; break-inside: avoid; }
  .cards, .score { break-inside: avoid; }
  .card, .score .s, .cols > div { background: #f6f8f6 !important; border: 1px solid #aab3ab; break-inside: avoid; }
  .card h4 { font-size: 15pt; }
  .score .s b { font-size: 36pt; }
  .steps li::before { background: #b3241a !important; color: #fff !important; }
  .lore-head { break-inside: avoid; }
  .lore-head img { width: 40mm; filter: none; }
  .note { font-size: 9pt; }
  img { max-width: 100%; }
  footer { margin-top: 8mm; padding: 4mm 0 0; border-top: 1px solid #999; font-size: 8.5pt; }

}

.visits { margin-top: 10px; font-size: 13px; letter-spacing: .06em; }
.visits strong { color: var(--gold); font-variant-numeric: tabular-nums; }
@media print { .visits { display: none !important; } }




.lane.lane-concept { margin: 22px 0 20px; }

/* block-die icons in the Touch table */
.die-cell { white-space: nowrap; }
.dietable th:first-child, .dietable td.die-cell { width: 150px; white-space: nowrap; }
.dietable td:nth-child(2), .dietable th:nth-child(2) { width: 110px; }
.die-cell img.die { display: block; width: 56px; height: 56px; margin: -4px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media print { img.die { width: 14mm !important; height: 14mm !important; } }

/* modal tabs */
.tabs { display: flex; gap: 6px; margin: 0 52px 18px 0; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 8px 14px; cursor: pointer;
  font: 600 14px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ice-dim); }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tab:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: 6px; }
[role="tabpanel"][hidden] { display: none; }
.cl-tag { font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: #1b1303; background: var(--gold); border-radius: 99px; padding: 2px 9px; vertical-align: middle; margin-left: 6px; }
#panel-log h3 { margin-top: 22px; color: var(--gold); }
#panel-log li { font-size: 15px; }
@media (max-width: 600px) { .tabs { margin-right: 46px; } .tab { padding: 8px 8px; font-size: 13px; letter-spacing: .08em; } }
.modal-inner { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.modal-inner::-webkit-scrollbar { width: 8px; }
.modal-inner::-webkit-scrollbar-track { background: transparent; }
.modal-inner::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* fixed-size modal: the tabs stay put and only the active panel scrolls */
.modal { height: min(720px, 92vh); max-height: none; overflow: hidden; }
.modal-inner { display: flex; flex-direction: column; height: 100%; max-height: none; overflow: hidden; }
.modal-inner .tabs { flex: none; }
.modal-inner [role="tabpanel"] { flex: 1; min-height: 0; overflow-y: auto; padding-right: 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.modal-inner [role="tabpanel"]::-webkit-scrollbar { width: 8px; }
.modal-inner [role="tabpanel"]::-webkit-scrollbar-track { background: transparent; }
.modal-inner [role="tabpanel"]::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* painted scene in Concept */
.scene { margin: 22px 0 6px; }
.scene img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.scene figcaption { margin-top: 8px; font-size: 14px; font-style: italic; color: var(--ice-dim); text-align: center; }
@media print { .scene { break-inside: avoid; } .scene img { box-shadow: none; } }

/* "new in this version" highlight: put data-new="1.x" on a section's h2 */
h2[data-new]::after {
  content: "New in v" attr(data-new);
  display: inline-block; margin-left: 14px; vertical-align: middle; transform: translateY(-3px);
  font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase;
  color: #1b1303; background: var(--gold); border-radius: 99px; padding: 4px 11px;
}
.toc a .new-pill {
  margin-left: auto; align-self: center; font: 600 10px var(--body); letter-spacing: .12em; text-transform: uppercase;
  color: #1b1303; background: var(--gold); border-radius: 99px; padding: 2px 7px;
}

/* tables whose long text sits in the second column: wrap it, no sideways scroll */
.tablewrap table.wrapall { min-width: 0; }
table.wrapall td:nth-child(2) { white-space: normal; }
table.wrapall td:first-child, table.wrapall td.cost { white-space: nowrap; }

/* Miniatures button in the left menu and the Miniatures window */
.side-mini {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 16px 10px; min-height: 36px;
  border-radius: 8px; border: 1px solid var(--ice); background: rgba(196,239,207,.08); color: var(--ice); cursor: pointer;
  font: 600 13px var(--head); letter-spacing: .12em; text-transform: uppercase;
}
.side-mini:hover { background: rgba(196,239,207,.18); color: #fff; }
.linkbtn { background: none; border: 1px solid var(--ice); color: var(--ice); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  font: 600 13px var(--head); letter-spacing: .12em; text-transform: uppercase; }
.linkbtn:hover { background: rgba(196,239,207,.12); color: #fff; }
.modal.modal-wide { width: min(1020px, 94vw); }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 8px; }
.mini { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mini img { display: block; width: 100%; height: auto; background: #fff; }
.mini figcaption { padding: 12px 14px 14px; display: grid; gap: 2px; }
.mini figcaption strong { font: 600 20px var(--head); letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.mini figcaption span { font-size: 13px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.mini figcaption small { font-size: 14px; color: var(--ice-dim); }
.mini .soon { justify-self: start; margin-top: 8px; font: 600 11px var(--body); letter-spacing: .14em; text-transform: uppercase; font-style: normal;
  color: #1b1303; background: var(--gold); border-radius: 99px; padding: 3px 10px; }
@media (max-width: 820px) { .mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .mini-grid { grid-template-columns: 1fr; } }
@media print { .side-mini, .modal { display: none !important; } }

.team-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 4px; }
.team-head h2 { margin-top: 0; }
.team-head > div { flex: 1; min-width: 0; }
.team-logo { width: 190px; height: 190px; flex: none; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); }
@media (max-width: 700px) { .team-head { flex-direction: column; align-items: flex-start; } .team-logo { width: 150px; height: 150px; align-self: center; } }
@media print { .team-logo { filter: none; } }

.guild-head { display: flex; gap: 24px; align-items: center; margin: 0 0 14px; }
.guild-head > p { flex: 1; margin: 0; }
.guild-head > div { flex: 1; min-width: 0; }
.guild-head > div > p { margin: 0 0 12px; }
.guild-head > div > p:last-child { margin-bottom: 0; }
.guild-logo { width: 170px; height: 170px; flex: none; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); }
@media (max-width: 700px) { .guild-head { flex-direction: column; } .guild-logo { width: 140px; height: 140px; } }
@media print { .guild-logo { filter: none; } }

.guild-head { flex-direction: row-reverse; }
@media (max-width: 700px) { .guild-head { flex-direction: column; align-items: center; } }

.guild-logo { width: 250px; height: 250px; }
.guild-head { align-items: flex-start; }
@media (max-width: 700px) { .guild-logo { width: 200px; height: 200px; order: 2; } }

/* Buy me a coffee button, under Playtesting notes */
.coffee {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 16px 16px; min-height: 38px;
  border-radius: 8px; background: var(--gold); color: #0d3a1d; text-decoration: none;
  font: 600 14px var(--head); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 2px 0 #a87a12;
}
.coffee:hover { transform: translateY(-1px); background: #f6c44f; }
.sidebar-r .side-foot { border-top: 1px solid var(--line); padding-bottom: 6px; }
@media print { .coffee { display: none !important; } }

/* all menu buttons: same height, same colour, squarer corners */
.side-dl, .coffee { min-height: 36px; border-radius: 3px; background: var(--gold); color: #0d3a1d; border: 0; box-shadow: 0 2px 0 #a87a12; font-size: 13px; }
.side-dl.alt { background: var(--gold); color: #0d3a1d; border: 0; box-shadow: 0 2px 0 #a87a12; }
.side-dl.alt:hover, .side-dl:hover, .coffee:hover { background: #f6c44f; }
.side-dl { margin: 0 16px 6px; }
.coffee { margin: 4px 16px 16px; }
.side-mini { border-radius: 3px; }
.coffee { letter-spacing: .1em; }

/* Free miniatures: a round badge as button */
.mini-badge { display: block; margin: 6px auto 10px; padding: 0; border: 0; background: none; cursor: pointer; width: 132px; height: 132px; border-radius: 50%; }
.mini-badge img { display: block; width: 100%; height: 100%; transition: transform .2s; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
.mini-badge:hover img { transform: scale(1.06) rotate(-2deg); }
.mini-badge:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
@media print { .mini-badge { display: none !important; } }

.mini-badge { margin: 6px auto 30px; }

/* support window */
.modal.modal-small { width: min(520px, 92vw); height: auto; max-height: 92vh; }
.modal-small .modal-inner { height: auto; max-height: 92vh; overflow: auto; }
.support-body { text-align: center; padding-top: 6px; }
.support-logo { width: 150px; height: 150px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.support-body h2 { margin: 8px 0 12px; }
.support-body p { text-align: left; }
.support-note { font-size: 13px; color: var(--ice-dim); margin: 14px 0 4px; }
@media print { #support, #group { display: none !important; } }

.modal.modal-small { height: fit-content !important; }
.modal-small .modal-inner { height: auto !important; max-height: 92vh; }

.support-cta { text-align: center !important; margin: 20px 0 12px; }
.support-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 28px; border-radius: 3px;
  background: var(--gold); color: #0d3a1d; text-decoration: none; font: 600 15px var(--head); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 3px 0 #a87a12; }
.support-btn:hover { background: #f6c44f; transform: translateY(-1px); }

/* Curios cards without an image yet */
.mini .mini-ph { aspect-ratio: 3 / 4; }
.mini-ph { display: grid; place-items: center; aspect-ratio: 3 / 2; margin: 10px; border: 1px dashed var(--line); border-radius: 8px;
  font: 600 13px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--ice-dim); background: rgba(255,255,255,.02); }
.linkbtn.linkbtn-inline { display: inline; padding: 1px 8px; font-size: 12px; }

/* a window without tabs: start the scrolling area below the close button, so the X never covers the scrollbar */
.modal-inner > .modal-close + [role="tabpanel"] { margin-top: 44px; }

/* Disclaimer window (what used to be the page footer) */
.disc-body { text-align: center; padding-top: 34px; }
.disc-body h2 { margin: 0 0 14px; }
.disc-body p { margin: 8px 0; color: var(--ice-dim); font-size: 15px; }
.disc-body p strong { color: #fff; }
.sidebar-r .visits { margin: -6px 16px 16px; text-align: center; }
.disc-body .disc-legal { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.disc-body .disc-legal p { font-size: 16px; line-height: 1.55; margin: 12px 0; }
.modal.modal-small#disclaimer { width: min(700px, 94vw); }
.print-footer { display: none; }
@media print { .print-footer { display: block; margin-top: 8mm; padding-top: 4mm; border-top: 1px solid #999; font-size: 8.5pt; text-align: center; } .print-footer p { margin: 2px 0; } #disclaimer { display: none !important; } }

/* empty space after the last section, so the page can scroll far enough for the last menu entries to be selected */
.end-spacer { height: 75vh; }
@media print { .end-spacer { display: none !important; } }

/* coach's board animation: generated by tools/make_board_animation.py; one 18s loop */
.mv { animation-duration: 18s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; animation-fill-mode: both; }
@keyframes mv-s {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  4% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  5.5% { transform: translate(33.75px, -41.56px); opacity: 1; animation-timing-function: linear; }
  7% { transform: translate(67.50px, -71.25px); opacity: 1; animation-timing-function: linear; }
  8.5% { transform: translate(101.25px, -89.06px); opacity: 1; animation-timing-function: linear; }
  10% { transform: translate(135.00px, -95.00px); opacity: 1; animation-timing-function: linear; }
  11.5% { transform: translate(168.75px, -89.06px); opacity: 1; animation-timing-function: linear; }
  13% { transform: translate(202.50px, -71.25px); opacity: 1; animation-timing-function: linear; }
  14.5% { transform: translate(236.25px, -41.56px); opacity: 1; animation-timing-function: linear; }
  16% { transform: translate(270.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  22% { transform: translate(270.00px, 0.00px); opacity: 1; }
  24% { transform: translate(405.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  29% { transform: translate(405.00px, 0.00px); opacity: 1; }
  31% { transform: translate(495.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  36% { transform: translate(495.00px, 0.00px); opacity: 1; }
  38% { transform: translate(630.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  43% { transform: translate(630.00px, 0.00px); opacity: 1; }
  45% { transform: translate(765.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  50% { transform: translate(765.00px, 0.00px); opacity: 1; }
  52% { transform: translate(900.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  57% { transform: translate(900.00px, 0.00px); opacity: 1; }
  59% { transform: translate(1035.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  64% { transform: translate(1035.00px, 0.00px); opacity: 1; }
  66% { transform: translate(1125.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(1125.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(1125.00px, 0.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-s { animation-name: mv-s; }
@keyframes mv-w1 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  8% { transform: translate(0.00px, 0.00px); opacity: 1; }
  20% { transform: translate(225.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  24% { transform: translate(225.00px, 45.00px); opacity: 1; }
  27% { transform: translate(360.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  31% { transform: translate(360.00px, 45.00px); opacity: 1; }
  34% { transform: translate(450.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  38% { transform: translate(450.00px, 45.00px); opacity: 1; }
  41% { transform: translate(585.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  45% { transform: translate(585.00px, 45.00px); opacity: 1; }
  48% { transform: translate(720.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  52% { transform: translate(720.00px, 45.00px); opacity: 1; }
  55% { transform: translate(855.00px, 45.00px); opacity: 1; }
  56% { transform: translate(828.00px, 45.00px); opacity: 1; }
  58% { transform: translate(855.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  59% { transform: translate(855.00px, 45.00px); opacity: 1; }
  62% { transform: translate(990.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  66% { transform: translate(990.00px, 45.00px); opacity: 1; }
  69% { transform: translate(1080.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(1080.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(1080.00px, 45.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-w1 { animation-name: mv-w1; }
@keyframes mv-w2 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  8% { transform: translate(0.00px, 0.00px); opacity: 1; }
  20% { transform: translate(225.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  24% { transform: translate(225.00px, 0.00px); opacity: 1; }
  27% { transform: translate(360.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  31% { transform: translate(360.00px, 0.00px); opacity: 1; }
  34% { transform: translate(450.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  38% { transform: translate(450.00px, 0.00px); opacity: 1; }
  41% { transform: translate(585.00px, 0.00px); opacity: 1; }
  42% { transform: translate(562.50px, 0.00px); opacity: 1; }
  44.5% { transform: translate(585.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  45% { transform: translate(585.00px, 0.00px); opacity: 1; }
  48% { transform: translate(720.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  52% { transform: translate(720.00px, 0.00px); opacity: 1; }
  55% { transform: translate(855.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  59% { transform: translate(855.00px, 0.00px); opacity: 1; }
  62% { transform: translate(990.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  66% { transform: translate(990.00px, 0.00px); opacity: 1; }
  69% { transform: translate(1080.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(1080.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(1080.00px, 0.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-w2 { animation-name: mv-w2; }
@keyframes mv-g {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  29% { transform: translate(0.00px, 0.00px); opacity: 1; }
  31% { transform: translate(45.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  43% { transform: translate(45.00px, 0.00px); opacity: 1; }
  45% { transform: translate(90.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  57% { transform: translate(90.00px, 0.00px); opacity: 1; }
  59% { transform: translate(135.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(135.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(135.00px, 0.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-g { animation-name: mv-g; }
@keyframes mv-d1 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  29% { transform: translate(0.00px, 0.00px); opacity: 1; }
  31% { transform: translate(45.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  43% { transform: translate(45.00px, 0.00px); opacity: 1; }
  45% { transform: translate(90.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  57% { transform: translate(90.00px, 0.00px); opacity: 1; }
  59% { transform: translate(135.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(135.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(135.00px, 0.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-d1 { animation-name: mv-d1; }
@keyframes mv-d2 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  30% { transform: translate(0.00px, 0.00px); opacity: 1; }
  40% { transform: translate(-225.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  42% { transform: translate(-225.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  44% { transform: translate(-225.00px, 0.00px); opacity: 0.35; animation-timing-function: linear; }
  93% { transform: translate(-225.00px, 0.00px); opacity: 0.35; animation-timing-function: linear; }
  96% { transform: translate(-225.00px, 0.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-d2 { animation-name: mv-d2; }
@keyframes mv-d3 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  50% { transform: translate(0.00px, 0.00px); opacity: 1; }
  54% { transform: translate(-90.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(-90.00px, 45.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(-90.00px, 45.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-d3 { animation-name: mv-d3; }
@keyframes mv-d4 {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  55% { transform: translate(0.00px, 0.00px); opacity: 1; }
  58% { transform: translate(45.00px, -45.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(45.00px, -45.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(45.00px, -45.00px); opacity: 0; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-d4 { animation-name: mv-d4; }
@keyframes mv-c {
  0% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  93% { transform: translate(0.00px, 0.00px); opacity: 1; animation-timing-function: linear; }
  96% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  96.1% { transform: translate(0.00px, 0.00px); opacity: 0; animation-timing-function: linear; }
  100% { transform: translate(0.00px, 0.00px); opacity: 1; }
}
.mv-c { animation-name: mv-c; }
@keyframes mv-pulse { 0%, 65% { opacity: 0; transform: scale(1); } 66% { opacity: 1; transform: scale(1); } 72% { opacity: 0; transform: scale(2.1); } 100% { opacity: 0; transform: scale(1); } }
.pulse { transform-box: fill-box; transform-origin: center; opacity: 0; animation: mv-pulse 18s infinite both; }
@media (prefers-reduced-motion: reduce) { .mv, .pulse { animation: none !important; } }

/* END board animation */

/* ---------- team builder ---------- */
.modal.modal-xl { width: min(1180px, 96vw); height: min(860px, 94vh); max-height: none; overflow: hidden; }
.modal-xl .modal-inner { height: 100%; max-height: none; overflow: hidden; display: flex; flex-direction: column; padding: 22px 26px 18px; }
.bld-root { flex: 1; min-height: 0; overflow-y: auto; margin-top: 36px; padding-right: 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.bld-head h2 { margin: 0 0 6px; font-size: clamp(30px, 4vw, 40px); }
.bld-lead { color: var(--ice-dim); font-size: 15px; margin: 0 0 14px; max-width: 70ch; }
.bld-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.bld-left h3 { margin: 22px 0 8px; font-size: 18px; }
.bld-left h3:first-of-type { margin-top: 14px; }
.bld-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bld-settings .bld-check { grid-column: 1 / -1; }
.bld-root input[type=text], .bld-root input[type=number], .bld-root input[type=search], .bld-root select {
  width: 100%; min-height: 38px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: #fff; padding: 0 10px; font: inherit; font-size: 14px; }
.bld-root select option, .bld-root select optgroup { background: #0f2a1a; color: #fff; }
.bld-root input[type=search]::placeholder { color: var(--ice-dim); opacity: .8; }
.bld-root input:focus, .bld-root select:focus { outline: 2px solid var(--ice); outline-offset: 1px; }
.bld-row { display: grid; grid-template-columns: 26px 1fr 34px; gap: 4px 8px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bld-num { font: 700 20px var(--head); color: var(--gold); padding-top: 4px; }
.bld-sel { display: grid; grid-template-columns: 1fr 1.4fr .8fr; gap: 6px; }
.bld-x { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.bld-x:hover { background: var(--blood); }
.bld-info { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; color: var(--ice-dim); min-height: 0; }
.bld-stats { font: 600 13px var(--head); letter-spacing: .06em; color: var(--bone); }
.bld-skills { flex-basis: 100%; }
.chip { font: 600 11px var(--body); letter-spacing: .08em; text-transform: uppercase; border-radius: 99px; padding: 2px 8px; background: var(--panel-2); color: var(--ice); border: 1px solid var(--line); }
.chip-rs { background: var(--gold); color: #1b1303; border-color: var(--gold); }
.chip-ttm { background: var(--blood); color: #fff; border-color: var(--blood); }
.chip-nb { background: #444; color: #fff; }
#bld-add { margin-top: 12px; }
#bld-add:disabled { opacity: .4; cursor: not-allowed; }
.bld-rr { display: grid; grid-template-columns: 80px auto 1fr; gap: 10px; align-items: center; }
.bld-note { font-size: 13px; color: var(--ice-dim); margin: 6px 0 0; }
.bld-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bld-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.bld-check.off { opacity: .45; cursor: not-allowed; }
.bld-check em { font-style: normal; color: var(--gold); font-weight: 600; }
.bld-right { position: sticky; top: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.bld-status { font: 700 22px var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; background: var(--panel-2); }
.bld-status.ok { background: #1c5a30; color: #bff2cc; }
.bld-status.bad { background: #5a1c14; color: #ffc9c0; }
.bld-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bld-line b { color: #fff; font-variant-numeric: tabular-nums; }
.bld-line.bld-total b { color: var(--gold); font-size: 17px; }
.bld-line.over b, .bld-line.over span { color: #ff9a8a; }
.bld-ck { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 6px; }
.bld-ck li { position: relative; padding-left: 24px; font-size: 13.5px; line-height: 1.4; margin: 0; }
.bld-ck li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.ck-ok::before { content: "✓"; color: #6fe0a1; }
.ck-bad::before { content: "✕"; color: #ff7a68; }
.ck-bad { color: #ffd2cb; }
.ck-info::before { content: "i"; color: var(--gold); font-style: italic; }
.ck-info { color: var(--ice-dim); }
.bld-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 860px) {
  .bld-grid { grid-template-columns: 1fr; }
  .bld-right { position: static; }
  .bld-sel { grid-template-columns: 1fr; }
  .bld-settings { grid-template-columns: 1fr; }
  .bld-rr { grid-template-columns: 70px 1fr; }
  .bld-rr select { grid-column: 1 / -1; }
}
@media print { #builder { display: none !important; } .side-mini { display: none !important; } }

/* team builder: printable team sheet */
#bld-sheet { display: none; }
@media print {
  body.bld-printing > *:not(#bld-sheet) { display: none !important; }
  body.bld-printing { background: #fff !important; color: #000 !important; }
  body.bld-printing #bld-sheet { display: block; font-family: Arial, sans-serif; color: #000; }
  #bld-sheet h1 { font-size: 22pt; margin: 0 0 2mm; }
  #bld-sheet .sh-sub { margin: 0 0 6mm; font-size: 10pt; text-transform: uppercase; letter-spacing: .08em; }
  #bld-sheet .sh-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  #bld-sheet .sh-table th, #bld-sheet .sh-table td { border: 1px solid #555; padding: 2.5mm 2mm; text-align: left; vertical-align: top; }
  #bld-sheet .sh-table th { background: #e4efe4; }
  #bld-sheet .sh-tot { list-style: none; margin: 6mm 0 0 auto; padding: 0; width: 100mm; font-size: 10pt; }
  #bld-sheet .sh-tot li { display: flex; justify-content: space-between; gap: 6mm; border-bottom: 1px solid #bbb; padding: 1.5mm 0; }
  #bld-sheet .sh-warn { margin-top: 6mm; font-size: 9pt; color: #a00; }
  #bld-sheet .sh-foot { margin-top: 12mm; font-size: 8pt; color: #555; text-align: center; }
}

/* team builder: search, saved teams, nicer sheet */
.bld-left input[type=search] { box-sizing: border-box; margin: 0 0 6px; -webkit-appearance: none; appearance: none; }
.bld-found { display: grid; gap: 4px; margin-bottom: 10px; }
.bld-hit { text-align: left; font: inherit; font-size: .88rem; color: inherit; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 6px 9px; cursor: pointer; }
.bld-hit:hover, .bld-hit:focus-visible { border-color: #f2b632; }
.bld-save { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.bld-save select { flex: 1 1 130px; min-width: 0; }
@media print {
  #bld-sheet .sh-head { display: flex; align-items: center; gap: 6mm; border-bottom: 3px solid #1d5a2c; padding-bottom: 3mm; margin-bottom: 5mm; }
  #bld-sheet .sh-head img { width: 22mm; height: auto; }
  #bld-sheet h1 { color: #1d5a2c; margin: 0; }
  #bld-sheet .sh-sub { margin: 1mm 0 0; }
  #bld-sheet .sh-table th { background: #1d5a2c; color: #fff; }
  #bld-sheet .sh-table tbody tr:nth-child(even) td { background: #f1f6f1; }
  #bld-sheet .sh-notes { margin-top: 8mm; border: 1px solid #555; min-height: 55mm; padding: 2mm 3mm; font-size: 9pt; }
}

table.wrapall td.st { white-space: nowrap; }
table.offer td:nth-child(2) { white-space: nowrap; padding-right: 22px; }

/* team builder: the drop-down lists get the themed scrollbar too */
.bld-root select { scrollbar-width: thin; scrollbar-color: var(--line) #0f2a1a; color-scheme: dark; }
.bld-root select::-webkit-scrollbar { width: 10px; }
.bld-root select::-webkit-scrollbar-track { background: #0f2a1a; }
.bld-root select::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid #0f2a1a; }
.bld-root select::-webkit-scrollbar-thumb:hover { background: var(--ice-dim); }
