:root{--bg:#f6f6f3;--card:#fff;--fg:#141414;--dim:#7c7c82;--line:#e7e7e3;--soft:#efefeb;--acc:#141414;--on-acc:#fff;--ok:#1f9d55;--warn:#c2700a;--bad:#d93636;--r:18px;color-scheme:light dark}
@media(prefers-color-scheme:dark){:root{--bg:#0c0c0d;--card:#161618;--fg:#ececec;--dim:#8a8a92;--line:#25252a;--soft:#1f1f23;--acc:#ececec;--on-acc:#0c0c0d;--warn:#f0a03c}}
*{box-sizing:border-box;margin:0}
html,body{height:100%;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{display:flex;flex-direction:column;height:100dvh;background:var(--bg);color:var(--fg);font:15px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",system-ui,sans-serif;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
button,input,textarea,select{font:inherit;color:inherit}
button{background:var(--acc);color:var(--on-acc);border:0;border-radius:14px;padding:0 18px;height:48px;font-weight:600;cursor:pointer;white-space:nowrap;transition:transform .12s,opacity .15s,background .15s}
button:active{transform:scale(.98)}
button:disabled{opacity:.28;cursor:default;transform:none}
button.ghost,button.secondary{background:var(--soft);color:var(--fg)}
button.danger{background:var(--soft);color:var(--bad)}
button.link{background:none;color:var(--dim);height:auto;padding:4px 2px;border-radius:6px;font-weight:500}
button.link:hover{color:var(--fg)}
button.pill{height:32px;padding:0 14px;border-radius:999px;background:var(--soft);color:var(--fg);font-size:13px;font-weight:500;position:relative}
:focus-visible{outline:2px solid var(--fg);outline-offset:2px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--dim)}
.lab{display:flex;justify-content:space-between;gap:8px}
.lab small{font-size:12px;opacity:.75}
input,textarea,select{width:100%;background:var(--soft);border:1px solid transparent;border-radius:12px;padding:0 14px;height:46px;font-size:16px;color:var(--fg);outline:none;transition:border-color .15s,background .15s}
textarea{height:96px;padding:12px 14px;resize:none;line-height:1.5}
input:focus,textarea:focus,select:focus{border-color:var(--fg);background:var(--card)}
input:focus-visible,textarea:focus-visible,select:focus-visible{outline:none}
input::placeholder,textarea::placeholder{color:var(--dim)}
form{display:flex;flex-direction:column;gap:12px}
form>button{margin-top:4px}
.dim,.muted{color:var(--dim)}
.rules{display:none}
.footer-note{font-size:13px;color:var(--dim)}
h1{font-size:30px;line-height:1.15;font-weight:700;letter-spacing:-.025em}
h2{font-size:20px;font-weight:650;letter-spacing:-.01em}
h3{font-size:14px;font-weight:600}
ul,ol{padding-left:18px}
.bar{flex:none;height:56px;display:flex;align-items:center;gap:12px;padding:0 20px}
.brand{background:none;color:var(--fg);height:auto;padding:0;font-size:16px;font-weight:700;letter-spacing:-.01em;display:flex;align-items:center;gap:9px}
.brand::before{content:"";width:9px;height:9px;border-radius:2.5px;background:currentColor;transform:rotate(45deg)}
#connection{font-size:12px;color:var(--warn)}
#who{margin-left:auto;display:flex;gap:14px;align-items:center;font-size:13px;color:var(--dim)}
main{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:560px;margin:0 auto;padding:4px 20px 16px;position:relative}
.center{flex:1;display:flex;flex-direction:column;justify-content:center;gap:28px}
.narrow{width:100%;max-width:360px;margin:0 auto}
.hero{display:flex;flex-direction:column;gap:8px}
.eyebrow{font-size:12px;font-weight:600;letter-spacing:.06em;color:var(--dim)}
.tabs{display:flex;background:var(--soft);border-radius:12px;padding:4px;gap:4px}
.tabs button{flex:1;height:36px;background:none;color:var(--dim);border-radius:9px;font-weight:500}
.tabs button.on{background:var(--card);color:var(--fg);box-shadow:0 1px 3px rgb(0 0 0/.08)}
.small{font-size:13px}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.spread{justify-content:space-between}
.form-actions{display:flex;gap:10px;flex-wrap:wrap}
.form-actions>button{flex:1}
.join{flex-direction:row;gap:8px}
.join input{flex:1;min-width:0}
.join button,#chat button{flex:none;height:46px}
.games{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.game{height:auto;background:var(--card);color:var(--fg);border-radius:var(--r);padding:16px;text-align:left;display:flex;flex-direction:column;gap:6px;white-space:normal;font-weight:400;box-shadow:0 0 0 1px var(--line)}
.game:hover{box-shadow:0 0 0 1px var(--fg)}
.game .glyph{width:28px;height:28px;border-radius:9px;margin-bottom:6px;background:#6d5efc}
.game:nth-child(2) .glyph{background:#ff7a45}
.game:nth-child(3) .glyph{background:#12b886}
.game:nth-child(4) .glyph{background:#f0b400}
.game strong{font-size:16px;font-weight:650}
.game span{font-size:12.5px;line-height:1.45;color:var(--dim);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.strip{flex:none;display:flex;align-items:center;gap:6px;padding:4px 0 14px}
.av{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:600;background:var(--soft);color:var(--fg);position:relative}
.av.off{opacity:.35}
.av.ready::after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;background:var(--ok);border:2px solid var(--bg)}
.av.host{background:var(--acc);color:var(--on-acc)}
.strip .meta{margin-left:auto;font-size:13px;color:var(--dim);font-variant-numeric:tabular-nums;text-align:right;line-height:1.3}
.strip .tools{display:flex;gap:6px;margin-left:8px}
.strip .meta+.tools{margin-left:8px}
.strip .av:last-of-type+.tools{margin-left:auto}
.dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:var(--bad);border:2px solid var(--bg)}
.timer{font-variant-numeric:tabular-nums;font-size:13px;color:var(--dim)}
.stage{flex:1;min-height:0;display:flex;flex-direction:column;gap:12px;overflow-y:auto;scrollbar-width:none}
.stage::-webkit-scrollbar{display:none}
.card,.panel{background:var(--card);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:10px;box-shadow:0 0 0 1px var(--line)}
.panel+.panel{border-top:0}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
button.row-card{height:auto;text-align:left;color:var(--fg);font-weight:400;flex-direction:row;align-items:center;justify-content:space-between;white-space:normal}
.row-card>span:first-child{display:flex;flex-direction:column;gap:2px}
.status{font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;background:var(--soft)}
.status.ok{color:var(--ok)}
.status.warn{color:var(--warn)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips span{font-size:13px;padding:5px 10px;border-radius:999px;background:var(--soft);font-variant-numeric:tabular-nums}
.roster{display:flex;flex-direction:column;gap:8px}
.person{display:flex;align-items:center;gap:10px;font-size:14px}
.person.off{opacity:.45}
.person small{font-size:11px;color:var(--dim);margin-left:4px}
.person .tick{margin-left:auto;font-size:12px;color:var(--dim)}
.person .tick.on{color:var(--ok);font-weight:600}
.dock{flex:none;display:flex;flex-direction:column;gap:8px;padding-top:12px;align-items:stretch}
.dock-hint{text-align:center;font-size:13px;color:var(--dim)}
.dock .form-actions{flex-wrap:nowrap}
.dock .link{align-self:center}
.badge{font-size:12px;color:var(--dim);padding:3px 10px;border-radius:999px;background:var(--soft);width:max-content}
.clue{padding:12px 14px;background:var(--soft);border-radius:12px}
.clue small{color:var(--dim);font-size:12px}
.secret{padding:20px;border-radius:var(--r);background:var(--acc);color:var(--on-acc);text-align:center;display:flex;flex-direction:column;gap:4px}
.secret strong{font-size:30px;font-weight:700}
.alert{color:var(--bad);font-size:14px}
.locations{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.location{height:auto;background:var(--soft);color:var(--fg);border-radius:14px;padding:14px 4px;font-size:13px;font-weight:500;white-space:normal}
.location.selected{background:var(--acc);color:var(--on-acc)}
.packets{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.packet{background:var(--soft);border-radius:12px;padding:12px}
.packet h3{font-size:12px;color:var(--dim);font-weight:500}
.config-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
details summary{cursor:pointer;color:var(--dim);font-size:13px;list-style:none}
details[open] summary{margin-bottom:8px}
.score{font-weight:650;color:var(--fg)}
.scrim{position:fixed;inset:0;height:auto;width:auto;padding:0;border-radius:0;background:rgb(0 0 0/.32);z-index:30;animation:fade .2s}
.sheet{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:560px;max-height:86dvh;background:var(--card);border-radius:24px 24px 0 0;z-index:31;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom);animation:rise .24s cubic-bezier(.2,.8,.2,1)}
.sheet::before{content:"";width:36px;height:4px;border-radius:2px;background:var(--line);margin:8px auto 0;flex:none}
.sheet-head{flex:none;display:flex;align-items:center;justify-content:space-between;padding:10px 20px 6px}
.sheet-body{flex:1;min-height:0;overflow-y:auto;padding:8px 20px 20px;display:flex;flex-direction:column;gap:12px}
.sheet.chat{height:72dvh}
.sheet.chat .sheet-body{overflow:hidden}
.log{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px}
.message{display:flex;flex-direction:column;gap:2px;max-width:85%}
.message small{color:var(--dim);font-size:12px}
.message p{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--soft);padding:8px 12px;border-radius:14px 14px 14px 4px;width:max-content;max-width:100%}
.message.mine{align-self:flex-end;align-items:flex-end}
.message.mine p{background:var(--acc);color:var(--on-acc);border-radius:14px 14px 4px 14px}
#chat{flex-direction:row;gap:8px}
#chat input{flex:1;min-width:0}
#chat button{flex:none}
#toast{position:fixed;left:50%;top:calc(64px + env(safe-area-inset-top));transform:translateX(-50%);max-width:min(90vw,480px);background:var(--acc);color:var(--on-acc);padding:10px 18px;border-radius:999px;font-size:14px;display:none;z-index:40;box-shadow:0 6px 24px rgb(0 0 0/.18)}
@keyframes rise{from{transform:translate(-50%,100%)}}
@keyframes fade{from{opacity:0}}
@media(max-width:520px){main{padding:4px 16px 12px}.bar{padding:0 16px}h1{font-size:26px}.locations{grid-template-columns:repeat(3,1fr)}.packets{grid-template-columns:1fr}.game{padding:14px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.av{overflow:hidden}
.av img,.me img{width:100%;height:100%;object-fit:cover;display:block}
.av.host{box-shadow:0 0 0 2px var(--acc)}
.me{background:none;color:var(--dim);height:auto;padding:0;display:flex;align-items:center;gap:8px;font-weight:500;font-size:13px}
.me img{width:28px;height:28px;border-radius:50%}
/* Account pages: the supplied warm, illustrated reference; room styles stay scoped above. */
body:is([data-screen="login"],[data-screen="register"],[data-screen="avatar"]){--bg:#fbf6ed;--card:#fbf6ed;--fg:#22231f;--dim:#8b867d;--soft:#f1ebe2;--line:#ece4d8;--or:#fa7b24;color-scheme:light;background:#e7dccb;padding:0}
body:is([data-screen="login"],[data-screen="register"],[data-screen="avatar"])>.bar{display:none}
body:is([data-screen="login"],[data-screen="register"],[data-screen="avatar"])>main{max-width:430px;padding:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;background:var(--bg);box-shadow:0 0 44px rgb(74 48 23/.1)}
.auth{--or:#fa7b24;--cream:#fbf6ed;position:relative;flex:1;display:flex;flex-direction:column;min-height:100%;width:100%;isolation:isolate}
.auth .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.auth .field{flex:none;flex-direction:row;align-items:center;gap:12px;background:var(--soft);border-radius:15px;padding:0 18px;height:54px;border:1px solid transparent;transition:border-color .15s,box-shadow .15s}
.auth .field:focus-within{border-color:#efa560;box-shadow:0 0 0 3px rgb(250 123 36/.09)}
.auth .field>svg{flex:none;width:21px;height:21px;fill:none;stroke:#31332d;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.auth .field input{background:none;border:0;padding:0;height:100%;flex:1;min-width:0;font-size:16px;color:var(--fg)}
.auth .field input:focus{background:none}
.auth .field input::placeholder{color:#aaa297}
.auth .field .eye{flex:none;background:none;height:44px;width:36px;padding:9px;border-radius:8px}
.auth .field .eye svg{width:18px;height:18px;fill:none;stroke:#96918a;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.auth .field .eye.on svg{stroke:var(--or)}
.auth form{gap:14px}
.auth button.cta{background:var(--or);color:#fff;height:54px;min-height:54px;border-radius:17px;font-size:17px;font-weight:650;box-shadow:none;margin-top:3px}
.auth button.cta:hover{background:#ef6f19}
.auth button.cta:disabled{opacity:.55}
.auth button.link.accent{color:var(--or);font-weight:650;padding:4px}
.auth .hint{font-size:12px;line-height:1.45;color:#938c81;margin-top:-7px;padding-left:4px}
.auth .auth-top{display:flex;align-items:center;justify-content:space-between;min-height:38px;font-size:13px;color:#9a9184}
.auth .round{width:36px;height:36px;min-height:36px;padding:0;border-radius:50%;background:#f3ece1;display:grid;place-items:center}
.auth .round svg,.auth .upload svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.auth .auth-title h1{font-size:34px;font-weight:800;line-height:1.2;letter-spacing:-.035em}
.auth .auth-title p{font-size:14px;color:#918a7e;margin-top:13px}
.auth .auth-foliage{position:absolute;bottom:-58px;left:-62px;width:168px;height:202px;object-fit:contain;pointer-events:none;z-index:-1;opacity:.83}
.auth-login .auth-hero{position:relative;flex:none;height:clamp(340px,61dvh,620px);overflow:hidden}
.auth-login .auth-hero>img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 36%}
.auth-login .auth-card{position:relative;flex:1;flex-shrink:0;background:var(--cream);border-radius:32px 32px 0 0;margin-top:-35px;padding:28px 28px max(30px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:22px;isolation:isolate;overflow:hidden}
.auth-login .auth-card h2{font-size:28px;font-weight:800;line-height:1.2;letter-spacing:-.025em}
.auth-login .switch{text-align:center;font-size:13px;color:#9b9487;margin-top:0}
.auth-register .auth-top{flex:none;margin:calc(28px + env(safe-area-inset-top)) 28px 32px}
.auth-register .auth-title{flex:none;padding:0 36px;margin-bottom:29px}
.auth-register .marked-title{position:relative;width:max-content}
.auth-register .marked-title::after{content:"";position:absolute;left:0;bottom:-7px;width:46px;height:4px;border-radius:50%;background:var(--or);transform:rotate(-5deg)}
.auth-register .title-rays{position:absolute;right:-21px;top:-10px;width:22px;height:25px}
.auth-register .title-rays::before,.auth-register .title-rays::after{content:"";position:absolute;width:4px;height:14px;border-radius:3px;background:var(--or);transform:rotate(30deg);left:1px;top:0}
.auth-register .title-rays::after{height:12px;transform:rotate(65deg);left:13px;top:12px}
.auth-register .register-form{flex:none;padding:0 28px;position:relative;z-index:1}
.auth-register .register-note{display:flex;align-items:center;gap:8px;font-size:12px;line-height:1.5;color:#9a9082;margin-top:2px}
.auth-register .register-note span{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;color:#fff;background:var(--or);flex:none}
.auth-register .register-note svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.auth-register .register-scene{position:relative;flex:1;min-height:220px;overflow:hidden;margin-top:8px}
.auth-register .register-scene img{display:block;width:100%;height:100%;position:absolute;inset:0;object-fit:cover;object-position:center bottom}
.auth-register .register-scene::after{content:"";position:absolute;inset:0 0 auto;height:58px;background:linear-gradient(var(--cream),transparent)}
.auth-avatar{padding:calc(28px + env(safe-area-inset-top)) 28px max(30px,env(safe-area-inset-bottom));gap:0;overflow:hidden}
.auth-avatar .auth-top{flex:none;margin-bottom:30px}
.auth-avatar .step-label{font-size:12px;color:#b4a58f}
.auth-avatar .auth-title{text-align:center;flex:none;margin-bottom:27px}
.auth-avatar .auth-title h1{font-size:30px}
.auth-avatar .auth-title p{margin-top:10px;font-size:13px}
.auth-avatar .avatar-big{position:relative;flex:none;width:124px;height:124px;margin:0 auto 30px}
.auth-avatar .avatar-big>img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;box-shadow:0 0 0 5px #fbf6ed,0 0 0 7px #e9d4b2}
.auth-avatar .upload{position:absolute;right:-1px;bottom:-1px;width:35px;height:35px;border-radius:50%;background:var(--or);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 0 0 3px var(--cream)}
.auth-avatar .upload input{position:absolute;width:1px;height:1px;opacity:0}
.auth-avatar .upload:focus-within{outline:2px solid var(--or);outline-offset:2px}
.auth-avatar .nickname-row{flex:none;margin-bottom:19px}
.auth-avatar .nick-hint{margin-top:7px;padding-left:3px;font-size:11px}
.auth-avatar .preset-grid{flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
.auth-avatar .preset{position:relative;aspect-ratio:1;height:auto;padding:3px;border:2px solid transparent;border-radius:17px;overflow:visible;background:none;cursor:pointer}
.auth-avatar .preset img{width:100%;height:100%;object-fit:cover;display:block;border-radius:12px}
.auth-avatar .preset.on{border-color:var(--or);background:#fff7e9}
.auth-avatar .preset.on::after{content:'✓';position:absolute;right:-3px;bottom:-3px;width:22px;height:22px;border-radius:50%;background:var(--or);color:#fff;font-size:13px;display:grid;place-items:center;box-shadow:0 0 0 2px var(--cream)}
.auth-avatar .preset:focus-visible{outline:2px solid var(--or);outline-offset:3px}
.auth-avatar .avatar-actions{position:relative;z-index:1;flex:none;display:flex;flex-direction:column;gap:12px;margin-top:30px}
.auth-avatar .avatar-actions .link{align-self:center;font-size:12px;color:#a59c8e}
@media(max-width:430px){body:is([data-screen="login"],[data-screen="register"],[data-screen="avatar"]){background:#fbf6ed}}
@media(max-height:740px){.auth-register .auth-top{margin-top:18px;margin-bottom:23px}.auth-register .auth-title{margin-bottom:23px}.auth-register .register-scene{min-height:180px}.auth-avatar{padding-top:18px}.auth-avatar .auth-top{margin-bottom:20px}.auth-avatar .auth-title{margin-bottom:22px}.auth-avatar .avatar-big{width:110px;height:110px;margin-bottom:23px}.auth-avatar .avatar-actions{margin-top:22px}}
