/* The game page's style: the look David chose (decision-19; doc-7 is the reference, to read before
   changing a colour, a shape or anything that moves) on the layout he decided (decision-20;
   doc-8). The values were tried on the mock-ups, look/round-5/ and look/layout.html.
   In order: the colours; the column; the top row; the status row; the board's box and its
   bubbles; the controls; what opens over the board; the list of boards; the board itself. */

@font-face {
  /* Rubik, for everything (doc-7). Served from the site's own files under the SIL Open Font
     License 1.1, which is beside it (fonts/OFL.txt). The Latin part, every weight in one file. */
  font-family: "Rubik"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
}

/* ---- The colours (doc-7, "The page" and "The colours"). The page's script sets data-theme on
        the root to light or dark before anything is drawn. Things on the board are drawn in the
        tones of palette.ts, the same in both; here are the ground, the lines and the marks. ---- */
:root {
  --outer: #eee1c3; --bg: #f7f1de; --panel: #fffbee; --panel-hi: #ffffff; --well: #ebe2c6; --edge: #d8cca6; --line: #e0d6b6;
  --ink: #17383d; --muted: #50696a; --off: #b1aa8f; --ink-hi: #21494f; --ink-edge: #0a2125;
  --primary: #3d5fae; --primary-hi: #4a6dbd; --primary-edge: #2b4687; --on-primary: #ffffff; --primary-soft: #a9bce9;
  --good: #2f9f68; --flame-ink: #b93a0c;
  --tip: #f0d2a0; --on-tip: #4a2a16; --tip-edge: rgba(13, 40, 45, 0.3);
  --cast: rgba(29, 85, 96, 0.16); --veil: rgba(23, 56, 61, 0.42);
  --grass: #bfe07c; --grass-line: #d6eda2; --burnt: #5d564e; --burnt-line: #6f675e; --fire-ground: #453a36;
  --stone: #cfd1bd; --stone-line: #e1e2d2;
  --mark: #c22f08; --no: #c2264b; --held: #fffbee; --held-case: #17383d;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --outer: #092328; --bg: #122a2e; --panel: #1e3f44; --panel-hi: #25494f; --well: #0c2226; --edge: #0a1a1d; --line: #26494f;
  --ink: #f4eed9; --muted: #9fbab6; --off: #4d6b6b; --ink-hi: #ffffff; --ink-edge: #bdb69e;
  --primary: #7fa6ea; --primary-hi: #92b4ef; --primary-edge: #4c73bd; --on-primary: #0e1e40; --primary-soft: #3f5f9d;
  --good: #86d162; --flame-ink: #ffa46e;
  --tip-edge: rgba(0, 0, 0, 0.4);
  --cast: rgba(0, 0, 0, 0.3); --veil: rgba(4, 14, 16, 0.6);
  --grass: #70a257; --grass-line: #86b56b; --burnt: #3d3a38; --burnt-line: #4d4946; --fire-ground: #2a2423;
  --stone: #8e9584; --stone-line: #a1a796;
  --mark: #a82605; --no: #b81e45; --held-case: #0a1a1d;
  color-scheme: dark;
}

[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 15px/1.4 "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---- The column: the page on a phone, a card 592 px wide from 860 px. The board gives way in
        height so that the top row, the status row, the board and the controls fit one screen
        (R22): the script sets the board's width from the room that is left (fit, in page.ts). ---- */
.stage {
  box-sizing: border-box; min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; align-items: flex-start;
  background: var(--bg); position: relative; isolation: isolate;
}
/* The background (ARI-42; doc-8, "The column"): a woodland, one picture for each setting, still.
   It is as wide as the screen and stays at its bottom while the page scrolls. On a wide screen
   the colour around the card is the picture's sky (--outer). On a phone the page lets it through
   and its top fades into the page's colour: it fills the room under the controls where there is
   some, and shows around them where there is none. A phone is given the small file and a wide
   screen the large one, which is sharp on a 4K screen. */
.stage::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("background/woodland-small.webp") no-repeat center bottom / 100% auto; }
:root[data-theme="dark"] .stage::before { background-image: url("background/woodland-dark-small.webp"); }
.page {
  box-sizing: border-box; width: 100%; min-width: 0; background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
@media (max-width: 859px) {
  .stage::before { -webkit-mask-image: linear-gradient(to top, #000 30vw, transparent 58vw); mask-image: linear-gradient(to top, #000 30vw, transparent 58vw); }
  .page { background: none; }
}
.head { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label, .day { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); line-height: 1; }

/* ---- The top row: the title, the board switch, help, the menu. ---- */
.top { position: relative; display: flex; align-items: center; gap: 6px; }
/* The title grows with the room the top row has: 26 px beside the board switch on a phone, up to
   40 px; 30 px where the switch is in the menu. The mark, the burning cell, follows it. */
.name { margin-right: auto; display: flex; align-items: center; gap: 6px; min-width: 0; border-radius: 10px; font-size: clamp(26px, calc(26px + (100vw - 400px) * 0.09), 40px); }
.name-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.name h1 { margin: 0; font: 800 1em/1 "Rubik", system-ui, sans-serif; letter-spacing: -0.02em; white-space: nowrap; }
.name h1 i { font-style: normal; color: var(--flame-ink); }
.day { min-height: 1em; }
.day em { font-style: normal; display: none; }
.mark { display: block; width: 1.15em; height: 1.35em; flex: none; }
.mark .key { display: block; width: 100%; height: 100%; }
/* The board switch, help and the menu are rounded squares, like the controls. */
.switch, .seg { display: flex; background: var(--well); border-radius: 14px; padding: 3px; }
.switch a, .seg button { display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 0 12px; min-height: 34px; border-radius: 11px; }
.switch a[aria-current="page"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.square { width: 38px; height: 37px; flex: none; border: 0; border-radius: 13px; background: var(--panel); box-shadow: 0 3px 0 var(--edge); margin-bottom: 3px; padding: 0; display: flex; align-items: center; justify-content: center; }
.square svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; }
.square:disabled { background: var(--well); color: var(--off); box-shadow: none; cursor: default; }
/* The menu on a wide screen: a small panel under its button, with no line around it: an edge
   under it and a flat shadow to the lower right, as a thing on the board has. */
.menu { position: absolute; z-index: 15; right: 0; top: calc(100% + 6px); width: 216px; box-sizing: border-box; background: var(--panel); border-radius: 18px; box-shadow: 0 3px 0 var(--edge), 5px 10px 0 var(--cast); padding: 6px; }
.menu-list { display: flex; flex-direction: column; }
.item { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; font-weight: 600; font-size: 15px; }
.menu-boards { display: none; flex-direction: column; border-bottom: 2px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; }
.menu-boards .item[aria-current="page"] { background: var(--well); }
/* The theme: the switch alone, as wide as the rows' text, with the room of a row around it. */
.menu-row { padding: 7px 6px; }
.seg button { flex: 1; font-size: 13.5px; padding: 0 8px; }
/* Where the top row has no room for the board switch, it is in the menu, and the day's line names
   the board. */
@media (max-width: 389px) {
  .switch { display: none; }
  .menu-boards { display: flex; }
  .day em { display: inline; }
  .name { font-size: 30px; }
}

/* ---- The status row: the running score, the tally, the turn. ---- */
.status { display: flex; align-items: flex-end; gap: 10px; }
.score b { display: block; font-weight: 700; font-size: 44px; line-height: 0.85; font-variant-numeric: tabular-nums lining-nums; }
.score span { display: block; margin-top: 5px; white-space: nowrap; }
.tally { display: flex; gap: 8px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.tally span { display: flex; align-items: center; gap: 2px; }
.tally i { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.tally .key { width: 32px; height: 37px; margin-block: -3px; }
/* The turn is a pill: it is a label, not a button. */
.turn { margin-left: auto; font-weight: 700; font-size: 13px; padding: 7px 11px; border-radius: 999px; background: var(--well); white-space: nowrap; }
.turn:empty { visibility: hidden; }
.turn.is-out { background: var(--ink); color: var(--bg); }
/* Under 400 px the tally's pictures are 28 px: at 32 the row is wider than the screen once the
   turn reads "The fire is out". */
@media (max-width: 399px) { .tally .key { width: 28px; height: 32px; } .status { gap: 8px; } }
@media (max-width: 379px) { .score span { white-space: normal; } .turn { padding: 7px 9px; } }

/* ---- The board's box, and the bubbles on it: what a cell is, why a tap did nothing, and the
        instruction for a newcomer. One tone with a rounded nub, the same in both settings. ---- */
.boardbox { position: relative; width: 100%; margin-inline: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.note { margin: 0; padding: 32px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.note.is-waiting { visibility: hidden; animation: late 0s linear 4s forwards; }
@keyframes late { to { visibility: visible; } }
.tip {
  position: absolute; z-index: 5; max-width: 240px; box-sizing: border-box; padding: 8px 13px 8px 9px; border-radius: 15px;
  background: var(--tip); color: var(--on-tip); font-size: 13.5px; font-weight: 600; line-height: 1.3; pointer-events: none;
  box-shadow: 0 4px 0 var(--tip-edge); display: flex; gap: 8px; align-items: center;
}
.tip .key { width: 28px; height: 32px; flex: none; }
.tip::after { content: ""; position: absolute; left: var(--nub, 50%); width: 14px; height: 14px; margin-left: -7px; background: inherit; transform: rotate(45deg); border-radius: 3px; bottom: -5px; }
.tip.is-below::after { bottom: auto; top: -5px; }
.tip.is-coach { pointer-events: auto; cursor: pointer; z-index: 4; }

/* ---- The controls. A button is raised and flat, with an edge under it that shortens when it is
        pressed; a disabled one is recessed and has none. ---- */
.controls { position: relative; display: flex; gap: 7px; padding-bottom: 3px; }
.controls button, .button {
  min-height: 50px; border-radius: 16px; border: 0; background: var(--panel); box-shadow: 0 3px 0 var(--edge);
  padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
}
.controls button { font-weight: 700; font-size: 14.5px; }
.controls button[aria-label] { width: 46px; padding: 0; flex: none; }
/* Result and the one button share the rest of the row equally, and neither changes size. */
.controls button[data-do="main"], .controls button[data-do="result"] { flex: 1 1 0; min-width: 0; padding: 0 6px; }
.controls button[data-do="main"] { transition: opacity 200ms; }
.controls button[data-do="result"]:not(:disabled) { background: var(--ink); color: var(--bg); box-shadow: 0 3px 0 var(--ink-edge); }
.controls button.is-burn { color: var(--flame-ink); }
.controls button.is-submit, .button.is-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 0 var(--primary-edge); }
/* The fire has just gone out: the one button takes no tap for a moment, and is faded for it. */
.controls button.is-wait { opacity: 0.5; }
.controls button:active:not(:disabled):not(.is-wait), .button:active, .square:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.controls button[data-do="result"]:active:not(:disabled) { box-shadow: 0 1px 0 var(--ink-edge); }
.controls button.is-submit:active:not(.is-wait), .button.is-primary:active { box-shadow: 0 1px 0 var(--primary-edge); }
.controls button:disabled { background: var(--well); color: var(--off); box-shadow: none; cursor: default; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
/* The note about the first answer, at the button it is about. */
.first-note { position: absolute; right: 0; bottom: calc(100% + 9px); z-index: 4; background: var(--tip); color: var(--on-tip); font-size: 13.5px; font-weight: 600; line-height: 1.25; padding: 8px 12px; border-radius: 13px; box-shadow: 0 3px 0 var(--tip-edge); pointer-events: none; }
.first-note::after { content: ""; position: absolute; right: 44px; bottom: -5px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 3px; }
@media (max-width: 379px) { .controls { gap: 6px; } .controls button[aria-label] { width: 40px; } .controls button { font-size: 14px; } }
@media (hover: hover) {
  .controls button:not(:disabled):hover, .button:hover, .square:hover { background: var(--panel-hi); }
  .controls button.is-submit:hover, .button.is-primary:hover { background: var(--primary-hi); }
  .controls button[data-do="result"]:not(:disabled):hover { background: var(--ink-hi); }
  .switch a:not([aria-current="page"]):hover, .seg button:not([aria-pressed="true"]):hover { color: var(--ink); }
  .item:hover { background: var(--well); }
}

/* ---- What opens over the board: a panel that rises from the bottom of a phone's screen, on a
        flat veil; from 860 px it is 520 px wide in the middle. ---- */
.veil { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: var(--veil); }
.sheet {
  --side: 18px;
  position: relative; box-sizing: border-box; width: 100%; max-width: 592px; max-height: 88%; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0; animation: rise 170ms ease-out; outline: none;
}
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px 12px;
  padding-left: max(var(--side), env(safe-area-inset-left, 0px)); padding-right: max(var(--side), env(safe-area-inset-right, 0px));
}
.sheet-head h2 { margin: 0; font-weight: 700; font-size: 21px; line-height: 1.1; }
.sheet-head .label { display: block; margin-bottom: 5px; }
.sheet-body {
  padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--side), env(safe-area-inset-left, 0px)); padding-right: max(var(--side), env(safe-area-inset-right, 0px));
}
/* The menu's rows in the panel: larger, and as wide as the panel's text. */
.sheet-body .menu-list { margin-inline: -12px; }
.sheet-body .item { min-height: 50px; font-size: 16px; }
.sheet-body .menu-row { padding: 8px 12px; }
.sheet-body .seg button { font-size: 15px; min-height: 40px; }

.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rule-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.rule-list svg { width: 34px; height: 39px; flex: none; }

/* The result. Its reward: the head is a band in the cup's colour. Gold, silver and bronze are
   outside the board's palette and the same in both settings (doc-7, "The page"). */
.sheet[data-cup] .sheet-head { padding-bottom: 15px; margin-bottom: 16px; }
.sheet[data-cup="gold"] .sheet-head { background: #e8b83a; color: #33270a; }
.sheet[data-cup="silver"] .sheet-head { background: #b9c7d2; color: #1c2b36; }
.sheet[data-cup="bronze"] .sheet-head { background: #c08a62; color: #2e1a0c; }
.sheet[data-cup] .sheet-head .label { color: inherit; opacity: 0.85; }
.sheet[data-cup] .sheet-head .square { color: var(--ink); box-shadow: none; margin-bottom: 0; }
.result { display: flex; flex-direction: column; gap: 12px; }
.result-top { display: flex; align-items: flex-end; gap: 10px; }
/* The number, "of N" and the label stand on one baseline. */
.result-score { display: flex; align-items: baseline; gap: 10px; }
.result-score b { font-weight: 700; font-size: 44px; line-height: 0.85; font-variant-numeric: tabular-nums lining-nums; }
.result-score em { font-style: normal; font-weight: 700; color: var(--muted); line-height: 1; }
.cup { width: 52px; height: 60px; flex: none; margin-block: -12px -3px; }
.result p { margin: 0; color: var(--muted); font-size: 13.5px; }
/* The distribution of first answers: a bar a score, the score under it. The player's first answer
   is in the primary colour, a later best in a lighter blue, the best possible in green. Without
   the counts the box keeps its height, empty or with a line that says so. */
.result-day { display: contents; }                   /* the part the server's answer fills again: its children lie in the result's column */
.hist { display: flex; align-items: flex-end; gap: 5px; height: 128px; }
.hist div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--well); min-height: 4px; }
.hist .is-you, .hist .is-pb { color: var(--ink); font-weight: 700; }
.hist .is-pb i { background: var(--primary-soft); }
.hist .is-you i { background: var(--primary); }
.hist .is-best i { background: var(--good); }
.hist.is-none { align-items: center; justify-content: center; border-radius: 16px; background: var(--well); padding-inline: 18px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend span::before { content: ""; width: 11px; height: 11px; border-radius: 4px; background: var(--well); }
.legend .is-you::before { background: var(--primary); }
.legend .is-pb::before { background: var(--primary-soft); }
.legend .is-best::before { background: var(--good); }
.acts { display: flex; gap: 8px; padding-bottom: 3px; }
.acts .button { flex: 1; min-height: 48px; }
.acts .icon { width: 21px; height: 21px; stroke-width: 2.5; }
.next { display: flex; gap: 8px; border-top: 2px solid var(--line); padding-top: 12px; padding-bottom: 3px; }
.next .button { flex: 1; min-height: 46px; }
/* The play-test's questions in the result (ARI-4): each a line and its answers, picked as the
   theme is in the menu. Removed with the test. */
.asks { display: flex; flex-direction: column; gap: 14px; border-top: 2px solid var(--line); padding-top: 12px; }
.ask { display: flex; flex-direction: column; gap: 6px; }
.asks .ask p, .asks .ask-done { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.ask .seg button { min-height: 40px; font-size: 15px; }
.ask-ends { display: flex; justify-content: space-between; padding-inline: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ask textarea { box-sizing: border-box; width: 100%; min-height: 70px; resize: vertical; border: 0; border-radius: 14px; background: var(--well); color: inherit; font: inherit; padding: 10px 12px; }
.ask textarea:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.ask .button { align-self: flex-start; min-height: 44px; margin-bottom: 3px; font-weight: 600; }

/* ---- The list of boards (list.ts; doc-8, "The list of boards"): the top row, a heading, and a
        row a board, raised like a button since it is one. In a row: the board's name over its
        size, what is on it, and at the right the player's own score, or an arrow. ---- */
.list-title { margin: 6px 0 0; font-weight: 700; font-size: 21px; line-height: 1.1; }
.list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 3px; }
.list h3 { margin: 10px 0 0; }
.list h3:first-child { margin-top: 2px; }
.row { box-sizing: border-box; min-height: 58px; padding: 6px 12px 6px 14px; border-radius: 16px; background: var(--panel); box-shadow: 0 3px 0 var(--edge); display: flex; align-items: center; gap: 10px; }
.row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.row-name { display: flex; flex-direction: column; gap: 2px; min-width: 62px; white-space: nowrap; }
.row-name b { font-weight: 700; font-size: 16px; line-height: 1.15; }
.row-name em, .row-has i, .row-own em, .row-own small { font-style: normal; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.row-has { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.row-has .key { width: 28px; height: 32px; flex: none; }
.row-has i { margin-right: 5px; }
.row-own { display: flex; align-items: center; gap: 7px; text-align: right; white-space: nowrap; }
.row-own > span { display: flex; flex-direction: column; }
.row-own b { font-weight: 700; font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.row-own .cup { width: 26px; height: 30px; margin: 0; }
.row-go { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--off); stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (hover: hover) { .row:hover { background: var(--panel-hi); } }

@media (min-width: 860px) {
  .stage { padding: 24px 16px 30px; background: none; }
  .stage::before { background-image: url("background/woodland.webp"); }
  :root[data-theme="dark"] .stage::before { background-image: url("background/woodland-dark.webp"); }
  html { background: var(--outer); }
  .page { width: 592px; border-radius: 30px; box-shadow: 0 8px 0 var(--cast); padding: 18px 24px 26px; }
  .veil { align-items: center; }
  .sheet { --side: 22px; border-radius: 26px; width: 520px; }
  .sheet-body { padding-bottom: 24px; }
  .status { gap: 16px; } .tally { gap: 14px; font-size: 17px; } .turn { font-size: 14px; padding: 8px 14px; }
  .controls button { font-size: 15.5px; }
  .controls button[aria-label] { width: 54px; }
}
/* A wide screen that is not high: less room around the card, so that the board keeps its size. */
@media (min-width: 860px) and (max-height: 800px) {
  .stage { padding: 10px 16px 14px; }
  .page { padding: 14px 24px 16px; box-shadow: 0 6px 0 var(--cast); }
}

/* ---- The board (view.ts): flat ground, one thin line between two cells, the things on it. The
        same rules draw the small pictures (.key). ---- */
.board { display: block; width: 100%; height: auto; overflow: visible; }
.land .k-grass { fill: var(--grass); }
.land .k-stone { fill: var(--stone); }
.land .k-burnt { fill: var(--burnt); }
.land .k-fire { fill: var(--fire-ground); }
.board .gr { pointer-events: all; }
.board .g { cursor: default; outline: none; }
.board .g.can { cursor: pointer; }
.board .lines, .board .cells, .board .held { pointer-events: none; }
/* The bands, inside a cell's border and under its thing. A cell under the pointer that can take a
   firebreak: lighter ground and a solid pale band. A refused tap: the same band in a cooler red
   than the fire's, for about half a second. The keyboard's focus: the primary colour. */
.band { fill: #ffffff; fill-opacity: 0.22; stroke: #fffbee; stroke-width: 6; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; transform: scale(0.88); opacity: 0; pointer-events: none; }
.band.no { fill-opacity: 0.28; stroke: var(--no); stroke-width: 7; }
.band.fo { fill: none; stroke: var(--primary); stroke-width: 7; }
@media (hover: hover) { .g.can:hover .hv { opacity: 1; } }
.g.is-no .no, .g:focus-visible .fo { opacity: 1; }
/* The line between two cells: every edge once, in the colour of the ground that counts most on its
   two sides (burnt, then stone, then grass), and drawn in that order, so that a line never ends
   over a line of another colour. */
.e { stroke-width: 3; stroke-linecap: round; }
.e.p0 { stroke: var(--grass-line); }
.e.p1 { stroke: var(--stone-line); }
.e.p2 { stroke: var(--burnt-line); }
.e-key { fill: none; stroke-width: 3; stroke-linejoin: round; stroke: var(--grass-line); }
.k-stone + .e-key { stroke: var(--stone-line); }
.k-burnt + .e-key, .k-fire + .e-key { stroke: var(--burnt-line); }
/* A firebreak's number: the turn it was cleared in. */
.num { font-family: inherit; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums lining-nums; }
/* The burns-next mark: round dashes just inside the cell's border, under the thing, in a dark red. */
.ring { fill: none; stroke: var(--mark); stroke-width: 5; stroke-dasharray: 2.4 4.2667; stroke-dashoffset: -2.13; stroke-linecap: round; stroke-linejoin: round; animation: pulse 1500ms ease-in-out infinite alternate; }
/* The held line, when the fire is out: cream cased in teal, along the cells' edges. */
.held .case { stroke: var(--held-case); stroke-width: 13; stroke-linecap: round; }
.held .line { stroke: var(--held); stroke-width: 7; stroke-linecap: round; }

/* What moves. The flame and the embers are shown in steps, at one pace, never eased: a frame is
   one of N, seen for its share of the loop. */
.fr { opacity: 0; animation-timing-function: step-end; animation-iteration-count: infinite; }
@keyframes fr-2 { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes fr-3 { 0% { opacity: 1; } 33.333% { opacity: 0; } 100% { opacity: 0; } }
@keyframes fr-4 { 0% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; } }
@keyframes fr-5 { 0% { opacity: 1; } 20% { opacity: 0; } 100% { opacity: 0; } }
@keyframes fr-6 { 0% { opacity: 1; } 16.667% { opacity: 0; } 100% { opacity: 0; } }
.c.dug .clear { animation: dig 190ms ease-out; }
.c.is-no .in { animation: shake 330ms ease-in-out; }
.held.draw line { stroke-dasharray: 1; animation: draw 420ms ease-out both; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes dig { from { opacity: 0; transform: translateY(-7px); } }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } 90% { transform: translateX(2px); } }
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } 10% { opacity: 1; } to { stroke-dashoffset: 0; } }
/* Reduced motion, and every small picture: nothing moves, and a flame shows its first frame. */
.is-still * { animation: none !important; transition: none !important; }
.is-still .fr:first-child { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .controls button[data-do="main"] { transition: none; } }
