:root {
  --bg: #121316; --panel: #1b1d22; --panel2: #23262d; --line: #30343c;
  --text: #ecebe6; --muted: #9a9ca3; --good: #4cc38a; --bad: #ff6b6b; --accent: #f5b83d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4; padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(18,19,22,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; letter-spacing: .02em; display: flex; gap: 10px; align-items: center; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px #555 inset; }
nav { display: flex; gap: 4px; }
nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 15px; }
nav a.on { background: var(--text); color: var(--bg); }
main { max-width: 760px; margin: 0 auto; padding: 16px 14px 60px; }
h1 { font-size: 26px; margin: 4px 0 4px; }
h2 { font-size: 18px; margin: 26px 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; font-weight: 800; background: var(--c); color: var(--ink); box-shadow: 0 0 0 1px #ffffff33 inset; }
.rank { width: 26px; font-weight: 800; color: var(--muted); font-size: 18px; text-align: center; }
.total { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.badge.heist { background: var(--accent); color: #1a1300; }
.badge.puppet { background: #8e4ec6; color: #fff; }
.badge.used { background: var(--panel2); color: var(--muted); }
.leader .total { color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: center; }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; }
.feed div { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pos { color: var(--bad); font-weight: 700; }
.neg { color: var(--good); font-weight: 700; }
button, select, input, textarea { font: inherit; color: inherit; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; touch-action: manipulation; }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: #1a1300; border-color: var(--accent); }
button.good { border-color: #2c6b4c; }
button.bad { border-color: #7a3434; }
button.ghost { background: none; }
button:disabled { opacity: .45; }
select, input, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.btngrid button { text-align: left; display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.stops { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.stops button { min-width: 44px; padding: 8px 0; }
.stops button.on { background: var(--text); color: var(--bg); }
.stops button.done::after { content: "✓"; font-size: 11px; margin-left: 2px; }
.warn { background: #3a2a10; border: 1px solid #6b4d14; color: #f7d48b; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-top: 8px; }
.entry { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.entry button { padding: 4px 9px; font-size: 13px; }
.stopcard .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.pill { background: var(--panel2); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
ul.rules { padding-left: 18px; margin: 6px 0; }
ul.rules li { margin: 3px 0; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 20; max-width: 90vw; }
.err { color: var(--bad); }
