/* ROOTBOUND interface, drawn as high-res pixel art. One art pixel = 2 CSS px. Colours come only from the palette in
   js/pixel/palette.js (ui ramp for frames and parchment; water/gold/violet/teal ramps for meters). Frames are 9-slice
   pixel images (border-image) or stepped box-shadows; nothing is blurred or rounded. Fonts are used at integer sizes:
   Pixelify Sans 16/24 (body), 32/48/96 bold (titles); Silkscreen 16 (labels) and for all digits. */
@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/pixelify-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/pixelify-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Silkscreen'; src: url('../fonts/silkscreen-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
/* Pixelify's 2, 5 and 7 read as Z, S and 1 at HUD sizes; digits come from Silkscreen, which sits on an exact grid */
@font-face { font-family: 'RB Digits'; src: url('../fonts/silkscreen-latin-400-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0030-0039, U+0025; }

:root {
  /* palette (js/pixel/palette.js) */
  --o0: #120c10; --o1: #1d1219;
  --u1: #2a1c1a; --u2: #4a3226; --u3: #7a5638; --u4: #b8895a; --u5: #e2c08e; --u6: #f6e6c4;
  --w2: #185778; --w3: #2786a3; --w4: #4fb8c9; --w5: #9ae2e6; --w6: #e8fcf8;
  --g0: #33190f; --g1: #5c3012; --g2: #8f5118; --g3: #c27f22; --g4: #e8ae38; --g5: #f8d968; --g6: #fff4b8;
  --v2: #5e3486; --v3: #8a54b4; --v4: #b888d8; --v5: #e4c6f2;
  --t1: #123f3e; --t2: #1a6b5f; --t3: #2aa184; --t4: #5ed2a8; --t5: #b4f2d4;
  --r1: #6e1a1c; --r2: #a82a22; --r3: #d8482a; --r4: #f27a46;
  --leaf: #a8cc52;
  --sky-dawn: #f4c890; --sky-day: #86b2d8; --sky-dusk: #e8804a; --sky-night: #171c3a;

  --font: 'RB Digits', 'Pixelify Sans', 'Silkscreen', monospace;
  --label: 'Silkscreen', 'Pixelify Sans', monospace;
  --shadow: 2px 2px 0 var(--o0);
  /* a 2px outline with the corner pixels knocked out */
  --notch: 0 -2px 0 0 var(--o0), 0 2px 0 0 var(--o0), -2px 0 0 0 var(--o0), 2px 0 0 0 var(--o0);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --f-wood: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M2 0h9v1h-9zM1 1h1v1h-1zM11 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM1 11h1v1h-1zM11 11h1v1h-1zM2 12h9v1h-9z'/%3E%3Cpath fill='%23b8895a' d='M2 1h9v1h-9zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%23e2c08e' d='M2 2h1v1h-1zM10 2h1v1h-1zM2 10h1v1h-1zM10 10h1v1h-1z'/%3E%3Cpath fill='%231d1219' d='M3 2h7v1h-7zM2 3h1v1h-1zM10 3h1v1h-1zM2 4h1v1h-1zM10 4h1v1h-1zM2 5h1v1h-1zM10 5h1v1h-1zM2 6h1v1h-1zM10 6h1v1h-1zM2 7h1v1h-1zM10 7h1v1h-1zM2 8h1v1h-1zM10 8h1v1h-1zM2 9h1v1h-1zM10 9h1v1h-1zM3 10h7v1h-7z'/%3E%3Cpath fill='%234a3226' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM2 11h9v1h-9z'/%3E%3Cpath fill='%232a1c1a' d='M3 3h7v1h-7zM3 4h7v1h-7zM3 5h7v1h-7zM3 6h7v1h-7zM3 7h7v1h-7zM3 8h7v1h-7zM3 9h7v1h-7z'/%3E%3C/svg%3E");
  --f-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M3 0h7v1h-7zM2 1h1v1h-1zM10 1h1v1h-1zM1 2h1v1h-1zM11 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM1 10h1v1h-1zM11 10h1v1h-1zM2 11h1v1h-1zM10 11h1v1h-1zM3 12h7v1h-7z'/%3E%3Cpath fill='%23b8895a' d='M3 1h7v1h-7zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1z'/%3E%3Cpath fill='%23f6e6c4' d='M2 2h1v1h-1zM10 2h1v1h-1zM4 4h5v1h-5zM4 5h1v1h-1zM8 5h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM8 6h1v1h-1zM4 7h1v1h-1zM8 7h1v1h-1zM4 8h5v1h-5zM2 10h1v1h-1zM10 10h1v1h-1z'/%3E%3Cpath fill='%237a5638' d='M3 2h7v1h-7zM2 3h1v1h-1zM11 3h1v1h-1zM2 4h1v1h-1zM11 4h1v1h-1zM2 5h1v1h-1zM11 5h1v1h-1zM2 6h1v1h-1zM11 6h1v1h-1zM2 7h1v1h-1zM11 7h1v1h-1zM2 8h1v1h-1zM11 8h1v1h-1zM2 9h1v1h-1zM11 9h1v1h-1zM3 11h7v1h-7z'/%3E%3Cpath fill='%231d1219' d='M3 3h7v1h-7zM3 4h1v1h-1zM9 4h1v1h-1zM3 5h1v1h-1zM9 5h1v1h-1zM3 6h1v1h-1zM9 6h1v1h-1zM3 7h1v1h-1zM9 7h1v1h-1zM3 8h1v1h-1zM9 8h1v1h-1zM3 9h7v1h-7z'/%3E%3Cpath fill='%234a3226' d='M10 3h1v1h-1zM10 4h1v1h-1zM10 5h1v1h-1zM10 6h1v1h-1zM10 7h1v1h-1zM10 8h1v1h-1zM10 9h1v1h-1zM3 10h7v1h-7z'/%3E%3Cpath fill='%23e2c08e' d='M6 5h1v1h-1zM5 6h1v1h-1zM7 6h1v1h-1zM6 7h1v1h-1z'/%3E%3C/svg%3E");
  --f-slip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%23f6e6c4' d='M1 1h11v1h-11zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%23e2c08e' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%23b8895a' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-slipOn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%23e8ae38' d='M1 1h11v1h-11zM1 2h1v1h-1zM11 2h1v1h-1zM1 3h1v1h-1zM11 3h1v1h-1zM1 4h1v1h-1zM11 4h1v1h-1zM1 5h1v1h-1zM11 5h1v1h-1zM1 6h1v1h-1zM11 6h1v1h-1zM1 7h1v1h-1zM11 7h1v1h-1zM1 8h1v1h-1zM11 8h1v1h-1zM1 9h1v1h-1zM11 9h1v1h-1zM1 10h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3Cpath fill='%23f6e6c4' d='M2 2h9v1h-9zM2 3h8v1h-8zM2 4h8v1h-8zM2 5h8v1h-8zM2 6h8v1h-8zM2 7h8v1h-8zM2 8h8v1h-8zM2 9h8v1h-8z'/%3E%3Cpath fill='%23b8895a' d='M10 3h1v1h-1zM10 4h1v1h-1zM10 5h1v1h-1zM10 6h1v1h-1zM10 7h1v1h-1zM10 8h1v1h-1zM10 9h1v1h-1zM2 10h9v1h-9z'/%3E%3C/svg%3E");
  --f-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%23fff4b8' d='M1 1h11v1h-11zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%23e8ae38' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%23c27f22' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-goldDown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%23c27f22' d='M1 1h11v1h-11zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%23e8ae38' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%23f8d968' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%23b8895a' d='M1 1h11v1h-11zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%237a5638' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%234a3226' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-btnDown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h1v1h-1zM12 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%232a1c1a' d='M1 1h11v1h-11zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%234a3226' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%23b8895a' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-seal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M4 0h5v1h-5zM3 1h1v1h-1zM9 1h1v1h-1zM2 2h1v1h-1zM10 2h1v1h-1zM1 3h1v1h-1zM11 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM1 9h1v1h-1zM11 9h1v1h-1zM2 10h1v1h-1zM10 10h1v1h-1zM3 11h1v1h-1zM9 11h1v1h-1zM4 12h5v1h-5z'/%3E%3Cpath fill='%23b8895a' d='M4 1h5v1h-5zM3 2h1v1h-1zM9 2h1v1h-1zM2 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM2 9h1v1h-1z'/%3E%3Cpath fill='%231d1219' d='M4 2h5v1h-5zM3 3h1v1h-1zM9 3h1v1h-1zM2 4h1v1h-1zM10 4h1v1h-1zM2 5h1v1h-1zM10 5h1v1h-1zM2 6h1v1h-1zM10 6h1v1h-1zM2 7h1v1h-1zM10 7h1v1h-1zM2 8h1v1h-1zM10 8h1v1h-1zM3 9h1v1h-1zM9 9h1v1h-1zM4 10h5v1h-5z'/%3E%3Cpath fill='%234a3226' d='M4 3h5v1h-5zM10 3h1v1h-1zM3 4h7v1h-7zM11 4h1v1h-1zM3 5h7v1h-7zM11 5h1v1h-1zM3 6h7v1h-7zM11 6h1v1h-1zM3 7h7v1h-7zM11 7h1v1h-1zM3 8h7v1h-7zM11 8h1v1h-1zM4 9h5v1h-5zM10 9h1v1h-1zM3 10h1v1h-1zM9 10h1v1h-1zM4 11h5v1h-5z'/%3E%3C/svg%3E");
  --f-sealTeal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M4 0h5v1h-5zM3 1h1v1h-1zM9 1h1v1h-1zM2 2h1v1h-1zM10 2h1v1h-1zM1 3h1v1h-1zM11 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM1 9h1v1h-1zM11 9h1v1h-1zM2 10h1v1h-1zM10 10h1v1h-1zM3 11h1v1h-1zM9 11h1v1h-1zM4 12h5v1h-5z'/%3E%3Cpath fill='%235ed2a8' d='M4 1h5v1h-5zM3 2h1v1h-1zM9 2h1v1h-1zM2 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM2 9h1v1h-1z'/%3E%3Cpath fill='%231d1219' d='M4 2h5v1h-5zM3 3h1v1h-1zM9 3h1v1h-1zM2 4h1v1h-1zM10 4h1v1h-1zM2 5h1v1h-1zM10 5h1v1h-1zM2 6h1v1h-1zM10 6h1v1h-1zM2 7h1v1h-1zM10 7h1v1h-1zM2 8h1v1h-1zM10 8h1v1h-1zM3 9h1v1h-1zM9 9h1v1h-1zM4 10h5v1h-5z'/%3E%3Cpath fill='%23123f3e' d='M4 3h5v1h-5zM3 4h7v1h-7zM3 5h7v1h-7zM3 6h7v1h-7zM3 7h7v1h-7zM3 8h7v1h-7zM4 9h5v1h-5z'/%3E%3Cpath fill='%231a6b5f' d='M10 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM10 9h1v1h-1zM3 10h1v1h-1zM9 10h1v1h-1zM4 11h5v1h-5z'/%3E%3C/svg%3E");
  --f-well: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M1 0h11v1h-11zM0 1h13v1h-13zM0 2h2v1h-2zM12 2h1v1h-1zM0 3h2v1h-2zM12 3h1v1h-1zM0 4h2v1h-2zM12 4h1v1h-1zM0 5h2v1h-2zM12 5h1v1h-1zM0 6h2v1h-2zM12 6h1v1h-1zM0 7h2v1h-2zM12 7h1v1h-1zM0 8h2v1h-2zM12 8h1v1h-1zM0 9h2v1h-2zM12 9h1v1h-1zM0 10h2v1h-2zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM1 12h11v1h-11z'/%3E%3Cpath fill='%231d1219' d='M2 2h9v1h-9zM2 3h9v1h-9zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM2 9h9v1h-9zM2 10h9v1h-9z'/%3E%3Cpath fill='%234a3226' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM1 11h11v1h-11z'/%3E%3C/svg%3E");
  --f-alarm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M4 0h5v1h-5zM3 1h1v1h-1zM9 1h1v1h-1zM2 2h1v1h-1zM10 2h1v1h-1zM1 3h1v1h-1zM11 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM1 9h1v1h-1zM11 9h1v1h-1zM2 10h1v1h-1zM10 10h1v1h-1zM3 11h1v1h-1zM9 11h1v1h-1zM4 12h5v1h-5z'/%3E%3Cpath fill='%23e88ca2' d='M4 1h5v1h-5zM3 2h1v1h-1zM9 2h1v1h-1zM2 3h1v1h-1zM1 4h1v1h-1zM1 5h1v1h-1zM1 6h1v1h-1zM1 7h1v1h-1zM1 8h1v1h-1zM2 9h1v1h-1z'/%3E%3Cpath fill='%238a3552' d='M4 2h5v1h-5zM3 3h7v1h-7zM2 4h9v1h-9zM2 5h9v1h-9zM2 6h9v1h-9zM2 7h9v1h-9zM2 8h9v1h-9zM3 9h7v1h-7zM4 10h5v1h-5z'/%3E%3Cpath fill='%235a1f36' d='M10 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM10 9h1v1h-1zM3 10h1v1h-1zM9 10h1v1h-1zM4 11h5v1h-5z'/%3E%3C/svg%3E");
  --f-plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23120c10' d='M2 0h9v1h-9zM1 1h1v1h-1zM11 1h1v1h-1zM0 2h1v1h-1zM12 2h1v1h-1zM0 3h1v1h-1zM12 3h1v1h-1zM0 4h1v1h-1zM12 4h1v1h-1zM0 5h1v1h-1zM12 5h1v1h-1zM0 6h1v1h-1zM12 6h1v1h-1zM0 7h1v1h-1zM12 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM1 11h1v1h-1zM11 11h1v1h-1zM2 12h9v1h-9z'/%3E%3Cpath fill='%23f6e6c4' d='M2 1h9v1h-9zM1 2h1v1h-1zM1 3h1v1h-1zM1 4h1v1h-1zM4 4h1v1h-1zM8 4h1v1h-1zM1 5h1v1h-1zM5 5h3v1h-3zM1 6h1v1h-1zM5 6h3v1h-3zM1 7h1v1h-1zM5 7h3v1h-3zM1 8h1v1h-1zM4 8h1v1h-1zM8 8h1v1h-1zM1 9h1v1h-1zM1 10h1v1h-1z'/%3E%3Cpath fill='%23e2c08e' d='M2 2h9v1h-9zM2 3h1v1h-1zM10 3h1v1h-1zM2 4h1v1h-1zM5 4h3v1h-3zM10 4h1v1h-1zM2 5h1v1h-1zM4 5h1v1h-1zM8 5h1v1h-1zM10 5h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM8 6h1v1h-1zM10 6h1v1h-1zM2 7h1v1h-1zM4 7h1v1h-1zM8 7h1v1h-1zM10 7h1v1h-1zM2 8h1v1h-1zM5 8h3v1h-3zM10 8h1v1h-1zM2 9h1v1h-1zM10 9h1v1h-1zM2 10h9v1h-9z'/%3E%3Cpath fill='%23b8895a' d='M11 2h1v1h-1zM11 3h1v1h-1zM11 4h1v1h-1zM11 5h1v1h-1zM11 6h1v1h-1zM11 7h1v1h-1zM11 8h1v1h-1zM11 9h1v1h-1zM11 10h1v1h-1zM2 11h9v1h-9z'/%3E%3Cpath fill='%237a5638' d='M3 3h7v1h-7zM3 4h1v1h-1zM9 4h1v1h-1zM3 5h1v1h-1zM9 5h1v1h-1zM3 6h1v1h-1zM9 6h1v1h-1zM3 7h1v1h-1zM9 7h1v1h-1zM3 8h1v1h-1zM9 8h1v1h-1zM3 9h7v1h-7z'/%3E%3C/svg%3E");
  --divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='98' height='14' viewBox='0 0 49 7' shape-rendering='crispEdges'%3E%3Cpath d='M21 0h2v1h-2zM26 0h2v1h-2zM20 1h4v1h-4zM25 1h4v1h-4zM21 2h3v1h-3zM25 2h3v1h-3zM23 3h1v1h-1zM25 3h1v1h-1zM24 4h1v1h-1zM24 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h41v1h-41zM46 6h1v1h-1zM48 6h1v1h-1z'/%3E%3C/svg%3E");
  --divider-w: 98px;
  --divider-h: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--u1); overflow: hidden; color: var(--u6); font: 400 16px/1.25 var(--font); -webkit-font-smoothing: none; -moz-osx-font-smoothing: grayscale; font-synthesis: none; }
/* the pixel font's fi ligature draws as a capital A */
* { font-variant-ligatures: none !important; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
body.clean #screens, body.clean #veil, body.clean #hud { display: none !important; }
.ico { width: 1em; height: 1em; flex: none; display: block; }
button { font: 400 16px/1 var(--font); color: inherit; cursor: pointer; border: 0; background: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button .ico { font-size: 24px; }
button:focus-visible { outline: 2px dashed var(--g5); outline-offset: 4px; }

#veil { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s steps(4);
  background: linear-gradient(90deg, rgba(18, 12, 16, 0.76) 0%, rgba(18, 12, 16, 0.4) 46%, rgba(18, 12, 16, 0) 72%); }
#veil.on { opacity: 1; }
#veil.full { opacity: 1; background: rgba(18, 12, 16, 0.62); }

/* ---------------------------------------------------------------- frames */
.plaque, .panel, .card, .toast, #ctx, .spot, .primary, .ghost { border-style: solid; border-color: transparent; border-width: 12px; border-image-slice: 12 fill; border-image-repeat: stretch; image-rendering: pixelated; }
.plaque { border-image-source: var(--f-wood); }
.panel { border-image-source: var(--f-paper); }
.divider { display: block; width: var(--divider-w); height: var(--divider-h); margin: 6px auto 18px; background: var(--g4); -webkit-mask: var(--divider) center / 100% 100% no-repeat; mask: var(--divider) center / 100% 100% no-repeat; }
.panel .divider { background: var(--u3); }

/* buttons: a gold stamped bar for the main action, a wooden one for the rest */
.primary, .ghost { padding: 6px 14px 4px; font: 400 16px/1 var(--label); text-transform: uppercase; letter-spacing: 0; }
.primary { border-image-source: var(--f-gold); color: var(--g0); }
.primary:hover { border-image-source: var(--f-goldHover, var(--f-gold)); filter: brightness(1.06); }
.primary:active { border-image-source: var(--f-goldDown); transform: translateY(2px); }
.ghost { border-image-source: var(--f-btn); color: var(--u6); text-shadow: var(--shadow); }
.ghost:hover { color: var(--g6); }
.ghost:active { border-image-source: var(--f-btnDown); transform: translateY(2px); }
.primary .ico, .ghost .ico { font-size: 24px; margin: -4px 0 -2px; }

/* ---------------------------------------------------------------- screens */
#screens { position: fixed; inset: 0; pointer-events: none; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; overflow-y: auto; }
.center { margin: auto; text-align: center; padding: 24px; max-width: 580px; }
.kicker { font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--g5); text-shadow: var(--shadow); }
.panel .kicker { color: var(--u3); text-shadow: none; }
.wordmark { font: 700 96px/1 var(--font); color: var(--u6); margin: 10px 0 6px; text-shadow: 4px 4px 0 var(--o0), -2px -2px 0 var(--u3); letter-spacing: 0; }
.title { font: 700 48px/1 var(--font); margin: 10px 0 6px; color: var(--u6); text-shadow: 2px 2px 0 var(--o0); }
.panel .title { color: var(--u1); text-shadow: 2px 2px 0 var(--u5); }
.lede { font: 400 24px/1.3 var(--font); color: var(--u6); margin: 0 0 22px; text-shadow: var(--shadow); }
.panel .lede { color: var(--u2); text-shadow: none; }
.quiet { font: 400 16px/1.3 var(--font); color: var(--u5); margin: 4px 0 0; text-shadow: var(--shadow); }
#s-loading { background: var(--u1); }
#s-loading .divider { margin-top: 4px; }
.loadline { width: 216px; height: 12px; margin: 10px auto 0; background: var(--o1); box-shadow: var(--notch); position: relative; overflow: hidden; }
.loadline i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, var(--g5) 0 4px, var(--g4) 4px 8px, var(--g3) 8px); transition: width 0.25s steps(6); }
#load-text { margin-top: 12px; }

.menu { margin: auto auto auto 0; padding: calc(28px + var(--safe-t)) 28px calc(28px + var(--safe-b)) calc(clamp(20px, 6vw, 90px) + var(--safe-l)); max-width: 680px; }
.menu .divider { margin: 2px 0 20px; }
.forest-line { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 0 0 26px; font: 400 16px/1 var(--font); color: var(--u5); text-shadow: var(--shadow); }
.forest-line b { display: block; font: 700 32px/1 var(--font); color: var(--g5); margin-bottom: 6px; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.actions.col { flex-direction: column; align-items: stretch; width: 280px; margin: 20px auto 0; gap: 12px; }
.center .actions, .plant .actions { justify-content: center; }
.settings { display: flex; gap: 10px 14px; margin-top: 26px; flex-wrap: wrap; align-items: center; }
.center-settings { justify-content: center; }
.chip { font: 400 16px/1 var(--font); color: var(--u5); padding: 4px 8px 4px 4px; gap: 6px; background: var(--u1); box-shadow: var(--notch), inset 0 2px 0 0 var(--u2); }
.chip .ico { font-size: 24px; color: var(--u4); }
.chip:hover { color: var(--u6); }
.chip:active { transform: translateY(2px); }

.panel { color: var(--u1); padding: 22px 26px 18px; }
.rules { list-style: none; padding: 0; margin: 4px 0 22px; display: grid; gap: 12px; text-align: left; }
.rules li { display: flex; gap: 14px; align-items: flex-start; font: 400 16px/1.38 var(--font); color: var(--u2); }
.rules li > span:first-child { flex: none; width: 32px; height: 32px; display: grid; place-items: center; font-size: 24px; color: var(--u3); background: var(--u5); box-shadow: 0 -2px 0 0 var(--u4), 0 2px 0 0 var(--u4), -2px 0 0 0 var(--u4), 2px 0 0 0 var(--u4); margin: 2px 2px 0; }
.rules li:nth-child(2) > span:first-child { color: var(--w2); }
.rules li:nth-child(3) > span:first-child { color: var(--g2); }
.rules li:nth-child(4) > span:first-child { color: var(--v2); }
.rules li:nth-child(5) > span:first-child { color: var(--r2); }
.rules li:nth-child(6) > span:first-child { color: var(--t2); }
.rules li:nth-child(7) > span:first-child { color: var(--r2); }
.rules b { color: var(--u1); font-weight: 700; }
.how { max-width: 660px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 4px 0 20px; text-align: center; background: var(--u4); gap: 2px; padding: 2px; }
.stats > div { padding: 10px 6px 10px; background: var(--u6); }
.stats dt { font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--u3); margin-bottom: 8px; }
.stats dd { margin: 0; font: 700 32px/1 var(--font); color: var(--u1); }
.end { max-width: 680px; }
#end-heir .kicker { margin-top: 2px; }

/* planting: notes on the parchment */
.plant { margin: auto; padding: 24px 24px 18px; text-align: center; max-width: 1000px; width: calc(100% - 40px); }
#spots { counter-reset: spot; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 2px 0 16px; }
.spot { position: relative; width: 290px; text-align: left; padding: 6px 8px 6px; border-image-source: var(--f-slip); color: var(--u1); display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.spot::before { counter-increment: spot; content: counter(spot); position: absolute; top: -2px; right: -2px; font: 400 16px/1 var(--label); color: var(--u3); }
.spot:hover, .spot:focus-visible { border-image-source: var(--f-slipOn); transform: translateY(-2px); }
.spot:active { transform: translateY(0); }
.spot h3 { font: 700 24px/1.1 var(--font); margin: 0 18px 6px 0; color: var(--u1); }
.spot p { font: 400 16px/1.3 var(--font); color: var(--u2); margin: 0; }
.spot .tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 2px 2px; }
.spot .tag { font: 400 16px/1 var(--font); padding: 3px 6px 2px; color: var(--g1); background: var(--g5); box-shadow: 0 -2px 0 0 var(--g2), 0 2px 0 0 var(--g2), -2px 0 0 0 var(--g2), 2px 0 0 0 var(--g2); }
.spot .tag.good { color: var(--t1); background: var(--t5); box-shadow: 0 -2px 0 0 var(--t2), 0 2px 0 0 var(--t2), -2px 0 0 0 var(--t2), 2px 0 0 0 var(--t2); }
#heir { margin: 0 auto 16px; font: 400 16px/1.3 var(--font); color: var(--u2); }
#heir b { color: var(--g1); font-weight: 700; }

/* adaptations: specimen plates */
.draft { max-width: 860px; }
#s-draft { background: rgba(18, 12, 16, 0.62); }
#draft-cards, #heir-cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.card { position: relative; width: 236px; padding: 8px 10px 10px; border-image-source: var(--f-plate); color: var(--u1); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; transition: transform 0.12s steps(2); }
.card:hover, .card:focus-visible { transform: translateY(-4px); }
.card:active { transform: translateY(0); }
.card .plate { font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--u3); margin: 4px 0 10px; }
.card .ci { width: 64px; height: 64px; display: grid; place-items: center; color: var(--u2); background: var(--u5); box-shadow: 0 -2px 0 0 var(--u3), 0 2px 0 0 var(--u3), -2px 0 0 0 var(--u3), 2px 0 0 0 var(--u3), inset 0 -4px 0 0 var(--u4); --ico-hi: var(--u6); }
.card .ci .ico { width: 48px; height: 48px; }
.card:hover .ci { color: var(--g1); background: var(--g5); box-shadow: 0 -2px 0 0 var(--g2), 0 2px 0 0 var(--g2), -2px 0 0 0 var(--g2), 2px 0 0 0 var(--g2), inset 0 -4px 0 0 var(--g4); --ico-hi: var(--g6); }
.card h3 { font: 700 24px/1.1 var(--font); margin: 14px 0 4px; }
.card .lat { display: block; font: 400 16px/1.2 var(--font); color: var(--u3); font-style: normal; }
.card p { position: relative; font: 400 16px/1.3 var(--font); color: var(--u2); margin: 10px 0 0; padding-top: 12px; }
.card p::before { content: ''; position: absolute; top: 0; left: 50%; width: 40px; margin-left: -20px; height: 2px; background: var(--u4); box-shadow: -6px 0 0 -0px var(--u6), 6px 0 0 0 var(--u6); }
.card.small { width: 188px; padding: 2px 4px 2px 2px; border-image-source: var(--f-slip); display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; align-items: center; text-align: left; }
.card.small .plate { display: none; }
.card.small .ci { width: 40px; height: 40px; background: var(--u6); }
.card.small .ci .ico { width: 24px; height: 24px; }
.card.small h3 { font-size: 16px; margin: 0; font-weight: 700; align-self: center; }
.card.small .lat { display: none; }
.card.small:hover { transform: translateY(-2px); }
.card.small.on { border-image-source: var(--f-slipOn); }
.card.small.on .ci { color: var(--g1); background: var(--g5); box-shadow: 0 -2px 0 0 var(--g2), 0 2px 0 0 var(--g2), -2px 0 0 0 var(--g2), 2px 0 0 0 var(--g2), inset 0 -4px 0 0 var(--g4); }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
#hud button, #hud .seg, #hud #ctx, #hud-res, #hud-tree, #hud-top, #hud-trade { pointer-events: auto; }
#hud .plaque { position: absolute; }

/* resources: segmented pixel meters, water / sugar / minerals */
#hud-res { left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); width: 268px; padding: 2px 4px 0 2px; display: grid; gap: 6px; }
.res { display: flex; gap: 8px; align-items: flex-start; --m5: #fff; --m4: #ccc; --m3: #999; --m2: #666; }
#r-water { --m5: var(--w5); --m4: var(--w4); --m3: var(--w3); --m2: var(--w2); --ico-hi: var(--w6); }
#r-sugar { --m5: var(--g5); --m4: var(--g4); --m3: var(--g3); --m2: var(--g2); --ico-hi: var(--g6); }
#r-min { --m5: var(--v5); --m4: var(--v4); --m3: var(--v3); --m2: var(--v2); --ico-hi: var(--v5); }
.res .ri { font-size: 24px; color: var(--m4); margin-top: 6px; }
.rb { flex: 1; min-width: 0; }
.rl { display: flex; justify-content: space-between; align-items: baseline; height: 18px; }
.rl b { font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--u4); font-weight: 400; }
.rv { font: 400 24px/1 var(--font); color: var(--u6); white-space: nowrap; }
.rv small { font-size: 16px; color: var(--u4); margin-left: 2px; }
.bar { position: relative; height: 14px; margin: 4px 2px 4px; background: var(--o1); box-shadow: var(--notch); overflow: hidden; }
.bar::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--u1); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: repeating-linear-gradient(90deg, transparent 0 4px, var(--o1) 4px 6px), linear-gradient(180deg, var(--m5) 0 2px, var(--m4) 2px 8px, var(--m3) 8px 12px, var(--m2) 12px); }
.rr { font: 400 16px/1 var(--font); color: var(--u4); height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr .up { color: var(--leaf); }
.rr .down { color: var(--r4); }
.res.low .bar { box-shadow: 0 -2px 0 0 var(--r3), 0 2px 0 0 var(--r3), -2px 0 0 0 var(--r3), 2px 0 0 0 var(--r3); }
.res.low .rv { color: var(--r4); }
.res.low .ri { animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* the day: a sky strip with the sun walking across it, and a pip for each day of the season */
#hud-top { left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-t)); display: flex; align-items: stretch; gap: 14px; padding: 0 4px 0 2px; }
#h-day { display: grid; gap: 6px; }
.dl { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#h-dayname { font: 400 24px/1 var(--font); color: var(--u6); white-space: nowrap; }
#h-daynum { font: 400 16px/1 var(--font); color: var(--u4); white-space: nowrap; }
#h-dial { --day: 74%; position: relative; width: 144px; height: 10px; margin: 8px 2px 0; box-shadow: var(--notch);
  background: linear-gradient(90deg, var(--sky-dawn) 0 6px, var(--sky-day) 6px calc(var(--day) - 8px), var(--sky-dusk) calc(var(--day) - 8px) var(--day), var(--sky-night) var(--day)); }
#h-dial::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(246, 230, 196, 0.35); }
#h-sun { position: absolute; z-index: 1; left: -12px; top: -9px; width: 24px; height: 24px; font-size: 24px; color: var(--g5); --ico-hi: var(--g6); filter: drop-shadow(2px 2px 0 var(--o0)); }
#h-sun.moon { color: var(--u6); }
#h-strip { display: flex; gap: 4px; margin: 2px 2px 2px; }
#h-strip i { width: 8px; height: 6px; background: var(--u2); }
#h-strip i.past { background: var(--g3); }
#h-strip i.now { background: var(--g5); box-shadow: 0 -2px 0 0 var(--g6); }
#h-weather { display: flex; gap: 10px; align-items: flex-end; padding: 0 2px 0 14px; box-shadow: inset 2px 0 0 0 var(--u2); }
#h-weather .w { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 400 16px/1 var(--font); color: var(--u4); }
#h-weather .w .ico { font-size: 24px; color: var(--u5); --ico-hi: var(--u6); }
#h-weather .w.today { color: var(--u6); }
#h-weather .w.today .ico { color: var(--u6); }
#h-weather .w.hot .ico { color: var(--r4); --ico-hi: var(--g5); }

/* controls and medallions: square seals with knocked-out corners */
#hud-ctrl { position: absolute; right: calc(12px + var(--safe-r)); top: calc(14px + var(--safe-t)); display: flex; gap: 12px; }
.round, #hud-adapt .a, #edge-marks .em { box-shadow: var(--notch), inset 2px 2px 0 0 var(--u4), inset -2px -2px 0 0 var(--u1); background: var(--u2); color: var(--u6); }
.round { width: 44px; height: 44px; font: 400 24px/1 var(--font); text-shadow: var(--shadow); }
.round .ico { font-size: 24px; filter: drop-shadow(2px 2px 0 var(--o0)); }
.round:hover { background: var(--u3); }
.round:active { transform: translateY(2px); box-shadow: var(--notch), inset 2px 2px 0 0 var(--u1), inset -2px -2px 0 0 var(--u3); }

#hud-tree { right: calc(12px + var(--safe-r)); top: calc(70px + var(--safe-t)); padding: 0 4px 0 2px; display: grid; gap: 6px; }
#hud-tree > div { display: flex; align-items: center; gap: 8px; font: 400 16px/1 var(--font); color: var(--u4); }
#hud-tree .ico { font-size: 24px; color: var(--u5); }
#hud-tree > div:nth-child(1) .ico { color: var(--leaf); }
#hud-tree > div:nth-child(2) .ico { color: var(--r3); --ico-hi: var(--r4); }
#hud-tree > div:nth-child(3) .ico { color: var(--r4); --ico-hi: var(--u6); }
#hud-tree b { font: 400 24px/1 var(--font); color: var(--u6); min-width: 40px; text-align: right; }
#h-health.low b { color: var(--r4); }
#h-health.low .ico { animation: blink 0.8s steps(1) infinite; }

#hud-trade { right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); padding: 0 2px 0 0; display: grid; gap: 8px; }
#hud-trade .tl { display: flex; align-items: center; gap: 8px; font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--t4); }
#hud-trade .tl .ico { font-size: 24px; --ico-hi: var(--t5); }
#h-favor { width: 74px; height: 12px; margin-left: auto; margin-right: 2px; background: var(--o1); box-shadow: var(--notch); overflow: hidden; }
#h-favor i { display: block; height: 100%; width: 50%; background: repeating-linear-gradient(90deg, transparent 0 4px, var(--o1) 4px 6px), linear-gradient(180deg, var(--t5) 0 2px, var(--t4) 2px 6px, var(--t3) 6px 10px, var(--t2) 10px); transition: width 0.3s steps(4); }
.seg { display: flex; gap: 2px; background: var(--o0); padding: 2px; margin: 0 2px 2px; }
.seg button { font: 400 16px/1 var(--font); padding: 6px 9px 5px; color: var(--u5); background: var(--u2); box-shadow: inset 0 2px 0 0 var(--u3); }
.seg button:hover { color: var(--u6); }
.seg button.on { color: var(--t5); background: var(--t1); box-shadow: inset 0 2px 0 0 var(--o0); }

#hud-adapt { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); display: flex; gap: 10px; flex-wrap: wrap; max-width: 46vw; }
#hud-adapt .a { width: 36px; height: 36px; display: grid; place-items: center; font-size: 24px; color: var(--g5); --ico-hi: var(--g6); pointer-events: auto; }
#hud-adapt .a.heir { color: var(--t4); --ico-hi: var(--t5); background: var(--t1); box-shadow: var(--notch), inset 2px 2px 0 0 var(--t3), inset -2px -2px 0 0 var(--o1); }

/* notes: small parchment slips */
#toasts { position: absolute; left: 50%; transform: translateX(-50%); top: calc(96px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 500px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 2px; border-image-source: var(--f-slip); color: var(--u1); font: 400 16px/1.25 var(--font); animation: toastIn 0.24s steps(3); transition: opacity 0.4s steps(3); max-width: 100%; }
.toast .ico { font-size: 24px; color: var(--g2); }
.toast.warn .ico { color: var(--r2); }
.toast.good .ico { color: var(--t2); }
.toast.gold .ico { color: var(--g2); }
.toast.water .ico { color: var(--w2); }
.toast.fade { opacity: 0; }
.toast button { font: 700 16px/1 var(--font); color: var(--r2); padding: 2px 0 0 6px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

#hint { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); font: 400 24px/1.25 var(--font); color: var(--u6); text-align: center; max-width: min(86vw, 560px); text-shadow: 2px 2px 0 var(--o0), -2px 0 0 var(--o0), 0 -2px 0 var(--o0), 2px 0 0 var(--o0), 0 2px 0 var(--o0); transition: opacity 0.4s steps(3); }
#hint:empty { opacity: 0; }

#cost { position: absolute; transform: translate(-50%, -150%); font: 400 16px/1 var(--font); padding: 4px 8px 3px 16px; white-space: nowrap; color: var(--u1); background: var(--u6); box-shadow: var(--notch), inset 0 -2px 0 0 var(--u4); }
#cost::before { content: ''; position: absolute; left: 6px; top: 50%; width: 4px; height: 4px; margin-top: -2px; background: var(--u3); }
#cost.bad { color: var(--r1); background: var(--rose-5, #ffd0d8); box-shadow: var(--notch), inset 0 -2px 0 0 #e88ca2; }
#cost.slow { color: var(--g1); background: var(--g6); }
#ctx { position: absolute; transform: translate(-50%, calc(-100% - 16px)); padding: 0 2px 2px; border-image-source: var(--f-slip); color: var(--u1); display: grid; gap: 8px; min-width: 210px; }
#ctx-info { font: 400 16px/1.3 var(--font); color: var(--u2); }
#ctx-info b { color: var(--u1); font-weight: 700; }
#ctx button { padding: 6px 10px 5px; font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--u6); background: var(--r2); text-shadow: 2px 2px 0 var(--r1); box-shadow: var(--notch), inset 2px 2px 0 0 var(--r3), inset -2px -2px 0 0 var(--r1); margin: 2px; }
#ctx button:active { transform: translateY(2px); }
#ctx button .ico { font-size: 24px; margin: -4px 0; }
#edge-marks .em { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; display: grid; place-items: center; font-size: 24px; color: var(--u6); background: var(--r2); box-shadow: var(--notch), inset 2px 2px 0 0 var(--r3), inset -2px -2px 0 0 var(--r1); pointer-events: auto; cursor: pointer; animation: blink 1s steps(1) infinite; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 640px) {
  #hud-res { width: min(254px, calc(100vw - 136px)); padding: 0 2px 0 0; gap: 4px; }
  .rl b { display: none; }
  .rl { justify-content: flex-end; height: 16px; }
  .rv { font-size: 16px; }
  .rv small { font-size: 16px; }
  .res .ri { margin-top: 2px; }
  .rr { font-size: 16px; }
  .res { gap: 6px; }
  #hud-top { top: auto; bottom: calc(60px + var(--safe-b)); gap: 10px; }
  #h-dayname { font-size: 16px; }
  #h-daynum { display: none; }
  #h-dial { width: 120px; }
  #h-strip { gap: 2px; }
  #h-strip i { width: 8px; }
  #h-weather { gap: 6px; padding-left: 10px; }
  #hud-tree { top: calc(68px + var(--safe-t)); }
  #hud-tree small { display: none; }
  #hud-tree b { font-size: 16px; min-width: 32px; }
  #toasts { top: auto; bottom: calc(196px + var(--safe-b)); }
  #hint { font-size: 16px; bottom: calc(140px + var(--safe-b)); }
  #hud-trade { bottom: auto; top: calc(196px + var(--safe-t)); }
  #hud-trade .seg button { padding: 6px 6px 5px; }
  #h-favor { width: 50px; }
  #hud-adapt { max-width: calc(100vw - 28px - var(--safe-l) - var(--safe-r)); gap: 8px; }
  .wordmark { font-size: 64px; }
  .title { font-size: 32px; }
  .lede { font-size: 16px; }
  .menu .kicker { font-size: 16px; }
  .forest-line { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 14px 30px; }
  .forest-line b { font-size: 24px; }
  .center.panel { width: calc(100% - 20px); }
  .panel { padding: 16px 10px 12px; }
  .plant { width: calc(100% - 20px); padding: 16px 8px 10px; }
  .spot { width: 100%; }
  #draft-cards { gap: 10px; }
  .card { width: min(100%, 360px); display: grid; grid-template-columns: 64px 1fr; column-gap: 14px; align-items: center; text-align: left; padding: 6px 8px 6px 4px; }
  .card .plate { grid-column: 2; margin: 0 0 6px; }
  .card .ci { grid-column: 1; grid-row: 1 / span 4; margin-left: 2px; }
  .card h3 { grid-column: 2; margin: 0 0 2px; }
  .card .lat { grid-column: 2; }
  .card p { grid-column: 2; margin-top: 6px; padding-top: 8px; }
  .card p::before { left: 0; margin-left: 6px; }
  .card.small { display: grid; width: calc(50% - 5px); padding: 2px; column-gap: 8px; }
  #s-draft { background: rgba(18, 12, 16, 0.8); }
  .stats dd { font-size: 24px; }
  .stats dt { font-size: 8px; }
}
@media (max-width: 640px) and (max-height: 760px) {
  #hint { bottom: calc(136px + var(--safe-b)); }
}

#heir-cards { gap: 10px; margin-top: 14px; }

/* ---------------------------------------------------------------- tutorial: the coach card */
#coach { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); padding: 14px 18px 12px; border-style: solid; border-color: transparent; border-width: 12px; border-image-slice: 12 fill; border-image-source: var(--f-paper); image-rendering: pixelated; color: var(--u1); pointer-events: auto; text-align: left; }
#coach.pop { animation: coachIn 0.24s steps(3); }
@keyframes coachIn { from { opacity: 0; transform: translate(-50%, 8px); } }
#coach .co-k { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--u3); }
#co-skip { font: 400 16px/1 var(--font); text-transform: none; color: var(--u3); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; padding: 2px 0; }
#co-skip:hover { color: var(--u1); }
#co-title { font: 700 32px/1 var(--font); margin: 8px 0 6px; color: var(--u1); text-shadow: 2px 2px 0 var(--u5); }
#co-text { font: 400 16px/1.38 var(--font); color: var(--u2); margin: 0 0 10px; }
#co-text b, #wl-text b { font-weight: 400; color: var(--u1); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--u4); }
#coach b.g, #wl-text b.g { color: var(--g2); } #coach b.w, #wl-text b.w { color: var(--w2); } #coach b.v, #wl-text b.v { color: var(--v2); }
#coach b.t, #wl-text b.t { color: var(--t2); } #coach b.r, #wl-text b.r { color: var(--r2); }
#co-task { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 6px 10px 5px 6px; font: 400 16px/1 var(--label); text-transform: uppercase; color: var(--g1); background: var(--g5); box-shadow: 0 -2px 0 0 var(--g2), 0 2px 0 0 var(--g2), -2px 0 0 0 var(--g2), 2px 0 0 0 var(--g2); width: max-content; max-width: 100%; }
#co-task .co-box { width: 16px; height: 16px; flex: none; background: var(--u6); box-shadow: inset 0 0 0 2px var(--g2); position: relative; }
#co-task.done { color: var(--t1); background: var(--t5); box-shadow: 0 -2px 0 0 var(--t2), 0 2px 0 0 var(--t2), -2px 0 0 0 var(--t2), 2px 0 0 0 var(--t2); }
#co-task.done .co-box { background: var(--t3); box-shadow: inset 0 0 0 2px var(--t1); }
#co-task.done .co-box::after { content: ''; position: absolute; left: 4px; top: 2px; width: 4px; height: 8px; border: solid var(--u6); border-width: 0 2px 2px 0; transform: rotate(40deg); }
#coach:not(.objective) #co-task { display: none; }
#coach .co-actions { display: flex; justify-content: flex-end; }
#coach .co-actions:has(#co-next.hidden):has(#co-final.hidden) { display: none; }
#co-final { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
#co-final.hidden { display: none; }
#hud:has(#coach:not(.hidden)) #hint { display: none; }
#hud:has(#coach:not(.hidden)) #hud-adapt { bottom: auto; top: calc(190px + var(--safe-t)); }
#hud:has(#coach:not(.hidden)) #hud-trade { bottom: auto; top: calc(210px + var(--safe-t)); }
.tut-hl { animation: tutPulse 0.8s steps(1) infinite; }
@keyframes tutPulse { 0% { outline: 4px solid var(--g5); outline-offset: 2px; } 50% { outline: 4px solid var(--g3); outline-offset: 4px; } }
#hud-adapt.tut-hl:empty { outline: none; animation: none; }

/* ---------------------------------------------------------------- welcome cards */
#s-welcome { background: rgba(18, 12, 16, 0.5); }
.welcome { position: relative; max-width: 620px; width: calc(100% - 24px); }
.welcome .title { margin-bottom: 14px; font-size: 40px; }
#wl-art { display: block; width: 600px; max-width: 100%; aspect-ratio: 200 / 72; height: auto; margin: 0 auto 16px; image-rendering: pixelated; box-shadow: 0 -2px 0 0 var(--u3), 0 2px 0 0 var(--u3), -2px 0 0 0 var(--u3), 2px 0 0 0 var(--u3); }
#wl-text { font-size: 16px; line-height: 1.4; min-height: 4.2em; margin-bottom: 14px; }
.wl-dots { display: flex; justify-content: center; gap: 10px; margin: 0 0 16px; }
.wl-dots button { width: 12px; height: 12px; background: var(--u4); box-shadow: inset 0 -2px 0 0 var(--u3); }
.wl-dots button.on { background: var(--g4); box-shadow: inset 0 -2px 0 0 var(--g2), 0 -2px 0 0 var(--g2), 0 2px 0 0 var(--g2), -2px 0 0 0 var(--g2), 2px 0 0 0 var(--g2); }
.wl-nav { justify-content: space-between !important; }
.wl-nav .invisible { visibility: hidden; }
#wl-final { margin-top: 4px; width: 340px; max-width: 100%; }
.wl-x { position: absolute; top: 0; right: 0; width: 36px; height: 36px; display: grid; place-items: center; font-size: 24px; color: var(--u3); }
.wl-x:hover { color: var(--u1); }
@media (max-width: 640px) {
  #coach { padding: 8px 6px 6px; bottom: calc(8px + var(--safe-b)); }
  #co-title { font-size: 24px; margin: 6px 0 4px; }
  #co-text { margin-bottom: 8px; }
  #hud:has(#coach:not(.hidden)) #hud-top { display: none; }
  #wl-text { min-height: 6em; }
}
