:root {
  --bg: #0b1220; --card: #121a2b; --soft: #1a2438; --line: #24314a; --text: #e8edf6; --muted: #8fa0bb;
  --primary: #f0b90b; --primary-text: #111; --good: #22c55e; --bad: #f43f5e; --warn: #f59e0b; --blue: #3b82f6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: clip; }
.hidden { display: none !important; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; } h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; } h3 { font-size: 1rem; margin: 0 0 .4rem; }
small, .muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
button, input, select { font: inherit; color: inherit; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); padding: .5rem .8rem; min-height: 42px; }
button { cursor: pointer; font-weight: 600; }
button.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select { background: #0e1626; width: 100%; }
label { display: block; margin: .6rem 0; font-weight: 600; font-size: .9rem; }
label input, label select { margin-top: .3rem; font-weight: 400; }
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card.narrow { width: 100%; max-width: 380px; text-align: center; }
.card.narrow input, .card.narrow button { width: 100%; margin-top: .6rem; text-align: center; font-size: 1.2rem; letter-spacing: .3em; }
header { position: sticky; top: 0; z-index: 10; background: rgba(11,18,32,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 10px 16px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mode { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.mode.sim { background: #1e3a5f; color: #93c5fd; } .mode.reel { background: #3b2a05; color: var(--primary); }
nav { display: flex; gap: 4px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
nav button { flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; min-height: 40px; color: var(--muted); font-weight: 600; }
nav button.on { color: var(--text); border-bottom-color: var(--primary); }
main { max-width: 900px; margin: 0 auto; padding: 14px 16px 40px; }
.tab { display: none; } .tab.on { display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi small { display: block; } .kpi b { display: block; font-size: 1.35rem; margin-top: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 140px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner { border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
.banner.sim { background: #10233d; border: 1px solid #1e3a5f; } .banner.reel { background: #2a1f04; border: 1px solid #5c4410; }
.banner.pause { background: #2a1717; border: 1px solid #5b2323; }
.coin { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-top: 1px dashed var(--line); }
.coin:first-child { border-top: 0; }
.chart { width: 100%; height: 190px; display: block; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chips button { min-height: 32px; padding: 3px 10px; font-size: .85rem; }
.chips button.on { background: var(--primary); color: var(--primary-text); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; }
.log div { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.log small { display: block; }
.alloc { display: grid; grid-template-columns: 1fr 90px 40px; gap: 6px; align-items: center; margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; min-height: 20px; margin-top: 2px; }
.steps li { margin: 6px 0; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 12px; z-index: 50; }
.toast.bad { background: var(--bad); color: #fff; }
