:root { --bg: #0b0912; --ink: #ece6f4; --dim: #9a91ad; --line: #2b2540; --teal: #3ff2df; --rose: #fb5cb8; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; }
canvas#view:active { cursor: grabbing; }
header { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 0; pointer-events: none; }
h1 { margin: 0; font: 700 15px var(--mono); letter-spacing: 0.18em; color: var(--ink); text-shadow: 0 0 18px #3ff2df55; }
h1 span { font-weight: 400; letter-spacing: 0.04em; color: var(--dim); }
header button { pointer-events: auto; }
button { font: 600 13px var(--mono); color: var(--ink); background: #1a1528cc; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
button.on, .chips button.on { border-color: var(--teal); color: var(--teal); }
#infoBtn { width: 32px; height: 32px; padding: 0; }
#info { position: fixed; top: calc(52px + env(safe-area-inset-top)); left: 16px; right: 16px; max-width: 560px; margin: 0 auto; background: #120f1ef2; border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; font-size: 14px; color: #d6cfe3; z-index: 2; }
#info b { color: var(--teal); font-family: var(--mono); }
#say { position: fixed; left: 16px; right: 16px; bottom: calc(var(--ph, 150px) + 8px); text-align: center; font-size: 14px; color: #d6cfe3; text-shadow: 0 1px 8px #000; pointer-events: none; }
#say b { color: var(--ink); }
#panel { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(#0b091200, #0b0912e8 30%); display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 760px; width: 100%; margin: 0 auto; }
.row label { font: 600 12px var(--mono); color: var(--dim); min-width: 74px; }
.row input[type=range] { flex: 1 1 140px; accent-color: var(--teal); min-width: 0; }
output { font: 12px var(--mono); color: var(--dim); min-width: 74px; text-align: right; }
.chips { display: inline-flex; gap: 4px; }
.chips button { padding: 5px 9px; }
@media (max-width: 520px) { .row label { min-width: 0; width: 100%; } output { min-width: 60px; } }

/* the balance panel */
.card { position: fixed; top: calc(52px + env(safe-area-inset-top)); left: 16px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - var(--ph, 150px) - 130px); overflow-y: auto; background: #120f1ef2; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; font-size: 13.5px; color: #d6cfe3; z-index: 2; }
.card .ghead { display: flex; justify-content: space-between; align-items: center; }
.card .x { width: 28px; height: 28px; padding: 0; }
.card h4 { margin: 12px 0 2px; font: 600 12px var(--mono); color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.gsub { margin: 6px 0; color: #b9b0cc; } .gsub .dim { color: var(--dim); }
.gplans { flex-wrap: wrap; margin: 6px 0; } .gplans small { color: var(--dim); font-weight: 400; }
.gview { width: 100%; height: 200px; display: block; background: #0b0912; border: 1px solid var(--line); border-radius: 10px; touch-action: none; cursor: grab; }
.gverdict { margin: 8px 0; } .gverdict i { color: var(--dim); }
.gphases { display: grid; gap: 4px; }
.gphases button { display: flex; justify-content: space-between; gap: 8px; border-radius: 8px; text-align: left; font-weight: 500; }
.gphases em { font-style: normal; font-weight: 400; } .gphases em.ok { color: #f2b84c; } .gphases em.no { color: #ff7a6a; }
.gbtns { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .gnote { font: 12px var(--mono); color: var(--dim); }
.grow label { min-width: 0 !important; width: auto !important; }
.gbar { display: grid; grid-template-columns: 9.5em 1fr 3em; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--dim); margin: 3px 0; }
.gbar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c9b3ff, #3ff2df); }
.gbar em { font-style: normal; text-align: right; }
/* on a phone the panel and the controls can't both fit over the cat: while the panel is open the controls step aside
   (its × brings them back), and the panel takes at most half the screen */
@media (max-width: 520px) { .card { max-height: 50dvh; } body.gait #panel { display: none; } body.gait #say { bottom: calc(10px + env(safe-area-inset-bottom)); } }
