/* The visual editor (public/cc/lib/visual/editor.js): tokens only (/ds/tokens.css), red only where the command centre
   uses it. The document reads like the page, the boxes like the site's boxes, the solid parts look solid. */

.vx { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--field); }
.vx:focus-within { border-color: var(--focus); }

/* ---------- the toolbar ---------- */
.vx-tools { position: sticky; top: var(--pb-h, 0px); z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 0 0; background: var(--panel); }
.vx-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text); font: 700 var(--fs-sm)/1 var(--font); cursor: pointer; }
.vx-b:hover:not(:disabled) { background: var(--panel-2); }
.vx-b[aria-pressed="true"] { border-color: var(--line-strong); background: var(--panel-2); }
.vx-b:disabled { color: var(--muted); opacity: .55; cursor: default; }
.vx-b:focus-visible, .vx-sel:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-sel { height: 36px; min-width: 128px; padding: 0 28px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--field); color: var(--text); font: 700 var(--fs-sm) var(--font); }
.vx-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.vx-gap { flex: 1 1 auto; }
.vx-count { padding: 0 6px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.vx-md-b[aria-pressed="true"] { border-color: var(--info); color: var(--info); }
.vx-ttools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.vx-ttools[hidden] { display: none; }
.vx-ttools-l { margin-right: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- the document ---------- */
.vx-surface[hidden], .vx-md[hidden] { display: none; }
.vx-doc { min-height: 480px; padding: 18px 22px 28px; outline: none; color: var(--text); font: 500 15px/1.65 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.vx-doc :where(p, h2, h3, h4, ul, ol, blockquote, table, figure) { margin: 0; }
.vx-doc > * + *, .vx-box-in > * + * { margin-top: 12px; }
.vx-doc > * + :where(h2, h3, h4), .vx-box-in > * + :where(h2, h3, h4) { margin-top: 24px; }
.vx-doc :where(h2, h3, h4) { line-height: 1.3; font-weight: 800; }
.vx-doc h2 { font-size: 22px; }
.vx-doc h3 { font-size: 18px; }
.vx-doc h4 { font-size: 16px; }
.vx-hid { margin-left: 10px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--muted); font: 600 12px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; vertical-align: middle; user-select: none; }
.vx-hid[hidden] { display: none; }
.vx-doc ul, .vx-doc ol { margin: 0; padding-left: 26px; }
.vx-doc ul { list-style: disc outside; }
.vx-doc ol { list-style: decimal outside; }
.vx-doc li { display: list-item; }
.vx-doc li::marker { color: var(--muted); font-weight: 700; }
.vx-doc li + li { margin-top: 4px; }
.vx-doc li > ul, .vx-doc li > ol { margin-top: 4px; }
.vx-doc strong { font-weight: 800; }
.vx-doc code { padding: 0 4px; border-radius: 4px; background: var(--panel-2); font: 500 .92em ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.vx-doc a, .vx-a { color: var(--info); text-decoration: underline; text-underline-offset: 2px; cursor: text; }
.vx-a--help::after { content: " ↗"; font-size: .85em; }
.vx-doc blockquote { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line-strong); font-size: 17px; font-weight: 700; }
.vx-empty::before { content: attr(data-placeholder); position: absolute; color: var(--muted); pointer-events: none; }
.vx-doc .ProseMirror-selectednode { outline: 2px solid var(--info); outline-offset: 2px; }

/* Tables: the head row bold, every cell a field to type in. */
.vx-doc table { width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; }
.vx-doc th, .vx-doc td { position: relative; min-width: 60px; padding: 7px 10px; border: 1px solid var(--line-strong); vertical-align: top; text-align: left; }
.vx-doc th { background: var(--panel-2); font-weight: 800; }
.vx-doc .selectedCell::after { content: ""; position: absolute; inset: 0; background: rgba(127, 178, 255, .18); pointer-events: none; }
.vx-doc .tableWrapper { overflow-x: auto; }

/* The site's boxes: a frame with a label, the text inside editable. */
.vx-box { padding: 0 0 12px; border: 1px solid var(--line-strong); border-left: 4px solid var(--muted); border-radius: var(--r-md); background: var(--panel); }
.vx-box-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; user-select: none; white-space: normal; }
.vx-box-l { white-space: nowrap; }
.vx-box-arg { flex: 1 1 140px; min-width: 0; max-width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--field); color: var(--text); font: 600 var(--fs-sm) var(--font); text-transform: none; letter-spacing: 0; }
.vx-box-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.vx-box-x:hover { background: var(--panel-2); color: var(--text); }
.vx-box-x[hidden] { display: none; }
.vx-box-in { padding: 10px 14px 0; }
.vx-box--summary { border-left-color: var(--success); }
.vx-box--tip { border-left-color: var(--success); }
.vx-box--note, .vx-box--example, .vx-box--calculator, .vx-box--figure { border-left-color: var(--info); }
.vx-box--warning { border-left-color: var(--warning); }
.vx-box--rg { border-left-color: var(--c5); }
.vx-box--steps .vx-box-in ol, .vx-box--steps .vx-box-in ul { padding-left: 24px; }
.vx-box--faq .vx-box-in h3 { font-size: 16px; }
.vx-box--faq .vx-box-in > * + h3 { margin-top: 18px; }
.vx-box--faq .vx-box-in > h3 + * { margin-top: 4px; }

/* Solid parts: a picture with its alt text, [[facts]], notes for writers, Markdown kept as it is. */
.vx-pic { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 14px; align-items: start; margin: 0; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); white-space: normal; }
.vx-pic.is-selected { outline: 2px solid var(--info); outline-offset: 2px; }
.vx-pic-img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; border-radius: var(--r-sm); background: var(--field); }
.vx-pic-bar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vx-pic-alt { width: 100%; }
.vx-pic-err { margin: 0; color: var(--warning); font-size: var(--fs-sm); font-weight: 700; }
.vx-pic-err[hidden] { display: none; }
.vx-pic-act { display: flex; flex-wrap: wrap; gap: 4px; }
.vx-pic-act [hidden] { display: none; }
.vx-solid { padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--panel); white-space: normal; user-select: none; }
.vx-solid.is-selected { outline: 2px solid var(--info); outline-offset: 2px; }
.vx-solid-h { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.vx-solid-t { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.vx-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; font-size: var(--fs-sm); }
.vx-facts dt { color: var(--muted); font-weight: 700; }
.vx-facts dt, .vx-facts dd { overflow-wrap: break-word; word-break: normal; }
.vx-facts dd { margin: 0; }
.vx-raw-t { margin: 8px 0 0; padding: 8px 10px; overflow-x: auto; border-radius: var(--r-sm); background: var(--field); font: 500 13px/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace; white-space: pre-wrap; }

/* Inline solid parts: a fact to confirm, a game fact with its current value. */
.vx-tc { display: inline; padding: 1px 5px; border: 1px solid var(--warning); border-radius: var(--r-sm); color: var(--text); white-space: normal; }
.vx-tc-l { margin-right: 2px; color: var(--warning); font-size: .78em; font-weight: 800; letter-spacing: .03em; }
.vx-field { display: inline; padding: 1px 6px; border-radius: var(--r-pill); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-weight: 700; white-space: nowrap; }
.vx-field.is-empty { color: var(--warning); }

/* The Markdown view. */
.vx-md { display: block; width: 100%; min-height: 480px; padding: 14px 16px; border: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: var(--field); font: 500 14px/1.65 ui-monospace, 'Cascadia Mono', Consolas, monospace; resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere; }

.vx.is-ro .vx-doc { color: var(--text); }

@media (max-width: 719.98px) {
  .vx-tools { padding: 4px; }
  .vx-sel { min-width: 0; max-width: 128px; }
  .vx-b--text span { display: none; }
  .vx-doc { min-height: 380px; padding: 14px 14px 22px; font-size: 15px; }
  .vx-pic { grid-template-columns: minmax(0, 1fr); }
  .vx-md { min-height: 380px; font-size: 13px; }
}
