/* Rentier — cartoon interface: cream paper cards, thick ink outlines, chunky buttons, rounded type */

/* bundled fonts (SIL Open Font License) */
@font-face { font-family: "Fredoka"; font-weight: 300 700; font-display: swap; src: url("../vendor/fonts/fredoka-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; font-weight: 300 700; font-display: swap; src: url("../vendor/fonts/fredoka-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Nunito"; font-weight: 400 900; font-display: swap; src: url("../vendor/fonts/nunito-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 400 900; font-display: swap; src: url("../vendor/fonts/nunito-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Nunito"; font-weight: 400 900; font-display: swap; src: url("../vendor/fonts/nunito-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 400 900; font-display: swap; src: url("../vendor/fonts/nunito-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* the map draws its labels from these two families: Fredoka for Latin, Nunito for Cyrillic */
@font-face { font-family: "Toon Bold"; font-weight: 300 700; src: url("../vendor/fonts/fredoka-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Toon Bold"; font-weight: 300 700; src: url("../vendor/fonts/fredoka-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Toon Bold"; font-weight: 400 900; src: url("../vendor/fonts/nunito-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Toon Bold"; font-weight: 400 900; src: url("../vendor/fonts/nunito-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F; }
@font-face { font-family: "Toon Medium"; font-weight: 300 700; src: url("../vendor/fonts/fredoka-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Toon Medium"; font-weight: 300 700; src: url("../vendor/fonts/fredoka-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Toon Medium"; font-weight: 400 900; src: url("../vendor/fonts/nunito-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Toon Medium"; font-weight: 400 900; src: url("../vendor/fonts/nunito-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F; }

:root {
  --ink: #232949; --paper: #fffaf0; --paper2: #fff1d0; --paper3: #ffe6ae;
  --line: rgba(35, 41, 73, 0.14); --line2: rgba(35, 41, 73, 0.3);
  --txt: #232949; --txt2: #545a80; --muted: #686d92;
  --sun: #ffd23f; --sun2: #ffe27a; --coral: #ff6b6b; --mint: #3ddc97; --sky: #4cc9f0; --grape: #9b5de5; --orange: #ff9f1c; --pink: #ff8fc7;
  --good: #0c7a3c; --bad: #c4262c; --warn: #9a5800;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #4a3aa7;
  --r: 20px; --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --pop: 5px 5px 0 var(--ink); --pop-s: 3px 3px 0 var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: #151b3d; color: var(--txt); font: 600 14.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 10px; }
b, strong { font-weight: 800; }

/* space behind the planet: big friendly stars */
#map { position: fixed; inset: 0; background-color: #151b3d;
  background-image: radial-gradient(2.5px 2.5px at 12% 18%, #fff 60%, transparent 62%), radial-gradient(2px 2px at 78% 12%, #ffe27a 60%, transparent 62%), radial-gradient(3px 3px at 64% 72%, #fff 60%, transparent 62%), radial-gradient(2px 2px at 22% 82%, #9be7ff 60%, transparent 62%), radial-gradient(2.5px 2.5px at 90% 56%, #fff 60%, transparent 62%), radial-gradient(3px 3px at 42% 8%, #ffe27a 60%, transparent 62%), radial-gradient(2px 2px at 6% 52%, #fff 60%, transparent 62%), radial-gradient(2.5px 2.5px at 52% 92%, #ffb3d9 60%, transparent 62%), radial-gradient(2px 2px at 34% 44%, #9be7ff 60%, transparent 62%), radial-gradient(3px 3px at 84% 86%, #fff 60%, transparent 62%), radial-gradient(2px 2px at 70% 34%, #fff 60%, transparent 62%), radial-gradient(2px 2px at 28% 62%, #ffe27a 60%, transparent 62%); }
.maplibregl-ctrl-bottom-right { bottom: 8px; right: 6px; }
.maplibregl-ctrl-group { border: 2.5px solid var(--ink) !important; border-radius: 14px !important; box-shadow: var(--pop-s) !important; overflow: hidden; background: var(--paper) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; font-family: var(--font); }

/* the money of planet Q: every country has its own sign, a capital letter with a stroke through it.
   A sign is drawn as a mask so it takes the colour and size of the text around it. */
.qs { display: inline-block; width: 0.74em; height: 0.92em; margin-right: 0.06em; vertical-align: -0.11em; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.qs.c-A, body[data-cur="A"] .qs:not([class*="c-"]) { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 3.6v18.8M6.8 3.6h8.4M6.8 22.4h8.4' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 13h12' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 3.6v18.8M6.8 3.6h8.4M6.8 22.4h8.4' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 13h12' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qs.c-E, body[data-cur="E"] .qs:not([class*="c-"]) { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M3.6 23.4L11 3.2l7.4 20.2M6.5 16.4h9' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.2 25L17.4 1' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M3.6 23.4L11 3.2l7.4 20.2M6.5 16.4h9' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.2 25L17.4 1' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qs.c-F, body[data-cur="F"] .qs:not([class*="c-"]) { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M17.4 6.8A7.4 8.6 0 1 0 17.4 19.2' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M11 1.6v22.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M17.4 6.8A7.4 8.6 0 1 0 17.4 19.2' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M11 1.6v22.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qs.c-U, body[data-cur="U"] .qs:not([class*="c-"]) { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 4A7 9 0 1 0 11.01 4z' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1.8 13h18.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 4A7 9 0 1 0 11.01 4z' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1.8 13h18.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qs.c-I, body[data-cur="I"] .qs:not([class*="c-"]) { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M7 23.4V3.6h5.4a4.9 4.9 0 0 1 0 9.8H7' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2.6 8.6h15.6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M7 23.4V3.6h5.4a4.9 4.9 0 0 1 0 9.8H7' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2.6 8.6h15.6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qs.c-Q { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 3.6A7.2 8.4 0 1 0 11.01 3.6zM13.2 17.6l5.6 6' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4 24.6L18 1.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M11 3.6A7.2 8.4 0 1 0 11.01 3.6zM13.2 17.6l5.6 6' fill='none' stroke='black' stroke-width='2.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4 24.6L18 1.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nw { white-space: nowrap; }
/* small drawn icons inside text, chips and buttons take the size and colour of the text around them (places with
   their own size — the rail, the round badges — say so further down) */
svg[aria-hidden="true"] { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.17em; flex: none; }

.glass { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--pop); }
.btn { border: 2.5px solid var(--ink); background: #fff; border-radius: 14px; padding: 6px 13px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); transition: transform 0.06s, box-shadow 0.06s, background 0.15s; }
.btn:hover { background: var(--paper2); } .btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--sun); } .btn.primary:hover { background: var(--sun2); }
.btn.teal { background: var(--mint); } .btn.teal:hover { background: #6fe8b3; }
.btn.danger { background: #ffd9d9; } .btn.danger:hover { background: #ffc2c2; }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; border-width: 2px; } .btn.ghost:hover { background: var(--paper2); } .btn.ghost:active { transform: none; }
.btn.sm { padding: 3px 10px; font-size: 13.5px; border-radius: 11px; box-shadow: 0 2px 0 var(--ink); border-width: 2px; } .btn.sm:active { transform: translateY(2px); }
.btn.big { padding: 11px 20px; font-size: 19px; border-radius: 18px; box-shadow: 0 5px 0 var(--ink); border-width: 3px; } .btn.big:active { transform: translateY(5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .row-click:focus-visible, [data-act]:focus-visible, summary:focus-visible, .x:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
input[type="text"], input[type="number"], select { background: #fff; border: 2.5px solid var(--ink); border-radius: 13px; padding: 7px 11px; width: 100%; min-width: 0; font-weight: 700; }
input::placeholder { color: var(--muted); font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--coral); height: 22px; margin-left: 0; margin-right: 0; } /* (U2: the browser's own 2 px side margins made a full-width slider 4 px wider than its box, e.g. the business price slider at 390 px) */
label.chk { display: flex; gap: 9px; align-items: center; cursor: pointer; } label.chk input { accent-color: var(--coral); width: 19px; height: 19px; flex: none; }
.up { color: var(--good); } .down { color: var(--bad); } .muted { color: var(--muted); } .gold { color: var(--orange); }
.num { font-variant-numeric: tabular-nums; }

/* avatars */
.av { display: inline-block; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; flex: none; overflow: hidden; vertical-align: middle; } .av svg { display: block; width: 100%; height: 100%; }

/* ---------- top bar ---------- */
#hud { position: fixed; top: 10px; left: 10px; right: 14px; height: 62px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 0 12px; }
#hud .logo { font-family: var(--display); font-weight: 700; letter-spacing: 0.09em; font-size: 22px; color: var(--coral); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 2px 2.5px 0 var(--ink); }
#hud .date { display: flex; flex-direction: column; line-height: 1.12; padding-right: 12px; border-right: 2.5px dashed var(--line2); }
#hud .date b { font-family: var(--display); font-weight: 600; font-size: 16.5px; white-space: nowrap; } #hud .date span { color: var(--txt2); font-size: 12px; white-space: nowrap; }
.stat { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.stat .k { color: var(--txt2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; font-weight: 800; }
.stat .v { font-family: var(--display); font-weight: 600; font-size: 17.5px; white-space: nowrap; }
.pill { border: 2.5px solid var(--ink); border-radius: 14px; padding: 4px 11px; background: #fff; }
.pill.cash { background: var(--sun); } .pill.nw { background: #c9f2ff; }
.fi { width: 150px; } .fi .bar { height: 10px; border-radius: 6px; background: #fff; border: 2px solid var(--ink); overflow: hidden; margin-top: 3px; } .fi .bar i { display: block; height: 100%; background: var(--mint); }
.fi .v { font-size: 13.5px; }
#hud .macro { margin-left: auto; display: flex; gap: 12px; padding: 0 12px; border-left: 2.5px dashed var(--line2); border-right: 2.5px dashed var(--line2); cursor: pointer; }
#hud .macro .stat .v { font-size: 15px; }
#hud .tools { display: flex; gap: 7px; }
.icon-btn { width: 38px; height: 38px; border-radius: 13px; border: 2.5px solid var(--ink); background: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 0 var(--ink); } .icon-btn:hover { background: var(--paper2); } .icon-btn:active { transform: translateY(3px); box-shadow: none; } .icon-btn.on { background: var(--sun); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.phase { font-size: 12px; font-weight: 800; padding: 1px 9px; border-radius: 20px; background: #c5f5d9; border: 2px solid var(--ink); font-family: var(--font); } .phase.rec { background: #ffc9c9; } .phase.boom { background: var(--sun); }

/* ---------- left rail + panel ---------- */
#rail { position: fixed; top: 86px; left: 10px; z-index: 19; width: 80px; padding: 7px; display: flex; flex-direction: column; gap: 3px; }
#rail button { position: relative; border: 2.5px solid transparent; background: transparent; border-radius: 14px; padding: 6px 2px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; font-family: var(--display); font-weight: 600; color: var(--txt); }
#rail button .blob { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--c, #fff); }
#rail button svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#rail button:hover { background: var(--paper2); } #rail button.on { background: var(--sun); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
#rail .badge { position: absolute; top: 0; right: 8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--coral); color: #fff; border: 2px solid var(--ink); font-size: 11px; display: grid; place-items: center; padding: 0 4px; font-family: var(--font); font-weight: 800; }
#panel { position: fixed; top: 86px; left: 102px; bottom: 16px; width: 456px; z-index: 18; display: flex; flex-direction: column; overflow: hidden; }
#inspector { position: fixed; top: 86px; right: 14px; width: 392px; max-height: calc(100vh - 148px); max-height: calc(100dvh - 148px); z-index: 18; display: flex; flex-direction: column; overflow: hidden; }
.p-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px 11px; border-bottom: 3px solid var(--ink); background: var(--paper2); }
.p-head h2 { font-size: 21px; flex: 1; min-width: 0; } .p-head .sub { color: var(--txt2); font-size: 12.5px; font-family: var(--font); font-weight: 700; margin-top: 2px; }
.p-body { overflow-y: auto; padding: 14px 16px 18px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.x { border: 2.5px solid var(--ink); background: #fff; color: var(--ink); width: 30px; height: 30px; border-radius: 50%; font-size: 19px; line-height: 1; cursor: pointer; padding: 0; flex: none; font-family: var(--display); box-shadow: 0 2px 0 var(--ink); } .x:hover { background: #ffd9d9; } .x:active { transform: translateY(2px); box-shadow: none; }
.sec { margin-bottom: 18px; } .sec > h3 { font-size: 15px; color: var(--txt); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; } .sec > h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); border: 2px solid var(--ink); flex: none; }
.card { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; }
.card + .card { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .tiles.two { grid-template-columns: repeat(2, 1fr); }
.tile { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 11px; min-width: 0; }
.tile:nth-child(4n+1) { background: #fff3c4; } .tile:nth-child(4n+2) { background: #d7f5ff; } .tile:nth-child(4n+3) { background: #dcf8e6; } .tile:nth-child(4n+4) { background: #ffe1ef; }
.tile .k { color: var(--txt2); font-size: 12px; font-weight: 800; } .tile .v { font-family: var(--display); font-weight: 600; font-size: 18.5px; white-space: nowrap; } .tile .d { font-size: 12px; color: var(--txt2); }
table.t { width: 100%; border-collapse: collapse; } table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); font-weight: 800; padding: 4px 6px; }
table.t td { padding: 7px 6px; border-top: 2px dashed var(--line); vertical-align: middle; } table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-click { cursor: pointer; } .row-click:hover td { background: var(--paper2); } tr.sel td { background: #fff0b0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; } .kv span:first-child { color: var(--txt2); } .kv span:last-child { font-variant-numeric: tabular-nums; text-align: right; font-weight: 800; }
.kv.total { border-top: 2.5px solid var(--ink); margin-top: 5px; padding-top: 7px; } .kv.total span:first-child { color: var(--txt); font-weight: 800; }
.row { display: flex; gap: 8px; align-items: center; } .row > .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; } .tabs button { flex: 1; border: 2.5px solid var(--ink); background: #fff; padding: 6px; border-radius: 13px; cursor: pointer; font-family: var(--display); font-weight: 600; color: var(--txt2); } .tabs button.on { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 1px 9px; border-radius: 20px; background: #fff; border: 2px solid var(--ink); white-space: nowrap; }
.chip.res { background: #cfe4ff; } .chip.ret { background: #ffd3e6; } .chip.off { background: #e2d8ff; } .chip.ind { background: #ffe3a3; } .chip.land { background: #c9f3d6; }
.chip.world { background: #d9ccff; } .chip.macro { background: #cfe4ff; } .chip.micro { background: #ffd3e6; } .chip.pf { background: #c9f3d6; } .chip.mkt { background: #ffe3a3; } .chip.life { background: #ffd0d0; } .chip.prop { background: #e2d8ff; } .chip.bank { background: #d7f5ff; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; border: 2px solid var(--ink); vertical-align: -1px; }
.note { font-size: 13px; color: var(--txt2); font-weight: 600; } .warn-box { background: #fff0b8; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 11px; font-size: 13.5px; }
.stack { display: flex; height: 18px; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; } .stack i { display: block; min-width: 3px; border-right: 2px solid var(--ink); } .stack i:last-child { border-right: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; color: var(--txt2); } .legend > span { display: inline-flex; gap: 5px; align-items: center; } .legend b { color: var(--txt); font-variant-numeric: tabular-nums; }
.meter { height: 12px; border-radius: 7px; background: #fff; border: 2px solid var(--ink); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--mint); }
.stars { color: var(--orange); letter-spacing: 1px; -webkit-text-stroke: 0.6px var(--ink); } .stars i { color: #e6e3d6; font-style: normal; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; } .field > span { font-size: 13px; color: var(--txt2); display: flex; justify-content: space-between; } .field > span b { color: var(--txt); font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 5px; flex-wrap: wrap; } .quick button { flex: 1; }
details.fold { border-top: 2.5px dashed var(--line2); } details.fold > summary { cursor: pointer; padding: 10px 0; font-family: var(--display); font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; } details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--sun); line-height: 1; } details.fold[open] > summary::after { content: "–"; background: #fff; } details.fold > div { padding-bottom: 12px; }
.calc { background: #f1fbff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 12px; } .calc .eq { font-family: var(--display); font-size: 16px; font-weight: 600; text-align: center; margin: 4px 0 6px; }
.seg { display: flex; gap: 5px; } .seg button { flex: 1; }

/* charts (light surface) */
.chart { position: relative; } .chart-wrap { position: relative; } .chart-svg { display: block; overflow: visible; }
.chart .grid { stroke: rgba(35, 41, 73, 0.12); stroke-width: 1; } .chart .grid.zero { stroke: rgba(35, 41, 73, 0.45); } .chart .tick { fill: var(--txt2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font); }
.chart .cross { stroke: var(--ink); stroke-width: 1; } .chart .hov-dot { stroke: #fff; stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-bottom: 6px; font-size: 12.5px; color: var(--txt2); } .lg-item { display: inline-flex; align-items: center; gap: 5px; } .lg-key { width: 16px; height: 4px; border-radius: 2px; } .lg-key.dash { background-image: linear-gradient(90deg, transparent 40%, #fff 40%, #fff 60%, transparent 60%); }
.chart-tip { position: absolute; top: 4px; pointer-events: none; background: var(--ink); color: #fff; border-radius: 11px; padding: 6px 9px; font-size: 12.5px; white-space: nowrap; z-index: 3; }
.tip-x { color: #c9cdea; margin-bottom: 3px; } .tip-row { display: flex; align-items: center; gap: 6px; } .tip-key { width: 10px; height: 4px; border-radius: 2px; } .tip-val { font-weight: 800; font-variant-numeric: tabular-nums; } .tip-name { color: #c9cdea; } .tip-plan { color: #c9cdea; white-space: normal; max-width: 230px; margin: 2px 0 3px; line-height: 1.3; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
.spark { vertical-align: middle; }

/* ---------- turn bar ---------- */
#turn { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 17; display: flex; gap: 9px; align-items: center; padding: 9px 11px 12px; }
#turn .btn.big { min-width: 190px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 8px 20px; } #turn .btn.big small { font-family: var(--font); font-weight: 800; font-size: 11.5px; opacity: 0.75; }
#turn .pace { display: flex; flex-direction: column; gap: 3px; } #turn .pace .k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--txt2); padding-left: 2px; }
body.panel-open #turn { left: calc(50% + 280px); } @media (max-width: 1500px) { body.panel-open.insp-open #turn { left: calc(50% + 84px); } }

/* ---------- start screen ---------- */
#start { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: 486px; max-width: 100vw; padding: 12px 22px 16px; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
/* the card never grows taller than the window: its body scrolls and the Begin button stays in view */
#start .start-card { pointer-events: auto; display: flex; flex-direction: column; max-height: 100%; min-height: 0; overflow: hidden; }
#start .start-body { padding: 16px 20px 10px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
#start .start-body { position: relative; }
#start .start-foot { padding: 10px 20px 14px; border-top: 3px solid var(--ink); background: var(--paper2); flex: none; }
#start .start-foot .btn.big { white-space: normal; line-height: 1.15; }
#start .logo { font-family: var(--display); font-weight: 700; font-size: 46px; letter-spacing: 0.09em; color: var(--coral); line-height: 1; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 var(--ink); transform: rotate(-2deg); display: inline-block; padding: 4px 6px; }
#start .tag { color: var(--txt2); margin: 8px 0 6px; font-size: 13.5px; line-height: 1.4; }
#start h4 { font-size: 14px; margin: 9px 0 4px; }
#start input[type="text"] { padding: 6px 11px; }
.results { margin-top: 5px; display: flex; flex-direction: column; gap: 4px; } .results button { text-align: left; border: 2px solid var(--ink); background: #fff; border-radius: 11px; padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; } .results button:hover { background: var(--paper2); } .results span { color: var(--txt2); font-size: 12px; text-align: right; } .results .stars { font-size: 11px; }
.place { margin-top: 8px; padding: 8px 11px; border-radius: 14px; background: #d6f7e5; border: 2.5px solid var(--ink); }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; } .opts.two { grid-template-columns: repeat(2, 1fr); }
.opt { border: 2.5px solid var(--ink); background: #fff; border-radius: 15px; padding: 8px 9px; cursor: pointer; text-align: left; display: flex; gap: 8px; align-items: center; } .opt b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; } .opt span { font-size: 12px; color: var(--txt2); display: block; line-height: 1.25; } .opt.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); } .opt.mini { padding: 5px 9px; } .opt.mini b { font-size: 15px; }
.setrow { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; margin-top: 6px; } .setrow .k { font-weight: 800; font-size: 12.5px; color: var(--txt2); }
.setrow .seg .btn.sm { display: flex; flex-direction: column; align-items: center; line-height: 1.12; padding: 4px 4px 5px; font-size: 14.5px; white-space: normal; } .setrow .seg .btn small { font: 700 10.5px/1.15 var(--font); opacity: 0.72; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; } .sw { width: 60px; cursor: pointer; border: 0; background: none; padding: 0; text-align: center; font-size: 11.5px; color: var(--txt2); font-weight: 800; } .sw i { display: block; height: 28px; border-radius: 12px; border: 2.5px solid var(--ink); margin-bottom: 3px; } .sw.on i { box-shadow: 0 0 0 3px var(--sun), 0 0 0 5.5px var(--ink); }
.learn p { margin: 0 0 6px; font-size: 14px; color: var(--txt2); } .learn a { color: var(--txt); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
/* ---------- for players who know the game (ui.js, game.js, story.js): Expert, challenge starts, achievements ---------- */
.xp-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 7px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink); color: var(--sun); font: 800 10.5px/1.5 var(--font); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 2px; white-space: nowrap; }
h3 .xp-tag, .row .xp-tag:first-child, .chal-box .xp-tag, .t.lives .xp-tag { margin-left: 0; }
#hud .xp-tag.hud { position: absolute; left: -5px; bottom: -7px; margin: 0; padding: 0 4px; font-size: 8.5px; line-height: 1.45; letter-spacing: 0.04em; pointer-events: none; }
.xp-chk { margin-top: 8px; font-size: 13.5px; line-height: 1.3; } .xp-chk b { font-family: var(--display); font-weight: 600; }
/* ---------- the start screens (task 101: ui.js, lessonui.js): home, play, lessons, host ---------- */
.st-tap, #start .btn.st-tap, #start input#ls-code, #start input#st-name, #start input#st-city { min-height: 44px; } /* (a touch target of 44 px; the coarse-pointer rules would give 38 to a small button) */
#start .st-lang { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--txt2); }
#start .st-home { display: flex; flex-direction: column; }
#start .st-home .logo { align-self: flex-start; }
/* the code box is first in the keyboard order and the returning player's buttons come before it on the screen (order) */
#start .st-ret { order: 1; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#start .st-home .ls-join { order: 2; margin-top: 8px; }
#start .st-main { order: 3; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ls-join label.dk-k { display: block; margin-bottom: 4px; } .ls-join .note { margin: 6px 0 0; }
.btn.st-big, .btn.st-two, .btn.st-play { display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; line-height: 1.15; width: 100%; }
.btn.st-big { padding: 9px 16px; border-radius: 18px; } .btn.st-two { padding: 6px 12px; font-size: 15px; }
.btn.st-big b, .btn.st-play b { font-weight: 700; } .btn.st-two b { font-weight: 600; }
.btn.st-big small, .btn.st-two small, .btn.st-play small { display: block; margin-top: 2px; font: 700 12.5px/1.25 var(--font); opacity: 0.8; }
.btn.st-play { align-items: center; text-align: center; }
#start .st-foot { margin: 0; font-size: 12px; font-weight: 600; color: var(--txt2); line-height: 1.3; }
#start .st-main .credits { margin-top: 0; }
#start .st-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 2px; }
#start .st-title { font-family: var(--display); font-weight: 700; font-size: 24px; margin: 4px 0 6px; outline: none; }
.st-choices { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.st-choice { text-align: left; font: inherit; color: inherit; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 6px 12px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.st-choice:hover { background: var(--paper2); } .st-choice.on { background: var(--sun); }
.st-choice b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.2; }
.st-choice small { display: block; font-size: 12.5px; color: var(--txt2); font-weight: 700; line-height: 1.25; }
.st-lbl { display: block; font-weight: 800; font-size: 12.5px; color: var(--txt2); margin: 10px 0 4px; }
/* a fold is a real button with aria-expanded (the body is hidden while it is closed) */
.st-fold { margin-top: 8px; border: 2px dashed var(--line2); border-radius: 14px; background: #fffdf6; }
.st-fold.open { border-style: solid; border-color: var(--ink); }
.st-fold-h { display: flex; gap: 8px; align-items: center; width: 100%; padding: 4px 10px; background: none; border: 0; border-radius: 12px; text-align: left; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 14.5px; color: inherit; }
.st-fold-h:hover { background: var(--paper2); }
.st-fold-h svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-fold-h::after { content: "+"; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; background: var(--sun); line-height: 1; }
.st-fold.open > .st-fold-h::after { content: "–"; background: #fff; }
.st-fold-t { flex: 1; min-width: 0; } .st-fold-t b { font-weight: 600; }
.st-fold-t small { display: block; font: 700 11.5px/1.25 var(--font); color: var(--txt2); }
.st-fold-b { padding: 0 10px 10px; } .st-fold-b[hidden] { display: none; }
.st-fold .note { margin: 6px 0 4px; }
.st-fold .st-fold { background: #fff; }
.st-topic { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 var(--ink); margin-top: 8px; }
.st-topic.open { background: #fffbe8; }
.st-topic > .st-fold-h { font-size: 16px; padding: 6px 12px; } .st-topic > .st-fold-h svg { width: 22px; height: 22px; }
.st-topic .ls-grid { gap: 7px; } .st-topic .ls-soon { margin-top: 8px; }
.ls-ct { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ls-mark { display: inline-flex; flex: none; } .ls-mark svg { width: 17px; height: 17px; fill: none; stroke: var(--txt2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; } .ls-mark.grp svg { stroke: var(--ink); }
.ls-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; }
.ls-legend span { display: inline-flex; align-items: center; gap: 5px; } .ls-legend svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-steps { margin: 6px 0 4px; padding-left: 22px; font-size: 13.5px; line-height: 1.4; color: var(--txt2); font-weight: 600; } .st-steps li { margin: 3px 0; }
.st-too { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; } .st-too legend { padding: 0; }
.st-radio { display: flex; gap: 10px; align-items: flex-start; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 7px 10px; margin-top: 6px; cursor: pointer; }
.st-radio:has(input:checked) { background: #fffbe8; box-shadow: 0 3px 0 var(--ink); }
.st-radio input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.st-radio b { display: block; font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.2; }
.st-radio small { display: block; font-size: 12.5px; color: var(--txt2); font-weight: 700; line-height: 1.3; }
.st-link { display: inline-block; margin-top: 6px; padding: 0 2px; background: none; border: 0; font: 800 14px var(--font); color: var(--txt); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cg-too { margin-top: 6px; }
@media (max-height: 700px) { /* a short phone: less air, the same content (the first screen then fits as far as it can) */
  #start .start-body { padding: 10px 16px 8px; } #start .st-home .ls-join { margin-top: 6px; padding: 9px 12px; } #start .st-main { margin-top: 8px; gap: 6px; } #start .st-ret { margin-top: 6px; }
  .btn.st-big { padding: 7px 14px; } #start .st-lang { margin-bottom: 2px; } #start .tag { margin: 6px 0 4px; }
}
.chal-seg { flex-wrap: wrap; } .chal-seg .btn { flex: 1 1 88px; white-space: normal; line-height: 1.15; padding: 5px 6px; } .chal-seg .btn small { display: block; font: 700 10px/1.2 var(--font); opacity: 0.75; }
.chal-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 8px 11px; border-radius: 14px; background: #fff0d6; border: 2px solid var(--ink); font-size: 14px; line-height: 1.4; } .chal-box.xp { background: #eceaf9; align-items: center; }
.chip.chal { background: #fff0d6; } .chip.chal svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ach-grid > .ach { display: flex; gap: 9px; align-items: flex-start; padding: 7px 9px; border-radius: 13px; border: 2px solid var(--line2); background: #fff; } .ach-grid > .ach.done { border-color: var(--ink); background: #fff6cf; }
.ach-grid > .ach b { display: block; font-size: 13.5px; line-height: 1.25; } .ach-grid > .ach .note { margin-top: 1px; font-size: 12px; } .ach-grid > .ach .bar { height: 8px; margin-top: 4px; } .ach-grid > .ach .bar i { background: var(--mint); } .ach-grid > .ach .grow { min-width: 0; }
@media (max-width: 560px) { .ach-grid { grid-template-columns: 1fr; } }
#ach-toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 16px); }
.toast.ok.ach { background: #fff6cf; font-size: 14px; } .toast.ach .mini-blob { width: 28px; height: 28px; } .toast.ach .mini-blob svg { width: 15px; height: 15px; } .chip.ach-new { background: #fff6cf; } .chip.ach-new svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* ---------- help for a first-time player (ui.js: the welcome, the first-turn guide, the "?" card, same start) ---------- */
.welcome .howto { margin-top: 12px; padding: 9px 12px; border-radius: 14px; background: #f1fbff; border: 2px solid var(--ink); font-size: 14px; line-height: 1.42; }
.welcome .howto p { margin: 0; } .welcome .howto p + p { margin-top: 7px; } .welcome .howto b { font-family: var(--display); font-weight: 600; }
.welcome .adv { margin-top: 10px; }
.same-start { margin-top: 10px; padding: 8px 12px; border-radius: 14px; background: #e2f8ea; border: 2px dashed var(--ink); font-size: 14px; }
.same-start .note { margin-top: 2px; }
.same-list .kv { align-items: flex-start; gap: 10px; } .same-list .kv > span:last-child { text-align: right; } .same-list .note { font-weight: 600; }
.help .sec p { margin: 0; font-size: 14px; line-height: 1.45; } .help .sec { margin-top: 12px; }
#guide { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 43; width: 520px; max-width: calc(100vw - 20px); display: flex; gap: 10px; align-items: center; padding: 9px 11px; background: #fff6cf; animation: pop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
#guide::after { content: ''; position: absolute; left: 50%; bottom: -11px; margin-left: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
#guide .grow, .guide-in .grow { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
#guide .who, .guide-in .who { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #8a4b00; }
#guide .btn, .guide-in .btn { flex: none; white-space: nowrap; }
body.panel-open #guide { left: calc(50% + 280px); } @media (max-width: 1500px) { body.panel-open.insp-open #guide { left: calc(50% + 84px); } }
.guide-in { display: flex; gap: 9px; align-items: center; margin: -4px 0 12px; padding: 8px 10px; border-radius: 14px; background: #fff6cf; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
#rail .rail-h { display: block; text-align: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt2); margin: 1px 0 1px; }
#rail button small.yr { display: block; font-size: 10px; font-weight: 800; color: var(--txt2); line-height: 1; margin-top: 1px; }
.crowns-h { margin-top: 14px; font-size: 12.5px; font-weight: 800; color: var(--txt2); } .crowns-h + .crowns { margin-top: 8px; }
#quests .q-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--txt2); }
.race-head .race-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); white-space: nowrap; }
.alloc-read .ar-k { font-weight: 800; color: var(--txt2); }
.verdict { margin: 4px 0 8px; } .verdict b { font-family: var(--display); font-weight: 600; }
#hud .stat .v small.per { font: 800 10.5px var(--font); color: var(--txt2); margin-left: 4px; text-transform: none; letter-spacing: 0; }
@media (max-width: 1500px) { #hud .macro .stat:nth-child(n+4) { display: none; } } /* (room for the "?" and for what "Saved" counts) */
@media (max-width: 860px) {
  #guide, body.panel-open #guide, body.panel-open.insp-open #guide { left: 50%; bottom: 218px; z-index: 45; }
  #guide, .guide-in { flex-wrap: wrap; row-gap: 4px; } #guide .grow, .guide-in .grow { flex: 1 1 calc(100% - 60px); }
  #guide .btn, .guide-in .btn { margin-left: auto; }
  #rail .rail-h { display: none; } #rail button small.yr { font-size: 8.5px; }
}
.credits { margin-top: 9px; font-size: 11px; color: var(--txt2); line-height: 1.3; } .credits a { color: inherit; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(21, 27, 61, 0.55); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.m-card { width: 640px; max-width: 100%; min-width: 0; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 24px; scrollbar-width: thin; box-shadow: 8px 8px 0 var(--ink); animation: plop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes plop { from { transform: scale(0.93) rotate(-1.5deg); } to { transform: none; } }
.m-card.wide { width: 780px; } .m-card h2 { font-size: 27px; margin: 8px 0 10px; } .m-card .lead { font-size: 15.5px; }
.m-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.m-card.good { background: #f0fff5; } .m-card.bad { background: #fff3f1; } .m-card.neutral { background: var(--paper); }
.m-top { display: flex; align-items: center; gap: 12px; } .badge-ic { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; flex: none; box-shadow: var(--pop-s); } .badge-ic svg { width: 28px; height: 28px; stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.steps p { margin: 0 0 8px; } .steps p:last-child { margin: 0; }
.choices { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; } .choices .btn { text-align: left; white-space: normal; padding: 10px 14px; }
.result { margin-top: 12px; padding: 12px; border-radius: 16px; background: #fff; border: 2.5px solid var(--ink); }
.final-level { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--sun); line-height: 1.15; letter-spacing: 0.03em; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--ink); margin: 2px 0 8px; display: inline-block; }

/* ---------- people, news ---------- */
.ppl { padding: 7px 0; line-height: 1.4; } .ppl + .ppl { border-top: 1.5px solid var(--line, #0001); } .ppl b { font-weight: 800; } /* the People list (Life desk, task 121) */
.person { display: flex; gap: 11px; align-items: center; } .person .grow b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.kids { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; } .kid { border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 5px 10px 5px 6px; display: flex; gap: 7px; align-items: center; font-size: 13px; line-height: 1.15; }
.news { display: flex; gap: 10px; padding: 8px 0; border-top: 2px dashed var(--line); } .news:first-child { border-top: 0; } .news .when { width: 64px; flex: none; color: var(--txt2); font-size: 12.5px; padding-top: 1px; }
.home-pin { transform: translateY(-4px); } .home-pin span { background: var(--coral); color: #fff; font-family: var(--display); font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 14px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); position: relative; display: inline-block; } .home-pin span::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.sel-pin { pointer-events: none; } .sel-pin i { display: block; width: 0; height: 0; border: 11px solid transparent; border-top: 16px solid #f4ff3a; border-bottom: 0; filter: drop-shadow(0 0 0 #232949) drop-shadow(2px 0 0 #232949) drop-shadow(-2px 0 0 #232949) drop-shadow(0 2px 0 #232949) drop-shadow(0 -2px 0 #232949); animation: bob 0.9s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.heat-key { position: fixed; left: 50%; top: 86px; transform: translateX(-50%); z-index: 16; padding: 8px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; width: max-content; max-width: min(600px, calc(100vw - 20px)); }
.heat-key .hk-row { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; } .heat-key .ramp { width: 150px; height: 12px; border-radius: 7px; border: 2px solid var(--ink); background: linear-gradient(90deg, #fff3a8, #ffc24a, #ff7a3d, #e23d6d, #8a2fb5); }

/* ---------- the advisor ---------- */
.adv { display: flex; gap: 9px; align-items: flex-start; margin: 8px 0; padding: 8px 10px; border-radius: 14px; background: #fff6cf; border: 2px dashed var(--ink); font-size: 13.5px; line-height: 1.4; text-align: left; }
.adv > div { min-width: 0; } .adv b:first-child { font-family: var(--display); font-weight: 600; margin-right: 3px; color: #8a4b00; } .adv.after { background: #e2f8ea; }
#advisor { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 44; width: 560px; max-width: calc(100vw - 20px); display: flex; gap: 11px; align-items: center; padding: 10px 12px; background: #fff6cf; animation: pop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
#advisor .grow { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.4; } #advisor .who { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #8a4b00; }
#advisor .adv-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
body.panel-open #advisor { left: calc(50% + 280px); } @media (max-width: 1500px) { body.panel-open.insp-open #advisor { left: calc(50% + 84px); } }
#advisor:not([hidden]) ~ #toasts { bottom: 226px; }
#netwarn { position: fixed; left: 50%; top: 86px; transform: translateX(-50%); z-index: 26; padding: 8px 14px; font-size: 13.5px; background: #ffe0e0; max-width: min(620px, calc(100vw - 20px)); text-align: center; }
.demo { display: inline-block; font: 800 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; border-radius: 20px; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); vertical-align: middle; -webkit-text-stroke: 0; text-shadow: none; }
#start .demo { margin-left: 10px; transform: rotate(4deg); } #hud .demo { margin-left: 6px; font-size: 9.5px; padding: 3px 6px; }
.demo-note { font-size: 12.5px; color: var(--txt2); margin: 6px 0 0; }

/* ---------- the world and trade ---------- */
.abroad { margin: 8px 0; padding: 7px 10px; border-radius: 14px; background: #efe7ff; border: 2.5px solid var(--ink); font-size: 13px; }
table.t.tight th, table.t.tight td { padding: 6px 4px; font-size: 13px; } table.t.tight th { font-size: 10.5px; letter-spacing: 0; }
table.t td.lo { background: #c5f5d9; } table.t td.hi { background: #ffd0d0; } table.t td.adv-cell { box-shadow: inset 0 0 0 3px #ffb800; font-weight: 800; }
.fxline { font-weight: 700 !important; white-space: normal; } .only-s { display: none; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column-reverse; gap: 9px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 14px; max-width: 580px; box-shadow: var(--pop-s); display: flex; gap: 10px; align-items: center; animation: pop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
.toast.ok { background: #d6f7e5; } .toast.err { background: #ffd9d9; } .toast.learn { background: #fff0b0; }
@keyframes pop { from { transform: translateY(10px) scale(0.95); } to { transform: none; } }

#hud .logo { white-space: nowrap; flex: none; }
@media (max-width: 1500px) { #hud { gap: 10px; } #hud .macro { gap: 10px; padding: 0 10px; } .fi { width: 112px; } #hud .tools { gap: 5px; } #hud .tools .icon-btn { width: 35px; height: 35px; } }
/* on a narrower screen the rank moves into the line under the date, and the policy rate and the jobless rate
   are left to the Economy tab (a click on the country's name opens it) */
@media (max-width: 1500px) { #hud .stat.rank { display: none; } .only-s { display: inline; } }
/* the label of the output tile wraps into two lines ("Output, year / on year") so that it does not run into "Saved" (task 111 Part D) */
@media (max-width: 1500px) { #hud .macro .stat[data-tip="growth"] .k { white-space: normal; max-width: 9em; } #hud .stat .v small.per { display: block; margin-left: 0; line-height: 1.1; } }
@media (max-width: 1420px) { .fi { width: 100px; } #hud .fi .v { font-size: 12.5px; } #hud .stat.pill { padding: 4px 8px; } #hud .logo { font-size: 20px; } #hud .date { padding-right: 8px; } #hud .macro { padding: 0 8px; } }
@media (max-width: 1420px) { #hud .stat.rank, #hud .macro .stat:nth-child(n+3) { display: none; } .only-s { display: inline; } }
@media (max-width: 1300px) { #hud .fi, #hud .macro .stat:nth-child(n+3) { display: none; } #inspector { width: 350px; } #panel { width: 410px; } }
/* task 146: the top bar fits at every width. Nothing in it shrinks (the player's own numbers least of all); when the bar is
   too wide, ui.js measures it and adds one class at a time to #hud: fit-extra (the rank, the passive income and the policy
   and jobless rates hide: the rank moves into the date's line), fit-date (the date loses its year), fit-eco (the economy
   block hides), fit-more (the tool buttons fold into "More"), fit-logo (the logo hides). The phone layout below wraps instead. */
#hud.fit-extra .stat.rank, #hud.fit-extra .fi, #hud.fit-extra .macro .stat:nth-child(n+3) { display: none; } #hud.fit-extra .only-s { display: inline; }
#hud > * { flex: none; }
#hud .stat { flex: none; min-width: max-content; }
#hud .tools .icon-btn { flex: none; }
#hud .tools-menu { display: contents; }
#hud .more-btn { display: none; align-items: center; gap: 5px; height: 35px; padding: 0 11px 0 8px; border-radius: 13px; border: 2.5px solid var(--ink); background: #fff; cursor: pointer; font: 800 13px var(--font); color: var(--ink); box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
#hud .more-btn:hover { background: var(--paper2); } #hud .more-btn:active { transform: translateY(3px); box-shadow: none; }
#hud .more-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; }
#hud.fit-date .date .d-yr { display: none; }
#hud.fit-eco .macro { display: none; } #hud.fit-eco .tools { margin-left: auto; }
#hud.fit-more .more-btn { display: inline-flex; }
#hud.fit-more .tools-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 3; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: max-content; max-width: 220px; padding: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--pop-s); }
#hud.fit-more.more-open .tools-menu { display: flex; }
#hud.fit-logo .logo { display: none; }
@media (max-width: 860px) {
  #hud { height: auto; flex-wrap: wrap; padding: 6px 9px; gap: 6px 9px; right: 10px; } #hud .macro, #hud .logo, #hud .stat:not(.pill) { display: none; } #hud .tools { margin-left: auto; } #hud .tools .icon-btn { width: 38px; height: 38px; } #hud .date { border: 0; padding: 0; } .only-s { display: inline; } #hud .tools [data-act="go-planet"] { display: none; }
  #rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; flex-direction: row; border-radius: 0; border-width: 3px 0 0; box-shadow: none; justify-content: space-around; z-index: 25; padding: 4px; } #rail button { flex: 1; font-size: 10.5px; padding: 4px 0 2px; min-width: 0; } #rail button .blob { width: 30px; height: 30px; }
  /* panels start right under the top bar, however many rows it has taken (--hud-b is measured by the game) */
  #panel { left: 0; right: 0; width: auto; top: calc(var(--hud-b, 104px) + 6px); bottom: 66px; z-index: 21; border-radius: 20px 20px 0 0; box-shadow: none; } #inspector { left: 0; right: 0; width: auto; top: auto; bottom: 66px; max-height: 60vh; max-height: min(60dvh, calc(100dvh - var(--hud-b, 104px) - 76px)); border-radius: 20px 20px 0 0; z-index: 19; box-shadow: none; }
  #turn, body.panel-open #turn { left: 50%; bottom: 76px; padding: 6px 8px 9px; } #turn .btn.big { min-width: 0; } #turn .pace .k { display: none; } #start { width: 100vw; padding: 8px; } #start .logo { font-size: 40px; } .tiles { grid-template-columns: repeat(2, 1fr); }
  #advisor, body.panel-open #advisor, body.panel-open.insp-open #advisor { left: 50%; bottom: 150px; z-index: 46; } #advisor .adv-btns { flex-direction: column; } #advisor:not([hidden]) ~ #toasts { bottom: 270px; } #toasts { bottom: 150px; width: calc(100vw - 16px); } .toast { max-width: 100%; }
  .heat-key, #netwarn { top: calc(var(--hud-b, 104px) + 8px); } .m-card { padding: 16px 15px; } .m-card h2 { font-size: 23px; } #modal { padding: 8px; } .m-foot .btn { flex: 1; }
  .maplibregl-ctrl-bottom-right { bottom: 140px; }
}
@media (max-height: 760px) and (min-width: 861px) { #start { padding: 8px 22px; } #start .logo { font-size: 38px; } #start .tag { margin: 6px 0 4px; } }
/* fingers need bigger targets than a mouse pointer */
@media (pointer: coarse) {
  .btn { min-height: 40px; } .btn.sm { min-height: 38px; padding: 6px 12px; } .x { width: 38px; height: 38px; } .icon-btn { width: 42px; height: 42px; }
  input[type="text"], input[type="number"], select { min-height: 42px; font-size: 16px; } input[type="range"] { height: 34px; } label.chk { min-height: 38px; } label.chk input { width: 24px; height: 24px; }
  table.t td { padding: 10px 6px; } details.fold > summary { padding: 13px 0; } .tabs button { min-height: 42px; } .results button { min-height: 42px; align-items: center; } .sw { width: 64px; } .sw i { height: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- start screen: looks and game modes ---------- */
.looks { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.look { border: 2.5px solid transparent; background: transparent; border-radius: 50%; padding: 2px; cursor: pointer; line-height: 0; }
.look:hover { background: var(--paper2); } .look.on { border-color: var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.look:focus-visible, .mode:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.mode { border: 2.5px solid var(--ink); background: #fff; border-radius: 15px; padding: 7px 10px 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 1px; font: inherit; color: inherit; }
.mode:first-child { grid-column: 1 / -1; }
.mode b { font-family: var(--display); font-weight: 600; font-size: 15.5px; } .mode small { font-size: 11px; color: var(--txt2); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; } .mode span { font-size: 12.5px; color: var(--txt2); line-height: 1.3; }
.mode:hover { background: var(--paper2); } .mode.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); } .mode.on span, .mode.on small { color: var(--txt); }
.setrow.one { grid-template-columns: 1fr; margin-top: 8px; }

/* ---------- goals of a scenario, small dialogs, the map legend ---------- */
.goals { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.goals li { display: flex; gap: 9px; align-items: flex-start; font-weight: 700; }
.goals li > i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 900; background: #fff; }
.goals li.ok > i { background: var(--mint); } .goals li.no > i { background: #ffc9c9; }
.m-card.small { width: 460px; } .m-card.bad { background: #fff3f1; }
/* ---------- the map's legend and the layers that follow the economy (next round, Part A: ui.js renderLegend, map.js) ----------
   The legend: the two switches on top, then one line for each layer that needs a key. It grows upwards, and the goals
   box moves up with it (--lg-h, measured by the game). On a phone it spans the width above the turn button. */
#legend { position: fixed; left: 102px; bottom: 16px; z-index: 15; padding: 5px 9px 6px 5px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px; line-height: 1.35; border-width: 2.5px; box-shadow: var(--pop-s); max-width: 380px; }
#legend .lg-row { display: flex; gap: 6px; flex-wrap: wrap; }
#legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--ink); margin-right: 4px; vertical-align: -2px; flex: none; }
#legend i.tg { border-radius: 6px; width: 15px; } #legend i.st { border-radius: 50%; }
#legend i.foot { width: 34px; border-radius: 6px; background: linear-gradient(90deg, #e3fbff, #8fe6ff, #3fb0ff, #3d5bd9); }
#legend .lg-btn { font: inherit; font-family: var(--display); font-weight: 700; font-size: 12.5px; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 11px; background: #fff; color: var(--txt); cursor: pointer; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
#legend .lg-btn:hover { background: var(--paper2); } #legend .lg-btn.on { background: var(--sun); }
#legend .lg-line { display: block; padding-left: 4px; max-width: 100%; }
#legend .lg-line > span { white-space: nowrap; margin-right: 7px; display: inline-block; }
#legend .lg-uses > span, #legend .lg-signs > span { margin-right: 10px; }
#legend .lg-who { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#legend .lg-k { font-weight: 800; color: var(--txt2); margin-right: 2px; }
#legend .lg-chip { font: inherit; font-weight: 800; font-size: 11.5px; padding: 1px 8px 1px 5px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--txt); cursor: pointer; white-space: nowrap; flex: none; display: inline-flex; align-items: center; }
#legend .lg-chip i { width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; } #legend .lg-chip.on { background: var(--sun); box-shadow: 0 2px 0 var(--ink); }
#legend .lg-x { font: 800 13px/1 var(--font); width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; color: var(--txt); cursor: pointer; padding: 0; margin-left: 4px; vertical-align: 0; }
#legend .sgk { font: 900 9.5px/1 var(--font); font-style: normal; padding: 2px 4px; border: 1.5px solid var(--ink); border-radius: 4px; margin-right: 4px; letter-spacing: 0.02em; background: #fff; display: inline-block; vertical-align: 1px; }
#legend .sgk.let { color: #c4262c; } #legend .sgk.sale { background: #ffd23f; } #legend .sgk.dark { background: #5b607c; color: #fff; } #legend .sgk.new { background: #3ddc97; } #legend .sgk.crane { background: #ffd23f; }
body #quests { bottom: calc(var(--lg-h, 46px) + 26px); }
@media (max-width: 1100px) { #legend { max-width: 300px; } }
@media (max-width: 860px) {
  #legend { left: 8px; right: 58px; bottom: 196px; max-width: none; font-size: 11.5px; padding: 4px 7px 5px 4px; }
  #legend .lg-btn { padding: 5px 11px; font-size: 13px; }
  #legend .lg-line { padding-left: 2px; }
  #legend .lg-who { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; } #legend .lg-who::-webkit-scrollbar { display: none; }
}
/* a sign under the name of your café: how many came a day last month, and how full it is of what the staff can serve */
.biz-pin span small { display: block; font: 800 10.5px/1.1 var(--font); color: var(--txt2); text-align: center; }
.biz-pin .cbar { display: block; height: 7px; margin: 3px 0 1px; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff; overflow: hidden; }
.biz-pin .cbar i { display: block; height: 100%; background: var(--grape); }
.heat-key .hk-cc { font-size: 12.5px; } .heat-key .hk-cc span { white-space: nowrap; }
@media (max-width: 860px) { .heat-key .note { display: none; } .heat-key .ramp { width: 96px; } .heat-key { padding: 6px 10px; gap: 3px; } }
@media (max-width: 860px) { .modes { grid-template-columns: 1fr; } }

.bad-year { margin-top: 5px; padding-top: 5px; border-top: 2px dashed rgba(0,0,0,.14); }
.plan-k { font-family: var(--display); font-weight: 600; font-size: 14.5px; margin-top: 10px; } .plan-k:first-child { margin-top: 0; } .plan-k .muted { font-family: var(--font); font-weight: 700; font-size: 12.5px; }
.plan .setrow.one { margin-top: 4px; } .plan .adv { margin-top: 6px; }
.heads { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; } .heads li { margin: 2px 0; }
#turn .btn.big { min-width: 210px; }
@media (max-width: 860px) { #turn .btn.big { min-width: 0; width: min(78vw, 320px); } }
.yr-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0 24px; margin-top: 12px; } .yr-cols .sec { margin-top: 0; } .yr-cols table.t td { padding: 4px 4px; }
@media (max-width: 700px) { .yr-cols { grid-template-columns: 1fr; } .yr-cols .sec + .sec { margin-top: 12px; } }
@media (max-width: 700px) { .seg.four { flex-wrap: wrap; } .seg.four button { flex: 1 1 calc(50% - 5px); } }

/* =====================================================================================================================
   Desks, the turn button, choice cards, crowns, dreams, quests, the money split, the race
   ===================================================================================================================== */

/* ---------- the rail: desks first, each with its state ---------- */
#rail .rail-sep { display: block; height: 2.5px; background: var(--line2); margin: 3px 8px; border-radius: 2px; flex: none; }
#rail button.locked { opacity: 0.55; }
#rail .badge.ok { background: var(--mint); color: var(--ink); } #rail .badge.tip { background: var(--sun); color: var(--ink); } #rail .badge.must { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.pill.joy { background: #ffe1ef; cursor: pointer; } .pill.joy svg { fill: #ff8fa3; margin-right: 3px; }
.joyc { color: #b0224f; white-space: nowrap; } .joyc svg { fill: #ff8fa3; stroke: var(--ink); margin-right: 2px; }

/* ---------- the turn button and the desks above it ---------- */
#turn { flex-direction: column; gap: 7px; }
.desk-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 7px; } /* (U2: the side padding holds the corner badge of the last dot, which sits 7 px outside it) */
.dd { flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--c, #fff); display: grid; place-items: center; cursor: pointer; padding: 0; }
.dd svg { width: 19px; height: 19px; } .dd:hover { filter: brightness(1.06); } .dd.locked { opacity: 0.5; } .dd.on { box-shadow: 0 0 0 3px var(--sun), 0 0 0 5.5px var(--ink); }
.dd::after { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; border-radius: 9px; border: 2px solid var(--ink); font: 800 11px/14px var(--font); text-align: center; color: var(--ink); }
.dd.ok::after { content: "✓"; background: var(--mint); } .dd.tip::after { content: "★"; background: var(--sun); } .dd.must::after { content: "!"; background: var(--coral); color: #fff; animation: pulse 1.1s ease-in-out infinite; }
#turn .btn.glow { animation: glow 1.25s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 5px 0 var(--ink), 0 0 0 0 rgba(255, 107, 107, 0.75); } 55% { box-shadow: 0 5px 0 var(--ink), 0 0 0 12px rgba(255, 107, 107, 0); } }
#advisor { bottom: 142px; } #toasts { bottom: 138px; } #advisor:not([hidden]) ~ #toasts { bottom: 268px; }

/* ---------- a desk: the strip that says why it wants a look, one control, one number ---------- */
.strip { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff6cf; margin-bottom: 12px; font-size: 13.5px; line-height: 1.35; }
.strip > .st { flex: 1; min-width: 0; } .strip .btn { flex: none; } .strip.must { background: #ffe3df; } .strip.ok { background: #e2f8ea; } .strip > svg { width: 20px; height: 20px; }
.deskc { background: #fffdf5; } .deskc + .card, .card + .deskc { margin-top: 8px; }
.dk-k { font-family: var(--display); font-weight: 600; font-size: 16px; margin-bottom: 6px; } .dk-k .muted { font-family: var(--font); font-weight: 700; font-size: 12.5px; }
.dk-num { display: flex; gap: 8px; margin-top: 10px; } .dk-num > div { flex: 1; min-width: 0; background: #f1fbff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 6px 10px; display: flex; flex-direction: column; }
.dk-num > div > span { font-size: 11px; font-weight: 800; color: var(--txt2); text-transform: uppercase; letter-spacing: 0.04em; } .dk-num b { font-family: var(--display); font-weight: 600; font-size: 21px; white-space: nowrap; } .dk-num small { font: 700 12px var(--font); color: var(--txt2); }
.locked-note { display: flex; gap: 9px; align-items: center; color: var(--txt2); }
.tabs.five button { font-size: 13.5px; padding: 6px 2px; } .tabs button svg { width: 13px; height: 13px; margin-right: 3px; }
.fc .btn.big { display: flex; gap: 6px; justify-content: center; align-items: center; }
.btn > svg[aria-hidden="true"] { margin-right: 6px; }

/* ---------- Ask Mira, and words explained on a tap ---------- */
details.ask { margin-top: 10px; } details.ask > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-family: var(--display); font-weight: 600; font-size: 13.5px; padding: 2px 12px 2px 3px; border: 2px dashed var(--ink); border-radius: 20px; background: #fff6cf; }
details.ask > summary::-webkit-details-marker { display: none; } details.ask > summary:hover { background: var(--sun2); } details.ask[open] > summary { display: none; } details.ask .adv { margin: 0; }
.gl { border-bottom: 2.5px dotted var(--grape); cursor: help; }
#gloss { position: fixed; z-index: 70; padding: 8px 12px; font-size: 13.5px; line-height: 1.35; background: #f3ecff; border-width: 2.5px; border-radius: 14px; box-shadow: var(--pop-s); }
#gloss b { text-transform: capitalize; font-family: var(--display); font-weight: 600; margin-right: 4px; }

/* ---------- a decision: choices side by side, each a card with chips and (for the big ones) two bars ---------- */
.dcard .lead { font-size: 16.5px; }
.opts { display: grid; gap: 10px; margin-top: 14px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); } .opts.n1 { --n: 1; } .opts.n3 { --n: 3; } .opts.n4 { --n: 4; }
.opt-card { border: 2.5px solid var(--ink); background: #fff; border-radius: 16px; padding: 11px 12px 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 0 var(--ink); font: inherit; color: inherit; transition: transform 0.06s, box-shadow 0.06s, background 0.15s; }
.opt-card:hover { background: var(--paper2); } .opt-card:active { transform: translateY(4px); box-shadow: none; } .opt-card:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.opt-card .ol { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.15; }
.opt-card.keep { background: #f3f1ea; border-style: dashed; } .opt-card.keep:hover { background: #ebe8dc; }
.opt-card.chosen { background: var(--sun); border-style: solid; } .opt-card.dim { opacity: 0.42; box-shadow: none; } .opt-card:disabled { cursor: default; transform: none; }
.chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cc { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; padding: 1px 8px; border-radius: 20px; border: 2px solid var(--ink); background: #fff; max-width: 100%; }
.cc.good { background: #c5f5d9; } .cc.bad { background: #ffd0d0; } .cc.joy { background: #ffe1ef; } .cc.joy svg { fill: #ff8fa3; } .cc.risk { background: #fff0b8; }
.cc .dots { display: inline-flex; gap: 2px; margin-left: 2px; } .cc .dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fff; }
.cc.r1 .dots i:nth-child(-n+1), .cc.r2 .dots i:nth-child(-n+2), .cc.r3 .dots i { background: var(--coral); }
.bars { display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: 7px; border-top: 2px dashed var(--line2); }
.bar-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 6px; align-items: center; font-size: 12px; } .bar-row em { font-style: normal; color: var(--txt2); font-weight: 800; white-space: nowrap; } .bar-row b { font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--sky); } .bar i.neg { background: var(--coral); }
.fundline { display: block; font-size: 12px; line-height: 1.35; font-weight: 600; color: var(--txt2); padding-top: 7px; border-top: 2px dashed var(--line2); }
.lockline { font-size: 11.5px; font-weight: 800; color: var(--txt2); display: flex; gap: 4px; align-items: center; }
.bars-note { margin-top: 8px; text-align: center; font-size: 12px; }
@media (max-width: 700px) { .opts, .opts.n3, .opts.n4 { grid-template-columns: 1fr; } .chips { flex-direction: row; flex-wrap: wrap; } }

/* ---------- the year on one screen ---------- */
.yr-hero { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.hero-t { border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 12px; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.hero-t .k { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); }
.hero-t > b { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.12; white-space: nowrap; } .hero-t > b small { font-size: 14px; color: var(--txt2); } .hero-t > b svg { fill: #ff8fa3; margin-right: 4px; }
.hero-t.nwt { background: #c9f2ff; } .hero-t.joyt { background: #ffe1ef; } .hero-t > span:last-child { font-size: 13px; font-weight: 800; }
.crowns { display: grid; grid-template-columns: repeat(var(--n, 9), 1fr); gap: 4px; margin-top: 16px; }
.crown { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.crown .blob { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--ink); background: #eeece2; display: grid; place-items: center; position: relative; } .crown .blob > svg { width: 19px; height: 19px; }
.crown.mine .blob { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.cap { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-8deg); line-height: 0; } .cap svg { width: 21px; height: 21px; fill: var(--sun); }
.crown b { font-family: var(--display); font-weight: 600; font-size: 13px; } .crown em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#panel .crowns { grid-template-columns: repeat(5, 1fr); row-gap: 16px; }
.headline { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 8px 11px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff0b8; font-weight: 800; } .headline svg { width: 20px; height: 20px; }
.says { display: flex; gap: 9px; align-items: center; margin-top: 10px; font-size: 14px; } .says b { font-family: var(--display); font-weight: 600; }
.chip.ok { background: #c5f5d9; } .chip.no { background: #ffd0d0; } .chip.trophy { background: var(--sun2); }
.starrow { display: inline-flex; gap: 1px; vertical-align: -3px; } .starrow svg { width: 15px; height: 15px; fill: #e6e3d6; } .starrow i.on svg { fill: var(--sun); }
.chap-stars { text-align: center; margin: 12px 0 8px; } .chap-stars .starrow svg { width: 46px; height: 46px; stroke-width: 1.7; }
.chap .card { margin-top: 10px; }
.quiz { margin-top: 12px; } .quiz .choices { margin-top: 8px; }
.yr .m-foot .btn svg { margin-right: 5px; }
@media (max-width: 700px) { .crowns { grid-template-columns: repeat(5, 1fr); row-gap: 14px; } .yr-hero { grid-template-columns: 1fr 1fr; } .hero-t.nwt { grid-column: 1 / -1; } }

/* ---------- crowns worn, the trophy shelf, quests and dreams ---------- */
.won { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 26px 0 8px; }
.won-c { display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 96px; text-align: center; }
.won-c .blob { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--ink); background: var(--sun); display: grid; place-items: center; position: relative; box-shadow: var(--pop-s); } .won-c .blob > svg { width: 32px; height: 32px; }
.won-c .cap { top: -24px; } .won-c .cap svg { width: 36px; height: 36px; } .won-c b { font-family: var(--display); font-weight: 600; font-size: 13.5px; line-height: 1.15; }
.mini-blob { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--ink); background: #eeece2; display: inline-grid; place-items: center; flex: none; } .mini-blob svg { width: 17px; height: 17px; } .mini-blob.mine { background: var(--sun); }
.crown-t td.r > svg { width: 22px; height: 22px; fill: var(--sun); }
.ring { position: relative; width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; } .ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring .bg { fill: #fff; stroke: var(--line2); stroke-width: 4; } .ring .fg { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; } .ring.done .fg { stroke: var(--orange); }
.ring > i { position: relative; display: grid; } .ring > i svg { width: 19px; height: 19px; }
.quest, .dream { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 2px dashed var(--line); } .quest:first-child, .dk-k + .dream { border-top: 0; }
.quest[data-act] { cursor: pointer; } .quest b, .dream b { font-family: var(--display); font-weight: 600; } .quest .meter { margin-top: 4px; height: 10px; } .dream.done b { color: var(--good); }
.chapc .goals { margin-top: 10px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px; }
.tro { height: 40px; border-radius: 12px; border: 2.5px solid var(--ink); display: grid; place-items: center; background: #eeece2; color: #a9a79b; } .tro svg { width: 20px; height: 20px; } .tro.got { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.dpicks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.inforce .chip { white-space: normal; max-width: 100%; text-align: left; } .dream .grow { flex: 1; min-width: 0; } .dpick .joyc, .dream .joyc { white-space: normal; }
.dpick { border: 2.5px solid var(--ink); background: #fff; border-radius: 16px; padding: 10px 5px 9px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font: inherit; color: inherit; }
.dpick .blob { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--ink); background: #ffe1ef; display: grid; place-items: center; } .dpick .blob svg { width: 22px; height: 22px; }
.dpick b { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.15; } .dpick small { font-size: 11.5px; color: var(--txt2); font-weight: 800; }
.dpick:hover { background: var(--paper2); } .dpick.on { background: var(--sun); box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px); } .dpick:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
@media (max-width: 700px) { .dpicks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- what to aim at, in the corner of the map ---------- */
#quests { position: fixed; left: 102px; bottom: 86px; z-index: 15; width: 232px; padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; border-width: 2.5px; box-shadow: var(--pop-s); }
#quests:hover { background: var(--paper2); } #quests:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.qrow { display: flex; gap: 8px; align-items: center; min-width: 0; } .qrow b { font-family: var(--display); font-weight: 600; font-size: 13.5px; line-height: 1.15; flex: 1; min-width: 0; }
.qrow .ring { width: 30px; height: 30px; } .qrow .ring > i svg { width: 14px; height: 14px; } .qrow .mini-blob { width: 30px; height: 30px; } .qrow .mini-blob svg { width: 15px; height: 15px; }
.qrow.chap { padding-bottom: 5px; border-bottom: 2px dashed var(--line2); margin-bottom: 1px; }
.gdots { display: inline-flex; gap: 3px; flex: none; } .gdots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; } .gdots i.ok { background: var(--mint); } .gdots i.no { background: #ffc9c9; }
.later-note { margin-top: 8px; text-align: center; font-size: 12px; } .later-note svg { margin-right: 4px; }
@media (max-width: 1100px) { #quests { bottom: 64px; } }
@media (max-width: 860px), (max-height: 700px) { #quests { display: none; } }

/* ---------- the money split ---------- */
.alloc-bar { position: relative; display: flex; height: 34px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; margin: 14px 4px 24px; touch-action: none; }
.alloc-bar .sg { display: block; height: 100%; min-width: 0; } .alloc-bar .sg:first-child { border-radius: 9px 0 0 9px; } .alloc-bar .sg:last-of-type { border-radius: 0 9px 9px 0; }
.alloc-bar .hd { position: absolute; top: -8px; width: 22px; height: 45px; margin-left: -11px; border-radius: 9px; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: ew-resize; touch-action: none; z-index: 2; }
.alloc-bar .hd::before { content: ""; position: absolute; inset: 11px 6px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); } .alloc-bar .hd.on, .alloc-bar .hd:hover { background: var(--sun); }
.alloc-bar .res { position: absolute; top: 100%; height: 8px; border-left: 2.5px dashed var(--ink); } .alloc-bar .res u { position: absolute; top: 7px; left: -24px; font: 800 10.5px var(--font); color: var(--txt2); text-decoration: none; white-space: nowrap; }
.alloc-leg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 16px; font-size: 13.5px; } .alloc-leg > span { display: flex; gap: 6px; align-items: center; } .alloc-leg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.alloc-read { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 9px; padding: 6px 10px; border-radius: 12px; background: #f1fbff; border: 2px solid var(--ink); font-size: 13px; align-items: baseline; } .alloc-read b { font-family: var(--display); font-weight: 600; font-size: 15.5px; }
@media (pointer: coarse) { .alloc-bar { height: 40px; } .alloc-bar .hd { width: 30px; margin-left: -15px; height: 52px; } }

/* ---------- the race: the year as it runs ---------- */
#race { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 17; width: 440px; max-width: calc(100vw - 16px); padding: 10px 12px; }
.race-head { display: flex; gap: 10px; align-items: center; margin-bottom: 7px; } .race-head b { font-family: var(--display); font-weight: 600; font-size: 17px; width: 84px; white-space: nowrap; }
.race-bar { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; overflow: hidden; } .race-bar i { display: block; height: 100%; background: var(--coral); transition: width 0.2s linear; }
.race-rows { position: relative; } .rr { position: absolute; left: 0; right: 0; top: 0; height: 28px; display: grid; grid-template-columns: 24px 56px 1fr 62px; gap: 6px; align-items: center; transition: transform 0.25s ease; font-size: 13px; }
.rr .rn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rr.you .rn { font-weight: 900; }
.rr .rb { height: 14px; border: 2px solid var(--ink); border-radius: 7px; background: #fff; overflow: hidden; } .rr .rb i { display: block; height: 100%; transition: width 0.22s linear; } .rr.you .rb { box-shadow: 0 0 0 2.5px var(--sun); }
.rr .rv { text-align: right; font-variant-numeric: tabular-nums; }
.race-ticks { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; min-height: 26px; }
.tk { align-self: flex-start; font-size: 12.5px; font-weight: 800; padding: 1px 9px; border-radius: 20px; border: 2px solid var(--ink); background: #fff; animation: pop 0.2s; max-width: 100%; }
.tk.bad { background: #ffd0d0; } .tk.good { background: #c5f5d9; } .tk.star { background: var(--sun2); } .tk:nth-child(n+2) { opacity: 0.55; }
body.panel-open #race { left: calc(50% + 280px); }

@media (max-width: 860px) {
  #rail button { font-size: 9.5px; } #rail .rail-sep { display: none; } #rail button .blob { width: 28px; height: 28px; } #rail .badge { right: 2px; }
  #race, body.panel-open #race { left: 50%; bottom: 76px; } .dd { width: 32px; height: 32px; }
  /* (U2) the turn box sits at left 50%, so by itself it may only be half the screen wide and the desk dots were
     squeezed; it takes the width its content needs, up to the screen less a small margin, and the dots wrap after that */
  #turn { width: max-content; max-width: calc(100vw - 16px); }
  #advisor, body.panel-open #advisor, body.panel-open.insp-open #advisor { bottom: 190px; } #toasts { bottom: 186px; } #advisor:not([hidden]) ~ #toasts { bottom: 310px; }
  .hero-t > b { font-size: 24px; }
}

/* ===================== version 7: hover cards, Q, storms, risk, the Wealth pie, the World board, the national bank ===================== */
/* hover cards: every economic word and number explains itself in the colours of the game */
#tipcard { position: fixed; z-index: 90; padding: 9px 12px 10px; font-size: 13.5px; line-height: 1.38; border-width: 2.5px; border-radius: 16px; box-shadow: var(--pop-s); pointer-events: none; background: #fffdf5; }
#tipcard.plain { padding: 6px 11px; font-size: 13px; background: #f3ecff; }
#tipcard .tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } #tipcard .tc-head b { font-family: var(--display); font-weight: 600; font-size: 15.5px; }
#tipcard .tc-blob { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; border: 2px solid var(--ink); flex: none; } #tipcard .tc-blob svg { width: 17px; height: 17px; }
#tipcard .tc-now { margin-top: 6px; padding: 3px 9px; border-radius: 10px; background: #fff3c4; border: 2px solid var(--ink); font-weight: 800; display: inline-block; }
#tipcard .tc-you { display: flex; gap: 7px; align-items: flex-start; margin-top: 7px; color: var(--txt2); } #tipcard .tc-you .av { flex: none; }
.tipw { cursor: help; border-bottom: 2px dotted var(--line2); } [data-tip] { cursor: help; } .btn[data-tip], button[data-tip], [data-act][data-tip] { cursor: pointer; }
.realtag { display: inline-flex; font-size: 11.5px; font-weight: 800; padding: 0 8px; border-radius: 12px; background: #e7f6ff; border: 2px solid var(--ink); margin-left: 6px; }
#hud .tools .icon-btn.on { background: var(--sun); }

/* the start: the five capitals */
.capitals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 6px; }
.capitals .cap { border: 2.5px solid var(--ink); background: #fff; border-radius: 13px; padding: 5px 4px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0; font-family: var(--display); }
.capitals .cap b { font-weight: 600; font-size: 13.5px; } .capitals .cap small { font: 700 11px var(--font); color: var(--txt2); } .capitals .cap .dot { width: 10px; height: 10px; }
.capitals .cap.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }

/* the year's report: crowns that changed heads, "if you had held", the bank */
.crown-news { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .crown-news .chip { white-space: normal; padding: 3px 10px; } .crown-news svg { width: 14px; height: 14px; }
.sec.ghost { margin-top: 12px; padding: 8px 10px; border: 2.5px dashed var(--line2); border-radius: 14px; background: #fbfdff; } .sec.ghost h3 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tiles.four { grid-template-columns: repeat(4, 1fr); } .tiles.four .tile .v { font-size: 16.5px; }

/* the story of a life */
.story { position: relative; height: calc(var(--lanes) * 30px + 30px); margin: 10px 4px 0; border-bottom: 3px solid var(--ink); }
.story .st-dot { position: absolute; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 9px; background: var(--sun2); border: 2px solid var(--ink); display: grid; place-items: center; cursor: help; }
.story .st-dot svg { width: 15px; height: 15px; }
.story .st-band { position: absolute; top: 0; bottom: 0; background: rgba(76, 201, 240, 0.18); border-radius: 8px; }
.story .st-axis { position: absolute; left: 0; right: 0; bottom: -20px; height: 18px; } .story .st-axis span { position: absolute; transform: translateX(-50%); font-size: 11.5px; font-weight: 800; color: var(--txt2); }
.story + * { margin-top: 26px; }

/* My lives */
.lives-wrap { overflow-x: auto; margin-top: 10px; } .t.lives th { text-align: left; vertical-align: top; min-width: 90px; } .t.lives td { vertical-align: top; min-width: 150px; } .t.lives .chip { margin: 1px 0; }

/* a year's range: bad, usual, good — and the worst year so far */
.range { margin-top: 8px; } .rg-track { position: relative; height: 16px; border-radius: 9px; border: 2px solid var(--ink); background: linear-gradient(90deg, #ffd0d0, #fff7d6 50%, #c5f5d9); }
.rg-zero { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: 0.35; }
.rg-band { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: rgba(35, 41, 73, 0.14); }
.rg-track b { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--ink); }
.rg-track .rg-bad { background: var(--coral); } .rg-track .rg-usual { background: #fff; width: 14px; height: 14px; } .rg-track .rg-good { background: var(--mint); }
.rg-track .rg-worst { width: 4px; height: 22px; border-radius: 2px; background: var(--ink); border: 0; }
.rg-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 12px; font-weight: 800; } .rg-legend .rg-w { color: var(--ink); }

/* the stress test */
.stress .st-hero { display: flex; gap: 8px; margin-bottom: 8px; } .stress .st-hero > div { flex: 1; background: #fff3f0; border: 2.5px solid var(--ink); border-radius: 14px; padding: 5px 9px; display: flex; flex-direction: column; }
.stress .st-hero > div > span { font-size: 11px; font-weight: 800; color: var(--txt2); text-transform: uppercase; letter-spacing: 0.04em; } .stress .st-hero b { font-family: var(--display); font-weight: 600; font-size: 19px; }
.st-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; } .st-row small { font-weight: 700; } .st-row b { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.st-bar { width: 90px; height: 10px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; overflow: hidden; } .st-bar i { display: block; height: 100%; background: var(--coral); }

/* the Wealth pie */
.wealth-pie .wp-main { display: flex; gap: 14px; align-items: center; }
.wp-ring { position: relative; flex: none; } .wp-ring .donut { display: block; } .wp-ring .donut path, .wp-ring .donut circle { cursor: help; }
.wp-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: auto; }
.wp-mid > span { font-size: 11px; font-weight: 800; color: var(--txt2); text-transform: uppercase; } .wp-mid b { font-family: var(--display); font-weight: 600; font-size: 19px; }
.wp-legend { flex: 1; min-width: 0; } .wp-li { display: flex; align-items: center; gap: 7px; padding: 3px 0; border-bottom: 1.5px solid var(--line); } .wp-li:last-child { border-bottom: 0; }
.wp-li i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--ink); flex: none; } .wp-li b { font-variant-numeric: tabular-nums; } .wp-li small { width: 36px; text-align: right; color: var(--txt2); font-weight: 800; }
.wp-debt { margin-top: 10px; } .wp-bar { display: flex; height: 14px; border-radius: 8px; border: 2px solid var(--ink); overflow: hidden; background: #fff; }
.wp-bar .own { background: var(--mint); } .wp-bar .owe { background: var(--coral); border-left: 2px solid #fff; }
.wp-cmp { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border: 2px dashed var(--line2); border-radius: 14px; }
.wp-ring.sm .donut { width: 104px; height: 104px; } .wp-mini { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; font-weight: 700; color: var(--txt2); margin-top: 3px; } .wp-mini i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; border: 1.5px solid var(--ink); }

/* the World board */
.tabs.six button { font-size: 13px; padding: 6px 1px; }
.board-best { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 15px; margin: 2px 0 4px; } .board-best b { font-family: var(--display); font-weight: 600; font-size: 22px; }
.t.board td, .t.board th { padding-left: 4px; padding-right: 4px; } .t.board td .chip { margin-top: 2px; font-size: 11px; } .t.board td .chip svg { width: 12px; height: 12px; }
.lt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); margin-right: 4px; vertical-align: 0; } .lt.g { background: var(--mint); } .lt.y { background: var(--sun); } .lt.r { background: var(--coral); }
.qcard { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; background: #f3ecff; } .qcard svg { width: 22px; height: 22px; }
.card.pres .mini-blob { background: #ffe3c2; }

/* the national bank */
.rate-big { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 8px; } .rate-big b { font-family: var(--display); font-weight: 600; font-size: 34px; min-width: 120px; text-align: center; }
.rate-big .btn { min-width: 46px; } input[type="range"][data-in="g-rate"] { width: 100%; }
.fc-box { margin-top: 10px; padding: 7px 9px; border-radius: 14px; border: 2px dashed var(--line2); background: #fbfdff; }
.fc-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; } .fc-row.mine span:first-child { font-weight: 800; }

@media (max-width: 860px) {
  .capitals { grid-template-columns: repeat(3, 1fr); }
  .wealth-pie .wp-main { flex-direction: column; align-items: stretch; } .wp-ring { align-self: center; }
  .tiles.four { grid-template-columns: repeat(2, 1fr); }
  .t.board { font-size: 12.5px; } .t.board th:nth-child(5), .t.board td:nth-child(5) { display: none; }
  .stress .st-hero b { font-size: 16px; } .st-bar { width: 54px; }
  #tipcard { max-width: calc(100vw - 16px); }
}

/* wide tables on a phone: tighter, and they scroll sideways rather than being cut */
.tx { overflow-x: auto; }
/* (U2) the cue of a table that scrolls sideways (UI.txCues sets the classes and adds the line "Swipe for more →"):
   a fade at the right edge while part of the table is out of sight; at the end the line stays in place but invisible */
.tx.more:not(.end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.tx-cue { text-align: right; font-size: 12px; font-weight: 800; color: var(--txt2); margin-top: 3px; }
.tx.end + .tx-cue { visibility: hidden; }
@media (max-width: 520px) { table.t th { font-size: 10px; letter-spacing: 0; padding: 4px 3px; } table.t td { padding-left: 3px; padding-right: 3px; } }

/* ===== v8: rent or buy, lessons ===== */
.rb-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; } .rb-ctl .seg { flex: 1 1 200px; } .rb-ctl > .btn { flex: 0 0 auto; }
.rb-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rb-tile { border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 10px; background: #fff; min-width: 0; position: relative; }
.rb-tile.best { box-shadow: 0 0 0 3px var(--sun) inset; background: #fffbe8; } .rb-tile.off { opacity: 0.65; background: var(--paper); }
.rb-k { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; font-size: 13px; } .rb-k > i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); flex: none; }
.rb-k { flex-wrap: nowrap; } .rb-k span { min-width: 0; line-height: 1.15; } .rb-ahead { font-size: 10.5px; padding: 0 6px; margin-top: 4px; } .rb-ahead svg { width: 11px; height: 11px; }
.rb-ctl .seg .btn small { display: block; }
.rb-v { font-family: var(--display); font-weight: 600; font-size: 21px; margin-top: 4px; }
.rb-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--txt2); margin-top: 2px; } .rb-row b { color: var(--txt); }
.rb-mini h3 { margin-top: 4px; }
.st-tabs { margin: 6px 0 4px; } .st-tabs .btn small { display: block; }
.ls-topic { margin-top: 10px; } .ls-th { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); margin-bottom: 6px; } .ls-th svg { width: 17px; height: 17px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-card { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; font: inherit; color: inherit; border: 2.5px solid var(--ink); border-radius: 16px; background: #fff; padding: 9px 12px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); margin-bottom: 6px; }
.ls-card:hover { background: var(--paper2); } .ls-card.on { background: var(--sun2); } .ls-card b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.ls-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; } .ls-best { font-size: 12px; font-weight: 800; color: var(--txt2); display: inline-flex; align-items: center; gap: 4px; }
.ls-best .starrow svg { width: 13px; height: 13px; }
.ls-soon { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; } .ls-soon .chip { background: var(--paper); font-weight: 700; border-style: dashed; cursor: help; }
.ls-detail { margin-top: 10px; background: #fffbe8; }
.ls-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px; } .ls-how > div { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 6px; background: #fff; font-weight: 700; font-size: 13px; } .ls-how svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-pred { margin-top: 10px; background: #f3ecff; } .ls-pred > b { display: flex; align-items: center; gap: 6px; } .ls-pred > b svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-pred .opts { margin-top: 6px; } .ls-pred .opt-card { align-items: center; text-align: center; }
.ls-act { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 2px dashed var(--line); } .ls-act:first-child { border-top: 0; }
.ls-r { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; background: #fff; flex: none; }
.ls-act.done .ls-r { background: var(--mint); } .ls-act.now .ls-r { background: var(--sun); }
.ls-score { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; } .ls-score b { font-family: var(--display); font-weight: 600; font-size: 34px; } .ls-score span { color: var(--txt2); font-weight: 700; }
.ls-score .starrow svg { width: 22px; height: 22px; }
.yr-hero.ls-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ex-q { padding: 8px 0; border-top: 2px dashed var(--line); } .ex-q:first-of-type { border-top: 0; }
.ex-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .ex-a .btn { text-align: left; white-space: normal; }
.ex-a .btn.right { background: #c5f5d9; } .ex-a .btn.wrong { background: #ffd0d0; } .ex-a .btn:disabled { opacity: 1; cursor: default; }
.ex-why { margin-top: 6px; }
.board .bm { display: flex; gap: 9px; align-items: center; padding: 6px 0; border-top: 2px dashed var(--line); } .board .bm:first-of-type { border-top: 0; }
.board .bm .btn { flex: none; min-width: 64px; }
@media (max-width: 560px) {
  .rb-paths { grid-template-columns: 1fr; } .rb-v { font-size: 19px; }
  .yr-hero.ls-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-how > div { font-size: 12px; }
}

/* ===== class games ===== */
#cg { position: fixed; inset: 0; z-index: 40; padding: 12px; background: rgba(21, 27, 61, 0.45); display: flex; }
#cg[hidden] { display: none; }
.cg-shell { width: 100%; max-width: 1260px; margin: 0 auto; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.cg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 3px solid var(--ink); background: var(--paper2); }
.cg-head .badge-ic, .cg-role .badge-ic { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--sun2); flex: none; }
.cg-head .badge-ic svg, .cg-role .badge-ic svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.cg-head b { font-family: var(--display); font-weight: 600; font-size: 19px; }
.cg-timer { font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; gap: 4px; } .cg-timer svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.cg-code { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 0.12em; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; padding: 2px 12px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.cg-cols { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 12px; padding: 12px; min-height: 0; flex: 1; }
.cg-side, .cg-main { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 8px 2px; }
.cg-side:empty, .cg-main:empty { display: none; }
#cg-body:empty { display: none; } #cg-body { padding: 16px; overflow-y: auto; }
.cg-wait { max-width: 560px; margin: 40px auto; text-align: center; } .cg-wait h2 { display: flex; align-items: center; justify-content: center; gap: 8px; } .cg-wait h2 svg { width: 26px; height: 26px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.cg-role { display: flex; gap: 10px; align-items: center; background: #fffbe8; }
.cg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cg-tiles .tile.good { background: #e6faf0; } .cg-tiles .tile.bad { background: #ffeaea; }
.cg-form .cg-f { margin-top: 8px; } .cg-fl { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.cg-num { display: flex; align-items: center; gap: 6px; } .cg-num input { width: 100px; text-align: center; font-size: 20px; font-weight: 800; padding: 6px; } .cg-num .btn { min-width: 44px; font-size: 20px; padding: 4px 0; } .cg-unit { font-weight: 800; font-size: 18px; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap .btn { flex: 1 1 110px; } .seg .btn small { display: block; }
.cg-go { width: 100%; margin-top: 10px; }
.cg-sent { display: flex; gap: 10px; align-items: center; background: #e6faf0; } .cg-sent svg { width: 26px; height: 26px; stroke: var(--ink); fill: none; stroke-width: 2.6; }
.cg-act { background: #f3ecff; } .cg-act .ls-pred { background: #fff; margin-top: 4px; }
.cg-line { display: flex; gap: 8px; align-items: center; font-weight: 700; } .cg-line svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2.2; flex: none; }
.cg-rev.good { background: #e6faf0; } .cg-rev.bad { background: #fff0e4; }
/* (U2) a ready-made talk line is a whole sentence: on a narrow screen it wraps inside its button instead of pushing the panel wider */
.cg-talk .btn { white-space: normal; text-align: left; max-width: 100%; }
.cg-talk .cg-msg { padding: 4px 0; border-top: 2px dashed var(--line); font-size: 13.5px; } .cg-talk .cg-msg.mine { color: var(--txt2); }
.cg-roster { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; } .cg-roster .chip.muted { opacity: 0.5; }
.cg-join { text-align: center; background: #fffbe8; } .cg-bigcode { font-family: var(--display); font-weight: 700; font-size: 64px; letter-spacing: 0.16em; margin: 4px 0; }
.cg-block .t td, .cg-block .t th { font-size: 13px; } .cg-block .t tr.total td { font-weight: 800; border-top: 2.5px solid var(--ink); }
.cg-chart { min-height: 40px; }
.cg-score { background: #fffbe8; }
.ls-join { background: #f3ecff; } .ls-join input { flex: 1; min-width: 0; font-weight: 800; letter-spacing: 0.1em; }
.ls-grid { display: grid; grid-template-columns: 1fr; gap: 0; } .ls-card .ls-best { margin-top: 3px; }
.chart-legend .lg-key.dot { width: 10px; height: 10px; border-radius: 50%; }
.ax-title { font-weight: 700; }
.cbars { display: flex; flex-direction: column; gap: 6px; } .cb-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.cb-row.mine { font-weight: 800; } .cb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cb-bar { height: 14px; background: var(--paper2); border-radius: 7px; overflow: hidden; border: 2px solid var(--ink); } .cb-bar i { display: block; height: 100%; } .cb-v { font-weight: 800; white-space: nowrap; }
@media (max-width: 860px) {
  /* (U2) minmax(0, 1fr), not 1fr: a plain 1fr column grows to its widest content, so one wide table made the whole
     side panel wider than the phone; now the column keeps the screen's width and a wide table scrolls in its own box */
  #cg { padding: 0; } .cg-shell { border-radius: 0; } .cg-cols { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow-y: auto; } .cg-side, .cg-main { overflow: visible; min-width: 0; }
  .cg-head { flex-wrap: wrap; } .cg-bigcode { font-size: 48px; }
}

/* ===== textbook diagrams ===== */
.dg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.dg-axis { fill: none; stroke: var(--ink); stroke-width: 2; }
.dg-ax { font-size: 11px; font-weight: 800; fill: var(--txt2); }
.dg-l { fill: none; stroke-width: 2.4; stroke-linecap: round; } .dg-l.a { stroke: #2a78d6; } .dg-l.b { stroke: #eb6834; } .dg-l.c { stroke: #4a3aa7; } .dg-l.d { stroke: #1baf7a; } .dg-l.dash { stroke-dasharray: 6 5; }
.dg-fill { stroke: none; } .dg-fill.a { fill: rgba(42, 120, 214, 0.16); } .dg-fill.b { fill: rgba(235, 104, 52, 0.16); } .dg-fill.c { fill: rgba(237, 161, 0, 0.22); } .dg-fill.x { fill: rgba(214, 69, 69, 0.22); } .dg-fill.d { fill: rgba(27, 175, 122, 0.18); }
.dg-guide { fill: none; stroke: #9aa0a6; stroke-width: 1.2; stroke-dasharray: 3 3; }
.dg-t { font-size: 11px; fill: var(--txt); } .dg-t.strong { font-weight: 800; } .dg-t.a { fill: #2a78d6; font-weight: 800; } .dg-t.b { fill: #eb6834; font-weight: 800; } .dg-t.c { fill: #4a3aa7; font-weight: 800; }
.dg-dot { fill: var(--ink); } .dg-arrow { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.dg-bar.a { fill: #2a78d6; } .dg-bar.b { fill: #eb6834; } .dg-bar.c { fill: #1baf7a; }
.dg-cell { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }

/* ===== a business of your own (bizui.js) ===== */
/* the desk's head: the name, what and where, how it is going */
.bz-head .row { align-items: flex-start; }
.bz-blob { width: 46px; height: 46px; border-radius: 14px; border: 2.5px solid var(--ink); background: #c8ef8e; display: grid; place-items: center; flex: none; box-shadow: 0 3px 0 var(--ink); } .bz-blob svg { width: 26px; height: 26px; }
.bz-name { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.15; display: block; }
.bz-worth { display: flex; flex-direction: column; align-items: flex-end; flex: none; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 12px; background: #fff3c4; }
.bz-worth > span { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); } .bz-worth b { font-family: var(--display); font-weight: 600; font-size: 17px; white-space: nowrap; }
.bz-verdict { margin-top: 8px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--ink); background: #f1fbff; font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.bz-verdict.good { background: #dcf8e6; } .bz-verdict.warn { background: #fff0b8; } .bz-verdict.bad { background: #ffd9d4; }
/* the preview in four numbers: stays at the top of the desk while the controls below it move */
.bz-sticky { position: sticky; top: -14px; z-index: 4; margin: 8px -16px 0; padding: 8px 16px 6px; background: var(--paper); border-bottom: 2.5px dashed var(--line2); }
.bz-live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bz-live > div { min-width: 0; border: 2.5px solid var(--ink); border-radius: 13px; background: #fff; padding: 4px 8px 5px; display: flex; flex-direction: column; line-height: 1.15; }
.bz-live > div:nth-child(1) { background: #fff3c4; } .bz-live > div:nth-child(2) { background: #dcf8e6; } .bz-live > div:nth-child(3) { background: #d7f5ff; } .bz-live > div:nth-child(4) { background: #ffe1ef; }
.bz-live > div > span { font-size: 10.5px; font-weight: 800; color: var(--txt2); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-live b { font-family: var(--display); font-weight: 600; font-size: 18px; white-space: nowrap; } .bz-live b em { font: 700 11px var(--font); font-style: normal; color: var(--txt2); }
.bz-live small { font-size: 11px; font-weight: 700; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-run { display: flex; gap: 6px; align-items: center; margin-top: 5px; font-size: 12.5px; font-weight: 800; } .bz-run.ok { color: var(--good); } .bz-run.bad { color: var(--bad); } .bz-run.warn { color: var(--warn); }
.bz-prev { margin-top: 10px; } .bz-prev #bz-ch { margin-top: 6px; }
.bz-row2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; } .bz-row2 > span:first-child { font-family: var(--display); font-weight: 600; font-size: 14.5px; }
/* the four decisions */
.bz-dec { margin-top: 10px; } .bz-dec .seg { margin-top: 4px; } .bz-dec .seg .btn.sm { display: flex; flex-direction: column; align-items: center; line-height: 1.12; padding: 4px 4px 5px; white-space: normal; } .bz-dec .seg .btn small { font: 700 10.5px/1.15 var(--font); opacity: 0.75; }
.bz-k { display: flex; align-items: center; gap: 8px; } .bz-n { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--sun); display: grid; place-items: center; font: 800 13px/1 var(--font); font-style: normal; flex: none; }
.bz-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 2px 0 2px; } .bz-big b { font-family: var(--display); font-weight: 600; font-size: 26px; }
.bz-slide { position: relative; } .bz-mark { position: absolute; top: -1px; width: 4px; height: 24px; margin-left: -2px; border-radius: 2px; background: var(--ink); opacity: 0.55; pointer-events: auto; }
.bz-scale { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; color: var(--txt2); margin-top: -2px; }
.bz-el { margin-top: 6px; padding: 7px 10px; border-radius: 12px; background: #f1fbff; border: 2px solid var(--ink); }
.bz-el-row { display: grid; grid-template-columns: 82px 1fr 1fr; gap: 6px; font-size: 13px; padding: 1px 0; } .bz-el-row > span { color: var(--txt2); font-weight: 800; } .bz-el-row b { font-variant-numeric: tabular-nums; }
.bz-el .note { margin-top: 3px; }
.bz-stepper { display: flex; align-items: center; gap: 10px; margin: 4px 0; flex-wrap: wrap; } .bz-stepper .btn { min-width: 40px; font-size: 18px; }
.bz-stepper > b { font-family: var(--display); font-weight: 600; font-size: 19px; display: flex; flex-direction: column; line-height: 1.1; min-width: 96px; text-align: center; } .bz-stepper > b small { font: 700 11.5px var(--font); color: var(--txt2); }
.bz-pl { flex-basis: 100%; }
.bz-why { margin: 4px 0 2px; font-size: 13px; line-height: 1.38; } .warn-box.bz-why { padding: 6px 10px; font-weight: 700; } .warn-box.bz-why svg { margin-right: 2px; }
.bz-sub { margin-top: 10px; }
.chart.bz-mp { display: block; margin-top: 4px; overflow: visible; }
.bz-mp-could { fill: #e3ebf7; stroke: var(--ink); stroke-width: 1.6; } .bz-mp-could.hired { fill: #fff0b0; } .bz-mp-came { fill: #2a78d6; stroke: var(--ink); stroke-width: 1.6; }
.bz-wage { stroke: #eb6834; stroke-width: 2.4; stroke-dasharray: 6 4; } .bz-now { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 3 3; } .chart .tick.bz-hired { fill: var(--txt); font-weight: 900; }
.dot.bz-k-could { background: #e3ebf7; } .dot.bz-k-came { background: #2a78d6; } .bz-k-wage { display: inline-block; width: 18px; height: 0; border-top: 2.6px dashed #eb6834; }
.bz-more { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line2); }
.seg.bz-cush .btn.sm { min-width: 0; }
/* a list of shop units: the best first */
.bz-units { display: flex; flex-direction: column; gap: 5px; }
.bz-unit { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 6px 9px; cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.bz-unit:hover { background: var(--paper2); } .bz-unit.on { background: var(--sun2); box-shadow: 0 0 0 2.5px var(--sun), 0 2px 0 var(--ink); } .bz-unit.off { opacity: 0.6; }
.bz-unit .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; } .bz-unit .grow b { font-family: var(--display); font-weight: 600; font-size: 14.5px; } .bz-unit small { font-size: 11.5px; font-weight: 700; color: var(--txt2); }
.bz-unit .stars { font-size: 11px; }
.bz-un { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; font: 800 12px/1 var(--font); flex: none; } .bz-unit.on .bz-un { background: var(--coral); color: #fff; }
.bz-ur { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-weight: 800; flex: none; max-width: 42%; } .bz-ur small { white-space: normal; }
/* the street */
.t.bz-rv td, .t.bz-rv th { padding-top: 5px; padding-bottom: 5px; } .t.bz-rv .chip { font-size: 10.5px; padding: 0 6px; }
/* what the numbers say */
.bz-num { margin-top: 16px; } .bz-tabbody { min-height: 60px; }
.adv.bz-idea { background: #f3ecff; border-style: solid; } .adv.bz-idea .chip { margin-right: 4px; white-space: normal; } .adv.bz-idea .chip svg { margin-right: 2px; }
.stack.bz-stack { height: 20px; } .stack.bz-stack i { border-right: 2px solid var(--ink); }
.bz-kpis { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--txt2); font-weight: 700; } .bz-kpis b { color: var(--txt); font-family: var(--display); font-weight: 600; font-size: 16px; }
.bz-wf { display: flex; flex-direction: column; gap: 4px; }
.bz-wr { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(50px, 0.75fr) 70px; gap: 8px; align-items: center; font-size: 13px; } .bz-wr > span:first-child { color: var(--txt2); font-weight: 700; line-height: 1.25; } .bz-wr > b { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bz-wr.total { border-top: 2.5px solid var(--ink); padding-top: 5px; margin-top: 2px; } .bz-wr.total > span:first-child { color: var(--txt); font-weight: 800; }
.bz-wbar { height: 12px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; overflow: hidden; } .bz-wbar i { display: block; height: 100%; background: var(--mint); } .bz-wbar i.neg { background: var(--coral); }
/* the trial runs: ten dots for the closings, and the bad, usual and good case */
.bz-odd { padding: 8px 0; border-top: 2px dashed var(--line); } .bz-odds .bz-odd:first-of-type, .bz-odd:first-child { border-top: 0; padding-top: 2px; }
.bz-odd-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .bz-odd-h > b { flex: 1 1 160px; min-width: 0; font-family: var(--display); font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.bz-ten { display: inline-flex; gap: 2px; cursor: help; } .bz-ten i { width: 10px; height: 10px; border-radius: 50%; border: 1.8px solid var(--ink); background: var(--mint); } .bz-ten i.x { background: var(--coral); }
.range.mrange { margin-top: 6px; } .range.mrange .rg-legend .muted { font-weight: 700; }
.bz-crisis .tiles .tile .v { font-size: 17px; }
.bz-pick-note { margin-top: 6px; }
/* the year's report */
.bz-yr { margin-top: 12px; padding: 9px 11px; border: 2.5px solid var(--ink); border-radius: 16px; background: #f4ffe6; }
.bz-yr > .row b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.bz-yr-n { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.bz-yr-n > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; } .bz-yr-n > div > span { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--txt2); } .bz-yr-n b { font-family: var(--display); font-weight: 600; font-size: 17px; white-space: nowrap; } .bz-yr-n small { font-size: 11.5px; font-weight: 800; }
.bz-yr .adv { margin-bottom: 0; }
/* Life ▸ Business: the ways to pay */
.bz-pks { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 7px; }
.bz-pk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; color: inherit; border: 2.5px solid var(--ink); border-radius: 15px; background: #fff; padding: 8px 9px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); min-width: 0; }
.bz-pk:hover { background: var(--paper2); } .bz-pk.on { background: var(--sun2); box-shadow: 0 0 0 2.5px var(--sun), 0 3px 0 var(--ink); } .bz-pk.off { opacity: 0.62; box-shadow: none; cursor: not-allowed; }
.bz-pk-l { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.15; } .bz-pk-v { font-family: var(--display); font-weight: 600; font-size: 20px; } .bz-pk > small { line-height: 1.2; }
.bz-pkr { display: flex; justify-content: space-between; gap: 6px; width: 100%; font-size: 12px; } .bz-pkr > span { color: var(--txt2); font-weight: 700; } .bz-pkr b { white-space: nowrap; }
.bz-pk .chip { margin-top: 4px; font-size: 11px; }
.bz-go .btn.big { white-space: normal; line-height: 1.2; }
.bz-fin { margin-top: 8px; } .bz-fin > summary { font-size: 14.5px; padding: 8px 0; } .bz-fin .seg { margin-bottom: 6px; } .bz-fin .seg .btn.sm { display: flex; flex-direction: column; align-items: center; line-height: 1.12; white-space: normal; } .bz-fin .seg .btn small { font: 700 10.5px/1.15 var(--font); opacity: 0.75; }
.bz-fr { margin-top: 6px; } .bz-fr .bz-row2 > b { font-family: var(--display); font-weight: 600; font-size: 16px; } .bz-fr .note { font-size: 12px; margin-top: -2px; }
.bz-finsum { display: flex; gap: 7px; align-items: flex-start; margin-top: 8px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--ink); font-weight: 700; font-size: 13px; line-height: 1.35; } .bz-finsum.ok { background: #dcf8e6; } .bz-finsum.bad { background: #ffe3df; } .bz-finsum svg { margin-top: 2px; }
.bz-insp { margin-top: 8px; background: #f4ffe6; } .bz-insp .stars { font-size: 13px; }
.bz-rl { margin-top: 2px; } .bz-rl svg { margin-right: 2px; }
.bz-story h3 svg { width: 16px; height: 16px; }
/* on the map: the business's sign, and the numbered units to choose from */
.biz-pin { pointer-events: none; } .biz-pin span { display: inline-block; position: relative; background: #c8ef8e; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 12.5px; padding: 2px 9px; border-radius: 12px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.biz-pin span::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.unit-pin { position: relative; width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); font: 800 13px/1 var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--ink); padding: 0; display: grid; place-items: center; }
.unit-pin::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -5px; border: 5px solid transparent; border-top: 7px solid var(--ink); border-bottom: 0; }
.unit-pin:hover { background: var(--sun2); } .unit-pin.on { background: var(--coral); color: #fff; width: 36px; height: 36px; font-size: 15px; }
@media (max-width: 860px) {
  .bz-sticky { margin: 8px -16px 0; }
  .bz-live b { font-size: 16px; } .bz-live > div { padding: 3px 6px 4px; } .bz-live > div > span { font-size: 9.5px; }
  .bz-yr-n { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bz-el-row { grid-template-columns: 74px 1fr 1fr; font-size: 12.5px; }
}
@media (max-width: 420px) {
  .bz-live { gap: 4px; } .bz-live > div { padding: 3px 5px 3px; border-radius: 11px; } .bz-live b { font-size: 14.5px; } .bz-live b em { font-size: 10px; } .bz-live > div > span { font-size: 8.5px; letter-spacing: 0; } .bz-live small { font-size: 9.5px; }
  .bz-pks { grid-template-columns: 1fr 1fr; }
  .bz-odds > h3 { flex-wrap: wrap; row-gap: 0; } .bz-odds > h3 .note { flex-basis: 100%; padding-left: 17px; }
}

/* ---------- class games, for a first-time player: the game's own lines, the act kept in view while deciding, the
   score rule, how to play (shown once), and the life version of a lesson on the shelf ---------- */
.cg-who { background: #eef6ff; font-size: 14.5px; line-height: 1.4; }
.cg-role { align-items: flex-start; } .cg-role .cg-how { margin-top: 5px; padding-top: 5px; border-top: 2px dashed var(--line); }
.cg-act .cg-pts { font-weight: 600; font-size: 13px; color: var(--txt2); }
.cg-mypred { display: flex; gap: 6px; align-items: flex-start; background: #fff; border: 2px dashed var(--line); border-radius: 10px; padding: 6px 8px; }
.cg-mypred svg { width: 16px; height: 16px; flex: none; margin-top: 2px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.cg-actnow { background: #f3ecff; padding: 8px 12px; }
.cg-actnow summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cg-actnow summary::-webkit-details-marker { display: none; }
.cg-actnow summary::after { content: '▸'; margin-left: auto; font-weight: 800; } .cg-actnow[open] summary::after { content: '▾'; }
.cg-head .cg-help { min-width: 34px; font-weight: 800; font-size: 16px; }
.cg-talk .btn small { display: block; font-weight: 600; font-size: 11px; opacity: 0.75; }
.cg-howto { width: 580px; }
.cg-hsteps { display: flex; flex-direction: column; gap: 11px; margin: 14px 0 6px; }
.cg-hstep { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.42; }
.cg-hstep svg { width: 22px; height: 22px; flex: none; margin-top: 1px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-alt { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); }
.ls-alt .note { flex: 1 1 220px; }
@media (max-width: 720px) {
  .cg-hstep { font-size: 14px; } .cg-howto .m-foot { flex-wrap: wrap; }
  .ls-alt .btn { width: 100%; }
}

/* ---------- lessons, for a first-time player (clarity audit, Part 2): the lesson's own part every time, the general
   how-to once on a device (open, skippable, and again behind the "?"), what "About the same" means, the unit of a reveal */
.lesson .ls-len { margin: 10px 0 0; font-weight: 700; } .lesson .ls-pts { margin: 4px 0 2px; line-height: 1.4; }
.ls-howto { margin-top: 10px; border: 2.5px solid var(--ink); border-radius: 14px; background: #f1fbff; padding: 0 12px; }
.ls-howto > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 0; font-family: var(--display); font-weight: 600; font-size: 15px; }
.ls-howto > summary::-webkit-details-marker { display: none; }
.ls-howto > summary::after { content: '▸'; margin-left: auto; font-weight: 800; } .ls-howto[open] > summary::after { content: '▾'; }
.ls-howto > summary svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-howto[open] { padding-bottom: 10px; }
.ls-hsteps { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 0; }
.lesson-help .ls-hsteps { margin-top: 12px; }
.ls-hstep { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.42; }
.ls-hstep > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ls-hstep .qs { vertical-align: -2px; }
.ls-pred .ls-same { margin-top: 6px; text-align: center; }
.ls-unit { margin: 8px 0 -2px; font-weight: 700; }
.lesson .m-foot { flex-wrap: wrap; }
@media (max-width: 560px) {
  .ls-hstep { font-size: 13.5px; }
  .lesson .m-foot .btn { flex: 1 1 auto; }
}

/* ---------- lessons for returning players (clarity audit, Part 4): the story played (one of several), the three stars,
   the best kept on this device, and the teacher's choice of story in a parallel class */
.chip.ls-story { margin-left: 5px; background: var(--paper2); }
.lesson .ls-xpnote { display: flex; gap: 6px; align-items: center; margin: 8px 0 0; font-weight: 800; color: var(--warn); }
.lesson .ls-xpnote svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; }
.ls-best { flex-wrap: wrap; line-height: 1.35; } .ls-xp { display: inline-flex; align-items: center; gap: 4px; }
.ls-bestrow { margin-top: 6px; }
.ls-stars { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 2px; font-size: 13px; font-weight: 700; color: var(--txt2); }
.ls-star.on { color: var(--txt); } .ls-star.on::first-letter { color: #c89400; }
.ls-bestnow { margin: 2px 0 4px; } .ls-bestnow .starrow svg { width: 13px; height: 13px; }
.ls-storysec { background: var(--paper2); border: 2px solid var(--line2); border-radius: 14px; padding: 8px 12px; }
.ls-storysec h3 { margin-top: 0; }
.par-story { margin-bottom: 10px; }
.par-story-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.par-story-opts .btn { white-space: normal; text-align: left; }
.par-story-all { margin-top: 4px; } .par-story-all > summary { cursor: pointer; } .par-story-all > div { margin: 4px 0 0; }
@media (max-width: 560px) {
  .par-story-opts .btn { flex: 1 1 40%; }
  .ls-stars { font-size: 12.5px; }
}

/* ---------- The Bank Board, one lesson (next round, Part C): its targets and points on the first screen, quick values
   next to the rate (the rate in force, the staff's), the story chip in a class game's head, and the bridge from the
   last day of a life whose forecasts were sharp ---------- */
.cg-targets { background: #eefaf3; }
.cg-targets > .dk-k { display: flex; align-items: center; gap: 6px; } .cg-targets > .dk-k svg { width: 17px; height: 17px; stroke: var(--ink); fill: none; stroke-width: 2.2; flex: none; }
.cg-tg-rows { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.cg-tg-row { display: flex; gap: 7px; align-items: flex-start; font-size: 13.5px; line-height: 1.38; }
.cg-tg-row svg { width: 17px; height: 17px; flex: none; margin-top: 1px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.t.cg-tg-pts td { font-size: 13px; padding-top: 3px; padding-bottom: 3px; } .t.cg-tg-pts td.r { white-space: nowrap; font-weight: 800; }
details.cg-targets { background: #eefaf3; } details.cg-targets[open] summary { margin-bottom: 4px; }
.cg-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.cg-head .chip.ls-story { vertical-align: 2px; } .cg-head .xp-tag { vertical-align: 2px; }
.cg-score .xp-tag { margin-left: 6px; }
.bank-bridge { display: flex; gap: 10px; align-items: center; margin-top: 12px; background: #eefaff; }
.bank-bridge > svg { width: 26px; height: 26px; flex: none; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.bank-bridge .btn { flex: none; } .bank-bridge > .grow { flex: 1 1 180px; min-width: 0; }
@media (max-width: 560px) {
  .bank-bridge { flex-wrap: wrap; } .bank-bridge .btn { width: 100%; }
  .cg-tg-row { font-size: 13px; }
}

/* ---------- with a desk open, the map's notes stay beside it, not under it (Q1) ---------- */
/* the legend goes right of the desk, above the turn box; toasts go where Mira and the turn box already go */
body.panel-open #quests { display: none; } /* it lay under the desk anyway */
body.panel-open #legend { left: 570px; bottom: 150px; max-width: 360px; }
body.panel-open #toasts { left: calc(50% + 280px); } body.panel-open .toast { max-width: 460px; }
@media (max-width: 1500px) { body.panel-open.insp-open #toasts { left: calc(50% + 84px); } }
@media (max-width: 1300px) { body.panel-open #legend { left: 524px; max-width: 300px; } }
/* a message with no button is only to be read: clicks pass through it to what lies under */
.toast:not(:has(button)) { pointer-events: none; }
/* the five capitals on the start card: .cap is also the crown's hat (absolute), keep these in the grid */
.capitals .cap { position: static; transform: none; top: auto; left: auto; line-height: normal; }
@media (max-width: 860px) {
  /* the desk covers the whole screen above the bottom bar, with its own Done button: the map's legend and the turn box lie under it */
  body.panel-open #legend, body.panel-open #turn, body.insp-open #turn { display: none; }
  body.insp-open #inspector { z-index: 22; }
  body.panel-open #toasts, body.panel-open.insp-open #toasts { left: 50%; } body.panel-open .toast { max-width: 100%; } /* (U4: the second selector beats the wide screens' "+ 84px" for a desk and the building card open together, which pushed a message's OK button off a phone screen) */
  /* (U4) a message with a button catches taps for 7 seconds, so on a phone it lies over no button. With no desk and no
     building card open it sits over the map, right under the top bar: the turn box, the map legend and the bottom bar
     stay free. With a desk or the building card open (they fill the screen) it sits right above the bottom bar, and
     the desk or card ends with room as tall as the messages (--toasts-h, measured in ui.js), so every button in it
     can be scrolled clear of them. */
  #toasts, #advisor:not([hidden]) ~ #toasts { top: calc(var(--hud-b, 104px) + 8px); bottom: auto; }
  body.panel-open #toasts, body.insp-open #toasts, body.panel-open #advisor:not([hidden]) ~ #toasts, body.insp-open #advisor:not([hidden]) ~ #toasts { top: auto; bottom: 70px; }
  body.panel-open #panel .p-body, body.insp-open #inspector .p-body { padding-bottom: calc(var(--toasts-h, 0px) + 18px); scroll-padding-bottom: var(--toasts-h, 0px); } /* (a button brought into view lands above the messages) */
}
.toast > div { min-width: 0; overflow-wrap: anywhere; } .toast .btn { flex: none; }

/* Lucky, the second advisor: his own colour (lilac, which the game uses for no money or warning), the border of Mira's */
.adv.lucky { background: #e9e4f7; } .adv.lucky b:first-child { color: #4b3f87; }
.adv.lucky .lk-ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: #4b3f87; } .adv.lucky .lk-ic svg { width: 14px; height: 14px; fill: currentColor; }
.lucky-intro { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; padding: 6px 10px; border-radius: 12px; background: #f1f1f4; font-size: 12.5px; line-height: 1.4; } .lucky-intro span { flex: 1; min-width: 0; }
.lk-year p, .lk-year ul { margin: 4px 0 0; } .lk-year ul { padding-left: 18px; } .lk-end .adv { margin: 4px 0; } .lk-apart { margin-top: 6px; }

/* Mira and Lucky in a class game: the round of advice */
.cg-advice .adv { margin-top: 6px; } .cg-advice .lk-who { margin-left: auto; align-self: flex-start; white-space: nowrap; }
.cg-lkbars { margin-top: 10px; }
/* "your world" on the end screen (N6) */
.world-place { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; background: #f6f8ff; }
.world-place > svg { width: 26px; height: 26px; flex: none; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.world-place > .grow { flex: 1 1 180px; min-width: 0; } .world-place .k { display: block; font-size: 12px; font-weight: 700; opacity: 0.7; }
.world-place .wp-leg + .wp-leg { margin-top: 8px; }
.chip.ach-new { white-space: normal; max-width: 100%; text-align: left; }
.sources { margin-top: 12px; } .sources .k { display: block; font-size: 12px; font-weight: 700; opacity: 0.7; }
.src-part { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0 0 10px; } .src-part b { white-space: nowrap; }
.src-t td { vertical-align: top; } .src-t td.r { white-space: nowrap; padding-left: 10px; } .src-t .src-sum td { border-top: 2px solid var(--line); padding-top: 6px; }

/* World of the week (N8) */
.week-card { background: #f6f8ff; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; margin: 6px 0 10px; } .week-card .k { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; flex: 1; } .week-card .k svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2.2; }

/* A whole life, together (task 102 Part 2; js/togetherui.js) */
.tg-pick { margin-bottom: 8px; } .tg-set h4 { margin: 12px 0 4px; } .tg-set .seg.wrap { flex-wrap: wrap; } .tg-set input[type="number"] { width: 120px; }
.tg-city { margin-bottom: 6px; } .tg-set .results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.tg-shell { min-height: 0; } .tg-shell .cg-head .tg-sub { font-size: 14px; }
.tg-main { padding: 14px; overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.tg-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tg-bigcode { font-size: clamp(48px, 9vw, 120px); }
.tg-rules { margin: 8px 0; padding-left: 20px; text-align: left; } .tg-rules li { margin: 3px 0; }
.tg-roster .chip { font-size: 16px; padding: 4px 10px; }
.tg-clock { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 6vw, 84px); line-height: 1.05; text-align: center; }
.tg-clock:empty, .tg-top:empty { display: none; }
.tg-ready { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 3vw, 40px); text-align: center; } .tg-away { text-align: center; font-size: clamp(15px, 2vw, 24px); color: var(--txt2); }
.tg-ctl { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; align-items: flex-end; } .tg-ctl:empty { display: none; }
.tg-paused { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 56px); text-align: center; background: var(--sun); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 14px; } .tg-paused[hidden] { display: none; }
.tg-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tg-table h3 { margin: 0 0 6px; font-size: clamp(16px, 2vw, 26px); } .tg-table table { width: 100%; } .tg-table td { font-size: clamp(14px, 1.7vw, 22px); padding: 4px 6px; }
.tg-ok { color: var(--mint-d, #14825a); font-weight: 800; }
.tg-list { margin: 8px 0 0; padding-left: 20px; } .tg-list li { margin: 4px 0; }
.tg-note { margin-top: 8px; padding: 6px 10px; border-radius: 12px; background: #fffbe8; border: 2px dashed var(--line2); }
.tg-line { text-align: center; font-weight: 700; }
#tgbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 4px 10px; min-height: 36px; border-radius: 0; border-width: 0 0 3px; font-size: 14px; font-weight: 700; background: var(--paper2); }
#tgbar .tg-r { white-space: nowrap; } #tgbar .tg-t { white-space: nowrap; font-family: var(--display); font-size: 16px; }
#tgbar .tg-warn { flex-basis: 100%; text-align: center; font-size: 13px; line-height: 1.3; color: #8a1d1d; background: #ffe4e0; border-radius: 10px; padding: 4px 8px; }
#tgover { position: fixed; inset: 0; z-index: 70; background: rgba(21, 27, 61, 0.7); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; text-align: center; } #tgover[hidden] { display: none; }
#tgover .m-card { width: 100%; max-width: min(440px, 100%); }
body.in-tg #hud { top: 46px; } body.in-tg #modal { padding-top: 46px; } body.in-tg .m-card { max-height: calc(100dvh - 76px); }
body.in-tg #toasts { z-index: 65; }
@media (min-width: 861px) { body.in-tg #rail, body.in-tg #panel, body.in-tg #inspector, body.in-tg .heat-key, body.in-tg #netwarn { top: 122px; } body.in-tg #inspector { max-height: calc(100dvh - 184px); } }
@media (max-width: 860px) { .tg-cols, .tg-tables { grid-template-columns: minmax(0, 1fr); } .tg-main { padding: 10px; } #tgbar { font-size: 13px; padding: 3px 8px; } #tgbar .tg-t { font-size: 14px; } }
/* (task 136: the host plays on the same screen; the host's bar sits under the clock bar, and the screen below it moves down by its height, --tgh) */
#tghost { position: fixed; left: 0; right: 0; top: 40px; z-index: 59; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 4px 10px; border-radius: 0; border-width: 0 0 3px; font-size: 14px; font-weight: 700; background: var(--paper); } #tghost[hidden] { display: none; }
#tghost .cg-code { font-size: 16px; padding: 2px 10px; } #tghost .tgh-ready { white-space: nowrap; } #tghost .tgh-away { color: var(--txt2); font-weight: 600; white-space: nowrap; } #tghost .tgh-min { display: flex; align-items: center; gap: 6px; } #tghost .tgh-min input[type="number"] { width: 70px; } #tghost .tgh-st { color: #8a1d1d; font-weight: 700; }
#tghost .tgh-names { color: var(--txt2); font-weight: 600; font-size: inherit; } /* (task 138: who has not pressed Ready, with no time limit; narrow screens show it in the window Run the game) */
#tghost .tgh-narrow { display: none; } #tghost .tgh-top { display: inline-flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; } #tghost .tgh-top:empty { display: none; } #tghost .tg-ready, #tghost .tg-away { font-family: inherit; font-size: inherit; text-align: left; }
#tghost .tgh-wide { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; } #tghost .tgh-btns { display: inline-flex; gap: 6px; } #tghost .tgh-min .seg { display: inline-flex; }
#tgrun { position: fixed; inset: 0; z-index: 72; background: rgba(21, 27, 61, 0.55); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; } #tgrun[hidden] { display: none; }
#tgrun .m-card { width: 100%; max-width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; } #tgrun .tg-ctl { display: flex; flex-direction: column; align-items: stretch; gap: 10px; } #tgrun .tgh-btns, #tgrun .tgh-min { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; } #tgrun .tgh-min input[type="number"] { width: 80px; } #tgrun .m-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
body.in-tghost #hud { top: calc(46px + var(--tgh, 0px)); } body.in-tghost #modal { padding-top: calc(46px + var(--tgh, 0px)); } body.in-tghost .m-card { max-height: calc(100dvh - 76px - var(--tgh, 0px)); }
@media (min-width: 861px) { body.in-tghost #rail, body.in-tghost #panel, body.in-tghost #inspector, body.in-tghost .heat-key, body.in-tghost #netwarn { top: calc(122px + var(--tgh, 0px)); } body.in-tghost #inspector { max-height: calc(100dvh - 184px - var(--tgh, 0px)); } }
@media (max-width: 860px) { #tghost { font-size: 13px; padding: 3px 8px; gap: 4px 8px; } #tghost .tgh-wide { display: none; } #tghost .tgh-narrow { display: inline-flex; } #tghost .tgh-names { display: none; } }
.tg-you { margin-top: 10px; } .tg-you .looks { margin: 8px 0; }
.tg-board .tg-main { padding-top: 10px; } .tg-board .tg-gone { text-align: center; color: #8a1d1d; font-weight: 700; }
/* (the long lines on the big button of a group game wrap inside it) */
body.in-tg #turn .btn.big { white-space: normal; text-align: center; } body.in-tg #turn .btn.big small { white-space: normal; max-width: 100%; }
body.in-tg #turn { max-width: calc(100vw - 16px); } body.in-tg #turn .tg-line { max-width: 100%; }

/* the notice of the game's own before a choice (UI.worldNotice), and the Coins tab (task 150) */
.wnotice { background: #fff0b8; border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.wnotice h3 { margin: 0 0 6px; font-size: 16px; } .wnotice p { margin: 4px 0; font-size: 14px; line-height: 1.4; font-weight: 600; } .wnotice .btn { margin-top: 8px; width: 100%; white-space: normal; }
.cn-coin { display: block; width: 100%; text-align: left; border: 2.5px solid var(--ink); background: #fff; border-radius: 13px; padding: 8px 10px; margin: 6px 0; cursor: pointer; font: inherit; color: inherit; }
.cn-coin.sel { background: #f1fbff; } .cn-coin b { font-family: var(--display); font-weight: 600; } .cn-coin .note { display: block; margin-top: 2px; }
.cn-words { font-family: var(--display); font-size: 17px; line-height: 1.5; background: #fff; border: 2.5px dashed var(--ink); border-radius: 12px; padding: 8px 10px; margin: 6px 0; overflow-wrap: anywhere; }
.cn-opt { border: 2.5px solid var(--ink); background: #fff; border-radius: 13px; padding: 8px 10px; margin: 6px 0; } .cn-opt p { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.cn-opt .btn { white-space: normal; }
.cn-lev { display: flex; gap: 6px; margin: 6px 0; } .cn-lev .btn { flex: 1; }
