/* The Mega Dimension handbook (handbook.html): the reference half of the field guide.
   Built on wot.css (paper & purple) and md/md.css (the rift HUD); every class here is hb-.
   The page is generated by Game Guide/handbook/build_handbook.py from the game's source. */

.hb { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; max-width: 1200px; margin: 0 auto; padding: 8px 40px 120px; align-items: start; }

/* Also loaded by the after-release guide.html (a new file, so nothing cached stands in for it):
   the switch between the guide's two halves, and the Mega Dimension chapter's pins. */
.ff-guideswitch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ff-guideswitch .ff-tab { display: inline-flex; align-items: center; }
.ff-guideswitch .ff-tab[aria-current="page"] { background: var(--violet); color: var(--white); }
.ff-mapfig.is-md .ff-pin { background: var(--ink); color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 3px 3px 0 2px var(--violet); }

/* contents, pinned beside the text on wide screens */
.hb-toc { --n: var(--notch-md); position: sticky; top: 20px; padding: 20px 20px 22px; background: var(--night); color: var(--on-night); max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
.hb-toc h2 { margin: 0 0 12px; font: 400 14px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hb-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.hb-toc li { counter-increment: toc; }
.hb-toc a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; font-size: 14.5px; line-height: 19px; font-weight: 600; color: var(--on-night-soft); transition: background-color .15s ease, color .15s ease; }
.hb-toc a::before { content: counter(toc, decimal-leading-zero); flex: none; font: 8px/19px var(--font-pixel); color: var(--violet-glow); }
.hb-toc a:hover, .hb-toc a[aria-current="true"] { background: var(--night-raised); color: var(--on-night); }
.hb-toc .hb-toc-spoil { font-weight: 500; font-style: italic; }

/* sections */
.hb-body { min-width: 0; display: flex; flex-direction: column; gap: 72px; }
.hb-sec { scroll-margin-top: 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hb-sec > header { display: flex; flex-direction: column; gap: 12px; }
.hb-sec h2 { font-size: clamp(40px, 4.4vw, 64px); }
.hb-sec h3 { margin: 14px 0 0; font: 400 26px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.hb-sec p, .hb-sec li { font-size: 17px; line-height: 27px; color: var(--ink-soft); text-wrap: pretty; }
.hb-sec p { margin: 0; max-width: 70ch; }
.hb-sec ul, .hb-sec ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 72ch; }
.hb-sec b, .hb-sec strong { color: var(--ink); }
.hb-sec a:not(.ff-btn) { color: var(--ink); box-shadow: inset 0 -2px 0 var(--violet); transition: box-shadow .15s ease; }
.hb-sec a:not(.ff-btn):hover { box-shadow: inset 0 -1.2em 0 color-mix(in srgb, var(--violet) 22%, transparent); }
.hb-k { font-family: var(--font-pixel); font-size: .72em; letter-spacing: 0; padding: 3px 5px 2px; background: var(--night); color: var(--on-night); white-space: nowrap; }

/* the "at a glance" strip */
.hb-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.hb-facts > div { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--paper-card); }
.hb-facts b { font: 400 34px/1 var(--font-display); color: var(--violet); }
.hb-facts span { font-size: 14px; line-height: 19px; color: var(--ink-soft); }

/* numbered steps */
.hb-steps { counter-reset: st; list-style: none; padding: 0 !important; gap: 12px !important; }
.hb-steps > li { counter-increment: st; position: relative; padding: 14px 18px 14px 64px; background: var(--paper-card); box-shadow: var(--shadow-hard); }
.hb-steps > li::before { content: counter(st); position: absolute; left: 18px; top: 12px; font: 400 32px/1 var(--font-display); color: var(--violet); }

/* tables */
.hb-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 2px solid var(--ink); background: var(--paper-card); box-shadow: 8px 8px 0 var(--violet); }
.hb-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 21px; }
.hb-table th { position: sticky; top: 0; padding: 11px 14px 10px; background: var(--ink); color: var(--on-night); text-align: left; font: 400 13px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.hb-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.hb-table td:first-child { color: var(--ink); font-weight: 700; white-space: nowrap; }
.hb-table tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 55%, var(--paper-card)); }
.hb-table .hb-num { font-family: var(--font-pixel); font-size: 10px; white-space: nowrap; }
.hb-table img.hb-icon { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; margin: -6px 8px -6px -4px; }
.hb-tag { display: inline-block; margin: 0 4px 2px 0; padding: 2px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--night); color: var(--on-night); }
.hb-tag--gold { background: var(--gold); color: var(--ink); }
.hb-tag--violet { background: var(--violet); color: var(--white); }

/* callouts */
.hb-note { --n: var(--notch-sm); display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--night); color: var(--on-night-soft); font-size: 15.5px; line-height: 24px; max-width: 76ch; }
.hb-note b { color: var(--gold); }
.hb-note .md-hud { position: static; flex: none; font-size: 12px; padding: 8px 9px 6px; }
.hb-sec .hb-note p { color: var(--on-night-soft); font-size: 15.5px; line-height: 24px; }

/* two-up cards */
.hb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hb-card { --n: var(--notch-md); display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; background: var(--paper-card); box-shadow: var(--shadow-hard); min-width: 0; }
.hb-card h3 { margin: 0; }
.hb-card p, .hb-card li { font-size: 15.5px; line-height: 24px; }
.hb-card .hb-who { display: flex; align-items: center; gap: 12px; }
.hb-card .hb-who img { width: 64px; height: 64px; image-rendering: pixelated; }

/* spoilers: closed until asked for */
.hb-spoiler { border: 2px dashed color-mix(in srgb, var(--violet) 60%, transparent); background: color-mix(in srgb, var(--violet) 6%, var(--paper-card)); }
.hb-spoiler > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; font: 400 18px/1.1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
.hb-spoiler > summary::-webkit-details-marker { display: none; }
.hb-spoiler > summary::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; flex: none; background: var(--violet); color: var(--white); font: 12px/1 var(--font-pixel); }
.hb-spoiler[open] > summary::before { content: "−"; }
.hb-spoiler > summary small { margin-left: auto; font: 600 12px/1 var(--font-sans); letter-spacing: .12em; color: var(--ink-faint); }
.hb-spoiler > .hb-spoiler-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 18px 20px; }

.hb-updated { margin: 0; font-size: 13px; color: var(--ink-faint); }

@media (max-width: 980px) {
  .hb { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 0 18px 90px; }
  .hb-toc { position: static; max-height: none; }
  .hb-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .hb-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hb-toc ol { grid-template-columns: minmax(0, 1fr); }
  .hb-grid { grid-template-columns: minmax(0, 1fr); }
  .hb-sec p, .hb-sec li { font-size: 16px; line-height: 25px; }
  .hb-tablewrap { box-shadow: 5px 5px 0 var(--violet); }
  .hb-steps > li { padding-left: 52px; }
}
