/* Canvas Temple Digital Interface Standard 1.1.0 — built 2026-11-03. Do not edit: change CTP_Interface_Standard/css/ and run tools/build.sh. */
/* ==========================================================================
   Canvas Temple Digital Interface Standard 1.1 — tokens
   --------------------------------------------------------------------------
   Layer 1: publisher constants (--ctp-pub-*) — never change per game.
   Layer 2: semantic roles (--ctp-*) — set by a family in 20-families.css and
            optionally tuned by a game's own ctp-theme.css.
   Games should read ONLY the semantic roles, never the raw publisher palette,
   so a family or game can retune without hunting through rules.
   ========================================================================== */

@font-face { font-family: "CTP Display"; src: url("fonts/ctp-display-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Display"; src: url("fonts/ctp-display-700.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Display"; src: url("fonts/ctp-display-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CTP Text"; src: url("fonts/ctp-text-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Text"; src: url("fonts/ctp-text-700.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Text"; src: url("fonts/ctp-text-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CTP Data"; src: url("fonts/ctp-data-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Data"; src: url("fonts/ctp-data-700.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "CTP Mono"; src: url("fonts/ctp-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ctp-standard-version: "1.1.0";

  /* ---- Publisher palette (constants) ----------------------------------
     1.1: values from the CTP Digital Games Design Directive (section 4).
     Directive names map to these: --ctp-ink -> --ctp-pub-navy,
     --ctp-parchment -> --ctp-pub-parchment, --ctp-paper -> --ctp-pub-paper,
     --ctp-oxblood -> --ctp-pub-oxblood, --ctp-brass -> --ctp-pub-brass,
     --ctp-field -> --ctp-pub-field, --ctp-slate -> --ctp-pub-slate,
     --ctp-warning -> --ctp-pub-warning, --ctp-brand-* -> --ctp-pub-brand-*. */
  --ctp-pub-ink:        #1c1f24;  /* printer's black, slightly warm        */
  --ctp-pub-paper:      #fcf7eb;  /* paper / ivory: readable text surfaces  */
  --ctp-pub-ivory:      var(--ctp-pub-paper);   /* 1.0 name, kept           */
  --ctp-pub-parchment:  #f1e6ce;  /* main parchment: major content surfaces */
  --ctp-pub-linen:      #d9cba8;  /* sunk paper / table                     */
  --ctp-pub-navy:       #10283a;  /* masthead ink: header, deep panels      */
  --ctp-pub-oxblood:    #742b30;  /* selected navigation, key actions       */
  --ctp-pub-burgundy:   var(--ctp-pub-oxblood); /* 1.0 name, kept           */
  --ctp-pub-brass:      #b08b4a;  /* antique brass: rules and insets only; under 3:1 on paper, never text */
  --ctp-pub-field:      #51654d;  /* field green: positive status           */
  --ctp-pub-slate:      #64727c;  /* muted slate; under 4.5:1 on parchment, so muted text uses a darker step */
  --ctp-pub-warning:    #a63c39;  /* rejected moves and errors              */
  --ctp-pub-brand-cyan:   #43cde3;  /* sampled from brand/ctp_logo.png; brand-adjacent accent and focus on dark plates */
  --ctp-pub-brand-violet: #6a57ad;  /* sampled from brand/ctp_logo.png; rare decoration only, 2.6:1 on navy */
  --ctp-pub-charcoal:   #2b2e33;
  --ctp-pub-gray:       #8a857a;  /* warm gray                              */

  /* ---- Type families --------------------------------------------------- */
  --ctp-font-display: "CTP Display", "EB Garamond", Garamond, "Linux Libertine O", Georgia, serif;
  --ctp-font-text:    "CTP Text", "Source Sans 3", "Source Sans Pro", "Segoe UI", Arial, sans-serif;
  --ctp-font-data:    "CTP Data", "Fira Sans Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --ctp-font-mono:    "CTP Mono", "Noto Sans Mono", "DejaVu Sans Mono", Consolas, monospace;
  /* Titles and editorial headers (directive: Cinzel or an available equivalent).
     No Cinzel file is bundled, so it is EB Garamond until one is approved.   */
  --ctp-font-title:   var(--ctp-font-display);

  /* ---- Type scale (rem-free so games with odd root sizes are safe) ---- */
  --ctp-fs-xs: 11px;    /* folio, captions, map labels                     */
  --ctp-fs-s:  12.5px;  /* tables, logs, dense panels                      */
  --ctp-fs-m:  14px;    /* body / controls                                 */
  --ctp-fs-l:  17px;    /* panel titles                                    */
  --ctp-fs-xl: 22px;    /* game title in masthead                          */
  --ctp-fs-xxl: 34px;   /* title screens, outcome banners                  */
  --ctp-tracking-caps: .12em;   /* letter-spacing for small caps headings  */

  /* ---- Spacing (4px grid with a 2px half-step for dense data) ---------- */
  --ctp-sp-0: 2px; --ctp-sp-1: 4px; --ctp-sp-2: 8px; --ctp-sp-3: 12px;
  --ctp-sp-4: 16px; --ctp-sp-5: 24px; --ctp-sp-6: 32px;

  /* ---- Layout measurements -------------------------------------------- */
  --ctp-masthead-h: 44px;    /* max masthead height — the map comes first   */
  --ctp-control-h: 28px;     /* standard control height; 24px in .ctp-dense */
  --ctp-inspector-w: 340px;  /* right-hand dossier / inspector column       */
  --ctp-radius: 2px;         /* printed parts are cut, not pill-shaped      */
  --ctp-radius-tab: 5px;     /* folder tabs only                            */
  --ctp-logo-h: 44px;        /* the logo in a portal masthead plate; PUBLISHING stays legible */
  --ctp-logo-h-shell: 30px;  /* the logo in a game shell masthead            */
  --ctp-masthead-plate-h: 60px;  /* a portal masthead plate holds the full logo; game shells keep 44px */

  /* ---- Motion ---------------------------------------------------------- */
  --ctp-dur-fast: 90ms;
  --ctp-dur: 160ms;
  --ctp-ease: cubic-bezier(.2, .6, .2, 1);

  /* ---- Layers ---------------------------------------------------------- */
  --ctp-z-panel: 20; --ctp-z-tooltip: 60; --ctp-z-dialog: 80; --ctp-z-toast: 90;
}

@media (prefers-reduced-motion: reduce) {
  :root { --ctp-dur-fast: 0ms; --ctp-dur: 0ms; }
}
/* ==========================================================================
   CTP Standard 1.1 — the three visual families
   --------------------------------------------------------------------------
   Put ONE of these on the <html> element:
     data-ctp-family="desk"    The Cartographer's Desk  (publisher foundation)
     data-ctp-family="bureau"  The Operations Bureau    (military / historical)
     data-ctp-family="relic"   The Relic Archive        (Deadwake, dark SF)
   Each family assigns the same semantic roles. A game's ctp-theme.css may
   re-assign any of them under its own [data-ctp-game="..."] selector.
   ========================================================================== */

/* Printed-paper grain: one tiny SVG noise tile, rasterised once, tiled. */
:root {
  --ctp-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --ctp-grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .85 0 0 0 0 .8 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- A. The Cartographer's Desk ----------------------------------------- */
[data-ctp-family="desk"] {
  color-scheme: light;
  --ctp-bg:             var(--ctp-pub-linen);  /* the desk the board sits on */
  --ctp-surface:        var(--ctp-pub-parchment);  /* 1.1: directive parchment */
  --ctp-surface-raised: var(--ctp-pub-paper);
  --ctp-surface-sunk:   #e7d9bb;
  --ctp-ink:            #22252b;
  --ctp-ink-muted:      #535f68;              /* slate, darkened to 4.5:1 on every paper surface */
  --ctp-ink-faint:      #7a858c;
  --ctp-rule:           #cbb98f;
  --ctp-rule-strong:    #8f7b52;
  --ctp-head-bg:        var(--ctp-pub-navy);
  --ctp-head-ink:       var(--ctp-pub-parchment);
  --ctp-head-rule:      var(--ctp-pub-navy);
  --ctp-accent:         var(--ctp-pub-oxblood);
  --ctp-accent-hover:   #8a353b;
  --ctp-accent-ink:     var(--ctp-pub-paper);
  --ctp-secondary:      var(--ctp-pub-navy);
  --ctp-imprint:        var(--ctp-pub-burgundy);
  --ctp-brass:          var(--ctp-pub-brass);
  --ctp-focus:          #1f5fa8;
  --ctp-selected-bg:    #e9d7a3;
  --ctp-selected-rule:  var(--ctp-pub-brass);
  --ctp-ok: var(--ctp-pub-field); --ctp-ok-bg: #e1e6d3;
  --ctp-warn: #7e520e; --ctp-warn-bg: #f3e2b8;
  --ctp-error: var(--ctp-pub-warning); --ctp-error-bg: #f5ded8;
  --ctp-info: #1f4a70; --ctp-info-bg: #dce3e8;
  --ctp-disabled-ink:   #9c927e;
  --ctp-disabled-bg:    #e3d7bd;
  --ctp-heading-font:   var(--ctp-font-display);
  --ctp-heading-weight: 600;
  --ctp-heading-transform: none;
  --ctp-heading-variant: small-caps;
  --ctp-heading-tracking: .04em;
  --ctp-control-font:   var(--ctp-font-text);
  --ctp-texture:        var(--ctp-grain);
  --ctp-shadow:         0 1px 0 rgba(255,255,255,.5) inset, 0 2px 6px rgba(60,40,10,.18);
  --ctp-masthead-bg:    var(--ctp-pub-navy);
  --ctp-masthead-ink:   var(--ctp-pub-parchment);
  --ctp-masthead-muted: #b9c3c9;
  --ctp-masthead-rule:  var(--ctp-pub-brass);
  --ctp-masthead-focus: var(--ctp-pub-brand-cyan);
  --ctp-nav-current-bg: var(--ctp-pub-oxblood);
  /* map overlays */
  --ctp-map-select: #f0c24a; --ctp-map-move: #2f7d4a; --ctp-map-attack: #b3261e;
  --ctp-map-must: #d9771a; --ctp-map-path: #1f3550; --ctp-map-fog: rgba(40,32,20,.35);
}

/* ---- B. The Operations Bureau -------------------------------------------- */
[data-ctp-family="bureau"] {
  color-scheme: light;
  --ctp-bg:             #4a4d43;              /* olive-gray planning table */
  --ctp-surface:        #ebe3cd;              /* printed record paper     */
  --ctp-surface-raised: #f4eedd;
  --ctp-surface-sunk:   #ddd3b8;
  --ctp-ink:            #1f2320;
  --ctp-ink-muted:      #555a4e;
  --ctp-ink-faint:      #858672;
  --ctp-rule:           #bdb293;
  --ctp-rule-strong:    #6d6a55;
  --ctp-head-bg:        #2e4436;              /* field-manual green strip */
  --ctp-head-ink:       #eee8d4;
  --ctp-head-rule:      #2e4436;
  --ctp-accent:         #9a2f22;              /* rust red: the one action */
  --ctp-accent-hover:   #b03826;
  --ctp-accent-ink:     #fbf1e0;
  --ctp-secondary:      #2e4436;
  --ctp-imprint:        var(--ctp-pub-burgundy);
  --ctp-brass:          #8d7440;
  --ctp-focus:          #1d5fb5;
  --ctp-selected-bg:    #e6d59a;
  --ctp-selected-rule:  #8d7440;
  --ctp-ok: #2c6435; --ctp-ok-bg: #d8e3c8;
  --ctp-warn: #865408; --ctp-warn-bg: #f0dcae;
  --ctp-error: #9e1d16; --ctp-error-bg: #efd2c8;
  --ctp-info: #1f4c78; --ctp-info-bg: #d5dfe6;
  --ctp-disabled-ink:   #9d9884;
  --ctp-disabled-bg:    #dcd4bc;
  --ctp-heading-font:   var(--ctp-font-data);
  --ctp-heading-weight: 700;
  --ctp-heading-transform: uppercase;
  --ctp-heading-variant: normal;
  --ctp-heading-tracking: .1em;
  --ctp-control-font:   var(--ctp-font-data);
  --ctp-texture:        var(--ctp-grain);
  --ctp-shadow:         0 1px 0 rgba(255,255,255,.45) inset, 0 1px 3px rgba(20,24,16,.28);
  --ctp-masthead-bg:    #1d2a22;              /* dark field-manual plate */
  --ctp-masthead-ink:   #eee8d4;
  --ctp-masthead-muted: #b8bba8;
  --ctp-masthead-rule:  #8d7440;
  --ctp-masthead-focus: var(--ctp-pub-brand-cyan);
  --ctp-nav-current-bg: #9a2f22;
  --ctp-map-select: #ffd23f; --ctp-map-move: #2e8b3e; --ctp-map-attack: #c0281d;
  --ctp-map-must: #e07a10; --ctp-map-path: #1d3f6e; --ctp-map-fog: rgba(30,30,24,.4);
}

/* ---- C. The Relic Archive ------------------------------------------------- */
[data-ctp-family="relic"] {
  color-scheme: dark;
  --ctp-bg:             #121517;              /* the dark of the hangar    */
  --ctp-surface:        #1c2124;              /* slate plate               */
  --ctp-surface-raised: #232a2d;
  --ctp-surface-sunk:   #15191b;
  --ctp-ink:            #e2dccd;              /* bone                       */
  --ctp-ink-muted:      #a3a69c;
  --ctp-ink-faint:      #6e7570;
  --ctp-rule:           #364145;              /* oxidised edge              */
  --ctp-rule-strong:    #5b6a69;
  --ctp-head-bg:        #2b2420;              /* umber-dark plate, distinct from slate */
  --ctp-head-ink:       #e0d3b8;
  --ctp-head-rule:      #8e6a4a;              /* oxidised copper edge */
  --ctp-accent:         #2f7b73;              /* muted teal: commit actions */
  --ctp-accent-hover:   #388d84;
  --ctp-accent-ink:     #f1ece0;
  --ctp-secondary:      #8e6a4a;              /* oxidised copper            */
  --ctp-imprint:        #b98a5e;
  --ctp-brass:          #a87a4e;
  --ctp-focus:          #e3b04b;              /* amber: visible on slate    */
  --ctp-selected-bg:    #24393a;
  --ctp-selected-rule:  #5fb3a6;
  --ctp-ok: #7cc49a; --ctp-ok-bg: #1b3326;
  --ctp-warn: #e0a84a; --ctp-warn-bg: #3a2e17;
  --ctp-error: #e8735f; --ctp-error-bg: #3d1d18;
  --ctp-info: #7fb6cf; --ctp-info-bg: #19303a;
  --ctp-disabled-ink:   #5d6461;
  --ctp-disabled-bg:    #1a1e20;
  --ctp-heading-font:   var(--ctp-font-data);
  --ctp-heading-weight: 600;
  --ctp-heading-transform: uppercase;
  --ctp-heading-variant: normal;
  --ctp-heading-tracking: .18em;
  --ctp-control-font:   var(--ctp-font-data);
  --ctp-texture:        var(--ctp-grain-dark);
  --ctp-shadow:         0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.45);
  --ctp-masthead-bg:    #0d1012;
  --ctp-masthead-ink:   #e2dccd;
  --ctp-masthead-muted: #a3a69c;
  --ctp-masthead-rule:  #8e6a4a;
  --ctp-masthead-focus: var(--ctp-pub-brand-cyan);
  --ctp-nav-current-bg: #215550;              /* deep teal: bone text at 6.2:1 */
  --ctp-map-select: #e3b04b; --ctp-map-move: #4fb39a; --ctp-map-attack: #e0604a;
  --ctp-map-must: #e39a3b; --ctp-map-path: #9fd3c7; --ctp-map-fog: rgba(6,8,9,.55);
}

/* ---- Lamplight: opt-in dark variant of the two paper families -------------
   A game that already honoured the OS dark preference keeps doing so by adding
   data-ctp-scheme="auto" next to data-ctp-family. (Relic is dark already.)
   data-theme="light" / "dark" on <html> still forces either.                */
@media (prefers-color-scheme: dark) {
  [data-ctp-scheme="auto"]:not([data-theme="light"]):not(:root[data-theme="light"] *):is([data-ctp-family="bureau"], [data-ctp-family="desk"]) {
    color-scheme: dark; --ctp-imprint: #dc8f80;
    --ctp-bg: #1d1f1b; --ctp-surface: #2a2b26; --ctp-surface-raised: #32332d; --ctp-surface-sunk: #22231f;
    --ctp-ink: #ece5d2; --ctp-ink-muted: #b3ab97; --ctp-ink-faint: #827b6b;
    --ctp-rule: #4a4a3f; --ctp-rule-strong: #6f6b58;
    --ctp-head-bg: #3a5444; --ctp-head-ink: #f0ead8;
    --ctp-accent: #b2402c; --ctp-accent-hover: #c44c36;
    --ctp-selected-bg: #5a4d22; --ctp-disabled-ink: #6c675a; --ctp-disabled-bg: #2a2a25;
    --ctp-ok: #8cc79a; --ctp-ok-bg: #22362a; --ctp-warn: #e6b45e; --ctp-warn-bg: #3d3119;
    --ctp-error: #ef8a78; --ctp-error-bg: #43231e; --ctp-info: #93bfdc; --ctp-info-bg: #1f3442;
    --ctp-texture: var(--ctp-grain-dark); --ctp-focus: #e3b04b;
  }
  [data-ctp-scheme="auto"][data-ctp-family="desk"]:not([data-theme="light"]):not(:root[data-theme="light"] *) { --ctp-head-bg: #2b3e57; --ctp-accent: #a3343a; }
}
:is([data-ctp-family="bureau"], [data-ctp-family="desk"]):is([data-theme="dark"], :root[data-theme="dark"] *) {
  color-scheme: dark; --ctp-imprint: #dc8f80;
  --ctp-bg: #1d1f1b; --ctp-surface: #2a2b26; --ctp-surface-raised: #32332d; --ctp-surface-sunk: #22231f;
  --ctp-ink: #ece5d2; --ctp-ink-muted: #b3ab97; --ctp-ink-faint: #827b6b;
  --ctp-rule: #4a4a3f; --ctp-rule-strong: #6f6b58; --ctp-head-bg: #3a5444; --ctp-head-ink: #f0ead8;
  --ctp-accent: #b2402c; --ctp-accent-hover: #c44c36; --ctp-selected-bg: #5a4d22;
  --ctp-disabled-ink: #6c675a; --ctp-disabled-bg: #2a2a25; --ctp-texture: var(--ctp-grain-dark); --ctp-focus: #e3b04b;
}
/* ==========================================================================
   CTP Standard 1.1 — interface patterns
   --------------------------------------------------------------------------
   Every selector is wrapped in :where() so it carries ZERO specificity: a
   game's own stylesheet or ctp-theme.css always wins without !important.
   Patterns are opt-in classes (ctp-*). Nothing here restyles a game's own
   elements by tag, except focus rings and reduced motion, which are
   accessibility guarantees.
   ========================================================================== */

/* ---- Accessibility guarantees ------------------------------------------- */
:where([data-ctp-family]) :where(:focus-visible) {
  outline: 2px solid var(--ctp-focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  :where([data-ctp-family]) *, :where([data-ctp-family]) *::before, :where([data-ctp-family]) *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
:where(.ctp-num) { font-variant-numeric: tabular-nums lining-nums; font-family: var(--ctp-font-data); }
:where(.ctp-sr) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Heading voice ------------------------------------------------------- */
:where(.ctp-heading) {
  font-family: var(--ctp-heading-font); font-weight: var(--ctp-heading-weight);
  text-transform: var(--ctp-heading-transform); font-variant-caps: var(--ctp-heading-variant);
  letter-spacing: var(--ctp-heading-tracking); line-height: 1.15; margin: 0;
}

/* Masthead, imprint and phase steps carry ONE class of specificity (not
   :where) so a game's universal reset ("* { margin: 0; padding: 0 }") cannot
   collapse them. Override them with one class plus the game scope. */
/* ---- Masthead: imprint | title | status | tools --------------------------
   <header class="ctp-masthead">
     <a class="ctp-imprint" href="https://canvastemple.com">Canvas Temple <span>Publishing</span></a>
     <h1 class="ctp-title">WW2 Deluxe <small>European Theater</small></h1>
     <div class="ctp-masthead__status">…turn, phase…</div>
     <nav class="ctp-masthead__tools">…secondary buttons…</nav>
   </header>                                                                  */
 .ctp-masthead {
  display: flex; align-items: center; gap: var(--ctp-sp-3);
  min-height: 36px; max-height: var(--ctp-masthead-h); padding: 0 var(--ctp-sp-3);
  background: var(--ctp-surface) var(--ctp-texture); color: var(--ctp-ink);
  border-bottom: 1px solid var(--ctp-rule-strong);
  box-shadow: 0 2px 0 -1px var(--ctp-rule);          /* the printer's double rule */
  font-family: var(--ctp-font-text); font-size: var(--ctp-fs-m);
  position: relative; z-index: var(--ctp-z-panel);
}
/* The imprint: the publisher's name, set — never larger than the game title. */
.ctp-imprint {
  display: inline-flex; flex-direction: column; justify-content: center; flex: none;
  padding-right: var(--ctp-sp-3); border-right: 1px solid var(--ctp-rule-strong);
  font-family: var(--ctp-font-display); font-weight: 600; font-variant-caps: all-small-caps;
  font-size: 13px; letter-spacing: .14em; line-height: 1; color: var(--ctp-imprint); text-decoration: none;
  white-space: nowrap;
}
.ctp-imprint span { font-size: 9.5px; letter-spacing: .32em; color: var(--ctp-ink-muted); margin-top: 3px; font-weight: 400; }
:where(.ctp-imprint):hover { color: var(--ctp-accent-hover); }
:where(.ctp-title) {
  margin: 0; font-family: var(--ctp-heading-font); font-weight: 700; font-size: var(--ctp-fs-xl);
  text-transform: var(--ctp-heading-transform); letter-spacing: .03em; line-height: 1; white-space: nowrap;
}
:where(.ctp-title) :where(small) {
  font-family: var(--ctp-font-text); font-weight: 400; font-size: var(--ctp-fs-xs); text-transform: uppercase;
  letter-spacing: var(--ctp-tracking-caps); color: var(--ctp-ink-muted); margin-left: var(--ctp-sp-2);
}
:where(.ctp-masthead__status) {
  display: flex; align-items: baseline; gap: var(--ctp-sp-3); min-width: 0;
  font-family: var(--ctp-font-data); font-size: var(--ctp-fs-s); color: var(--ctp-ink-muted);
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:where(.ctp-masthead__status) :where(b, strong) { color: var(--ctp-ink); font-weight: 700; }
:where(.ctp-masthead__tools) { margin-left: auto; display: flex; align-items: center; gap: var(--ctp-sp-1); flex: none; }

/* ---- 1.1: masthead plate, logo and portal navigation ----------------------
   The official logo on a dark plate (CTP Digital Games Design Directive,
   sections 3 and 5). The image is never tinted, filtered or redrawn.
   <header class="ctp-masthead ctp-masthead--plate">
     <a class="ctp-logo" href="/"><img src="ctp/brand/ctp_logo.png" width="460" height="110" alt="Canvas Temple Publishing"></a>
     <nav class="ctp-nav" aria-label="Main"><a href="/my" aria-current="page">My Games</a>…</nav>
     <div class="ctp-masthead__tools">…</div>
   </header>
   Add .ctp-masthead--shell inside a game for the smaller logo.               */
.ctp-masthead--plate {
  background: var(--ctp-masthead-bg); color: var(--ctp-masthead-ink);
  border-bottom: 1px solid var(--ctp-masthead-rule); box-shadow: 0 2px 0 -1px var(--ctp-masthead-rule);
  max-height: var(--ctp-masthead-plate-h);
}
.ctp-masthead--plate.ctp-masthead--shell { max-height: var(--ctp-masthead-h); }
:where(.ctp-masthead--plate) :where(.ctp-title) { color: var(--ctp-masthead-ink); }
:where(.ctp-masthead--plate) :where(.ctp-title small, .ctp-masthead__status) { color: var(--ctp-masthead-muted); }
:where(.ctp-masthead--plate) :where(.ctp-masthead__status) :where(b, strong) { color: var(--ctp-masthead-ink); }
:where(.ctp-masthead--plate) :where(.ctp-btn--quiet) { color: var(--ctp-masthead-muted); }
:where(.ctp-masthead--plate) :where(.ctp-btn--quiet):hover { color: var(--ctp-masthead-ink); background: rgba(255,255,255,.08); border-color: var(--ctp-masthead-rule); }
:where(.ctp-masthead--plate) :where(:focus-visible) { outline-color: var(--ctp-masthead-focus); }
.ctp-logo { display: inline-flex; align-items: center; flex: none; padding: 4px var(--ctp-sp-2) 4px 0; line-height: 0; }
.ctp-logo img { display: block; height: var(--ctp-logo-h); width: auto; max-width: none; }
.ctp-masthead--shell .ctp-logo img { height: var(--ctp-logo-h-shell); }
:where(.ctp-nav) { display: flex; align-self: stretch; align-items: stretch; gap: 2px; min-width: 0; }
:where(.ctp-nav) > :where(a) {
  display: flex; align-items: center; padding: 0 var(--ctp-sp-3); color: var(--ctp-masthead-muted); text-decoration: none;
  font: 600 var(--ctp-fs-s) var(--ctp-font-text); letter-spacing: .04em; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
:where(.ctp-nav) > :where(a):hover { color: var(--ctp-masthead-ink); border-bottom-color: var(--ctp-masthead-rule); }
:where(.ctp-nav) > :where(a[aria-current]) { color: var(--ctp-masthead-ink); background: var(--ctp-nav-current-bg); border-bottom-color: var(--ctp-masthead-rule); }

/* ---- Folder tabs (primary navigation) ----------------------------------- */
:where(.ctp-tabs) { display: flex; gap: 2px; align-items: flex-end; padding: 0 var(--ctp-sp-2); border-bottom: 1px solid var(--ctp-rule-strong); }
:where(.ctp-tab) {
  appearance: none; border: 1px solid var(--ctp-rule-strong); border-bottom: none;
  border-radius: var(--ctp-radius-tab) var(--ctp-radius-tab) 0 0; margin-bottom: -1px;
  padding: 5px 14px 4px; background: var(--ctp-surface-sunk); color: var(--ctp-ink-muted); cursor: pointer;
  font: var(--ctp-heading-weight) var(--ctp-fs-s) var(--ctp-heading-font); text-transform: uppercase; letter-spacing: var(--ctp-tracking-caps);
}
:where(.ctp-tab):hover { color: var(--ctp-ink); }
:where(.ctp-tab)[aria-selected="true"], :where(.ctp-tab.is-active) { background: var(--ctp-surface); color: var(--ctp-ink); padding-bottom: 5px; }

/* ---- Phase / sequence-of-play track --------------------------------------
   <ol class="ctp-phases"><li class="is-done">…</li><li aria-current="step">…</li><li>…</li></ol>
   The current step is marked by fill AND a rule above it AND aria-current —
   never by colour alone. Completed steps carry a ✓.                         */
:where(.ctp-phases) { display: flex; align-items: stretch; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: ctp-phase; }
.ctp-phases > li {
  counter-increment: ctp-phase; position: relative; display: flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border: 1px solid var(--ctp-rule); margin-left: -1px;
  background: var(--ctp-surface-sunk); color: var(--ctp-ink-muted);
  font: 600 var(--ctp-fs-xs)/1.1 var(--ctp-font-data); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
:where(.ctp-phases) > :where(li)::before {
  content: counter(ctp-phase); font: 700 12px/1 var(--ctp-font-data); color: var(--ctp-ink-faint); min-width: 1ch;
}
/* The state rules must outrank ".ctp-phases > li" above, or a step's state
   never shows (1.0.3 bug, fixed in 1.1.0). A game overriding them needs the
   game scope plus ".ctp-phases > li.<state>".                               */
.ctp-phases > li.is-done { color: var(--ctp-ink-faint); }
:where(.ctp-phases) > :where(li.is-done)::before { content: "\2713"; color: var(--ctp-ok); }
.ctp-phases > li:is([aria-current], .is-current) {
  background: var(--ctp-head-bg); color: var(--ctp-head-ink); border-color: var(--ctp-head-bg);
  box-shadow: inset 0 3px 0 var(--ctp-accent); z-index: 1;
}
:where(.ctp-phases) > :where(li[aria-current], li.is-current)::before { content: "\25B6\00a0" counter(ctp-phase); color: var(--ctp-head-ink); }

/* ---- Panels: a heading strip and a printed body --------------------------- */
:where(.ctp-panel) {
  background: var(--ctp-surface) var(--ctp-texture); color: var(--ctp-ink);
  border: 1px solid var(--ctp-rule-strong); border-radius: var(--ctp-radius);
}
:where(.ctp-panel__head) {
  display: flex; align-items: center; gap: var(--ctp-sp-2); margin: 0;
  padding: 4px var(--ctp-sp-2); background: var(--ctp-head-bg); color: var(--ctp-head-ink);
  font-family: var(--ctp-heading-font); font-weight: var(--ctp-heading-weight); font-size: var(--ctp-fs-s);
  text-transform: var(--ctp-heading-transform); font-variant-caps: var(--ctp-heading-variant); letter-spacing: var(--ctp-heading-tracking);
}
:where(.ctp-panel__head) :where(.ctp-panel__aside) { margin-left: auto; font-weight: 400; letter-spacing: .04em; opacity: .8; }
:where(.ctp-panel__body) { padding: var(--ctp-sp-2); }
/* A sub-heading inside a panel: a ruled caption, not another dark strip. */
:where(.ctp-rubric) {
  margin: var(--ctp-sp-2) 0 var(--ctp-sp-1); padding-bottom: 2px; border-bottom: 1px solid var(--ctp-rule);
  font: 700 var(--ctp-fs-xs) var(--ctp-font-data); text-transform: uppercase; letter-spacing: var(--ctp-tracking-caps); color: var(--ctp-ink-muted);
}

/* ---- Unit dossier (selected unit / formation) ---------------------------- */
:where(.ctp-dossier) { display: grid; grid-template-columns: auto 1fr; gap: var(--ctp-sp-1) var(--ctp-sp-3); align-items: start; }
:where(.ctp-dossier__art) { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--ctp-rule); background: var(--ctp-surface-sunk); }
:where(.ctp-dossier__name) { font: 700 var(--ctp-fs-l)/1.1 var(--ctp-heading-font); text-transform: var(--ctp-heading-transform); letter-spacing: .03em; }
:where(.ctp-dossier__meta) { font-size: var(--ctp-fs-s); color: var(--ctp-ink-muted); }
/* Stat grid: label above number, tabular — reads like a counter's statline. */
:where(.ctp-stats) { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 1px; margin: var(--ctp-sp-1) 0; background: var(--ctp-rule); border: 1px solid var(--ctp-rule); }
:where(.ctp-stats) > :where(div) { background: var(--ctp-surface-raised); padding: 3px 6px; }
:where(.ctp-stats) :where(dt) { font: 600 10px var(--ctp-font-data); text-transform: uppercase; letter-spacing: .08em; color: var(--ctp-ink-muted); }
:where(.ctp-stats) :where(dd) { margin: 0; font: 700 16px/1.2 var(--ctp-font-data); font-variant-numeric: tabular-nums; }

/* ---- Status track (integrity, supply, morale…): pips + number ----------- */
:where(.ctp-track) { display: flex; align-items: center; gap: var(--ctp-sp-2); font: var(--ctp-fs-s) var(--ctp-font-data); }
:where(.ctp-track__pips) { display: flex; gap: 2px; }
:where(.ctp-track__pips) > :where(i) { width: 10px; height: 10px; border: 1px solid var(--ctp-rule-strong); background: transparent; }
:where(.ctp-track__pips) > :where(i.on) { background: var(--ctp-ok); border-color: var(--ctp-ok); }
:where(.ctp-track__value) { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- Buttons --------------------------------------------------------------
   Three weights, matched to gameplay importance:
     .ctp-btn--primary  the ONE next required action (End phase, Resolve combat)
     .ctp-btn           ordinary commands (Undo, Move, Fire)
     .ctp-btn--quiet    housekeeping (Save, Load, Guide, Report) — present, not loud
   States: :hover, :focus-visible, [aria-pressed=true] (toggles / selected
   order), :disabled or [aria-disabled=true] (with a title saying why).       */
:where(.ctp-btn) {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctp-control-h); padding: 0 10px; cursor: pointer;
  font: 600 var(--ctp-fs-s) var(--ctp-control-font); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  color: var(--ctp-ink); background: var(--ctp-surface-raised);
  border: 1px solid var(--ctp-rule-strong); border-radius: var(--ctp-radius); box-shadow: var(--ctp-shadow);
  transition: background var(--ctp-dur-fast) var(--ctp-ease), border-color var(--ctp-dur-fast) var(--ctp-ease);
}
:where(.ctp-btn):hover { background: var(--ctp-surface); border-color: var(--ctp-ink-muted); }
:where(.ctp-btn):active { transform: translateY(1px); }
:where(.ctp-btn)[aria-pressed="true"], :where(.ctp-btn.is-selected) {
  background: var(--ctp-selected-bg); border-color: var(--ctp-selected-rule); box-shadow: inset 0 0 0 1px var(--ctp-selected-rule);
}
:where(.ctp-btn--primary) {
  background: var(--ctp-accent); color: var(--ctp-accent-ink); border-color: color-mix(in srgb, var(--ctp-accent) 70%, #000);
  font-weight: 700; letter-spacing: .08em;
}
:where(.ctp-btn--primary):hover { background: var(--ctp-accent-hover); border-color: color-mix(in srgb, var(--ctp-accent) 60%, #000); }
:where(.ctp-btn--quiet) { background: transparent; box-shadow: none; border-color: transparent; color: var(--ctp-ink-muted); font-weight: 600; }
:where(.ctp-btn--quiet):hover { background: var(--ctp-surface-sunk); border-color: var(--ctp-rule); color: var(--ctp-ink); }
:where(.ctp-btn--danger) { color: var(--ctp-error); border-color: var(--ctp-error); }
:where(.ctp-btn):disabled, :where(.ctp-btn)[aria-disabled="true"] {
  cursor: not-allowed; color: var(--ctp-disabled-ink); background: var(--ctp-disabled-bg);
  border-color: var(--ctp-rule); border-style: dashed; box-shadow: none; transform: none;
}
:where(.ctp-btn-group) { display: inline-flex; }
:where(.ctp-btn-group) > :where(.ctp-btn) + :where(.ctp-btn) { margin-left: -1px; }

/* Form controls that belong to the game, not the browser */
:where(.ctp-select, .ctp-input) {
  min-height: var(--ctp-control-h); padding: 0 6px; font: var(--ctp-fs-s) var(--ctp-control-font);
  color: var(--ctp-ink); background: var(--ctp-surface-sunk); border: 1px solid var(--ctp-rule-strong); border-radius: var(--ctp-radius);
}

/* ---- Notices: warning / error / success / info ---------------------------
   Each carries a glyph so state never rests on colour alone.               */
:where(.ctp-notice) {
  display: flex; gap: var(--ctp-sp-2); align-items: baseline; padding: 6px 10px;
  border: 1px solid currentColor; border-left-width: 4px; border-radius: var(--ctp-radius);
  font: var(--ctp-fs-s)/1.35 var(--ctp-font-text); background: var(--ctp-info-bg); color: var(--ctp-info);
}
:where(.ctp-notice)::before { content: "\2139"; font-weight: 700; }
:where(.ctp-notice--ok) { background: var(--ctp-ok-bg); color: var(--ctp-ok); }
:where(.ctp-notice--ok)::before { content: "\2713"; }
:where(.ctp-notice--warn) { background: var(--ctp-warn-bg); color: var(--ctp-warn); }
:where(.ctp-notice--warn)::before { content: "\25B2"; }
:where(.ctp-notice--error) { background: var(--ctp-error-bg); color: var(--ctp-error); }
:where(.ctp-notice--error)::before { content: "\2717"; }
:where(.ctp-toast) { position: fixed; right: var(--ctp-sp-4); bottom: var(--ctp-sp-4); z-index: var(--ctp-z-toast); max-width: 380px; box-shadow: var(--ctp-shadow); }

/* ---- Tooltips / hover cards ----------------------------------------------- */
:where(.ctp-tip) {
  z-index: var(--ctp-z-tooltip); max-width: min(360px, 90vw); padding: 6px 9px;
  background: var(--ctp-surface-raised); color: var(--ctp-ink); border: 1px solid var(--ctp-rule-strong);
  border-radius: var(--ctp-radius); box-shadow: 0 4px 14px rgba(0,0,0,.25);
  font: var(--ctp-fs-s)/1.35 var(--ctp-font-text); overflow-wrap: anywhere;
}

/* ---- Dialogs (modal, confirmation, save/load, rules) ---------------------- */
:where(.ctp-backdrop) { position: fixed; inset: 0; z-index: var(--ctp-z-dialog); background: rgba(12,10,6,.55); display: grid; place-items: center; }
:where(.ctp-dialog) {
  max-width: min(720px, 94vw); max-height: 88vh; overflow: auto; color: var(--ctp-ink);
  background: var(--ctp-surface-raised) var(--ctp-texture); border: 1px solid var(--ctp-rule-strong);
  border-top: 4px solid var(--ctp-head-rule, var(--ctp-head-bg)); border-radius: var(--ctp-radius); box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font: var(--ctp-fs-m)/1.45 var(--ctp-font-text);
}
:where(.ctp-dialog__title) {
  margin: 0; padding: var(--ctp-sp-3) var(--ctp-sp-4) var(--ctp-sp-2); border-bottom: 1px solid var(--ctp-rule);
  font: var(--ctp-heading-weight) var(--ctp-fs-l) var(--ctp-heading-font); text-transform: var(--ctp-heading-transform);
  font-variant-caps: var(--ctp-heading-variant); letter-spacing: var(--ctp-heading-tracking);
}
:where(.ctp-dialog__body) { padding: var(--ctp-sp-3) var(--ctp-sp-4); }
:where(.ctp-dialog__actions) { display: flex; justify-content: flex-end; gap: var(--ctp-sp-2); padding: var(--ctp-sp-2) var(--ctp-sp-4) var(--ctp-sp-3); border-top: 1px solid var(--ctp-rule); }

/* ---- Information log ---------------------------------------------------- */
:where(.ctp-log) { font: var(--ctp-fs-s)/1.35 var(--ctp-font-text); }
:where(.ctp-log__turn) { font: 700 var(--ctp-fs-xs) var(--ctp-font-data); text-transform: uppercase; letter-spacing: var(--ctp-tracking-caps); color: var(--ctp-ink-muted); border-bottom: 1px solid var(--ctp-rule); margin-top: var(--ctp-sp-2); }
:where(.ctp-log__ref) { font: var(--ctp-fs-xs) var(--ctp-font-data); color: var(--ctp-ink-faint); }

/* ---- Victory / defeat ------------------------------------------------------ */
:where(.ctp-outcome) {
  text-align: center; padding: var(--ctp-sp-5) var(--ctp-sp-4); border: 1px solid var(--ctp-rule-strong);
  border-top: 6px double var(--ctp-brass); background: var(--ctp-surface-raised) var(--ctp-texture);
}
:where(.ctp-outcome__verdict) { font: 700 var(--ctp-fs-xxl)/1 var(--ctp-font-display); font-variant-caps: small-caps; letter-spacing: .06em; margin: 0 0 var(--ctp-sp-2); }
:where(.ctp-outcome.is-victory) :where(.ctp-outcome__verdict) { color: var(--ctp-ok); }
:where(.ctp-outcome.is-defeat) :where(.ctp-outcome__verdict) { color: var(--ctp-error); }

/* ---- Small furniture ------------------------------------------------------- */
:where(.ctp-kbd) { display: inline-block; min-width: 1.4em; padding: 0 4px; text-align: center; font: 600 11px/1.5 var(--ctp-font-mono); border: 1px solid var(--ctp-rule-strong); border-bottom-width: 2px; border-radius: 3px; background: var(--ctp-surface-raised); color: var(--ctp-ink); }
:where(.ctp-folio) { font: var(--ctp-fs-xs) var(--ctp-font-data); letter-spacing: .1em; text-transform: uppercase; color: var(--ctp-ink-faint); }
:where(.ctp-tag) { display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; border: 1px solid currentColor; border-radius: var(--ctp-radius); font: 700 10px/16px var(--ctp-font-data); text-transform: uppercase; letter-spacing: .06em; }

/* Dense mode for operational games: tighter controls, same type. */
:where(.ctp-dense) { --ctp-control-h: 24px; }
