/* JOHNSON: the view on a stage (CAD⁴'s bar, pad, lever and caption), the facts in a panel: below on a phone (the view
   the top two thirds), beside from 980 px */
:root { --bg: #07080c; --panel: #0d0f15; --text: #e9e4da; --dim: #9a958c; --gold: #ffd27a; --ana: #38f2e0; --kata: #ff66b8; --ice: #6fe0ff; --bad: #ff6a4a;
  --mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace; --sans: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.stage { position: relative; flex: 0 0 66.667%; min-height: 0; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.panel { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--panel); border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); font: 12px var(--mono); }
@media (min-width: 980px) { .app { flex-direction: row; } .stage { flex: 1 1 auto; height: 100%; } .panel { flex: 0 0 400px; height: 100%; border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.1); } }
#gl, #ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl { touch-action: none; cursor: grab; } #ov { pointer-events: none; }
#bar { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 6px; align-items: center; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 10px; background: linear-gradient(rgba(7, 8, 12, 0.88), rgba(7, 8, 12, 0)); overflow-x: auto; scrollbar-width: none; }
#bar > b { font: 800 13px var(--mono); letter-spacing: 0.1em; margin-right: 2px; }
#bar .home { font: 600 11px var(--mono); color: var(--dim); text-decoration: none; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 3px 7px; flex: none; }
#bar button, #bar select, .btns button { flex: none; font: 600 12px var(--mono); background: rgba(7, 8, 12, 0.6); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; padding: 5px 9px; cursor: pointer; touch-action: manipulation; }
#bar select { border-color: var(--gold); color: var(--gold); max-width: 42vw; }
#bar button.on { border-color: var(--gold); color: var(--gold); }
.seg { display: inline-flex; flex: none; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; overflow: hidden; }
#bar .seg button { border: 0; border-radius: 0; background: rgba(7, 8, 12, 0.6); }
#bar .seg button + button { border-left: 1px solid rgba(255, 255, 255, 0.18); }
#bar .seg button.on { background: var(--gold); color: var(--bg); }
body:not(.is4) .four { display: none !important; }
#cap { position: absolute; left: 10px; top: calc(44px + env(safe-area-inset-top)); max-width: min(460px, calc(100% - 130px)); font: 12.5px/1.5 var(--sans); color: #d9d3c8; background: rgba(7, 8, 12, 0.62); border-radius: 10px; padding: 7px 10px; cursor: pointer; }
#cap.min { max-height: 2.4em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
#toast { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); font: 600 12px var(--mono); color: var(--gold); background: rgba(7, 8, 12, 0.8); border: 1px solid var(--gold); border-radius: 10px; padding: 7px 11px; pointer-events: none; opacity: 0; transition: opacity 0.3s; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; }
.pad { position: absolute; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 96px; height: 96px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.28); background: rgba(7, 8, 12, 0.35); touch-action: none; cursor: grab; }
.pad.live, .lever.live { border-color: rgba(255, 210, 122, 0.75); }
#twistKnob { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); pointer-events: none; }
.pad span { position: absolute; left: -10px; right: -10px; top: -17px; text-align: center; font: 10px var(--mono); color: var(--dim); pointer-events: none; }
.lever { position: absolute; right: 14px; bottom: calc(26px + env(safe-area-inset-bottom)); width: 42px; height: 112px; border-radius: 21px; border: 2px solid rgba(255, 255, 255, 0.28); background: linear-gradient(rgba(56, 242, 224, 0.18), rgba(7, 8, 12, 0.3) 50%, rgba(255, 102, 184, 0.18)); touch-action: none; cursor: ns-resize; }
#anaKnob { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); pointer-events: none; }
.lever b, .lever i { position: absolute; left: 0; right: 0; text-align: center; font: 600 10px var(--mono); font-style: normal; pointer-events: none; }
.lever b { top: -15px; color: var(--ana); } .lever i { bottom: -15px; color: var(--kata); }
.nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--dim); }

.panel section { margin: 0 0 12px; }
.panel h2 { font: 700 12px var(--mono); letter-spacing: 0.08em; color: var(--gold); margin: 0 0 6px; }
.rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.rows > i { font-style: normal; color: var(--dim); } .rows > span { text-align: right; overflow-wrap: anywhere; }
#chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#chips span { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); }
#chips i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.btns button.on { border-color: var(--gold); color: var(--gold); }
.foot { font: 12.5px/1.6 var(--sans); color: var(--dim); margin: 4px 0; }
details { margin-top: 10px; color: #c9c3b8; font: 13.5px/1.6 var(--sans); }
details p b { color: var(--text); } details a { color: var(--ice); }
summary { font: 600 11px var(--mono); color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.t { color: var(--ana); font-style: normal; } .p { color: var(--kata); font-style: normal; }
body:not(.isSeat) .seatonly { display: none !important; }
.legend { display: grid; gap: 4px; margin-top: 6px; }
.legend button { display: flex; align-items: center; gap: 8px; text-align: left; font: 12px var(--mono); color: var(--text); background: none; border: 1px solid transparent; border-radius: 8px; padding: 3px 6px; cursor: pointer; }
.legend button.on { border-color: var(--gold); }
.legend i { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.legend em { color: var(--dim); font-style: normal; margin-left: auto; }
#chart { display: block; width: 100%; height: 130px; margin: 8px 0; background: #07080c; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; touch-action: none; }
.panel h2.sub { margin-top: 10px; } .panel h2 em { font: 400 11px var(--mono); color: var(--dim); letter-spacing: 0; }
.next { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.next button { font: 600 11.5px var(--mono); color: var(--text); background: #11141c; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; padding: 5px 8px; cursor: pointer; text-align: left; touch-action: manipulation; }
.next button:hover, .next button.hot { border-color: var(--gold); color: var(--gold); }
.next button small { display: block; font: 10.5px var(--mono); color: var(--dim); }
.next .end { color: var(--gold); font: 600 12px var(--mono); }
