/* Instigator Command Centre: the game's war-room look. Layout: one column of stamped panels on the game's olive ground, a tab
   bar at the thumb, figures in tabular numerals. Single dark theme on purpose, like the game. */
@font-face { font-family: 'Big Shoulders Stencil'; src: url(fonts/BigShouldersStencilDisplay-900.woff2) format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Big Shoulders Stencil'; src: url(fonts/BigShouldersStencilDisplay-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url(fonts/Archivo-400-800.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Special Elite'; src: url(fonts/SpecialElite-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
:root {
  --ground: #181a14; --panel: #23261e; --panel-2: #2d3127; --line: #3c4133; --ink: #efe7d2; --ink-dim: #a7a28c;
  --mustard: #e9b72f; --mustard-ink: #1d1a0e; --red: #da3b2c; --red-hi: #ff8c78; --good: #9cc25b; --dove: #8fc5d8; --paper: #efe4c6;
  --f-display: 'Big Shoulders Stencil', Impact, 'Arial Narrow', sans-serif; --f-body: 'Archivo', system-ui, sans-serif; --f-type: 'Special Elite', 'Courier New', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) calc(84px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
main, .top { max-width: 760px; margin: 0 auto; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.brand { display: grid; }
.brand h1 { margin: 2px 0 0; font: 900 40px/0.9 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; }
.brand .sub { font: 700 13px/1 var(--f-body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--mustard); margin-top: 4px; }
.stamp { justify-self: start; font: 400 12px/1 var(--f-type); color: var(--red); border: 2px solid var(--red); padding: 3px 7px; transform: rotate(-3deg); text-transform: uppercase; letter-spacing: 0.08em; }
.stamp.big { font-size: 18px; padding: 6px 12px; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-dim); }
.live.on i { background: var(--good); box-shadow: 0 0 0 0 rgba(156, 194, 91, .6); animation: pulse 2s infinite; }
.live.err i { background: var(--red); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(156, 194, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(156, 194, 91, 0); } }
@media (prefers-reduced-motion: reduce) { .live.on i { animation: none; } }
.tab { display: grid; gap: 12px; }
.ranges { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ranges button { border: 0; background: var(--panel); color: var(--ink); padding: 10px 6px; font: 700 14px var(--f-body); }
.ranges button + button { border-left: 1px solid var(--line); }
.ranges button[aria-pressed="true"] { background: var(--mustard); color: var(--mustard-ink); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.tile .k { font: 700 11px/1.2 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.tile .v { font: 900 34px/1.05 var(--f-display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .n { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.tile.money { background: var(--mustard); color: var(--mustard-ink); border-color: var(--mustard); }
.tile.money .k, .tile.money .n { color: rgba(29, 26, 14, .75); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.panel h2 { margin: 0 0 10px; font: 700 22px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.03em; }
.panel h2 small { font: 400 12px var(--f-body); color: var(--ink-dim); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--ink-dim); font: 11px var(--f-body); }
.bar { display: grid; grid-template-columns: minmax(0, 9em) 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.bar .track { height: 12px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--mustard); }
.bar .fill.red { background: var(--red); }
.bar b { font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kv div { background: var(--panel-2); border-radius: 6px; padding: 10px; }
.kv span { display: block; font-size: 12px; color: var(--ink-dim); }
.kv b { font: 900 26px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font: 700 11px var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.feed, .list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; font-size: 14px; }
.feed time, .list time { color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.chip { font: 700 10px/1 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: var(--panel-2); color: var(--ink-dim); white-space: nowrap; }
.chip.good { background: var(--good); color: #17200a; } .chip.red { background: var(--red); color: #fff; } .chip.gold { background: var(--mustard); color: var(--mustard-ink); } .chip.dove { background: var(--dove); color: #0f2630; }
.list li { background: var(--panel-2); border-radius: 6px; padding: 10px; display: grid; gap: 4px; }
.list li .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list li p { margin: 0; color: var(--ink-dim); font-size: 13px; }
.empty { color: var(--ink-dim); font-size: 14px; margin: 0; }
.hint { color: var(--ink-dim); font-size: 13px; margin: -4px 0 10px; }
form.panel { display: grid; gap: 10px; }
label { display: grid; gap: 5px; font: 700 12px var(--f-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
input, textarea, select { font: 16px var(--f-body); color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: 10px; width: 100%; text-transform: none; letter-spacing: 0; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--mustard); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px; }
fieldset label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font: 15px var(--f-body); color: var(--ink); }
fieldset input { width: auto; }
legend { font: 700 12px var(--f-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); padding: 0 4px; }
details summary { cursor: pointer; font-weight: 700; color: var(--mustard); }
details summary small { color: var(--ink-dim); font-weight: 400; }
details[open] { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .row > * { flex: 1 1 140px; }
.btn { font: 900 18px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.05em; border-radius: 6px; padding: 14px; border: 2px solid var(--mustard); background: var(--mustard); color: var(--mustard-ink); cursor: pointer; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--mustard); }
.btn.small { font-size: 14px; padding: 7px 10px; }
.btn:disabled { opacity: .5; }
.result { margin: 0; font-size: 14px; min-height: 1em; } .result.ok { color: var(--good); } .result.no { color: var(--red-hi); }
.warn { margin: 0; color: var(--ground); background: var(--mustard); border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.preview { display: flex; gap: 10px; background: var(--paper); color: #222; border-radius: 14px; padding: 10px 12px; align-items: center; }
.preview img { width: 36px; height: 36px; border-radius: 8px; }
.preview div { display: grid; font-size: 14px; min-width: 0; } .preview b { font-size: 14px; } .preview span { overflow: hidden; text-overflow: ellipsis; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #11130e; border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); z-index: 5; }
.tabs button { background: none; border: 0; color: var(--ink-dim); font: 700 11px var(--f-body); letter-spacing: 0.08em; text-transform: uppercase; display: grid; gap: 2px; justify-items: center; padding: 6px 0; }
.tabs button span { font-size: 18px; line-height: 1; }
.tabs button[aria-current="page"] { color: var(--mustard); }
.login { max-width: 360px; margin: 12vh auto 0; display: grid; gap: 12px; background: var(--paper); color: #241f12; border-radius: 4px; padding: 26px 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.login h2 { margin: 0; font: 900 30px/1 var(--f-display); text-transform: uppercase; }
.login label { color: #5b5340; }
.login input { background: #fff8e6; color: #241f12; border-color: #c9bc95; }
.login .stamp { justify-self: start; }
.list li .row > * { flex: 0 1 auto; }

/* growth: stacked iPhone / Android bars, change against the period before */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; color: var(--ink-dim); margin: 0; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.legend i.ios { background: var(--mustard); } .legend i.android { background: var(--good); } .legend i.partial { background: repeating-linear-gradient(45deg, var(--ink-dim) 0 2px, transparent 2px 5px); }
.delta { font: 700 13px var(--f-body); } .delta.up { color: var(--good); } .delta.down { color: var(--red-hi); }
.tile.money .delta.up { color: #2f4a0a; } .tile.money .delta.down { color: #7d160d; }
.split { font-size: 12px; color: var(--ink-dim); } .tile.money .split { color: rgba(29, 26, 14, .75); }
