/* The game's own stylesheet. It is loaded inside the game's shadow root, so nothing here reaches the
   host page and the host page's styles do not reach in. Sizes follow the host element (container
   query units), never the browser window: the game fits whatever box it is mounted in. */
:host {
  --bg: #17120d;
  --panel: #241b13;
  --panel2: #30251a;
  --line: #4a3a27;
  --ink: #f3e9d2;
  --muted: #b9a888;
  --brass: #e3b04b;
  --brass-l: #f7dc8f;
  --brass-d: #9a6f1e;
  --paper: #efdfb4;
  --sepia: #3b2814;
  --red: #b3261e;
  --red-l: #df5a48;
  --red-d: #7a1510;
  --blue: #2456a6;
  --blue-l: #5b8fdc;
  --blue-d: #153a78;
  /* Three faces from the years the game is set in. Titles: a Didone, the type of proclamations and
     title pages around 1800. Labels and numbers: a Clarendon, sturdy enough to read at 9 px on a
     badge. Running text: Georgia, a screen face drawn after the Scotch Romans of the 1810s. */
  --display: "Bodoni Moda", "Bodoni 72", Didot, "Playfair Display", Georgia, "Times New Roman", serif;
  --slab: Besley, Superclarendon, Clarendon, Rockwell, "Roboto Slab", Georgia, serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  /* each army's metal: gold for the red army, silver for the blue one */
  --m: #e3b04b; --m-l: #fff0b8; --m-d: #8a5f17; --m-ink: #2b1a05;
  --tilt: -11deg; /* every piece is tipped the same way */
  display: block; position: relative; visibility: visible;
  container: game / size;
  color-scheme: dark; color: var(--ink);
  font: 15px/1.4 var(--serif);
  text-align: left; letter-spacing: normal; text-transform: none;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
svg { display: block; width: 100%; height: 100%; }

.stage { position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(110% 60% at 50% -5%, rgba(227,176,75,.13), transparent 60%),
    repeating-linear-gradient(93deg, rgba(255,255,255,.012) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, #211912, var(--bg) 55%, #100c08); }
.app {
  --board: max(264px, min(100cqw - 12px, (100cqh - 190px) * 1.23, 760px));
  height: 100%; overflow: hidden auto; scrollbar-width: none; /* a scrollbar would take width the layout has already counted */
  padding: 6px 6px calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.app::-webkit-scrollbar { display: none; }
.app > * { width: var(--board); flex: none; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
/* Menu, at the left of the bar: back to headquarters, where the battle waits (it was a brass crest nobody took for a
   way out). Words with a line under them, and the arrow that Back has on the second screen. */
.bar-menu { flex: none; min-height: 36px; padding: 0 6px 0 2px; color: var(--ink); font-size: 11px; letter-spacing: .14em; }
.bar-menu::before { content: ""; width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.app.point-menu .bar-menu { outline: 2px solid var(--brass-l); outline-offset: 2px; border-radius: 3px; animation: reach-pulse .7s ease-in-out infinite alternate; }
.bar-text { flex: 1; min-width: 0; }
.status { margin: 0; font: 700 19px/1.1 var(--display); letter-spacing: .01em; word-spacing: .12em; display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; }
.status::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px rgba(227,176,75,.2); }
/* A line too long for its one row even at the smallest size it is set in (game.js, fitStatus): two rows of that size,
   and on the smallest of screens a third, before anything is cut off. */
.status.two { white-space: normal; line-height: 1.06; text-wrap: balance; overflow-wrap: anywhere; }
.app[data-phase="play"][data-turn="p"] .status::before { background: var(--red-l); box-shadow: 0 0 0 3px rgba(223,90,72,.22); }
.app[data-phase="play"][data-turn="c"] .status::before { background: var(--blue-l); box-shadow: 0 0 0 3px rgba(91,143,220,.22); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
/* the hint under the status: up to two lines, and the room for two is always kept so the board never shifts */
.sub { margin: 1px 0 0; font-size: 12.5px; line-height: 1.28; color: var(--muted); min-height: 2.56em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* A sign to press is the sign alone, in the colour of what it stands on: no plate behind it (the owner found
   the small plates "of all sizes, like plasters"). The square is only felt: 40 across, the sign two thirds of it. */
.icon-btn { flex: none; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; opacity: .9; transition: opacity .12s, background-color .12s, transform .08s ease-out; }
.icon-btn svg { flex: none; width: 26px; height: 26px; }
.icon-btn:hover { opacity: 1; background: color-mix(in srgb, currentColor 13%, transparent); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.armed { opacity: 1; background: radial-gradient(120% 170% at 38% 15%, #b8332a, #8c1c14 60%, #5a0f0a); color: #f7ebc8; }
/* the sound sheet: a switch and a volume each for music and for effects */
.sheet.sound-sheet { z-index: 95; }
.sound-sheet .sheet-card { width: min(100%, 340px); gap: 14px; }
.vol { display: grid; grid-template-columns: auto 64px 1fr; align-items: center; gap: 10px; }
.vol label { font: 700 13px/1 var(--slab); letter-spacing: .04em; color: #3b2814; }
.switch { position: relative; width: 44px; height: 26px; padding: 0; border-radius: 13px; border: 1px solid #1f1108; cursor: pointer; background: #8d7a58; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff0b8, var(--brass) 55%, var(--brass-d)); box-shadow: 0 1px 2px rgba(0,0,0,.6); transition: transform .15s; }
.switch[aria-checked="true"] { background: linear-gradient(180deg, #7d1a14, #5a100c); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.vol input[type="range"] { width: 100%; min-width: 0; height: 26px; margin: 0; accent-color: #7d1a14; cursor: pointer; }
.vol input[type="range"]:disabled { opacity: .4; cursor: default; }
.opt { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.25; color: #3b2814; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }


/* ---------- the war table: a map clamped to a wooden board, with working rails ---------- */
.table {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "board board" "raill railr";
  border-radius: 12px;
  background:
    repeating-linear-gradient(91deg, rgba(0,0,0,.16) 0 1px, transparent 1px 5px, rgba(255,255,255,.035) 5px 6px, transparent 6px 13px),
    linear-gradient(135deg, #8a5a2c, #5e3a19 40%, #3f2610 72%, #6f4622);
  box-shadow: 0 14px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,160,.35), inset 0 -2px 0 rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.4);
}
.board-frame { grid-area: board; position: relative; padding: 1.7%; }
.clamp { position: absolute; width: clamp(15px, 6.4%, 34px); aspect-ratio: 1; z-index: 3; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.65)); }
.clamp::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #fff0b8, var(--brass) 42%, var(--brass-d)); clip-path: polygon(0 0, 100% 0, 100% 32%, 32% 32%, 32% 100%, 0 100%); }
.clamp::after { content: ""; position: absolute; left: 8%; top: 8%; width: 16%; height: 16%; border-radius: 50%; background: #5a3d0c; box-shadow: inset 0 1px 0 rgba(255,255,255,.55); }
.clamp.tl { left: 0; top: 0; } .clamp.tr { right: 0; top: 0; transform: scaleX(-1); }
.clamp.bl { left: 0; bottom: 0; transform: scaleY(-1); } .clamp.br { right: 0; bottom: 0; transform: scale(-1); }

.rail { display: flex; align-items: center; gap: 6px; min-height: 50px; padding: 2px 8px 7px; min-width: 0; }
.rail-l { grid-area: raill; } .rail-r { grid-area: railr; justify-content: flex-end; }
.plate { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plate.foe { flex: 0 1 auto; }
.plate.mine .pname { display: none; } /* on a narrow strip the red badge speaks for itself */
.badge { position: relative; flex: none; width: 34px; height: 34px; padding: 7px; margin: 0 2px; border-radius: 50%; color: #f6e7c3;
  background: radial-gradient(circle at 35% 28%, var(--c-l), var(--c) 55%, var(--c-d));
  box-shadow: 0 0 0 2px #1a0f05, 0 0 0 4px var(--brass-d), 0 2px 4px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.35); transition: box-shadow .3s; }
/* a painted face: the three enemy commanders and the player's aide */
.who { display: block; background: #2a1c10 center / cover no-repeat; }
.who.wren { background-image: url(img/people/wren.webp); } .who.hale { background-image: url(img/people/hale.webp); }
.who.voss { background-image: url(img/people/voss.webp); } .who.aide { background-image: url(img/people/aide.webp); }
.badge .who { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.5); }
/* the commander's level under his portrait: chevrons on the level's colour, no word (there is no room) */
.badge .lv { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 1px 3px; gap: 0; }
.badge .lv svg { width: 10px; height: 10px; }
/* a few words from the enemy commander */
.plate.foe { position: relative; }
/* Under the board (the upright layouts) the words come out beside the commander's face, along his
   own strip: over his name for a moment, never over the map, where they would hide the player's back row. */
/* The commander's line, beside his portrait. Under the map (a phone held upright) it hangs from the
   top of the strip and grows downward: centred on the strip, a line of three rows rose over the
   player's back row of pieces. */
.say { position: absolute; z-index: 47; left: 50px; top: 3px; width: max-content; max-width: min(62cqw, 240px); padding: 6px 10px 7px; border-radius: 11px; pointer-events: none;
  font: italic 600 13px/1.25 var(--serif); color: #16233c; background: linear-gradient(175deg, #f6f8fc, #d3dcec); box-shadow: 0 0 0 1.5px var(--blue-d), 0 6px 16px rgba(0,0,0,.55); }
.say::after { content: ""; position: absolute; left: -9px; top: 13px; width: 10px; height: 12px; background: #e4eaf4; clip-path: polygon(100% 0, 100% 100%, 0 50%); filter: drop-shadow(-1.5px 0 0 var(--blue-d)); }.say.go { animation: say-in .28s cubic-bezier(.2,1.4,.4,1); }
@keyframes say-in { from { transform: translateY(8px) scale(.9); opacity: 0; } }
.badge.broken { filter: grayscale(.85) brightness(.6); animation: broke .7s ease-out; }
.badge.broken::after { content: ""; position: absolute; inset: -2px; z-index: 2; border-radius: 50%; background: linear-gradient(112deg, transparent 45%, #0e0804 45.5% 48.5%, transparent 49%), linear-gradient(58deg, transparent 57%, #0e0804 57.5% 60%, transparent 60.5%); }
@keyframes broke { 0% { transform: scale(1.3) rotate(-10deg); filter: brightness(2.4); } 100% { transform: none; } }
.pname { min-width: 0; padding: 4px 4px 3px; border-radius: 3px; font: 700 8.5px/1 var(--slab); letter-spacing: .02em; text-transform: uppercase; color: #f1dfb4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--c-d); box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.18); }
.app[data-phase="play"][data-turn="p"] .plate.mine .badge,
.app[data-phase="play"][data-turn="c"] .plate.foe .badge { box-shadow: 0 0 0 2px #1a0f05, 0 0 0 4px var(--brass-l), 0 0 14px 2px var(--c-l), inset 0 1px 0 rgba(255,255,255,.35); }
/* the lever leans toward whoever is to move */
/* Whose turn it is. The knob lies toward the side that is to move, the bar takes that side's colour,
   and where there is room the words say it. In the middle of the strip, between the two commanders. */
.turn { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 auto; }
.turn-word { display: none; font: 700 10px/1 var(--slab); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: #f1dfb4; }
@container game (min-width: 480px) { .turn-word { display: block; } }
.app[data-phase="play"][data-turn="p"] .lever { background: linear-gradient(180deg, var(--red-d), var(--red)); }
.app[data-phase="play"][data-turn="c"] .lever { background: linear-gradient(180deg, var(--blue-d), var(--blue)); }
.lever { flex: none; position: relative; width: 52px; height: 18px; border-radius: 9px; transition: background .3s; background: linear-gradient(180deg, #17110c, #3a2d22); box-shadow: inset 0 1px 3px rgba(0,0,0,.85), 0 1px 0 rgba(255,220,170,.22); }
.knob { position: absolute; left: 0; top: -5px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff0b8, var(--brass) 48%, var(--brass-d)); box-shadow: 0 2px 3px rgba(0,0,0,.65), inset 0 0 0 1.5px rgba(255,255,255,.35); transform: translateX(12px); transition: transform .4s cubic-bezier(.3,1.4,.4,1); }
.app[data-phase="play"][data-turn="c"] .knob { transform: translateX(0); }
.app[data-phase="play"][data-turn="p"] .knob { transform: translateX(24px); }
/* strength plaques: the ranks each side still has, added up */
.plaque { flex: none; min-width: 42px; height: 34px; padding: 0 6px; display: grid; place-items: center; clip-path: polygon(13% 0, 87% 0, 100% 50%, 87% 100%, 13% 100%, 0 50%); background: linear-gradient(180deg, var(--c-l), var(--c) 45%, var(--c-d)); }
.plaque { cursor: help; }
.str-cap { display: none; font: 700 8.5px/1 var(--slab); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.app.point-str .plaque { animation: reach-pulse .7s ease-in-out infinite alternate; filter: brightness(1.25); }
.plaque b { font: 700 15px/1 var(--slab); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.55); font-variant-numeric: tabular-nums; }
.plaque.drop b { animation: drop .8s ease-out; }
@keyframes drop { 0% { transform: translateY(-7px) scale(1.25); color: #ffe08a; } 100% { transform: none; } }
.grave-btn { flex: none; width: 38px; height: 38px; padding: 6px; border-radius: 10px; border: 1px solid #1a0f05; color: #20242a; cursor: pointer; background: linear-gradient(180deg, #dfe3e8, #9aa1aa 55%, #6a717a); box-shadow: 0 2px 0 #2b2f35, inset 0 1px 0 rgba(255,255,255,.65); }
.grave-btn[aria-expanded="true"] { background: linear-gradient(180deg, #fbe7a6, var(--brass) 55%, #cf9a34); color: #2a1d00; }

/* ---------- the map ---------- */
.board { position: relative; aspect-ratio: 5 / 4; container: board / inline-size; border-radius: 2px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  box-shadow: 0 0 0 1px rgba(30,18,6,.9), 0 2px 8px rgba(0,0,0,.6); }
.terrain, .edge, .reach, .ink, .pieces, .cells, .fx, .dim { position: absolute; inset: 0; }
.terrain { border-radius: 2px; overflow: hidden; }
.ripple { animation: ripple 5s ease-in-out infinite alternate; }
@keyframes ripple { to { transform: translateX(1.2px); opacity: .3; } }
/* the edge of the map glows in the colour of the side to move */
.edge { z-index: 2; pointer-events: none; transition: box-shadow .35s; box-shadow: inset 0 0 0 0 transparent; }
.app[data-phase="play"][data-turn="p"] .edge { box-shadow: inset 0 0 0 .45cqw rgba(196,44,34,.9), inset 0 0 4.5cqw rgba(196,44,34,.5); }
.app[data-phase="play"][data-turn="c"] .edge { box-shadow: inset 0 0 0 .45cqw rgba(36,86,166,.9), inset 0 0 4.5cqw rgba(36,86,166,.5); }
/* where the chosen piece can go: its squares lit as one area, one outline around all of it */
.reach { z-index: 3; width: 100%; height: 100%; pointer-events: none; overflow: visible; transition: opacity .15s; }
.reach.faint { opacity: .55; }
.reach-fill { fill: rgba(252,214,112,.3); }
.reach-home { fill: rgba(59,40,20,.22); }
.reach-glow { fill: none; stroke: #ffe9a8; stroke-width: 2.4; stroke-linejoin: round; filter: url(#reach-blur); animation: reach-pulse 1.5s ease-in-out infinite alternate; }
.reach-edge { fill: none; stroke: #6b4a12; stroke-width: 1.05; stroke-linejoin: round; }
.reach-line { fill: none; stroke: #fde9a6; stroke-width: .5; stroke-linejoin: round; }
.reach.faint .reach-glow { animation: none; opacity: .4; }
.reach-hit { fill: rgba(196,44,34,.32); stroke: #c22a1e; stroke-width: 1.05; stroke-linejoin: round; }
.reach-hit-line { fill: none; stroke: #ffd3c2; stroke-width: .42; stroke-linejoin: round; animation: reach-pulse .8s ease-in-out infinite alternate; }
@keyframes reach-pulse { from { opacity: .4; } to { opacity: 1; } }
.ink { z-index: 4; pointer-events: none; }
.pieces { z-index: 10; pointer-events: none; }
.cells { z-index: 20; display: grid; grid-template: repeat(10, 1fr) / repeat(10, 1fr); }
.fx { z-index: 30; pointer-events: none; }
.dim { z-index: 35; pointer-events: none; background: rgba(20,12,4,.36); opacity: 0; transition: opacity .2s; }
.board.dimmed .dim { opacity: 1; }
.cell { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 0; }
.cell.lake { cursor: default; }
.cell.grab { cursor: grab; touch-action: none; }
.cell:focus-visible { outline: 2px solid #1b1206; outline-offset: -2px; z-index: 2; }
.cell.atk::after { content: ""; position: absolute; inset: 3% 2%; border-radius: 50%; transform: rotate(var(--tilt)); border: .6cqw solid #ffe9a8; box-shadow: 0 0 0 .45cqw #c2180c, inset 0 0 1.6cqw rgba(255,60,30,.85), 0 0 2.2cqw rgba(255,60,30,.8); animation: pop .6s ease-in-out infinite alternate; }
.cell.hover::before { content: ""; position: absolute; inset: 0; background: rgba(255,240,170,.45); box-shadow: inset 0 0 0 .5cqw var(--brass); }
@keyframes pop { from { scale: .86; } to { scale: 1; } }
.deploy-plate { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 18; pointer-events: none; padding: 1.1cqw 1.8cqw; border-radius: .8cqw; text-align: center; white-space: nowrap;
  font: 700 2.1cqw/1.3 var(--slab); letter-spacing: .16em; text-transform: uppercase; color: #2a1d00;
  background: linear-gradient(180deg, #fbe7a6, var(--brass) 55%, #cf9a34); box-shadow: 0 .4cqw 1cqw rgba(0,0,0,.5), inset 0 0 0 .22cqw rgba(90,61,12,.6), inset 0 .2cqw 0 rgba(255,255,255,.5); }
.app[data-phase="setup"] .deploy-plate { display: block; }
.banner { position: absolute; left: 0; right: 0; top: 50%; z-index: 45; pointer-events: none; padding: 2.6cqw 0; text-align: center; transform: translateY(-50%);
  font: 700 8cqw/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #f0c665;
  text-shadow: 0 .15cqw 0 #fff3c9, 0 .5cqw 0 #2a1806, 0 1cqw 2.4cqw rgba(0,0,0,.8);
  background: linear-gradient(90deg, transparent, rgba(20,12,4,.8) 18%, rgba(20,12,4,.8) 82%, transparent); }
.banner.go { animation: banner 1.2s ease both; }
@keyframes banner { 0% { opacity: 0; letter-spacing: .4em; } 22% { opacity: 1; letter-spacing: .08em; } 76% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- pieces: round tokens lying on the map, seen at a slant ---------- */
/* 1em is the width of a square; a square is 0.8em high. */
.pc { position: absolute; left: 0; top: 0; width: 10%; height: 10%; font-size: 10cqw;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  transition: transform .26s cubic-bezier(.25,.8,.3,1); will-change: transform; }
.mine { --c: #c6241b; --c-l: #f4705a; --c-d: #7d150f; --m: #e3b04b; --m-l: #fff0b8; --m-d: #8a5f17; --m-ink: #2b1a05; }
.foe { --c: #2659b3; --c-l: #7fb0f5; --c-d: #123470; --m: #cdd5de; --m-l: #ffffff; --m-d: #6f7b89; --m-ink: #0f1a2b; }
/* the token's own box: a wide oval, a little smaller than its square so the map shows around it */
.tok { position: absolute; left: .06em; right: .06em; top: .04em; bottom: .06em; transition: transform .15s, filter .15s; filter: drop-shadow(0 .045em .03em rgba(50,30,8,.5)); }
/* its thickness: the near edge of the disc */
.tok::before { content: ""; position: absolute; inset: 0; border-radius: 50%; transform: translateY(.034em) rotate(var(--tilt));
  background: linear-gradient(90deg, var(--c-d), #120a05 55%, var(--c-d)); box-shadow: 0 0 0 .008em rgba(12,7,2,.85); }
/* the rim carries the army's colour: enamel between two fine lines of the army's metal */
.rim { position: absolute; inset: 0; border-radius: 50%; transform: rotate(var(--tilt));
  background:
    repeating-conic-gradient(rgba(255,255,255,.06) 0 3deg, rgba(0,0,0,.07) 3deg 6deg),
    radial-gradient(60% 46% at 30% 12%, rgba(255,255,255,.5), transparent 70%),
    linear-gradient(170deg, var(--c-l) 0%, var(--c) 34%, var(--c) 60%, var(--c-d) 100%);
  box-shadow: 0 0 0 .008em rgba(12,7,2,.9), inset 0 0 0 .013em var(--m), inset 0 -.03em .02em rgba(0,0,0,.4); }
/* the window in the rim, and the painting behind it: the window is tipped, the painting stays upright */
.win { position: absolute; inset: .085em; border-radius: 50%; overflow: hidden; transform: rotate(var(--tilt)); background: #2a1c10;
  box-shadow: 0 0 0 .013em var(--m-l), 0 0 0 .022em rgba(12,7,2,.55); }
.win::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: inset 0 .035em .05em rgba(0,0,0,.55), inset 0 -.012em .02em rgba(255,255,255,.22); }
/* one frame of the army's sprite sheet (12 frames, strongest rank first, then Bomb and Flag) */
.art { position: absolute; inset: -2.5% -1%; transform: rotate(calc(var(--tilt) * -1));
  background: url(img/army-red.webp) calc(var(--i) * 100% / 11) 0 / 1200% 100% no-repeat #2a1c10; }
.foe .art { background-image: url(img/army-blue.webp); }
.hi { position: absolute; inset: 0; background: center / cover no-repeat; }
/* the rank: a small badge of the army's metal, pinned to the low end of the rim */
.num { position: absolute; left: -.24em; bottom: -.3em; z-index: 1; display: grid; place-items: center; box-sizing: border-box; min-width: 1.3em; height: 1.3em; padding: .06em .14em 0; border-radius: .65em;
  font: 700 .25em/1 var(--slab); font-variant-numeric: lining-nums; letter-spacing: -.02em; color: var(--m-ink);
  background: radial-gradient(circle at 34% 26%, var(--m-l), var(--m) 58%, var(--m-d) 130%);
  box-shadow: 0 0 0 .06em rgba(12,7,2,.92), 0 .09em .12em rgba(0,0,0,.55), inset 0 0 0 .06em rgba(255,255,255,.4), inset 0 0 0 .11em rgba(60,36,6,.22); }
.nm { display: none; }
/* the Spy's dagger, the Scout's telescope, the Sapper's pick: a small mark opposite the number */
.sig { position: absolute; right: -.24em; bottom: -.3em; z-index: 1; box-sizing: border-box; width: 1.3em; height: 1.3em; padding: .09em; border-radius: 50%; font-size: .25em; color: #fff3d6; background: #1d140b; box-shadow: 0 0 0 .06em var(--m), 0 .09em .12em rgba(0,0,0,.55); }
.sig svg { display: block; width: 100%; height: 100%; }
.mini .sig { display: none; }
.clash-pc .sig { font-size: .12em; right: -.1em; bottom: -.2em; }
/* the tag beside a piece that is picked up or looked at: its name, and a line on what it does */
.tag { position: absolute; z-index: 45; left: calc((var(--x) + .5) * 10%); top: calc((var(--y) + 1) * 10%); transform: translate(-50%, 5px); width: max-content; max-width: min(64%, 236px); padding: 5px 9px 6px; border-radius: 8px; border: 1px solid var(--brass-d); background: rgba(24,16,9,.95); color: #e9d8ad; font: 12px/1.3 var(--serif); text-align: left; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.tag b { display: block; font: 700 12.5px/1.25 var(--slab); color: #fff3d6; }
.tag.above { top: calc(var(--y) * 10%); transform: translate(-50%, calc(-100% - 5px)); }
.tag.l { left: calc(var(--x) * 10%); transform: translate(0, 5px); } .tag.l.above { transform: translate(0, calc(-100% - 5px)); }
.tag.r { left: calc((var(--x) + 1) * 10%); transform: translate(-100%, 5px); } .tag.r.above { transform: translate(-100%, calc(-100% - 5px)); }
/* face down: enamel in the army's colour, engine-turned, with the army's star */
.back .win { background:
    repeating-conic-gradient(rgba(255,255,255,.12) 0 5deg, rgba(0,0,0,.12) 5deg 10deg),
    radial-gradient(circle at 42% 34%, var(--c-l), var(--c) 52%, var(--c-d)); }
.emblem { position: absolute; left: 50%; top: 50%; width: .34em; height: .34em; margin: -.17em 0 0 -.17em; color: var(--m-l); filter: drop-shadow(0 .012em 0 rgba(0,0,0,.7)); }
/* one of my pieces that the enemy has already seen */
.seen { position: absolute; right: -.01em; top: -.03em; z-index: 1; width: .23em; height: .23em; padding: .03em; border-radius: 50%; background: var(--brass); color: #3b2a00; box-shadow: 0 0 0 .012em rgba(12,7,2,.8), 0 .015em .03em rgba(0,0,0,.6), inset 0 0 0 .01em rgba(255,255,255,.5); display: none; }
.pc.known .seen { display: block; }
/* a piece on high ground wears "+1" at its upper left: attacked there, it fights one rank higher (brass, as the eye is) */
.high { display: none; position: absolute; left: 0; top: 0; z-index: 1; font: 800 .17em/1.45 var(--slab); min-width: 1.75em; height: 1.45em; padding: 0 .12em; box-sizing: border-box; border-radius: .72em; transform: translate(-14%, -20%); background: var(--brass); color: #2a1c00; text-align: center; letter-spacing: -.02em; box-shadow: 0 0 0 .07em rgba(12,7,2,.8), 0 .09em .18em rgba(0,0,0,.6), inset 0 .07em 0 rgba(255,246,208,.55); }
.pc.up .high { display: block; }
.pc.flagged .tok { filter: drop-shadow(0 0 .025em #fff) drop-shadow(0 0 .09em var(--brass-l)) drop-shadow(0 0 .2em var(--brass)); }
.pc.flagged::after { content: ""; position: absolute; inset: -.04em -.03em; border-radius: 50%; transform: rotate(var(--tilt)); border: .03em solid var(--brass-l); box-shadow: 0 0 .12em var(--brass); animation: reach-pulse .9s ease-in-out infinite alternate; pointer-events: none; }
.pc.sel { z-index: 15 !important; }
.pc.sel .tok { transform: translateY(-.1em) scale(1.12); filter: drop-shadow(0 0 .02em #fff) drop-shadow(0 0 .05em var(--brass-l)) drop-shadow(0 0 .11em var(--brass)) drop-shadow(0 .13em .07em rgba(50,30,8,.6)); }
.pc.lunge { z-index: 16 !important; transition-timing-function: cubic-bezier(.5,0,.8,.4); }
.flip .tok { animation: flip .45s ease-out; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(1.1); filter: brightness(1.8); } 60% { transform: rotateY(0) scale(1.1); } 100% { transform: none; } }
.pc.dying { z-index: 14 !important; }
.pc.dying .tok { animation: die .38s ease-in forwards; transform-origin: 50% 100%; }
@keyframes die { 25% { transform: rotate(-8deg); filter: brightness(1.6) saturate(.3); } 100% { transform: rotate(-86deg) translateY(.2em) scale(.8); opacity: 0; filter: saturate(0); } }

@container board (min-width: 520px) {
  .num, .sig { font-size: .2em; }
}

.pc.ready .tok { filter: drop-shadow(0 0 .02em rgba(255,238,176,.95)) drop-shadow(0 .045em .03em rgba(50,30,8,.5)); }
.pc.dragging { transition: none; z-index: 18 !important; }
.pc.dragging .tok { transform: scale(1.2); filter: drop-shadow(0 0 .03em #fff) drop-shadow(0 .2em .11em rgba(30,18,6,.6)); }
.pc.nudge .tok { animation: nudge .3s; }
@keyframes nudge { 20% { transform: translateX(-.07em); } 45% { transform: translateX(.07em); } 70% { transform: translateX(-.04em); } }

/* ---------- a fight: both pieces brought forward, the hidden one turned, the verdict held ---------- */
.clash { position: absolute; z-index: 40; transform: translate(-50%, -50%); display: flex; align-items: flex-end; gap: .6cqw; pointer-events: none; }
.clash-pc { position: relative; width: 1em; height: .8em; font-size: 29cqw; animation: clash-in .22s cubic-bezier(.2,1.4,.4,1) both; transition: transform .25s, filter .25s; }
.clash-pc.mine { transform-origin: 100% 100%; } .clash-pc.foe { transform-origin: 0 100%; }
@keyframes clash-in { from { transform: scale(.45); opacity: 0; } }
.clash-pc .num { font-size: .12em; left: -.1em; bottom: -.2em; }
.clash-pc .nm { display: block; position: absolute; left: 50%; bottom: -.035em; z-index: 1; transform: translateX(-50%); padding: .016em .05em .012em; border-radius: .02em; white-space: nowrap;
  font: 700 .058em/1.25 var(--slab); letter-spacing: .14em; text-transform: uppercase; color: var(--m-ink);
  background: linear-gradient(180deg, var(--m-l), var(--m) 70%); box-shadow: 0 0 0 .007em rgba(12,7,2,.9), 0 .012em .02em rgba(0,0,0,.5), inset 0 0 0 .006em rgba(255,255,255,.5); }
.clash-pc.crack::before { content: ""; position: absolute; inset: -18%; z-index: 3; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255,232,150,.85) 28%, transparent 66%); animation: flash .32s ease-out forwards; }
.clash-pc.won { transform: translateY(-6%) scale(1.09); z-index: 2; }
.clash-pc.won .tok { filter: drop-shadow(0 0 .03em #fff) drop-shadow(0 0 .1em var(--brass)); }
.clash-pc.fell { filter: grayscale(.85) brightness(.82); }
.clash-pc.gone { animation: topple-l .34s ease-in forwards; }
.clash-pc.foe.gone { animation-name: topple-r; }
@keyframes topple-l { to { transform: rotate(-82deg) translateY(.12em) scale(.8); opacity: 0; } }
@keyframes topple-r { to { transform: rotate(82deg) translateY(.12em) scale(.8); opacity: 0; } }
.clash-pc.gone::after { content: ""; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(66,56,50,.9), rgba(66,56,50,.55) 42%, transparent 70%); animation: puff .45s ease-out forwards; }
@keyframes puff { from { transform: scale(.4); opacity: .95; } to { transform: scale(1.5); opacity: 0; } }
/* the verdict in words: always centred on the map, just under the pieces (or above them near the bottom edge) */
.clash-text { position: absolute; left: 50%; z-index: 41; width: max-content; max-width: 88cqw; margin: 0; padding: 1.1cqw 2.6cqw; border-radius: 1cqw; text-align: center; pointer-events: none; text-wrap: balance; transform: translate(-50%, 14.6cqw); font: 700 clamp(13px, 3.2cqw, 21px)/1.25 var(--serif); color: var(--sepia);
  background: linear-gradient(175deg, #f4e6bf, #dcc591); box-shadow: 0 .5cqw 1.6cqw rgba(0,0,0,.55), inset 0 0 0 .18cqw rgba(59,40,20,.5); }
.clash-text.above { transform: translate(-50%, calc(-100% - 14cqw)); }
.board.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translate(-.6%, .4%); } 40% { transform: translate(.6%, -.5%); } 60% { transform: translate(-.4%, -.3%); } 80% { transform: translate(.3%, .2%); } }

.burst { position: absolute; left: 0; top: 0; width: 10%; height: 10%; transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%)); }
.burst::before { content: ""; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #ffe08a 30%, rgba(255,120,40,.7) 55%, transparent 70%); animation: flash .55s ease-out forwards; }
.burst.boom::before { inset: -110%; animation-duration: .85s; background: radial-gradient(circle, #fff 0%, #ffd27a 25%, rgba(230,80,20,.8) 50%, rgba(60,40,30,.5) 62%, transparent 72%); }
.burst.flag::before { background: radial-gradient(circle, #fff 0%, #fff3b0 35%, rgba(227,176,75,.8) 55%, transparent 72%); inset: -130%; animation-duration: 1s; }
.burst i { position: absolute; left: 46%; top: 46%; width: 8%; height: 8%; border-radius: 50%; background: #c2580c; animation: spark .6s ease-out forwards; }
.burst.boom i { background: #3b2814; animation-duration: .85s; }
.burst i:nth-child(1) { --dx: 0; --dy: -1; } .burst i:nth-child(2) { --dx: .7; --dy: -.7; } .burst i:nth-child(3) { --dx: 1; --dy: 0; } .burst i:nth-child(4) { --dx: .7; --dy: .7; }
.burst i:nth-child(5) { --dx: 0; --dy: 1; } .burst i:nth-child(6) { --dx: -.7; --dy: .7; } .burst i:nth-child(7) { --dx: -1; --dy: 0; } .burst i:nth-child(8) { --dx: -.7; --dy: -.7; }
@keyframes flash { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@keyframes spark { to { transform: translate(calc(var(--dx) * 900%), calc(var(--dy) * 900%)) scale(.2); opacity: 0; } }

/* ---------- side panels ---------- */
.side { display: flex; flex-direction: column; gap: 7px; }
.panel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 7px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 16px rgba(0,0,0,.3); }
.app[data-phase="setup"] .play-only, .app:not([data-phase="setup"]) .setup-only { display: none; }
/* a scenario that hands over an army to lay out: no formations to choose or save, a line and "Deal again" in their place */
.app[data-dealt="true"] .own-only, .app:not([data-dealt="true"]) .dealt-only { display: none !important; }
/* Setting out the army: the button that starts the battle stays in sight, even where the orders have to scroll. */
.app[data-phase="setup"] #start { position: sticky; bottom: 5px; z-index: 3; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.lbl { margin: 0; font: 700 10px/1.2 var(--slab); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lbl:not(:first-child) { margin-top: 3px; }
.foes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.foes button { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; text-align: left; min-height: 48px; padding: 6px 4px 6px 6px; border-radius: 10px; border: 1px solid var(--line); background: #1a130c; cursor: pointer; color: var(--muted); min-width: 0; }
.foes .who { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(20,12,4,.7), 0 1px 3px rgba(0,0,0,.45); filter: saturate(.8) brightness(.92); transition: filter .2s; }
.foes button[aria-checked="true"] .who { filter: none; box-shadow: 0 0 0 1.5px var(--brass-l), 0 2px 5px rgba(0,0,0,.5); }
.foe-name { font: 700 11.5px/1.15 var(--slab); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* German writes a commander's name whole, on the two small plates too ("Leutnant Wren", never "Lt. Wren": the
   owner's plan, 2026-11-21), and whole it is wider than a plate. There it stands in two lines, the rank over
   the name, each of the three the same way and none cut off. (The words say which language they are in: the
   page's lang reaches the game through its host.) */
.foe-name:lang(de), .plate.foe .pname:lang(de) { width: min-content; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.12; }
.plate.foe .pname:lang(de) { text-align: center; }
.foe-lv { display: flex; align-items: center; gap: 4px; font-size: 11px; }
/* A commander's level, the same wherever it is shown: its word on its own colour, with one to three
   chevrons lit. Never stars: those are what a scenario is scored in. The pale edge keeps the tag
   apart from whatever it lies on, parchment or the dark red of the chosen card. */
.lv { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 4px; border-radius: 999px; border: 1px solid rgba(255,244,214,.65); color: #fff6dc; font: 700 10.5px/1 var(--slab); font-style: normal; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.lv svg { flex: none; width: 12px; height: 12px; }
.lv-easy { background: #2f6b3d; } .lv-medium { background: #8a5d12; } .lv-hard { background: #a3231b; }
/* where a newcomer begins: a small flag on the gentlest commander's card */
.foes button { position: relative; }
.foe-new { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 3px 6px 2px 7px; background: #f3e6c0; color: #7d1810; font: 700 9px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 0 0 1px #3b2814, 0 1px 3px rgba(0,0,0,.45); pointer-events: none; }
#foe-blurb b { display: block; font-style: normal; }
.foes button:hover { border-color: var(--brass-d); }
.foes button[aria-checked="true"] { border-color: var(--brass); background: linear-gradient(180deg, #4a3518, #2c200f); box-shadow: 0 0 0 1px var(--brass), 0 3px 8px rgba(0,0,0,.4); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #1a130c; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { min-height: 36px; padding: 0 2px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 700 12.5px/1 var(--slab); letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: #2a1d00; background: linear-gradient(180deg, var(--brass-l), var(--brass)); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 2px 5px rgba(0,0,0,.4); }
.hint { margin: 0; font: italic 12.5px/1.35 var(--serif); color: var(--muted); min-height: 1.35em; }
.wide-only { display: none; }
/* Buttons. The parchment plate is kept for what a screen is about: the wordmark, a card, a sheet. A button is
   never a small plate (2026-11-17: the owner found the first screen "untidy: too many of the same banner, of
   all sizes, like plasters"). There are four things to press, and one size of each on a screen:
     .btn.star      the one thing to do on a screen: the plate made of the seal's wax (see "the main button")
     .btn.primary   the button to press in a panel: solid, in the wordmark's ink, its words in the paper's colour
     .btn           any other button: a ruled line round its words and nothing behind them
     .btn.small     the same, small, its words as they are written (they are often a sentence)
     .quiet         less than a button: words with a line under them (More ways to play, Back, the doors)
   A button takes its colour from what it stands on: light words on the dark table, ink on parchment. */
.btn { min-height: 44px; padding: 0 14px; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 55%, transparent); border-radius: 3px; background: none; color: inherit;
  font: 700 12px/1.15 var(--display); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: transform .08s ease-out, background-color .12s, border-color .12s; }
.btn:hover:not(:disabled) { border-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px); background: color-mix(in srgb, currentColor 18%, transparent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 34px; padding: 0 10px; font: 700 12px/1.15 var(--slab); letter-spacing: .01em; text-transform: none; }
.btn.small[aria-pressed="true"] { border-color: currentColor; background: color-mix(in srgb, currentColor 16%, transparent); }
.btn.primary { border-color: #2b1a0c; background: linear-gradient(180deg, #4a3320, #3b2814); color: #f7ebc8; font-size: 13px; letter-spacing: .1em; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.btn.primary:hover:not(:disabled) { border-color: #2b1a0c; background: linear-gradient(180deg, #5a4028, #46301a); }
.btn.primary:active:not(:disabled) { background: linear-gradient(180deg, #3b2814, #2b1a0c); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
/* a button that is asking before it ends a battle: it fills with the seal's wax, its words in the paper's colour, until it is pressed again or the time is up */
.btn.armed, .btn.armed:hover:not(:disabled) { border-color: #5a0f0a; background: radial-gradient(120% 170% at 38% 15%, #b8332a, #8c1c14 60%, #5a0f0a); color: #f7ebc8; text-shadow: 0 1px 0 #3d0906; letter-spacing: .06em; }
.btn.big { min-height: 52px; font-size: 15.5px; margin: 3px 0 4px; }
/* the one that destroys something: a ruled line and words in the wax's red */
.btn.wipe, .btn.small.wipe { justify-self: start; min-height: 32px; padding: 0 12px; color: #5a100c; background: none; border: 1px solid rgba(90,16,12,.5); border-radius: 8px; box-shadow: none; font: 700 11.5px/1.1 var(--slab); letter-spacing: .02em; text-transform: none; }
.btn.wipe:hover:not(:disabled) { background: rgba(90,16,12,.1); border-color: #5a100c; }
/* less than a button: words with a line under them */
.quiet { min-height: 40px; padding: 0 4px; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: inherit; font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; white-space: nowrap; }
.quiet:hover, .quiet:focus-visible { text-decoration-thickness: 2px; }
.quiet[hidden] { display: none; }
.quiet.armed, .gate .quiet.armed { color: #f08a7e; text-decoration-thickness: 2px; }

.guide { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 0 12px; font-size: 13.5px; color: #dccfb4; }
.guide summary { cursor: pointer; padding: 11px 0; font: 700 13px/1.2 var(--slab); letter-spacing: .03em; color: var(--ink); }
.guide ul { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 5px; }


/* the aide's note */
.log { position: relative; margin: 0; min-height: 46px; padding: 7px 11px 7px 52px; display: flex; align-items: center; border-radius: 8px; font: 600 13.5px/1.3 var(--serif); color: var(--sepia);
  background: linear-gradient(175deg, #efdfb6, #dcc591); border-left: 4px solid var(--brass-d); box-shadow: inset 0 0 12px rgba(92,56,16,.35), 0 3px 8px rgba(0,0,0,.3); }
.log p { margin: 0; flex: 1 1 60%; min-width: 0; }
/* beside the map the panels are a column that scrolls when it is too tall: the note keeps its height there, so that its words are never cut */
.side > .log { flex-shrink: 0; }
.log p:empty::before { content: "\00a0"; }
.app[data-phase="setup"] .log:not(.tip) { display: none; }
/* a lesson, or a second thought before a costly move */
.log.tip, .log.warn { flex-wrap: wrap; gap: 6px 10px; padding-top: 9px; padding-bottom: 9px; animation: aide-in .3s cubic-bezier(.2,1.3,.4,1); }
.log.tip { box-shadow: 0 0 0 2px var(--brass), 0 0 18px rgba(227,176,75,.45), inset 0 0 12px rgba(92,56,16,.35); }
.log.warn { border-left-color: var(--red); box-shadow: 0 0 0 2px var(--red-l), 0 0 18px rgba(223,90,72,.45), inset 0 0 12px rgba(92,56,16,.35); }
@keyframes aide-in { from { transform: translateY(6px); opacity: 0; } }
/* The aide's note over the map itself: whenever it waits for an answer, and whenever its place
   under the map is out of sight (game.js, popAide). It stands beside the squares it is about. */
.aide-pop { position: absolute; left: 50%; z-index: 60; width: min(96%, 420px); translate: -50% 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 11px 9px 52px; border-radius: 8px;
  font: 600 13.5px/1.3 var(--serif); color: var(--sepia); background: linear-gradient(175deg, #f4e6c0, #dcc591); border-left: 4px solid var(--brass-d);
  box-shadow: 0 0 0 2px var(--brass), 0 0 18px rgba(227,176,75,.45), 0 10px 24px rgba(0,0,0,.6), inset 0 0 12px rgba(92,56,16,.3); animation: aide-in .3s cubic-bezier(.2,1.3,.4,1); }
.aide-pop[hidden] { display: none; }
.aide-pop.warn { border-left-color: var(--red); box-shadow: 0 0 0 2px var(--red-l), 0 0 18px rgba(223,90,72,.5), 0 10px 24px rgba(0,0,0,.6), inset 0 0 12px rgba(92,56,16,.3); }
.aide-pop p { margin: 0; flex: 1 1 60%; min-width: 0; }
.aide-pop::after { content: ""; position: absolute; left: 8px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%); border-radius: 50%; background: #2a1c10 url(img/people/aide.webp) center / cover no-repeat; box-shadow: 0 0 0 1.5px var(--brass-d); }
.aide-pop .aide-actions .btn.small { min-height: 36px; padding: 0 10px; }
.aide-actions { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.aide-actions .btn.small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.aide-actions .link { color: #5a3410; padding: 4px 2px; font-size: 11.5px; }
.app.point-grave .grave-btn, .app.point-grave .grave { outline: 2px solid var(--brass-l); outline-offset: 2px; animation: reach-pulse .7s ease-in-out infinite alternate; }
/* the aide's pointer on the map */
.tip-mark { position: absolute; left: 0; top: 0; width: 10%; height: 10%; transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%)); pointer-events: none; }
.tip-mark::before { content: ""; position: absolute; inset: -5% -3%; border-radius: 50%; transform: rotate(var(--tilt)); border: .45cqw solid var(--brass-l); box-shadow: 0 0 1.6cqw var(--brass), inset 0 0 1cqw rgba(247,220,143,.55); animation: reach-pulse .8s ease-in-out infinite alternate; }
.tip-mark::after { content: ""; position: absolute; left: 50%; top: -30%; width: 2.6cqw; height: 2.1cqw; margin-left: -1.3cqw; background: linear-gradient(180deg, #fff3c4, var(--brass)); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 .25cqw 0 #3a2608); animation: tip-bob .55s ease-in-out infinite alternate; }
@keyframes tip-bob { to { transform: translateY(-.9cqw); } }
/* the aide who writes the notes */
.log::after { content: ""; position: absolute; left: 8px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%); border-radius: 50%; background: #2a1c10 url(img/people/aide.webp) center / cover no-repeat; box-shadow: 0 0 0 1.5px var(--brass-d), 0 1px 3px rgba(0,0,0,.45); }
/* pieces left, rank by rank. A drawer on a phone, a fixed panel on a wide screen. */
.grave { position: absolute; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; gap: 8px; padding: 10px 9px calc(12px + env(safe-area-inset-bottom));
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--panel2), var(--panel)); box-shadow: 0 -12px 30px rgba(0,0,0,.65);
  transform: translateY(106%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.3,1), visibility 0s .28s; }
.app.grave-open .grave { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.3,1); }
.grave-head { display: flex; align-items: center; justify-content: space-between; }
.mini-btn { width: 30px; height: 30px; } .mini-btn svg { width: 20px; height: 20px; }
.grave-row { display: grid; gap: 4px; }
.grave-who { display: flex; justify-content: space-between; font: 700 10px/1.2 var(--slab); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.grave-who b { color: var(--ink); }
.grave-row ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.app[data-mode="skirmish"] .grave-row ul { grid-template-columns: repeat(7, 1fr); }
.grave-row li { display: grid; justify-items: center; gap: 5px; padding: 5px 0 4px; min-width: 0; border-radius: 6px; background: rgba(0,0,0,.3); }
.mini { position: relative; width: 36px; max-width: calc(100% - 8px); aspect-ratio: 1.26; }
.mini .win { inset: 3px; box-shadow: 0 0 0 .7px var(--m-l); }
.mini .win::after { display: none; }
.mini .num { left: -4px; bottom: -4px; font-size: 8.5px; box-shadow: 0 0 0 1px rgba(12,7,2,.92), inset 0 0 0 .5px rgba(255,255,255,.4); }
.gc { font: 700 11px/1 var(--slab); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.gc i { font-style: normal; font-size: 9px; opacity: .55; }
.grave-row li.out { opacity: .36; }
/* their side of the list where the armies were not told: a note, and two short lists of what has shown itself */
.grave-note { margin: 0; font: italic 12px/1.3 var(--serif); color: var(--muted); }
.grave-sub { margin: 3px 0 0; font: 700 9px/1.2 var(--slab); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grave-none { margin: 0; font: italic 12px/1.3 var(--serif); color: var(--muted); opacity: .8; }
.grave-row li.chg { animation: chg 1.1s; }
@keyframes chg { 0%, 45% { background: var(--brass); } }

/* ---------- result ---------- */
.overlay { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; background: rgba(12,8,4,.74); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .35s ease-out; overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
/* how a battle ended: a sheet like the others (the wordmark's plate), the word in its pressed capitals */
.result-card { --pb: 20px; position: relative; width: min(100%, 390px); min-width: 0; padding: 4px 0 0; text-align: center; color: var(--sepia);
  border: var(--pb) solid transparent; border-image: url(img/brand/plate.svg) 24 fill / var(--pb) stretch; filter: drop-shadow(0 16px 28px rgba(0,0,0,.75)); animation: rise .5s cubic-bezier(.2,1.2,.3,1); }
.result-card .lbl { color: #5a3410; }
@keyframes rise { from { transform: translateY(26px) scale(.92); opacity: 0; } }
.medal { width: 96px; height: 92px; margin: -4px auto 4px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); animation: medal .8s cubic-bezier(.2,1.4,.3,1) .15s backwards; }
@keyframes medal { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
.result-card [aria-level="2"] { margin: 0; font: 700 32px/1.1 var(--display); letter-spacing: .1em; text-indent: .1em; text-transform: uppercase; color: #2b1a0c; text-shadow: .7px 1px 0 rgba(255,248,222,.7); }
.result-card p { margin: 8px 0 0; color: #4a321a; font-family: var(--serif); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 16px 0 10px; }
.stats div { background: rgba(59,40,20,.08); border: 1px solid rgba(59,40,20,.35); border-radius: 4px; padding: 8px 2px; }
.stats dt { font: 700 9px/1.2 var(--slab); letter-spacing: .1em; text-transform: uppercase; color: #5a4424; }
.stats dd { margin: 4px 0 0; font: 700 20px/1 var(--slab); font-variant-numeric: tabular-nums; color: #2b1a0c; }
.report { margin: 2px 0 10px; padding: 9px 12px 10px; text-align: left; border-radius: 4px; background: rgba(59,40,20,.08); border: 1px solid rgba(59,40,20,.35); }
.report [aria-level="3"] { margin: 0 0 6px; }
.report ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font: 13px/1.3 var(--serif); color: #3b2814; }
.report li { padding-left: 13px; position: relative; }
.report li::before { content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; background: #7d1810; transform: rotate(45deg); }
.report-line { display: block; width: 100%; padding: 1px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 3px; }
.report-line:hover { color: #7d1810; text-decoration: underline; text-underline-offset: 3px; }
.record { font-size: 13px; color: #5a4424 !important; font-style: italic; white-space: pre-line; }
/* medals: a brass disc with a drawing; grey until earned */
.medal-i { flex: none; display: block; width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: #3b2a00; background: radial-gradient(circle at 35% 28%, #fff0b8, var(--brass) 52%, var(--brass-d)); box-shadow: 0 0 0 1.5px #3a2608, 0 2px 4px rgba(0,0,0,.45), inset 0 0 0 1.5px rgba(255,255,255,.35); }
.earned { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; }
.earned li { display: flex; align-items: center; gap: 7px; font: 700 12px/1.1 var(--slab); color: #2b1a0c; animation: medal .7s cubic-bezier(.2,1.4,.3,1) .5s backwards; }
/* replay: a slider and five keys */
.replay-bar { gap: 8px; }
.replay-bar input[type="range"] { width: 100%; height: 24px; margin: 0; accent-color: var(--brass); cursor: pointer; }
.replay-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.replay-keys .btn { min-height: 38px; padding: 0; display: grid; place-items: center; }
.replay-keys svg { flex: none; width: 20px; height: 20px; }
/* the record book */
.sheet.records-sheet { z-index: 94; }
/* ---------- the field manual: the rules, shown ---------- */
.sheet.manual-sheet .sheet-card { width: min(100%, 880px); gap: 12px; }
.tag-more { display: block; margin-top: 3px; padding: 2px 0; border: 0; background: none; cursor: pointer; pointer-events: auto; font: italic 12px/1.2 var(--serif); color: var(--brass-l); text-decoration: underline; text-underline-offset: 2px; }
.m-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 9px; background: rgba(59,40,20,.14); box-shadow: inset 0 0 0 1px rgba(59,40,20,.3); }
.m-tabs button { min-height: 42px; padding: 0 4px; border: 0; border-radius: 4px; background: none; cursor: pointer; font: 700 11.5px/1.1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #5a4424; }
.m-tabs button[aria-selected="true"] { color: #f7ebc8; background: linear-gradient(180deg, #4a3320, #3b2814); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 5px rgba(40,20,5,.45); }
.m-pane[hidden] { display: none; }
.manual-sheet .lbl { margin: 0 0 8px; color: #6b4a1c; }
/* a piece as the manual draws it: the game's own painting in an oval, its number pinned on */
.mtok { position: relative; display: block; flex: none; width: var(--w, 60px); aspect-ratio: 1.3; padding: 0; border: 0; border-radius: 50%; background: #2a1c10 url(img/army-red.webp) calc(var(--n) * 100% / 11) 0 / 1200% 100% no-repeat; --rim: #8f2118; --metal: #e3b04b; box-shadow: 0 0 0 calc(var(--w, 60px) * .045) var(--rim), 0 0 0 calc(var(--w, 60px) * .07) var(--metal), 0 0 0 calc(var(--w, 60px) * .085) #1a1108, 0 4px 8px rgba(40,20,5,.45); }
.mtok.blue { background-image: url(img/army-blue.webp); --rim: #23518f; --metal: #c9d2de; }
.mtok.back { background: radial-gradient(circle at 50% 50%, #5d8fd6 0 12%, #2c62ad 13% 100%); }
.mtok.back b { visibility: hidden; }
.mtok b { position: absolute; left: -8%; bottom: -10%; min-width: 38%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font: 800 calc(var(--w, 60px) * .21)/1 var(--slab); color: #2a1806; background: radial-gradient(circle at 35% 30%, #fbe7a6, #e3b04b 60%, #a87420); box-shadow: 0 0 0 1.5px #3a2408; }
.mtok.blue b { background: radial-gradient(circle at 35% 30%, #fff, #c9d2de 60%, #8792a3); }
button.mtok { cursor: pointer; }
button.mtok[aria-pressed="true"] { outline: 3px solid #5a100c; outline-offset: 5px; }
button.mtok:focus-visible { outline: 3px solid var(--brass); outline-offset: 5px; }
/* a strip of map on which a rule is shown happening */
.demo { padding: 10px 12px; border-radius: 6px; background: linear-gradient(170deg, #f1e3bb, #dcc591); box-shadow: inset 0 0 0 1px rgba(90,60,20,.45); }
.lane { position: relative; height: 58px; border-radius: 3px; background-image: linear-gradient(90deg, rgba(90,60,20,.3) 1px, transparent 1px); background-size: 20% 100%; box-shadow: inset 0 0 0 1px rgba(90,60,20,.4); }
.lane .mtok { position: absolute; top: 50%; left: calc(var(--at) * 20% + 10%); translate: -50% -50%; --w: 50px; transition: left .7s cubic-bezier(.3,.1,.2,1), opacity .35s .55s, scale .35s .55s; }
.lane .mtok.gone { opacity: 0; scale: .6; }
.said { margin: 8px 0 0; min-height: 2.9em; font: 600 14px/1.45 var(--serif); color: #3b2814; }
/* the manual's "Show it again". (It was .again, the very class the title screen carries once it has been seen, and its
   justify-self: start then shrank the title screen to nothing for anyone who came back: the first screen, headquarters
   and the crest's way back to them all stood invisible.) */
.m-again { justify-self: start; margin: 2px 0 0; padding: 6px 0; border: 0; background: none; cursor: pointer; font: italic 14px/1 var(--serif); color: #5a3410; text-decoration: underline; text-underline-offset: 3px; }
/* how to play: six cards */
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.how li { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 8px; background: rgba(255,250,232,.62); box-shadow: 0 0 0 1px rgba(59,40,20,.24); }
.how-t b { display: block; font: 700 15px/1.2 var(--slab); color: #5a100c; }
.how-t p { margin: 4px 0 0; font: 15px/1.45 var(--serif); color: #3b2814; }
/* the pieces: the twelve on the left, the one chosen on the right */
.m-guide { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 18px 8px; justify-items: center; padding: 6px 4px 8px; }
.m-grid figure { margin: 0; display: grid; justify-items: center; gap: 9px; }
.m-grid figcaption { font: 700 11.5px/1.1 var(--slab); color: #3b2814; text-align: center; }
.m-card { display: grid; gap: 12px; padding: 14px; border-radius: 8px; background: rgba(255,250,232,.62); box-shadow: 0 0 0 1px rgba(59,40,20,.24); }
.m-who { display: flex; align-items: center; gap: 18px; padding: 6px 0 2px 8px; }
.m-who [aria-level="3"] { font: 800 25px/1.1 var(--display); color: #5a100c; }
.m-who p { margin: 4px 0 0; font: 700 10.5px/1.3 var(--slab); letter-spacing: .1em; text-transform: uppercase; color: #6b4a1c; }
.m-power { margin: 0; font: italic 16px/1.45 var(--serif); color: #3b2814; }
.m-rows { display: grid; gap: 10px; }
.m-rows div { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 8px; min-height: 30px; }
.m-rows span:not(.mtok) { flex: 0 0 100%; font: 700 10.5px/1.2 var(--slab); letter-spacing: .12em; text-transform: uppercase; color: #6b4a1c; }
.m-rows em { font: italic 14px/1.3 var(--serif); color: #6b5334; }
/* who wins? */
.m-pick { display: flex; flex-wrap: wrap; gap: 14px 12px; padding: 6px 4px 12px; --w: 52px; }
.m-pick .mtok { --w: 52px; }
.m-verdict { margin-top: 4px; padding: 14px; border-radius: 8px; text-align: center; color: #fff3d6; background: linear-gradient(180deg, #7d1a14, #5a100c); box-shadow: 0 0 0 2px var(--brass), 0 6px 14px rgba(40,20,5,.45); }
.m-verdict b { display: block; font: 800 21px/1.2 var(--display); }
.m-verdict span { display: block; margin-top: 4px; font: italic 15px/1.4 var(--serif); color: #f1dfb4; }
/* ask the aide */
.m-ask { display: flex; gap: 12px; align-items: center; }
.m-ask .who { flex: none; width: 50px; height: 50px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 0 0 2px var(--brass), 0 0 0 3px #2a1806; }
.m-ask input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(59,40,20,.55); background: rgba(255,250,232,.8); color: #2a1806; font: 600 16px/1 var(--serif); }
.m-qa { margin-top: 10px; display: grid; }
.m-qa details { border-top: 1px solid rgba(90,60,20,.28); } .m-qa details:last-of-type { border-bottom: 1px solid rgba(90,60,20,.28); }
.m-qa summary { position: relative; list-style: none; cursor: pointer; padding: 11px 28px 11px 2px; font: 700 15px/1.35 var(--slab); color: #3b2814; }
.m-qa summary::-webkit-details-marker { display: none; }
.m-qa summary::after { content: "+"; position: absolute; right: 4px; top: 50%; translate: 0 -50%; font: 700 20px/1 var(--slab); color: #7d1a14; }
.m-qa details[open] summary::after { content: "\2013"; }
.m-qa p { margin: 0 0 12px; font: 15px/1.5 var(--serif); color: #3b2814; }
.m-none { margin: 12px 0 0; font: italic 15px/1.4 var(--serif); color: #6b5334; }
@container game (max-width: 720px) {
  .how { grid-template-columns: 1fr; }
  .m-guide { grid-template-columns: 1fr; gap: 12px; }
  .m-grid { grid-template-columns: repeat(4, 1fr); gap: 14px 6px; } .m-grid .mtok { --w: 54px; }
  .m-pick { gap: 12px 9px; } .m-pick .mtok { --w: 44px; } .lane .mtok { --w: 44px; }
  .m-tabs button { font-size: 10.5px; letter-spacing: .03em; }
  .m-who [aria-level="3"] { font-size: 22px; }
}
@container game (max-width: 399px) { .m-tabs { grid-template-columns: repeat(2, 1fr); } }
.records-sheet .sheet-card { width: min(100%, 520px); gap: 10px; }
.records-sheet .lbl { color: #5a3410; margin-top: 4px; }
.rec-foes, .rec-medals, .rec-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rec-foes li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; font-size: 13.5px; color: #3b2814; }
.rec-foes .who { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--brass-d); }
.rec-foes b, .rec-medals b { font: 700 13px/1.15 var(--slab); color: #2a1806; }
.rec-facts { margin: 0; font-size: 13px; line-height: 1.4; color: #3b2814; }
.rec-medals { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; }
.rec-medals li { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; align-items: center; font-size: 11.5px; line-height: 1.25; color: #4a321a; }
.rec-medals .medal-i { grid-row: 1 / 3; }
.rec-medals li:not(.got) { opacity: .55; }
.rec-medals li:not(.got) .medal-i { background: #8d7a58; color: #4a3a22; box-shadow: 0 0 0 1.5px #5c4a2e, inset 0 1px 2px rgba(0,0,0,.4); }
/* nothing here yet: the compass star over one line */
.none { text-align: center; font-style: italic; }
.none::before { content: ""; display: block; width: 26px; height: 26px; margin: 2px auto 5px; background: url(img/brand/compass.svg) center / contain no-repeat; }
.rec-recent li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 13px; color: #3b2814; }
.rec-recent .btn.small { min-height: 30px; padding: 0 10px; }
.title-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 16px; }
.war-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.war-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 5px; align-items: center; }
.war-list input { min-width: 0; height: 32px; padding: 0 9px; border-radius: 7px; border: 1px solid rgba(59,40,20,.55); background: rgba(255,250,232,.6); color: #2a1806; font: 700 13px/1 var(--slab); }
.war-list input::placeholder { color: rgba(59,40,20,.55); font-weight: 400; }
.war-list .btn.small { min-height: 32px; padding: 0 7px; font-size: 11.5px; }
/* the war room is wider than other sheets, for ten squares in a row; it has a shelf (a size and its five formations) and a desk (one formation, opened) */
.war-sheet .sheet-card { width: min(100%, 560px); }
.war-shelf, .war-desk { display: grid; gap: 10px; }
.war-shelf[hidden], .war-desk[hidden] { display: none; }
.war-list input:disabled { opacity: .75; }
.war-sheet .hint { margin: 0; min-height: 1.35em; text-align: center; color: #4a321a; font-size: 13.5px; }
.war-sheet .seg { background: rgba(59,40,20,.14); border-color: rgba(59,40,20,.5); }
.war-sheet .seg button { color: #4a321a; min-height: 34px; font-size: 12px; }
.war-sheet .seg button:hover { color: #2a1806; }
.war-sheet .seg button[aria-checked="true"] { color: #fff3d6; background: linear-gradient(180deg, #4a3320, #3b2814); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 5px rgba(40,20,5,.45); }
.war-desk input { min-width: 0; height: 36px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(59,40,20,.55); background: rgba(255,250,232,.6); color: #2a1806; font: 700 14px/1 var(--slab); }
/* the formation on the desk: four rows of ten squares, the front row at the top; each piece is the game's own small token */
.war-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; padding: 8px 6px; border-radius: 6px; background: rgba(59,40,20,.1); box-shadow: inset 0 0 0 1px rgba(59,40,20,.4); }
.war-cell { position: relative; aspect-ratio: 1.12; display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: rgba(255,250,232,.28); box-shadow: inset 0 0 0 1px rgba(59,40,20,.22); cursor: pointer; }
.war-cell .mtok { --w: 30px; width: 80%; pointer-events: none; }
.war-cell .mtok b { min-width: 46%; font-size: 10.5px; }
.war-cell[aria-pressed="true"] { background: rgba(140,28,20,.22); box-shadow: inset 0 0 0 2px #8c1c14; }
.war-cell:focus-visible { outline: 2px solid #8c1c14; outline-offset: 1px; }
#war-map[hidden] { display: none; }
/* scenarios: a road of ten numbered stops, a briefing, and the aims shown during play */
.rocks { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.scen-list { list-style: none; margin: 0; padding: 0 0 0 2px; display: grid; gap: 4px; }
/* The road between the numbers is drawn row by row, down the middle of each row's own number column: it is under the
   circles whatever a row's height, and never in the words' column (the owner saw it run through the titles). The
   row is laid out by a part inside the button, not by the button itself, and the words begin well clear of the circles. */
.scen-list li { position: relative; --num: 32px; }
.scen-list li::before { content: ""; position: absolute; left: calc(var(--num) / 2); top: -2px; bottom: -2px; border-left: 2px dashed rgba(90,52,16,.5); pointer-events: none; }
.scen-list li:first-child::before { top: 50%; } .scen-list li:last-child::before { bottom: 50%; }
/* The list is in chapters. A chapter's name is a row of its own with no road through it: the road of each chapter
   starts at its first scenario and ends at its last. Beside the name, the stars won in the chapter; under it,
   while the chapter is shut, what opens it. One chapter's scenarios are listed at a time: pressing a name opens
   that chapter and puts the others away (the small mark before the name says which way it stands). */
.scen-list li.scen-chap::before { content: none; }
.scen-list li.scen-chap + li::before { top: 50%; }
.scen-list li:has(+ li.scen-chap)::before, .scen-list li:not(.scen-chap):last-child::before { bottom: 50%; }
.scen-chap { padding: 0 0 4px; border-bottom: 1.5px solid rgba(59,40,20,.45); }
.scen-chap:not(:first-child) { margin-top: 6px; }
#scen-more:empty { display: none; }
.scen-list .scen-chap-b { padding: 6px 8px 4px 4px; border-radius: 6px; }
.scen-chap > .scen-chap-row { padding: 6px 8px 4px 4px; }
.scen-chap-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.scen-chap-t { position: relative; display: grid; gap: 1px; min-width: 0; }
.scen-chap-t > * { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.scen-chap-b .scen-chap-t { padding-left: 18px; }
.scen-chap-b .scen-chap-t::before { content: ""; position: absolute; left: 3px; bottom: 5px; width: 7px; height: 7px; border-right: 2px solid #6b4a22; border-bottom: 2px solid #6b4a22; transform: rotate(-45deg); transition: transform .15s; }
.scen-chap-b[aria-expanded="true"] .scen-chap-t::before { transform: rotate(45deg); bottom: 7px; }
.scen-chap-t small { font: 700 10.5px/1 var(--slab); letter-spacing: .12em; text-transform: uppercase; color: #6b4a22; }
.scen-chap-t b { font: 700 18px/1.1 var(--display); color: #5a100c; }
.scen-chap.shut .scen-chap-t b { color: #5a4630; }
.scen-chap-s { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font: 700 13px/1 var(--slab); color: #3b2814; }
.scen-chap-s svg { display: inline-block; width: 14px; height: 14px; color: #9a6f1e; }
.scen-chap-s small { font-weight: 400; font-size: 12px; color: #6b4a22; }
.scen-chap-why { margin: 2px 8px 3px 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; line-height: 1.3; color: #3b2814; }
.scen-list .scen-chap-why .btn { display: inline-block; width: auto; min-height: 30px; padding: 0 12px; border: 1px solid rgba(59,40,20,.6); border-radius: 3px; text-align: center; font: 700 12px/1.15 var(--slab); color: #2a1806; }
.scen-list button { position: relative; display: block; width: 100%; padding: 4px 8px 4px 0; border: 1px solid transparent; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: #3b2814; font: inherit; }
.scen-row { display: grid; grid-template-columns: var(--num) minmax(0, 1fr) auto; align-items: center; column-gap: 14px; }
.scen-list button:hover:not(:disabled), .scen-list button[aria-current="true"] { background: rgba(59,40,20,.1); border-color: rgba(59,40,20,.5); }
/* a scenario not yet open: its words and stars are faint; its circle is the paper's own colour and whole, so that the road does not show through it */
.scen-list button:disabled { cursor: default; }
.scen-list button:disabled .scen-t, .scen-list button:disabled .scen-s { opacity: .5; }
.scen-n { position: relative; width: 30px; height: 30px; margin: 1px; display: grid; place-items: center; border-radius: 50%; font: 700 14px/1 var(--display); color: #f7ebc8; background: #3b2814; }
.scen-list button:disabled .scen-n { color: #8a744c; background: #ecdcae; box-shadow: 0 0 0 1.5px rgba(59,40,20,.45); }
.scen-t { display: grid; gap: 1px; min-width: 0; font-size: 12px; line-height: 1.25; }
.scen-t b { font: 700 13.5px/1.15 var(--slab); color: #2a1806; }
.scen-s, .stars-row { display: flex; gap: 2px; }
.scen-s i, .stars-row span { display: block; width: 15px; height: 15px; color: rgba(59,40,20,.25); }
.scen-s i.on { color: #9a6f1e; }
.scen-brief { padding: 10px 12px 12px; border-radius: 8px; background: rgba(59,40,20,.1); box-shadow: inset 0 0 0 1px rgba(59,40,20,.4); display: grid; gap: 8px; }
.scen-brief [aria-level="3"] { margin: 0; font: 700 19px/1.1 var(--display); color: #5a100c; }
.scen-brief p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #3b2814; }
.scen-brief p.scen-ground { font-size: 12.5px; font-style: italic; color: #5a4630; }
.scen-brief ul, .goals ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; line-height: 1.3; }
.scen-brief li, .goals li { position: relative; padding-left: 20px; }
.scen-brief li::before, .goals li::before { content: ""; position: absolute; left: 2px; top: .22em; width: 11px; height: 11px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .7; }
.scen-brief li:first-child, .goals li.main { font-weight: 700; }
.goals { gap: 6px; padding: 9px 11px; }
.goals li { color: #dccfb4; }
/* a line of the panel that is not an aim: reinforcements still to come (no box to tick) */
.goals li.note { padding-left: 0; font-style: italic; color: #cdb98c; } .goals li.note::before { content: none; }
.goals li.yes { color: #9fd8a4; } .goals li.no { color: #e59a8c; text-decoration: line-through; text-decoration-thickness: 1px; }
.goals li.yes::before { box-shadow: none; opacity: 1; background: #3f9a52; clip-path: polygon(12% 52%, 38% 78%, 88% 16%, 100% 28%, 38% 100%, 0 64%); }
.goals li.no::before { box-shadow: none; opacity: 1; background: #d5604c; clip-path: polygon(14% 0, 50% 36%, 86% 0, 100% 14%, 64% 50%, 100% 86%, 86% 100%, 50% 64%, 14% 100%, 0 86%, 36% 50%, 0 14%); }
.stars-row { justify-content: center; gap: 6px; margin: 4px 0 2px; }
.stars-row span { width: 26px; height: 26px; color: rgba(59,40,20,.2); }
.stars-row span.on { color: #c9952f; filter: drop-shadow(0 1px 0 rgba(43,26,12,.7)) drop-shadow(0 0 4px rgba(227,176,75,.6)); animation: medal .6s cubic-bezier(.2,1.4,.3,1) backwards; }
.stars-row span.on:nth-child(2) { animation-delay: .25s; } .stars-row span.on:nth-child(3) { animation-delay: .5s; }
.result-actions { display: grid; gap: 8px; margin-top: 14px; }
.result-actions .btn:not(.primary) { font-size: 12px; padding: 0 2px; }
/* under the main button, who or what is next; under the row, the way to choose something else: words, not a third button */
.again-note { margin: -4px 0 2px; text-align: center; font: italic 13.5px/1.2 var(--serif); color: #5a4424; }
.again-note[hidden] { display: none; }
.result-change { justify-self: center; min-height: 30px; color: #5a4424; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; animation: fall linear infinite; }
@keyframes fall { to { top: 105%; transform: rotate(720deg) translateX(30px); } }

/* ---------- title screen: a painting, lit like a lamp-lit tent ---------- */
/* until the painting has arrived, a still of it that the page may hand in (see tools/build-site.mjs) */
.title-screen { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden auto; background: #0b0806 var(--title-still, none) 50% 50% / 100% 100% no-repeat; transition: opacity .7s ease-in, transform 1.2s cubic-bezier(.5,0,.8,.4); }
.title-screen.leaving { opacity: 0; transform: scale(1.5); pointer-events: none; transform-origin: 50% 55%; }
.scene { position: absolute; inset: 0; overflow: hidden; animation: scene-in 1s ease-out both; }
.scene img { position: absolute; left: -10%; width: 120%; top: -24%; height: 112%; object-fit: cover; object-position: 50% 50%; filter: sepia(.38) saturate(.95) contrast(1.16) brightness(.6); animation: push 38s ease-in-out infinite alternate; opacity: 0; transition: opacity .5s ease-out; }
.scene img.in { opacity: 1; }
@keyframes scene-in { from { opacity: 0; } }
@keyframes push { from { transform: scale(1) translateX(-.6%); } to { transform: scale(1.07) translateX(.8%); } }
/* lamp light, then the dark of the tent closing in */
.light { position: absolute; inset: 0; background: radial-gradient(70% 40% at 50% 44%, rgba(255,176,84,.42), rgba(190,90,30,.16) 55%, transparent 78%); mix-blend-mode: soft-light; animation: lamp 4.6s ease-in-out infinite alternate; }
@keyframes lamp { 0% { opacity: .82; } 35% { opacity: 1; } 60% { opacity: .88; } 100% { opacity: .96; } }
.shade { position: absolute; inset: 0; background:
    linear-gradient(180deg, rgba(9,6,4,.92) 0%, rgba(9,6,4,.6) 16%, transparent 34%, transparent 58%, rgba(9,6,4,.8) 80%, #0b0806 100%),
    radial-gradient(120% 90% at 50% 50%, transparent 46%, rgba(6,4,2,.82) 100%); }
.grainy { position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"); opacity: .5; mix-blend-mode: overlay; }
.smoke { position: absolute; left: -30%; right: -30%; top: 22%; height: 40%; opacity: .34; filter: blur(26px); mix-blend-mode: screen;
  background: radial-gradient(28% 40% at 22% 60%, rgba(235,215,185,.8), transparent 70%), radial-gradient(34% 46% at 58% 46%, rgba(215,190,160,.7), transparent 72%), radial-gradient(26% 36% at 84% 66%, rgba(240,220,190,.7), transparent 70%);
  animation: drift 34s ease-in-out infinite alternate; }
.smoke.two { top: 36%; opacity: .26; animation-duration: 47s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translateX(-9%); } to { transform: translateX(9%); } }
.title-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 8px; z-index: 2; }
.title-tools .icon-btn { color: var(--paper); filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.title-screen[data-view="hq"] .title-tools .icon-btn { color: #2b1a0c; filter: drop-shadow(0 0 4px rgba(246,233,198,.9)); }
/* the way to an account, always in sight on the title screen (only where the page offers accounts) */
.acct-chip { min-height: 40px; padding: 0 6px; border: 0; background: none; color: var(--paper); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-shadow: 0 1px 5px #000, 0 0 2px #000; }
.acct-chip[hidden] { display: none; }
/* the page's own links, handed to the game (option `links`), stand in the same row on the first screen: words in the same hand as "Sign in", without its line until they are pointed at */
.title-links { display: flex; align-items: center; }
.title-links[hidden] { display: none; }
.tool-link { min-height: 40px; padding: 0 7px; display: inline-flex; align-items: center; color: var(--paper); font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; text-decoration: none; text-shadow: 0 1px 5px #000, 0 0 2px #000; }
.tool-link:hover { color: #fff3d6; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.tool-link:focus-visible { outline: 2px solid var(--brass-l); outline-offset: 2px; }
@container game (max-width: 430px) { .tool-link { min-height: 34px; padding: 0 5px; font-size: 10.5px; letter-spacing: .12em; } .title-screen[data-view] .title-tools { gap: 4px; right: 4px; } }
.acct-chip:hover { color: #fff3d6; text-decoration-thickness: 2px; }
.acct-chip:focus-visible { outline: 2px solid var(--brass-l); outline-offset: 2px; }
/* signed in: the flag fought under, with a green dot, then the part of the address before the @ */
.acct-chip.in { letter-spacing: .02em; text-transform: none; text-decoration: none; font: 700 13.5px/1 var(--slab); }
.acct-chip .acct-ava { width: 24px; height: 24px; margin: 0 2px 0 0; }
.acct-chip-text { display: block; max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Who is playing is shown by the flag they fight under: the Flag piece's own painting in a ring of the wordmark's ink. */
.acct-ava, .id-ava { position: relative; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-block; font-size: 0; background: #5a100c url(img/pieces/rF.webp) 46% 48% / 150% auto no-repeat; box-shadow: 0 0 0 2px #3b2814, 0 0 0 3.5px #ecd9a6, 0 0 0 4.5px #3b2814; }
.acct-ava[hidden] { display: none; }
.acct-ava::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: #5fc04a; box-shadow: 0 0 0 1.5px #2b1a0c; }
.title-head { position: relative; flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; padding: max(46px, 7cqh) 14px 6px; text-align: center; }
.title-head p, .title-head ::slotted(p) { margin: 0; }
/* Room under the line for the tails of the two g's. The gradient is painted on the letters'
   own box, which ends at the line; without this the tails had nothing behind them and showed
   cut off. The margin gives the room back, so that the line below stays where it was. */
.title-head .wordmark { padding-bottom: .2em; margin-bottom: -.2em; }
/* the name, struck in brass */
.wordmark { white-space: nowrap; font: 700 clamp(30px, 11cqw, 96px)/1.06 var(--display); letter-spacing: -.01em; color: #f0c665;
  background: linear-gradient(180deg, #fff6d2 0%, #f3d27c 34%, #b9862a 52%, #f0c665 70%, #8a5f17 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #fff3c9) drop-shadow(0 3px 0 #2a1806) drop-shadow(0 6px 14px rgba(0,0,0,.85)); animation: title-in .7s cubic-bezier(.2,.7,.2,1) .15s both; }
.wordmark span { font-style: italic; font-weight: 400; }
@keyframes title-in { from { opacity: 0; letter-spacing: .05em; } to { opacity: 1; letter-spacing: -.01em; } }
.tagline { font: italic clamp(14.5px, 3.9cqw, 20px)/1.3 var(--serif); color: var(--paper); text-shadow: 0 1px 8px #000, 0 0 2px #000; animation: line-in .5s ease-out .4s both; }
/* one plain line under it: what this is, for whoever has just arrived */
.pitch { font: 600 clamp(11.5px, 2.9cqw, 13.5px)/1.35 var(--slab); letter-spacing: .02em; color: #d9c79b; text-shadow: 0 1px 6px #000, 0 0 2px #000; animation: line-in .5s ease-out .5s both; }
.title-screen.again .pitch { animation-delay: 0s; animation-duration: .2s; }
/* the way down to the page's reading matter, at the foot of the title screen */
.more { position: relative; align-self: center; margin: -4px 0 calc(8px + env(safe-area-inset-bottom)); padding: 6px 12px; font: 700 10.5px/1 var(--slab); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-l); text-decoration: none; text-shadow: 0 1px 3px #000; }
.more[hidden] { display: none; }
.more::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.more:hover, .more:focus-visible { color: #fff3d6; }
@keyframes line-in { from { opacity: 0; transform: translateY(8px); } }

/* the orders: parchment in a carved frame with brass corners */
.title-menu { position: relative; flex: none; width: min(100% - 20px, 470px); margin: auto 0 10px; padding: 7px; border-radius: 9px; animation: line-in .45s ease-out .3s both;
  background: repeating-linear-gradient(91deg, rgba(0,0,0,.2) 0 1px, transparent 1px 5px, rgba(255,255,255,.04) 5px 6px, transparent 6px 13px), linear-gradient(135deg, #7a4d24, #4a2c12 45%, #2f1b0a 75%, #5e3a19);
  box-shadow: 0 18px 40px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,220,160,.35), inset 0 -2px 0 rgba(0,0,0,.6), 0 0 0 1px #140b04; }
.title-menu::before { content: ""; position: absolute; inset: 0; border-radius: 9px; pointer-events: none; z-index: 2; background:
    radial-gradient(circle at 9px 9px, #fff3c4 0 1.5px, var(--brass) 2px 5px, #5a3d0c 5.5px 6.5px, transparent 7px),
    radial-gradient(circle at calc(100% - 9px) 9px, #fff3c4 0 1.5px, var(--brass) 2px 5px, #5a3d0c 5.5px 6.5px, transparent 7px),
    radial-gradient(circle at 9px calc(100% - 9px), #fff3c4 0 1.5px, var(--brass) 2px 5px, #5a3d0c 5.5px 6.5px, transparent 7px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #fff3c4 0 1.5px, var(--brass) 2px 5px, #5a3d0c 5.5px 6.5px, transparent 7px); }
.sheet-paper { position: relative; border-radius: 4px; padding: 22px 12px 12px; display: flex; flex-direction: column; gap: 8px; color: var(--sepia);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='5' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .22 0 0 0 0 .07 0 0 0 1.1 -.42'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E"), linear-gradient(175deg, #efdfb6, #dcc591 60%, #cdb279);
  box-shadow: inset 0 0 0 1px rgba(59,40,20,.55), inset 0 0 26px rgba(92,56,16,.55), inset 0 0 70px rgba(92,56,16,.25); }
/* leather label, stitched */
.title-menu .lbl { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); z-index: 3; margin: 0; padding: 6px 16px 7px; white-space: nowrap; border-radius: 3px 3px 7px 7px; color: #f1dfb4; opacity: 1; font: 700 10px/1 var(--slab); letter-spacing: .22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"), linear-gradient(180deg, #5a3620, #3a2012); box-shadow: 0 3px 6px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,220,170,.25); outline: 1px dashed rgba(241,223,180,.45); outline-offset: -4px; }
.title-menu .foes button { background: linear-gradient(180deg, rgba(255,250,232,.5), rgba(214,190,140,.35)); border: 1px solid rgba(59,40,20,.5); color: rgba(59,40,20,.8); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.title-menu .foe-name { color: var(--sepia); }
.title-menu .foes button[aria-checked="true"] { background: linear-gradient(180deg, #7d1a14, #5a100c); border-color: #2c0705; color: #f1dfb4; box-shadow: 0 0 0 2px var(--brass), 0 4px 10px rgba(40,20,5,.55), inset 0 1px 0 rgba(255,255,255,.25); }
.title-menu .foes button[aria-checked="true"] .foe-name { color: #fff3d6; }
.title-menu .hint { text-align: center; color: #4a321a; min-height: 2.7em; font-size: 13.5px; }
.title-menu .seg { background: rgba(59,40,20,.14); border-color: rgba(59,40,20,.5); }
.title-menu .seg button { color: #4a321a; min-height: 34px; font-size: 12px; }
.title-menu .seg button:hover { color: #2a1806; }
.title-menu .seg button[aria-checked="true"] { color: #fff3d6; background: linear-gradient(180deg, #7d1a14, #5a100c); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 5px rgba(40,20,5,.45); }
.title-menu .hint.center { min-height: 0; margin-top: -2px; }
.title-menu .btn:not(.primary):not(.ghost) { color: #f1dfb4; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"), linear-gradient(180deg, #5a3620, #3a2012); border-color: #1f1108; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; }
.btn.ghost:hover:not(:disabled) { background: none; color: #2a1806; }
.btn.ghost:active:not(:disabled) { transform: none; }
.btn.ghost { background: none; border: 0; box-shadow: none; color: #5a3410; align-self: center; padding: 0 12px; min-height: 34px; text-decoration: underline; text-underline-offset: 3px; text-transform: none; letter-spacing: 0; font: italic 400 14px/1.15 var(--serif); }
.fine { position: relative; margin: 0 0 calc(10px + env(safe-area-inset-bottom)); text-align: center; font: 700 9.5px/1.2 var(--slab); letter-spacing: .24em; text-transform: uppercase; color: #cdb98c; text-shadow: 0 1px 3px #000; animation: line-in .5s ease-out .6s both; }
/* Somebody who has been here before is not made to wait for the entrance at all. */
.title-screen.again .scene, .title-screen.again .wordmark, .title-screen.again .tagline, .title-screen.again .title-menu, .title-screen.again .fine { animation-delay: 0s; animation-duration: .2s; }
/* saving progress to an account: one quiet line where it is offered, and its sheet */
/* signed in, that line is one row: dot, "Signed in as", the address in bold (cut short if too long), and the way to the account */
.acct-line.in { display: flex; justify-content: center; align-items: baseline; gap: 8px; max-width: 100%; }
.acct-line.in > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-line.in > span b { font-style: normal; font-weight: 700; color: #2a1806; }
.acct-line.in .btn.ghost { flex: 0 0 auto; }
.acct-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #3f9a2f; box-shadow: 0 0 0 2px rgba(63,154,47,.22); vertical-align: 1px; }
/* in the account sheet: the mark, "Signed in", and the address on a line of its own */
.acct-id { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(255,250,232,.55); border: 1px solid rgba(59,40,20,.3); min-width: 0; }
.acct-id .acct-ava { width: 44px; height: 44px; font-size: 21px; }
.acct-id .acct-ava::after { width: 12px; height: 12px; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px #2b1a0c; }
.acct-id-text { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.acct-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 10px; font: 700 10.5px/1 var(--slab); letter-spacing: .14em; text-transform: uppercase; color: #24521a; background: rgba(63,154,47,.16); border: 1px solid rgba(47,110,34,.45); }
.acct-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3f9a2f; }
.acct-mail { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 19px/1.2 var(--slab); color: #2a1806; }
.acct-mail.long { font-size: 16.5px; } .acct-mail.xlong { font-size: 14.5px; }
.acct-line .btn.ghost { min-height: 26px; padding: 0 2px; font-size: inherit; }
.result-card .acct-line { margin-top: -4px; }
.sheet.acct-sheet { z-index: 96; }
.acct-form { display: grid; gap: 9px; }
.acct-form input { width: 100%; height: 44px; padding: 0 12px; border-radius: 7px; border: 1px solid rgba(59,40,20,.55); background: rgba(255,250,232,.7); color: #2a1806; font: 700 16px/1 var(--slab); }
.acct-form input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
#acct-code, #acct-remove-code { text-align: center; letter-spacing: .32em; font-size: 22px; }
.acct-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; }
.acct-row .btn:not(.ghost) { flex: 1 1 130px; }
a.btn { display: inline-grid; place-items: center; text-decoration: none; }
.acct-more { display: grid; gap: 8px; }
.acct-more[hidden] { display: none; }
.acct-or { display: flex; align-items: center; gap: 10px; font: italic 13px/1 var(--serif); color: #6b5334; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: rgba(59,40,20,.35); }
/* Google's sign-in button, to Google's sign-in branding guidelines (light theme): fill #FFFFFF, a 1px line #747775
   inside, words #1F1F1F in Google Sans Medium 14/20 (Roboto or the system's sans where that is not installed; no font
   is fetched for it), 12px before the G, 10px after it, 12px after the words; 40 high. It is the one thing on these
   sheets that is not in our hand, on purpose. */
.g-btn { box-sizing: border-box; justify-self: center; display: inline-flex; align-items: center; justify-content: center; width: 100%; max-width: 400px; height: 40px; padding: 0 12px; border: 1px solid #747775; border-radius: 4px; background: #fff; color: #1f1f1f;
  font: 500 14px/20px "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .25px; text-decoration: none; text-transform: none; white-space: nowrap; cursor: pointer; transition: background-color .2s, box-shadow .2s; }
.g-btn .g-logo { flex: none; width: 20px; height: 20px; margin-right: 10px; }
.g-btn .g-logo svg { display: block; width: 20px; height: 20px; }
.g-btn:hover { background: #f2f2f2; box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.g-btn:active { background: #e8e8e8; }
.g-btn:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }
/* The "are you a person" check is the page's own element, shown through a slot. It takes no room
   until the visitor is asked to do something. */
.acct-foot { display: grid; justify-items: center; }
.acct-foot ::slotted(*) { display: grid; justify-items: center; width: 100%; max-width: 100%; min-height: 0; overflow: hidden; }
.acct-foot ::slotted([data-human="asking"]) { margin-bottom: 8px; overflow: visible; }
.acct-msg { margin: 0; min-height: 1.35em; text-align: center; font: italic 13px/1.35 var(--serif); color: #5a100c; }
.acct-msg.good { color: #2f5524; }
#acct-remove { justify-self: center; }
/* on parchment: labels and plain buttons in the darker inks the other sheets use */
.acct-sheet .lbl { color: #5a3410; }
.acct-sheet .hint { color: #6b5334; }
.acct-sheet .btn:disabled { opacity: .55; cursor: default; }
.acct-sheet a.btn { text-align: center; }
.sheet { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 14px; background: rgba(10,7,5,.8); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
/* a sheet is the wordmark's plate: its ruled edge stays where it is while what is on it scrolls */
/* (a row of a card is as wide as the card, not as wide as its longest word wants: a language's long word once
   made every row of a card wider than a narrow phone) */
.sheet-card > * { min-width: 0; }
.sheet-card { --pb: 20px; width: min(100%, 440px); max-height: 100%; overflow-y: auto; padding: 2px 0 0; color: var(--sepia); display: grid; gap: 12px;
  border: var(--pb) solid transparent; border-image: url(img/brand/plate.svg) 24 fill / var(--pb) stretch; filter: drop-shadow(0 12px 22px rgba(0,0,0,.75)); }
.sheet-card [aria-level="2"] { margin: 0; font: 700 21px/1.15 var(--display); letter-spacing: .1em; text-indent: .1em; text-transform: uppercase; color: #2b1a0c; text-shadow: .7px 1px 0 rgba(255,248,222,.7); text-align: center; }
.sheet-card ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: 14px; color: #3b2814; }
.foe-line { margin: 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.foe-line b { color: var(--ink); font-family: var(--slab); flex: 1; }
.link { background: none; border: 0; padding: 6px 2px; color: var(--brass); font: 700 12px/1.2 var(--slab); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@container game (min-aspect-ratio: 1/1) { .scene img { left: -14%; width: 128%; top: -40%; height: 128%; } .title-head { padding-top: max(30px, 5cqh); } }
/* A wide screen that is not a phone on its side (that one has a layout of its own, further down).
   The menu card is not pinned to the bottom edge any more: it stands in the space between the
   title and the foot of the screen, nearer the title than the foot. */
@container game (min-width: 900px) and (min-height: 541px) and (min-aspect-ratio: 1/1) {
  .title-menu { margin: auto 0; }
  .title-screen::after { content: ""; flex: 0 1 9cqh; }
}
/* the armies take the field as the title screen lifts */
.deploying .pc .tok { animation: deploy .55s cubic-bezier(.2,1.1,.3,1) both; animation-delay: calc(.25s + var(--y) * 45ms); }
@keyframes deploy { from { opacity: 0; transform: translateY(-.5em) scale(1.25); } }

/* ---------- wide box: rails beside the map, orders on the right ---------- */
@container game (min-width: 1060px) and (min-aspect-ratio: 13/10) {
  .app { --board: max(420px, min((100cqh - 24px) * 1.23, 100cqw - 548px, 1040px)); display: grid; grid-template-columns: auto 330px; grid-template-rows: 70px minmax(0, 1fr); grid-template-areas: "table bar" "table side"; justify-content: center; align-content: center; align-items: start; column-gap: 16px; padding: 10px; overflow: hidden; }
  .app > * { width: auto; }
  .bar { grid-area: bar; align-self: start; gap: 4px; }
  /* the column is narrow: Menu and the three signs a little smaller, so that the hint under the status keeps its two lines */
  .bar .icon-btn { width: 32px; height: 32px; } .bar .icon-btn svg { width: 22px; height: 22px; }
  .bar-menu { padding-right: 2px; font-size: 10px; letter-spacing: .08em; gap: 5px; }
  .status { white-space: normal; font-size: 16px; word-spacing: .04em; }
  .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .table { grid-area: table; align-self: center; grid-template-columns: 86px var(--board) 86px; grid-template-areas: "raill board railr"; }
  .rail { flex-direction: column; justify-content: center; gap: 16px; min-height: 0; padding: 8px 4px; }
  .plate { flex-direction: column; gap: 9px; }
  .plate.foe { flex: none; }
  .say { left: calc(100% + 10px); top: 8px; translate: none; padding: 7px 11px 8px; border-radius: 3px 11px 11px 11px; max-width: 260px; font-size: 13.5px; }
  .say::after { left: -9px; top: 9px; width: 10px; height: 12px; background: #d3dcec; clip-path: polygon(100% 0, 100% 100%, 0 15%); filter: drop-shadow(-1.5px 0 0 var(--blue-d)); }
  .plate.mine .pname { display: block; }
  .badge { width: 58px; height: 58px; padding: 12px; margin: 0; }
  .badge .lv { bottom: -9px; padding: 2px 5px; } .badge .lv svg { width: 13px; height: 13px; }
  .pname { max-width: 84px; font-size: 9.5px; }
  .turn { flex-direction: column; gap: 7px; margin: 0; } .turn-word { display: block; font-size: 9px; text-align: center; white-space: normal; max-width: 80px; }
  .lever { width: 18px; height: 52px; }
  .grave-btn { width: 40px; height: 40px; }
  .knob { left: -5px; top: 0; transform: translateY(12px); }
  .app[data-phase="play"][data-turn="c"] .knob { transform: translateY(0); }
  .app[data-phase="play"][data-turn="p"] .knob { transform: translateY(24px); }
  .plaque { min-width: 62px; height: 44px; } .plaque b { font-size: 19px; }
  .str-cap { display: block; }
  .grave-btn, #grave-close { display: none; }
  .side { grid-area: side; align-self: stretch; overflow-y: auto; min-height: 0; }
  .grave { position: static; z-index: auto; transform: none; visibility: visible; transition: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 16px rgba(0,0,0,.3); border-radius: 12px; padding: 12px; }
  .app[data-phase="setup"] .grave { display: none; }
  .wide-only { display: block; }
  .sub { white-space: normal; }
  .panel { padding: 14px; gap: 9px; }
  .foe-name { font-size: 12px; }
}
/* a tall, narrow box has room under the map: keep the tally open there instead of in a drawer */
@container game ((max-width: 1059px) and (min-height: 760px)) or ((min-width: 1060px) and (max-aspect-ratio: 13/10)) {
  .grave { position: static; z-index: auto; transform: none; visibility: visible; transition: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 16px rgba(0,0,0,.3); border-radius: 12px; padding: 9px; }
  .app[data-phase="setup"] .grave { display: none; }
  .grave-btn, #grave-close { display: none; }
}
/* a short, narrow box (a small phone): tighten the orders so that Start battle stays on screen */
@container game (max-width: 1059px) and (max-height: 720px) {
  .app[data-phase="setup"] { --board: max(264px, min(100cqw - 12px, (100cqh - 304px) * 1.23, 760px)); gap: 5px; padding-top: 4px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .app[data-phase="setup"] .panel { padding: 7px 9px 8px; gap: 5px; }
  .app[data-phase="setup"] #lbl-form { display: none; }
  .app[data-phase="setup"] .foe-line .link { padding: 2px; }
  .app[data-phase="setup"] .btn.big { min-height: 46px; margin: 1px 0 0; }
}
/* ---------- a short, wide box (a phone held sideways): the map takes the full height, both rails
   stack in one narrow strip on its left, and everything else is a column on its right ---------- */
@container game (max-width: 1059px) and (max-height: 540px) and (min-aspect-ratio: 13/10) {
  .app, .app[data-phase="setup"] { --board: max(280px, min((100cqh - 8px) * 1.239, 100cqw - 216px)); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "table bar" "table side"; align-items: start; align-content: start; justify-content: stretch; gap: 5px 8px; padding: 4px; overflow: hidden; }
  .app > * { width: auto; }
  .table { grid-area: table; align-self: center; grid-template-columns: 50px var(--board); grid-template-rows: auto auto; grid-template-areas: "raill board" "railr board"; }
  .rail { flex-direction: column; justify-content: center; gap: 7px; min-height: 0; padding: 4px 2px; }
  .plate { flex-direction: column; gap: 4px; }
  .plate.foe { flex: none; }
  .say { left: calc(100% + 8px); top: 4px; translate: none; padding: 7px 11px 8px; border-radius: 3px 11px 11px 11px; max-width: 220px; font-size: 12.5px; }
  .say::after { left: -9px; top: 9px; width: 10px; height: 12px; background: #d3dcec; clip-path: polygon(100% 0, 100% 100%, 0 15%); filter: drop-shadow(-1.5px 0 0 var(--blue-d)); }
  .pname { display: none; }
  .turn { flex-direction: column; margin: 0; } .turn-word { display: none; }
  .lever { width: 16px; height: 44px; }
  .knob { left: -4px; top: 0; width: 24px; height: 24px; transform: translateY(10px); }
  .app[data-phase="play"][data-turn="c"] .knob { transform: translateY(0); }
  .app[data-phase="play"][data-turn="p"] .knob { transform: translateY(20px); }
  .plaque { min-width: 44px; height: 30px; } .plaque b { font-size: 14px; }
  .grave-btn { width: 34px; height: 34px; padding: 7px; }
  /* the bar: buttons on one line, the words under them */
  .bar { grid-area: bar; display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 4px 5px; min-height: 0; }
  .bar-menu { grid-area: 1 / 1; min-height: 32px; font-size: 10.5px; }
  .bar .js-sound { grid-area: 1 / 4; } .bar #newgame { grid-area: 1 / 5; }
  .bar .icon-btn { --pb: 8px; width: 32px; height: 32px; } .bar .icon-btn svg { width: 21px; height: 21px; }
  .bar-text { grid-area: 2 / 1 / 3 / -1; }
  .status { white-space: normal; font-size: 15.5px; }
  .sub { min-height: 0; font-size: 12px; -webkit-line-clamp: 3; }
  /* the orders, narrow */
  .side { grid-area: side; align-self: stretch; min-height: 0; overflow-y: auto; scrollbar-width: none; gap: 5px; }
  .side::-webkit-scrollbar { display: none; }
  .panel, .app[data-phase="setup"] .panel { padding: 7px 8px 8px; gap: 6px; }
  .foe-line { font-size: 0; gap: 6px; } /* only the name and "Change": the word "Opponent" is dropped */
  .foe-line b { font-size: 12px; } .foe-line .link { font-size: 11.5px; padding: 2px; }
  #lbl-form { display: none; }
  .seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .seg button { min-height: 30px; font-size: 11.5px; }
  .panel .row { grid-auto-flow: row; gap: 5px; }
  .btn.small { --pb: 7px; min-height: 30px; font-size: 11px; }
  .btn.big, .app[data-phase="setup"] .btn.big { --pb: 11px; min-height: 42px; padding: 0 3px; font-size: 12px; letter-spacing: .08em; margin: 0; }
  .log { min-height: 40px; padding: 6px 8px 6px 44px; font-size: 12.5px; }
  .log::after { left: 6px; width: 30px; height: 30px; }
  .guide { font-size: 12.5px; padding: 0 9px; } .guide summary { padding: 8px 0; }
  /* the tally: a drawer across the bottom, one line for each army */
  .grave { padding: 7px 9px calc(8px + env(safe-area-inset-bottom)); gap: 5px; }
  .grave-row ul, .app[data-mode="skirmish"] .grave-row ul { grid-template-columns: repeat(12, 1fr); }
  .app[data-mode="skirmish"] .grave-row ul { grid-template-columns: repeat(7, minmax(0, 64px)); }
  .report { margin: 0 0 6px; padding: 6px 10px 7px; } .report ol { font-size: 12px; gap: 2px; } .report li:nth-child(n+4) { display: none; }
  .title-menu .seg button { min-height: 30px; font-size: 11px; }
  /* title: the name on the left, the orders on the right */
  .title-screen { flex-direction: row; align-items: flex-start; justify-content: center; gap: 2cqw; padding: 6px 10px; }
  .title-head { flex: 1 1 0; min-width: 0; margin: auto 0; padding: 0 4px; }
  .wordmark { font-size: clamp(24px, 5.6cqw, 52px); }
  .tagline { font-size: clamp(12.5px, 2.2cqw, 17px); }
  .title-menu { width: min(50%, 400px); margin: auto 0; }
  .sheet-paper { padding: 18px 9px 7px; gap: 5px; }
  .title-menu .hint { min-height: 0; font-size: 12px; }
  .foes button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 3px 4px; text-align: center; }
  .foes .who { width: 40px; height: 40px; margin-bottom: 1px; }
  .foe-name { max-width: 100%; }
  .title-menu .btn { min-height: 36px; }
  .title-menu .btn.big { min-height: 40px; }
  .title-menu .btn.ghost { min-height: 24px; font-size: 13px; }
  .title-tools { right: auto; left: 6px; top: 4px; }
  .title-tools .icon-btn { --pb: 8px; width: 34px; height: 34px; } .title-tools .icon-btn svg { width: 22px; height: 22px; }
  .acct-chip { --pb: 9px; min-height: 34px; font-size: 10.5px; }
  .acct-chip.in { padding: 0 3px; font-size: 12px; } .acct-chip.in .acct-chip-text { display: none; } .acct-chip .acct-ava { width: 26px; height: 26px; font-size: 13px; }
  .fine { display: none; }
  .more { display: none; }
  /* the result: one compact card */
  .overlay { padding: 6px; overflow-y: auto; }
  .result-card { --pb: 14px; width: min(100%, 520px); padding: 0 2px; }
  .medal { width: 54px; height: 52px; margin: -2px auto 0; }
  .result-card [aria-level="2"] { font-size: 23px; }
  .result-card p { margin-top: 4px; font-size: 13.5px; }
  .stats { margin: 8px 0 6px; } .stats div { padding: 5px 2px; } .stats dd { font-size: 17px; margin-top: 2px; }
  .record { font-size: 12px; }
  .result-actions { grid-template-columns: 1fr 1.7fr; gap: 6px; margin-top: 8px; }
  .result-actions > #again { grid-column: 1; grid-row: 1; } .result-actions > .row { grid-column: 2; grid-row: 1; } .result-actions > .again-note { grid-column: 1; grid-row: 2; margin: 0; } .result-actions > .result-change { grid-column: 2; grid-row: 2; min-height: 24px; }
  .result-actions .btn { min-height: 42px; }
}
/* very little height (a small phone sideways with the browser's bars showing): drop the hint line */
@container game (max-width: 1059px) and (max-height: 349px) and (min-aspect-ratio: 13/10) {
  .sub { display: none; }
  .panel .row, #war-open { display: none; } /* saving and loading a setup can wait for an upright phone */
}
@container game (max-width: 480px) {
  .status { font-size: 18px; }
  .foes button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 4px 6px; text-align: center; }
  .foes .who { width: 56px; height: 56px; margin-bottom: 2px; }
  .foe-name { font-size: 13.5px; max-width: 100%; }
}
/* The strip under the map on a phone. Its one row holds the commander and his name, the lever, the player, the
   two strengths and (where the tally is a drawer) its button, and it is as wide as the map: 378px on a phone 390
   wide, 308 on one 320 wide, and less where the map is made smaller to fit the screen's height (264 at the
   least). It was drawn for 378 and was too full below that: at 360 wide the name lost its end ("LT. WR…"), at
   320 it had room for one letter ("L…") and the player's badge lay on the first strength.
   Now every part of the row has its size from the map's width: as it was at 378 and wider, and smaller step by
   step down to 264, where a whole name still stands (in two rows where a language writes it whole: "LEUTNANT /
   WREN"), nothing lies on anything, and three figures of strength (a full army's 148) fit their plaque.
   --t is how much wider than the narrowest the map is, 0 to 114px. */
@container game (max-width: 399px) {
  .app { --t: clamp(0px, var(--board) - 264px, 114px); }
  /* (each: its size at the narrowest, and what it gains over the 114px to its size at 378, to the pixel) */
  .rail { gap: calc(2px + var(--t) * 4 / 114); padding-left: calc(2px + var(--t) * 6 / 114); padding-right: calc(2px + var(--t) * 6 / 114); }
  .plate { gap: calc(3px + var(--t) * 3 / 114); }
  .badge { width: calc(30px + var(--t) * 4 / 114); height: calc(30px + var(--t) * 4 / 114); margin: 0 calc(var(--t) * 2 / 114); }
  .pname { font-size: calc(8px + var(--t) * .5 / 114); }
  .lever { width: calc(30px + var(--t) * 6 / 114); }
  .knob { width: calc(22px + var(--t) * 4 / 114); height: calc(22px + var(--t) * 4 / 114); top: calc(-2px - var(--t) * 3 / 114); transform: translateX(calc(4px + var(--t) * 1 / 114)); }
  .app[data-phase="play"][data-turn="p"] .knob { transform: translateX(calc(8px + var(--t) * 2 / 114)); }
  .plaque { min-width: calc(32px + var(--t) * 10 / 114); padding: 0 calc(3px + var(--t) * 3 / 114); } .plaque b { font-size: calc(13px + var(--t) * 2 / 114); }
  .grave-btn { width: calc(30px + var(--t) * 8 / 114); height: calc(30px + var(--t) * 8 / 114); padding: calc(4px + var(--t) * 2 / 114); }
}
/* Dutch's words for the three levels (Makkelijk, Gemiddeld, Moeilijk) are longer than a commander's card is wide on
   a phone: the three lay on one another at 360 (at 390 they just fit, and are as they were). They are set closer in that language; and its two sizes of battle
   ("Volledig · 40 stukken") a little smaller on the narrowest phones, where the second lost its end. */
@container game (max-width: 389px) { .foe-lv .lv:lang(nl) { font-size: 8.5px; letter-spacing: 0; gap: 2px; padding: 2px 5px 2px 3px; } .foe-lv .lv:lang(nl) svg { width: 10px; height: 10px; } }
/* (the manual's pieces: a long name (Feldmarschall, Unteroffizier) made its column wider than a quarter of a phone
   320 wide and the grid wider than the sheet: there the four columns are even and a name may break) */
@container game (max-width: 359px) { .stats dt { letter-spacing: .03em; } .m-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .m-grid figure { min-width: 0; max-width: 100%; } .m-grid figcaption { font-size: 10.5px; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; } }
@container game (max-width: 359px) { .lv { font-size: 9.5px; letter-spacing: .04em; padding-right: 5px; } .seg button { font-size: 12.5px; } .foe-name { font-size: 12px; } .icon-btn { --pb: 9px; width: 36px; height: 36px; } .icon-btn svg { width: 24px; height: 24px; }  .bar-menu { padding: 0; font-size: 9.5px; letter-spacing: .06em; gap: 4px; } .status { font-size: 16px; } }
/* the smallest phones: the corner button a size down, so that it clears the line above the title;
   and on a short screen the card does without its own line about saving (the corner button is there) */
@container game (max-width: 359px) { .acct-chip { --pb: 9px; min-height: 34px; font-size: 10.5px; letter-spacing: .14em; }
  .acct-chip.in { padding: 0; } .acct-chip.in .acct-chip-text { display: none; } .acct-chip .acct-ava { width: 22px; height: 22px; margin: -3px 0; } }
@container game (max-height: 700px) { .title-menu .acct-line { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* With motion off, what is drawn only to be animated away would stay: the flash over a piece being turned over hid it for the whole of the verdict. */
@media (prefers-reduced-motion: reduce) { .clash-pc.crack::before, .clash-pc.gone::after { display: none; } }

/* ============ the two screens: the threshold and headquarters ============ */
.title-screen .gate[hidden], .title-screen .hq[hidden] { display: none; }
.title-screen[data-view] .title-tools { left: auto; right: 8px; top: 8px; z-index: 5; }
.title-screen[data-view="hq"] .title-tools { display: none; }  /* the menu has its own two buttons, and says who is playing */
.title-screen[data-view="hq"] .scene { display: none; }
/* the painting, shown whole: the two groups at its sides are not cut, and nothing pushes in */
.title-screen .scene img { left: 0; top: 0; width: 100%; height: 100%; object-position: 50% 50%; filter: saturate(.96) brightness(.9); animation: none; }
.title-screen .shade { background: linear-gradient(180deg, rgba(8,5,3,.55) 0%, transparent 24%, transparent 60%, rgba(8,5,3,.84) 100%); }

/* ---- the first screen: the name over the sky, one thing to do over the dark ridge, the sunrise left clear between ---- */
.gate { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; row-gap: 8px; padding: max(52px, 7cqh) 14px calc(8px + env(safe-area-inset-bottom)); }
.gate .title-head { padding: 0; gap: clamp(6px, 1.4cqh, 12px); }
.gate.no-head .title-head { display: none; }
/* the same page, on the menu: no name in the top row (its place is kept, so that the row stands as it does elsewhere) */
.hq.no-head .mn-mark { visibility: hidden; }
@container hq (max-aspect-ratio: 4/5) { .hq.no-head .mn-mark { display: none; } }
.gate .title-head img.wordmark { display: block; width: min(54cqw, 590px); height: auto; padding: 0; margin: 0; filter: drop-shadow(0 8px 20px rgba(0,0,0,.7)); animation: lift-in .7s cubic-bezier(.2,.7,.2,1) .15s both; }
.gate-act { grid-row: 3; display: grid; justify-items: center; gap: 9px; padding-bottom: clamp(2px, 1.6cqh, 14px); animation: lift-in .5s ease-out .5s both; }
/* Two things on this screen are made of something: the name, on its parchment, and the one thing to do, in the
   seal's wax (see "the main button"). Everything else is words: a line that says what the button does, and
   under it two ways on that are less than buttons. */
.gate-act .btn.big { --pb: 16px; --shade: drop-shadow(0 4px 4px rgba(0,0,0,.6)); min-width: min(80cqw, 380px); min-height: 64px; margin: 0; font-size: clamp(17px, 2cqw, 20px); letter-spacing: .1em; }
.gate-act .btn.big:active:not(:disabled) { --shade: drop-shadow(0 1px 1px rgba(0,0,0,.65)); }
/* one row under the button (the owner: "put this on one line"): the game shows a short form where the whole line does not fit;
   if even that runs over, the rows are kept even and the last word is never left alone (copy.js, tie) */
.go-note { margin: 0; max-width: 100%; text-align: center; text-wrap: balance; font: italic 13.5px/1.35 var(--serif); color: #e6d6ae; text-shadow: 0 1px 6px #000, 0 0 2px #000; }
.gate-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 26px; margin-top: 2px; }
.gate .quiet { color: #efdfb6; text-shadow: 0 1px 5px #000, 0 0 2px #000; }
.ways::after { content: ""; width: 6px; height: 6px; margin-left: -1px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.gate .more { position: static; align-self: auto; margin: 0; padding: 0 4px; font: 700 11px/1 var(--display); letter-spacing: .14em; color: #efdfb6; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.gate .more::after { width: 6px; height: 6px; margin-left: 1px; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.gate .more.out::after { border-width: 1.5px 1.5px 0 0; transform: translateY(-1px) rotate(45deg); }
.title-screen.again .gate-act, .title-screen.again .gate .title-head img.wordmark { animation-delay: 0s; animation-duration: .2s; }
@keyframes lift-in { from { opacity: 0; transform: translateY(10px); } }
@container game (max-aspect-ratio: 3/4) {
  /* The owner, of a phone: "bring the top down a little". The name and its two lines stood hard under the corner
     buttons with empty sky below them: they now stand in the middle of the sky, clear of the buttons above and of
     the sunrise below. */
  .gate { padding-top: clamp(88px, 15cqh, 140px); }
  .gate .title-head img.wordmark { width: 90cqw; }
  .gate-act { width: 100%; }
  .gate-act .btn.big { width: 100%; max-width: 440px; min-height: 70px; font-size: 19px; }
  .gate { padding-left: 10px; padding-right: 10px; }
  .go-note { font-size: 13px; letter-spacing: -.005em; }
  .gate-links { gap: 0 18px; } .gate .quiet, .gate .more { font-size: 10px; letter-spacing: .12em; }   /* both ways on, side by side */
  .title-screen .scene img { top: -7%; }           /* lifted a little: the two groups stand clear above the button */
}
/* A phone's width, a low box: the home page gives the first screen 480 at most on a phone, so that its own words show
   under the game (site/site.css). It is the phone's first screen all the same: the name across the box, the one
   button from side to side, the two ways on under it. The name stands 84 down, under the corner row even where that
   row is two rows (German and Dutch on a narrow phone), which is about where it stands in a whole window. (Before
   this such a box was laid out as a wide one: a small name, a small button.) */
@container game (max-width: 480px) and (max-height: 520px) {
  .gate { padding: 84px 10px calc(8px + env(safe-area-inset-bottom)); }
  .gate .title-head img.wordmark { width: 90cqw; }
  .gate-act { width: 100%; }
  .gate-act .btn.big { width: 100%; max-width: 440px; min-height: 70px; font-size: 19px; }
  .go-note { font-size: 13px; letter-spacing: -.005em; }
  .gate-links { gap: 0 18px; } .gate .quiet, .gate .more { font-size: 10px; letter-spacing: .12em; }
  .title-screen .scene img { top: -7%; }
}
/* a box under 400 high (a phone with a short window): the button a little lower and the ways on closer, so that the
   two of them fit under it even where they stand one over the other (a language with longer words) */
@container game (max-width: 480px) and (max-height: 400px) { .gate-act { gap: 6px; } .gate-act .btn.big { min-height: 60px; } .gate .quiet, .gate .more { min-height: 30px; } }
/* (on the narrowest phones the two ways on are set closer, so that the English ones still stand side by side) */
@container game (max-width: 339px) and (max-height: 520px) { .gate-links { gap: 0 10px; } .gate .quiet, .gate .more { letter-spacing: .05em; } }
@container game (max-height: 540px) and (min-aspect-ratio: 13/10) {
  .gate { padding-top: 8px; row-gap: 4px; }
  .gate .title-head img.wordmark { width: min(43cqw, 400px); }
  .gate .pitch { font-size: 11px; }
  .gate-act { gap: 5px; }
  .gate-act .btn.big { --pb: 12px; min-height: 48px; font-size: 15px; } .go-note { font-size: 12.5px; } .gate .quiet { min-height: 30px; font-size: 10px; }
}

/* ---- the second screen: a map, with the ways to play laid on it as orders ----
   Everything on the map is one of the wordmark's parts: the orders are its plate, their names its pressed
   capitals, the buttons the same plate, the stop you are at a seal of the same wax, the player the flag. */
/* ============ the main menu (the second screen) ============
   The owner, of a menu drawn with gradients: "like plastic, a grade below the rest". So every surface here is a
   painting in the same hand as the pieces and the map (img/menu/, tools/art/build_menu.py, docs/piece-art.md): the
   walnut desk, the war map unrolled on it with its two rolls, the brass compass with three plaques, the long plates
   with arrow ends, the frame, the brass buttons, the ring round the player's flag. Words and signs are laid over
   them. ONE layout, the same for everybody; a few small lines are all that differ. */
.seal { --seal: 44px; display: inline-grid; place-items: center; flex: none; width: var(--seal); aspect-ratio: 116 / 120; background: url(img/brand/seal.svg) center / contain no-repeat; }
.hq { position: absolute; inset: 0; z-index: 1; overflow: hidden; container: hq / size; color: #2b1a0c; font-family: var(--serif); background: #0c0704 url(img/menu/desk-plain.webp) center / cover; }
.hq::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 85% 85% at 50% 50%, transparent 45%, rgba(4,2,1,.6) 100%); }
.hq > * { position: absolute; }
.hq button { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; cursor: pointer; }
.hq button:focus-visible { outline: 2px solid var(--brass-l); outline-offset: 3px; }
/* The sizes the middle is built from. --d: the compass across. --mid: its centre line. --s: how large one point of
   the map's painting is drawn. They are given to the pieces that use them: a container is not sized by its own query. */
.mn-map, .hq .pin, .mn-rose, .mn-notice, .mn-film { --d: max(330px, min(68cqh, 47cqw)); --mid: 51.5cqh; --s: min(80cqw / 1421, 53cqh / 507); }
/* the war map (one painting, 1536 x 1024; the sheet's middle is at 767.5, 511.5 in it), its edges let into the desk */
.mn-map { left: calc(50% - var(--s) * 767.5); top: calc(var(--mid) - var(--s) * 511.5); width: calc(var(--s) * 1536); height: calc(var(--s) * 1024); background: url(img/menu/desk-wide.webp) 0 0 / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.6%, #000 97.4%, transparent), linear-gradient(180deg, transparent 3%, #000 13%, #000 87%, transparent 97%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 2.6%, #000 97.4%, transparent), linear-gradient(180deg, transparent 3%, #000 13%, #000 87%, transparent 97%); mask-composite: intersect; }
/* the seal pins the map, on the water at its lower right: the one seal on the screen */
.hq .pin { left: calc(50% + var(--s) * 398); top: calc(var(--mid) + var(--s) * 78); width: calc(var(--s) * 104); transform: rotate(-11deg); filter: drop-shadow(0 4px 5px rgba(30,14,2,.65)); pointer-events: none; }

/* the compass, lying on the map; its three plaques are the three things to do (where they are in the painting, as parts of its width) */
.mn-rose { left: 50%; top: var(--mid); width: var(--d); aspect-ratio: 1; transform: translate(-50%, -50%); container: mnrose / inline-size; }
.mn-disc { position: absolute; inset: 0; background: url(img/menu/compass.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3.6cqw 4.6cqw rgba(0,0,0,.72)); }
.hq .mn-plate { position: absolute; display: grid; justify-items: center; text-align: center; border-radius: 2cqw; transition: background .15s; }
.mn-plate b { font: 700 6cqw/1 var(--display); letter-spacing: .05em; text-indent: .05em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,248,222,.6); }
.mn-plate i { font: italic max(11px, 2.9cqw)/1.15 var(--serif); color: #5a4424; white-space: nowrap; }
.mn-plate i svg { display: inline-block; width: 1em; height: 1em; vertical-align: -.1em; color: #a8791c; }
.mn-plate:hover, .mn-plate:focus-visible { background: radial-gradient(ellipse 60% 70% at 50% 58%, rgba(255,246,216,.3), transparent 72%); }
.hq .mn-plate:focus-visible { outline-offset: -4px; }
/* the upper plaque is arched above, the lower one below: the small line goes into the arch, the name against the level edge */
.hq .mn-p1 { left: 11.5%; width: 77%; top: 8.8%; height: 26%; align-content: end; gap: .8cqw; padding-bottom: 2.6cqw; }
.mn-p1 i { order: -1; }
.mn-p2 { left: 8%; width: 84%; top: 39.2%; height: 22.6%; align-content: center; gap: .9cqw; }
.hq .mn-p3 { left: 11.5%; width: 77%; top: 65%; height: 25.8%; align-content: start; gap: 1cqw; padding-top: 3.3cqw; }
/* the one in the wax: the middle of the screen, the strongest colour, the largest words, the compass star before them */
.hq .mn-main { color: #f7ebc8; }
.mn-main b { font-size: 7.6cqw; text-shadow: 0 1px 0 #3d0906, 0 0 3px rgba(61,9,6,.8); }
.mn-main b::before { content: ""; display: inline-block; width: .78em; height: .78em; margin-right: .3em; vertical-align: -.05em; background: url(img/brand/compass-l.svg) center / contain no-repeat; }
.mn-main i { color: #f6dfc4; }

/* along the top. Left: the player, one thing with one door (flag in a brass ring, a name cut short rather than a plate
   that grows with it, the way to the account), and the stars won. Right: two brass buttons. */
.mn-top { left: 0; right: 0; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: clamp(8px, 1.3cqw, 14px) clamp(12px, 1.8cqw, 22px); }
/* the name, in the middle of the top (the owner: "the title is missing there"): the wordmark itself, as on the first screen, smaller */
.mn-mark { width: clamp(230px, 27cqw, 380px); aspect-ratio: 1178 / 151; background: url(img/wordmark.svg) center / contain no-repeat; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6));
  /* at the top of its row, nine points under the page's head, not level with the player's flag: in a low window the compass comes up close under it (the owner: "too near; half a line higher") */
  align-self: start; margin-top: calc(9px - clamp(8px, 1.3cqw, 14px)); }
.mn-left { display: flex; align-items: center; gap: clamp(12px, 1.6cqw, 22px); min-width: 0; }
.hq .mn-who { display: flex; align-items: center; gap: 12px; color: #fbf1d3; text-align: left; text-shadow: 0 1px 3px #000; }
.hq .mn-who:disabled { cursor: default; }
.mn-avatar { position: relative; flex: none; width: 62px; height: 62px; }
.mn-avatar::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: #5a100c url(img/pieces/rF.webp) 46% 48% / 150% auto no-repeat; }
.mn-avatar::after { content: ""; position: absolute; inset: 0; background: url(img/menu/ring.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px rgba(0,0,0,.65)); }
.mn-who-text { display: grid; gap: 2px; justify-items: start; }
.mn-who-text b { max-width: 11ch; font: 800 18px/1.3 var(--slab); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-acct { font: 700 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: #f7dc8f; text-decoration: underline; text-underline-offset: 3px; }
.mn-acct[hidden], .mn-acct [hidden] { display: none; }
.mn-earned { flex: none; display: inline-flex; align-items: center; gap: 7px; font: 800 17px/1 var(--slab); color: #fbf1d3; text-shadow: 0 1px 3px #000; }
.mn-earned svg { width: 19px; height: 19px; color: #e3b04b; filter: drop-shadow(0 1px 2px #000); }
.mn-earned b { font: inherit; } .mn-earned small { font: 700 12px/1 var(--slab); color: #cdb98c; }
.mn-signs { display: flex; align-items: center; gap: 10px; justify-self: end; }
.mn-signs .title-links { flex: none; margin-right: 2px; }
.hq .mn-sign { width: 50px; height: 51px; display: grid; place-items: center; color: #f3e4bb; background: url(img/menu/button.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 5px rgba(0,0,0,.65)); }
.mn-sign svg { width: 23px; height: 23px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.7)); }
.mn-sign:hover { color: #fff6da; }
/* (the third of them, the way to the admin page, is a link, and is there for an admin alone) */
.hq .mn-sign[hidden] { display: none; }
a.mn-sign { text-decoration: none; }

/* two long plates coming in from the lower left edge, their ends cut to an arrow (one painting; what lies to the left of the screen's edge is not seen) */
.mn-strips { left: 0; bottom: clamp(14px, 2.8cqh, 28px); display: grid; gap: clamp(8px, 1.6cqh, 14px); justify-items: start; }
.hq .mn-strip { --h: clamp(54px, 9.4cqh, 70px); display: grid; align-content: center; justify-items: start; gap: 4px; height: var(--h); width: clamp(210px, 20cqw, 290px); padding: 0 calc(var(--h) * .62) 0 clamp(16px, 2cqw, 28px); text-align: left;
  background: url(img/menu/plate.webp) right center / auto 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0,0,0,.65)); }
.hq .mn-strip + .mn-strip { width: clamp(250px, 25cqw, 360px); }
.mn-strip b { font: 700 clamp(15px, 1.6cqw, 21px)/1 var(--display); letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(255,248,222,.6); white-space: nowrap; }
.mn-strip small { font: italic 12.5px/1 var(--serif); color: #5a4424; white-space: nowrap; }
.mn-strip:hover, .mn-film:hover { filter: drop-shadow(0 6px 8px rgba(0,0,0,.65)) brightness(1.06); }

/* at the lower right, the frame for the film that shows how the game is played: the painted card, a cover in it, a play sign in the brass ring */
/* its size: as it was (a fifth of the width, 264 at most) and, where the window is wide and low so that there is room
   to the right of the map's roll, larger, up to that room (the owner drew it about half as large again). The 710.5
   is half the map with its two rolls, in the painting's points; the card never reaches the roll or the seal by growing. */
.hq .mn-film { right: clamp(12px, 1.8cqw, 22px); bottom: clamp(14px, 2.8cqh, 28px); width: max(clamp(200px, 19cqw, 264px), min(20.5cqw, 50cqw - var(--s) * 710.5 - 34px)); display: grid; gap: 5px; justify-items: center; padding: 1px 1px 3px; text-align: center;
  border: 10px solid transparent; border-image: url(img/menu/card.webp) 30 fill / 10px stretch; filter: drop-shadow(0 6px 8px rgba(0,0,0,.65)); }
.mn-cover { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1a120a url(img/menu/cover.webp) center / cover; box-shadow: inset 0 0 0 1px rgba(43,26,12,.8), inset 0 0 0 100px rgba(20,11,3,.22); }
.mn-cover::before { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.500v11l9-5.500z' fill='%23f7ebc8'/%3E%3C/svg%3E") center / 62% no-repeat, rgba(20,11,3,.78); }
.mn-cover::after { content: ""; position: absolute; left: 50%; top: 50%; width: 38%; aspect-ratio: 1; transform: translate(-50%, -50%); background: url(img/menu/ring.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.mn-film b { font: 700 clamp(12.5px, 1.2cqw, 19px)/1 var(--display); letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(255,248,222,.6); }
.mn-film small { font: italic clamp(12px, .85cqw, 14.5px)/1 var(--serif); color: #5a4424; }

/* said when a button has, just now, nothing to do */
.mn-notice { left: 50%; top: calc(var(--mid) + var(--d) * .5 + 12px); transform: translateX(-50%); z-index: 3; margin: 0; padding: 2px 16px 4px; border: 10px solid transparent; border-image: url(img/menu/card.webp) 30 fill / 10px stretch;
  width: max-content; max-width: min(92cqw, 560px); font: italic 15px/1.3 var(--serif); text-align: center; text-wrap: balance; filter: drop-shadow(0 6px 10px rgba(0,0,0,.7)); animation: mn-said .2s ease-out; }
.mn-notice[hidden] { display: none; }
@keyframes mn-said { from { opacity: 0; } }

/* a phone held upright: the compass stays the hero, as wide as the screen; the map runs off both sides; the film's
   frame becomes a row above the two plates, which lie side by side along the foot */
@container hq (max-aspect-ratio: 4/5) {
  /* top bar 64, the name under it 44; under the compass the film's row 74 and the plates 68 */
  .mn-map, .hq .pin, .mn-rose, .mn-notice { --d: min(96cqw, 100cqh - 306px); --free: calc(100cqh - 258px - var(--d)); --mid: calc(108px + var(--free) * .42 + var(--d) / 2); --s: calc(var(--d) * .8 / 485); }
  /* first row: the player at the left, "How to play" and the sound at the right; second row: the stars under the flag, the name in the middle */
  /* The second row is three columns: the stars, the name, and as much again to the name's right as the stars have
     to its left, so that the name stands in the middle of the screen. Where the stars want more than that (three
     figures of three: "177 / 177") their column is as wide as they are and the name moves to the right of them,
     and they no longer run under it. The first row lies across all three: the player at its left end, the buttons
     at its right. */
  .mn-top { grid-template-columns: minmax(max-content, 1fr) auto minmax(0, 1fr); row-gap: 6px; column-gap: 6px; padding-left: 10px; padding-right: 8px; } .mn-left { display: contents; }
  .hq .mn-who { grid-column: 1 / -1; grid-row: 1; justify-self: start; } .mn-signs { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .mn-earned { grid-column: 1; grid-row: 2; justify-self: start; align-self: center; padding-left: 4px; }
  .mn-mark { grid-column: 2; grid-row: 2; justify-self: center; width: min(56cqw, 236px); margin-top: 0; }
  /* The page's own links are not in this row on a phone: three of them beside the player took the room of "How to
     play" and the sound, which were squeezed to half their width and pushed off the screen (and in a language
     with longer words, gone). They stand on the first screen and in the foot of the page. */
  .mn-signs .title-links { display: none; }
  .mn-map { left: calc(50% - var(--s) * 512); top: calc(var(--mid) - var(--s) * 686.5); width: calc(var(--s) * 1024); height: calc(var(--s) * 1536); background-image: url(img/menu/desk-tall.webp);
    -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 16%, #000 84%, transparent 96%); mask-image: linear-gradient(180deg, transparent 4%, #000 16%, #000 84%, transparent 96%); -webkit-mask-composite: source-over; mask-composite: add; }
  .hq .pin { left: auto; right: 10px; top: calc(var(--mid) + var(--d) * .4 - 38px); width: 40px; }
  .mn-avatar { width: 46px; height: 46px; } .hq .mn-who { gap: 8px; } .mn-who-text b { font-size: 14.5px; max-width: 9ch; } .mn-acct { font-size: 9.5px; letter-spacing: .1em; }
  .mn-earned { font-size: 15px; gap: 5px; } .mn-earned svg { width: 16px; height: 16px; } .mn-earned small { font-size: 11px; }
  .mn-signs { gap: 5px; } .hq .mn-sign { width: 38px; height: 39px; } .mn-sign svg { width: 19px; height: 19px; }
  .hq .mn-film { left: 10px; right: 10px; bottom: 74px; width: auto; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; align-content: center; justify-items: start; gap: 3px 12px; padding: 0 4px 0 0; text-align: left; border-width: 8px; border-image-width: 8px; }
  .mn-cover { grid-row: 1 / 3; align-self: center; } .mn-film b { align-self: end; font-size: 14px; } .mn-film small { align-self: start; }
  .mn-strips { left: 0; right: 0; bottom: 0; grid-template-columns: 1fr 1fr; gap: 0 8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(4,2,1,.55); justify-items: stretch; }
  .hq .mn-strip, .hq .mn-strip + .mn-strip { width: auto; height: 52px; padding: 0 4px; justify-items: center; text-align: center; background: none; border: 9px solid transparent; border-image: url(img/menu/card.webp) 30 fill / 9px stretch; filter: none; }
  .mn-strip b { font-size: 13.5px; } .mn-strip small { display: none; }
}
/* the narrowest phones: the first row still holds the player and the two buttons */
@container hq (max-width: 372px) { .hq .mn-sign { width: 35px; height: 36px; } .mn-avatar { width: 42px; height: 42px; } .mn-top { column-gap: 4px; padding-left: 8px; padding-right: 6px; } }

/* the sheet opened by "Quick battle": the opponent and the size, on the sheet's parchment */
.battle-sheet .lbl { margin: 0; text-align: center; color: #5a4424; }
.battle-sheet { display: grid; gap: 8px; padding: 10px; border-radius: 4px; background: rgba(59,40,20,.08); box-shadow: inset 0 0 0 1px rgba(59,40,20,.3); }
.battle-sheet .foes button { background: linear-gradient(180deg, rgba(255,250,232,.5), rgba(214,190,140,.35)); border: 1px solid rgba(59,40,20,.5); color: rgba(59,40,20,.8); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.battle-sheet .foe-name { color: var(--sepia); }
.battle-sheet .foes button[aria-checked="true"] { background: linear-gradient(180deg, #4a3320, #3b2814); border-color: #2b1a0c; color: #f1dfb4; box-shadow: 0 0 0 2px #ecd9a6, 0 0 0 3px #3b2814, 0 4px 10px rgba(40,20,5,.45); }
.battle-sheet .foes button[aria-checked="true"] .foe-name { color: #fff3d6; }
.battle-sheet .hint { text-align: center; color: #4a321a; min-height: 0; margin: 0; font-size: 13.5px; }
.battle-sheet .seg { background: rgba(59,40,20,.14); border-color: rgba(59,40,20,.5); }
.battle-sheet .seg button { color: #4a321a; min-height: 34px; font-size: 12px; }
.battle-sheet .seg button:hover { color: #2a1806; }
.battle-sheet .seg button[aria-checked="true"] { color: #fff3d6; background: linear-gradient(180deg, #4a3320, #3b2814); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 5px rgba(40,20,5,.45); }

/* ============ the main button ============
   The owner, of the first screen on a phone: "so many buttons look alike: make Enter battle stand out, so that
   people press it and begin". The one thing to do on a screen (.btn.star) is the only button made of something:
   the plate's outline and ruled lines in the seal's wax (img/brand/plate-wax.svg), its words and its compass
   star in the paper's colour, and a low warm light round it that slowly comes and goes. Nothing new is drawn
   for it. Its filter is three parts so that the light can move: --shade (one shadow), --glow, --tone (two steps). */
.btn.star { --pb: 14px; --shade: drop-shadow(0 3px 3px rgba(0,0,0,.55)); --glow: drop-shadow(0 0 12px rgba(255,190,110,.34)); --tone: brightness(1) saturate(1);
  padding: 0 6px; border: var(--pb) solid transparent; border-image: url(img/brand/plate-wax.svg) 24 fill / var(--pb) stretch; border-radius: 0; background: none; box-shadow: none; color: #f7ebc8; text-shadow: 0 1px 0 #3d0906, 0 0 2px rgba(61,9,6,.85);
  letter-spacing: .1em; filter: var(--shade) var(--glow) var(--tone); transition: transform .08s ease-out, filter .08s ease-out; animation: beckon 3.8s ease-in-out infinite; }
.btn.star::before { content: ""; display: inline-block; vertical-align: middle; width: 1.9em; height: 1.9em; margin: -.7em .7em -.55em -.2em; background: url(img/brand/compass-l.svg) center / contain no-repeat; }
@keyframes beckon { 50% { filter: var(--shade) drop-shadow(0 0 26px rgba(255,200,125,.78)) brightness(1.1) saturate(1.06); } }
.btn.star:hover:not(:disabled) { --glow: drop-shadow(0 0 22px rgba(255,200,125,.7)); --tone: brightness(1.12) saturate(1.06); border-color: transparent; background: none; animation: none; }
.btn.star:active:not(:disabled) { --shade: drop-shadow(0 1px 1px rgba(0,0,0,.65)); --glow: drop-shadow(0 0 6px rgba(255,190,110,.3)); --tone: brightness(.92) saturate(1); background: none; transform: translateY(3px); animation: none; }
.btn.star:disabled { animation: none; }
/* asking before it ends a battle, the wax button must not look like itself: a ruled line and words in the wax's red, and still */
.btn.star.armed, .btn.star.armed:hover:not(:disabled) { padding: 0 14px; border: 2px solid #8c1c14; border-image: none; border-radius: 3px; background: rgba(140,28,20,.1); color: #7d1810; text-shadow: none; letter-spacing: .06em; filter: none; animation: none; }
.btn.star.armed::before { background-image: url(img/brand/compass.svg); }
.gate-act .btn.big, .battle-sheet .btn.big { --pb: 16px; }

/* Contact support (the account sheet's button): the form for writing to us, on the account sheet's own parchment.
   Its parts are those of parts/feedback.js, given the sheet's classes (lbl, btn primary, acct-msg) by game.js. */
.sheet.fb-sheet { z-index: 97; }
.fb-sheet .fb-message { width: 100%; min-height: 132px; resize: vertical; padding: 10px 12px; border-radius: 7px; border: 1px solid rgba(59,40,20,.55);
  background: rgba(255,250,232,.7); color: #2a1806; font: 16px/1.45 var(--serif); }
.fb-sheet .fb-message:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.fb-sheet .fb-count { justify-self: end; margin-top: -4px; font: italic 12px/1 var(--serif); color: #6b5334; }
.fb-sheet .fb-send { margin-top: 4px; }
.fb-sheet .fb-note:empty { min-height: 0; }
.fb-sheet .fb-note[data-kind="ok"] { color: #2f5524; font-style: normal; font-weight: 700; }
#acct-contact { width: 100%; }
#acct-contact[hidden] { display: none; }

/* ---------- points and ranks (shown once they are released: ranks.js) ----------
   The rank under the player's name on the menu, the lines on the card at the end of a battle, the table in the
   records. The badge is a small shield in the player's red (art.js, rankSvg): not the medals' round disc, so that
   a rank is never taken for one more medal. */
.rk { flex: none; display: block; width: 26px; height: 29px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.rk svg { display: block; width: 100%; height: 100%; }
.mn-rank { display: flex; align-items: center; gap: 6px; margin-top: 4px; text-align: left; }
.mn-rank[hidden] { display: none; }
.mn-rank .rk { width: 20px; height: 22.5px; }
.mn-rank > span:last-child { display: grid; gap: 2px; }
.mn-who-text .mn-rank b { max-width: none; overflow: visible; font: 800 11.5px/1 var(--slab); letter-spacing: .02em; color: #fbf1d3; }
/* (upright, not italic: in small italic letters the "ui" of Luitenant read as "u") */
.mn-rank i { font: 10.5px/1 var(--serif); color: #cdb98c; white-space: nowrap; }
/* On the narrowest phones the row holds the player and two buttons, and for an admin three. The line that says how
   far the next rank is can be long ("900 more to Field Marshal"), and it pushed the last button off a phone 320
   wide: there it may stand in two rows, and the player's part of the row is no wider than what the buttons leave
   (two of them 75px with their gap, three 115). */
@container hq (max-width: 339px) { .hq .mn-who { max-width: calc(100% - 79px); } .mn-top:has(#admin:not([hidden])) .mn-who { max-width: calc(100% - 119px); } .hq .mn-who, .mn-who-text, .mn-rank > span:last-child { min-width: 0; } .mn-rank i { white-space: normal; } }
.rank-gain { display: grid; justify-items: center; gap: 5px; margin: 8px 0 0; color: #2b1a0c !important; text-align: center; }
.rank-gain[hidden] { display: none; }
.rk-pts { font: 800 13px/1.1 var(--slab); color: #7d1a14; }
.rk-up { display: inline-flex; align-items: center; gap: 9px; margin-top: 2px; }
.rk-up .rk { width: 30px; height: 34px; }
.rk-up b { font: 800 16px/1.15 var(--slab); color: #2b1a0c; }
.rk-peer { font: italic 13.5px/1.3 var(--serif); color: #5a4424; }
.rec-rank { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.rec-rank .rk { width: 30px; height: 34px; }
.rec-rank > span:last-child { display: grid; gap: 2px; }
.rec-rank b { font: 800 16px/1.1 var(--slab); } .rec-rank i { font: 13px/1.2 var(--serif); color: #5a4424; }
.rec-points { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.rec-points li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font: 13px/1.3 var(--serif); border-bottom: 1px dotted rgba(59,40,20,.35); }
.rec-points b { font: 800 13px/1.3 var(--slab); }
@container game (max-width: 339px) { .seg button:lang(nl) { font-size: 11px; letter-spacing: 0; } .stats dt { font-size: 8px; letter-spacing: 0; } }
