:root{color-scheme:dark;--bg:#0b1020;--panel:#141d31;--panel2:#19243a;--line:#293751;--text:#f1f6ff;--muted:#a5b4cb;--accent:#69daf0;--good:#8ce8c8;--warn:#ffd08d;--bad:#ff9d9d}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:radial-gradient(circle at 50% -15%,#1b3154,#0b1020 55%);font:15px/1.5 "Segoe UI",Inter,system-ui,sans-serif;color:var(--text)}
button,select,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}
button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
h1,h2,h3,p{margin-top:0}h1{letter-spacing:-.04em}h2{font-size:21px}h3{font-size:17px}
.site-header{height:80px;max-width:1190px;margin:auto;padding:0 26px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #253751}
.brand{display:flex;align-items:center;gap:12px;font-size:19px;font-weight:850;letter-spacing:-.7px;line-height:1.08}
.brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(140deg,#6eecdc,#67b5f7);display:grid;place-items:center;color:#071726;font-weight:900;font-size:25px}
.brand-accent{color:#90ddec}.brand small{display:block;font-size:10px;letter-spacing:1.7px;color:#8dabc4;font-weight:700;margin-top:4px}
.beta-label{border:1px solid #325168;border-radius:30px;padding:6px 12px;font-size:10px;color:#a5d8e7;letter-spacing:1px}
.screen{max-width:1140px;margin:0 auto;padding:0 26px}
.choice-screen{min-height:calc(100vh - 156px);display:flex;align-items:center;justify-content:center;flex-direction:column;padding-top:70px;padding-bottom:65px}
.intro{text-align:center;margin-bottom:36px}.eyebrow{display:block;font-size:11px;color:#7ed8ea;letter-spacing:2px;font-weight:850;margin-bottom:12px}
.intro h1{font-size:clamp(32px,5vw,56px);margin:0 0 12px;line-height:1.15}.intro p{color:var(--muted);font-size:16px;margin:0}
.choice-grid{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.choice{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;min-height:228px;padding:29px;border-radius:17px;border:1px solid #35465f;background:linear-gradient(165deg,#1a2942,#131d30);color:var(--text);transition:transform .18s,border-color .18s,background .18s;box-shadow:0 12px 44px #0002}
.choice:hover{transform:translateY(-3px);border-color:#79d6e6;background:#1c3147}
.choice-symbol{display:grid;place-items:center;width:50px;height:50px;border-radius:14px;font-size:29px;font-weight:900;margin-bottom:24px}
.choice-healthy .choice-symbol{background:#1c4e45;color:var(--good)}
.choice-drift .choice-symbol{background:#534126;color:var(--warn)}
.choice-severe .choice-symbol{background:#552d3a;color:var(--bad)}
.choice strong{font-size:21px;letter-spacing:-.5px;line-height:1.2;margin-bottom:9px}
.choice>span:nth-last-child(2){font-size:13px;color:var(--muted)}
.choice-arrow{position:absolute;right:28px;top:36px;color:#9eafc4;font-size:26px}
.tiny-note{text-align:center;font-size:12px;color:#8097b1;margin:23px 0 0}
.test-screen{padding-top:43px;padding-bottom:80px}
.test-top{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:19px}
.back-btn{padding:7px 0;color:#afd4e5;border:0;background:none;font-weight:650;font-size:13px}
.back-btn:hover{color:white}.choice-badge{font-size:12px;color:#d2e9f7;padding:7px 12px;background:#1c3447;border:1px solid #30536c;border-radius:30px}
.test-screen h1{font-size:clamp(30px,4vw,40px);margin:0 0 7px}.section-lede{color:var(--muted);margin-bottom:26px}
.test-layout{display:grid;grid-template-columns:minmax(0,1fr) 252px;gap:19px;align-items:start}.column{display:flex;flex-direction:column;gap:18px;min-width:0}
.panel,.help-card{background:linear-gradient(150deg,var(--panel),#121b2c);border:1px solid var(--line);border-radius:15px;padding:25px}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.panel-heading h2{margin:0}
.status-tag{font-size:11px;padding:5px 9px;border:1px solid #635438;border-radius:20px;color:#eac68c;white-space:nowrap}
.status-tag.ok{border-color:#427461;color:#a1efd2}
.notice{font-size:13px;padding:12px 14px;background:#12273b;border:1px solid #25465e;color:#b5cfe0;border-radius:8px;margin-bottom:17px}.notice.error{color:#ffc3c3;border-color:#824d53}
.field-label{display:block;font-size:12px;color:#bac8da;margin-bottom:8px;font-weight:700}
select{width:100%;background:#0d1727;border:1px solid #344b62;padding:12px 15px;color:var(--text);border-radius:8px}
.sticks-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-top:19px}
.stick{text-align:center;background:#101c2d;border:1px solid #2d4057;border-radius:12px;padding:12px;min-width:0}
.stick h3{font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#96afc8;margin:2px 0 8px}
.stick canvas{display:block;width:min(100%,220px);aspect-ratio:1;margin:auto}
.stick strong{font-size:17px;color:#93e3ed;font-variant-numeric:tabular-nums}
.progress-track{height:7px;background:#263850;border-radius:99px;overflow:hidden}
.progress-fill{background:linear-gradient(90deg,#85e8d1,#85b9ff);height:100%;width:0%;transition:width .14s}
.step-marker{font-weight:850;color:#9ecfdf;font-size:13px}
.phase-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:22px}
.phase-top h3{margin:0}.phase-top strong{font-variant-numeric:tabular-nums;color:#9aeaf1;font-size:22px}
.phase-description{color:var(--muted);font-size:13px;margin:12px 0 21px}
.phase-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:22px}
.phase-steps span{border:1px solid #32445b;border-radius:7px;padding:10px 6px;color:#8a9eb6;text-align:center;font-size:11px}
.phase-steps span.active{border-color:#5fadb6;background:#1d3e4b;color:#d4faff}
.phase-steps span.done{border-color:#3e7566;color:#9bead0}
.check-line{display:flex;gap:12px;align-items:flex-start;font-size:13px;color:#bdcadd;line-height:1.6;margin:18px 0}
.check-line input{accent-color:#72dce7;margin:4px 0 0;width:17px;height:17px;flex:none}
.button-row{display:flex;gap:11px;flex-wrap:wrap}
.btn{padding:12px 22px;font-size:14px;font-weight:800;border-radius:9px;border:1px solid #36516a}
.btn-primary{background:#7cdeef;color:#092131;border-color:#7cdeef}.btn-primary:hover:not(:disabled){background:#a4eff7}
.btn-secondary{background:#192c43;color:#c7dfed}.btn-secondary:hover:not(:disabled){background:#26405b}
.feedback{color:#9db4c9;font-size:12px;margin:12px 0 0}.feedback.error{color:#ffb4b4}
.help-card h2{margin-bottom:19px}.help-card ol{padding-left:22px;margin:0 0 23px;color:#d2deed}.help-card li{margin:15px 0}
.help-card p{border-top:1px solid #314157;padding-top:18px;color:#91acc3;font-size:12px;margin:0}
.result-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}
.result-grid>div{border:1px solid #31495d;background:#132438;border-radius:9px;padding:17px}
.result-grid span{display:block;color:#a2b7ca;font-size:12px}.result-grid strong{display:block;font-size:24px;color:#9ce5ed;font-variant-numeric:tabular-nums;margin-top:9px}
.result-note{color:#9db4c9;font-size:12px;margin:16px 0}.result-panel #uploadBtn{margin-top:0}
.hidden{display:none!important}
.footer{max-width:1190px;margin:0 auto;border-top:1px solid #223047;display:flex;justify-content:space-between;gap:12px;padding:20px 26px;color:#8196af;font-size:11px}
@media(max-width:840px){.choice-grid{grid-template-columns:1fr;max-width:560px}.choice{min-height:125px;padding:19px 60px 19px 19px}.choice-symbol{margin-bottom:12px;width:36px;height:36px;font-size:21px}.choice-arrow{top:30px}.choice strong{font-size:18px}.choice-screen{padding-top:50px;padding-bottom:55px}.test-layout{grid-template-columns:1fr}.help-card{display:none}}
@media(max-width:530px){.screen{padding-inline:16px}.site-header{height:70px;padding-inline:16px}.brand{font-size:17px}.intro p{font-size:14px}.intro h1{font-size:34px}.choice-grid{gap:12px}.panel{padding:17px}.sticks-grid{gap:8px}.stick{padding:6px}.phase-steps{grid-template-columns:repeat(2,1fr)}.result-grid{grid-template-columns:1fr}.footer{flex-wrap:wrap;padding-inline:16px}.test-top{align-items:flex-start;flex-direction:column;gap:8px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}

/* v0.1.6: manual Gamepad API axis mapping and browser-only filter demonstration */
.mapping-panel{margin-top:15px;border:1px solid #34465f;border-radius:10px;padding:13px;background:#101b2f}
.mapping-panel summary{cursor:pointer;color:#c4e3ef;font-size:13px;font-weight:700}
.mapping-panel summary:hover{color:#fff}
.mapping-help{color:#9eb6ca;font-size:12px;margin:12px 0}
.mapping-grid,.survey-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.mapping-grid label,.survey-grid label{color:#b9cfe0;font-weight:600;font-size:12px}
.mapping-grid select,.survey-grid select{margin-top:7px}
.survey-grid{margin:14px 0 22px}
.survey-grid label{line-height:1.5}
.preview-entry{border-color:#2f6673}
.preview-entry .section-lede{margin-bottom:17px;font-size:13px}
.preview-controls{align-items:center;justify-content:space-between;margin-top:13px}
.preview-controls strong{color:#9de4ed;font-variant-numeric:tabular-nums;font-size:18px}
.dot-legend{display:inline-block;height:9px;width:9px;border-radius:50%;margin-right:4px;margin-left:6px}
.raw-dot{background:#f2bb70}.filter-dot{background:#8aeedd}
#surveyPanel{margin-top:23px;border-top:1px solid #36506b;padding-top:22px}
#previewPanel h3{margin-bottom:8px}
#previewSendBtn{max-width:100%}
@media(max-width:530px){.mapping-grid,.survey-grid{grid-template-columns:1fr}}
