/* GAIA 2037 — "Simple" HUD. Mobile landscape first (two thumbs), the same layout scales up to desktop.
   Tokens follow GUI/DESIGN_SPEC.md: near-black neutral surfaces, colour only by meaning. */
:root {
  --bg: #08090B; --panel: #141517; --raised: #1B1C1F; --stroke: #2D2F33; --line: #3a3d43;
  --text: #E6E7E9; --muted: #8B8D93; --dim: #55575E;
  --i0: #ECE3CD; --i1: #E7BF3E; --i2: #E28A36; --i3: #D64048;
  --ok: #1ECC78; --sci: #A76DE1; --trust: #E36A8A; --gold: #F0C24B; --r: 10px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --pad: clamp(8px, 1.2vw, 16px);
  --thumb: clamp(46px, 13vh, 60px);
  font-family: Inter, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--stroke); border-radius: var(--r); padding: 8px 14px; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--text); color: #0b0c0e; border-color: var(--text); font-weight: 650; }
button.ghost { background: transparent; color: var(--muted); }
button.go { background: var(--ok); color: #04170d; border-color: var(--ok); font-weight: 700; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico[data-fill] { fill: currentColor; stroke: none; }
.num, b { font-variant-numeric: tabular-nums; }
.good { color: var(--ok); } .bad { color: var(--i3); } .muted { color: var(--muted); }

/* ---------- map and overlay ---------- */
#app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.drag { cursor: grabbing; }
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bub { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; border: 0; border-radius: 50%; padding: 0; background: none; display: flex; flex-direction: column; align-items: center; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.bub .disc { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--bg); }
.bub .disc .ico { width: 20px; height: 20px; }
.bub .stem { width: 2px; height: 7px; background: var(--text); }
.bub small { position: absolute; top: -18px; white-space: nowrap; font-size: 11px; font-weight: 700; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.bub.coin .disc { background: var(--ok); color: #04170d; }   /* money is green, like the bank icon; yellow is for signals (20.11) */
.bub.coin small { color: var(--ok); }
.bub.sig .disc { background: var(--i3); color: #fff; animation: beat 1.6s infinite; }
.bub.sig.env .disc { background: var(--i1); color: #2b2000; }
.bub.adv .disc { background: var(--sci); color: #fff; }
.bub.coach-ring { transform: translate(-50%, -50%); width: 50px; height: 50px; border-radius: 50%; border: 2px solid #fff; animation: ring 1.4s infinite; pointer-events: none; }
@keyframes pop { from { transform: translate(-50%, -100%) scale(.2); opacity: 0; } }
@keyframes beat { 50% { transform: scale(1.12); } }
@keyframes ring { 50% { transform: translate(-50%, -50%) scale(1.25); opacity: .35; } }

/* ---------- top bar: pills · news ticker · clock ---------- */
#top { position: absolute; top: calc(var(--st) + 6px); left: calc(var(--sl) + var(--pad)); right: calc(var(--sr) + var(--pad)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
.pills { display: flex; gap: 5px; flex: none; }
.pill { display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 9px; border-radius: 16px; background: rgba(20,21,23,.86); border-color: rgba(45,47,51,.9); backdrop-filter: blur(6px); position: relative; }
.pill b { font-weight: 650; font-size: 13.5px; }
.pill.money .ico { color: var(--ok); } .pill.trust .ico { color: var(--trust); } .pill.inf .ico { color: var(--i1); } .pill.dead .ico { color: var(--muted); }
.pill u { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 3px; text-decoration: none; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: rgba(8,9,11,.9); opacity: 0; pointer-events: none; white-space: nowrap; }
.pill u.up { color: var(--ok); animation: delta 2.6s ease-out; } .pill u.down { color: var(--i3); animation: delta 2.6s ease-out; }
@keyframes delta { 0% { opacity: 0; transform: translate(-50%, -6px); } 12% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
#ticker { flex: 1; min-width: 60px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 16px; background: rgba(20,21,23,.86); border-color: rgba(45,47,51,.9); overflow: hidden; text-align: left; }
#ticker .ico { color: var(--i1); }
#ticker span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); font-size: 13px; }
#ticker span.fresh { animation: slide .5s ease-out; }
@keyframes slide { from { transform: translateY(100%); opacity: 0; } }
.clock { display: flex; align-items: center; gap: 5px; flex: none; }
#phase { height: 32px; padding: 0 10px; border-radius: 16px; font-weight: 700; font-size: 12px; letter-spacing: .04em; background: rgba(20,21,23,.86); }
#phase[data-stage="2"] { color: var(--i1); border-color: rgba(231,191,62,.45); } #phase[data-stage="3"] { color: var(--i3); border-color: rgba(214,64,72,.5); }
#when { height: 32px; padding: 0 10px; border-radius: 16px; display: flex; flex-direction: column; justify-content: center; line-height: 1.05; background: rgba(20,21,23,.86); position: relative; overflow: hidden; }
#when b { font-size: 13px; white-space: nowrap; }
#when .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
#when .prog i { display: block; height: 100%; width: 0; background: var(--muted); }
.round { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(20,21,23,.86); }
#speed { width: auto; min-width: 40px; padding: 0 8px; border-radius: 16px; font-weight: 700; background: var(--text); color: #0b0c0e; border-color: var(--text); }
#pause.paused { background: var(--i1); color: #1c1500; border-color: var(--i1); }
.pulse { animation: glow 1.2s infinite; } @keyframes glow { 50% { outline: 2px solid #fff; outline-offset: 3px; } }

/* ---------- side icons: notification badges ---------- */
.side { position: absolute; bottom: calc(var(--sb) + var(--thumb) + 18px); display: flex; flex-direction: column; gap: 8px; }
#side-l { left: calc(var(--sl) + var(--pad)); } #side-r { right: calc(var(--sr) + var(--pad)); align-items: flex-end; }
.bell { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(20,21,23,.9); position: relative; }
.bell .ico { width: 21px; height: 21px; }
.bell > u { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--i3); color: #fff; font-size: 11px; font-weight: 800; text-decoration: none; display: none; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.bell.has > u { display: grid; }
.bell.gold > u { background: var(--gold); color: #2b2000; }
.bell.ready { color: var(--sci); border-color: var(--sci); animation: glow 1.4s infinite; }
#b-signals.has { color: var(--i3); }
.bell.ringed { background: rgba(20,21,23,.9); }
.bell .rp { position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; }
.bell .spin { position: absolute; inset: 3px; }

/* ---------- bottom: two thumb buttons and the selection strip ---------- */
#bottom { position: absolute; left: calc(var(--sl) + var(--pad)); right: calc(var(--sr) + var(--pad)); bottom: calc(var(--sb) + 8px); display: flex; gap: 8px; align-items: stretch; height: var(--thumb); pointer-events: none; }
#bottom > * { pointer-events: auto; }
.thumb { width: clamp(118px, 19vw, 190px); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; background: #1f2124; border-color: #3a3d43; border-radius: 14px; }
.thumb .ico { width: 22px; height: 22px; }
.thumb:active { transform: translateY(1px); }
#strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 14px; background: rgba(20,21,23,.9); text-align: left; overflow: hidden; }
#strip .nm { min-width: 0; flex: 1; }
#strip .nm b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#strip .nm span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#strip .kv { display: flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
#strip .kv .ico { width: 16px; height: 16px; }
#strip .runs { display: flex; gap: 4px; }
#strip .runs i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #24262a; position: relative; }
#strip .runs i .ico { width: 13px; height: 13px; }
.st-calm { color: var(--muted); } .st-signal { color: var(--i1); } .st-outbreak { color: var(--i3); }

/* ---------- popover for the pills ---------- */
#pop { position: absolute; z-index: 30; width: min(360px, calc(100vw - 24px)); max-height: calc(100% - 70px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; user-select: text; }
#pop h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
#pop .big { font-size: 26px; font-weight: 750; margin: 2px 0 8px; }
#pop p { margin: 6px 0; color: #c8cacd; line-height: 1.4; font-size: 13px; }
#pop .eq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; }
#pop .eq span { background: var(--raised); border: 1px solid var(--stroke); border-radius: 8px; padding: 4px 8px; }
#pop .eq em { font-style: normal; color: var(--muted); }
#pop .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--stroke); font-size: 13px; }
#pop .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.meter { height: 8px; border-radius: 4px; background: #26282c; overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; border-radius: 4px; }

/* ---------- sheets: Operations (left thumb) and World (right thumb) ---------- */
#sheet { position: absolute; inset: 0; z-index: 20; background: rgba(8,9,11,.82); backdrop-filter: blur(4px); display: flex; flex-direction: column; padding: calc(var(--st) + 8px) calc(var(--sr) + var(--pad)) calc(var(--sb) + 8px) calc(var(--sl) + var(--pad)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(14px); opacity: 0; } }
.tabs { display: flex; gap: 6px; flex: none; }
.tabs button { flex: 1; height: 40px; padding: 0 8px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; background: rgba(27,28,31,.95); color: #b9bbbf; white-space: nowrap; overflow: hidden; position: relative; }
.tabs button.on { background: var(--text); color: #0b0c0e; border-color: var(--text); }
.tabs button u { text-decoration: none; min-width: 18px; height: 18px; border-radius: 9px; background: var(--i3); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.tabs .x { flex: none; width: 48px; }
.body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); gap: 10px; margin-top: 8px; }
.body.one { grid-template-columns: minmax(0, 1fr); }
.col { min-height: 0; overflow: auto; border-radius: 14px; background: rgba(20,21,23,.94); border: 1px solid var(--stroke); padding: 12px; -webkit-overflow-scrolling: touch; }
.col h3 { margin: 0 0 6px; font-size: 16px; }
.col h5 { margin: 12px 0 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.col p { margin: 6px 0; line-height: 1.42; color: #c8cacd; }
.hint { color: var(--muted); font-size: 12.5px; }

/* city header inside Operations */
.chead { position: relative; border-radius: 12px; overflow: hidden; min-height: 92px; background: #111 center/cover; display: flex; align-items: flex-end; padding: 10px 12px; }
.chead::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,9,11,.95) 0%, rgba(8,9,11,.7) 50%, rgba(8,9,11,.25) 100%); }
.chead > * { position: relative; }
.chead h3 { margin: 0; font-size: 19px; } .chead .cap { color: var(--muted); font-size: 12px; }
.chead .figs { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; font-size: 13px; }
.chead .figs span { display: flex; align-items: center; gap: 4px; }
.chead .figs .ico { width: 15px; height: 15px; }

/* action tiles: the hex grid of Plague's control screen, as round tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.tile { height: 92px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 14px; background: #1a1c1f; position: relative; text-align: center; font-size: 12px; line-height: 1.15; }
.tile .disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #26292e; border: 1px solid #3a3e45; position: relative; }
.tile .disc .ico { width: 21px; height: 21px; }
.tile.on { border-color: var(--text); background: #23262a; }
.tile.run .disc { border-color: var(--i1); color: var(--i1); }
.tile.act .disc { background: var(--ok); color: #04170d; border-color: var(--ok); }
.tile.done .disc { background: var(--sci); color: #fff; border-color: var(--sci); }
.tile.lock { opacity: .55; }
.tile .flag { position: absolute; top: 6px; right: 6px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.tile.run .flag { color: var(--i1); } .tile.act .flag { color: var(--ok); }
.tile.hl { animation: glow 1.2s infinite; border-color: #fff; }
.tile .lvl { position: absolute; bottom: -3px; right: -3px; font-size: 10px; font-weight: 800; background: var(--text); color: #000; border-radius: 7px; padding: 0 4px; }

/* detail panel */
.det .pic { height: 96px; border-radius: 12px; background: #111 center/cover; margin-bottom: 10px; }
.fx { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fx span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; background: #1f2124; font-size: 12.5px; font-weight: 600; }
.fx span .ico { width: 14px; height: 14px; }
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0 4px; }
.stages div { padding: 6px 7px 7px; border-radius: 9px; background: #1f2124; font-size: 11.5px; position: relative; overflow: hidden; }
.stages div b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stages div span { color: var(--muted); }
.stages div i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--i1); }
.stages div.ok { background: #17261d; } .stages div.ok i { width: 100%; background: var(--ok); }
.stages div.now { box-shadow: inset 0 0 0 1px var(--i1); }
.stnote { font-size: 11.5px; color: var(--muted); }
.buy { margin-top: 12px; }
.buy .row { display: flex; align-items: center; gap: 10px; }
.buy .pre .why { margin: 0 0 8px; } .buy .pre .stnote { margin-bottom: 6px; }
.det .buy:not(.inline) { position: sticky; bottom: -12px; margin: 12px -12px -12px; padding: 10px 12px calc(10px + var(--sb)); background: var(--panel); border-top: 1px solid var(--stroke); z-index: 2; }
.buy .price { font-size: 20px; font-weight: 750; display: flex; align-items: center; gap: 6px; }
.buy .price .ico { color: var(--ok); width: 20px; height: 20px; }
.buy button { flex: 1; height: 46px; font-size: 15px; }
.buy.inline button { height: 40px; font-size: 14px; }
.why { margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: rgba(214,64,72,.1); border: 1px solid rgba(214,64,72,.35); font-size: 12.5px; color: #f0c3c6; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.why button { padding: 4px 10px; font-size: 12px; flex: none; }
.state { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: #1d2a21; color: #bdf0d2; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.state.run { background: #2a2614; color: #f2df9d; }

/* lists: news, signals, research, documents */
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: #1a1c1f; text-align: left; width: 100%; }
.item.on { border-color: var(--text); }
.item .disc { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #26292e; }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; font-size: 13.5px; font-weight: 650; }
.item .t span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .r { flex: none; font-size: 12px; color: var(--muted); text-align: right; }
.item.new { box-shadow: inset 3px 0 0 var(--i1); }
.item .mini { height: 4px; border-radius: 2px; background: #2a2c30; margin-top: 6px; overflow: hidden; }
.item .mini i { display: block; height: 100%; background: var(--sci); }

/* research chain */
.chain { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chain .lane { display: flex; flex-direction: column; gap: 8px; }
.chain .lane h5 { margin: 0; }
.rcard { padding: 10px; border-radius: 12px; background: #1a1c1f; text-align: left; width: 100%; position: relative; }
.rcard b { display: block; font-size: 13.5px; } .rcard span { font-size: 12px; color: var(--muted); }
.rcard.done { box-shadow: inset 0 0 0 1px var(--sci); } .rcard.run { box-shadow: inset 0 0 0 1px var(--i1); }
.rcard.lock { opacity: .5; }
.rcard + .rcard::before { content: ""; position: absolute; top: -9px; left: 22px; width: 2px; height: 9px; background: var(--line); }

/* funds */
.formula { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13.5px; }
.formula span { color: #c8cacd; } .formula b { text-align: right; }
.formula .tot { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; color: var(--text); }
.zones { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.zones div { display: grid; grid-template-columns: 1fr 70px 56px; gap: 8px; align-items: center; font-size: 12.5px; }
.zones .bar { height: 6px; border-radius: 3px; background: #26282c; overflow: hidden; } .zones .bar i { display: block; height: 100%; background: var(--gold); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { padding: 5px 10px; border-radius: 14px; font-size: 12.5px; background: #1f2124; border: 1px solid var(--stroke); }
.chip.key { border-color: #5a5d63; } .chip.hit { color: var(--i3); } .chip.sig { color: var(--i1); }

/* ---------- coach: Plague-style tutorial callouts ---------- */
#coach { position: absolute; z-index: 40; width: min(330px, calc(100vw - 24px)); background: #2f74b2; color: #fff; border-radius: 14px; padding: 12px 14px; font-weight: 600; line-height: 1.35; font-size: 13.5px; }
#coach p { margin: 0; }
#coach .cact { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
#coach .cact button { padding: 5px 14px; background: #fff; color: #18486f; border: 0; font-weight: 700; }
#coach .cact button.ghost { background: transparent; color: #d6e8f7; }
#coach .arrow { position: absolute; width: 14px; height: 14px; background: #2f74b2; transform: rotate(45deg); }
.target { position: relative; z-index: 41; outline: 3px solid #fff !important; outline-offset: 3px; }
.bub.target { position: absolute; outline: none !important; }
.bub.target .disc { outline: 3px solid #fff; outline-offset: 2px; }

#toast { position: absolute; left: 50%; top: calc(var(--st) + 48px); transform: translateX(-50%); z-index: 35; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; animation: up .25s ease-out; max-width: calc(100vw - 24px); }
#toast button { padding: 4px 10px; font-size: 12px; flex: none; }
#rotate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50; background: rgba(20,21,23,.96); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; width: min(320px, 90vw); }
#rotate button { padding: 4px 10px; }

/* spinner: anything in preparation */
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(231,191,62,.25); border-top-color: var(--i1); animation: rot .9s linear infinite; vertical-align: middle; flex: none; }
.spin.hold { animation-play-state: paused; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- start screen ---------- */
#start { position: fixed; inset: 0; display: flex; align-items: center; background: #000; overflow: hidden; }
#start video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
#start::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,9,11,.96) 0%, rgba(8,9,11,.75) 45%, rgba(8,9,11,.1) 100%); z-index: 1; }
.start-box { position: relative; z-index: 2; max-width: 520px; padding: 0 calc(var(--sl) + 6vw); }
.start-box h1 { font-size: clamp(34px, 7vw, 64px); margin: 0 0 6px; letter-spacing: .04em; }
.start-box .sub { font-size: clamp(14px, 1.6vw, 17px); color: #cfd1d4; line-height: 1.45; margin: 0 0 12px; }
#cue { min-height: 22px; color: #fff; font-size: 14px; margin-bottom: 12px; text-shadow: 0 1px 3px #000; }
.start-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.start-actions button { height: 46px; padding: 0 20px; font-size: 15px; }
.fine { font-size: 11.5px; color: var(--muted); margin-top: 14px; line-height: 1.4; }

/* ---------- briefing: video left, story right (landscape) ---------- */
#event, #end { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.86); display: grid; place-items: center; padding: calc(var(--st) + 10px) calc(var(--sr) + 12px) calc(var(--sb) + 10px) calc(var(--sl) + 12px); }
.ev-box { width: min(1080px, 100%); max-height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--panel); border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden; animation: up .3s ease-out; }
.ev-media { background: #000; position: relative; min-height: 200px; }
.ev-media video, .ev-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-body { padding: 14px 18px; max-height: calc(100dvh - 24px); overflow: hidden; display: flex; flex-direction: column; user-select: text; }
.ev-text { flex: 1; min-height: 0; overflow: auto; margin-right: -8px; padding-right: 8px; -webkit-overflow-scrolling: touch; }
.ev-body .kicker { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ev-body h2 { margin: 8px 0 6px; font-size: clamp(17px, 2.2vw, 22px); line-height: 1.2; }
.ev-body p { margin: 5px 0; line-height: 1.45; color: #cfd1d4; font-size: 13.5px; }
.ev-do { margin: 10px 0 0; padding: 9px 11px; border-radius: 10px; background: #1d2a21; color: #c9f2da; font-size: 13px; line-height: 1.4; }
.ev-do b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin-bottom: 2px; }
.ev-body .start-actions { flex: none; padding-top: 10px; }
.ev-body .start-actions { flex-wrap: nowrap; }
.ev-body .start-actions button { height: 42px; padding: 0 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-body .start-actions button.primary { flex: 1; }
.ev-body .choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ev-body .choice button { height: auto; min-height: 52px; padding: 8px 10px; text-align: left; font-size: 13px; line-height: 1.3; }
.ev-body .choice button b { display: block; font-size: 14px; }
.end-box { width: min(980px, 100%); max-height: 100%; display: grid; grid-template-columns: 1fr 1.1fr; background: var(--panel); border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden; }
.end-box .pic { background: #000 center/cover; min-height: 220px; }
.end-text { padding: 18px; overflow: auto; }
.end-text h1 { margin: 6px 0 8px; font-size: clamp(22px, 3vw, 30px); }
.end-text p { line-height: 1.45; color: #cfd1d4; }
.end-text .kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- desktop: more air, same layout ---------- */
@media (min-width: 1100px) and (min-height: 640px) {
  html, body { font-size: 15px; }
  .pill { height: 36px; } #ticker, #phase, #when, .round, #speed { height: 36px; } .round { width: 36px; }
  .body { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 420px); }
  #sheet { padding-left: 6vw; padding-right: 6vw; }
}
/* ---------- phones on their side: short screens ---------- */
@media (max-height: 430px) {
  #top { top: calc(var(--st) + 4px); gap: 5px; }
  .pill { height: 30px; padding: 0 7px; } .pill b { font-size: 12.5px; }
  #ticker, #phase, #when, .round, #speed { height: 30px; } .round { width: 30px; }
  .bell { width: 40px; height: 40px; }
  .side { gap: 6px; }
  .tabs button { height: 36px; font-size: 13px; }
  .chead { min-height: 74px; }
  .tile { height: 80px; } .tile .disc { width: 36px; height: 36px; }
  .det .pic { display: none; }
  .det h3 { font-size: 15px; } .det p { font-size: 12.5px; margin: 4px 0; }
  .stages { margin-top: 6px; }
  .buy button { height: 42px; }
  .ev-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
@media (max-width: 760px) {
  .pill.dead { display: none; }
  .tabs button .lbl { display: none; }
  /* the active tab stays an icon too (20.11: the label was cut to "Фина") */
}
/* very narrow (iPhone SE landscape 667px): the ticker yields to the figures */
@media (max-width: 700px) and (orientation: landscape) { #ticker span { font-size: 12px; } .thumb { width: 104px; font-size: 13px; } .thumb .ico { display: none; } }
/* portrait phones: still playable, stacked */
@media (orientation: portrait) and (max-width: 700px) {
  #top { flex-wrap: wrap; } #ticker { order: 3; flex-basis: 100%; }
  .body { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow: auto; }
  .col { overflow: visible; }
  .ev-box, .end-box { grid-template-columns: 1fr; overflow: auto; }
  .ev-media { aspect-ratio: 16 / 9; min-height: 0; }
  .thumb { width: 96px; font-size: 12.5px; } .thumb .ico { display: none; }
  #strip .kv:not(.k1) { display: none; }
  .chain { grid-template-columns: 1fr; }
}

/* ---------- research list (v0.7.1): one column, three segments, one button ---------- */
.rlist { display: flex; flex-direction: column; gap: 8px; }
.rrow { padding: 10px 12px; border-radius: 12px; background: #1a1c1f; border: 1px solid var(--stroke); }
.rrow.wait { border-color: var(--gold); } .rrow.run { border-color: rgba(231,191,62,.45); } .rrow.done { border-color: rgba(167,109,225,.5); } .rrow.lock { opacity: .5; }
.rrow.hl { outline: 3px solid #fff; outline-offset: 2px; }
.rtop { display: flex; align-items: center; gap: 10px; }
.rtop .disc { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #26292e; flex: none; }
.rtop b { flex: 1; font-size: 14px; }
.rtop .r { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rtop .r.gold { color: var(--gold); font-weight: 700; } .rtop .r.good { color: var(--ok); }
.rrow p { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: #c8cacd; } .rrow p b { color: var(--text); }
.rrow p.hint { margin-top: 4px; font-size: 12px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.seg3 span { position: relative; height: 22px; border-radius: 6px; background: #26282c; overflow: hidden; }
.seg3 span i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(231,191,62,.35); }
.seg3 span.ok i { background: rgba(167,109,225,.55); } .seg3 span.now i { background: rgba(231,191,62,.45); }
.seg3 span em { position: relative; font-style: normal; font-size: 11px; line-height: 22px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ract { margin-top: 8px; } .ract button { width: 100%; height: 42px; } .ract .why { margin-top: 6px; }
.state.wait { background: #2b2410; color: var(--gold); }
.stages div.next { box-shadow: inset 0 0 0 1px var(--gold); }
.stages div span .ico { width: 12px; height: 12px; color: var(--ok); }
/* news: kind of news, place, text, meaning */
.tag { font-style: normal; display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.t-signal { background: var(--i1); color: #2b2000; } .t-ibc { background: #9FB4C8; color: #0d1620; } .t-money { background: var(--ok); color: #04170d; } .t-story { background: #3CC8C0; color: #04201e; } .t-world { background: #3a3d43; color: var(--text); }
.item.news .t small { color: var(--muted); font-size: 11.5px; }
.item.news .t b { margin-top: 3px; }
#ticker span .tag { font-size: 9.5px; padding: 1px 5px; }

/* ---------- v0.7.2: labels under the side icons — every icon says what it is ---------- */
.side { gap: 22px; margin-bottom: 12px; }
.bell > em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; font-style: normal; font-size: 10px; font-weight: 650; color: #b9bbbf; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
@media (max-height: 430px) { .side { gap: 18px; } .bell > em { font-size: 9.5px; margin-top: 1px; } }

/* ticker: a round photo of the city the headline comes from */
#ticker-pic { display: none; width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; background: #222 center/cover; flex: none; }
#ticker-pic.on { display: block; } #ticker-pic.on + .ico { display: none; }

/* ---------- city insert: a short report with the city's photo slides in over the map ---------- */
/* 22.11: the insert is the news strip opening downwards (place, width and height are set by insertBox in main.js) */
#insert { position: absolute; z-index: 25; padding: 0; border-radius: 10px; border: 1px solid rgba(45,47,51,.9); background: #0d0e10; overflow: hidden; text-align: left; display: flex; align-items: stretch;
  transition: height .45s cubic-bezier(.4,0,.2,1); }
#insert .pic { position: absolute; top: 0; right: 0; bottom: 0; width: min(56%, 460px); background: #15171a center/cover no-repeat; }
#insert .pic::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0d0e10 0%, rgba(13,14,16,.6) 14%, rgba(13,14,16,0) 32%); }
#insert .it { position: relative; flex: 1; min-width: 0; padding: 12px calc(min(56%, 460px) - 16px) 14px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
#insert .k { display: flex; align-items: center; gap: 0; font-size: 12px; color: #c8cacd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#insert b { font-size: 15px; line-height: 1.28; }
#insert .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: rgba(8,9,11,.7); z-index: 1; }
#insert .x .ico { width: 14px; height: 14px; }
#insert .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--text); opacity: .5; transform-origin: left; animation: drain 5s linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
/* closed (the strip's own height): the content fades, so it melts into the strip; open: it shows */
#insert .it, #insert .pic, #insert .x, #insert .bar { opacity: 0; transition: opacity .2s; }
#insert.open .it, #insert.open .pic, #insert.open .x, #insert.open .bar { opacity: 1; transition: opacity .25s .12s; }
#insert:not(.open) { pointer-events: none; }
#insert .it { min-height: 118px; }
@media (max-width: 700px) { #insert .it { min-height: 104px; padding-right: calc(52% - 12px); } #insert .pic { width: 52%; } #insert b { font-size: 14.5px; } }
#ticker.got { animation: got .6s ease-out; }
@keyframes got { 0% { box-shadow: 0 0 0 0 rgba(230,231,233,.55); } 100% { box-shadow: 0 0 0 8px rgba(230,231,233,0); } }

/* ---------- news: a newspaper — lead story on a photo, filter chips, cards with thumbnails ---------- */
.t-city { background: #4D9BE0; color: #04121f; }
/* 22.11: news as a timeline of full-width rows — photo on the right fading into the text on the left */
.nrows { display: flex; flex-direction: column; gap: 8px; }
.nrows h5 { margin: 10px 0 0; }
.nrow { position: relative; display: flex; align-items: center; width: 100%; min-height: clamp(92px, 12vw, 136px); padding: 0; border-radius: 12px; overflow: hidden; background: #16181b; text-align: left; }
.nrow .ph { position: absolute; top: 0; right: 0; bottom: 0; width: 64%; background: #202226 center/cover no-repeat; display: grid; place-items: center end; padding-right: 22px; }
.nrow .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #16181b 0%, rgba(22,24,27,.9) 18%, rgba(22,24,27,.35) 55%, rgba(22,24,27,0) 80%); }
.nrow .ph.none { background: linear-gradient(90deg, #16181b, #23262b); }
.nrow .ph.none .ico { width: 34px; height: 34px; color: #5d6168; position: relative; z-index: 1; }
.nrow .tx { position: relative; z-index: 1; width: 60%; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.nrow .k { display: flex; align-items: center; font-size: 11.5px; color: #a9acb2; white-space: nowrap; overflow: hidden; }
.nrow .k > span { overflow: hidden; text-overflow: ellipsis; }
.nrow b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: clamp(14px, 1.35vw, 17px); font-weight: 650; line-height: 1.28; }
.nrow small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: #9a9da3; font-size: 12.5px; line-height: 1.35; }
.nrow { cursor: pointer; } .nrow:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* 22.11: Play — a small button on the right of a row, a larger one on the right of the full picture */
.nplay { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: rgba(8,9,11,.62); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(4px); }
.nplay .ico, .playbtn .ico { width: 18px; height: 18px; }
.nplay:hover, .playbtn:hover { background: rgba(8,9,11,.8); border-color: rgba(255,255,255,.6); }
.ev-acts { display: flex; align-items: flex-end; gap: 10px; } .ev-acts > .start-actions, .ev-acts > .choice { flex: 1; min-width: 0; }
.playbtn { flex: none; margin-left: auto; width: 52px; height: 42px; padding: 0; display: grid; place-items: center; background: rgba(8,9,11,.6); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.playbtn .ico { width: 22px; height: 22px; }
.playbtn.on { background: var(--text); color: #0b0c0e; border-color: var(--text); }
@media (orientation: portrait) and (max-width: 700px) { .nplay { width: 36px; height: 36px; right: 10px; } }
.nrow:hover .ph, .nrow:focus-visible .ph { filter: brightness(1.12); }
@media (orientation: portrait) and (max-width: 700px) { .nrow { min-height: 96px; } .nrow .tx { width: 66%; padding: 10px 12px; } .nrow .ph { width: 58%; } .nrow small { display: none; } .nrow b { -webkit-line-clamp: 3; font-size: 14px; } .nfs { position: static; margin-top: 0; padding-top: 0; } }
.nfs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 2px; scrollbar-width: none; position: sticky; top: -12px; margin-top: -12px; padding-top: 12px; background: rgba(20,21,23,.98); z-index: 2; }
.nfs::-webkit-scrollbar { display: none; }
.nf { flex: none; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 16px; font-size: 12.5px; font-weight: 600; background: #1f2124; }
.nf small { color: var(--muted); font-size: 11px; font-weight: 700; }
.nf.on { background: var(--text); color: #0b0c0e; border-color: var(--text); } .nf.on small { color: #55575e; }
.nf .dot { width: 8px; height: 8px; border-radius: 50%; display: block; }

/* ---------- v0.7.3 (QA 20.11) ---------- */
#start .start-box { visibility: hidden; } #start.ready .start-box { visibility: visible; }
/* the toast sits above the bottom bar, out of the way of the city insert at the top */
#toast { top: auto; bottom: calc(var(--sb) + var(--thumb) + 18px); }
/* the ending: the button stays visible on short phone screens */
.end-text { display: flex; flex-direction: column; }
.end-text .start-actions { position: sticky; bottom: -18px; margin: 8px -18px -18px; padding: 10px 18px 14px; background: var(--panel); border-top: 1px solid var(--stroke); }
.why.warn { background: rgba(231,191,62,.1); border-color: rgba(231,191,62,.4); color: #f2df9d; }
.cut { margin-top: 6px; } .cut .chip { width: 100%; color: #f0c3c6; border-color: rgba(214,64,72,.4); background: transparent; }
#toast { width: max-content; max-width: min(560px, calc(100vw - 140px)); }
.end-text { max-height: calc(100dvh - 24px - var(--st) - var(--sb)); min-height: 0; }
/* a running order: a yellow ring turns around the tile's icon (instead of a loader next to the days) */
.tile .disc .ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(231,191,62,.22); border-top-color: var(--i1); border-right-color: var(--i1); animation: rot 1.1s linear infinite; pointer-events: none; }
.tile .disc .ring.hold { animation-play-state: paused; }
/* tile states, flat: running — one thin yellow loader line in place of the border; done — green outline and green icon */
.tile.run .disc { border-color: transparent; color: var(--i1); }
.tile .disc .ring { inset: -1px; border-width: 1.5px; border-color: rgba(231,191,62,.18); border-top-color: var(--i1); border-right-color: transparent; }
.tile.act .disc { background: transparent; color: var(--ok); border-color: var(--ok); }
/* days left: a small pill on the bottom edge of the circle — never over the icon, whatever the tile width */
.tile { gap: 10px; }
.tile .disc .flag { top: auto; right: auto; bottom: -8px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; line-height: 14px; padding: 0 5px; border-radius: 7px; background: #1a1c1f; }
.tile.on .disc .flag { background: #23262a; }
.tile { height: auto; min-height: 92px; gap: 10px; } .tile .disc { flex: none; }
@media (max-height: 430px) { .tile { min-height: 80px; padding: 8px 6px 6px; gap: 9px; } }
.tile { justify-content: flex-start; padding-top: 10px; } @media (max-height: 430px) { .tile { padding-top: 8px; } }
/* time stands still while a window is open: the day counter dims */
#when.held { opacity: .55; }

/* ---------- finances as an infographic (20.11) ---------- */
.fhead { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.fhead > div { padding: 10px 12px; border-radius: 12px; background: #1a1c1f; }
.fhead small { display: block; color: var(--muted); font-size: 11.5px; }
.fhead .big { font-size: 24px; font-weight: 750; margin: 2px 0; }
.fhead .net.good .big { color: var(--ok); } .fhead .net.bad .big { color: var(--i3); }
.fbar { display: flex; align-items: center; gap: 10px; }
.fbar .track { flex: 1; height: 18px; border-radius: 6px; background: #26282c; display: flex; overflow: hidden; }
.fbar .track i { display: block; height: 100%; }
.fbar .track i + i { box-shadow: inset 2px 0 0 #141517; }
.fbar b { width: 72px; text-align: right; font-size: 14px; }
.fbar.in b { color: var(--ok); } .fbar.out b { color: var(--i3); }
.flegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: #c8cacd; }
.flegend span { display: inline-flex; align-items: center; gap: 5px; }
.flegend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.col h5 .ico { width: 14px; height: 14px; vertical-align: -2px; }
.col h3 .ico { vertical-align: -3px; }
/* close: a round icon button, clearly not one more tab */
.tabs .x { width: 40px; height: 40px; flex: none; align-self: center; border-radius: 50%; background: transparent; border-color: var(--line); color: var(--muted); padding: 0; }
.tabs .x:hover { color: var(--text); border-color: var(--muted); }
@media (max-height: 430px) { .tabs .x { width: 36px; height: 36px; } }
/* close: the same rounded rectangle as every other button (20.11: no round buttons) */
/* 21.11: square — as wide as it is tall */
.tabs .x { width: 40px; height: 40px; border-radius: 12px; background: rgba(27,28,31,.95); border-color: var(--stroke); color: #b9bbbf; align-self: auto; }
@media (max-height: 430px) { .tabs .x { width: 36px; height: 36px; } }

/* ---------- one button style (20.11): rounded rectangles everywhere, no round or pill-shaped controls ----------
   small controls (≤ 44 px): radius 10 px; large ones (thumbs, tabs, tiles, panels): 12 px. Map markers stay round. */
.pill, #ticker, #phase, #when, .round, #speed, .chip, .nf, #insert .x, .tabs .x, button { border-radius: 10px; }
.bell { border-radius: 12px; }
.thumb, .tabs button, .tile, #strip { border-radius: 12px; }
.bell .rp { inset: auto; left: 6px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--sci); width: 0; }
#ticker-pic { border-radius: 6px; }
.how { margin: 6px 0; padding-left: 20px; color: #c8cacd; line-height: 1.45; font-size: 13px; } .how li { margin: 3px 0; }
/* briefing: title + one line + one short "what next" line (20.11: ≤ 200 characters per message) */
.ev-body p.ev-next { color: var(--ok); font-weight: 600; margin-top: 8px; }
.ev-body h2 { font-size: clamp(18px, 2.4vw, 24px); }
.ev-body .ev-text p { font-size: 14.5px; }

/* ---------- briefing (20.11): the video carries the story; title, a line or two and the buttons sit on it ---------- */
.ev-box { display: block; position: relative; width: min(1080px, 100%, calc((100dvh - 24px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: calc(100dvh - 24px); grid-template-columns: none; }
.ev-media { position: absolute; inset: 0; min-height: 0; }
.ev-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: none; padding: 48px 20px 16px; background: linear-gradient(180deg, rgba(8,9,11,0) 0%, rgba(8,9,11,.82) 34%, rgba(8,9,11,.95) 100%); }
.ev-body .kicker { color: #c8cacd; }
.ev-body h2 { margin: 6px 0 4px; max-width: 760px; }
.ev-body .ev-text { flex: none; overflow: visible; max-width: 760px; }
.ev-body .ev-text p { color: #e1e2e4; margin: 2px 0; }
.ev-body .start-actions { max-width: 520px; }
@media (max-height: 430px) { .ev-body { padding: 36px 16px 12px; } .ev-body h2 { font-size: 18px; } .ev-body .ev-text p { font-size: 13px; } .ev-body .start-actions button { height: 38px; } }
@media (orientation: portrait) and (max-width: 700px) {
  .ev-box { width: 100%; aspect-ratio: auto; display: flex; flex-direction: column; }
  .ev-media { position: relative; aspect-ratio: 16 / 9; }
  .ev-body { position: static; background: var(--panel); padding: 14px 16px; }
}
/* the ending: like a briefing — the picture fills the box, title, two lines, chips and the button sit on it (20.11) */
.end-box { display: block; position: relative; width: min(1080px, 100%, calc((100dvh - 24px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: calc(100dvh - 24px); grid-template-columns: none; }
.end-box .pic { position: absolute; inset: 0; min-height: 0; }
.end-text { position: absolute; left: 0; right: 0; bottom: 0; max-height: none; overflow: visible; padding: 48px 20px 16px; background: linear-gradient(180deg, rgba(8,9,11,0) 0%, rgba(8,9,11,.82) 34%, rgba(8,9,11,.95) 100%); }
.end-text h1 { margin: 4px 0; } .end-text p { margin: 3px 0; color: #e1e2e4; }
.end-text .start-actions { position: static; margin: 8px 0 0; padding: 0; background: none; border: 0; }
@media (max-height: 430px) { .end-text { padding: 32px 16px 12px; } .end-text h1 { font-size: 20px; } .end-text p { font-size: 13px; } }
@media (orientation: portrait) and (max-width: 700px) { .end-box { width: 100%; aspect-ratio: auto; display: flex; flex-direction: column; } .end-box .pic { position: relative; aspect-ratio: 16 / 9; } .end-text { position: static; background: var(--panel); } }

/* ---------- city card (21.11): the photo shows the city's state, the figures sit below ---------- */
.ccard { position: relative; border-radius: 12px; overflow: hidden; min-height: 150px; background: #111 center/cover; display: flex; align-items: flex-end; }
.ccard::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,9,11,.95) 0%, rgba(8,9,11,.55) 55%, rgba(8,9,11,.05) 100%); }
.cc-in { position: relative; padding: 12px; width: 100%; }
.cc-k { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c8cacd; }
.cc-in h3 { margin: 4px 0 2px; font-size: 20px; } .cc-in p { margin: 0; color: #e1e2e4; font-size: 13px; }
.t-st { background: var(--i3); color: #fff; }
.cstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.cs { padding: 8px 10px; border-radius: 10px; background: #1a1c1f; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.cs .ico { width: 16px; height: 16px; grid-row: span 2; color: var(--muted); }
.cs b { font-size: 16px; } .cs span { font-size: 11px; color: var(--muted); grid-column: 2; }
.cs.warn .ico { color: var(--i1); } .cs.bad b, .cs.bad .ico { color: var(--i3); } .cs.sci .ico, .cs.sci b { color: var(--sci); } .cs.good .ico, .cs.good b { color: var(--ok); }
.chead .cap { display: flex; flex-wrap: wrap; gap: 4px; }
.cityln { padding: 2px 8px; font-size: 12px; border-radius: 8px; background: rgba(20,21,23,.7); border-color: rgba(255,255,255,.18); color: #e1e2e4; }
.cityln.on { background: var(--text); color: #0b0c0e; }
.chip .ico { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-height: 430px) { .ccard { min-height: 120px; } .cc-in h3 { font-size: 17px; } .cs { padding: 6px 8px; } .cs b { font-size: 14px; } }

/* ---------- layout fixes from phone screenshots (21.11) ---------- */
/* a reason block: text takes the room, its button stays a compact button (it used to stretch over the box) */
.why span { flex: 1; min-width: 0; }
.why button, .ract .why button, .buy .why button { flex: none; width: auto; height: auto; min-height: 32px; padding: 6px 12px; font-size: 12.5px; }
/* research header: the title and the status wrap instead of running off the card on narrow screens */
.rtop { flex-wrap: wrap; row-gap: 4px; }
.rtop b { flex: 1 1 140px; min-width: 0; }
.rtop .r { flex: 0 1 auto; white-space: normal; text-align: right; margin-left: auto; }
/* the four forms of the organism (21.11) */
/* 16:9 slides of the forms (21.11) */
.slides { position: relative; aspect-ratio: 16 / 9; margin: 10px 0 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--stroke); background: #0c0d0e; }
.slides figure { position: absolute; inset: 0; margin: 0; background: #0c0d0e center / cover; opacity: 0; transition: opacity .8s ease; }
.slides figure.on { opacity: 1; }
.slides figcaption { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 7px; padding: 28px 12px 10px; font-size: 14px; color: #f0f0f0; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.slides figcaption i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.slides figcaption span { margin-left: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #b9bbbf; padding-right: 2px; }
.slides .dots { position: absolute; top: 10px; right: 10px; display: flex; gap: 5px; }
.slides .dots button { width: 22px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.slides .dots button.on { background: #fff; }
/* Overview (21.11, second pass): small form pictures, the phase strip, the world list */
.fthumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 0; }
.fthumbs figure { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 8px; background: #0c0d0e center / cover; border: 1px solid var(--stroke); overflow: hidden; animation: fin .5s ease-out; }
.fthumbs figure.now { border: 2px solid var(--c); }
.fthumbs figcaption { position: absolute; inset: auto 0 0 0; padding: 10px 5px 3px; font-size: 10.5px; line-height: 1.1; color: #eee; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes fin { from { opacity: 0; transform: translateX(-8px); } }
.fstrip { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 6px; padding: 9px 12px; border-radius: 10px; color: #fff; }
.fstrip b { font-size: 16px; font-weight: 750; }
.fstrip span { margin-left: auto; font-size: 12.5px; opacity: .85; white-space: nowrap; }
.fstrip.light { color: #0b0c0e; }
.pdesc { margin: 0 0 4px; color: #c8cacd; }
.wlist { display: flex; flex-direction: column; border-radius: 12px; background: #1b1c1f; border: 1px solid var(--stroke); overflow: hidden; }
.wrow { --c: #8b8d93; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.wrow:first-child { border-top: 0; }
.wrow .wi { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.wrow .wi .ico { width: 19px; height: 19px; }
.wrow .wl { flex: 1; min-width: 0; font-size: 15px; color: #d6d8db; }
.wrow .wbar { display: block; height: 5px; border-radius: 3px; background: #2c2e33; overflow: hidden; margin-top: 6px; max-width: 220px; }
.wrow .wbar i { display: block; height: 100%; background: var(--c); }
.wrow b { font-size: 22px; font-weight: 750; color: var(--text); white-space: nowrap; }
.wrow b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; font-size: 12px; color: #c8cacd; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pill.inf .ico, .cs.warn .ico { color: #E04848; }   /* people are red (21.11) */

/* ---------- story as a feed (21.11): posts with pictures, newest first ---------- */
.feed { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.feed > .chips { margin: 0; }
.post { border-radius: 12px; background: #1a1c1f; border: 1px solid var(--stroke); overflow: hidden; }
.p-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; }
.p-head .disc { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: #26292e; }
.p-head .disc .ico { width: 15px; height: 15px; }
.p-head span:last-child { color: var(--muted); margin-left: auto; text-align: right; }
.p-media { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 0; background: #111 center/cover; position: relative; }
.p-play { position: absolute; left: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(8,9,11,.7); color: #fff; }
.p-body { padding: 10px 12px 12px; }
.p-body b { display: block; font-size: 15px; line-height: 1.3; }
.p-body p { margin: 4px 0 0; color: #c8cacd; font-size: 13px; line-height: 1.4; }
.p-more { text-align: center; }
/* zone mood (21.11) */
.zst { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; margin-left: 4px; }
.zst.warn { background: rgba(231,191,62,.18); color: var(--i1); } .zst.bad { background: rgba(214,64,72,.2); color: var(--i3); }
.zones .left b { color: var(--i3); text-decoration: line-through; }
.zmood { margin-top: 6px; font-size: 12px; padding: 4px 8px; border-radius: 8px; }
.zmood.warn { background: rgba(231,191,62,.18); color: #f2df9d; } .zmood.bad { background: rgba(214,64,72,.25); color: #f6c4c8; }
/* the adviser's situation report (21.11) */
.sit { margin: 4px 0 8px; padding-left: 16px; font-size: 13px; line-height: 1.4; color: #c8cacd; }
.sit li { margin: 3px 0; }
/* account popup (21.11): two numbers, the next transfer as a bar, the formula last, one big button */
#pop .bnums { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
#pop .bnums > div { background: var(--raised); border: 1px solid var(--stroke); border-radius: 10px; padding: 8px 10px; }
#pop .bnums small { display: block; font-size: 12px; color: var(--muted); }
#pop .bnums b { font-size: 22px; font-weight: 750; }
#pop .tranche { margin: 4px 0 8px; }
#pop .tranche .tt { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
#pop .tranche .tt b { font-size: 17px; }
#pop .tranche .meter { height: 10px; border-radius: 5px; margin: 6px 0 4px; }
#pop .tranche small { font-size: 12.5px; color: #c8cacd; }
#pop .bhow { border-top: 1px solid var(--stroke); margin-top: 8px; padding-top: 4px; }
#pop .bhow p, #pop .bhow .eq { font-size: 12px; color: var(--muted); }
#pop button.wide { width: 100%; height: 46px; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 650; }
/* Finances · how money works (21.11) */
.howm { display: flex; flex-direction: column; gap: 2px; }
.howm .hm { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.howm .hm:first-child { border-top: 0; }
.howm .hi { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--raised); color: #c8cacd; }
.howm .hi .ico { width: 16px; height: 16px; }
.howm .hm > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.4; color: #c8cacd; }
.howm b { color: var(--text); font-size: 14px; }
/* spread of each form (21.11): one bar per form, in its colour */
.fsh { margin: 10px 0 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.fbars { display: flex; flex-direction: column; gap: 8px; }
.fb { --c: #8b8d93; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; font-size: 13.5px; color: #d6d8db; }
.fb span { display: inline-flex; align-items: center; gap: 7px; }
.fb span i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.fb b { color: var(--c); font-size: 15px; }
.fb em { grid-column: 1 / -1; display: block; height: 7px; border-radius: 4px; background: #26282c; overflow: hidden; }
.fb em i { display: block; height: 100%; background: var(--c); border-radius: 4px; }


/* 22.11: one button height everywhere in briefings, news pictures and the start/ending screens; Play is a square of the same height */
:root { --bh: 48px; }
.start-actions button, .ev-body .start-actions button, .ev-body .choice button { height: var(--bh); min-height: 0; }
.ev-body .choice { align-items: stretch; }
.ev-body .choice button { display: block; padding: 0 12px; line-height: 1.25; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-body .choice button b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; margin-top: calc((var(--bh) - 34px) / 2); }
.playbtn { width: var(--bh); height: var(--bh); border-radius: 10px; }
@media (max-height: 430px) { :root { --bh: 40px; } .ev-body .choice button { font-size: 11.5px; line-height: 1.2; } .ev-body .choice button b { font-size: 13px; margin-top: calc((var(--bh) - 30px) / 2); } }

/* 22.11: every briefing and news picture can be closed — × in the top right corner, a click on the dark backdrop, Esc */
.ev-x { position: absolute; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: rgba(8,9,11,.6); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); }
.ev-x .ico { width: 18px; height: 18px; }
.ev-x:hover { background: rgba(8,9,11,.85); border-color: rgba(255,255,255,.6); }
#event { cursor: default; }
/* 22.11: story videos, archive documents and decisions fill the whole screen */
#event.full { padding: 0; background: #000; }
#event.full .ev-box { width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; border-radius: 0; border: 0; }
#event.full .ev-x { top: calc(var(--st) + 14px); right: calc(var(--sr) + 14px); }
#event.full .ev-body { padding: 64px calc(var(--sr) + 28px) calc(var(--sb) + 22px) calc(var(--sl) + 28px); }
@media (orientation: portrait) and (max-width: 700px) {
  #event.full .ev-box { display: block; }
  #event.full .ev-media { position: absolute; inset: 0; aspect-ratio: auto; }
  #event.full .ev-body { position: absolute; background: linear-gradient(180deg, rgba(8,9,11,0) 0%, rgba(8,9,11,.85) 30%, rgba(8,9,11,.96) 100%); padding: 60px 16px calc(var(--sb) + 16px); }
}
@media (orientation: portrait) and (max-width: 700px) { .ev-body .choice { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.ev-acts .start-actions:empty { display: none; }
.ev-body .choice button .why-no { color: #f0a34a; }
.ev-body .choice button:disabled { opacity: .75; }
/* 22.11: a choice the account cannot pay for: a red crossed-out bank at the start */
.ev-body .choice button.broke b .ico { width: 16px; height: 16px; color: var(--bad, #E04848); vertical-align: -3px; margin-right: 6px; }
.ev-body .choice button.broke .why-no { color: var(--bad, #E04848); }
.ev-acts .funds { flex: none; margin-left: auto; height: var(--bh); padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-color: rgba(54,200,120,.55); color: #c9f2da; background: rgba(29,42,33,.85); }
.ev-acts .funds .ico { width: 18px; height: 18px; color: var(--ok); }
.ev-acts .funds + .playbtn { margin-left: 0; }
/* 22.11: the price of a choice sits in a green ring at the start; if the account cannot pay, a red crossed-out bank */
.ev-body .choice button { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px; }
.ev-body .choice button .ct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-body .choice button .ct b { margin-top: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-body .choice .cost { flex: none; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 18px; display: grid; place-items: center; border: 2px solid var(--ok); color: #c9f2da; font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: -.02em; }
.ev-body .choice .cost.no { border-color: #E04848; color: #E04848; padding: 0; width: 36px; }
.ev-body .choice .cost.no .ico { width: 18px; height: 18px; margin: 0; color: #E04848; }
@media (max-height: 430px) { .ev-body .choice .cost { min-width: 30px; height: 30px; font-size: 10.5px; } .ev-body .choice .cost.no { width: 30px; } }
.ev-body .choice button > .ct:first-child { padding-left: 4px; }
/* 22.11: full-screen pages (Operations, World, News, Menu) open below the top bar — money, trust, cases and time stay in sight */
#sheet { top: var(--toph, 0px); padding-top: 8px; }

/* ---------- 22.11: Menu · About and Settings as cards ---------- */
.about, .settings { max-width: 1100px; margin: 0 auto; }
.card { background: #16181b; border: 1px solid var(--stroke); border-radius: 14px; padding: 14px; min-width: 0; }
.card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14.5px; }
.card h4 .ico { width: 18px; height: 18px; color: var(--muted); }
.card .hint { margin: 4px 0 10px; }
.card .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.card .acts button { height: 40px; padding: 0 14px; }
.card .acts button.danger { border-color: rgba(224,72,72,.5); color: #f3b3b3; }
.card .acts button.danger:hover { background: rgba(224,72,72,.15); }
/* settings */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; align-items: start; }
.settings .card.wide { grid-column: 1 / -1; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: #0f1012; border: 1px solid var(--stroke); }
.seg button { height: 36px; padding: 0 16px; border: 0; background: transparent; color: #c8cacd; font-weight: 600; }
.seg button.on { background: var(--text); color: #0b0c0e; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
.item.sw { padding: 10px 12px; background: #1b1d20; cursor: pointer; }
.item.sw .li { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: #24272b; }
.item.sw .li .ico { width: 17px; height: 17px; }
.item.sw .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item.sw .t small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.item.sw input { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 12px; background: #3a3d43; position: relative; cursor: pointer; transition: background .2s; }
.item.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.item.sw input:checked { background: var(--ok); }
.item.sw input:checked::after { transform: translateX(16px); }
.speeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.speeds > div { background: #1b1d20; border-radius: 10px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.speeds b { font-size: 16px; } .speeds span { font-size: 12px; color: var(--muted); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 13px; color: #c8cacd; }
kbd { justify-self: start; min-width: 30px; text-align: center; padding: 3px 8px; border-radius: 7px; background: #26282c; border: 1px solid #3a3d43; border-bottom-width: 3px; font: 600 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
/* about */
.about-cover { position: relative; min-height: 190px; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end; background: #15171a center 30%/cover no-repeat; border: 1px solid var(--stroke); }
.about-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,9,11,.95) 0%, rgba(8,9,11,.75) 45%, rgba(8,9,11,.15) 100%); }
.about-cover > div { position: relative; padding: 18px; max-width: 560px; }
.about-cover h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: .02em; }
.about-cover p { margin: 0 0 8px; color: #e1e2e4; font-size: 14.5px; line-height: 1.4; }
.about-cover small { color: #a9acb2; font-size: 12px; line-height: 1.35; display: block; }
.about h5 { margin: 18px 0 8px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.how-step { position: relative; background: #16181b; border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 12px 10px 48px; min-height: 64px; }
.how-step .n { position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--text); color: #0b0c0e; font-weight: 750; font-size: 13px; }
.how-step > .ico { position: absolute; right: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.how-step p { margin: 0; padding-right: 18px; font-size: 13px; line-height: 1.4; color: #d6d7da; }
.src-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.src { padding: 9px 0; border-top: 1px solid var(--stroke); }
.src:first-of-type { border-top: 0; padding-top: 0; }
.src .st { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.src .st b { font-size: 13.5px; }
.src .lic { flex: none; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: #9fb4c8; background: rgba(159,180,200,.12); border-radius: 6px; padding: 2px 6px; }
.src p { margin: 3px 0 2px; font-size: 12.5px; color: #b9bcc1; line-height: 1.35; }
.src a { font-size: 11.5px; color: var(--muted); text-decoration: none; word-break: break-all; }
.src a:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 700px) { .settings, .src-groups, .how-grid { grid-template-columns: minmax(0, 1fr); } .about-cover { min-height: 170px; } .about-cover h2 { font-size: 22px; } }
/* 22.11: languages as a list — the name on the left, the code on the right; the current one highlighted */
.langs { display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: 12px; background: #1b1d20; border: 1px solid var(--stroke); }
.langs button { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #b9bcc1; font-size: 15px; text-align: left; }
.langs button code { font: 700 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: #6f737a; }
.langs button:hover { background: #24272b; color: var(--text); }
.langs button.on { background: #2b2e33; color: var(--text); }
.langs button.on code { color: #D7F34A; }
.settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.settings .stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (max-width: 700px) { .settings { grid-template-columns: minmax(0, 1fr); } }
/* 22.11: the language select — the current language with its code; the list drops down over the card */
.lsel { position: relative; }
.lcur { width: 100%; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; background: #1b1d20; border: 1px solid var(--stroke); font-size: 15px; text-align: left; }
.lcur span { flex: 1; } .lcur code { font: 700 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: #D7F34A; }
.lcur .caret { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.lsel.open .lcur .caret { transform: rotate(-135deg) translate(-2px, -2px); }
.lsel .langs { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); box-shadow: 0 12px 30px rgba(0,0,0,.5); background: #202226; }
.keys-page .keys { font-size: 14px; gap: 10px 14px; }
.keys-page kbd { font-size: 13px; padding: 4px 10px; }
.settings.keys-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 22.11: spread by phase — a group per phase, an icon before each bar, one line on what to do */
.fsub { margin: -2px 0 8px; font-size: 12px; color: var(--muted); }
.fgroups { display: flex; flex-direction: column; gap: 8px; }
.fg { border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 12px; background: #17191c; display: flex; flex-direction: column; gap: 8px; }
.fg.now { border-color: #4a4d53; }
.fg.soon { opacity: .75; border-style: dashed; }
.fgh { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.fgh b { text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: 11px; }
.fgh span { color: #d6d8db; font-weight: 650; font-size: 13px; }
.fg .fb span .ico { width: 17px; height: 17px; color: var(--c); }
.fdo { margin: 0; font-size: 12px; line-height: 1.38; color: #a9acb2; }
/* 22.11: form bars are buttons — they lead to the zone where the form is worst */
button.fb { width: 100%; height: auto; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
button.fb:hover { background: #22252a; }
button.wlink { width: 100%; height: auto; text-align: left; background: transparent; border: 0; border-radius: 0; cursor: pointer; }
button.wlink:hover { background: #22252a; }
/* 22.11: About — the tutorial row and the sources as one list with a heading per theme */
.coach-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #16181b; border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 12px; }
.coach-row > div:first-child { display: flex; flex-direction: column; gap: 2px; } .coach-row span { font-size: 12.5px; color: var(--muted); }
.coach-row .acts { display: flex; gap: 8px; } .coach-row .acts button { height: 40px; padding: 0 14px; }
.src-list { display: flex; flex-direction: column; background: #16181b; border: 1px solid var(--stroke); border-radius: 12px; padding: 4px 14px 8px; }
.src-list .src-h { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.src-list .src-h .ico { width: 16px; height: 16px; }
.src-list .src { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(0, 2.4fr) auto minmax(0, 1.2fr); gap: 4px 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--stroke); }
.src-list .src-h + .src { border-top: 0; }
.src-list .src b { font-size: 13.5px; } .src-list .src p { margin: 0; }
.src-list .src a { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
@media (max-width: 860px) { .src-list .src { grid-template-columns: minmax(0, 1fr) auto; } .src-list .src p, .src-list .src a { grid-column: 1 / -1; text-align: left; } }
@media (max-width: 860px) { .src-list .src .lic { order: 1; } .src-list .src p { order: 2; } .src-list .src a { order: 3; } }
@media (min-width: 861px) { .src-list .src { grid-template-columns: 180px minmax(0, 1fr) 150px 220px; } .src-list .src .lic { justify-self: start; } }

/* ---------- 23.11: the dashboard at the bottom ----------
   Replaces the four side bells and the one-line strip. Figures that are not in the top bar, one cell each; a cell opens
   the place where you act on it. Colour only by meaning: red — act now, amber — look, violet — ready / science. */
#dash { flex: 1; min-width: 0; display: flex; align-items: stretch; background: rgba(20,21,23,.92); border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; }
#dash .cell { flex: 1 1 auto; min-width: max-content; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 12px; background: transparent; border: 0; border-radius: 0; text-align: left; }
#dash .cell + .cell { border-left: 1px solid #24262a; }
#dash .cell:hover { background: rgba(255,255,255,.035); }
#dash .cell:active { background: rgba(255,255,255,.06); }
#dash .cell small { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dash .cell b { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
#dash .cell b > span { overflow: hidden; text-overflow: ellipsis; }
#dash .cell b .ico { width: 15px; height: 15px; color: var(--muted); }
#dash .cell b i { font-style: normal; }
#dash .cell em { display: flex; align-items: center; gap: 3px; font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
#dash .cell em .ico { width: 12px; height: 12px; margin-left: 4px; } #dash .cell em .ico:first-child { margin-left: 0; }
#dash .cell.zone { flex: 1.4 1 auto; } #dash .cell.fit { display: none; } #dash .cell.zone:not(.on) { display: none; }
#bottom .thumb { width: clamp(112px, 12.5vw, 180px); }
#dash .cell.zone.on { background: rgba(255,255,255,.04); }
#dash .cell.zone b.muted { color: var(--muted); font-weight: 500; }
#dash .cell::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: transparent; }
#dash .cell.warn::before { background: var(--i1); } #dash .cell.warn b .ico { color: var(--i1); }
#dash .cell.hot::before { background: var(--i3); } #dash .cell.hot b .ico, #dash .cell.hot small { color: var(--i3); }
#dash .cell.gold b .ico, #dash .cell.gold b { color: var(--gold); }
#dash .cell.ready::before { background: var(--sci); } #dash .cell.ready b, #dash .cell.ready b .ico { color: var(--sci); }
#dash .cell.ready { animation: dashglow 1.4s infinite; }
@keyframes dashglow { 50% { background: rgba(167,109,225,.14); } }
#dash .cell .bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; border-radius: 1px; background: #26282c; }
#dash .cell .bar > i { display: block; height: 100%; border-radius: 1px; background: var(--sci); }
#dash .rk.low { color: var(--ok); } #dash .rk.mid { color: var(--i1); } #dash .rk.high { color: var(--i3); } #dash .rk.unknown { color: var(--muted); }
#dash .st-outbreak { color: var(--i3); } #dash .st-signal { color: var(--i1); }
#dash .cell.target { outline: 2px solid var(--gold); outline-offset: -2px; }
.work { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 6px; }
.work li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.work li span { flex: 1; min-width: 0; } .work li small { display: block; color: var(--muted); font-size: 11px; }
.work li b { white-space: nowrap; font-size: 12.5px; }
@media (max-width: 1100px) { #dash .cell { padding: 5px 9px; } #dash .cell b { font-size: 12.5px; } #dash .cell small { font-size: 9.5px; } #dash .cell .bar { left: 9px; right: 9px; } }
@media (max-height: 430px) { #dash .cell { gap: 1px; } #dash .cell em { display: none; } }
/* 23.11: alerts — what is running out, and where */
#dash .cell.alerts { flex: 6 1 0; min-width: clamp(230px, 34vw, 560px); flex-direction: row; align-items: stretch; gap: 0; padding: 0; position: relative; }
#dash .cell.alerts:hover { background: transparent; }
#dash .cell.alerts.none { display: none; }
#al-track { flex: 1; min-width: 0; display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding-inline: 30px; scrollbar-width: none; overscroll-behavior-x: contain; }
#al-track::-webkit-scrollbar { display: none; }
#dash .al { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 112px; padding: 4px 10px 4px 9px; border-radius: 8px; border: 1px solid rgba(231,191,62,.28); border-left: 3px solid var(--i1); background: rgba(231,191,62,.08); text-align: left; }
#dash .al small { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--i1); white-space: nowrap; }
#dash .al small .ico { width: 13px; height: 13px; }
#dash .al b { font-size: 12.5px; font-weight: 650; white-space: nowrap; color: var(--text); }
#dash .al.w3 { border-color: rgba(214,64,72,.4); border-left-color: var(--i3); background: rgba(214,64,72,.11); } #dash .al.w3 small { color: var(--i3); }
#dash .al:hover { filter: brightness(1.25); }
#dash .arr { position: absolute; top: 0; bottom: 0; z-index: 2; width: 26px; padding: 0; border: 0; border-radius: 0; font-size: 20px; line-height: 1; color: var(--text); }
#dash .arr[data-scroll="-1"] { left: 0; background: linear-gradient(90deg, rgba(20,21,23,1) 45%, rgba(20,21,23,0)); text-align: left; padding-left: 6px; }
#dash .arr[data-scroll="1"] { right: 0; background: linear-gradient(270deg, rgba(20,21,23,1) 45%, rgba(20,21,23,0)); text-align: right; padding-right: 6px; }
@media (max-width: 1100px) { #dash .al { min-width: 96px; padding: 3px 8px 3px 7px; } #dash .al b { font-size: 11.5px; } #dash .cell.alerts { min-width: clamp(180px, 30vw, 560px); } }
@media (max-height: 430px) { #al-track { padding: 4px 6px; } }
.work.al li { align-items: flex-start; } .work.al li > .ico { margin-top: 2px; color: var(--i1); } .work.al li.w3 > .ico { color: var(--i3); }
.work.al li button { padding: 4px 8px; font-size: 11.5px; white-space: nowrap; }

/* ================= 25.11: usability pass (docs/GAME_REVIEW.html) ================= */
/* --- decisions: cards that are read in full, picked first and confirmed second; Confirm sits on the right, away from
       where «Got it» of the previous window was --- */
.ev-acts.decide { flex-direction: column; align-items: stretch; gap: 8px; }
.ev-body .ev-acts.decide .choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-top: 10px; max-width: 1000px; }
.ev-body .ev-acts.decide .choice button { height: auto; min-height: 56px; padding: 8px 12px 8px 8px; display: flex; align-items: flex-start; gap: 10px; text-align: left; white-space: normal; overflow: visible; font-size: 13px; line-height: 1.3; background: rgba(20,21,23,.84); border: 1px solid rgba(255,255,255,.24); }
.ev-body .ev-acts.decide .choice button .ct { white-space: normal; overflow: visible; text-overflow: clip; }
.ev-body .ev-acts.decide .choice button .ct b { display: block; white-space: normal; overflow: visible; font-size: 14px; margin: 0 0 2px; }
.ev-body .ev-acts.decide .choice button > .ct:first-child { padding-left: 4px; }
.ev-body .ev-acts.decide .choice button.sel { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); background: rgba(255,255,255,.14); }
.ev-row { display: flex; align-items: center; gap: 10px; }
.ev-row .playbtn { order: 1; margin-left: 0; } .ev-row .funds { order: 2; margin-left: 0; }
.ev-body .kicker .seq { font-weight: 800; color: #fff; }
#toast button[data-undo] { border-color: var(--i1); color: var(--i1); }
@media (max-height: 430px) { :root { --bh: 44px; } .ev-body .start-actions button { height: 44px; } .ev-body .ev-acts.decide .choice button { min-height: 48px; padding: 6px 10px 6px 8px; font-size: 12.5px; } }

/* --- touch targets: 44 px where the finger lands, whatever the drawn size --- */
.pill, #phase, .round, #speed, #ticker { position: relative; }
.pill::after, #phase::after, .round::after, #speed::after, #ticker::after { content: ""; position: absolute; inset: -6px -1px; }
.bub::before { content: ""; position: absolute; inset: -8px; }
.bub[data-more]::after { content: attr(data-more); position: absolute; top: -6px; right: -9px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--text); color: #0b0c0e; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
@media (max-height: 430px) { .pill { height: 34px; } #ticker, #phase, #when, .round, #speed { height: 34px; } .round { width: 34px; } .tabs button { height: 40px; } .tabs .x { width: 40px; height: 40px; } }
.chip { min-height: 32px; }

/* --- the smallest type: nothing under 10.5 px --- */
.bell > em { font-size: 11px; } @media (max-height: 430px) { .bell > em { font-size: 10.5px; } }
#dash .cell small { font-size: 11px; } @media (max-width: 1100px) { #dash .cell small { font-size: 10.5px; } }
.tag, #ticker span .tag { font-size: 10.5px; } .tile .disc .flag, .tile .flag { font-size: 11px; } .fthumbs figcaption { font-size: 11px; }
.stages div { font-size: 12px; } .stages div b { white-space: normal; overflow: visible; line-height: 1.2; } .seg3 span em { font-size: 11.5px; }
#dash .tr { font-weight: 800; } #dash .tr.up { color: var(--i3); } #dash .tr.dn { color: var(--ok); }
#dash #c-spread .bar > i { background: var(--ok); }

/* --- the coach arrow can point sideways --- */
#coach .arrow { margin: 0; }

/* --- zone: character, task force, forecast --- */
.traits { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 6px; position: relative; }
.trait { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 7px; background: rgba(8,9,11,.66); color: #d5d7da; white-space: nowrap; }
.trait .ico { width: 13px; height: 13px; } .trait.bad { color: #f0a34a; }
.team { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: #1a1c1f; border: 1px solid var(--stroke); }
.team > .ico { width: 20px; height: 20px; flex: none; color: var(--muted); }
.team > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.team b { display: flex; align-items: center; gap: 6px; font-size: 13px; } .team b .ico { width: 14px; height: 14px; }
.team small { color: var(--muted); font-size: 11.5px; } .team .chip { flex: none; min-height: 38px; padding: 0 12px; }
.fc { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: #17191c; border: 1px solid var(--stroke); }
.fc h5 { margin: 0 0 4px; } .fc div { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; padding: 2px 0; }
.fc span { flex: 1 1 130px; } .fc i { font-style: normal; color: var(--muted); white-space: nowrap; } .fc i b { color: var(--text); } .fc i.good b { color: var(--ok); }

/* --- settings: segmented difficulty --- */
.seg { display: flex; gap: 6px; } .seg button { flex: 1; height: 40px; padding: 0 6px; } .seg button.on { background: var(--text); color: #0b0c0e; border-color: var(--text); }

/* --- portrait phones: time under the thumb, the dashboard as a strip that scrolls, tabs keep their names --- */
@media (max-width: 760px) { .tabs button .lbl { display: inline; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; } .tabs button { min-width: 0; } }
@media (max-width: 480px) { .tabs button:not(.x):not(.back) .ico { display: none; } }
@media (orientation: portrait) and (max-width: 700px) {
  .pill, #ticker, #phase, #when, .round { height: 40px; } .round { width: 40px; } .pill.dead { display: flex; }
  #bottom { flex-wrap: wrap; height: auto; justify-content: space-between; row-gap: 8px; }
  #dash { order: -1; flex: 0 0 100%; height: 50px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  #dash::-webkit-scrollbar { display: none; }
  #dash .cell, #dash .cell.fit { display: flex; flex: 0 0 47%; min-width: 0; scroll-snap-align: start; }
  #dash .cell.zone:not(.on), #dash .cell.alerts.none { display: none; }
  #dash .cell.alerts { flex: 0 0 86%; min-width: 0; }
  #top .clock { margin-left: auto; }
  #bottom .thumb { width: calc(50% - 4px); height: var(--thumb); }   /* pause and speed stay at the top right, as in landscape */
  .side { bottom: calc(var(--sb) + var(--thumb) + 18px + 58px); }
  #toast { bottom: calc(var(--sb) + var(--thumb) + 18px + 58px); max-width: calc(100vw - 132px); }
  .ev-body .ev-acts.decide .choice { grid-template-columns: minmax(0, 1fr); }
  .ev-body .kicker { flex-wrap: wrap; gap: 2px 10px; }
}
@media (max-height: 430px) { .traits { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 2px 0 4px; } .traits::-webkit-scrollbar { display: none; } }
#toast.top { top: calc(var(--st) + 10px); bottom: auto; z-index: 70; }   /* over an open briefing: «Undo» stays in reach */
@media (orientation: portrait) and (max-width: 700px) {
  #toast, #toast.top { left: 12px; right: 12px; transform: none; width: auto; max-width: none; flex-wrap: wrap; top: calc(var(--toph, 96px) + 8px); bottom: auto; }
  #toast.top { top: calc(var(--st) + 10px); right: 64px; }
}

/* --- 25.11 (second pass): on big screens the four side buttons (Adviser, Signals, Science, News) are 1.5× --- */
@media (min-width: 760px) and (min-height: 600px) {
  .bell { width: 66px; height: 66px; border-radius: 16px; }
  .bell .ico { width: 32px; height: 32px; }
  .bell > u { top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; font-size: 14px; }
  .bell > em { font-size: 14px; margin-top: 4px; }
  .bell .rp { bottom: 6px; height: 4px; }
  .side { gap: 34px; margin-bottom: 20px; }
}
#dash #c-spread small { color: var(--text); }

/* 25.11 Play is always on the right: in a decision it stands at the right edge beside the cards (right thumb), as in a message
   and in the news list. On a narrow portrait screen the cards take the full width and Play sits under them, on the right. */
.ev-acts.decide { flex-direction: row; align-items: flex-end; gap: 10px; }
.ev-acts.decide > .ev-row { flex: none; margin-left: auto; justify-content: flex-end; }
.ev-row .funds { order: 1; } .ev-row .playbtn { order: 2; }
@media (orientation: portrait) and (max-width: 700px) { .ev-acts.decide { flex-direction: column; align-items: stretch; gap: 8px; } }

/* 25.11 start screen: «New operation» and «Continue» on the first line, difficulty and language together on the second */
#start .start-actions::after { content: ""; flex: 0 0 100%; order: 1; height: 0; margin-top: -10px; }
#start #diff, #start #lang2 { order: 2; white-space: nowrap; }

/* 25.11 start screen: the opening message rolls upward in a window of a fixed height, edges fading out */
#cue { height: 108px; min-height: 0; overflow: hidden; margin-bottom: 14px; line-height: 1.5;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
#cue .roll { animation: roll 30s linear infinite; will-change: transform; }
#cue .roll p { margin: 0 0 10px; }
@keyframes roll { from { transform: translateY(108px); } to { transform: translateY(-100%); } }
@media (max-height: 430px) { #cue { height: 76px; } @keyframes roll { from { transform: translateY(76px); } to { transform: translateY(-100%); } } }
@media (prefers-reduced-motion: reduce) { #cue { height: auto; -webkit-mask-image: none; mask-image: none; } #cue .roll { animation: none; } }

/* 25.11 the first dashboard cell is the situation in small icons; its pop-up lists the same figures by name */
#dash .cell b.now { gap: 10px; } #dash .cell b.now i { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
#dash .cell b.now i .ico { width: 14px; height: 14px; color: inherit; }
#dash .cell b.now i.n { color: var(--text); } #dash .cell b.now i.n.s-alert { color: var(--i1); } #dash .cell b.now i.n.s-zone, #dash .cell b.now i.n.s-bio { color: var(--i3); }
#pop ul.work.now li .ico { width: 16px; height: 16px; color: var(--muted); flex: none; } #pop ul.work.now b.warn { color: var(--i1); }
#pop h5 { margin: 12px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (orientation: portrait) and (max-width: 700px) { #dash #c-work, #dash #c-work.fit { flex: 0 0 auto; min-width: 47%; } }
#dash #c-work small { flex: none; } #dash .cell b.now { line-height: 1.1; min-height: 0; } #dash .cell b.now i { line-height: 1; }
