/* Self-hosted fonts for the website build (from Fontsource 5.3.0). The licences sit beside the files. */
@font-face { font-family: 'Caveat Brush'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/caveat-brush-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Caveat Brush'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/caveat-brush-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/cinzel-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/cinzel-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-display: swap; font-weight: 900; src: url(fonts/cinzel-latin-ext-900-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-display: swap; font-weight: 900; src: url(fonts/cinzel-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/old-standard-tt-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/old-standard-tt-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Old Standard TT'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/old-standard-tt-latin-ext-400-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Old Standard TT'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/old-standard-tt-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/old-standard-tt-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Old Standard TT'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/old-standard-tt-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/shantell-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/shantell-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Shantell Sans'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/shantell-sans-latin-ext-400-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Shantell Sans'; font-style: italic; font-display: swap; font-weight: 400; src: url(fonts/shantell-sans-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/shantell-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/shantell-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/shantell-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/shantell-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 800; src: url(fonts/shantell-sans-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Shantell Sans'; font-style: normal; font-display: swap; font-weight: 800; src: url(fonts/shantell-sans-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Special Elite'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/special-elite-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Special Elite'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/special-elite-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Design tokens. Direction B, hand-inked comic: warm ink outlines, muted print colours, cream paper, brush titles.
   One deliberate look on a midnight table: the game does not switch to a light theme. */
:root {
  color-scheme: dark;

  /* ink and paper */
  --ink: #2b2118;
  --ink-soft: #5a4a3a;
  --paper: #f6eedb;
  --paper-2: #e9dcc0;
  --paper-3: #fbf6e8;
  --paper-dim: #6f6352;
  --label: #fbf7ec;
  --manila: #dcc58f;
  --manila-2: #c8ab6c;
  --newsprint: #e8e2d0;

  /* the table (retinted per location on body[data-city]) */
  --night: #161f2a;
  --night-2: #1d2734;
  --night-3: #263242;
  --felt: #2b403b;
  --felt-2: #22332f;
  --on-night: #e8dcc2;
  --on-night-dim: #b9ad96;

  /* spot colours */
  --yellow: #d9a845;
  --yellow-2: #b98b2e;
  --red: #b23b30;
  --red-2: #8f2c23;
  --blue: #4c6b8f;
  --green: #6c955a;
  --green-ink: #4f7f3e;

  /* resource language: one colour and one shape per resource, everywhere (icons and text) */
  --c-inf: #c38f2a;        /* Legacy: gold star */
  --c-inf-text: #94690f;
  --c-sec: #b8364a;        /* Life: red heart */
  --c-bm: #a87a1c;         /* Gold: a coin (a darker, browner gold than Legacy's star) */
  --c-hit: #2e2a33;        /* Hits: ink crosshair */
  --c-file: #4c6b8f;       /* Keepsakes: blue folder */
  --c-loss: #b23b30;       /* anything lost: damage, stolen Cash, a burned landmark */
  --c-inf-wash: #ecd9a0;
  --c-sec-wash: #f1d0d2;
  --c-bm-wash: #efdfb8;
  --c-hit-wash: #dcd6cc;
  --c-loss-wash: #ecc3b8;

  /* dice */
  --die-ivory: #f3ead4;
  --die-2: #fbf6e9;
  --die-side: #e2d6bb;

  /* one light source, top-left: every hard shadow falls down and to the right */
  --shadow-sm: 1px 2px 0 var(--ink);
  --shadow: 2px 3px 0 var(--ink);
  --hard: 3px 4px 0 var(--ink);
  --hard-lg: 4px 6px 0 var(--ink);
  --hard-xl: 5px 8px 0 var(--ink);

  /* hand-cut corners */
  --wobble-sm: 16px 8px 14px 9px / 9px 14px 8px 16px;
  --wobble: 16px 9px 14px 10px / 10px 15px 9px 16px;
  --wobble-lg: 24px 14px 22px 12px / 13px 22px 14px 24px;

  /* type roles */
  --f-brand: Cinzel, "Trajan Pro", Georgia, serif;
  --f-title: "Caveat Brush", "Segoe Print", "Comic Sans MS", cursive;
  --f-body: "Shantell Sans", "Segoe UI", "Trebuchet MS", sans-serif;
  --f-doc: "Special Elite", "Courier New", monospace;
  --f-news: "Old Standard TT", Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* type scale (rem) */
  --t-2xs: 0.64rem;
  --t-xs: 0.74rem;
  --t-sm: 0.86rem;
  --t-md: 1rem;
  --t-lg: 1.18rem;
  --t-xl: 1.5rem;
  --t-2xl: 1.95rem;
  --t-3xl: 2.6rem;

  /* view scale, set by the interface (1 on phones) */
  --k: 1;
  --fk: 1;
  --mz: 1;

  --occult: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='2' seed='4'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23e9c37a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='.11'%3E%3Ccircle cx='170' cy='170' r='124'/%3E%3Ccircle cx='170' cy='170' r='106'/%3E%3Ccircle cx='170' cy='170' r='56' stroke-dasharray='5 7'/%3E%3Cpath d='M276.0 170.0 L294.0 170.0'/%3E%3Cpath d='M274.4 188.4 L283.3 190.0'/%3E%3Cpath d='M269.6 206.3 L278.1 209.3'/%3E%3Cpath d='M261.8 223.0 L277.4 232.0'/%3E%3Cpath d='M251.2 238.1 L258.1 243.9'/%3E%3Cpath d='M238.1 251.2 L243.9 258.1'/%3E%3Cpath d='M223.0 261.8 L232.0 277.4'/%3E%3Cpath d='M206.3 269.6 L209.3 278.1'/%3E%3Cpath d='M188.4 274.4 L190.0 283.3'/%3E%3Cpath d='M170.0 276.0 L170.0 294.0'/%3E%3Cpath d='M151.6 274.4 L150.0 283.3'/%3E%3Cpath d='M133.7 269.6 L130.7 278.1'/%3E%3Cpath d='M117.0 261.8 L108.0 277.4'/%3E%3Cpath d='M101.9 251.2 L96.1 258.1'/%3E%3Cpath d='M88.8 238.1 L81.9 243.9'/%3E%3Cpath d='M78.2 223.0 L62.6 232.0'/%3E%3Cpath d='M70.4 206.3 L61.9 209.3'/%3E%3Cpath d='M65.6 188.4 L56.7 190.0'/%3E%3Cpath d='M64.0 170.0 L46.0 170.0'/%3E%3Cpath d='M65.6 151.6 L56.7 150.0'/%3E%3Cpath d='M70.4 133.7 L61.9 130.7'/%3E%3Cpath d='M78.2 117.0 L62.6 108.0'/%3E%3Cpath d='M88.8 101.9 L81.9 96.1'/%3E%3Cpath d='M101.9 88.8 L96.1 81.9'/%3E%3Cpath d='M117.0 78.2 L108.0 62.6'/%3E%3Cpath d='M133.7 70.4 L130.7 61.9'/%3E%3Cpath d='M151.6 65.6 L150.0 56.7'/%3E%3Cpath d='M170.0 64.0 L170.0 46.0'/%3E%3Cpath d='M188.4 65.6 L190.0 56.7'/%3E%3Cpath d='M206.3 70.4 L209.3 61.9'/%3E%3Cpath d='M223.0 78.2 L232.0 62.6'/%3E%3Cpath d='M238.1 88.8 L243.9 81.9'/%3E%3Cpath d='M251.2 101.9 L258.1 96.1'/%3E%3Cpath d='M261.8 117.0 L277.4 108.0'/%3E%3Cpath d='M269.6 133.7 L278.1 130.7'/%3E%3Cpath d='M274.4 151.6 L283.3 150.0'/%3E%3Cpolygon points='170.0 64.0 261.8 223.0 78.2 223.0'/%3E%3Cpolygon points='170.0 276.0 78.2 117.0 261.8 117.0' stroke-dasharray='3 6'/%3E%3Cpath d='M148 170 Q170 155 192 170 Q170 185 148 170 Z'/%3E%3Ccircle cx='170' cy='170' r='6'/%3E%3Cpolyline points='392.0 64.0 436.0 96.0 472.0 84.0 506.0 136.0 458.0 168.0 418.0 146.0 436.0 96.0'/%3E%3Ccircle cx='424' cy='420' r='62'/%3E%3Ccircle cx='424' cy='420' r='9'/%3E%3Cpath d='M362 420 A62 62 0 0 1 424 358' stroke-dasharray='2 5' transform='rotate(200 424 420) scale(1)'/%3E%3Cpath d='M436.0 420.0 L508.0 420.0'/%3E%3Cpath d='M432.5 428.5 L456.5 452.5'/%3E%3Cpath d='M424.0 432.0 L424.0 504.0'/%3E%3Cpath d='M415.5 428.5 L391.5 452.5'/%3E%3Cpath d='M412.0 420.0 L340.0 420.0'/%3E%3Cpath d='M415.5 411.5 L391.5 387.5'/%3E%3Cpath d='M424.0 408.0 L424.0 336.0'/%3E%3Cpath d='M432.5 411.5 L456.5 387.5'/%3E%3Cpolygon points='120 412 152 468 88 468'/%3E%3Cpath d='M107 452 Q120 442 133 452 Q120 461 107 452 Z'/%3E%3Cpath d='M84.0 422.5 L73.3 417.2'/%3E%3Cpath d='M90.3 413.2 L81.4 405.2'/%3E%3Cpath d='M98.8 406.1 L92.4 395.9'/%3E%3Cpath d='M109.0 401.5 L105.7 390.0'/%3E%3Cpath d='M120.0 400.0 L120.0 388.0'/%3E%3Cpath d='M131.0 401.5 L134.3 390.0'/%3E%3Cpath d='M141.2 406.1 L147.6 395.9'/%3E%3Cpath d='M149.7 413.2 L158.6 405.2'/%3E%3Cpath d='M156.0 422.5 L166.7 417.2'/%3E%3Cpath d='M249.9 312.3 L258.6 312.3 M254.3 307.9 L254.3 316.6'/%3E%3Cpath d='M257.8 284.2 L265.1 284.2 M261.5 280.6 L261.5 287.9'/%3E%3Cpath d='M55.1 447.2 L62.8 447.2 M59.0 443.3 L59.0 451.1'/%3E%3Cpath d='M28.2 540.4 L37.0 540.4 M32.6 536.0 L32.6 544.8'/%3E%3Cpath d='M360.3 342.4 L365.9 342.4 M363.1 339.6 L363.1 345.2'/%3E%3Cpath d='M15.5 295.3 L20.7 295.3 M18.1 292.7 L18.1 297.9'/%3E%3Cpath d='M22.9 260.5 L29.6 260.5 M26.2 257.1 L26.2 263.9'/%3E%3Cpath d='M461.1 290.3 L468.7 290.3 M464.9 286.5 L464.9 294.1'/%3E%3Cpath d='M276.5 367.7 L283.3 367.7 M279.9 364.3 L279.9 371.1'/%3E%3Cpath d='M155.7 548.7 L164.7 548.7 M160.2 544.2 L160.2 553.2'/%3E%3C/g%3E%3Cg fill='%23e9c37a' opacity='.2'%3E%3Ccircle cx='392' cy='64' r='1.6'/%3E%3Ccircle cx='436' cy='96' r='1.6'/%3E%3Ccircle cx='472' cy='84' r='1.6'/%3E%3Ccircle cx='506' cy='136' r='1.6'/%3E%3Ccircle cx='458' cy='168' r='1.6'/%3E%3Ccircle cx='418' cy='146' r='1.6'/%3E%3Ccircle cx='471' cy='396' r='0.9'/%3E%3Ccircle cx='177' cy='129' r='0.9'/%3E%3Ccircle cx='162' cy='39' r='0.9'/%3E%3Ccircle cx='429' cy='224' r='0.9'/%3E%3Ccircle cx='474' cy='216' r='0.9'/%3E%3Ccircle cx='537' cy='474' r='0.9'/%3E%3Ccircle cx='0' cy='117' r='0.9'/%3E%3Ccircle cx='510' cy='263' r='0.9'/%3E%3Ccircle cx='549' cy='223' r='0.9'/%3E%3Ccircle cx='41' cy='352' r='0.9'/%3E%3Ccircle cx='436' cy='151' r='0.9'/%3E%3Ccircle cx='49' cy='186' r='0.9'/%3E%3Ccircle cx='540' cy='425' r='0.9'/%3E%3Ccircle cx='66' cy='138' r='0.9'/%3E%3Ccircle cx='57' cy='34' r='0.9'/%3E%3Ccircle cx='446' cy='99' r='0.9'/%3E%3Ccircle cx='313' cy='251' r='0.9'/%3E%3Ccircle cx='107' cy='410' r='0.9'/%3E%3Ccircle cx='73' cy='360' r='0.9'/%3E%3Ccircle cx='65' cy='236' r='0.9'/%3E%3Ccircle cx='119' cy='151' r='0.9'/%3E%3Ccircle cx='544' cy='450' r='0.9'/%3E%3Ccircle cx='170' cy='496' r='0.9'/%3E%3Ccircle cx='118' cy='221' r='0.9'/%3E%3Ccircle cx='478' cy='359' r='0.9'/%3E%3Ccircle cx='56' cy='554' r='0.9'/%3E%3C/g%3E%3C/svg%3E");
  --memento: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='2' seed='9'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23e9c37a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='.11'%3E%3Cpath d='M120 150 L152 128 L252 128 L220 150 Z'/%3E%3Cpath d='M220 150 L252 128 L252 228 L220 250'/%3E%3Crect x='120' y='150' width='100' height='100' rx='12'/%3E%3Ccircle cx='149' cy='194' r='15'/%3E%3Ccircle cx='191' cy='194' r='15'/%3E%3Cpath d='M170 217 L164 209 Q163 205 167 205 L170 207.5 L173 205 Q177 205 176 209 Z'/%3E%3Cpath d='M136 238 Q170 242 204 238 M136 236 V250 Q141 258 147 251 Q153 258 159 251 Q165 258 170 251 Q176 258 182 251 Q188 258 193 251 Q199 258 204 250 V236 M147 241 V251 M159 242 V251 M170 242 V251 M182 242 V251 M193 241 V251'/%3E%3Cpath d='M127 155 l7 9 l-4 6 l8 8'/%3E%3Cellipse cx='174' cy='139' rx='9' ry='4'/%3E%3Cellipse cx='214' cy='134' rx='9' ry='4'/%3E%3Cellipse cx='231' cy='170' rx='3' ry='7'/%3E%3Cellipse cx='236' cy='189' rx='3' ry='7'/%3E%3Cellipse cx='241' cy='208' rx='3' ry='7'/%3E%3Cpath d='M398 62 H462 M398 166 H462 M404 62 Q404 104 430 114 Q404 124 404 166 M456 62 Q456 104 430 114 Q456 124 456 166'/%3E%3Cpath d='M414 154 Q430 140 446 154 Z M418 86 Q430 98 442 86' stroke-dasharray='2 4'/%3E%3Cpath d='M430 116 V150' stroke-dasharray='1 5'/%3E%3Cpath d='M96 412 V492 H128 V412 Q120 418 112 412 Q104 406 96 412 Z'/%3E%3Cpath d='M118 414 Q120 428 116 436'/%3E%3Cpath d='M112 404 Q104 392 112 378 Q120 392 112 404 Z'/%3E%3Cpath d='M112 412 V404'/%3E%3Cpath d='M132.0 392.0 L140.0 392.0'/%3E%3Cpath d='M126.1 406.1 L131.8 411.8'/%3E%3Cpath d='M112.0 412.0 L112.0 420.0'/%3E%3Cpath d='M97.9 406.1 L92.2 411.8'/%3E%3Cpath d='M92.0 392.0 L84.0 392.0'/%3E%3Cpath d='M97.9 377.9 L92.2 372.2'/%3E%3Cpath d='M112.0 372.0 L112.0 364.0'/%3E%3Cpath d='M126.1 377.9 L131.8 372.2'/%3E%3Cpath d='M84 492 H140'/%3E%3Cpath d='M392 498 V430 A38 38 0 0 1 468 430 V498'/%3E%3Cpath d='M404 498 V434 A26 26 0 0 1 456 434 V498' stroke-dasharray='3 6'/%3E%3Cpath d='M440 404 l-6 12 l7 8 l-5 12'/%3E%3Cpath d='M372 498 H488 M380 498 l-4 -9 M392 498 l2 -10 M470 498 l3 -9 M482 498 l-2 -8'/%3E%3Cg transform='rotate(18 300 330)'%3E%3Crect x='272' y='302' width='56' height='56' rx='10'/%3E%3Ccircle cx='288' cy='318' r='5'/%3E%3Ccircle cx='300' cy='330' r='5'/%3E%3Ccircle cx='312' cy='342' r='5'/%3E%3C/g%3E%3Cpath d='M326 52 A26 26 0 1 0 354 92 A20 20 0 1 1 326 52 Z'/%3E%3Cpath d='M53 60 H67 M60 53 V67'/%3E%3Cpath d='M514 260 H526 M520 254 V266'/%3E%3Cpath d='M253 470 H267 M260 463 V477'/%3E%3Cpath d='M35 300 H45 M40 295 V305'/%3E%3Cpath d='M515 520 H525 M520 515 V525'/%3E%3Cpath d='M326 200 H334 M330 196 V204'/%3E%3Ccircle cx='90' cy='250' r='1.6'/%3E%3Ccircle cx='480' cy='330' r='1.6'/%3E%3Ccircle cx='360' cy='520' r='1.6'/%3E%3Ccircle cx='250' cy='40' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .14 0 0 0 0 .08 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paperclip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 54'%3E%3Cpath d='M13 14 V38 a3.6 3.6 0 0 1 -7.2 0 V9 a5.6 5.6 0 0 1 11.2 0 V41 a7.6 7.6 0 0 1 -15.2 0 V17' fill='none' stroke='%232b2118' stroke-width='3.8' stroke-linecap='round'/%3E%3Cpath d='M13 14 V38 a3.6 3.6 0 0 1 -7.2 0 V9 a5.6 5.6 0 0 1 11.2 0 V41 a7.6 7.6 0 0 1 -15.2 0 V17' fill='none' stroke='%23b9bcc2' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

body[data-city="area51"] { --night: #13221e; --night-2: #192c27; --night-3: #213830; --felt: #2a4234; --felt-2: #21352a; }
body[data-city="antarctica"] { --night: #11222e; --night-2: #172b39; --night-3: #1f3747; --felt: #273f4a; --felt-2: #1e333c; }
body[data-city="waco"] { --night: #231d18; --night-2: #2c241e; --night-3: #382e26; --felt: #3d3a2a; --felt-2: #312e21; }
body[data-city="jonestown"] { --night: #12201a; --night-2: #182a22; --night-3: #20352b; --felt: #2a4232; --felt-2: #213528; }
body[data-city="jekyll"] { --night: #1f1a26; --night-2: #282131; --night-3: #33293d; --felt: #3b3346; --felt-2: #2f2838; }
body[data-city="camphero"] { --night: #0f1520; --night-2: #151d2a; --night-3: #1c2636; --felt: #233140; --felt-2: #1b2633; }
body[data-city="dealey"] { --night: #1a2230; --night-2: #212b3b; --night-3: #2a3648; --felt: #3a4152; --felt-2: #2e3443; }

/* Base: the table, type roles, icons and the shared controls (buttons, chips, avatars). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* a device too slow for the ink filters (ui.js watchFrames): the art keeps its lines, without the hand-shaken edge */
.lite svg [filter] { filter: none !important; }
/* the icon in front of a power or a house rule: what it pays */
.rule-glyph { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; margin-right: 5px; vertical-align: -0.22em; }
.rule-glyph .ico { width: 100%; height: 100%; vertical-align: 0; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--on-night);
  font: 600 16px/1.38 var(--f-body);
  overflow-x: hidden;
  /* midnight ink with a chart drawn faintly across it (memento mori for the base game, the occult for a Series 1
     board), a lamp pool from the top-left and a vignette */
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 70% 55% at 38% 22%, rgba(233, 184, 76, 0.1), transparent 70%),
    radial-gradient(ellipse 130% 95% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.55)),
    var(--motif, var(--memento)),
    var(--paper-grain);
  background-size: 100% 100%, 100% 100%, 560px 560px, 160px 160px;
  background-attachment: fixed;
}
html[data-view="l"] body, html[data-view="m"] body { overflow: hidden; }
body[data-series="series1"] { --motif: var(--occult); }
/* The menus always draw the memento chart (tinted by the place on the card), drifting slowly down and to the right on
   its own layer: one tile per lap, so the loop never shows a seam. */
body.setup-view { background-image: radial-gradient(ellipse 70% 55% at 38% 22%, rgba(233, 184, 76, 0.1), transparent 70%), radial-gradient(ellipse 130% 95% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.55)), var(--paper-grain); background-size: 100% 100%, 100% 100%, 160px 160px; }
body.setup-view::after { content: ""; position: fixed; inset: -560px 0 0 -560px; z-index: -1; pointer-events: none; background: var(--memento) 0 0 / 560px 560px; animation: motif-drift 160s linear infinite; will-change: transform; }
@keyframes motif-drift { to { transform: translate(560px, 560px); } }
@media (prefers-reduced-motion: reduce) { body.setup-view::after { animation: none; } }
html.calm body.setup-view::after { animation: none; }
html[data-view="l"] body.setup-view, html[data-view="m"] body.setup-view { overflow: auto; }
#app { min-height: 100%; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
b, strong { font-weight: 800; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none; }
kbd { font: 800 var(--t-xs)/1 var(--f-body); border: 2px solid currentColor; border-radius: 5px; padding: 2px 5px; opacity: 0.75; }
@media (hover: none) { kbd { display: none; } }

/* type roles */
.t-title { font-family: var(--f-title); font-weight: 400; font-size-adjust: 0.5; letter-spacing: 0.01em; }
.t-doc { font-family: var(--f-doc); font-weight: 400; letter-spacing: 0.06em; }
.t-label { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.12em; text-transform: uppercase; }

/* resources in text wear their colour */
.r-inf { color: var(--c-inf-text); font-weight: 800; }
.r-sec { color: var(--c-sec); font-weight: 800; }
.r-bm { color: var(--c-bm); font-weight: 800; }
.r-hit { color: var(--c-hit); font-weight: 800; }
.on-dark .r-inf { color: #e8c062; }
.on-dark .r-sec { color: #f19aa3; }
.on-dark .r-bm { color: #9fd39a; }
.on-dark .r-hit { color: #ddd4c6; }
.i-star { color: var(--c-inf); }
.i-heart { color: var(--c-sec); }
.i-cash { color: var(--c-bm); }
.i-crosshair { color: var(--c-hit); }
.i-folder { color: var(--c-file); }

/* avatars: a portrait in a coloured disc, and a die-cut standee with a paper edge */
.seal {
  --soc: #555;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--soc);
  border: 2.5px solid var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.seal .portrait { width: 100%; height: 100%; display: block; }
.seal.xs { width: 22px; height: 22px; border-width: 2px; box-shadow: none; vertical-align: -6px; margin: 0 3px; }
.seal.sm { width: 30px; height: 30px; }
.seal.md { width: 48px; height: 48px; }
.seal.lg { width: 64px; height: 64px; }
.standee { display: inline-block; line-height: 0; }
.standee .portrait {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(3px 0 0 var(--paper)) drop-shadow(-3px 0 0 var(--paper)) drop-shadow(0 3px 0 var(--paper)) drop-shadow(0 -3px 0 var(--paper)) drop-shadow(2px 4px 0 var(--ink));
}

/* expressions drawn into portraits, switched on by an ancestor's feel-* class */
.portrait .mood { display: none; }
.feel-smug .portrait .mood-smug, .feel-hurt .portrait .mood-hurt, .feel-panic .portrait .mood-panic { display: inline; }

/* buttons: flat spot colour, ink edge, offset shadow, brush lettering */
.cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 22px 8px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-sm);
  background: var(--red);
  color: var(--paper);
  font: 400 var(--t-xl)/1 var(--f-title);
  font-size-adjust: 0.5;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--hard);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.cta .ico { width: 1.15em; height: 1.15em; }
.cta:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.cta:active:not(:disabled) { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.cta:disabled { opacity: 0.45; cursor: not-allowed; }
.cta kbd { font-size: var(--t-2xs); margin-left: 2px; }
.cta.big { font-size: var(--t-2xl); padding: 11px 30px 10px; }
.cta.small { font-size: var(--t-lg); padding: 7px 14px 6px; }
.cta.gold { background: var(--yellow); color: var(--ink); }
.cta.ghost { background: var(--paper); color: var(--ink); }
.cta.wide { width: 100%; }
@keyframes nudge { 0%, 45%, 60%, 100% { transform: rotate(0); } 50% { transform: rotate(-1.5deg); } 55% { transform: rotate(1deg); } }

.icon-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 5px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-sm);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: var(--t-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.icon-btn .ico { width: 19px; height: 19px; }
.icon-btn:active { transform: translate(1px, 2px); box-shadow: var(--shadow-sm); }
.icon-btn.met::after { content: "\2713"; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: var(--ink); border: 2px solid var(--ink); font: 800 0.7rem/14px var(--f-body); text-align: center; }
.link-btn { appearance: none; border: 0; background: none; color: inherit; opacity: 0.85; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; font-weight: 800; font-size: var(--t-sm); }
.link-btn:hover:not(:disabled) { opacity: 1; }
.link-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.undo-btn { appearance: none; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper-2); color: var(--ink); font: 800 var(--t-sm)/1 var(--f-body); padding: 6px 12px; cursor: pointer; box-shadow: var(--shadow); }
.undo-btn:active { transform: translate(1px, 2px); box-shadow: var(--shadow-sm); }

.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none;
  min-width: 48px;
  padding: 6px 15px 4px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-sm);
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-xl)/1 var(--f-title);
  font-size-adjust: 0.5;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.chip:active { transform: translate(1px, 2px); box-shadow: var(--shadow-sm); }
.chip.on { background: var(--yellow); }

/* paper surfaces share a grain and a hand-cut edge */
.paper { background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); border: 2.5px solid var(--ink); border-radius: var(--wobble); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* Less motion (the menu's Display), for anyone who hasn't set it on their device */
html.calm *, html.calm *::before, html.calm *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
/* Large text (the menu's Display): the type scale a step up */
html.big-text { --t-2xs: 0.72rem; --t-xs: 0.84rem; --t-sm: 0.97rem; --t-md: 1.12rem; --t-lg: 1.3rem; }

/* Setup: one briefing card. Your society and a Play button up front; rivals, place and length are tiles that open
   pickers; the modes are tabs. A first-time player sees only what the guided game needs. */
.setup {
  max-width: 1180px;
  margin: 0 auto;
  padding-block: 18px 48px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 20px;
}
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setup-logo { width: min(400px, 70vw); height: auto; overflow: visible; }
.setup.first .setup-top { justify-content: center; }
.setup.first .setup-logo { width: min(520px, 90vw); }
.lodge-chip { appearance: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); text-align: left; box-shadow: var(--hard); cursor: pointer; }
.lodge-chip .deg-seal { width: 42px; height: 42px; font-size: 1.2rem; }
.lodge-chip b { display: block; font: 400 var(--t-lg)/1 var(--f-title); font-size-adjust: 0.5; }
.lodge-chip small { font-size: var(--t-xs); color: var(--ink-soft); }
.lodge-chip:hover { transform: translateY(-1px); }
.lodge-chip { position: relative; }
.chip-dot { position: absolute; top: -6px; right: -6px; width: 15px; height: 15px; border: 2px solid var(--ink); border-radius: 50%; background: var(--red); }

/* modes as tabs */
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-tab { appearance: none; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 14px; border: 2.5px solid rgba(246, 238, 219, 0.28); border-radius: var(--wobble); background: rgba(246, 238, 219, 0.05); color: var(--on-night); text-align: left; cursor: pointer; }
.mode-tab .ico { width: 30px; height: 30px; flex: none; color: var(--yellow); }
.mode-tab b { display: block; font: 400 var(--t-xl)/1 var(--f-title); font-size-adjust: 0.5; }
.mode-tab small { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--on-night-dim); }
.mode-tab:hover { border-color: rgba(246, 238, 219, 0.55); }
.mode-tab.on { border-color: var(--ink); background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); box-shadow: var(--hard); }
.mode-tab.on small { color: var(--ink-soft); }
.mode-tab.on .ico { color: var(--red); }

/* the briefing card. Every mode and society keeps the same rows and heights, so switching tabs never moves the page. */
.brief { display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 3px solid var(--ink); border-radius: var(--wobble-lg); background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); box-shadow: var(--hard-xl); overflow: hidden; }
.brief-who { position: relative; min-height: 320px; border-right: 3px solid var(--ink); background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.16) 0 1.5px, transparent 1.5px 8px), var(--soc); }
.brief-who .standee { position: absolute; left: 50%; bottom: 0; width: 250px; transform: translateX(-50%); }
.brief-who .mastery { top: 12px; right: 12px; }
.brief-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; padding: 24px 28px 22px; min-width: 0; }
.brief-kicker { color: var(--red); font: 400 var(--t-sm)/1 var(--f-doc); letter-spacing: 0.14em; text-transform: uppercase; }
.brief-name { font: 400 clamp(2rem, 4vw, 3rem)/1 var(--f-title); font-size-adjust: 0.5; }
.brief-motto { color: var(--paper-dim); font: 400 var(--t-sm)/1.3 var(--f-doc); }
/* a starter game's chapter card: the place behind you, and one line of the story under the chapter's title */
.brief-motto.chapter-line { min-height: 2lh; max-width: 52ch; color: var(--ink-soft); font: 400 var(--t-md)/1.35 var(--f-body, inherit); }
.chapter-art { background: var(--night-2, #1d1a22); }
.chapter-art .city-thumb { position: absolute; inset: 0; height: auto; border: 0; }
.chapter-art .standee { width: 210px; filter: drop-shadow(0 6px 0 rgba(20, 14, 10, 0.35)); }
.brief-power { min-height: 2lh; margin-top: 4px; font-size: var(--t-md); }
.brief-power b { margin-right: 4px; color: var(--red); }
.brief-change { justify-self: start; padding: 2px 0; color: var(--blue); font-size: var(--t-sm); }
.brief-change:disabled { opacity: 1; color: var(--paper-dim); text-decoration: none; cursor: default; }
.brief-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.brief-slots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slot { appearance: none; position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 12px; align-items: start; min-width: 0; padding: 10px 12px 10px 10px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--label); color: var(--ink); text-align: left; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
/* tall enough for a two-line value (The Paris Temple), so switching tales or modes never changes the card's height */
.brief-slots .slot { min-height: 102px; }
html[data-view="s"] .brief-slots .slot { min-height: 0; }
.slot:not(:disabled):hover { transform: translateY(-2px); box-shadow: var(--hard); }
.slot:disabled { cursor: default; }
.slot-art { grid-row: 1 / -1; display: grid; place-items: center; width: 74px; height: 74px; overflow: hidden; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper-2); }
.slot-art .city-thumb { position: relative; width: 100%; height: 100%; overflow: hidden; }
.slot-label { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-dim); }
.slot-value { margin-top: 3px; font: 400 1.35rem/1.05 var(--f-title); font-size-adjust: 0.5; overflow-wrap: anywhere; }
/* at most two lines, which still fits beside the art, so a long sub never makes the tile taller */
.slot-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--t-xs); color: var(--ink-soft); }
.slot-change { position: absolute; right: 10px; top: 8px; color: var(--blue); font-weight: 800; font-size: var(--t-xs); }
/* the dice for a random pick: one on each tile's corner, a small one by the society, Randomize all at the end of the
   Play row; whatever a die changed pops once */
.slot-cell { position: relative; display: grid; min-width: 0; }
.rand-die { appearance: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; transition: transform 0.15s ease; }
.rand-die .five { width: 72%; height: 72%; fill: currentColor; }
button.rand-die:hover { transform: rotate(-14deg) scale(1.08); }
button.rand-die:active { transform: rotate(80deg) scale(0.94); }
.rand-die.spin { animation: die-spin 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes die-spin { from { transform: rotate(-220deg) scale(0.7); } }
.slot-cell > .rand-die { position: absolute; right: -9px; bottom: -9px; z-index: 1; }
.brief-change-row { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
/* Die Hard: a toggle beside the replay link, dark once it's on */
.die-hard { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 2px 7px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-2); color: var(--ink); font: 400 var(--t-sm)/1.1 var(--f-title); cursor: pointer; box-shadow: 1.5px 1.5px 0 var(--ink); }
.die-hard .ico { width: 16px; height: 16px; }
.die-hard.on { background: var(--ink); color: #f3d36b; }
.die-hard:hover { transform: translateY(-1px); }
.brief-change-row .rand-die { width: 24px; height: 24px; margin-block: -4px; border-radius: 6px; box-shadow: 1.5px 1.5px 0 var(--ink); }
.brief-go .rand-all { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.rand-all .rand-die { width: 24px; height: 24px; border-radius: 6px; box-shadow: none; }
.rand-all:hover .rand-die { transform: rotate(-14deg); }
.rolled { animation: rolled 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes rolled { 0% { transform: scale(0.95) rotate(-1.5deg); } 60% { transform: scale(1.03) rotate(0.5deg); } }
@media (prefers-reduced-motion: reduce) { .rolled, .rand-die.spin { animation: none; } }
html.calm :is(.rolled, .rand-die.spin) { animation: none; }
/* Resume says what it resumes, on a second line */
.resume-btn { flex-direction: column; gap: 1px; line-height: 1.05; }
.resume-btn small { font: 600 var(--t-2xs)/1.15 var(--f-body); opacity: 0.8; white-space: nowrap; }
.ghosts { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; padding: 4px; }
.ghosts i { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; background: #c9bfa8; font: 400 0.85rem/1 var(--f-title); font-style: normal; color: var(--ink-soft); }
.ghosts .seal.sm { width: 28px; height: 28px; border-width: 2px; box-shadow: none; }
.len-art { display: grid; place-items: center; gap: 0; }
.len-art .ico { width: 22px; height: 22px; color: var(--c-inf); }
.len-art b { font: 400 1.8rem/1 var(--f-title); }
.brief-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.brief-go .cta.big { font-size: 1.9rem; padding: 12px 34px 11px; }
.brief-sum { min-height: 2lh; color: var(--ink-soft); font-size: var(--t-sm); max-width: 60ch; }
.brief-sum b { color: var(--red); }

/* pickers */
.dialog.picker { width: min(720px, calc(100vw - 32px)); }
.dialog.picker.wide { width: min(1060px, calc(100vw - 32px)); }
.pick-h { margin: 16px 0 8px; font: 400 var(--t-lg)/1 var(--f-title); font-size-adjust: 0.5; }
.pick-grid { display: grid; gap: 14px; margin-top: 14px; }
.pick-grid.socs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
/* pickers list each pack under its own heading */
/* the pickers show one box at a time, chosen with chips: every box is drawn in one cell, so the tallest sets the height */
.pick-chips { margin-top: 12px; }
.pick-panels { display: grid; }
.pick-panels > .pick-grid { grid-area: 1 / 1; align-content: start; visibility: hidden; }
.pick-panels > .pick-grid.on { visibility: visible; }
.pick-grid.cities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.count-row { display: flex; flex-wrap: wrap; gap: 10px; }
.count-pick { appearance: none; display: grid; justify-items: center; gap: 6px; min-width: 88px; padding: 10px 10px 8px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.count-pick b { font: 400 1.8rem/1 var(--f-title); }
.count-pick .ghosts { padding: 0; max-width: 80px; }
.count-pick .ghosts i { width: 14px; height: 14px; font-size: 0; border-width: 1.5px; }
.count-pick.on, .diff-pick.on, .len-pick.on { background: var(--yellow); box-shadow: var(--hard); }
.diff-row, .len-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.diff-pick, .len-pick { appearance: none; display: grid; align-content: start; gap: 4px; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--paper); color: var(--ink); text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.diff-pick b, .len-pick b { font: 400 1.4rem/1 var(--f-title); font-size-adjust: 0.5; }
.diff-pick span, .len-pick span { font-size: var(--t-sm); }
.len-pick small { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-dim); }
.len-row { margin-top: 14px; }
.dialog .hotseat { margin-top: 16px; color: var(--ink); }
.dialog .hotseat summary { cursor: pointer; font-weight: 800; }
.dialog .hotseat .chips-row { margin-top: 10px; }

/* society tiles (the picker) */
.soc-pick {
  appearance: none;
  position: relative;
  min-height: 132px;
  padding: 14px 16px 14px 120px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-lg);
  background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.14) 0 1.5px, transparent 1.5px 7px), var(--soc);
  box-shadow: var(--hard);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.soc-pick::after { content: ""; position: absolute; inset: 10px 10px 10px 110px; z-index: 0; border-radius: var(--wobble); background: var(--paper); background-image: var(--paper-grain); }
.soc-pick > * { position: relative; z-index: 1; }
.soc-pick .standee { position: absolute; left: 4px; bottom: 4px; width: 108px; z-index: 2; }
.soc-pick:hover { transform: translateY(-3px) rotate(-0.5deg); }
.soc-pick.on { transform: translateY(-4px); box-shadow: 0 0 0 4px var(--yellow), var(--hard-lg); }
.soc-name { font: 400 1.4rem/1 var(--f-title); font-size-adjust: 0.5; }
.soc-motto { font: 400 var(--t-xs)/1.3 var(--f-doc); color: var(--paper-dim); }
.soc-power { font-size: var(--t-sm); margin-top: 6px; }
.soc-power b { color: var(--red); margin-right: 5px; }
.mastery { position: absolute; right: 14px; top: -12px; z-index: 3; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 2px 5px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); color: var(--ink); font: 400 1rem/1 var(--f-title); }
.mastery .ico { width: 15px; height: 15px; }
/* not recruited yet: a wanted poster you can't pick (unless a free recruit is waiting) */
.soc-pick.locked { background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.14) 0 1.5px, transparent 1.5px 7px), #8a8172; }
.soc-pick.locked .standee { filter: grayscale(1) contrast(1.1) brightness(0.85); }
.soc-pick.locked:disabled { cursor: default; }
.soc-pick.locked:disabled:hover { transform: none; }
.soc-wanted { position: absolute !important; left: 10px; top: 10px; z-index: 3 !important; padding: 3px 7px 1px; border: 2.5px solid var(--red); border-radius: 4px; background: var(--manila); color: var(--red); font: 400 0.95rem/1 var(--f-title); letter-spacing: 0.04em; text-transform: uppercase; transform: rotate(-8deg); box-shadow: var(--shadow-sm); }
.soc-pick.locked:not(:disabled) .soc-wanted { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.soc-wanted.soc-new { border-color: var(--ink); background: var(--paper); color: var(--ink); transform: rotate(-5deg); }

/* place tiles (the picker) */
.city-pick { appearance: none; position: relative; display: grid; align-content: start; padding: 0; overflow: hidden; text-align: left; color: var(--ink); border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper); background-image: var(--paper-grain); box-shadow: var(--hard); cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.city-pick:hover { transform: translateY(-2px); }
.city-pick.on { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--yellow), var(--hard-lg); }
.city-pick.locked { cursor: default; background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.14) 0 1.5px, transparent 1.5px 7px), #8a8172; }
.city-pick.locked:hover { transform: none; }
.city-pick.locked .city-thumb { filter: grayscale(1) contrast(1.1) brightness(0.85); }
.city-pick.locked .soc-wanted { border-color: var(--ink); color: var(--ink); background: var(--paper); font-size: 0.8rem; }
.city-pick .city-thumb { height: 92px; border-bottom: 2.5px solid var(--ink); }
.city-pick .city-name { padding: 9px 12px 0; font: 400 1.35rem/1 var(--f-title); font-size-adjust: 0.5; }
.city-pick .city-name i { margin-left: 3px; font: 400 var(--t-xs)/1 var(--f-doc); font-style: normal; letter-spacing: 0.06em; color: var(--paper-dim); }
.city-pick .city-rule { padding: 4px 12px 12px; font-size: var(--t-xs); line-height: 1.35; }
.city-pick .city-rule b { color: var(--red); }
.act-pick .city-rule { padding: 3px 10px 9px; }

/* L and M: zoomed with the view */
html[data-view="l"] .setup, html[data-view="m"] .setup { zoom: var(--k); padding-block: 28px; min-height: calc(100vh / var(--k)); align-content: center; }
/* M is 760 tall where L is 900: its setup zooms a step smaller, so it fits as L does */
html[data-view="m"] .setup { zoom: calc(var(--k) * 0.89); min-height: calc(100vh / (var(--k) * 0.89)); }
html[data-view="l"] .setup.first, html[data-view="m"] .setup.first { max-width: 1000px; padding-top: 60px; gap: 34px; }

/* S: phones */
html[data-view="s"] .setup { gap: 14px; }
html[data-view="s"] .setup-logo { width: min(250px, 60vw); }
html[data-view="s"] .lodge-chip { padding: 4px 10px 4px 4px; }
html[data-view="s"] .lodge-chip small { display: none; }
html[data-view="s"] .lodge-chip .deg-seal { width: 34px; height: 34px; font-size: 1rem; }
html[data-view="s"] .mode-tabs { gap: 6px; }
html[data-view="s"] .mode-tab { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; text-align: center; }
html[data-view="s"] .mode-tab .ico { width: 24px; height: 24px; }
html[data-view="s"] .mode-tab b { font-size: 1.05rem; }
html[data-view="s"] .mode-tab small { display: none; }
html[data-view="s"] .brief { grid-template-columns: 1fr; }
html[data-view="s"] .brief-who { min-height: 140px; border-right: 0; border-bottom: 3px solid var(--ink); }
html[data-view="s"] .brief-who .standee { width: 130px; }
html[data-view="s"] .chapter-art .standee { width: 120px; }
html[data-view="s"] .brief-body { padding: 16px 16px 18px; }
html[data-view="s"] .brief-power, html[data-view="s"] .brief-sum { min-height: 3lh; }
html[data-view="s"] .brief-slots, html[data-view="s"] .brief-slots.two { grid-template-columns: 1fr; gap: 8px; }
html[data-view="s"] .slot { grid-template-columns: 58px minmax(0, 1fr); padding: 7px 10px 7px 7px; }
html[data-view="s"] .slot-art { width: 58px; height: 58px; }
html[data-view="s"] .ghosts { gap: 2px; padding: 2px; }
html[data-view="s"] .ghosts i, html[data-view="s"] .ghosts .seal.sm { width: 22px; height: 22px; }
html[data-view="s"] .brief-go .cta.big { width: 100%; padding-inline: 16px; font-size: min(1.9rem, 5.8vw); } /* "Play today’s conspiracy" fits a 360px phone */
html[data-view="s"] .brief-go .rand-all { width: 100%; justify-content: center; margin-left: 0; }
html[data-view="s"] .slot-cell > .rand-die { right: 8px; bottom: 8px; width: 26px; height: 26px; box-shadow: 1.5px 1.5px 0 var(--ink); }
html[data-view="s"] .pick-grid.socs, html[data-view="s"] .pick-grid.cities { grid-template-columns: 1fr; }
html[data-view="s"] .pick-grid.cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-view="s"] .city-pick .city-rule { display: none; }
html[data-view="s"] .diff-row, html[data-view="s"] .len-row { grid-template-columns: 1fr; }
html[data-view="s"] .soc-pick { padding-left: 104px; min-height: 120px; }
html[data-view="s"] .soc-pick .standee { width: 94px; }
html[data-view="s"] .soc-pick::after { left: 96px; }

/* ---------- Die Trying: the tale trail under the card, a stone per tale, chapter by chapter ---------- */
/* one row on L and M (the card keeps the height it has in the other modes); it wraps on phones */
/* the chapter chips, then the open chapter's stones on a grid as wide as the longest chapter */
.brief-sum:has(.trail) { max-width: none; }
.trail { display: flex; align-items: center; gap: 8px 16px; padding-top: 4px; }
.trail-chs { display: inline-flex; gap: 4px; }
.tch { appearance: none; min-width: 34px; height: 26px; padding: 0 6px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); font: 700 var(--t-xs)/1 var(--f-brand); cursor: pointer; transition: transform 0.12s ease; }
.tch:not(:disabled):not(.on):hover { transform: translateY(-2px); }
.tch.done { background: #f1dfae; }
.tch.on { background: var(--ink); color: var(--yellow); cursor: default; }
.tch.locked { border-style: dashed; border-color: rgba(43, 33, 24, 0.45); background: transparent; color: rgba(43, 33, 24, 0.4); cursor: default; }
.trail-tales { display: grid; grid-template-columns: repeat(var(--most), 26px); gap: 5px; }
.tn { appearance: none; position: relative; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid var(--ink); border-radius: 7px; background: var(--paper); color: var(--ink); font: 400 0.9rem/1 var(--f-title); cursor: pointer; transition: transform 0.12s ease; }
.brief-sum .tn b { color: inherit; font-weight: 400; }
.tn:not(:disabled):hover { transform: translateY(-2px); }
.tn.done { background: #f1dfae; }
.tn.on { z-index: 1; background: var(--yellow); box-shadow: 0 0 0 3px var(--ink), var(--hard); transform: translateY(-2px) scale(1.12); }
.tn.locked { border-style: dashed; border-color: rgba(43, 33, 24, 0.45); background: transparent; color: rgba(43, 33, 24, 0.4); cursor: default; }
.tn.fin { color: var(--red); }
.tn.fin.locked { color: rgba(178, 59, 48, 0.5); border-color: rgba(178, 59, 48, 0.5); }
.tn-stars { position: absolute; left: 50%; bottom: -5px; display: flex; gap: 1px; transform: translateX(-50%); }
.tn-stars i { width: 6px; height: 6px; border: 1px solid var(--ink); border-radius: 50%; background: #e8a91f; }

/* the Stars tile: four stars in a square, lit when earned */
.star-art { background: #f6ecd2; }
.star-row { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 3px; }
.star-row i { display: grid; width: 24px; height: 24px; }
.star-row i .ico { width: 100%; height: 100%; color: rgba(43, 33, 24, 0.2); }
.star-row i.on .ico { color: #e8a91f; filter: drop-shadow(1px 1px 0 var(--ink)); }
.mode-tab .dieguy.ico { width: 34px; height: 34px; margin: -2px 0; overflow: visible; }
html[data-view="s"] .mode-tab .dieguy.ico { width: 26px; height: 26px; }
html[data-view="s"] .trail { flex-wrap: wrap; }
html[data-view="s"] .star-row i { width: 19px; height: 19px; }
/* the Die Trying tab carries your progress: tales won out of all of them */
.mode-prog { display: inline-block; margin-left: 8px; padding: 2px 7px 1px; border: 1.5px solid currentColor; border-radius: 99px; font: 700 var(--t-xs)/1.2 var(--f-body); font-style: normal; vertical-align: 0.25em; opacity: 0.85; }
html[data-view="s"] .mode-prog { margin-left: 4px; padding: 1px 5px 0; font-size: 0.62rem; }

/* ---------- How to play: lessons behind chips, all drawn in one cell so switching never resizes the card ---------- */
.top-chips { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.rules-ico { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid var(--ink); border-radius: 10px; background: var(--red); color: var(--paper); }
.rules-ico .ico { width: 26px; height: 26px; vertical-align: 0; }
.rules-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px 28px 28px; box-shadow: var(--hard-lg); }
.rules-card .pick-chips { flex-wrap: wrap; margin-top: 2px; }
.rl-pages { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
.rl-page { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; visibility: hidden; }
.rl-page.on { visibility: visible; }
.rl-text { display: grid; gap: 10px; align-content: start; }
.rl-text h2 { font: 400 var(--t-2xl)/1.05 var(--f-title); font-size-adjust: 0.5; }
.rl-text p { line-height: 1.45; }
.rl-text i { font-style: normal; font-weight: 800; }
.rl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rl-tile { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 104px; padding: 12px 10px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--label); text-align: center; box-shadow: var(--shadow); }
.rl-tile b { font: 400 2.4rem/1 var(--f-title); color: var(--red); }
.rl-tile b .ico { width: 2.3rem; height: 2.3rem; vertical-align: 0; }
.rl-tile span { font-size: var(--t-sm); line-height: 1.25; color: var(--ink-soft); }
.rl-tips { display: grid; gap: 9px; margin: 0; padding-left: 1.1em; line-height: 1.4; }
.rl-tips b { color: var(--red); }
.rl-tip-art { display: grid; place-items: center; }
.rl-tip-art .standee { width: min(240px, 100%); height: auto; }
/* the dice tray to try: the table's own dice on a strip of night */
.demo { display: grid; justify-items: center; gap: 14px; padding: 22px 18px 18px; border: 2.5px solid var(--ink); border-radius: var(--wobble-lg); background: var(--night-2); color: var(--on-night); box-shadow: var(--hard); }
.demo-tray { --die: 54px; display: flex; gap: 10px; padding-top: 8px; }
.demo-read { min-height: 4lh; max-width: 40ch; text-align: center; font-size: var(--t-sm); line-height: 1.4; }
.demo-read small { opacity: 0.75; }
.die.toss { animation: toss 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes toss { from { transform: translateY(-16px) rotate(-120deg) scale(0.85); } }
@media (prefers-reduced-motion: reduce) { .die.toss { animation: none; } }
html.calm .die.toss { animation: none; }
html[data-view="s"] .rl-page { grid-template-columns: minmax(0, 1fr); gap: 18px; }
html[data-view="s"] .rules-card { padding: 16px 14px 18px; }
html[data-view="s"] .rules .setup-top { flex-wrap: wrap; justify-content: center; }
html[data-view="s"] .demo-tray { --die: 40px; gap: 6px; }
/* phones: the logo on its own row, the two chips sharing the row under it */
html[data-view="s"] .setup-top { flex-direction: column; gap: 12px; }
html[data-view="s"] .top-chips { width: 100%; margin-left: 0; gap: 10px; }
html[data-view="s"] .top-chips > .lodge-chip { flex: 1 1 0; min-width: 0; }
html[data-view="s"] .top-chips b { font-size: min(var(--t-lg), 5vw); white-space: nowrap; }
html[data-view="s"] .rules-ico { width: 34px; height: 34px; border-radius: 8px; }
html[data-view="s"] .rules-ico .ico { width: 22px; height: 22px; }

/* The table: top bar, rival seats, the board (score track, the Capital, landmarks), the Dossier desk, your player
   board (your ID, the dice tray, the handler's note and the buttons) and the rival's dice tray.
   Sizes here are in canvas units for L and M; views.css arranges the pieces per view and shrinks them for S. */

.game { position: relative; display: grid; }

/* ---------- top bar ---------- */
.topbar { grid-area: top; display: flex; align-items: center; gap: 10px 16px; min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.logo:hover .dieguy { transform: rotate(-8deg); transition: transform 0.15s ease; }
.logo .dieguy { width: 40px; height: 40px; flex: none; margin: -6px 0 -4px; overflow: visible; }
.logo > span { display: grid; gap: 1px; }
.logo b { font: 400 1.55rem/0.9 var(--f-title); color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }
.logo small { font: 700 0.62rem/1 var(--f-brand); letter-spacing: 0.16em; text-transform: uppercase; color: #d9ad52; }
.goal { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 5px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); color: var(--ink); font-weight: 800; font-size: var(--t-sm); white-space: nowrap; box-shadow: var(--shadow); }
.goal b { font: 400 1.35rem/1 var(--f-title); }
.round { padding-left: 10px; border-left: 2px solid var(--ink); }
.round.goal-round { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.round.final { padding: 2px 10px 1px; margin-left: 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--red); color: var(--paper); font: 400 1.05rem/1 var(--f-title); animation: alert-pulse 1.2s ease-in-out infinite; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* the first game's checklist beside the race: a pip per lesson, then the next one by name (fixed width: nothing moves) */
.lessons { display: inline-flex; align-items: center; gap: 10px; width: 350px; min-width: 0; padding: 5px 12px 4px; border: 2px solid rgba(233, 184, 76, 0.55); border-radius: var(--wobble-sm); background: rgba(8, 6, 12, 0.55); color: var(--paper); font-size: var(--t-sm); white-space: nowrap; }
.lessons-pips { display: flex; flex: none; gap: 4px; }
.lessons-pips i { width: 11px; height: 11px; border: 2px solid #d9ad52; border-radius: 50%; }
.lessons-pips i.on { border-color: var(--yellow); background: var(--yellow); }
.lessons-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lessons-text i { font-style: normal; }
.lessons-text b { margin-right: 4px; color: var(--yellow); font: 400 1.1rem/1 var(--f-title); }
.lessons.tick .lessons-pips { animation: gain-pop 0.6s ease; }
.ag-prog { padding: 2px 6px 1px; border-radius: 6px; background: var(--paper-2); font: 400 0.95rem/1 var(--f-title); }
.ag-prog:empty { display: none; }
.icon-btn.met .ag-prog { background: var(--c-sec-wash); }

/* ---------- seats: ID badges. Portrait on a colour panel, name, dials and tokens. ---------- */
.seats { display: grid; gap: 22px; align-content: start; min-width: 0; }
.seat {
  --dial: 46px;
  appearance: none;
  position: relative;
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  min-height: calc(var(--dial) + 40px);
  padding: 7px 9px 9px 68px;
  text-align: left;
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble);
  background: linear-gradient(90deg, var(--soc) 0 58px, var(--ink) 58px 60.5px, transparent 60.5px), var(--paper-grain), var(--paper);
  box-shadow: var(--hard);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.3s ease, opacity 0.3s ease;
}
.seat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 58px; border-radius: inherit; border-top-right-radius: 0; border-bottom-right-radius: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.16) 0 1.2px, transparent 1.2px 6px); }
.seat:hover { transform: translateY(-2px); }
.seat-portrait { position: absolute; left: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.seat-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 1.3rem/1.05 var(--f-title); font-size-adjust: 0.5; }
.seat-tag { position: absolute; left: 5px; bottom: 5px; z-index: 3; padding: 2px 5px 1px; border: 2px solid var(--ink); border-radius: 5px; background: var(--yellow); font: 400 0.82rem/1 var(--f-title); }
.seat-tag:empty { display: none; }
.seat-flag { display: none; position: absolute; top: -9px; right: 42px; z-index: 3; padding: 2px 5px 1px; border: 2px solid var(--ink); border-radius: 5px; background: var(--red); color: var(--paper); font: 400 0.8rem/1 var(--f-title); transform: rotate(5deg); }
.seat.fringe .seat-flag { display: block; }
.seat-wanted { position: absolute; top: -9px; left: 8px; z-index: 3; padding: 2px 5px 0; border: 2px solid var(--red); border-radius: 4px; background: var(--manila); color: var(--red); font: 400 0.78rem/1 var(--f-title); letter-spacing: 0.04em; text-transform: uppercase; transform: rotate(-5deg); box-shadow: var(--shadow-sm); pointer-events: none; }
.seat-pts { position: absolute; left: 4px; top: 4px; z-index: 3; padding: 2px 3px 1px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper); font: 400 var(--t-2xs)/1 var(--f-doc); letter-spacing: 0.04em; white-space: nowrap; }
.seat-pts:empty { display: none; }
.seat-crown { position: absolute; top: -17px; right: 6px; z-index: 3; display: none; color: var(--yellow); filter: drop-shadow(1px 2px 0 var(--ink)); }
.seat-crown .ico { width: 30px; height: 30px; stroke: var(--ink); stroke-width: 1.4; }
/* whoever holds the Hot Seat glows, wherever they sit */
.seat.in-cap, .me.in-cap .me-photo { outline: 3px solid var(--c-inf); outline-offset: 3px; animation: seat-glow 2.4s ease-in-out infinite; }
@keyframes seat-glow { 50% { outline-color: #f3cf6e; filter: drop-shadow(0 0 10px rgba(243, 207, 110, 0.55)); } }
.seat.in-cap .seat-crown { display: block; animation: crown-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes crown-in { from { transform: translateY(-16px) scale(0.4) rotate(-20deg); opacity: 0; } }
.seat.active { box-shadow: 0 0 0 3px var(--yellow), var(--hard-lg); }
.seat.active::after { content: "TURN"; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); padding: 3px 8px 2px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); font: 400 1rem/1 var(--f-title); box-shadow: var(--shadow-sm); }
.seat-next { display: none; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); padding: 2px 7px 1px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); font: 400 0.85rem/1 var(--f-title); }
.seat.next .seat-next { display: block; }
.seat-alert { display: none; position: absolute; top: -14px; left: 50%; z-index: 3; padding: 4px 8px 2px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--red); color: var(--paper); font: 400 0.95rem/1 var(--f-title); white-space: nowrap; box-shadow: var(--shadow-sm); transform: translateX(-50%) rotate(-3deg); animation: alert-pulse 1s ease-in-out infinite; }
.seat.near .seat-alert { display: block; }
@keyframes alert-pulse { 50% { scale: 1.08; } }
.seat.winner { box-shadow: 0 0 0 5px var(--yellow), 0 0 40px rgba(233, 184, 76, 0.6), var(--hard); }
.seat.hit { animation: shake 0.45s ease; }
@keyframes shake { 20% { translate: -7px 0; rotate: -2deg; } 40% { translate: 6px 0; rotate: 2deg; } 60% { translate: -4px 0; } 80% { translate: 2px 0; } }
.seat.flip { animation: seat-flip 0.7s ease; }
@keyframes seat-flip { 50% { transform: perspective(600px) rotateY(90deg); } }
.seat.flash { animation: flash 0.4s ease 4; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px var(--paper), 0 0 26px var(--paper); } }
.seat.preview-comp { box-shadow: 0 0 0 4px var(--red), var(--hard); }
/* blood soaks into the card's paper, under its name and stats: a few drops at low Life, the full splatter once Martyred */
.seat { isolation: isolate; }
.seat-blood { display: none; position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; opacity: 0.85; }
.seat.low .seat-blood, .seat.fringe .seat-blood { display: block; }
.seat-blood .b-pool { display: none; }
.seat.fringe .seat-blood .b-pool { display: inline; }

/* dials and tokens */
.dials { display: flex; align-items: center; gap: 6px; }
.dial { position: relative; width: var(--dial, 46px); height: var(--dial, 46px); flex: none; }
.dial svg { width: 100%; height: 100%; display: block; }
.dial-arc { transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), stroke 0.3s; }
.dial-ghost { stroke: transparent; }
.dial-ghost.gain { stroke: rgba(195, 143, 42, 0.42); }
.d-sec .dial-ghost.gain { stroke: rgba(47, 111, 106, 0.42); }
.dial-ghost.loss { stroke: var(--red); animation: ghost-loss 0.9s ease-in-out infinite; }
@keyframes ghost-loss { 50% { opacity: 0.35; } }
.dial-num { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 3px; font: 400 calc(var(--dial, 46px) * 0.56)/1 var(--f-title); font-size-adjust: 0.5; font-variant-numeric: tabular-nums; color: var(--ink); }
.dial-num.pop { animation: pop 0.45s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }
.dial-ico { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.dial-ico .ico { width: 11px; height: 11px; }
.d-inf .dial-ico { color: var(--c-inf); }
.d-sec .dial-ico { color: var(--c-sec); }
.low .d-sec .dial-arc { stroke: var(--red); }
.low .d-sec .dial-ico { color: var(--red); }
.low .d-sec { animation: throb 1s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.06); } }
.dial-delta { position: absolute; top: -9px; right: -9px; z-index: 2; display: none; padding: 2px 4px 1px; border: 2px solid var(--ink); border-radius: 6px; font: 400 0.8rem/1 var(--f-title); color: var(--ink); }
.dial-delta.up { display: block; background: #cfe3bf; }
.dial-delta.down { display: block; background: var(--c-loss-wash); }
.dial-delta.preview { display: block; border-style: dashed; background: #dbe8ff; }
.dial.gain, .tok.gain { animation: gain-pop 0.32s ease; }
@keyframes gain-pop { 50% { scale: 1.2; } }
.tokens { order: 3; margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tok { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 1px 4px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font: 800 var(--t-sm)/1 var(--f-body); }
.tok .ico { width: 15px; height: 15px; }
.tok-bm .ico { color: var(--c-bm); }
.tok-files .ico { color: var(--c-file); }
.tok.none { opacity: 0.4; }
.tok-delta { margin-left: 2px; font: 400 0.85rem/1 var(--f-title); font-style: normal; }
.tok-delta.up { color: var(--green-ink); }
.tok-delta.down { color: var(--red); }
.tok-delta.preview { color: var(--blue); }

/* ---------- your ID on the player board ---------- */
.me { grid-area: me; position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 6px; align-content: start; min-width: 0; padding: 0; cursor: default; }
.me-photo { grid-row: 1 / span 3; position: relative; align-self: stretch; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.16) 0 1.2px, transparent 1.2px 6px), var(--soc); box-shadow: var(--hard); overflow: hidden; min-height: 120px; }
.me-photo .standee { position: absolute; left: 50%; bottom: -4px; width: 92px; transform: translateX(-50%); }
.me .seat-tag { left: 6px; bottom: 6px; }
.me .seat-pts { left: 6px; top: 6px; }
.me .seat-crown { top: -16px; right: auto; left: 64px; }
.me-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; font: 400 1.5rem/1 var(--f-title); font-size-adjust: 0.5; color: var(--paper); text-shadow: 1px 1px 0 var(--ink); }
.me-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .dials { --dial: 60px; gap: 8px; }
.me .tokens { margin-left: 4px; align-self: center; align-items: flex-start; }
.me .tok { font-size: var(--t-md); }
.me-agenda { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border: 2px dashed rgba(246, 238, 219, 0.35); border-radius: var(--wobble-sm); color: var(--on-night); font-size: var(--t-xs); cursor: pointer; background: none; text-align: left; }
.me-agenda b { font: 400 1.05rem/1 var(--f-title); color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-agenda .ag-prog { margin-left: auto; color: var(--ink); }
.me-agenda.met { border-color: var(--green); }
.me-agenda .ico { color: var(--yellow); }
.me.active .me-photo { box-shadow: 0 0 0 3px var(--yellow), var(--hard-lg); }

/* ---------- the board: a printed game board. A cream frame carries the score track; the Capital sits inside. ---------- */
.board {
  grid-area: board;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 48px 50px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--wobble-lg);
  background-color: var(--paper-2);
  background-image: radial-gradient(circle, rgba(43, 33, 24, 0.09) 1px, transparent 1.4px), var(--paper-grain);
  background-size: 9px 9px, 160px 160px;
  box-shadow: var(--hard-xl);
}
.board::before { content: ""; position: absolute; inset: 8px; border: 1.5px dashed rgba(43, 33, 24, 0.3); border-radius: var(--wobble-lg); pointer-events: none; }
.track { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.track-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.track-path path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 7; opacity: 0.35; }
.tc { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); font: 400 0.8rem/1 var(--f-title); color: var(--paper-dim); }
.tc.five { width: 32px; height: 32px; margin: -16px 0 0 -16px; background: var(--paper-3); color: var(--ink); font-size: 1.1rem; box-shadow: var(--shadow-sm); }
.tc.goal-cell { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: var(--yellow); color: var(--ink); box-shadow: var(--shadow); }
.tc.goal-cell .ico { width: 24px; height: 24px; }
.track-mark { position: absolute; z-index: 3; margin: -16px 0 0 -16px; transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s ease; pointer-events: auto; }
.track-mark .seal { width: 32px; height: 32px; }
.track-mark.active { z-index: 5; }
.track-mark.active .seal { box-shadow: 0 0 0 3px var(--yellow), var(--shadow-sm); }
.track-mark.you .seal { border-color: var(--yellow); }
.track-mark.flash .seal { animation: flash 0.4s ease 4; }

/* the Capital: a city scene seen through a surveillance camera, with the badge and the holder */
.capital {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 10px 26px;
  padding: 16px 20px 26px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-lg);
  background: linear-gradient(180deg, #1b2030 0%, #343552 55%, #5f4c66 100%);
  box-shadow: inset 0 0 0 2px rgba(246, 238, 219, 0.08);
  container-type: size;
}
.capital::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: var(--paper-grain); opacity: 0.6; mix-blend-mode: overlay; }
.capital[data-city="area51"], .city-thumb[data-city="area51"] { background: linear-gradient(180deg, #131c1b 0%, #2b453d 55%, #6c7a52 100%); }
.capital[data-city="antarctica"], .city-thumb[data-city="antarctica"] { background: linear-gradient(180deg, #111a26 0%, #2b4862 60%, #6d97b4 100%); }
.capital[data-city="waco"], .city-thumb[data-city="waco"] { background: linear-gradient(180deg, #2a2a36 0%, #6a5244 55%, #c99a62 100%); }
.capital[data-city="jonestown"], .city-thumb[data-city="jonestown"] { background: linear-gradient(180deg, #14281f 0%, #2f5a40 55%, #a9b07a 100%); }
.capital[data-city="jekyll"], .city-thumb[data-city="jekyll"] { background: linear-gradient(180deg, #232443 0%, #714d70 52%, #e4a676 100%); }
.capital[data-city="camphero"], .city-thumb[data-city="camphero"] { background: linear-gradient(180deg, #0d111d 0%, #1f2a3c 55%, #3e5a5c 100%); }
.capital[data-city="dealey"], .city-thumb[data-city="dealey"] { background: linear-gradient(180deg, #2b5f92 0%, #69a3cf 55%, #efe2b0 100%); }
.city-thumb[data-city="washington"] { background: linear-gradient(180deg, #1b2030 0%, #343552 55%, #5f4c66 100%); }
.capital .skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 50%; z-index: -1; }
.cam {
  position: absolute; inset: 10px; z-index: 0; pointer-events: none;
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 12px;
  font: 700 0.7rem/1 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246, 238, 219, 0.78);
  --b: linear-gradient(rgba(246, 238, 219, 0.7), rgba(246, 238, 219, 0.7));
  background: var(--b) left top / 24px 2px, var(--b) left top / 2px 24px, var(--b) right top / 24px 2px, var(--b) right top / 2px 24px,
    var(--b) left bottom / 24px 2px, var(--b) left bottom / 2px 24px, var(--b) right bottom / 24px 2px, var(--b) right bottom / 2px 24px;
  background-repeat: no-repeat;
}
.cam-rec { display: inline-flex; align-items: center; gap: 5px; color: #f0a198; }
.cam-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d65a4f; animation: rec 1.6s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: 0.15; } }
.cap-art { position: relative; flex: none; width: clamp(110px, 62cqh, 250px); display: grid; place-items: center; }
.cap-badge { width: 100%; height: auto; display: block; filter: drop-shadow(2px 5px 0 var(--ink)); }
/* the unseat meter: a pip per Hit it takes, lit for what the roll in progress would deal */
.cap-meter { position: absolute; left: 50%; bottom: 4%; z-index: 3; display: flex; align-items: center; gap: 4px; transform: translateX(-50%); padding: 4px 8px 3px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: rgba(20, 16, 12, 0.88); box-shadow: var(--shadow-sm); white-space: nowrap; }
.cap-meter[hidden] { display: none; }
.cap-meter b { margin-right: 2px; font: 400 1.1rem/1 var(--f-title); color: var(--paper); }
.cap-meter i { width: 15px; height: 15px; border: 2px solid var(--paper-dim, #b9a98a); border-radius: 50%; }
.cap-meter i.on { border-color: var(--ink); background: var(--red); }
.cap-meter.full { background: var(--red); animation: alert-pulse 0.9s ease-in-out infinite; }
.cap-meter.full i.on { background: var(--yellow); }
.capital.claimed .cap-badge { animation: badge-slam 0.75s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes badge-slam { 0% { transform: scale(1.35) rotate(-200deg); } 55% { transform: scale(0.94) rotate(8deg); } 75% { transform: scale(1.05) rotate(-3deg); } }
.cap-seal { position: absolute; left: 50%; bottom: 8%; width: 58%; transform: translateX(-50%); }
.cap-seal .standee { width: 100%; }
.capital.claimed .cap-seal { animation: drop-in 0.65s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes drop-in { from { transform: translate(-50%, -120%) scale(0.6); } }
.cap-seal.arriving { visibility: hidden; }
.cap-seal.landed { animation: landed 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
@keyframes landed { 40% { transform: translateX(-50%) scale(1.15); } }
.cap-vacant { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%) rotate(-6deg); padding: 8px 12px 4px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font: 400 1.6rem/1 var(--f-title); box-shadow: var(--shadow); }
.cap-info { position: relative; z-index: 1; display: grid; gap: 8px; max-width: 340px; min-width: 0; }
.cap-title { font: 400 1.05rem/1 var(--f-title); letter-spacing: 0.04em; color: var(--yellow); text-shadow: 1px 1px 0 var(--ink); }
.cap-holder { font: 400 2.1rem/1 var(--f-title); font-size-adjust: 0.5; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }
.you-pill { padding: 3px 7px 1px; border: 2.5px solid var(--ink); border-radius: 6px; background: var(--yellow); color: var(--ink); font: 400 1rem/1 var(--f-title); text-shadow: none; vertical-align: 6px; }
.cap-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cap-perks li { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font-size: var(--t-sm); box-shadow: var(--shadow-sm); }
.cap-perks .ico { width: 20px; height: 20px; }
.cap-perks .good .ico { color: var(--c-inf); }
.cap-perks .bad .ico { color: var(--c-loss); }
.city-pill { padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; background: rgba(43, 33, 24, 0.72); color: var(--on-night); font-size: var(--t-sm); }
.city-pill b { margin-right: 4px; color: var(--yellow); }
.city-pill.fell { border-color: var(--red); background: rgba(70, 18, 12, 0.82); }
.city-pill.fell b { color: #ff8a6a; }
@container (max-height: 300px) { .city-pill, .cap-perks li:nth-child(3) { display: none; } }
@container (max-height: 230px) { .cap-perks li:nth-child(2) { display: none; } .cap-holder { font-size: 1.5rem; } }
/* the board reacts: heat when the holder is low, frost at the Ice Wall */
.capital[data-heat="1"] .cap-badge { filter: drop-shadow(2px 5px 0 var(--ink)) drop-shadow(0 0 14px rgba(255, 150, 40, 0.7)); }
.capital[data-heat="2"] .cap-badge { filter: drop-shadow(2px 5px 0 var(--ink)) drop-shadow(0 0 22px rgba(255, 70, 50, 0.85)); animation: heat 0.9s ease-in-out infinite; }
.capital[data-heat="3"] .cap-badge { filter: drop-shadow(2px 5px 0 var(--ink)) drop-shadow(0 0 30px rgba(255, 40, 40, 1)); animation: heat 0.5s ease-in-out infinite; }
@keyframes heat { 50% { transform: rotate(-2deg) scale(1.03); } }
.capital.frost::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 6px #bfe9ff, inset 0 0 60px rgba(191, 233, 255, 0.9); animation: fade 0.9s ease reverse; }

/* city scenes (also used small on tiles and in results) */
.city-thumb { position: relative; display: block; height: 84px; overflow: hidden; isolation: isolate; border-bottom: 2.5px solid var(--ink); }
.city-thumb .skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 72%; z-index: -1; overflow: visible; } /* smoke and towers that rise above the scene's strip show in the frame's sky (the frame still trims the sides) */
.sky-stars { position: absolute; inset: 0; z-index: -3; background-image: radial-gradient(#f6eedb 1px, transparent 1.5px), radial-gradient(#f6eedb 1px, transparent 1.5px); background-size: 70px 60px, 110px 90px; background-position: 10px 8px, 40px 30px; opacity: 0.45; }
.sky-stars.faint { opacity: 0.18; }
.sky-moon { position: absolute; top: 12%; left: 10%; width: 54px; height: 54px; z-index: -2; border: 2.5px solid var(--ink); border-radius: 50%; background: #f2e6c4; box-shadow: 0 0 34px rgba(255, 246, 200, 0.45); }
.sky-sun { position: absolute; left: 50%; bottom: 14%; width: 180px; height: 180px; margin-left: -90px; z-index: -2; border-radius: 50%; background: radial-gradient(circle, #efd79a 0 52%, rgba(255, 190, 90, 0) 70%); }
.sky-sun.flare { animation: flare 1.2s ease-out; }
@keyframes flare { 30% { transform: scale(1.35); filter: brightness(1.4); } }
.searchlights { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.searchlights i { position: absolute; bottom: 10%; width: 90px; height: 140%; transform-origin: 50% 100%; background: linear-gradient(0deg, rgba(255, 236, 190, 0.28), rgba(255, 236, 190, 0)); clip-path: polygon(44% 100%, 56% 100%, 100% 0, 0 0); }
.searchlights i:nth-child(1) { left: 18%; animation: sweep 7s ease-in-out infinite; }
.searchlights i:nth-child(2) { right: 18%; animation: sweep 8s ease-in-out infinite reverse; }
@keyframes sweep { 0%, 100% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } }
.ufo { position: absolute; top: 4%; right: 12%; width: 116px; z-index: -1; animation: ufo 3.2s ease-in-out infinite; }
.ufo svg, .chopper svg { width: 100%; height: auto; display: block; }
@keyframes ufo { 0%, 100% { transform: translate(0, 0) rotate(-3deg); } 50% { transform: translate(-10px, 8px) rotate(3deg); } }
.ufo.beaming svg path:first-child { fill: rgba(165, 215, 170, 0.85); }
.ufo.beaming { animation: ufo-beam 0.35s ease-in-out 4; }
@keyframes ufo-beam { 50% { transform: translateY(-6px) scale(1.06); } }
.aurora { position: absolute; inset: 0 0 35% 0; z-index: -2; overflow: hidden; }
.aurora i { position: absolute; left: -20%; top: 6%; width: 140%; height: 55%; border-radius: 50%; background: linear-gradient(90deg, transparent, rgba(120, 205, 165, 0.55), rgba(170, 110, 255, 0.5), transparent); filter: blur(14px); animation: aurora 9s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { top: 30%; opacity: 0.7; animation-duration: 13s; }
@keyframes aurora { from { transform: translateX(-10%) skewY(-6deg); } to { transform: translateX(10%) skewY(6deg); } }
.snow { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.85; background-image: radial-gradient(#f6eedb 1.5px, transparent 2px), radial-gradient(#f6eedb 1px, transparent 1.6px); background-size: 60px 60px, 90px 90px; animation: snow 7s linear infinite; }
@keyframes snow { to { background-position: 20px 60px, -30px 90px; } }
.chopper { position: absolute; top: 6%; left: 14%; width: 104px; z-index: -1; animation: chopper 5s ease-in-out infinite; }
.chopper .rotor { animation: rotor 0.18s steps(2) infinite; transform-origin: 60px 14px; }
@keyframes chopper { 0%, 100% { transform: translate(0, 0) rotate(-2deg); } 50% { transform: translate(26px, 6px) rotate(2deg); } }
@keyframes rotor { 50% { transform: scaleX(0.35); } }
.mist { position: absolute; inset: 30% 0 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(220, 230, 210, 0.25) 60%, transparent); }
.city-thumb .ufo { width: 44px; top: 4%; }
.city-thumb .chopper { width: 40px; }
.city-thumb .sky-moon { width: 22px; height: 22px; border-width: 2px; }
.city-thumb .sky-sun { width: 90px; height: 90px; margin-left: -45px; }
.city-thumb .searchlights i { width: 40px; }

/* landmarks: three deeds along the bottom of the board */

/* ---------- the Dossier desk: the three cards on offer, buyable in place when it's your shopping step ---------- */
.desk { grid-area: desk; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-width: 0; min-height: 0; }
.desk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.stamp-head { padding: 5px 9px 3px; border: 2px solid currentColor; border-radius: 3px; color: #e48a7c; font: 400 1rem/1 var(--f-doc); letter-spacing: 0.14em; text-transform: uppercase; transform: rotate(-2deg); }
.desk-cash { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 2px 5px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font-weight: 800; font-size: var(--t-sm); }
.desk-cash b { font: 400 1.2rem/1 var(--f-title); }
.desk-cash .ico { color: var(--c-bm); }
.desk-head .link-btn { margin-left: auto; color: var(--on-night); font-size: var(--t-xs); }
.desk-note { color: var(--on-night-dim); font-size: var(--t-xs); }
.game[data-turn="human"][data-phase="buy"] .desk { --hot: 1; }
.game[data-turn="human"][data-phase="buy"] .desk .stamp-head { color: var(--yellow); }

/* Dossier cards: manila folders with a typed label, a rubber stamp and a paperclip */

/* ---------- the player board: your ID, the dice tray, the handler's note and the buttons ---------- */
.mat {
  grid-area: mat;
  position: relative;
  display: grid;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 3px solid var(--ink);
  border-radius: var(--wobble-lg);
  background: linear-gradient(180deg, var(--night-3), var(--night-2));
  box-shadow: var(--hard-lg);
  outline: 1.5px dashed rgba(233, 184, 76, 0.24);
  outline-offset: -9px;
}
.tray { grid-area: tray; position: relative; display: grid; grid-template-rows: auto auto auto; gap: 6px; min-width: 0; padding: 10px 16px 6px; border: 2.5px solid var(--ink); border-radius: var(--wobble-lg); background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 7px), radial-gradient(ellipse at 40% 0%, rgba(255, 255, 255, 0.08), var(--felt) 60%, var(--felt-2)); box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.25); outline: 1.5px dashed rgba(246, 238, 219, 0.16); outline-offset: -7px; transition: opacity 0.3s ease, filter 0.3s ease; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-title { font: 400 1.4rem/1 var(--f-title); font-size-adjust: 0.5; color: var(--paper); text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; }
.who-sub { display: flex; align-items: center; gap: 6px; color: var(--on-night-dim); font-size: var(--t-sm); }
.steps4 { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }
.steps4 li { padding: 2px 6px 1px; border: 1.5px solid currentColor; border-radius: 4px; font: 400 0.82rem/1 var(--f-title); letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.5; }
.steps4 li.done { opacity: 0.32; text-decoration: line-through; }
.steps4 li.on { opacity: 1; color: var(--ink); background: var(--yellow); border-color: var(--ink); box-shadow: 1px 2px 0 var(--ink); transform: rotate(-3deg); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.pips i.used { background: var(--yellow); }

/* dice: flat ivory faces with a clean ink edge, tumbled onto the tray */
.dice-row { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.dice { --die: 72px; display: flex; flex-wrap: wrap; gap: 30px 14px; padding: 6px 0 30px; }
.die {
  appearance: none;
  touch-action: manipulation; /* a double tap keeps all of a face, never zooms */
  position: relative;
  width: var(--die);
  height: var(--die);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.die .face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  border-radius: 19%;
  background: linear-gradient(150deg, #fffbf1 0%, var(--die-2) 50%, #eee2c4 100%);
  box-shadow: inset -3px -4px 0 rgba(43, 33, 24, 0.09), 3px 4px 0 rgba(10, 7, 5, 0.5);
  transition: box-shadow 0.15s ease;
}
.die .pips { width: 100%; height: 100%; fill: var(--ink); }
.die .face .ico { width: 60%; height: 60%; vertical-align: 0; }
.die.f-leak .face, .die.show-leak .face { color: var(--c-hit); }
.die.f-heal .face, .die.show-heal .face { color: var(--c-sec); }
.die.f-cash .face, .die.show-cash .face { color: var(--c-bm); }
/* each face wears its colour, so a roll reads at a glance: Gold, Hearts, Hits; numbers stay plain */
.die.f-cash .face { background: linear-gradient(150deg, #fff6dc 0%, var(--c-bm-wash) 55%, #e0c68a 100%); }
.die.f-heal .face { background: linear-gradient(150deg, #fff1f1 0%, var(--c-sec-wash) 55%, #e2adb3 100%); }
.die.f-leak .face { background: linear-gradient(150deg, #f6f3ee 0%, var(--c-hit-wash) 55%, #bfb6a9 100%); }
.die .q { display: none; font: 400 calc(var(--die) * 0.42)/1 var(--f-title); }
.die.blank { display: grid; place-items: center; border: 2.5px dashed rgba(246, 238, 219, 0.3); border-radius: 19%; background: rgba(246, 238, 219, 0.05); color: rgba(246, 238, 219, 0.4); cursor: default; transform: none !important; }
.die.blank .face { display: none; }
.die.blank .q { display: block; }
.die.rolling .cap, .die.rolling .kbadge { visibility: hidden; }
.die:disabled { cursor: default; }
.die:not(:disabled):not(.blank):hover { transform: translateY(-4px) rotate(-3deg); }
.die.kept { transform: translateY(-11px); }
.die.kept .face { box-shadow: inset 0 0 0 3px var(--yellow), 5px 10px 0 rgba(10, 7, 5, 0.38); }
.die.kept:not(:disabled):hover { transform: translateY(-13px); }
.die.suggest { animation: wiggle 1.2s ease-in-out infinite; }
/* the Satanists' Backmasking: armed, every die can flip; the coach's pick wears a dashed red ring */
.die.flippable { cursor: alias; }
.die.flippable .face { box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 3px #8a2a2a, 3px 4px 0 rgba(10, 7, 5, 0.5); }
.die.flip-hint .face { outline: 2.5px dashed #8a2a2a; outline-offset: 4px; }
.who .backmask { margin-left: 8px; }
.cta.backmask.on { background: #8a2a2a; color: var(--paper); }
.die.suggest .face { box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 2px var(--paper), 3px 4px 0 rgba(10, 7, 5, 0.5); }
.die.in-set .face { box-shadow: inset 0 0 0 3px #9cc08a, 3px 4px 0 rgba(10, 7, 5, 0.5); }
.die.in-set.kept .face { box-shadow: inset 0 0 0 3px #9cc08a, 5px 10px 0 rgba(10, 7, 5, 0.38); }
.die.spent { opacity: 0.45; filter: grayscale(0.6); }
/* A Skull locks where it lands: it sits down, ringed in blood red, with no keep badge. */
.die.skull .face { color: #3a1414; }
.die.skull.kept, .die.skull.kept:not(:disabled):hover { transform: none; }
.die.skull.kept .face { box-shadow: inset 0 0 0 3px #8a2a2a, 3px 4px 0 rgba(10, 7, 5, 0.5); }
.die.skull .kbadge { display: none !important; }
.die.skull .cap { color: #f0a090; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes score-pop { 40% { transform: translateY(-16px) scale(1.12); } }
.die.scoring { animation: score-pop 0.52s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.die.scoring .face { box-shadow: inset 0 0 0 4px var(--yellow), 0 0 16px rgba(233, 184, 76, 0.75); }
.die .cap { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; color: var(--on-night); text-shadow: 1px 1px 0 var(--ink); font: 800 var(--t-xs)/1 var(--f-body); }
.die.kept .cap { color: var(--yellow); }
/* one voice: the coach's note speaks; a die's caption shows only while you point at the dice */
.die .cap { opacity: 0; transition: opacity 0.15s; }
.dice:hover .cap, .die:focus-visible .cap { opacity: 1; }
.die .kbadge { position: absolute; top: -10px; right: -10px; z-index: 2; display: none; place-items: center; width: 24px; height: 24px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); }
.die .kbadge .ico { width: 13px; height: 13px; }
.die.kept .kbadge { display: grid; }
.die.toss { animation: tumble 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) backwards; }
@keyframes tumble {
  0% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--spin)) scale(0.62); }
  14% { opacity: 1; }
  72% { transform: translate(0, 0) rotate(0deg) scale(1.05, 0.95); }
  86% { transform: translate(0, -6px) scale(0.98, 1.03); }
  100% { transform: none; }
}
/* a die face on its own (the rules) */
.die.mini { --die: 44px; display: inline-block; flex: none; cursor: default; }
.die.mini .face { border-width: 2px; box-shadow: 2px 3px 0 var(--ink); }

/* score preview */
.chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-height: 40px; padding-bottom: 6px; min-width: 0; }
.chip-r { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 2px 5px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font: 800 var(--t-md)/1 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-sm); }
.chip-r .ico { width: 19px; height: 19px; }
.chip-r.inf { background: var(--c-inf-wash); }
.chip-r.sec { background: var(--c-sec-wash); }
.chip-r.cash { background: var(--c-bm-wash); }
.chip-r.hit { background: var(--c-hit-wash); }
.chip-r.cap { background: #ecd9a0; }
.chip-r.void { opacity: 0.55; text-decoration: line-through; }
.chip-r.doom { background: #e8c4bc; color: #6e1f1f; }

/* the handler's note: lined notepad, a fixed number of ruled lines so the table never jumps */
.coach { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.coach-ico { flex: none; width: 58px; height: 58px; overflow: hidden; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--paper-2); box-shadow: var(--shadow-sm); }
.coach-ico .portrait { width: 100%; height: 100%; display: block; }
.coach-body { position: relative; flex: 1; min-width: 0; display: grid; gap: 2px; padding: 9px 14px 9px 30px; border: 2.5px solid var(--ink); border-radius: var(--wobble-lg); background-color: #fbf6e4; background-image: linear-gradient(90deg, transparent 19px, rgba(178, 59, 48, 0.4) 19px 20.5px, transparent 20.5px), var(--paper-grain); color: var(--ink); box-shadow: var(--shadow); }
.coach-body::before { content: ""; position: absolute; left: -14px; bottom: 12px; border: 9px solid transparent; border-right: 14px solid var(--ink); border-left: 0; }
.coach-body::after { content: ""; position: absolute; left: -9px; bottom: 15px; border: 6px solid transparent; border-right: 10px solid #fbf6e4; border-left: 0; }
.coach-label { display: block; height: 22px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--red); font: 400 var(--t-xs)/22px var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
/* on your turn the label is the turn's goal, in one big line */
.coach-label.coach-goal { color: var(--ink); font: 400 1.2rem/22px var(--f-title); letter-spacing: 0; text-transform: none; }
.coach-label.coach-goal small { margin-right: 8px; color: var(--red); font: 400 var(--t-xs)/22px var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.coach p { min-height: 66px; font-size: var(--t-md); line-height: 22px; background: repeating-linear-gradient(180deg, transparent 0 21px, rgba(76, 107, 143, 0.17) 21px 22px); }
.coach p b { color: var(--red); }
.ff-hint { margin-left: 8px; padding: 0; border: 0; background: none; font: 800 var(--t-2xs)/1 var(--f-body); letter-spacing: 0; text-transform: inherit; color: var(--paper-dim); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
body.ff .ff-hint { color: var(--red); }
/* on a touch screen it's something to hold: a small pill with a thumb-sized hit area */
@media (hover: none) {
  .ff-hint { position: relative; padding: 3px 8px 2px; border: 1.5px solid currentColor; border-radius: 999px; color: var(--ink); vertical-align: 1px; }
  .ff-hint::after { content: ""; position: absolute; inset: -10px -6px; }
}
.actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 12px; }
.actions .cta { flex: 1 1 0; min-width: 0; padding-inline: 14px; }
.game[data-turn="human"] .actions .cta.big:not(:disabled) { animation: nudge 2.4s ease-in-out infinite; }
/* the idle nudge: after a while with nothing pressed, what the coach would press bounces and glows */
.game .idle-nudge, .game .actions .cta.big.idle-nudge:not(:disabled) { animation: idle-nudge 1.1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px var(--paper), 0 0 28px rgba(233, 184, 76, 0.95); }
@keyframes idle-nudge { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px) rotate(-1deg); } 60% { transform: translateY(0) rotate(0.5deg); } }
@media (prefers-reduced-motion: reduce) { .game .idle-nudge { animation: none; } }
html.calm .game .idle-nudge { animation: none; }
/* a rival's seat, hovered (L and M): their power and Keepsakes */
.seat-peek { position: fixed; z-index: 60; display: grid; gap: 7px; width: 250px; padding: 10px 12px 11px; border: 2.5px solid var(--ink); border-left: 9px solid var(--soc); border-radius: var(--wobble-sm); background: var(--paper); background-image: var(--paper-grain); color: var(--ink); font-size: var(--t-sm); line-height: 1.3; box-shadow: var(--shadow); pointer-events: none; animation: rise 0.15s ease; }
.sp-name { font: 400 1.3rem/1 var(--f-title); }
.sp-power small { display: block; margin-bottom: 2px; color: var(--red); font: 400 var(--t-2xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.sp-power > b { margin-right: 3px; }
.sp-files { display: flex; flex-wrap: wrap; gap: 4px; }
.sp-files i { padding: 2px 7px 1px; border: 1.5px solid var(--ink); border-radius: 999px; background: #dbe6f0; font: 700 var(--t-2xs)/1.3 var(--f-body); font-style: normal; }
.sp-files em { color: var(--paper-dim); font-size: var(--t-xs); }

/* your Files: a fan of small manila cards */
.hand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hand-label { flex: none; font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-night); text-shadow: 1px 1px 0 var(--ink); }
.hand-cards { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.hand-card { appearance: none; flex: none; display: flex; align-items: center; overflow: hidden; padding: 0; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background-color: var(--manila); color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.15s ease; }
.hand-card:hover, .hand-card:focus-visible { transform: translateY(-2px); }
.hc-art { width: 30px; height: 26px; border-right: 2px solid var(--ink); }
.hc-name { padding: 2px 8px; white-space: nowrap; font: 800 var(--t-xs)/1 var(--f-body); }

/* the shop inside the mat (phones only) */
.shop-zone { display: grid; gap: 8px; min-width: 0; }
.shop-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.shop-title { font: 400 1.4rem/1 var(--f-title); color: var(--paper); text-shadow: 1px 1px 0 var(--ink); }
.shop-head .link-btn { color: var(--on-night); }
.shop-cards { display: grid; gap: 9px; }

/* ---------- a rival's dice: a small tray that opens beside their seat on their turn ---------- */
.rival-tray { position: absolute; z-index: 8; display: grid; gap: 6px; width: 340px; padding: 10px 12px 12px; border: 2.5px solid var(--ink); border-radius: var(--wobble-lg); background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 7px), radial-gradient(ellipse at 40% 0%, rgba(255, 255, 255, 0.08), var(--felt) 60%, var(--felt-2)); box-shadow: var(--hard-lg); animation: tray-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes tray-in { from { opacity: 0; transform: translateX(-14px) scale(0.96); } }
.rival-tray::before { content: ""; position: absolute; left: -14px; top: 26px; border: 9px solid transparent; border-right: 13px solid var(--ink); border-left: 0; }
.rt-head { display: flex; align-items: center; gap: 8px; color: var(--paper); font: 400 1.2rem/1 var(--f-title); }
.rt-head .pips { margin-left: auto; }
.rival-tray .dice { --die: 40px; gap: 18px 7px; padding: 2px 0 14px; }
.rival-tray .die .face { border-width: 2px; box-shadow: 2px 3px 0 rgba(10, 7, 5, 0.5); }
.rival-tray .die.kept { transform: translateY(-6px); }
.rival-tray .die .cap { display: none; }
.rival-tray .die .kbadge { width: 16px; height: 16px; top: -7px; right: -7px; border-width: 2px; }
.rival-tray .die .kbadge .ico { width: 9px; height: 9px; }
.rt-say { padding: 6px 9px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font-size: var(--t-sm); line-height: 1.3; }
/* how long the rival's turn has left: what they're doing, who's up after them, and a bar that is full as the turn ends */
.rt-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; margin-top: 2px; color: var(--paper); font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.rt-now { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rt-next { color: var(--on-night-dim); white-space: nowrap; }
.turnbar { position: relative; display: block; grid-column: 1 / -1; height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(10, 7, 5, 0.45); box-shadow: 1px 2px 0 var(--ink); overflow: hidden; }
.turnbar > i { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left center; background: linear-gradient(var(--yellow), #c08f32); }
.who-sub .turnbar { display: inline-block; width: 64px; height: 8px; margin-left: 8px; vertical-align: -1px; box-shadow: none; }

/* ---------- news: newspaper clippings ---------- */
@keyframes tick-in { from { opacity: 0; transform: translateY(-10px) rotate(-3deg); } }
.rail-head { color: var(--on-night); font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- phase focus: the table brightens what matters now ---------- */
.game[data-turn="human"] .seats .seat:not(.active) { filter: saturate(0.78) brightness(0.93); }
.game[data-turn="bot"] .tray { opacity: 0.55; filter: saturate(0.6); }
.game[data-turn="bot"] .me { opacity: 0.85; }

/* your ID borrows the seat's badges */
.me .seat-flag { position: static; display: none; transform: rotate(-4deg); }
.me.fringe .seat-flag { display: inline-block; }
.me.in-cap .seat-crown { display: block; animation: crown-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.me.near .seat-alert { display: block; left: 160px; }
.me.hit { animation: shake 0.45s ease; }
.me.flash .me-photo { animation: flash 0.4s ease 4; }
.me.preview-comp .me-photo { box-shadow: 0 0 0 4px var(--red), var(--hard); }
.me .hand { grid-column: 2; }

/* Breaking News in the top bar */
.news-chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 5px 11px 4px 7px; border: 2.5px solid var(--ink); border-radius: 3px 7px 4px 8px / 8px 4px 7px 3px; background-color: var(--newsprint); background-image: var(--paper-grain); color: #241d16; font: 700 var(--t-sm)/1 var(--f-news); white-space: nowrap; box-shadow: var(--shadow); cursor: pointer; transform: rotate(-1.5deg); }
.news-chip span { overflow: hidden; text-overflow: ellipsis; }
.news-chip .ico { width: 18px; height: 18px; color: var(--red); }
html[data-view="s"] .news-chip span { display: none; }

/* the board reacts: dusk over the rounds, sirens and smoke when the holder is in trouble, an alarm on exposures */
.dusk { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 10, 34, var(--dusk, 0)), rgba(8, 10, 34, calc(var(--dusk, 0) * 0.45))); transition: background 2s ease; }
.capital .sky-stars { opacity: calc(0.3 + var(--dusk, 0)); }
.capital[data-heat="2"]::after, .capital[data-heat="3"]::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; animation: siren 1.1s steps(2, jump-none) infinite; }
.capital[data-heat="2"]::after { opacity: 0.55; }
@keyframes siren { 0% { box-shadow: inset 0 0 0 4px rgba(178, 59, 48, 0.75), inset 0 0 50px rgba(178, 59, 48, 0.45); } 100% { box-shadow: inset 0 0 0 4px rgba(76, 107, 143, 0.75), inset 0 0 50px rgba(76, 107, 143, 0.45); } }
.capital[data-heat="3"] .cap-art::before, .capital[data-heat="3"] .cap-art::after { content: ""; position: absolute; top: 4%; z-index: 3; width: 34px; height: 34px; border-radius: 50%; background: rgba(60, 50, 70, 0.55); filter: blur(3px); pointer-events: none; animation: smoke 1.8s ease-out infinite; }
.capital[data-heat="3"] .cap-art::before { left: 26%; }
.capital[data-heat="3"] .cap-art::after { left: 58%; animation-delay: 0.9s; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(10px) scale(0.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50px) scale(1.6); } }
.capital.alarm .searchlights i { animation-duration: 0.9s; background: linear-gradient(0deg, rgba(240, 120, 100, 0.45), rgba(240, 120, 100, 0)); }
.capital.alarm .dusk { background: rgba(120, 20, 20, 0.25); }
@keyframes lm-smoke { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px) translateX(6px) scale(1.8); } }

/* the turn timer: a fuse that burns down across the top of the tray */
.fuse { position: absolute; top: 12px; right: 16px; display: flex; align-items: center; gap: 8px; z-index: 2; pointer-events: none; }
.fuse-cord { position: relative; width: 120px; height: 8px; border: 2px solid var(--ink); border-radius: 6px; background: repeating-linear-gradient(115deg, var(--paper-2) 0 5px, #c9b48a 5px 8px); box-shadow: 1px 2px 0 var(--ink); overflow: visible; }
.fuse-cord i { position: absolute; inset: -2px auto -2px -2px; width: calc((100% + 4px) * (1 - var(--p, 1))); border-radius: 6px 0 0 6px; background: var(--ink); transition: width 0.2s linear; }
.fuse-cord::after { content: ""; position: absolute; top: 50%; left: calc(100% * (1 - var(--p, 1))); width: 16px; height: 16px; margin: -8px 0 0 -8px; background: radial-gradient(circle, #fff6c8 0 25%, var(--yellow) 26% 50%, transparent 52%), conic-gradient(from 0deg, transparent 0 10%, var(--red) 10% 14%, transparent 14% 35%, var(--red) 35% 39%, transparent 39% 60%, var(--red) 60% 64%, transparent 64% 85%, var(--red) 85% 89%, transparent 89%); border-radius: 50%; animation: spark 0.35s steps(2) infinite; transition: left 0.2s linear; }
.fuse b { min-width: 2.2em; font: 700 var(--t-sm)/1 var(--f-mono); color: var(--paper); text-align: right; text-shadow: 1px 1px 0 var(--ink); }
.fuse.low b { color: #ef8a7c; animation: nudge 1s ease infinite; }
.fuse.out .fuse-cord::after { display: none; }
.fuse.out b { color: var(--yellow); font-family: var(--f-title); font-size: var(--t-lg); }
@keyframes spark { to { transform: rotate(40deg) scale(1.15); } }

/* your hand (L and M): Assets and what you brought, card-sized, under the handler's note */
.holdings { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-width: 0; min-height: 0; }
.hold-label { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-night-dim); }
.hold-label b { margin-left: 6px; font-weight: 400; color: var(--on-night); }
.hold-cards { --w: 86px; position: relative; display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 2px 2px 16px; }
.hold-cards > .tcg { position: relative; }
.hold-cards.crowd { gap: 0; }
.hold-cards.crowd > * + * { margin-left: calc(var(--w) * -0.4); }
.hold-cards > .tcg:hover { z-index: 3; }
html[data-view="m"] .hold-cards { --w: 64px; gap: 6px; }
html[data-view="s"] .holdings { display: none; }

/* ---------- the Omen: this round's card, face up on the table (a strip on phones) ---------- */
.omen { position: absolute; z-index: 4; left: 64px; top: 90px; --w: 128px; }
.game.no-omens .omen { display: none; }
.omen-card { display: grid; text-align: left; }
.omen-card .tcg-name { padding-left: 0; }
.omen-card.face { background-color: #e6dcf2; transform: rotate(-3deg); box-shadow: 0 0 0 3px #b39ce0, var(--hard-lg); }
.omen-card.face:hover { transform: rotate(-3deg) translateY(-3px); }
.omen-card .tcg-art .art { background: radial-gradient(circle at 50% 40%, var(--c2), var(--c1)); }
.omen-card .tcg-type i { color: #6a3fa0; border-color: #6a3fa0; }
.omen-card .tcg-type i.when { color: var(--ink); border-color: var(--ink); }
.omen-card.struck { filter: saturate(0.85); }
.omen-card.back { cursor: default; transform: rotate(-3deg); }
.omen-card.back .back-mark { width: 62%; }
/* a new Omen turns over, then glows until the round has had a moment to notice it */
.omen-card.turning { animation: omen-turn 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) both, omen-glow 1.4s 0.7s ease-in-out 3; }
@keyframes omen-turn { 0% { transform: rotate(-3deg) perspective(600px) rotateY(90deg) scale(0.9); } 100% { transform: rotate(-3deg) perspective(600px) rotateY(0) scale(1); } }
@keyframes omen-glow { 50% { box-shadow: 0 0 0 3px #b39ce0, 0 0 28px 8px rgba(179, 156, 224, 0.85), var(--hard-lg); } }
.omen-strip { display: none; }
/* All Souls' Night: the way to the Altar sits under the Omen card on your shop step */
/* a story's next turn of events, a tab under the Omen deck: its round, and its name on one line */
.omen-next { display: grid; width: calc(var(--w) + 12px); margin: 10px 0 0 -6px; padding: 4px 8px 3px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: #f0dcc4; color: var(--ink); font-size: var(--t-2xs); line-height: 1.2; box-shadow: var(--shadow-sm); transform: rotate(-3deg); }
.omen-next b { color: #7a4a22; font: 400 var(--t-xs)/1.1 var(--f-doc); letter-spacing: 0.08em; text-transform: uppercase; }
.omen-next span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html[data-view="s"] .omen-next { display: none; }
.omen-go { display: block; margin: 12px auto 0; animation: title-fade 0.3s ease both; }
.omen-go[hidden] { display: none; }

/* Overlays: dialogs, tutorial callouts, the turn banner and every flying, stamping effect.
   Dialogs zoom with the view scale (--mz); effects live in #fxl, which is scaled like the table (--fk). */

/* ---------- dialogs ---------- */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
#modal[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(26, 20, 15, 0.72); animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  position: relative;
  zoom: var(--mz);
  width: min(560px, 100%);
  max-height: calc((100vh - 32px) / var(--mz));
  overflow-y: auto;
  overflow-x: hidden; /* a dialog never scrolls sideways: anything poking out (a door's burst) is clipped */
  display: grid;
  gap: 14px;
  padding: 26px 26px 22px;
  border: 3px solid var(--ink);
  border-radius: var(--wobble-lg);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  box-shadow: var(--hard-xl);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.94); } }
.dialog h2 { padding-top: 4px; font: 400 var(--t-2xl)/1 var(--f-title); font-size-adjust: 0.5; color: var(--ink); }
.dialog h3 { margin-top: 4px; font: 400 1.2rem/1 var(--f-title); color: var(--paper-dim); }
.dialog p { max-width: 62ch; font-size: var(--t-md); }
.dialog p b { color: var(--red); }
.dlg-x { position: absolute; top: 12px; right: 12px; padding: 6px; }
.dlg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.dialog .link-btn { color: var(--paper-dim); }
.dialog .chip { font-size: 1.15rem; }
.fine { font-size: var(--t-sm) !important; color: var(--paper-dim); }
.menu-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 8px 0; border-bottom: 2px dashed rgba(43, 33, 24, 0.2); font-weight: 800; }
.menu-sub { display: block; font-weight: 600; font-size: var(--t-xs); color: var(--paper-dim); }
html.big-text .menu-sub { display: none; } /* Large text: the menu keeps one line a row, so it still fits without scrolling */

/* the briefing */
.dialog.intro { justify-items: center; padding-top: 30px; text-align: center; }
.intro-step { display: grid; gap: 12px; justify-items: center; }
.intro-art { height: 150px; display: grid; place-items: center; }
.intro-art.stars { position: relative; color: var(--yellow); }
.intro-art.stars .ico { width: 140px; height: 140px; stroke: var(--ink); stroke-width: 1.3; filter: drop-shadow(2px 5px 0 var(--ink)); }
.intro-art.stars b { position: absolute; padding-top: 14px; font: 400 2.4rem/1 var(--f-title); color: var(--ink); }
.intro-art.cap .cap-badge { width: 160px; }
.intro-art.house .cap-badge { width: 150px; }
.intro-art.rivals { grid-auto-flow: column; gap: 6px; align-items: end; }
.intro-art.rivals .standee { width: 96px; }
.intro-art.agenda .standee { width: 120px; }
.intro-art.lms { height: auto; padding: 8px 0; }
.intro-art .lm.demo { width: min(300px, 100%); cursor: default; }
/* a starter game's new piece, as the card itself: one of the table's Sites, the Omen deck */
.intro-art.site .tcg, .intro-art.omens .tcg { --w: 104px; pointer-events: none; transform: rotate(-3deg); }
/* Die Trying's harder dice: three Skulls (and the Life they cost), or a drop of blood */
.intro-art.dice { grid-auto-flow: column; gap: 10px; align-items: center; }
.intro-art.dice .die.mini { --die: 64px; }
.intro-art.dice .die.mini:nth-child(2) { transform: translateY(-10px) rotate(4deg); }
.intro-art.dice .die.mini:nth-child(3) { transform: rotate(-5deg); }
.intro-art.dice > .ico { width: 56px; height: 56px; color: var(--red); stroke: var(--ink); filter: drop-shadow(2px 3px 0 var(--ink)); }
.intro-art.bleed .ico { width: 110px; height: 110px; color: var(--red); stroke: var(--ink); stroke-width: 1.3; filter: drop-shadow(2px 5px 0 var(--ink)); }
.dialog.intro p .ico { width: 1.2em; height: 1.2em; }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); transition: width 0.2s ease; }
.dots i.on { width: 30px; border-radius: 6px; background: var(--yellow); }
.dialog.intro .dlg-actions { flex-direction: column; justify-content: center; }

/* choices: claim a landmark or score */
.choice-art { display: flex; align-items: center; justify-content: center; gap: 14px; }
.choice-art > .ico { width: 64px; height: 64px; color: var(--ink); }
.secmeter { height: 18px; overflow: hidden; border: 2.5px solid var(--ink); border-radius: 9px; background: var(--paper-2); }
.secmeter i { display: block; height: 100%; background: var(--c-sec); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.choice-btn { appearance: none; display: grid; gap: 4px; padding: 14px 16px; text-align: left; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper-3); background-image: var(--paper-grain); color: var(--ink); box-shadow: var(--hard); cursor: pointer; transition: transform 0.12s ease; }
.choice-btn b { padding-top: 3px; font: 400 1.6rem/1 var(--f-title); font-size-adjust: 0.5; }
.choice-btn b .ico { width: 20px; height: 20px; margin-right: 6px; vertical-align: -3px; }
.choice-btn span { font-size: var(--t-sm); color: var(--paper-dim); }
.choice-btn:hover { transform: translateY(-3px); }
.choice-btn:active { transform: translate(2px, 3px); box-shadow: var(--shadow-sm); }
.choice-btn.rec { background-color: #e3ecd6; box-shadow: 0 0 0 3px var(--green), var(--hard); }
.choice-btn.rec b::after { content: "Safer"; margin-left: 8px; padding: 3px 7px 1px; border: 2px solid var(--ink); border-radius: 6px; background: var(--green); font: 400 0.9rem/1 var(--f-title); vertical-align: 6px; }
.claim-choices .choice-btn.rec b::after { content: "Best pick"; }

/* rules */
.rule-grid { display: grid; gap: 12px; }
.rule { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 12px; font-size: var(--t-md); }
.rule b { display: block; font: 400 1.25rem/1.1 var(--f-title); color: var(--ink); }
.rule-ico { width: 48px; height: 48px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper-2); color: var(--ink); }
.rule-ico .ico { width: 28px; height: 28px; vertical-align: 0; }
.rule-ico .glyph { width: 38px; height: 38px; }
.rule-ico.inf { color: var(--c-inf); }
.rule-ico.hit { color: var(--c-hit); }
.die.mini { --die: 48px; flex: none; border-radius: 12px; cursor: default; box-shadow: var(--shadow); }
.face-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; width: 100%; text-align: left; }
.face-legend > div { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); line-height: 1.25; }
.face-legend b { display: block; font: 400 1.15rem/1.1 var(--f-title); }
/* the in-game rules: three steps, then one page per chip, stacked so the card keeps its size */
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; padding: 0; list-style: none; }
.steps3 li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-sm); line-height: 1.25; }
.steps3 b { display: block; font: 400 1.3rem/1.05 var(--f-title); }
.step-n { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 400 1.1rem/1 var(--f-title); }
.help-chips { margin: 16px 0 10px; }
.help-pages { display: grid; grid-template-columns: minmax(0, 1fr); }
.help-page { grid-area: 1 / 1; visibility: hidden; }
.help-page.on { visibility: visible; }
.help-page p { margin: 0; line-height: 1.35; }
html[data-view="s"] .steps3 { gap: 6px; margin-bottom: 10px; }
html[data-view="s"] .steps3 li { flex-direction: column; gap: 4px; font-size: var(--t-xs); }
html[data-view="s"] .help-chips { margin: 12px 0 8px; }
html[data-view="s"] .dialog .fine { display: none; }
html[data-view="s"] .dialog .face-legend { gap: 8px; }
html[data-view="s"] .dialog .die.mini { --die: 36px; border-radius: 9px; }

/* target picker */
.targets { display: grid; gap: 12px; }
.target-btn { appearance: none; display: flex; align-items: center; gap: 14px; padding: 10px 14px; text-align: left; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper-3); background-image: var(--paper-grain); color: var(--ink); box-shadow: var(--hard); cursor: pointer; transition: transform 0.12s ease; }
.target-btn:hover { transform: translateY(-3px); }
.target-btn.rec { box-shadow: 0 0 0 3px var(--red), var(--hard); }
.t-body { display: grid; gap: 2px; min-width: 0; }
.t-name { padding-top: 3px; font: 400 1.35rem/1 var(--f-title); }
.t-rec { margin-left: 6px; padding: 3px 7px 1px; border: 2px solid var(--ink); border-radius: 6px; background: var(--red); color: var(--paper); font-size: var(--t-xs); vertical-align: 3px; }
.t-stat { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--paper-dim); font-size: var(--t-sm); }
.t-prev { font-size: var(--t-sm); font-weight: 800; color: var(--blue); }
.t-prev.bad { color: var(--red); }

/* a society's file */
.seat-detail { display: flex; align-items: center; gap: 16px; padding-right: 30px; }
.seat-detail .standee { flex: none; width: 110px; }
.motto { font: 400 var(--t-sm)/1.3 var(--f-doc) !important; color: var(--paper-dim); }
.detail-stats { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.detail-stats span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px 3px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); font-weight: 800; }
.detail-stats b { font: 400 1.35rem/1 var(--f-title); }
.power-card { display: grid; gap: 2px; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--paper); }
.power-card.on { background: #fff7d1; box-shadow: var(--shadow); }
.power-card.off { opacity: 0.55; }
.power-side { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-dim); }
.power-card b { font: 400 1.3rem/1.1 var(--f-title); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file-list li { display: grid; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--manila); background-image: var(--paper-grain); }
.file-list b { font: 400 1.15rem/1.1 var(--f-title); color: var(--blue); }

/* secret agenda */
.agenda-card { position: relative; display: grid; gap: 6px; padding: 20px; border: 2.5px dashed var(--ink); border-radius: var(--wobble); background-color: var(--paper); background-image: var(--paper-grain); }
.eyes { position: absolute; top: -14px; right: 16px; padding: 5px 9px 3px; border: 2.5px solid var(--ink); border-radius: 6px; background: var(--red); color: var(--paper); font: 400 1rem/1 var(--f-title); transform: rotate(6deg); box-shadow: var(--shadow-sm); }
.agenda-name { font: 400 1.9rem/1 var(--f-title); }
.agenda-text { font-size: var(--t-lg); }
.agenda-bonus { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.agenda-bonus .ico { color: var(--c-inf); }
.agenda-status { font-size: var(--t-sm); color: var(--paper-dim); }
.agenda-status.met { color: var(--green-ink); font-weight: 800; }
.agenda-meter { display: block; height: 12px; margin-top: 4px; overflow: hidden; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper-2); }
.agenda-meter i { display: block; height: 100%; background: var(--green); }
.agenda-prog { font: 400 1.15rem/1 var(--f-title); }

/* the case log */
.dialog.drawer { align-self: stretch; justify-self: end; width: min(420px, 100%); max-height: none; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-sm); }
.log li { padding: 5px 0; border-bottom: 2px dashed rgba(43, 33, 24, 0.12); }
.log .k-turn { padding-top: 12px; font: 400 1.15rem/1 var(--f-title); color: var(--blue); }
.log .k-bad, .log .k-expose { color: var(--red); }
.log .k-good { color: var(--green-ink); }
.log .k-capital { color: #9a6a1e; }
.log .k-muted, .log .k-info { color: var(--paper-dim); }

/* landmark details */
.lm-head { display: flex; align-items: center; gap: 14px; }
.site-story { margin-top: 6px; font: italic 400 var(--t-sm)/1.3 var(--f-doc); color: var(--paper-dim); }
.spied { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 2px dashed var(--ink); border-radius: var(--wobble-sm); background: rgba(233, 184, 76, 0.18); font-size: var(--t-sm); }
.spied .ico { flex: none; width: 20px; height: 20px; color: var(--red); }
.site-targets .tcg-solo { --w: 84px; padding: 0; }
.site-targets .tcg { cursor: pointer; }

/* ---------- results ---------- */
.dialog.over { width: min(1040px, 100%); padding-top: 22px; }
.win-hero { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 22px; padding: 0 44px 4px 0; }
.win-hero::before { content: ""; position: absolute; inset: -22px -26px auto; z-index: 0; height: 168px; border-radius: 20px 20px 0 0; background: repeating-conic-gradient(from 0deg at 86px 78%, var(--soc) 0deg 8deg, transparent 8deg 16deg); opacity: 0.35; }
.win-hero > * { position: relative; z-index: 1; }
.win-pic { display: grid; justify-items: center; }
.win-crown { z-index: 2; margin-bottom: -18px; color: var(--yellow); filter: drop-shadow(1px 3px 0 var(--ink)); animation: crown-in 0.6s 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4) backwards; }
.win-crown .ico { width: 50px; height: 50px; stroke: var(--ink); stroke-width: 1.3; }
.win-hero .standee { width: 116px; animation: drop-win 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards; }
@keyframes drop-win { from { transform: translateY(-40px) scale(0.6); } }
.win-text { display: grid; justify-items: start; gap: 6px; }
.win-hero h2 { font-size: 3rem; color: var(--red); text-shadow: 2px 2px 0 rgba(43, 33, 24, 0.25); }
.new-best { justify-self: start; padding: 7px 12px 4px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); color: var(--ink); font: 400 1.25rem/1 var(--f-title) !important; transform: rotate(-2deg); box-shadow: var(--shadow-sm); }
.over-tip { max-width: 62ch; padding-left: 10px; border-left: 3px solid var(--red); font-size: var(--t-sm); line-height: 1.35; }
.over-tip b { margin-right: 6px; color: var(--red); font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.over-body { display: grid; gap: 16px; align-items: start; }
@media (min-width: 880px) { .over-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; } }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res { display: grid; grid-template-columns: 24px 34px minmax(0, 1fr) auto auto 48px; align-items: center; gap: 10px; padding: 8px 12px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper-3); background-image: var(--paper-grain); font-variant-numeric: tabular-nums; animation: res-in 0.4s var(--d) cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards; transition: box-shadow 0.15s ease, transform 0.15s ease; }
@keyframes res-in { from { transform: translateX(-24px); } }
.res .seal { width: 34px; height: 34px; }
.res.on { box-shadow: 0 0 0 3px var(--yellow); transform: translateX(3px); }
.res.first { background-color: #f1e2ae; box-shadow: var(--shadow); }
.res-rank { padding-top: 3px; font: 400 1.4rem/1 var(--f-title); color: var(--paper-dim); }
.res-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.res-name small { font: 400 0.9rem/1 var(--f-title); color: var(--blue); }
.res-inf { display: inline-flex; align-items: center; gap: 3px; font: 400 1.25rem/1 var(--f-title); }
.res-inf .ico { color: var(--c-inf); }
.res-inf em { margin-left: 4px; font: 400 0.95rem/1 var(--f-title); font-style: normal; color: var(--blue); }
.res-agenda { display: grid; text-align: right; font-size: var(--t-xs); line-height: 1.15; }
.res-agenda.met { color: var(--green-ink); font-weight: 800; }
.res-agenda.miss { color: var(--paper-dim); }
.res-total { padding-top: 4px; text-align: right; font: 400 2rem/1 var(--f-title); }
.res-pts { font: 400 var(--t-sm)/1 var(--f-doc); color: var(--green-ink); white-space: nowrap; }
.res-places { display: inline-flex; gap: 3px; }
.pl { padding: 3px 5px 2px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper-2); font: 400 var(--t-2xs)/1 var(--f-doc); font-style: normal; }
.pl.p1 { background: var(--yellow); }
.pl.p2 { background: #d8d4c8; }
.pl.p3 { background: #e0b48a; }
.trends { display: grid; gap: 6px; }
.trends h3 { color: var(--ink) !important; }
.chart { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 56px; padding: 8px 4px 2px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper-3); background-image: var(--paper-grain); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.t-axis text { font: 700 11px var(--f-body); fill: var(--paper-dim); }
.t-grid { stroke: rgba(43, 33, 24, 0.1); stroke-width: 1; }
.t-goal { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 5; opacity: 0.75; }
.t-line { fill: none; stroke: rgba(43, 33, 24, 0.3); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; transition: opacity 0.15s ease, stroke-width 0.15s ease; }
.t-line.key { stroke: var(--c); stroke-width: 3.4; }
.t-dot { fill: rgba(43, 33, 24, 0.45); stroke: var(--paper-3); stroke-width: 2; }
.t-dot.key { fill: var(--c); }
.t-lead { fill: none; stroke: rgba(43, 33, 24, 0.28); stroke-width: 1; }
.chart.focusing .t-line:not(.on), .chart.focusing .t-dot:not(.on), .chart.focusing .t-end:not(.on) { opacity: 0.25; }
.t-line.on { stroke: var(--c); stroke-width: 3.8; }
.t-dot.on { fill: var(--c); }
.t-cross { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.t-rail { position: relative; }
.t-end { position: absolute; left: 2px; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px; font: 400 1.15rem/1 var(--f-title); color: var(--ink); transition: opacity 0.15s ease; }
.t-end .seal { margin: 0; }
.t-end.key .seal, .t-end.on .seal { box-shadow: 0 0 0 2.5px var(--c); }
.t-tip { position: absolute; top: 6px; z-index: 3; display: grid; gap: 3px; min-width: 150px; padding: 7px 9px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); font-size: var(--t-xs); pointer-events: none; }
.t-tip b { margin-bottom: 2px; color: var(--red); font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.t-tip span { display: flex; align-items: center; gap: 2px; }
.t-tip .seal { margin: 0 4px 0 0; }
.t-tip i { margin-left: auto; padding-left: 10px; font: 400 1rem/1 var(--f-title); font-style: normal; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tl-act { display: grid; gap: 5px; padding: 6px; border: 2px solid var(--ink); border-radius: var(--wobble); background: var(--paper-3); }
.tl-act .city-thumb { height: 76px; border: 2px solid var(--ink); border-radius: 8px; }
.tl-label { font: 400 var(--t-2xs)/1.2 var(--f-doc); letter-spacing: 0.04em; text-transform: uppercase; }
.tl-win { display: flex; align-items: center; gap: 4px; font: 400 1.05rem/1 var(--f-title); }
.tl-win .seal { margin: 0; }

/* between acts */
.dialog.act { width: min(860px, 100%); }
.act-head { position: relative; display: grid; gap: 6px; padding-right: 30px; }
.act-no { font: 400 var(--t-sm)/1 var(--f-doc); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.act-head h2 { font-size: 2.4rem; }
.act-results .res { grid-template-columns: 24px 34px minmax(0, 1fr) auto auto 44px; }
.act-next { display: grid; gap: 10px; }
.act-next h3 { font-size: 1.35rem !important; color: var(--ink) !important; }
.act-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.act-pick .city-thumb { height: 96px; }
.act-pick .city-rule { font-size: var(--t-xs); line-height: 1.3; }
.act-pick:disabled { cursor: default; opacity: 0.85; }
.act-pick:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--yellow), var(--hard-lg); }

/* ---------- first-game callouts ---------- */
#mark { position: fixed; inset: 0; z-index: 60; }
#mark[hidden] { display: none; }
#mark.enter { animation: mark-in 0.32s ease-out; }
#mark.enter .mark-bubble { animation: mark-bubble-in 0.42s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes mark-in { from { opacity: 0; } }
@keyframes mark-bubble-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } }
.mark-hole { position: fixed; border-radius: 20px; box-shadow: 0 0 0 9999px rgba(26, 20, 15, 0.76), 0 0 0 4px var(--yellow); pointer-events: none; }
.mark-bubble { position: fixed; display: grid; gap: 8px; padding: 16px 18px; border: 3px solid var(--ink); border-radius: var(--wobble-lg); background-color: var(--paper-3); background-image: var(--paper-grain); color: var(--ink); box-shadow: var(--hard-lg); }
.mark-bubble::before { content: ""; position: absolute; left: calc(var(--arrow) - 12px); border: 12px solid transparent; }
.mark-bubble.below::before { top: -24px; border-bottom-color: var(--ink); }
.mark-bubble.above::before { bottom: -24px; border-top-color: var(--ink); }
.mark-bubble.right::before { left: -24px; top: calc(var(--arrow) - 12px); border-right-color: var(--ink); }
.mark-bubble.left::before { left: auto; right: -24px; top: calc(var(--arrow) - 12px); border-left-color: var(--ink); }
.mark-bubble.over::before { display: none; }
.mark-title { padding-top: 3px; font: 400 var(--t-xl)/1 var(--f-title); font-size-adjust: 0.5; }
.mark-bubble p { font-size: var(--t-md); line-height: 1.4; }
.mark-bubble p .ico { width: 1.2em; height: 1.2em; }
.mark-bubble .cta { justify-self: start; }
/* the first game's tour of the table: a step points at the table, or sits in the middle with its own picture */
.mark-hole.none { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(26, 20, 15, 0.76); }
.mark-bubble.center::before { display: none; }
.mark-bubble.tour { gap: 12px; padding: 20px 22px 16px; }
.mark-bubble.tour p { font-size: var(--t-lg); line-height: 1.4; }
.tour-art.roll { gap: 6px; padding-top: 12px; }
.tour-art.roll .die.mini { --die: 46px; }
.tour-art.roll .die.kept { transform: translateY(-9px); }
.tour-extra { position: relative; display: inline-flex; }
.tour-extra .face { box-shadow: inset 0 0 0 3px var(--yellow), 2px 3px 0 var(--ink); }
.tour-extra i { position: absolute; top: -12px; right: -14px; padding: 3px 6px; border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow); color: var(--ink); font: 400 1.05rem/1 var(--f-title); font-style: normal; transform: rotate(8deg); }
.tour-skip { position: absolute; top: 6px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ink-soft, var(--ink)); font: 400 1.6rem/1 var(--f-title); cursor: pointer; opacity: 0.6; }
.tour-skip:hover, .tour-skip:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.tour-art { display: flex; align-items: center; justify-content: center; }
.tour-art.versus { gap: 10px; }
.tour-art.versus .standee { width: 92px; }
.tour-art.versus .standee:last-child { transform: scaleX(-1); }
.tour-art.versus b { font: 400 2rem/1 var(--f-title); color: var(--red); transform: rotate(-8deg); }
.tour-art.sets { flex-direction: column; align-items: stretch; gap: 8px; }
.tour-art.sets > div, .tour-rows > div { display: flex; align-items: center; gap: 10px; }
.tour-art.sets > div > span { display: flex; gap: 5px; min-width: 196px; }
.tour-art.sets .die.mini, .tour-rows .die.mini { --die: 38px; }
.tour-art.sets b { display: inline-flex; align-items: center; gap: 4px; font: 400 1.35rem/1 var(--f-title); }
.tour-art.sets b .ico { width: 1.1em; height: 1.1em; }
.tour-art.sets .none { opacity: 0.55; }
.tour-art.sets .none b { font-size: 1.05rem; }
.tour-rows { display: grid; gap: 7px; font-size: var(--t-md); line-height: 1.25; }
.tour-ico { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.tour-ico .ico { width: 20px; height: 20px; }
.tour-ico.heart { background: #f3c9c2; }
.tour-ico.cash { background: #f3dc8c; }
.tour-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.tour-foot .dots { flex: 1; gap: 5px; }
.tour-foot .dots i { width: 9px; height: 9px; }
.tour-foot .dots i.on { width: 22px; }
.mark-bubble .tour-foot .cta { justify-self: auto; }

/* long-press tooltip */
.tip-bubble { position: fixed; z-index: 70; max-width: min(280px, calc(100vw - 16px)); padding: 8px 12px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font-size: var(--t-sm); font-weight: 800; box-shadow: var(--shadow); pointer-events: none; animation: rise 0.18s ease; }

/* low-Health warning around the screen */
/* dread: the table's edges darken as your Life drops (--dread runs 0 at 5 Life to 1 at 1), and at 1 Life the Reaper's
   shadow fades in behind your portrait */
.dread { position: fixed; inset: 0; z-index: 27; pointer-events: none; background: radial-gradient(ellipse 120% 110% at 50% 45%, transparent 48%, rgba(5, 2, 8, 0.82) 100%); opacity: var(--dread, 0); transition: opacity 1.6s ease; }
.me-photo .reaper { position: absolute; left: 50%; bottom: -6px; width: 128px; opacity: 0; transform: translateX(-62%) scale(0.92); transform-origin: 50% 100%; transition: opacity 1.8s ease, transform 1.8s ease; pointer-events: none; }
.me-photo .reaper svg { display: block; width: 100%; height: auto; }
.game.reaper .me-photo .reaper { opacity: 0.92; transform: translateX(-62%) scale(1); }
body.danger::after { content: ""; position: fixed; inset: 0; z-index: 28; pointer-events: none; box-shadow: inset 0 0 0 4px rgba(178, 59, 48, 0.8), inset 0 0 90px rgba(178, 59, 48, 0.55); animation: danger 1.4s ease-in-out infinite; }
@keyframes danger { 50% { opacity: 0.4; } }

/* ---------- the turn banner (inside the table, so it scales with it) ---------- */
.banner {
  position: fixed;
  left: 50%;
  top: 40%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 34px 8px 18px;
  border: 3px solid var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  font: 400 4rem/1 var(--f-title);
  font-size-adjust: 0.5;
  white-space: nowrap;
  box-shadow: var(--hard-xl);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) skewX(-10deg);
}
.banner .seal, .banner .ico { transform: skewX(10deg); }
.banner .ico { width: 56px; height: 56px; color: var(--yellow); }
.banner span { padding-top: 6px; }
.banner.show { animation: banner 1.5s ease forwards; }
.banner.final { background-color: var(--red); color: var(--paper); }
@keyframes banner {
  0% { opacity: 0; transform: translate(-150%, -50%) skewX(-10deg); }
  15% { opacity: 1; transform: translate(-48%, -50%) skewX(-10deg); }
  25%, 75% { opacity: 1; transform: translate(-50%, -50%) skewX(-10deg); }
  100% { opacity: 0; transform: translate(60%, -50%) skewX(-10deg); }
}

/* ---------- effects layer: scaled like the table ---------- */
#fxl { position: fixed; left: 0; top: 0; z-index: 30; width: calc(100vw / var(--fk)); height: calc(100vh / var(--fk)); transform: scale(var(--fk)); transform-origin: 0 0; pointer-events: none; overflow: visible; }
#fxl > * { pointer-events: none; }
#fxl svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#strings path { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(1px 2px 0 var(--ink)); transition: stroke-dashoffset 0.4s ease-out; }
#strings circle { fill: var(--red); stroke: var(--ink); stroke-width: 2; }
#intent path { fill: none; stroke: #d0675d; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 9; opacity: 0.75; animation: march 0.8s linear infinite; }
#intent path.you { stroke-width: 5; opacity: 1; stroke-dasharray: 1 10; filter: drop-shadow(1px 2px 0 var(--ink)); }
#intent path.mine { stroke: #b3362c; stroke-width: 3; stroke-dasharray: 7 6; opacity: 0.9; }
#intent path.mine.coup { stroke: #b3362c; stroke-width: 4; }
#intent marker path, #intent defs path { fill: #b3362c; stroke: none; animation: none; opacity: 1; }
#intent .intent-tag { font: 400 1.05rem/1 var(--f-title); fill: var(--paper); stroke: var(--ink); stroke-width: 4px; paint-order: stroke; text-anchor: middle; letter-spacing: 0.03em; }
#intent .intent-tag.coup { fill: #ffd34d; font-size: 1.25rem; }
@keyframes march { to { stroke-dashoffset: -20; } }
.floater {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 3px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-sm);
  background: var(--paper);
  color: var(--ink);
  font: 400 1.45rem/1 var(--f-title);
  font-size-adjust: 0.5;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: float-up 1.4s ease-out forwards;
}
.floater .ico { width: 22px; height: 22px; }
.floater.inf { background: var(--c-inf-wash); }
.floater.sec { background: var(--c-sec-wash); }
.floater.cash { background: var(--c-bm-wash); }
.floater.lose { background: var(--c-loss-wash); }
.floater.ice { background: #d7e6ef; }
.floater.buy { font-size: 1.15rem; }
.floater.secret { font: 400 var(--t-md)/1 var(--f-doc); letter-spacing: 0.04em; }
.floater.secret.good { background: #d4e7c4; }
.floater.secret.bad { background: var(--c-loss-wash); }
.floater.secret .ico { width: 18px; height: 18px; }
.floater.hit { flex-direction: column; gap: 0; padding: 22px 26px; border: 0; border-radius: 0; background: var(--ink); color: var(--paper); font-size: 1.7rem; box-shadow: none; clip-path: polygon(50% 0, 60% 22%, 84% 8%, 76% 32%, 100% 38%, 78% 54%, 96% 76%, 70% 70%, 66% 100%, 50% 78%, 34% 100%, 30% 72%, 4% 80%, 22% 56%, 0 38%, 24% 32%, 16% 8%, 40% 22%); animation: pow 1.3s ease-out forwards; }
.floater.hit::before { content: ""; position: absolute; inset: 4px; z-index: -1; background: var(--red); clip-path: inherit; }
.floater.hit .pow { font-size: 0.85rem; color: #f1d27a; }
.floater.hit .ico { display: none; }
@keyframes float-up { 0% { opacity: 0; translate: 0 10px; scale: 0.6; } 15% { opacity: 1; translate: 0 0; scale: 1.1; } 25% { scale: 1; } 75% { opacity: 1; } 100% { opacity: 0; translate: 0 -34px; } }
@keyframes pow { 0% { opacity: 0; scale: 0.3; rotate: -20deg; } 15% { opacity: 1; scale: 1.25; rotate: 6deg; } 30% { scale: 1; rotate: -4deg; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1.1; } }
.stamp-fx { position: absolute; transform: translate(-50%, -50%) rotate(-12deg); padding: 10px 16px 6px; border: 3px solid var(--red); border-radius: 8px 4px 9px 5px / 5px 9px 4px 8px; background: rgba(246, 238, 219, 0.95); color: var(--red); font: 400 2.6rem/1 var(--f-title); animation: slam 1.6s ease-out forwards; }
@keyframes slam { 0% { opacity: 0; scale: 2.6; } 14% { opacity: 1; scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.token { position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-sm); }
.token .ico { width: 22px; height: 22px; }
.token.t-star { background: var(--yellow); color: var(--ink); }
.token.t-cash { background: var(--c-bm-wash); color: var(--c-bm); }
.token.t-heart { background: var(--c-sec-wash); color: var(--c-sec); }
.token.t-crosshair { width: 40px; height: 40px; background: var(--red); color: var(--paper); }
.set-pop { position: absolute; transform: translate(-50%, -100%) rotate(-6deg); padding: 7px 12px 4px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: #cfe0bf; color: var(--ink); font: 400 1.8rem/1 var(--f-title); white-space: nowrap; box-shadow: var(--shadow); animation: set-pop 1.3s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards; }
.set-pop.jackpot { background: var(--yellow); font-size: 2.1rem; }
.set-pop.doomed { background: #8a2a2a; color: var(--paper); font-size: 2.1rem; animation-duration: 1.6s; }
.menu-row.off { opacity: 0.5; }
.dialog.dicerules .menu-row { flex-wrap: nowrap; }
.dialog.dicerules .menu-row > span { flex: 1; }
.dialog.dicerules .chips-row { flex: none; }
@keyframes set-pop { 0% { opacity: 0; scale: 0.3; } 15% { opacity: 1; scale: 1.15; } 30% { scale: 1; } 80% { opacity: 1; translate: 0 -10px; } 100% { opacity: 0; translate: 0 -24px; } }
.flyer { position: absolute; left: 0; top: 0; }
.flyer .standee { width: 100%; }
.card-flyer { position: absolute; left: 0; top: 0; --w: 84px; pointer-events: none; }
.burst { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; background: var(--yellow); clip-path: polygon(50% 0, 60% 30%, 92% 14%, 72% 42%, 100% 55%, 68% 62%, 82% 96%, 52% 72%, 30% 100%, 32% 66%, 0 72%, 26% 48%, 6% 18%, 38% 30%); animation: burst 0.6s ease-out forwards; }
@keyframes burst { 0% { transform: scale(0.2) rotate(-20deg); opacity: 1; } 100% { transform: scale(1.3) rotate(15deg); opacity: 0; } }
.crown-off { position: absolute; width: 40px; color: var(--yellow); filter: drop-shadow(1px 3px 0 var(--ink)); animation: crown-off 1s ease-in forwards; }
.crown-off .ico { width: 40px; height: 40px; stroke: var(--ink); stroke-width: 1.4; }
@keyframes crown-off { 0% { transform: translate(-50%, 0) rotate(0); } 30% { transform: translate(-30%, -30px) rotate(25deg); } 100% { transform: translate(40%, 60px) rotate(140deg); opacity: 0; } }
.power-pop { position: absolute; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 3px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font: 800 var(--t-sm)/1 var(--f-body); white-space: nowrap; box-shadow: var(--shadow-sm); animation: power-pop 1.7s ease forwards; }
.power-pop .ico { width: 16px; height: 16px; }
.power-pop.k-file { background: #dbe8ff; }
.power-pop.k-power { background: #fff3c4; }
.power-pop.k-rogue { background: var(--c-loss-wash); }
.power-pop.k-city { background: var(--yellow); }
@keyframes power-pop { 0% { opacity: 0; translate: 0 -6px; scale: 0.7; } 12% { opacity: 1; translate: 0 0; scale: 1.05; } 22% { scale: 1; } 85% { opacity: 1; } 100% { opacity: 0; translate: 0 6px; } }
.rogue-card { position: absolute; transform: translate(-50%, -50%); display: grid; gap: 3px; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--red); background-image: var(--paper-grain); color: var(--paper); text-align: center; box-shadow: var(--hard); animation: rogue 2.7s ease forwards; }
.rogue-card b { font: 400 1rem/1 var(--f-title); color: var(--yellow); }
.rogue-card .rc-name { font: 400 1.6rem/1.05 var(--f-title); }
.rogue-card .rc-text { font-size: var(--t-sm); font-weight: 800; }
@keyframes rogue { 0% { opacity: 0; transform: translate(-50%, -50%) perspective(600px) rotateY(90deg); } 15% { opacity: 1; transform: translate(-50%, -50%) perspective(600px) rotateY(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }

/* scoring tally, ink splats and the table jolt */
.tally { position: absolute; transform: translate(-50%, -100%); display: flex; gap: 6px; padding: 6px 10px 5px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background-color: var(--paper); background-image: var(--paper-grain); box-shadow: var(--shadow); animation: tally-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.tally:empty { visibility: hidden; }
.tally.done { animation: tally-thud 0.35s ease, tally-out 0.5s 0.9s ease forwards; }
@keyframes tally-in { from { opacity: 0; transform: translate(-50%, -80%) scale(0.8); } }
@keyframes tally-thud { 40% { transform: translate(-50%, -100%) scale(1.16) rotate(-2deg); } }
@keyframes tally-out { to { opacity: 0; transform: translate(-50%, -130%); } }
.tally-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 2px 4px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); font: 400 1.35rem/1 var(--f-title); animation: chip-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
.tally-chip .ico { width: 20px; height: 20px; }
.tally-chip.inf { background: var(--c-inf-wash); }
.tally-chip.cash { background: var(--c-bm-wash); }
.tally-chip.sec { background: var(--c-sec-wash); }
.tally-chip.hit { background: var(--c-hit-wash); }
@keyframes chip-in { from { transform: scale(0.3) rotate(-12deg); } }
.splat { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; animation: splat 1.4s ease-out forwards; }
.splat svg { width: 100%; height: 100%; display: block; }
.splat path { fill: rgba(143, 44, 35, 0.85); }
@keyframes splat { 0% { scale: 0.2; opacity: 0; } 12% { scale: 1.1; opacity: 1; } 70% { opacity: 0.9; } 100% { scale: 1; opacity: 0; } }
.game.shake-1 { animation: table-shake 0.36s ease; }
.game.shake-2 { animation: table-shake-big 0.52s ease; }
@keyframes table-shake { 20% { translate: -5px 2px; } 40% { translate: 4px -2px; } 60% { translate: -3px 1px; } 80% { translate: 2px 0; } }
@keyframes table-shake-big { 12% { translate: -10px 4px; } 28% { translate: 9px -5px; } 44% { translate: -7px 3px; } 60% { translate: 5px -2px; } 76% { translate: -3px 1px; } }

/* previews: a die's exact effect, and who it would hit */
.die-tip { position: absolute; transform: translate(-50%, -100%); max-width: 260px; padding: 6px 10px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); font-size: var(--t-sm); font-weight: 700; line-height: 1.3; text-align: center; box-shadow: var(--shadow); animation: rise 0.15s ease; }
.die-tip::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.seat.targeted, .me.targeted .me-photo { box-shadow: 0 0 0 4px var(--red), var(--hard); }
.die.lm-hint .face { box-shadow: inset 0 0 0 4px var(--blue), 0 0 14px rgba(76, 107, 143, 0.7); }

/* ---------- the Lodge ---------- */
/* a coin for the ferryman: gold, with your count on it (class names keep the old Degree wording) */
.deg-seal { position: relative; display: inline-grid; place-items: center; flex: none; width: 52px; height: 52px; border: 2.5px solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe28a, var(--yellow) 45%, #b8862a); box-shadow: var(--hard); color: var(--ink); font: 400 1.5rem/1 var(--f-brand); }
.deg-seal::before { content: ""; position: absolute; inset: 4px; border: 1.5px dashed rgba(43, 33, 24, 0.55); border-radius: 50%; }
.deg-seal b { font-weight: 900; }

.xp-bar { display: block; height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: calc(var(--to) * 100%); background: repeating-linear-gradient(115deg, var(--yellow) 0 6px, #e7a92a 6px 9px); border-right: 2px solid var(--ink); animation: xpfill 1.1s 0.5s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
@keyframes xpfill { from { width: calc(var(--from) * 100%); } }

/* ---------- the Crypt: your coins up top, then folder tabs over one panel at a time ---------- */
.dialog.lodge { width: min(800px, calc(100vw - 32px)); height: min(640px, calc((100vh - 32px) / var(--mz))); grid-template-rows: auto auto minmax(0, 1fr); align-content: stretch; gap: 12px; padding: 22px 26px; }
.lodge-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.lodge-head > .deg-seal { width: 60px; height: 60px; font-size: 1.75rem; }
.lodge-id { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 5px 12px; min-width: 0; }
.lodge-id h2 { padding: 0; }
.lodge-title { font-size: var(--t-md); }
.lodge-id .xp-bar { grid-column: 1 / -1; }
.dialog .lodge-next { grid-column: 1 / -1; max-width: none; font-size: var(--t-sm); color: var(--ink-soft); }
.lodge-tabs { display: flex; gap: 6px; padding: 0 8px; border-bottom: 2.5px solid var(--ink); }
.lodge-tab { appearance: none; position: relative; display: inline-flex; align-items: center; gap: 7px; margin-bottom: -2.5px; padding: 10px 22px 8px; border: 2.5px solid var(--ink); border-radius: 12px 12px 0 0; background: #d6c9ad; color: var(--ink-soft); font: 400 var(--t-lg)/1 var(--f-title); font-size-adjust: 0.5; cursor: pointer; }
.lodge-tab:hover { background: #e2d7bf; color: var(--ink); }
.lodge-tab.on { z-index: 1; border-bottom-color: transparent; background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); }
.tab-badge { padding: 2px 6px 1px; border-radius: 99px; background: var(--red); color: var(--paper); font: 800 var(--t-2xs)/1.2 var(--f-body); font-style: normal; }
/* every panel shares one grid cell, so the dialog is as tall as the tallest and switching tabs never resizes it */
.lodge-panels { display: grid; min-height: 0; overflow-x: clip; overflow-y: auto; }
.lodge-panel { grid-area: 1 / 1; display: grid; align-content: start; gap: 12px; min-width: 0; }
.lodge-panel:not(.on) { visibility: hidden; }
.dialog .lodge-lead { max-width: none; font-size: var(--t-md); }
.lodge-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.lodge-stats span { display: grid; gap: 3px; min-width: 104px; padding: 7px 14px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink-soft); font-size: var(--t-xs); box-shadow: var(--shadow-sm); }
.lodge-stats b { font: 400 var(--t-2xl)/1 var(--f-title); font-size-adjust: 0.5; color: var(--ink); }

/* Loadout: four slots as cards; one slot's choices as big rows */
.kit-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kit-slot { appearance: none; position: relative; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; justify-items: center; gap: 7px; aspect-ratio: 5 / 7; min-width: 0; padding: 12px 10px 11px; border: 2.5px solid var(--ink); border-radius: 12px; background-color: var(--paper); background-image: var(--paper-grain); color: var(--ink); text-align: center; box-shadow: var(--hard); cursor: pointer; transition: transform 0.12s ease; }
.kit-slot:not(.shut):hover { transform: translateY(-3px) rotate(-0.5deg); }
.ks-kind { font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.ks-art { display: grid; place-items: center; width: 80px; height: 80px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-2); font: 400 2.6rem/1 var(--f-title); color: var(--ink-soft); }
.ks-art .lodge-ico { width: 62px; height: 62px; }
.ks-art .ico { width: 34px; height: 34px; }
.kit-slot b { font: 400 var(--t-lg)/1.05 var(--f-title); font-size-adjust: 0.5; }
.kit-slot small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-size: var(--t-sm); line-height: 1.3; color: var(--ink-soft); }
.ks-change { padding: 5px 16px 4px; border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; }
.kit-slot.empty { border-style: dashed; background: rgba(246, 238, 219, 0.55); box-shadow: none; }
.kit-slot.empty .ks-change { background: var(--paper); }
.kit-slot.shut { cursor: default; box-shadow: none; opacity: 0.55; filter: grayscale(0.7); }
.kit-pick-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 2px 14px; }
.dialog .kit-empty { color: var(--blue); font-size: var(--t-sm); }
.kit-pick-head h3 { margin: 0; font: 400 var(--t-xl)/1 var(--f-title); font-size-adjust: 0.5; color: var(--ink); }
.dialog .kit-pick-head p { grid-column: 2 / -1; max-width: none; font-size: var(--t-sm); color: var(--ink-soft); }
.dialog .kit-back { color: var(--blue); font-size: var(--t-md); }
.kit-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kit-opt { appearance: none; position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 12px 9px 9px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); text-align: left; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.12s ease; }
.kit-opt:not(:disabled):hover { transform: translateY(-2px); }
.kit-opt .lodge-ico { width: 48px; height: 48px; flex: none; }
.kit-txt { display: grid; gap: 2px; min-width: 0; }
.kit-txt b { font: 400 var(--t-lg)/1.05 var(--f-title); font-size-adjust: 0.5; }
.kit-txt small { font-size: var(--t-sm); line-height: 1.3; color: var(--ink-soft); }
.kit-opt.on { background: var(--yellow); box-shadow: var(--hard); }
.kit-opt.on .kit-txt small { color: var(--ink); }
.kit-opt.locked { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.85); }
.kit-none { display: grid; place-items: center; width: 48px; height: 48px; flex: none; font: 400 1.6rem/1 var(--f-title); color: var(--ink-soft); }
.kit-on { position: absolute; right: 9px; top: 7px; font: 400 var(--t-2xs)/1 var(--f-doc); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; }

/* chips for a pack (Societies) or a page of doors (Coins) */
.pack-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pack-chip { appearance: none; position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 5px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; cursor: pointer; }
.pack-chip small { font: 700 var(--t-xs)/1 var(--f-body); color: var(--ink-soft); }
.pack-chip:hover { background: #fff8e6; }
.pack-chip.on { background: var(--ink); color: var(--paper); }
.pack-chip.on small { color: var(--on-night-dim); }

/* Graveyard: a stone for each way to die, four across; the undug ones are fainter and keep their name */
.graves { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.grave { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; padding: 8px 10px 8px 8px; border: 2px solid var(--ink); border-radius: 10px; background-color: var(--manila); background-image: var(--paper-grain); box-shadow: var(--shadow-sm); }
.grave-stone { display: grid; place-items: center; width: 38px; height: 46px; border: 2px solid var(--ink); border-radius: 19px 19px 4px 4px; background: #b9b2a3; color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.grave-stone .ico { width: 24px; height: 24px; }
.grave-stone b { font: 400 1.3rem/1 var(--f-title); color: var(--ink-soft); }
.grave-txt { display: grid; gap: 2px; min-width: 0; }
.grave-txt b { font: 400 var(--t-md)/1.05 var(--f-title); font-size-adjust: 0.5; }
.grave-txt small { font-size: var(--t-xs); line-height: 1.25; color: var(--ink-soft); }
.grave-n { position: absolute; top: -8px; right: -6px; padding: 2px 6px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font: 700 var(--t-xs)/1 var(--f-body); font-style: normal; }
.grave:not(.dug) { background-color: #cfc4ad; box-shadow: none; opacity: 0.7; }
.grave:not(.dug) .grave-stone { background: #a49c8c; box-shadow: none; }

/* Societies: one pack at a time, every card the same size (six fit across) */
.roster { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.roster-card { flex: 0 0 calc((100% - 60px) / 6); appearance: none; position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 5px; min-width: 0; aspect-ratio: 5 / 7; padding: 6px; overflow: hidden; border: 2.5px solid var(--ink); border-radius: 11px; background-color: var(--manila); background-image: var(--paper-grain); color: var(--ink); text-align: left; box-shadow: var(--shadow-sm); }
.roster-pic { position: relative; display: block; min-height: 0; overflow: hidden; border: 2px solid var(--ink); border-radius: 7px; background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.16) 0 1.5px, transparent 1.5px 8px), var(--soc); }
.roster-pic .standee { position: absolute; left: 50%; bottom: 0; width: 92%; transform: translateX(-50%); }
.roster-txt { display: grid; gap: 2px; min-width: 0; padding: 0 2px 2px; }
.roster-txt b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; }
.roster-txt small { overflow: hidden; font-size: var(--t-xs); color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; }
.roster-card.locked { background-color: #cfc4ad; }
.roster-card.locked .roster-pic { background: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.14) 0 1.5px, transparent 1.5px 7px), #8a8172; }
.roster-card.locked .standee { filter: grayscale(1) contrast(1.1) brightness(0.85); }
.roster-card .soc-wanted { left: 8px; top: 9px; font-size: 0.74rem; }
.roster-card.take { cursor: pointer; box-shadow: 0 0 0 3px var(--yellow), var(--hard); transition: transform 0.12s ease; }
.roster-card.take:hover { transform: translateY(-3px) rotate(-0.5deg); }
.roster-card.take .soc-wanted { border-color: var(--ink); background: var(--yellow); color: var(--ink); }

/* Daily: today's table on a night-blue card */
.daily-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; padding: 16px; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: var(--night); color: var(--on-night); box-shadow: var(--shadow-sm); }
.daily-card .city-thumb { width: 100%; height: 230px; border: 2.5px solid var(--ink); border-radius: 10px; }
.daily-side { display: grid; gap: 12px; min-width: 0; }
.daily-side .lodge-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.daily-side .lodge-stats span { min-width: 0; padding-inline: 10px; }
.daily-txt { display: grid; gap: 9px; align-content: start; min-width: 0; }
.daily-txt .t-label { color: var(--yellow); }
.dialog .daily-txt h3 { margin: 0; font: 400 var(--t-2xl)/1 var(--f-title); font-size-adjust: 0.5; color: var(--paper); }
.dialog .daily-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--t-md); }
.daily-vs .seal.xs { margin: 0 5px 0 0; }
.daily-txt .fine { color: var(--on-night-dim); }
.daily-txt .cta { justify-self: start; margin-top: 4px; }

/* Coins: an advent calendar. A door for every coin, cut into a night-blue board. Reached doors glow until you open
   them; an open door folds back to show its prize in a recessed box. */
.cal-top { display: flex; align-items: center; gap: 12px; }
.cal-record { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink-soft); text-align: right; }
.cal-top > b { font: 400 var(--t-lg)/1 var(--f-title); }
.cal-cta { display: grid; justify-items: end; gap: 6px; text-align: right; }
.cal-cta b { font: 400 var(--t-xl)/1 var(--f-title); font-size-adjust: 0.5; }
.cal-cta small { font-size: var(--t-xs); color: var(--ink-soft); }
.cal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 10px; list-style: none; border: 2.5px solid var(--ink); border-radius: var(--wobble); background: radial-gradient(circle, rgba(246, 238, 219, 0.3) 1px, transparent 1.6px) 0 0 / 27px 23px, radial-gradient(circle, rgba(246, 238, 219, 0.18) 1px, transparent 1.4px) 11px 9px / 19px 31px, radial-gradient(ellipse at 50% 115%, rgba(232, 180, 60, 0.22), transparent 62%), var(--night); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.28), var(--shadow-sm); }
.cal-cell { position: relative; aspect-ratio: 5 / 7; }
.cal-cell.swing { z-index: 2; }

/* behind the door: the prize */
.cal-prize { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; overflow: hidden; border: 2px solid var(--ink); border-radius: 8px; background-color: var(--paper); background-image: var(--paper-grain); box-shadow: inset 0 4px 9px rgba(43, 33, 24, 0.38); color: var(--ink); text-align: center; }
.cal-prize > :nth-child(2) { margin-top: auto; } /* art and name sit centred above the type line */
.cal-prize::after { content: ""; position: absolute; inset: 3px; border: 1.5px solid rgba(43, 33, 24, 0.3); border-radius: 6px; pointer-events: none; }
.cal-prize .lodge-ico, .cal-prize > .ico { flex: none; width: 50px; height: 50px; }
.cal-prize > .ico { color: var(--c-inf, #b0832a); }
.cal-prize b, .cal-prize em { max-width: 100%; overflow-wrap: break-word; hyphens: auto; }
.cal-prize b { font: 400 var(--t-md)/1.02 var(--f-title); font-size-adjust: 0.5; }
.cal-prize em { font: 700 var(--t-2xs)/1.15 var(--f-body); font-style: normal; color: var(--red); }
.cal-kind { flex: none; max-width: 100%; margin-top: auto; padding-top: 3px; overflow: hidden; font: 400 0.56rem/1 var(--f-doc); letter-spacing: 0.02em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; color: var(--ink-soft); }
.cal-rec { font: 800 var(--t-2xs)/1.1 var(--f-body); font-style: normal; color: var(--blue); }
/* a prize with a title or a recruit on top: smaller art and type so it all fits the card */
.cal-prize.rich .lodge-ico, .cal-prize.rich > .ico { width: 40px; height: 40px; }
.cal-prize.rich b { font-size: 0.92rem; }
.cal-prize.rich em, .cal-prize.rich .cal-rec { font-size: var(--t-xs); }
.cal-n { position: absolute; left: 4px; top: 4px; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 400 0.8rem/1 var(--f-title); }
.cal-stamp { padding: 3px 5px 1px; border: 2px solid var(--red); border-radius: 3px; color: var(--red); font: 400 0.72rem/1 var(--f-title); letter-spacing: 0.06em; text-transform: uppercase; transform: rotate(-9deg); }
.is-open .cal-prize { padding-inline: 8px 3px; }
.is-open .cal-prize::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 5px; border-right: 1.5px solid var(--ink); background: var(--door); }
.cal-cell.now .cal-prize { background-color: #f4e2a6; box-shadow: inset 0 4px 9px rgba(43, 33, 24, 0.32), 0 0 0 3px var(--yellow); }

/* the door: a leaf hinged on its left edge, printed on the front, plain paper on the back */
.cal-door { appearance: none; position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; background: none; color: var(--paper); perspective: 560px; cursor: default; }
.cal-leaf { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; }
.cal-front, .cal-back { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cal-front { display: grid; justify-items: center; align-content: center; gap: 7px; background-color: var(--door); background-image: repeating-linear-gradient(135deg, rgba(43, 33, 24, 0.13) 0 1.5px, transparent 1.5px 7px), var(--paper-grain); box-shadow: inset 0 0 0 4px rgba(246, 238, 219, 0.16); }
.cal-front::before { content: ""; position: absolute; inset: 5px; border: 1.5px dashed rgba(246, 238, 219, 0.5); border-radius: 5px; }
.cal-back { transform: rotateY(180deg); background-color: var(--paper-2); background-image: var(--paper-grain); }
.cal-num { font: 400 2.7rem/1 var(--f-title); font-size-adjust: 0.5; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }
.cal-seal { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 46% 52% 48%; background: radial-gradient(circle at 35% 30%, #cf5246, #8f231d 72%); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(0, 0, 0, 0.14); color: #5c130f; }
.cal-seal .ico { width: 19px; height: 19px; }
.cal-front small { position: relative; padding: 2px 5px 1px; border-radius: 3px; background: rgba(246, 238, 219, 0.92); color: var(--ink); font: 400 var(--t-2xs)/1.1 var(--f-doc); letter-spacing: 0.04em; text-transform: uppercase; }
.cal-tab { position: relative; padding: 3px 9px 2px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--yellow); color: var(--ink); font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; box-shadow: 1px 2px 0 var(--ink); }

/* locked: dimmed and sealed */
.is-locked .cal-front { filter: saturate(0.45) brightness(0.74); }
/* reached: glowing, and every few seconds it tugs at its hinge; hovering cracks it open */
.is-ready .cal-door { cursor: pointer; }
.is-ready .cal-leaf { animation: door-tug 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.43s); }
.is-ready .cal-front { box-shadow: inset 0 0 0 4px rgba(246, 238, 219, 0.16), 0 0 0 3px var(--yellow), 0 0 16px 3px rgba(232, 180, 60, 0.55); }
.is-ready .cal-door:hover .cal-leaf, .is-ready .cal-door:focus-visible .cal-leaf { animation: none; transform: rotateY(-18deg); transition: transform 0.18s ease; }
.is-ready .cal-door:focus-visible .cal-front { outline: 3px solid var(--paper); outline-offset: 2px; }
@keyframes door-tug { 0%, 84%, 100% { transform: rotateY(0); } 88% { transform: rotateY(-13deg); } 92% { transform: rotateY(-3deg); } 96% { transform: rotateY(-8deg); } }
/* open: the leaf is folded away; while it opens it swings past ninety degrees, settles, and fades */
.is-open .cal-door { visibility: hidden; }
.cal-cell.swing .cal-door { visibility: visible; }
.cal-cell.swing .cal-leaf { animation: door-swing 1s cubic-bezier(0.3, 0.1, 0.3, 1) var(--delay) both; }
@keyframes door-swing {
  0% { transform: rotateY(0); }
  12% { transform: rotateY(-7deg); }
  20% { transform: rotateY(-2deg); }
  66% { transform: rotateY(-124deg); }
  82% { transform: rotateY(-106deg); }
  100% { transform: rotateY(-114deg); }
}
/* the faces fade, not the leaf: opacity on the leaf would flatten it and show the front mirrored instead of its back */
.cal-cell.swing .cal-front, .cal-cell.swing .cal-back { animation: door-fade 1s linear var(--delay) both; }
@keyframes door-fade { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
.cal-cell.swing .cal-prize > * { animation: prize-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) calc(var(--delay) + 0.42s) both; }
@keyframes prize-pop { from { opacity: 0; transform: scale(0.4); } }
.cal-burst { position: absolute; left: 50%; top: 50%; z-index: -1; width: 190px; height: 190px; margin: -95px 0 0 -95px; opacity: 0; pointer-events: none; background: var(--yellow); clip-path: polygon(50% 0, 60% 30%, 92% 14%, 72% 42%, 100% 55%, 68% 62%, 82% 96%, 52% 72%, 30% 100%, 32% 66%, 0 72%, 26% 48%, 6% 18%, 38% 30%); }
.cal-cell.swing .cal-burst { animation: cal-burst 0.75s ease-out calc(var(--delay) + 0.36s) both; }
@keyframes cal-burst { 0% { opacity: 1; transform: scale(0.3) rotate(-25deg); } 100% { opacity: 0; transform: scale(1.3) rotate(20deg); } }
/* sparks fly out past the edges of the box */
.cal-sparks { position: absolute; left: 50%; top: 50%; z-index: 3; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; opacity: 0; pointer-events: none; box-shadow: 0 -66px var(--yellow), 46px -50px var(--paper), 62px 4px var(--yellow), 44px 52px var(--paper), 0 70px var(--yellow), -44px 52px var(--paper), -62px 4px var(--yellow), -46px -50px var(--paper); }
.cal-cell.swing .cal-sparks { animation: cal-sparks 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--delay) + 0.4s) both; }
@keyframes cal-sparks { 0% { opacity: 1; transform: scale(0.25); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .is-ready .cal-leaf, .cal-cell.swing .cal-leaf { animation: none; }
  .cal-cell.swing .cal-door { visibility: hidden; }
  .cal-cell.swing .cal-prize > *, .cal-cell.swing .cal-burst, .cal-cell.swing .cal-sparks { animation: none; }
}
html.calm :is(.is-ready .cal-leaf, .cal-cell.swing .cal-leaf, .cal-cell.swing .cal-prize > *, .cal-cell.swing .cal-burst, .cal-cell.swing .cal-sparks) { animation: none; }
html.calm .cal-cell.swing .cal-door { visibility: hidden; }

/* the starter games, to replay: one row each, numbered (a tick once played) */
.dialog.starters { width: min(600px, 100%); }
.starter-list { display: grid; gap: 10px; }
.starter-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: rgba(246, 238, 219, 0.9); }
.starter-row.locked { opacity: 0.55; }
.starter-n { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); font: 400 1.4rem/1 var(--f-title); }
.starter-row.done .starter-n { background: var(--yellow); }
.starter-n .ico { width: 22px; height: 22px; }
.starter-txt { display: grid; gap: 2px; min-width: 0; }
.starter-txt b { font: 400 1.25rem/1.05 var(--f-title); }
.starter-txt small { font-size: var(--t-sm); color: var(--paper-dim); }
.starter-txt .starter-who { color: var(--ink-soft); font-weight: 700; }
/* a question that needs a clear answer before going on */
.dialog.confirm { width: min(480px, 100%); }
/* the keyboard shortcuts card */
.keys-list { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 7px; }
.keys-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.keys-list kbd { justify-self: start; opacity: 1; font-size: var(--t-sm); }

/* XP after a game, under the winner */
.learn-strip { display: grid; justify-items: start; gap: 4px; margin-top: 8px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: rgba(246, 238, 219, 0.9); color: var(--ink); font-size: var(--t-sm); }
.learn-strip .ls-ready { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font: 400 1.35rem/1 var(--f-title); }
.learn-strip .ls-ready .ico { width: 22px; height: 22px; color: var(--yellow); stroke: var(--ink); }
.xp-strip { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px 6px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: rgba(246, 238, 219, 0.9); color: var(--ink); }
.xp-strip .deg-seal { width: 42px; height: 42px; font-size: 1.15rem; }
.xp-strip.up .deg-seal { animation: sealpop 0.6s 1.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes sealpop { from { transform: scale(0.4) rotate(-30deg); } }
.xp-main { flex: 1; display: grid; gap: 4px; min-width: 0; }
.xp-line { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-sm); }
.xp-line b { font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; }
.xp-line span { font-weight: 800; color: var(--c-inf-text); }
.xp-unlock { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: var(--t-xs); }
.xp-unlock.recruited { padding: 3px 8px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); font-weight: 700; }
.xp-unlock .lodge-ico { width: 22px; height: 22px; }

/* your kit on the player board */
.me { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.me-photo { grid-row: 1 / -1; }
.me-kit { grid-column: 2; display: flex; align-items: center; gap: 6px; min-width: 0; }
.me .hand { grid-row: 5; }
.kit-chip { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-sm); }
.kit-chip .lodge-ico { width: 28px; height: 28px; }
.kit-chip.cb { background: #f3d9c9; }
.relic-btn { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 34px; padding: 2px 10px 2px 4px; border: 2px solid var(--ink); border-radius: 8px; background: var(--yellow); color: var(--ink); font: 400 var(--t-md)/1 var(--f-title); font-size-adjust: 0.5; box-shadow: var(--hard); cursor: pointer; }
.relic-btn .lodge-ico { width: 28px; height: 28px; flex: none; }
.relic-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relic-btn:disabled { background: var(--paper-2); box-shadow: var(--shadow-sm); cursor: default; }
.relic-btn.used { opacity: 0.55; filter: grayscale(1); }
.relic-btn:not(:disabled):hover { transform: translateY(-1px); }
.actions .relic-btn { height: auto; align-self: stretch; padding: 4px 10px 4px 6px; }

/* contraband on the desk: a red stamp with the owner's seal */
.cb-stamp { position: absolute; bottom: 6px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px 1px 6px; border: 2px solid var(--red); border-radius: 4px; background: rgba(246, 238, 219, 0.92); color: var(--red); font: 400 var(--t-2xs, 0.7rem)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-4deg); }
.cb-stamp .seal.xs { margin: 0 0 0 2px; }
.kit-list-detail li { position: relative; padding-left: 40px; }
.kit-list-detail li .lodge-ico { position: absolute; left: 0; top: 2px; width: 32px; height: 32px; }
.kit-list-detail small { margin-left: 6px; font-family: var(--f-doc); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }

/* ---------- pressing the big buttons: a squash, an ink ring and a few sparks ---------- */
.actions .cta { position: relative; overflow: hidden; }
.actions .cta::after { content: ""; position: absolute; inset: -2px; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.38) 45%, transparent 60%); transform: translateX(-120%); }
.actions .cta:hover:not(:disabled)::after { animation: glint 0.7s ease; }
@keyframes glint { to { transform: translateX(120%); } }
.actions.swap > * { animation: pop-in 0.26s cubic-bezier(0.3, 1.6, 0.5, 1) backwards; }
.actions.swap > * + * { animation-delay: 0.05s; }
@keyframes pop-in { from { transform: scale(0.86); opacity: 0.4; } }
.press-ring { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 4px solid var(--yellow); border-radius: 50%; animation: press-ring 0.5s ease-out forwards; }
.press-ring.k-roll { border-color: var(--paper); }
.press-ring.k-end { border-color: #b9ad96; }
@keyframes press-ring { from { transform: scale(1); opacity: 0.95; } to { transform: scale(9); opacity: 0; border-width: 1px; } }
.spark { position: absolute; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; animation: spark 0.56s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.spark.k-roll { border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.spark.k-resolve { width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; background: var(--yellow); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.spark.k-end { width: 10px; height: 14px; margin: -7px 0 0 -5px; border: 1.5px solid var(--ink); background: var(--paper-2); }
@keyframes spark { from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.5); opacity: 0; } }

/* ---------- the opening: the place, the shuffle, the deal, your agenda, who goes first ---------- */
.tcg.undealt { visibility: hidden; }
.tcg.flip-in { animation: flip-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
@keyframes flip-in { from { transform: perspective(520px) rotateY(88deg) scale(1.08); } }
.ritual-title { position: absolute; z-index: 5; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 16px 44px 14px; border-block: 3px double #d9ad52; background: rgba(20, 16, 12, 0.86); color: var(--paper); text-align: center; white-space: nowrap; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); animation: title-card 1.6s ease forwards; }
.ritual-title small { font: 400 var(--t-sm)/1 var(--f-doc); letter-spacing: 0.3em; text-transform: uppercase; color: #d9ad52; }
.ritual-title b { font: 900 3.4rem/1 var(--f-brand); letter-spacing: 0.08em; text-transform: uppercase; color: #e8c062; text-shadow: 3px 3px 0 var(--ink); }
.ritual-title span { font: 400 1.3rem/1 var(--f-title); color: var(--on-night); }
html[data-view="s"] .ritual-title { padding: 12px 14px 10px; white-space: normal; }
html[data-view="s"] .ritual-title b { font-size: 2.1rem; }
html[data-view="s"] .ritual-title span { font-size: 1rem; line-height: 1.15; }
@keyframes title-card { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -58%) scale(0.98); } }
.deal-card, .riffle { position: absolute; border: 2px solid var(--ink); border-radius: 7%; background: radial-gradient(circle at 50% 42%, #2b3550, #141826 72%); box-shadow: inset 0 0 0 4px #141826, inset 0 0 0 5.5px rgba(233, 184, 76, 0.6), 3px 4px 0 rgba(10, 7, 5, 0.5); }
.deal-card.k-site { background: repeating-linear-gradient(45deg, #403a58 0 6px, #332e48 6px 12px); }
.tcg.back.shuffling { opacity: 0; }
.riffle-l { animation: riffle-l 0.7s ease-in-out; }
.riffle-r { animation: riffle-r 0.7s ease-in-out; }
@keyframes riffle-l { 25% { transform: translate(-62%, -5%) rotate(-11deg); } 50% { transform: none; } 75% { transform: translate(-48%, -3%) rotate(-7deg); } }
@keyframes riffle-r { 25% { transform: translate(62%, -5%) rotate(11deg); } 50% { transform: none; } 75% { transform: translate(48%, -3%) rotate(7deg); } }
.deal-agenda { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 120px; height: 80px; border: 2px solid var(--ink); border-radius: 6px; background-color: var(--manila); background-image: var(--paper-grain); box-shadow: 3px 4px 0 rgba(10, 7, 5, 0.5); }
.deal-agenda span { padding: 4px 8px 2px; border: 2.5px solid var(--red); border-radius: 4px; color: var(--red); font: 400 1.05rem/1 var(--f-title); transform: rotate(-8deg); }
.seat.roulette, .me.roulette .me-photo { box-shadow: 0 0 0 4px var(--yellow), 0 0 26px rgba(233, 184, 76, 0.8), var(--hard-lg) !important; }
.game.ritual-on .seat.active:not(.roulette) { box-shadow: var(--hard); }
.game.ritual-on .seat.active::after, .game.ritual-on .seat-next, .game.ritual-on .rival-tray { display: none; }
.game.ritual-on .me.active:not(.roulette) .me-photo { box-shadow: var(--hard); }
.me-agenda.flash, .agenda-btn.flash, #agendaBtn.flash { animation: flash 0.4s ease 2; }
/* who goes first: a line for the table, a pip die on each seat, and the story's reason under the stamp */
.ritual-title.small { padding: 12px 30px 10px; animation-duration: 1s; }
.ritual-title.small b { font-size: 2.2rem; }
.ritual-title.small span { font-size: 1.05rem; }
.ritual-title.fall { white-space: normal; max-width: min(560px, 92%); animation-duration: 3.2s; border-block-color: var(--red); }
.ritual-title.fall b { color: #ff8a6a; }
.rolloff-die { position: absolute; z-index: 6; width: 46px; height: 46px; margin: -23px 0 0 -23px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px; border: 3px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 3px 4px 0 rgba(10, 7, 5, 0.5); animation: rolloff 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both, rolloff-out 0.3s ease 2.9s forwards; }
.rolloff-die i { width: 8px; height: 8px; place-self: center; border-radius: 50%; background: var(--ink); }
.rolloff-die[data-face="1"] i { grid-area: 2 / 2; }
.rolloff-die[data-face="2"] i:nth-child(1) { grid-area: 1 / 1; } .rolloff-die[data-face="2"] i:nth-child(2) { grid-area: 3 / 3; }
.rolloff-die[data-face="3"] i:nth-child(1) { grid-area: 1 / 1; } .rolloff-die[data-face="3"] i:nth-child(2) { grid-area: 2 / 2; } .rolloff-die[data-face="3"] i:nth-child(3) { grid-area: 3 / 3; }
.rolloff-die[data-face="4"] i:nth-child(1) { grid-area: 1 / 1; } .rolloff-die[data-face="4"] i:nth-child(2) { grid-area: 1 / 3; } .rolloff-die[data-face="4"] i:nth-child(3) { grid-area: 3 / 1; } .rolloff-die[data-face="4"] i:nth-child(4) { grid-area: 3 / 3; }
.rolloff-die[data-face="5"] i:nth-child(1) { grid-area: 1 / 1; } .rolloff-die[data-face="5"] i:nth-child(2) { grid-area: 1 / 3; } .rolloff-die[data-face="5"] i:nth-child(3) { grid-area: 2 / 2; } .rolloff-die[data-face="5"] i:nth-child(4) { grid-area: 3 / 1; } .rolloff-die[data-face="5"] i:nth-child(5) { grid-area: 3 / 3; }
.rolloff-die[data-face="6"] i:nth-child(odd) { grid-column: 1; } .rolloff-die[data-face="6"] i:nth-child(even) { grid-column: 3; }
@keyframes rolloff { 0% { opacity: 0; transform: translate(-60px, -40px) rotate(-260deg) scale(0.6); } 70% { opacity: 1; transform: translate(4px, 2px) rotate(12deg) scale(1.05); } 100% { transform: none; } }
@keyframes rolloff-out { to { opacity: 0; transform: scale(0.8); } }
.stamp-caption { position: absolute; z-index: 6; transform: translateX(-50%); max-width: 240px; padding: 5px 10px 4px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(20, 16, 12, 0.9); color: var(--paper); font: 400 1rem/1.15 var(--f-title); text-align: center; animation: fade 0.3s ease 0.3s both; }

/* a story's panels: three before the game (the place, you, them), three after (the ending, the winner, the history) */
.dialog.panels-dlg { width: min(980px, 100%); justify-items: center; text-align: center; }
.dialog.panels-dlg .brief-kicker { font: 400 var(--t-sm)/1 var(--f-doc); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-dim); }
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.panel { display: grid; grid-template-rows: auto 1fr; margin: 0; overflow: hidden; border: 3px solid var(--ink); border-radius: var(--wobble); background: var(--paper-3); box-shadow: var(--hard); transform: rotate(-0.6deg); animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.panel:nth-child(2) { transform: rotate(0.5deg); animation-delay: 0.12s; }
.panel:nth-child(3) { transform: rotate(-0.3deg); animation-delay: 0.24s; }
.panel-art { position: relative; display: grid; place-items: end center; height: 190px; overflow: hidden; border-bottom: 3px solid var(--ink); }
.panel-art .city-thumb { position: absolute; inset: 0; height: auto; border: 0; }
.panel-art .city-thumb.dim { filter: brightness(0.55) saturate(0.8); }
.panel-art .city-thumb.sepia { filter: sepia(0.85) brightness(0.8); }
.panel-art > .standee { position: relative; width: 150px; margin-bottom: -6px; }
.panel-foes { position: relative; display: flex; align-items: flex-end; justify-content: center; margin-bottom: -6px; }
.panel-foes .standee { width: 130px; }
.panel-foes.n2 .standee { width: 112px; margin: 0 -14px; }
.panel-foes.n3 .standee, .panel-foes.n4 .standee { width: 92px; margin: 0 -16px; }
.panel figcaption { padding: 10px 12px 12px; font: 400 1.08rem/1.2 var(--f-title); font-size-adjust: 0.5; text-align: left; }
.panel.after figcaption { font-style: italic; }
.panel-stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-9deg); padding: 8px 14px 4px; border: 3px solid var(--red); border-radius: 8px; background: rgba(246, 238, 219, 0.95); color: var(--red); font: 400 2rem/1 var(--f-title); white-space: nowrap; }
.panel-stamp.won { border-color: var(--green, #2f8a4a); color: var(--green, #2f8a4a); }
.panel-tag { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 6px 12px 4px; border: 2px solid var(--ink); background: var(--manila, #e8d3a0); color: var(--ink); font: 400 1.2rem/1 var(--f-title); white-space: nowrap; }
.panels-goal { display: flex; align-items: center; gap: 8px; margin: 0; text-align: left; padding: 8px 14px 6px; border: 2.5px solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); font-weight: 700; }
.panels-goal .ico { width: 20px; height: 20px; flex: none; }
.dialog .panels-goal b { flex: none; color: var(--ink); }
@media (max-width: 720px) {
  .panels { grid-template-columns: 1fr; gap: 10px; }
  .panel { grid-template-columns: 120px 1fr; grid-template-rows: auto; }
  .panel-art { height: 110px; border-bottom: 0; border-right: 3px solid var(--ink); }
  .panel-art > .standee { width: 84px; }
  .panel-foes .standee, .panel-foes.n2 .standee, .panel-foes.n3 .standee, .panel-foes.n4 .standee { width: 64px; margin: 0 -10px; }
  .panel figcaption { align-self: center; font-size: 1rem; }
  .panel-stamp { font-size: 1.2rem; }
  .panel-tag { font-size: 0.9rem; white-space: normal; text-align: center; }
}

/* Die Trying: a tale's stars on the results, under the winner */
.tale-strip { display: grid; gap: 6px; margin-top: 8px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: rgba(246, 238, 219, 0.92); color: var(--ink); }
.ts-title { font: 400 var(--t-lg)/1 var(--f-title); }
.ts-stars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ts-star { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: var(--t-xs); line-height: 1.15; color: var(--ink-soft); }
.ts-star .ico { flex: none; width: 24px; height: 24px; color: rgba(43, 33, 24, 0.2); }
.ts-star.kept .ico { color: #d9c08a; }
.ts-star.on { color: var(--ink); font-weight: 700; }
.ts-star.on .ico { color: #e8a91f; filter: drop-shadow(1px 1px 0 var(--ink)); }
.ts-star.new .ico { animation: star-pop 0.6s 0.9s cubic-bezier(0.3, 1.8, 0.5, 1) both; }
@keyframes star-pop { from { transform: scale(0.2) rotate(-60deg); } }
.ts-next { font-size: var(--t-sm); }
.ts-next b { color: var(--red); }

/* the Altar: every face-up Offering, with its owner above and the button to take it below */
.altar-offers { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.altar-offer { display: grid; justify-items: center; gap: 8px; --w: 150px; }
.altar-who { display: inline-flex; align-items: center; gap: 4px; font: 400 var(--t-md)/1 var(--f-title); }
.altar-who small { font: 600 var(--t-xs)/1 var(--f-body); color: var(--ink-soft); }
.altar-offer.rec .tcg { box-shadow: 0 0 0 4px var(--yellow), var(--hard); }
/* the Offerings slot in the Crypt: the pile's glyphs fanned out */
.ks-pile { display: flex; align-items: center; justify-content: center; gap: 0; }
.ks-pile .lodge-ico { width: 40px; height: 40px; margin: 0 -6px; }
.ks-pile .lodge-ico:nth-child(2) { transform: translateY(-6px) rotate(6deg); }
.ks-pile .lodge-ico:nth-child(3) { transform: rotate(-6deg); }
/* the shop sheet on a night the Altar is open */
.market-altar { display: flex; align-items: center; gap: 10px; max-width: none; padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: #ddd6c6; }
.market-altar .glyph { width: 34px; height: 34px; flex: none; }
.market-altar span { flex: 1; font-size: var(--t-sm); }
/* sharing a result: the card as it will look, then where it goes */
.dialog.share { width: min(680px, calc(100vw - 32px)); }
.share-img { display: block; width: 100%; height: auto; margin: 4px 0 6px; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); }
.dialog.share a.cta { text-decoration: none; }

/* The piece that's new at this table (the ladder): a glow and a New stamp until it's tapped. */
.new-here { animation: new-here 1.6s ease-in-out infinite; border-radius: var(--wobble-sm); }
.city-pill.new-here, .me-agenda.new-here, .icon-btn.new-here { position: relative; }
.new-here::after { content: 'New'; position: absolute; top: -9px; right: -6px; z-index: 6; padding: 3px 6px 1px; border: 2px solid var(--ink); border-radius: 4px; background: var(--yellow); color: var(--ink); font: 400 0.8rem/1 var(--f-title); letter-spacing: 0.05em; text-transform: uppercase; transform: rotate(6deg); box-shadow: 1px 2px 0 var(--ink); pointer-events: none; }
@keyframes new-here { 50% { box-shadow: 0 0 0 4px rgba(255, 209, 64, 0.85), 0 0 18px rgba(255, 209, 64, 0.6); } }
@media (prefers-reduced-motion: reduce) { .new-here { animation: none; box-shadow: 0 0 0 4px rgba(255, 209, 64, 0.85); } }

/* playtest notes (?playtest): a quiet button bottom left, and the notes as plain text to copy */
.pt-btn { position: fixed; left: 8px; bottom: 8px; z-index: 9999; font: inherit; font-size: 12px; padding: 4px 9px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); color: var(--ink); opacity: 0.7; cursor: pointer; }
.pt-btn:hover { opacity: 1; }
.pt-dlg { width: min(720px, calc(100vw - 32px)); border: 3px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 14px; }
.pt-dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.pt-dlg textarea { width: 100%; height: min(60vh, 480px); font: 12px/1.45 ui-monospace, monospace; resize: none; box-sizing: border-box; }
.pt-dlg div { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* TCG cards: 5:7 like their physical counterparts (2.5 x 3.5 in). Everything scales with --w. */
.tcg {
  --u: calc(var(--w, 150px) / 100);
  appearance: none;
  position: relative;
  flex: none;
  width: var(--w, 150px);
  aspect-ratio: 5 / 7;
  display: grid;
  grid-template-rows: calc(var(--u) * 15) calc(var(--u) * 50) auto minmax(0, 1fr);
  gap: calc(var(--u) * 2.6);
  padding: calc(var(--u) * 4);
  border: max(2px, calc(var(--u) * 1.7)) solid var(--ink);
  border-radius: calc(var(--u) * 6);
  background-color: var(--manila);
  background-image: var(--paper-grain);
  box-shadow: var(--hard);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}
.tcg-name { display: flex; align-items: center; min-width: 0; padding-left: calc(var(--u) * 21); font: 400 calc(var(--u) * 12)/0.95 var(--f-title); font-size-adjust: 0.5; letter-spacing: 0.01em; }
.tcg-name.long { font-size: calc(var(--u) * 9.6); }
.tcg-art { display: block; overflow: hidden; border: max(1.5px, calc(var(--u) * 1.3)) solid var(--ink); border-radius: calc(var(--u) * 3.5); }
.tcg-art .art .glyph { height: 78%; }
.tcg-type { display: flex; gap: calc(var(--u) * 2.5); align-items: center; font: 400 calc(var(--u) * 6.4)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; }
.tcg-type i { font-style: normal; padding: calc(var(--u) * 1) calc(var(--u) * 2.5) calc(var(--u) * 0.6); border: max(1px, calc(var(--u) * 1)) solid var(--red); border-radius: calc(var(--u) * 1.5); color: var(--red); background: rgba(251, 247, 236, 0.85); }
.tcg.file .tcg-type i { color: var(--blue); border-color: var(--blue); }
.tcg-type i.city { color: var(--ink); border-color: var(--ink); }
.tcg-text { min-height: 0; overflow: hidden; padding: calc(var(--u) * 3) calc(var(--u) * 3.6); border: max(1px, calc(var(--u) * 0.9)) solid rgba(43, 33, 24, 0.35); border-radius: calc(var(--u) * 2.5); background: var(--label); font: 600 calc(var(--u) * 8.6)/1.24 var(--f-body); }
.tcg-text em { display: block; margin-top: calc(var(--u) * 3); color: var(--paper-dim); font-weight: 400; font-size: 0.88em; }
.tcg-cost { position: absolute; top: calc(var(--u) * -5); left: calc(var(--u) * -5); z-index: 2; width: calc(var(--u) * 25); height: calc(var(--u) * 25); display: grid; place-items: center; border: max(2px, calc(var(--u) * 1.7)) solid #5c3d05; border-radius: 50%; color: #3d2604;
  /* a gold coin, like the Gold icon: a bright face, a deep rim, a shine top left */
  background: radial-gradient(circle at 34% 28%, #fff4c2 0 9%, #f7c932 30%, #eab625 62%, #c8920f 100%);
  box-shadow: inset 0 0 0 calc(var(--u) * 1.5) #c8920f, inset 0 0 0 calc(var(--u) * 2.4) #f2c02c, var(--shadow-sm); }
.tcg-cost .ico { display: none; }
.tcg-cost b { position: relative; padding-top: calc(var(--u) * 1.5); text-shadow: 0 calc(var(--u) * 0.8) 0 rgba(255, 244, 194, 0.75); font: 400 calc(var(--u) * 14)/1 var(--f-title); font-size-adjust: 0.55; }
.tcg-cost s { position: absolute; bottom: calc(var(--u) * -6); padding: 0 calc(var(--u) * 2); border: max(1px, calc(var(--u) * 1)) solid var(--ink); border-radius: calc(var(--u) * 3); background: var(--paper); color: var(--paper-dim); font: 800 calc(var(--u) * 6)/1.3 var(--f-body); }
.tcg.op { background-color: #f1d9bd; }
.tcg.file { background-color: #d9dfdf; }
.tcg.contraband { background-color: #efc9bd; box-shadow: 0 0 0 max(2px, calc(var(--u) * 1.4)) var(--red), var(--hard); }
.tcg .cb-stamp { top: calc(var(--u) * 50); bottom: auto; right: calc(var(--u) * 3); font-size: calc(var(--u) * 5.2); }
.tcg .ribbon { position: absolute; top: calc(var(--u) * -7); right: calc(var(--u) * -4); z-index: 4; padding: calc(var(--u) * 2) calc(var(--u) * 4) calc(var(--u) * 1); border: max(2px, calc(var(--u) * 1.5)) solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); font: 400 calc(var(--u) * 8)/1 var(--f-title); transform: rotate(4deg); box-shadow: var(--shadow-sm); }
.tcg-foot { position: absolute; left: 50%; bottom: 0; z-index: 3; transform: translate(-50%, 55%); white-space: nowrap; padding: calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * 1.4); border: max(1.5px, calc(var(--u) * 1.4)) solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper-2); font: 800 calc(var(--u) * 7)/1 var(--f-body); box-shadow: var(--shadow-sm); }
.tcg-foot.go { background: var(--yellow); font: 400 calc(var(--u) * 10)/1 var(--f-title); }
.tcg-foot.ok { background: #cfe3c0; }
.tcg:disabled { cursor: default; }
.tcg.cant { opacity: 0.72; }
.tcg.can:hover, .tcg.idle:hover, .tcg.place:hover { transform: translateY(-3px) rotate(-0.6deg); box-shadow: var(--hard-lg); }
.tcg.best { box-shadow: 0 0 0 max(3px, calc(var(--u) * 2.4)) var(--yellow), var(--hard); }
/* the coach names the best pick; the ring and ribbon show only while you point at the cards */
:is(.desk-cards, .shop-cards, .market-cards):not(:hover) > .tcg.best:not(:focus-visible) { box-shadow: var(--hard); }
:is(.desk-cards, .shop-cards, .market-cards):not(:hover) > .tcg.best:not(:focus-visible) .ribbon { visibility: hidden; }
.tcg.empty { display: grid; place-items: center; border-style: dashed; border-color: rgba(246, 238, 219, 0.4); background: rgba(246, 238, 219, 0.06); box-shadow: none; color: var(--on-night-dim); font: 400 calc(var(--u) * 6)/1 var(--f-doc); letter-spacing: 0.1em; text-transform: uppercase; cursor: default; }

/* the deck, face down */
.tcg.back { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; align-items: center; padding: calc(var(--u) * 6) calc(var(--u) * 6) calc(var(--u) * 10); background: radial-gradient(circle at 50% 40%, #2b3550, #141826 72%); color: var(--paper); }
.tcg.back::before { content: ""; position: absolute; inset: calc(var(--u) * 3.5); border: max(1px, calc(var(--u) * 0.9)) solid rgba(233, 184, 76, 0.55); border-radius: calc(var(--u) * 4); pointer-events: none; }
.back-mark { width: 82%; }
.back-mark svg { width: 100%; height: auto; display: block; }
.back-label { font: 700 calc(var(--u) * 8.5)/1 var(--f-brand); letter-spacing: 0.16em; text-transform: uppercase; color: #d9ad52; }
.back-count { margin-top: calc(var(--u) * 2); font: 400 calc(var(--u) * 5.6)/1 var(--f-doc); letter-spacing: 0.08em; color: var(--on-night-dim); }
.tcg.back:not(:disabled):hover { transform: translateY(-3px); box-shadow: var(--hard-lg); }

/* a location card (a Site) */
.tcg.place { grid-template-rows: calc(var(--u) * 15) calc(var(--u) * 52) auto minmax(0, 1fr); background-color: var(--label); }
.tcg.place .tcg-name { padding-left: 0; justify-content: center; text-align: center; }
.tcg.place .tcg-art { position: relative; display: grid; place-items: center; background: linear-gradient(180deg, #1b2030 0%, #343552 55%, #5f4c66 100%); }
.place-ico { display: grid; place-items: center; width: calc(var(--u) * 34); height: calc(var(--u) * 34); border: max(2px, calc(var(--u) * 1.6)) solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-sm); }
.place-ico .ico { width: 62%; height: 62%; }
.tcg-need { display: flex; justify-content: center; gap: calc(var(--u) * 2); }
.tcg-need .nd { width: calc(var(--u) * 12); height: calc(var(--u) * 12); border-width: max(1px, calc(var(--u) * 1.1)); border-radius: 22%; font-size: calc(var(--u) * 8.5); }
.tcg-need .nd .ico { width: 72%; height: 72%; }
.tcg.place .tcg-text { display: grid; place-items: center; padding-bottom: calc(var(--u) * 9); text-align: center; font-size: calc(var(--u) * 9.2); }
.tcg-holder { position: absolute; left: 50%; bottom: 0; z-index: 3; transform: translate(-50%, 50%); display: grid; place-items: center; }
.tcg-holder .seal { width: calc(var(--u) * 26); height: calc(var(--u) * 26); margin: 0; box-shadow: 0 0 0 max(2px, calc(var(--u) * 1.8)) var(--soc), var(--shadow-sm); }
.tcg-holder .secret { display: grid; place-items: center; width: calc(var(--u) * 22); height: calc(var(--u) * 22); border: max(2px, calc(var(--u) * 1.6)) solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c8574a, var(--red-2)); color: #f6dcd2; font: 400 calc(var(--u) * 13)/1 var(--f-title); padding-top: calc(var(--u) * 1.5); }
.tcg-holder > .ico { width: calc(var(--u) * 24); height: calc(var(--u) * 24); color: #d65a2f; }
.tcg.place.held { background-color: color-mix(in srgb, var(--soc) 26%, var(--label)); }
.tcg.place.held .place-ico { background: var(--soc); color: var(--paper); }
/* a Curse works against whoever is in the Hot Seat */
.site-bad { position: absolute; left: calc(var(--u) * 2); top: calc(var(--u) * 2); z-index: 1; padding: calc(var(--u) * 1.4) calc(var(--u) * 2.6) calc(var(--u) * 0.8); border: max(1px, calc(var(--u) * 0.9)) solid var(--ink); border-radius: calc(var(--u) * 1.6); background: var(--red); color: var(--paper); font: 400 calc(var(--u) * 5.2)/1 var(--f-doc); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.tcg.site.bad { background-color: #e7b6a6; }
.tcg.site.bad .site-pw { background: var(--red); color: var(--paper); }
.tcg.site.bad .tcg-text { color: var(--red-2); }
/* a Site: its art over the place's colours, its keyword, and the power it gives whoever is in the Hot Seat */
.tcg.site .tcg-art { display: block; }
.site-art { position: absolute; inset: 0; display: grid; place-items: center; }
.site-art .glyph { width: 78%; height: 78%; }
.site-key { position: absolute; z-index: 1; display: flex; align-items: center; gap: calc(var(--u) * 1); padding: calc(var(--u) * 1.4) calc(var(--u) * 2.6) calc(var(--u) * 0.8); border: max(1px, calc(var(--u) * 0.9)) solid var(--ink); border-radius: calc(var(--u) * 1.6); background: var(--paper); font: 400 calc(var(--u) * 5.2)/1 var(--f-doc); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.site-key { right: calc(var(--u) * 2); top: calc(var(--u) * 2); background: #5d6b80; color: var(--paper); }
.site-key .ico { width: calc(var(--u) * 6); height: calc(var(--u) * 6); }
.k-payoff .site-key { background: var(--c-bm); }
.site-pw { position: absolute; right: calc(var(--u) * 2); bottom: calc(var(--u) * 2); z-index: 1; display: grid; place-items: center; width: calc(var(--u) * 15); height: calc(var(--u) * 15); border: max(1.5px, calc(var(--u) * 1.2)) solid var(--ink); border-radius: 50%; background: var(--paper); }
.site-pw .ico { width: 64%; height: 64%; }
.tcg.site.held { background-color: color-mix(in srgb, var(--soc) 26%, var(--label)); }
.tcg.site.held .site-pw { background: var(--soc); color: var(--paper); }
.tcg-holder .vacant { display: grid; place-items: center; width: calc(var(--u) * 20); height: calc(var(--u) * 20); border: max(2px, calc(var(--u) * 1.6)) solid var(--ink); border-radius: 50%; background: var(--paper-2); color: var(--paper-dim); }
.tcg-holder .vacant .ico { width: 58%; height: 58%; }
.tcg.place.ready { box-shadow: 0 0 0 max(3px, calc(var(--u) * 2.6)) var(--yellow), var(--hard); animation: lm-ready 1.4s ease-in-out infinite; }
@keyframes lm-ready { 50% { box-shadow: 0 0 0 max(3px, calc(var(--u) * 2.6)) var(--yellow), 0 0 calc(var(--u) * 14) rgba(233, 184, 76, 0.8), var(--hard); } }
.tcg.place .lm-ready { position: absolute; top: calc(var(--u) * -8); left: 50%; z-index: 4; transform: translateX(-50%) rotate(-3deg); white-space: nowrap; padding: calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * 1); border: max(2px, calc(var(--u) * 1.5)) solid var(--ink); border-radius: var(--wobble-sm); background: var(--yellow); font: 400 calc(var(--u) * 9)/1 var(--f-title); box-shadow: var(--shadow-sm); }
/* the Site a story has you protect */
.tcg.place .lm-guard { position: absolute; top: calc(var(--u) * -8); left: 50%; z-index: 3; display: inline-flex; align-items: center; gap: calc(var(--u) * 2); transform: translateX(-50%) rotate(2deg); white-space: nowrap; padding: calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * 1); border: max(2px, calc(var(--u) * 1.5)) solid var(--ink); border-radius: var(--wobble-sm); background: var(--green); color: var(--paper); font: 400 calc(var(--u) * 9)/1 var(--f-title); box-shadow: var(--shadow-sm); }
.tcg.place .lm-guard .ico { width: calc(var(--u) * 10); height: calc(var(--u) * 10); }
.tcg.place.burning { animation: lm-burn 0.25s steps(2) 5; }
@keyframes lm-burn { 50% { filter: brightness(1.6) saturate(1.4); transform: rotate(-1deg); } }
.tcg.place.peek { box-shadow: 0 0 0 max(3px, calc(var(--u) * 2.4)) var(--blue), var(--hard); }
.place[data-city="area51"] .tcg-art { background: linear-gradient(180deg, #131c1b 0%, #2b453d 55%, #6c7a52 100%); }
.place[data-city="antarctica"] .tcg-art { background: linear-gradient(180deg, #111a26 0%, #2b4862 60%, #6d97b4 100%); }
.place[data-city="waco"] .tcg-art { background: linear-gradient(180deg, #2a2a36 0%, #6a5244 55%, #c99a62 100%); }
.place[data-city="jonestown"] .tcg-art { background: linear-gradient(180deg, #14281f 0%, #2f5a40 55%, #a9b07a 100%); }
.place[data-city="jekyll"] .tcg-art { background: linear-gradient(180deg, #232443 0%, #714d70 52%, #e4a676 100%); }
.place[data-city="camphero"] .tcg-art { background: linear-gradient(180deg, #0d111d 0%, #1f2a3c 55%, #3e5a5c 100%); }
.place[data-city="dealey"] .tcg-art { background: linear-gradient(180deg, #2b5f92 0%, #69a3cf 55%, #efe2b0 100%); }

/* where the cards sit: the desk (a 2x2 with the deck), the board's foot, a phone's shop row */
.desk-cards { --w: 146px; display: grid; grid-template-columns: repeat(2, var(--w)); justify-content: space-between; align-content: start; gap: 22px 12px; padding: 8px 4px 14px; }
.lm-row { --w: 118px; position: relative; z-index: 3; display: flex; justify-content: space-evenly; align-items: end; min-width: 0; margin-top: -128px; padding-bottom: 8px; pointer-events: none; }
.lm-row .tcg { pointer-events: auto; }
.lm-row .tcg:nth-child(1) { transform: rotate(-2deg); }
.lm-row .tcg:nth-child(3) { transform: rotate(2deg); }
.lm-row[data-n="1"] .tcg { transform: none; }
.lm-row .tcg:hover { transform: translateY(-4px); }
.board .capital { padding-top: 10px; padding-bottom: 128px; }
.board { row-gap: 6px; }
.shop-cards { --w: min(136px, calc((100vw - 92px) / 3)); display: flex; justify-content: space-between; gap: 6px; padding: 12px 2px 16px; }
.tcg-zoom { position: absolute; z-index: 6; pointer-events: none; animation: zoom-in 0.14s ease-out both; filter: drop-shadow(4px 8px 0 rgba(10, 7, 5, 0.45)); }
.tcg-zoom .tcg { transform: none !important; animation: none; }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.9); } }
.tcg-solo { --w: 260px; display: grid; justify-items: center; padding: 8px 0 14px; }
.tcg-solo .tcg { cursor: default; }
.tcg-solo .tcg.dossier { grid-template-rows: calc(var(--u) * 15) calc(var(--u) * 42) auto minmax(0, 1fr); }
.tcg-solo.small { --w: 160px; padding: 4px 0 14px; }

/* the shop as one decision */
.dialog.market { width: min(780px, calc(100vw - 32px)); }
.market-head { display: flex; align-items: center; gap: 12px; padding-right: 44px; }
.market-cards { --w: 206px; display: flex; justify-content: center; gap: 22px; margin: 18px 0 8px; }
.market-slot { display: grid; justify-items: center; align-content: start; gap: 18px; min-width: 0; }
.market-slot .cta { min-width: 70%; }
.market-pv { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 4px; max-width: var(--w); font-size: var(--t-xs); text-align: center; }
.market-pv .ico { width: 14px; height: 14px; }
.market-pv .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--paper-dim); margin: 0 3px; }

/* the whispers: what just happened, in plain type */
.ticker { list-style: none; margin: 0; padding: 10px 12px 12px; display: grid; align-content: start; gap: 9px; min-height: 0; overflow: hidden; border: 2.5px solid var(--ink); border-radius: var(--wobble); background-color: var(--paper); background-image: var(--paper-grain); box-shadow: var(--hard); }
.ticker::before { content: "Whispers"; padding-bottom: 6px; border-bottom: 1.5px dashed rgba(43, 33, 24, 0.35); color: var(--red); font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.16em; text-transform: uppercase; }
.ticker:empty { visibility: hidden; } /* the Whispers wait for the first one */
.ticker li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; color: var(--ink); font: 600 0.9rem/1.3 var(--f-body); cursor: pointer; }
.ticker li.old { color: #4d4237; font-size: 0.84rem; }
.ticker li:nth-child(n+3) { opacity: 0.75; }
.wire-ico { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; color: var(--paper-dim); }
.wire-ico .ico { width: 17px; height: 17px; }
.ticker .k-capital .wire-ico { color: var(--c-inf); }
.ticker .k-bad .wire-ico, .ticker .k-expose .wire-ico { color: var(--c-loss); }
.ticker .k-buy .wire-ico { color: var(--c-bm); }
.ticker .k-warn .wire-ico { color: #c96b2c; }
.ticker .k-good .wire-ico { color: var(--green-ink, #4d7a3a); }

/* shared pieces carried over from the old cards: art, combo dice, preview chips */
.lm-need { display: flex; align-items: center; gap: 3px; min-width: 0; white-space: nowrap; }
.lm-need small { margin-left: 4px; font: 400 0.68rem/1 var(--f-doc); color: var(--paper-dim); }
.lm-need.inline { display: inline-flex; vertical-align: -4px; margin: 0 2px; }
.nd { flex: none; width: 17px; height: 17px; display: inline-grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 4px 3px 4px 3px; background: var(--die-2); font: 400 0.82rem/1 var(--f-title); font-style: normal; color: var(--ink); }
.nd .ico { width: 12px; height: 12px; }
.nd.f-leak { color: var(--c-hit); }
.nd.f-cash { color: var(--c-bm); }
.nd.f-heal { color: var(--c-sec); }
.nd.have { background: var(--yellow); }
@keyframes flicker { 33% { transform: scale(1.08) rotate(-4deg); } 66% { transform: scale(0.95) rotate(3deg); } }
.art { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle, rgba(43, 33, 24, 0.22) 1.05px, transparent 1.45px) 0 0 / 6px 6px, linear-gradient(160deg, var(--c1), var(--c2)); }
.art .glyph { height: 82%; width: auto; max-width: 90%; display: block; filter: drop-shadow(1px 2px 0 rgba(43, 33, 24, 0.35)); }
.card-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 4px 7px; border: 2px dashed rgba(43, 33, 24, 0.35); border-radius: 8px; background: var(--c-bm-wash); font-size: var(--t-xs); font-weight: 800; line-height: 1.3; }
.card-preview .ico { width: 14px; height: 14px; margin-right: 1px; }
.card-preview b { color: var(--red); }
.card-preview .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--paper-dim); margin: 0 3px; }

/* mini cards: where space is short (M's desk and board, phone landmarks) the rules text hides; hover or tap for the full card */
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg:not(.back) { grid-template-rows: calc(var(--u) * 17) minmax(0, 1fr) auto; }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg .tcg-text { display: none; }
:is(html[data-view="m"] .lm-row, html[data-view="s"] .lm-row) .tcg.place { padding-bottom: calc(var(--u) * 15); }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg-name { font-size: calc(var(--u) * 13); }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg-name.long { font-size: calc(var(--u) * 10.5); }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg-type { font-size: calc(var(--u) * 8); }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg-foot { font-size: calc(var(--u) * 8.5); }
:is(html[data-view="m"] .desk-cards, html[data-view="m"] .lm-row, html[data-view="s"] .lm-row, .hold-cards) .tcg-foot.go { font-size: calc(var(--u) * 11); }

/* longer rules set a little tighter so they always fit the box above the status tab */
/* a card on the table shows its short label, big and centred; the full text is a tap away */
.tcg-text.brief { display: flex; align-items: center; justify-content: center; text-align: center; font-size: calc(var(--u) * 11); line-height: 1.15; }
.tcg-text.full { display: none; }
.tcg-zoom .tcg-text.brief { display: none; }
.tcg-zoom .tcg-text.full { display: block; }
.tcg-text.dense { font-size: calc(var(--u) * 7.7); line-height: 1.2; }
.tcg-text.denser { font-size: calc(var(--u) * 6.9); line-height: 1.18; }
.desk-cards .tcg.dossier { grid-template-rows: calc(var(--u) * 15) calc(var(--u) * 42) auto minmax(0, 1fr); }
.desk-cards .tcg-text, .shop-cards .tcg-text { padding-bottom: calc(var(--u) * 7); }

/* your hand (L and M): owned cards at a smaller size, the same 5:7 shape */
.hold-cards .tcg-cost { display: none; }
.hold-cards .tcg.idle:hover { transform: translateY(-6px); box-shadow: var(--hard-lg); }
/* what you brought from the Lodge, as cards: brass for an Operative, gold for a Relic, red for Contraband */
.tcg.kit { cursor: default; }
.tcg.kit .art .glyph { height: 70%; }
.tcg.kit .tcg-type i { color: #7a5a14; border-color: #7a5a14; }
.tcg.k-operative { background-color: #e6d6a6; }
.tcg.k-relic { background-color: #efd88a; }
.tcg.k-contraband { background-color: #efc9bd; }
.tcg.k-contraband .tcg-type i { color: var(--red); border-color: var(--red); }
.tcg.kit.can { cursor: pointer; box-shadow: 0 0 0 max(3px, calc(var(--u) * 2.4)) var(--yellow), var(--hard); animation: lm-ready 1.4s ease-in-out infinite; }
.tcg.kit.used { opacity: 0.5; filter: grayscale(1); }

/* the Altar card in the Boneyard: stone grey, a price that depends on what you take */
.tcg.altar { background-color: #d8d2c4; }
.tcg.altar .tcg-cost { background: radial-gradient(circle at 34% 28%, #f4f1ea 0 9%, #c9c3b4 40%, #8f8878 100%); border-color: #3d372c; box-shadow: var(--shadow-sm); }
.tcg.altar .tcg-type i { color: var(--ink); border-color: var(--ink); }

/* Three first-class views, chosen by the interface from the window's shape (html[data-view]):
   L  desktop: a 1600x900 composition scaled to fit; spare width or height goes to the board.
   M  small landscape (tablets, small laptops): its own 1180x760 composition, scaled the same way.
   S  phones and portrait screens: a fluid stack with a sticky player board.
   The table pieces are the same in every view; only their arrangement and size change. */

/* ---------- L ---------- */
html[data-view="l"] .game, html[data-view="m"] .game { position: fixed; left: 0; top: 0; transform-origin: 0 0; }
html[data-view="l"] .game {
  grid-template-columns: 250px minmax(0, 1fr) 318px;
  grid-template-rows: 52px minmax(0, 1fr) 280px;
  grid-template-areas: "top top top" "rail board desk" "mat mat mat";
  gap: 12px 18px;
  padding: 10px 16px 14px;
}
.rail { grid-area: rail; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; min-width: 0; min-height: 0; }
html[data-view="l"] .seats { padding-top: 16px; }
/* the header is a band across the whole table: the brand, the race, the menu. The rail below is all yours. */
:is(html[data-view="l"], html[data-view="m"]) .topbar { margin: -10px -16px 0; padding: 0 16px; border-bottom: 2px solid rgba(233, 184, 76, 0.28); background: linear-gradient(180deg, rgba(8, 6, 12, 0.72), rgba(8, 6, 12, 0.45)); }
html[data-view="m"] .topbar { margin: -8px -14px 0; padding: 0 14px; }
/* M is narrow: the checklist keeps its count and the next lesson, the coach's goal line drops its kicker */
html[data-view="m"] .lessons { width: 250px; }
html[data-view="m"] .lessons-pips, html[data-view="m"] .lessons-text i { display: none; }
html[data-view="m"] .coach-label.coach-goal { font-size: 1.05rem; }
html[data-view="m"] .coach-label.coach-goal small { display: none; }
html[data-view="l"] .rail-head { display: none; }
html[data-view="l"] .rail { grid-template-rows: auto minmax(0, 1fr); }
/* the scene makes room on its left for the Omen card */
html[data-view="l"] .board .capital { padding-left: 160px; }
html[data-view="l"] .seats .seat.mine, html[data-view="m"] .seats .seat.mine { display: none; }
/* The player board: your ID | the dice, with the buttons right under them | the handler's note over your hand of cards.
   The buttons sit beneath the dice so the hand never travels far between keeping dice and rolling or scoring. */
html[data-view="l"] .mat {
  grid-template-columns: 300px 700px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "me tray coach" "me tray holdings" "me actions holdings";
  gap: 10px 18px;
}
.mat .coach { grid-area: coach; align-self: start; }
/* Coach Off: the handler leaves the table, and on L and M your hand takes the whole column (rivals talk in their tray);
   a phone gives the room to the dice (the name over the tray still says whose turn it is) */
.game.no-coach:not(.coach-pop) .mat .coach { display: none; }
/* Quiet: a slip warning floats over your hand (on a phone, just above your board), so nothing under it moves */
.game.no-coach.coach-pop .mat .coach { position: absolute; top: 12px; right: 16px; z-index: 20; width: min(460px, calc(100% - 32px)); pointer-events: none; animation: rise 0.2s ease both; }
html[data-view="s"] .game.no-coach.coach-pop .mat .coach { top: auto; left: 9px; right: 9px; bottom: calc(100% + 6px); width: auto; }
.game.no-coach.coach-pop .coach p { min-height: 0; }
html[data-view="s"] .game.no-coach .mat { grid-template-areas: "tray" "actions"; }
:is(html[data-view="l"], html[data-view="m"]) .game.no-coach .mat { grid-template-areas: "me tray holdings" "me tray holdings" "me actions holdings"; }
html[data-view="l"] .hold-cards.big { --w: 124px; }
html[data-view="m"] .hold-cards.big { --w: 82px; }
html[data-view="m"] .game.no-coach .holdings { padding-top: 10px; } /* clear of the Boneyard's last card foot above */
.mat .actions { grid-area: actions; }
.mat .holdings { grid-area: holdings; }
html[data-view="l"] .tray .hand, html[data-view="m"] .tray .hand { display: none; }
html[data-view="l"] .shop-zone, html[data-view="m"] .shop-zone { display: none !important; }
/* L and M trays: whose turn and the score preview share the top line; the dice fill the rest */
:is(html[data-view="l"], html[data-view="m"]) .tray { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "who chips" "dice dice"; align-content: start; column-gap: 14px; }
:is(html[data-view="l"], html[data-view="m"]) .tray .who { grid-area: who; }
:is(html[data-view="l"], html[data-view="m"]) .tray .chips { grid-area: chips; justify-content: flex-end; min-height: 0; padding-bottom: 0; }
:is(html[data-view="l"], html[data-view="m"]) .tray .dice-row { grid-area: dice; }
:is(html[data-view="l"], html[data-view="m"]) .fuse { top: -15px; right: 20px; }
:is(html[data-view="l"], html[data-view="m"]) .actions { justify-content: center; }
:is(html[data-view="l"], html[data-view="m"]) .actions .cta { max-width: 340px; }
:is(html[data-view="l"], html[data-view="m"]) .me-kit, :is(html[data-view="l"], html[data-view="m"]) .me .hand { display: none !important; }

/* ---------- M ---------- */
html[data-view="m"] .game {
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-rows: 46px auto minmax(0, 1fr) 236px;
  grid-template-areas: "top top" "rail rail" "board desk" "mat mat";
  gap: 10px 14px;
  padding: 8px 14px 12px;
}
html[data-view="m"] .rail { grid-template-rows: auto; }
html[data-view="m"] .rail-head, html[data-view="m"] .ticker { display: none; }
html[data-view="m"] .seats { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; padding-top: 14px; }
html[data-view="m"] .seat { --dial: 40px; padding-left: 62px; background: linear-gradient(90deg, var(--soc) 0 52px, var(--ink) 52px 54.5px, transparent 54.5px), var(--paper-grain), var(--paper); }
html[data-view="m"] .seat::before { width: 52px; }
html[data-view="m"] .seat-portrait { width: 54px; }
html[data-view="m"] .seat-name { font-size: 1.15rem; }
html[data-view="m"] .mat {
  grid-template-columns: 250px 540px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "me tray coach" "me tray holdings" "me actions holdings";
  gap: 8px 14px;
  padding: 12px 14px 14px;
}
html[data-view="m"] .coach-ico, html[data-view="m"] .coach-body::before, html[data-view="m"] .coach-body::after { display: none; }
html[data-view="m"] .me { grid-template-columns: 78px minmax(0, 1fr); }
html[data-view="m"] .me-photo .standee { width: 76px; }
html[data-view="m"] .me .dials { --dial: 52px; }
html[data-view="m"] .board { padding: 40px 42px 10px; }
html[data-view="m"] .omen { left: 54px; top: 80px; --w: 96px; }
html[data-view="m"] .board .capital { padding-left: 124px; }
html[data-view="m"] .tc { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: 0.7rem; }
html[data-view="m"] .tc.five { width: 27px; height: 27px; margin: -13.5px 0 0 -13.5px; font-size: 0.95rem; }
html[data-view="m"] .tc.goal-cell { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
html[data-view="m"] .track-mark .seal { width: 28px; height: 28px; }
html[data-view="m"] .track-mark { margin: -14px 0 0 -14px; }
html[data-view="m"] .dice { --die: 58px; gap: 26px 10px; }
html[data-view="m"] .coach p { min-height: 66px; font-size: var(--t-sm); }
html[data-view="m"] .rival-tray { width: 300px; }
html[data-view="m"] .actions .cta.big { font-size: 1.5rem; }
html[data-view="m"] .actions .cta { font-size: 1.3rem; }
html[data-view="m"] .rival-tray::before { left: 30px; top: -14px; border: 9px solid transparent; border-bottom: 13px solid var(--ink); border-top: 0; }

/* ---------- S ---------- */
html[data-view="s"] .game {
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "rail" "board" "mat";
  gap: 8px;
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
}
html[data-view="s"] .logo, html[data-view="s"] .round, html[data-view="s"] .desk, html[data-view="s"] .me, html[data-view="s"] .rail-head, html[data-view="s"] .ticker, html[data-view="s"] .rival-tray { display: none !important; }
html[data-view="s"] .topbar { gap: 6px; }
html[data-view="s"] .goal { gap: 4px; padding: 3px 9px 2px; font-size: 0; }
/* the top bar's icon buttons are drawn small on a phone; their hit area reaches a thumb's 44px without moving anything */
html[data-view="s"] .topbar .icon-btn::after { content: ""; position: absolute; inset: -6px -2px; }
html[data-view="s"] .goal > .ico { width: 17px; height: 17px; }
html[data-view="s"] .goal b { font-size: 1.15rem; }
/* the first game's checklist as a count; the wish button gives up its progress text to make room */
html[data-view="s"] .lessons { flex: none; width: auto; padding: 3px 8px 2px; }
html[data-view="s"] .lessons-pips, html[data-view="s"] .lessons-text span { display: none; }
html[data-view="s"] .lessons-text b { margin: 0; font-size: 1.05rem; }
html[data-view="s"] .lessons-text b::before { content: "\2713\00a0"; }
html[data-view="s"] .topbar:has(.lessons) .ag-prog { display: none; }
html[data-view="s"] .coach-label.coach-goal { font-size: 1.02rem; }
html[data-view="s"] .top-actions { gap: 5px; }
html[data-view="s"] .top-actions .icon-btn { padding: 5px 7px; border-width: 2px; }
html[data-view="s"] .top-actions .icon-btn span:not(.sr-only) { display: none; }
/* a tap on the speed chip names the new speed under it for a moment, over the table */
html[data-view="s"] .speed-btn.named::before { content: attr(data-name); position: absolute; top: calc(100% + 7px); right: -4px; z-index: 30; padding: 4px 9px 3px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: var(--paper); color: var(--ink); font: 700 var(--t-sm)/1 var(--f-body); white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; animation: rise 0.15s ease; }
html[data-view="s"] .ag-prog { display: inline-block; max-width: 4.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* seats: three across, portrait overhanging a colour band */
html[data-view="s"] .seats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 6px; padding-top: 14px; }
html[data-view="s"] .seat { --dial: 34px; gap: 3px; min-height: 0; padding: 4px 4px 6px; border-width: 2px; background: linear-gradient(180deg, var(--soc) 0 22px, transparent 22px), var(--paper-grain), var(--paper); }
html[data-view="s"] .seat::before { right: 0; width: auto; height: 22px; bottom: auto; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
html[data-view="s"] .seat-portrait { top: -16px; bottom: auto; left: 1px; width: 38px; }
html[data-view="s"] .seat-head { min-height: 18px; padding-left: 38px; }
html[data-view="s"] .seat-name { font-size: 0.85rem; color: var(--paper); text-shadow: 1px 1px 0 var(--ink), -1px 0 0 var(--ink); }
html[data-view="s"] .seat-tag { display: none; }
html[data-view="s"] .seat-flag { top: -10px; right: 2px; font-size: 0.6rem; }
html[data-view="s"] .seat-pts { left: auto; top: auto; right: 3px; bottom: -9px; font-size: 0.55rem; padding: 1px 3px 0; }
html[data-view="s"] .dials { justify-content: space-between; gap: 2px; }
html[data-view="s"] .dial-ico { width: 15px; height: 15px; bottom: -5px; border-width: 1.5px; }
html[data-view="s"] .dial-ico .ico { width: 9px; height: 9px; }
html[data-view="s"] .dial-delta { top: -7px; right: -7px; font-size: 0.6rem; padding: 1px 3px 0; }
html[data-view="s"] .tokens { order: 0; margin-left: 0; align-items: center; }
html[data-view="s"] .tok { gap: 2px; padding: 1px 4px 0 2px; font-size: 0.72rem; border-width: 1.5px; }
html[data-view="s"] .tok .ico { width: 12px; height: 12px; }
html[data-view="s"] .tok-files { display: none; }
html[data-view="s"] .seat-crown { top: -18px; }
html[data-view="s"] .seat-crown .ico { width: 24px; height: 24px; }
html[data-view="s"] .seat.active::after { bottom: -10px; padding: 2px 5px 0; font-size: 0.7rem; }
html[data-view="s"] .seat-next { bottom: -9px; padding: 2px 5px 0; font-size: 0.66rem; }
html[data-view="s"] .seat-alert { top: -14px; font-size: 0.7rem; }
/* the board: the track runs along the top edge */
html[data-view="s"] .board { gap: 6px; padding: 30px 8px 8px; border-width: 2.5px; box-shadow: var(--hard); }
html[data-view="s"] .board::before { inset: 5px; }
html[data-view="s"] .tc { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-width: 1.5px; font-size: 0; }
html[data-view="s"] .tc.five { width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; font-size: 0.72rem; }
html[data-view="s"] .tc.goal-cell { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
html[data-view="s"] .tc.goal-cell .ico { width: 14px; height: 14px; }
html[data-view="s"] .track-mark { margin: -11px 0 0 -11px; }
html[data-view="s"] .track-mark .seal { width: 22px; height: 22px; border-width: 2px; }
html[data-view="s"] .capital { gap: 10px; padding: 6px 10px 8px; border-width: 2px; container-type: normal; }
html[data-view="s"] .cap-art { width: 84px; }
html[data-view="s"] .cap-vacant { padding: 5px 7px 2px; font-size: 0.95rem; }
html[data-view="s"] .cap-info { gap: 4px; }
html[data-view="s"] .cap-title { font-size: 0.8rem; }
html[data-view="s"] .cap-holder { font-size: 1.2rem; }
html[data-view="s"] .you-pill { padding: 2px 5px 0; font-size: 0.75rem; vertical-align: 3px; }
html[data-view="s"] .cap-perks { gap: 3px; }
html[data-view="s"] .cap-perks li { padding: 2px 7px 2px 3px; font-size: 0.7rem; }
html[data-view="s"] .cap-perks li:nth-child(3), html[data-view="s"] .city-pill { display: none; }
html[data-view="s"] .cap-perks .ico { width: 14px; height: 14px; }
html[data-view="s"] .cam { inset: 6px; padding: 6px 8px; font-size: 0.6rem; }
html[data-view="s"] .cam span:not(.cam-rec) { display: none; }
html[data-view="s"] .ufo { width: 64px; }
html[data-view="s"] .sky-moon { width: 30px; height: 30px; }
html[data-view="s"] .nd { width: 13px; height: 13px; border-width: 1px; font-size: 0.66rem; }
html[data-view="s"] .nd .ico { width: 9px; height: 9px; }
/* the player board: the note, the dice, the buttons; sticky at the bottom */
html[data-view="s"] .mat {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 5;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "coach" "tray" "actions";
  gap: 7px;
  padding: 8px 9px 9px;
}
html[data-view="s"] .coach { gap: 8px; }
html[data-view="s"] .coach-ico { width: 34px; height: 34px; }
html[data-view="s"] .coach-body { padding: 6px 9px 6px 26px; background-image: linear-gradient(90deg, transparent 15px, rgba(178, 59, 48, 0.4) 15px 16.5px, transparent 16.5px), var(--paper-grain); }
html[data-view="s"] .coach-label { font-size: 0.68rem; }
html[data-view="s"] .coach p { min-height: 38px; font-size: 0.86rem; line-height: 19px; background-image: repeating-linear-gradient(180deg, transparent 0 18px, rgba(76, 107, 143, 0.17) 18px 19px); }
html[data-view="s"] .tray { gap: 4px; padding: 6px 6px 2px; }
/* phones roll a rival's dice in your tray (there's no rival tray), so it stays lit for their turn */
html[data-view="s"] .game[data-turn="bot"] .tray { opacity: 1; filter: none; }
html[data-view="s"] .who-title { font-size: 1.05rem; }
html[data-view="s"] .who-sub { font-size: 0.78rem; }
html[data-view="s"] .who .seal { display: none; }
html[data-view="s"] .dice { --die: 42px; justify-content: center; gap: 26px 6px; padding: 12px 0 16px; }
html[data-view="s"] .die .face { border-width: 2px; }
html[data-view="s"] .die.kept { transform: translateY(-8px); }
html[data-view="s"] .die .cap { top: calc(100% + 7px); font-size: 0.55rem; letter-spacing: 0; }
html[data-view="s"] .die .kbadge { top: -8px; right: -8px; width: 20px; height: 20px; border-width: 2px; }
html[data-view="s"] .die .kbadge .ico { width: 11px; height: 11px; }
html[data-view="s"] .chips { justify-content: center; min-height: 0; padding-bottom: 4px; flex-wrap: wrap; }
html[data-view="s"] .chip-r { font-size: 0.8rem; padding: 3px 8px 2px 4px; }
html[data-view="s"] .actions .cta { padding: 10px 8px 8px; font-size: 1.35rem; }
html[data-view="s"] .actions .cta.big { font-size: 1.5rem; }
html[data-view="s"] .shop-zone { gap: 6px; }
html[data-view="s"] .banner { font-size: 2rem; padding: 8px 22px 6px 12px; }
html[data-view="s"] .banner .seal.lg { width: 46px; height: 46px; }
@media (max-height: 760px) {
  html[data-view="s"] .hand { display: none !important; }
  html[data-view="s"] .cap-art { width: 70px; }
  html[data-view="s"] .cap-perks li:nth-child(2) { display: none; }
  html[data-view="s"] .coach-ico { display: none; }
  html[data-view="s"] .coach-body::before, html[data-view="s"] .coach-body::after { display: none; }
}
/* dialogs on phones */
html[data-view="s"] .face-legend { grid-template-columns: minmax(0, 1fr); }
html[data-view="s"] .res { grid-template-columns: 20px 30px minmax(0, 1fr) auto 40px; }
html[data-view="s"] .res-inf { display: none; }
html[data-view="s"] .win-hero { gap: 8px 12px; padding-right: 0; }
html[data-view="s"] .win-text { display: contents; }
html[data-view="s"] .win-pic { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
html[data-view="s"] .win-text > * { grid-column: 1 / -1; }
html[data-view="s"] .win-text > h2 { grid-column: 2; padding-right: 28px; }
html[data-view="s"] .win-text > p:first-of-type { grid-column: 2; }
html[data-view="s"] .win-hero::before { height: 132px; background: repeating-conic-gradient(from 0deg at 56px 78%, var(--soc) 0deg 8deg, transparent 8deg 16deg); }
html[data-view="s"] .win-hero .standee { width: 80px; }
html[data-view="s"] .win-crown { margin-bottom: -12px; }
html[data-view="s"] .win-crown .ico { width: 34px; height: 34px; }
html[data-view="s"] .win-hero h2 { font-size: 2rem; }
html[data-view="s"] .win-hero p { font-size: 0.86rem; }
html[data-view="s"] .chart { grid-template-columns: minmax(0, 1fr) 50px; }
html[data-view="s"] .act-head h2 { font-size: 1.8rem; }
html[data-view="s"] .act-pick .city-thumb { height: 70px; }
html[data-view="s"] .timeline { grid-template-columns: minmax(0, 1fr); }
html[data-view="s"] .tl-act { grid-template-columns: 90px minmax(0, 1fr); align-items: center; }
html[data-view="s"] .tl-act .city-thumb { grid-row: span 2; height: 54px; }
html[data-view="s"] .act-results .res { grid-template-columns: 20px 30px minmax(0, 1fr) auto 36px; }
html[data-view="s"] .act-results .res-inf { display: none; }
html[data-view="s"] .res-places .pl { padding: 2px 3px 1px; font-size: 0.6rem; }
html[data-view="s"] .tray.shopping > :not(.shop-zone) { display: none !important; }

html[data-view="s"] .fuse { top: 8px; right: 10px; }
html[data-view="s"] .fuse-cord { width: 64px; }

/* the Lodge on phones: a full-height dialog, so switching tabs never resizes it; one panel at a time scrolls */
html[data-view="s"] .dialog.lodge { height: calc((100vh - 32px) / var(--mz)); }
html[data-view="s"] .lodge-panel:not(.on) { display: none; }
html[data-view="s"] .lodge-tabs { position: sticky; top: -26px; z-index: 2; gap: 3px; margin-inline: -4px; padding: 10px 0 0; background-color: var(--paper); background-image: var(--paper-grain); }
html[data-view="s"] .lodge-tab { flex: 1 1 0; justify-content: center; gap: 3px; min-width: 0; padding: 9px 2px 7px; font-size: 0.95rem; }
html[data-view="s"] .tab-badge { width: 8px; height: 8px; padding: 0; font-size: 0; align-self: flex-start; }
html[data-view="s"] .graves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html[data-view="s"] .grave { gap: 7px; padding: 7px 8px 7px 6px; }
html[data-view="s"] .grave-stone { width: 32px; height: 40px; }
/* two slots a row (the third centred under them), wide enough for their names and text */
html[data-view="s"] .kit-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html[data-view="s"] .kit-slot:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
html[data-view="s"] .ks-art { width: 64px; height: 64px; }
html[data-view="s"] .ks-art .lodge-ico { width: 50px; height: 50px; }
html[data-view="s"] .kit-opts { grid-template-columns: 1fr; }
html[data-view="s"] .kit-pick-head { grid-template-columns: 1fr; }
html[data-view="s"] .kit-pick-head p { grid-column: auto; }
html[data-view="s"] .lodge-head > .deg-seal { width: 58px; height: 58px; font-size: 1.7rem; }
html[data-view="s"] .roster { gap: 8px; }
html[data-view="s"] .roster-card { flex-basis: calc((100% - 16px) / 3); padding: 4px; gap: 3px; border-radius: 9px; }
html[data-view="s"] .roster-txt { padding: 0 2px 2px; }
html[data-view="s"] .roster-txt small { font-size: var(--t-2xs); }
html[data-view="s"] .roster-txt b { font-size: var(--t-md); }
html[data-view="s"] .roster-card .soc-wanted { left: 6px; top: 7px; font-size: 0.7rem; }
html[data-view="s"] .daily-card { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
html[data-view="s"] .daily-card .city-thumb { height: 130px; }
html[data-view="s"] .daily-card .cta { justify-self: stretch; }
html[data-view="s"] .lodge-stats span { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
html[data-view="s"] .cal-top { flex-wrap: wrap; }
html[data-view="s"] .cal-record { flex-basis: 100%; text-align: left; }
html[data-view="s"] .cal { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px; }
html[data-view="m"] .me-kit .relic-btn span { max-width: 84px; }

/* six at the table: the rail of five rivals tightens so it never runs under the player board */
html[data-view="l"] .seats:has(> .seat:nth-child(6)) { gap: 12px; }
html[data-view="l"] .seats:has(> .seat:nth-child(6)) .seat { --dial: 40px; padding-top: 5px; padding-bottom: 6px; }
html[data-view="l"] .rail:has(.seats > .seat:nth-child(6)) .ticker { display: none; }

/* phones hold still: a fixed gutter so the scrollbar never nudges the width, a three-line coach, and a reserved
   score row; the shop rises as a sheet, because it replaces the dice rather than squeezing in beside them */
html[data-view="s"] { scrollbar-gutter: stable; }
html[data-view="s"] .coach p { min-height: 57px; }
html[data-view="s"] .tray:not(.shopping) .chips { min-height: 35px; }
html[data-view="s"] .tray.shopping .shop-zone { animation: sheet-up 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes sheet-up { from { opacity: 0; transform: translateY(48px); } }
html[data-view="s"] .actions { min-height: 50px; }

/* the cards on phones: landmarks in a row under the city, not over it */
html[data-view="s"] .lm-row { --w: min(108px, calc((100vw - 84px) / 3)); margin-top: 0; padding: 4px 0 18px; }
html[data-view="s"] .lm-row .tcg:nth-child(n) { transform: none; }
html[data-view="s"] .board .capital { padding-bottom: 14px; }

/* M: the desk holds mini cards; the landmarks stand beside the Capital rather than over it; six dice fit the tray */
html[data-view="m"] .desk-cards { --w: 92px; gap: 15px 10px; padding: 6px 6px 10px; justify-content: space-evenly; }
html[data-view="m"] .board { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); column-gap: 12px; }
html[data-view="m"] .lm-row { --w: 90px; grid-column: 2; margin-top: 0; align-self: center; gap: 8px; padding: 0 0 12px; }
html[data-view="m"] .board .capital { padding-bottom: 16px; }
html[data-view="m"] .dice { --die: 54px; gap: 26px 9px; }
html[data-view="s"] .lm-row { --w: 86px; }
/* the Crypt on phones: the title stacks, and slot cards grow to fit their text instead of holding the card shape */
html[data-view="s"] .lodge-id { grid-template-columns: minmax(0, 1fr); gap: 4px; }
html[data-view="s"] .lodge-head { padding-right: 40px; }
html[data-view="s"] .kit-slot { aspect-ratio: auto; grid-template-rows: auto auto auto auto auto; }
html[data-view="s"] .kit-slot small { -webkit-line-clamp: 3; }
/* phones: the Omen is a strip across the top of the board */
html[data-view="s"] .omen { position: static; grid-row: 1; }
html[data-view="s"] .omen-card { display: none; }
html[data-view="s"] .omen-strip { appearance: none; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px 6px 6px; border: 2px solid var(--ink); border-radius: var(--wobble-sm); background: #e6dcf2; color: var(--ink); text-align: left; font-size: var(--t-sm); line-height: 1.25; box-shadow: 0 0 0 2px #b39ce0; }
html[data-view="s"] .omen-strip .glyph { width: 30px; height: 30px; flex: none; }
html[data-view="s"] .omen-strip b { margin-right: 4px; color: #6a3fa0; }
html[data-view="s"] .omen-strip.quiet { background: var(--paper-2); box-shadow: none; color: var(--ink-soft); }
html[data-view="s"] .omen-strip.turning { animation: omen-glow 1.4s 0.3s ease-in-out 3; }

/* ---------- S, held sideways ---------- */
/* a phone on its side is too short for the stack: the table scrolls on the left and your board stays put on the right */
@media (orientation: landscape) and (max-height: 500px) {
  html[data-view="s"] .game { grid-template-columns: minmax(0, 1fr) minmax(300px, 44%); grid-template-areas: "top top" "rail mat" "board mat"; align-items: start; }
  html[data-view="s"] .mat { top: 6px; bottom: auto; gap: 5px; padding: 6px 8px 7px; }
  html[data-view="s"] .coach p { min-height: 19px; }
  html[data-view="s"] .dice { --die: 37px; gap: 18px 4px; padding: 8px 0 10px; }
}

/* The frame: the title screen, screen transitions and the lamp over the table. */

/* ---------- the lamp: warm light from the top left, a vignette at the edges ---------- */
/* Every shadow in the game falls down and to the right, so the light sits up and to the left. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 32% 20%, rgba(255, 214, 140, 0.08), transparent 70%),
    radial-gradient(ellipse 130% 115% at 42% 34%, transparent 58%, rgba(12, 7, 4, 0.32) 100%);
}
body.title-view::before { background: radial-gradient(ellipse 120% 105% at 50% 40%, transparent 50%, rgba(12, 7, 4, 0.5) 100%); }

/* ---------- screen transitions: the new screen opens like an eye ---------- */
::view-transition-old(root) { animation: vt-out 0.42s ease both; }
::view-transition-new(root) { animation: vt-iris 0.62s cubic-bezier(0.65, 0, 0.3, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(0.985); filter: brightness(0.55); } }
@keyframes vt-iris { from { clip-path: ellipse(0% 0% at 50% 45%); } to { clip-path: ellipse(85% 85% at 50% 45%); } }
#app.app-in { animation: app-in 0.35s ease both; }
@keyframes app-in { from { opacity: 0; filter: brightness(0.6); } }

/* ---------- the title screen ---------- */
.title-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px 16px 40px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
}
.title-lamp { position: absolute; top: -18vh; left: 50%; width: min(1100px, 160vw); height: 120vh; margin-left: max(-550px, -80vw); pointer-events: none; transform-origin: 50% 0; background: radial-gradient(ellipse 45% 55% at 50% 35%, rgba(255, 214, 140, 0.16), transparent 70%); animation: sway 7s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
/* the cast: the mascot in the middle of the base game's six, standing on one line, the outer ones a step back */
.title-cast { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(0px, 0.6vw, 8px); margin-bottom: 4px; }
.cast-spot { flex: none; line-height: 0; }
.title-cast .standee.cast { width: calc(clamp(58px, 7.6vw, 108px) * (1 - var(--i) * 0.07)); filter: brightness(calc(1 - var(--i) * 0.07)); }
.title-mascot { flex: none; width: clamp(130px, 15vw, 214px); margin: 0 clamp(2px, 0.6vw, 10px); }
/* phones: the outer pair steps out, so the mascot and four of the cast fit across */
html[data-view="s"] .cast-outer { display: none; }
html[data-view="s"] .title-cast .standee.cast { width: calc(56px * (1 - var(--i) * 0.07)); }
html[data-view="s"] .title-mascot { width: 112px; margin: 0 2px; }
html[data-view="s"] .title-tag { font-size: 0.7rem; letter-spacing: 0.14em; }
.title-word { position: relative; font: 400 clamp(3rem, 9.5vw, 7rem)/0.9 var(--f-title); letter-spacing: 0.01em; color: var(--paper); text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 6px 8px 0 var(--ink); }
.title-word span { color: #e8c062; }
.title-tag { position: relative; margin-top: 6px; font: 400 clamp(0.78rem, 1.5vw, 1.05rem)/1 var(--f-doc); letter-spacing: 0.28em; text-transform: uppercase; color: #e8c062; }
.title-actions { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.title-actions .link-btn { color: var(--on-night); }
.title-hint { position: relative; margin-top: 18px; font: 400 var(--t-xs)/1 var(--f-doc); letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-night-dim); animation: hint 2.2s 3s ease-in-out infinite; }
@keyframes hint { 50% { opacity: 0.35; } }

/* the mascot lands, the cast pops up around it from the middle out, then the wordmark and tagline */
.title-mascot { transform-origin: 50% 100%; animation: title-rise 0.6s 0.05s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.title-mascot .portrait { transform-origin: 50% 90%; animation: guy-bob 2.8s 1.2s ease-in-out infinite; }
@keyframes guy-bob { 50% { transform: rotate(-4deg) translateY(-5px); } }
.cast-spot { animation: cast-pop 0.45s calc(0.35s + var(--i) * 0.12s) cubic-bezier(0.3, 1.5, 0.5, 1) both; transform-origin: 50% 100%; }
@keyframes cast-pop { from { opacity: 0; transform: translateY(30px) scale(0.6); } }
.title-word { animation: title-rise 0.6s 0.9s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.title-tag { animation: title-fade 0.6s 1.3s ease both; }
.title-actions { animation: title-fade 0.5s 1.6s ease both; }
@keyframes title-rise { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes title-fade { from { opacity: 0; } }
.hint-tap { display: none; }
@media (hover: none) { .hint-key { display: none; } .hint-tap { display: inline; } }

/* ---------- the maker's credit: a quiet line at the foot of the title and setup screens, and in the menu ---------- */
.credit { margin: 0; font: 400 var(--t-xs)/1.4 var(--f-doc); letter-spacing: 0.08em; color: var(--on-night-dim); text-align: center; }
.credit a { color: #e8c062; text-underline-offset: 3px; }
.credit a:hover, .credit button:hover { color: var(--paper); }
.credit button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.title-credit { position: absolute; left: 16px; right: 16px; bottom: 14px; animation: title-fade 0.5s 1.8s ease both; }
html[data-view="s"] .credit:not(.fine) { font-size: 0.68rem; letter-spacing: 0; } /* one line across a phone */
.dialog .credit { color: var(--paper-dim); }
.dialog .credit a { color: var(--blue); }
.dialog .credit a:hover, .dialog .credit button:hover { color: var(--ink); }

/* ---------- the safety net (js/guard.js): a bar at the foot of the screen when the game breaks ---------- */
.oops { position: fixed; left: 50%; bottom: 16px; z-index: 100; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 14px; transform: translateX(-50%); border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 4px 5px 0 var(--ink); font: 400 var(--t-sm)/1.3 var(--f-body); color: var(--ink); }
.oops button { padding: 4px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #fffaf0; font: 700 var(--t-xs)/1.2 var(--f-body); color: var(--ink); cursor: pointer; }
.oops button:hover { background: #e8c062; }
.oops a { color: var(--blue); font: 800 var(--t-xs)/1.2 var(--f-body); text-underline-offset: 3px; }
/* the credit: its links, then who made it and the build, smaller and quieter underneath */
.credit-links, .credit-by { display: block; }
.credit-by { margin-top: 3px; font-size: 0.88em; opacity: 0.55; }
.credit-by:hover { opacity: 0.85; }
/* after a game: how was it, and a word to @ParanoidAmerica */
.over-talk { margin-left: auto; font-size: var(--t-sm); color: var(--ink-soft); }
.over-talk a { color: var(--blue); font-weight: 800; text-underline-offset: 3px; }
.noscript { max-width: 32ch; margin: 30vh auto 0; padding: 0 16px; font: 400 1.1rem/1.4 var(--f-body); color: var(--on-night); text-align: center; }
