:root{font-family:system-ui,"Segoe UI",sans-serif;color:#282521;background:#c4cbc2;font-synthesis:none;text-rendering:optimizeLegibility;font-weight:400}*{box-sizing:border-box}html,body,#stage{width:100%;height:100%;margin:0;overflow:hidden}body{position:relative}#stage canvas{display:block;width:100%;height:100%;touch-action:none}#hud{position:absolute;z-index:2;top:max(12px,env(safe-area-inset-top));left:12px;right:12px;display:flex;align-items:center;gap:10px;min-height:56px;padding:9px 12px;border:1px solid #ffffff35;border-radius:15px;background:#24211de8;color:#fff;box-shadow:0 8px 28px #0003;backdrop-filter:blur(10px)}#hud[hidden],#help[hidden],#touchControls[hidden]{display:none}.brand{display:flex;flex-direction:column;min-width:190px;margin-right:auto}.brand strong{color:#ffd166;font-size:15px}.brand span,.student span{font-size:11px;color:#d7d1c8}.student{display:flex;flex-direction:column;max-width:180px;font-size:13px}.pill{border:1px solid #ffffff2b;border-radius:10px;padding:9px 11px;color:#fff;background:#ffffff12;font:inherit;font-size:13px;cursor:pointer}.pill:hover{background:#ffffff25}kbd{font:600 11px ui-monospace,monospace;padding:3px 5px;border-radius:5px;color:#fff;background:#ffffff20}#minimap{position:absolute;z-index:2;right:14px;top:82px;width:220px;height:160px;border:1px solid #ffffff80;border-radius:12px;background:#222b2adc;box-shadow:0 8px 28px #0003}#loading{position:absolute;z-index:4;left:50%;top:50%;transform:translate(-50%,-50%);padding:13px 18px;border-radius:12px;background:#24211de8;color:#fff;font-size:14px}#toast{position:absolute;z-index:3;left:50%;top:82px;transform:translateX(-50%);padding:10px 15px;border-radius:10px;background:#24211ded;color:white;box-shadow:0 5px 20px #0003}#help{position:absolute;z-index:2;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;gap:12px;align-items:center;white-space:nowrap;padding:10px 14px;border-radius:13px;background:#24211de8;color:#fff;font-size:12px;box-shadow:0 8px 28px #0003}#help[hidden]{display:none}.mobile-note{display:none}.overlay{position:absolute;z-index:5;inset:0;display:grid;place-items:center;padding:20px;background:linear-gradient(135deg,#3930279c,#1119139c);backdrop-filter:blur(4px)}.overlay[hidden]{display:none}.card{width:min(100%,480px);padding:clamp(23px,5vw,38px);border:1px solid #e6d6c5;border-radius:22px;background:#fffaf1;box-shadow:0 24px 80px #17130f55}.eyebrow{margin:0 0 8px;color:#a33a2c;font-size:11px;font-weight:800;letter-spacing:.14em}.card h1{margin:0;color:#8e2a22;font-size:clamp(28px,7vw,40px);line-height:1.12}.lead{margin:10px 0 22px;color:#6b6258;font-size:15px}.fields{display:grid;gap:13px}.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}label{display:grid;gap:6px;color:#514a42;font-size:13px;font-weight:650}input,select{width:100%;min-height:43px;padding:10px 11px;border:1px solid #d8cbbd;border-radius:9px;background:white;color:#292522;font:inherit;font-size:14px}input:focus,select:focus{outline:2px solid #c65c4f55;border-color:#a33a2c}.primary{width:100%;margin-top:19px;padding:13px;border:0;border-radius:10px;background:#8e2a22;color:#fff;font:inherit;font-weight:750;cursor:pointer}.primary:hover{background:#722019}.privacy{margin:12px 0 0;color:#82776c;font-size:11px;text-align:center}.error{margin:12px 0 0;color:#a2231b;font-size:13px}#touchControls{position:absolute;z-index:3;left:14px;bottom:20px;display:none;flex-direction:column;align-items:center;gap:4px}#touchControls>div{display:flex;gap:4px}#touchControls button{width:48px;height:45px;border:1px solid #ffffff4d;border-radius:11px;background:#24211dcc;color:#fff;font:700 17px system-ui;touch-action:none}#touchControls button[data-key="ShiftLeft"]{width:74px;font-size:12px}@media(max-width:720px){#hud{gap:6px;padding:8px}.brand{min-width:0}.brand strong{font-size:12px}.brand span{display:none}.student{display:none}.pill{padding:8px;font-size:11px}#minimap{top:69px;width:170px;height:124px}.mobile-note{display:inline}#help{left:10px;right:10px;bottom:150px;transform:none;display:flex;justify-content:center;flex-wrap:wrap;gap:6px;padding:8px;font-size:10px}.overlay{padding:13px}.card{padding:23px 19px}#touchControls{display:flex}#touchControls[hidden]{display:none}}
.environment-status{max-width:290px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 10px;border:1px solid #ffffff2b;border-radius:10px;background:#ffffff12;color:#fff;font-size:12px;font-variant-numeric:tabular-nums}
@media(max-width:720px){.environment-status{order:3;max-width:100%;flex:1 0 100%;padding:6px 8px;text-align:center;font-size:11px}}
.overlay{overflow-y:auto}.uniform-rule{margin:12px 0 0;padding:10px 12px;border:1px solid #ead8ae;border-radius:9px;background:#fff4d8;color:#66512d;font-size:12px;line-height:1.45}.error{line-height:1.5}@media(max-height:760px){.overlay{align-items:start}}@media(max-width:720px){.overlay{align-items:start}}
.uniform-preview{display:flex;align-items:center;gap:14px;margin:0 0 16px;padding:10px 13px;border:1px solid #eed9b6;border-radius:14px;background:linear-gradient(135deg,#fff6df,#fffdf6)}.uniform-illustration{width:108px;height:114px;flex:0 0 auto}.uniform-illustration [hidden]{display:none}.preview-backdrop{fill:#d9f1ff}.preview-sun{fill:#ffc857}.preview-cloud{fill:#fffdf7}.preview-ground{fill:none;stroke:#83b67b;stroke-width:3;stroke-linecap:round}.preview-face{fill:#d99c73}.preview-hair{fill:#30221b}.preview-neck{fill:#d99c73}.preview-arm{fill:none;stroke:#f8f7ee;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.preview-collar{fill:#fff;stroke:#d9d2c7;stroke-width:1}.preview-shirt-seam{fill:none;stroke:#d6d3cc;stroke-width:1.4}.preview-bag-strap,.preview-backpack-strap{fill:none;stroke:#64492f;stroke-width:4;stroke-linecap:round}.preview-bag{fill:#9b4332;stroke:#793327;stroke-width:1.5}.preview-bag-detail{fill:none;stroke:#f1c978;stroke-width:2;stroke-linecap:round}.preview-shoe{fill:#332c27}.preview-shoe-detail{fill:none;stroke:#f0c77b;stroke-width:2;stroke-linecap:round}.uniform-preview-copy{display:grid;gap:5px}.uniform-preview-copy strong{color:#547b40;font-size:14px}.uniform-preview-copy span{color:#62584a;font-size:12px;line-height:1.45}.uniform-preview.is-invalid{border-color:#e7a29a;background:linear-gradient(135deg,#fff0ed,#fffaf4)}.uniform-preview.is-invalid .uniform-preview-copy strong{color:#a63127}#previewShirt{fill:#fffdf6;stroke:#c9c4b9;stroke-width:1.5}#previewPants{fill:#171717;stroke:#090909;stroke-width:1.5}#previewUntuckedHem{fill:none;stroke:#aaa398;stroke-width:2}
.preview-hair-tie{fill:none;stroke:#c94e45;stroke-width:2.5;stroke-linecap:round}
.npc-speech{position:absolute;z-index:3;max-width:min(280px,80vw);padding:9px 12px;border:1px solid #ffffffa0;border-radius:12px;background:#fffaf0;color:#3f3328;font-size:13px;font-weight:650;line-height:1.4;box-shadow:0 5px 18px #0003;transform:translate(-50%,-100%);pointer-events:none}.npc-speech::after{content:"";position:absolute;left:calc(50% - 6px);bottom:-7px;width:12px;height:12px;background:#fffaf0;border-right:1px solid #ffffffa0;border-bottom:1px solid #ffffffa0;transform:rotate(45deg)}
#npcLabels{position:absolute;z-index:1;inset:0;overflow:hidden;pointer-events:none}.npc-name-tag{position:absolute;transform:translate(-50%,-100%);max-width:min(190px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 7px;border:1px solid #fff9;border-radius:8px;background:#28231dd9;color:#fff8e9;font-size:11px;font-weight:700;text-shadow:0 1px 2px #0008;box-shadow:0 2px 8px #0003}.npc-name-tag[hidden]{display:none}
.npc-name-tag.principal-name-tag{border-color:#f0cf75;background:#493b1fe8;color:#ffe29a}
#chatPanel{position:absolute;z-index:4;right:14px;top:82px;width:min(360px,calc(100vw - 24px));height:min(440px,calc(100dvh - 110px));display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;border:1px solid #ffffff70;border-radius:16px;background:#fffaf1;color:#302922;box-shadow:0 12px 36px #0005}
#chatPanel[hidden]{display:none}
.chat-heading{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#302b25;color:#fff}
.chat-heading>div{display:grid;gap:2px}.chat-heading strong{font-size:14px}.chat-heading span{font-size:11px;color:#d9cfc1}
#chatClose{width:30px;height:30px;border:0;border-radius:8px;background:#ffffff18;color:white;font-size:22px;line-height:1;cursor:pointer}
#chatMessages{display:flex;flex-direction:column;gap:9px;overflow:auto;padding:12px;background:linear-gradient(#fffaf1,#fff5e8)}
.chat-message{max-width:92%;padding:8px 10px;border:1px solid #eadbc8;border-radius:10px;background:#fff;color:#3a332d;overflow-wrap:anywhere}
.chat-message.is-own{align-self:flex-end;border-color:#e7c6a7;background:#f9e8d7}.chat-message.is-system{align-self:center;border:0;background:transparent;color:#82766b;font-size:11px;text-align:center}
.chat-meta{display:flex;gap:7px;align-items:baseline;margin-bottom:3px;font-size:11px;color:#806348}.chat-meta strong{color:#8e2a22}.chat-text{margin:0;font-size:13px;line-height:1.4;white-space:pre-wrap}
#chatForm{display:flex;gap:8px;padding:10px;border-top:1px solid #eadbc8;background:#fffdf8}
#chatInput{min-width:0;flex:1;min-height:40px;padding:8px 10px;font-size:13px}
#chatForm button{min-width:58px;border:0;border-radius:9px;background:#8e2a22;color:#fff;font:600 13px system-ui;cursor:pointer}
.remote-player-tag{border-color:#c9e3ff;background:#16344fe8;color:#f1f8ff}
@media(max-width:720px){#chatPanel{top:124px;right:10px;width:min(350px,calc(100vw - 20px));height:min(55dvh,420px)}#chatToggle{order:4}}
