@font-face{font-family:Inter;src:url('assets/Inter.woff2');font-weight:100 900;font-display:swap}
:root{font-family:Inter,Arial,sans-serif;color:#292d33;background:#f5f3ed;font-synthesis:none;--ink:#292d33;--muted:#696d72;--purple:#514acb;--line:#dddcd5;--header:72px;--dock:78px}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select,summary{outline-offset:3px}button{cursor:pointer;border:0;color:inherit;background:#fffef9;border-radius:12px;padding:12px 16px;font-weight:600;min-height:44px;touch-action:manipulation}button:hover{background:#ede9fb}button:active{transform:translateY(1px)}button:disabled{opacity:.5;cursor:wait}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #635bdd}[hidden]{display:none!important}a{color:var(--purple)}.primary,.secondary{display:flex;align-items:center;justify-content:center;gap:12px;border-radius:13px;text-decoration:none;min-height:48px;font-weight:600}.primary{background:var(--purple);color:#fff;padding:14px 20px}.primary:hover{background:#403bb1}.secondary{background:#e9e5fa;color:#4c44bd;padding:14px 18px}.eyebrow{font-size:11px;letter-spacing:1.2px;font-weight:700;color:#686576}h1,h2,h3,p{margin-top:0}h1,h2{letter-spacing:-.6px}.close{position:absolute;right:12px;top:12px;width:44px;height:44px;padding:0;background:#fffefa;font-size:28px;z-index:5;border:1px solid var(--line)}.text-button{background:transparent;color:var(--purple);font-size:13px;padding:10px 0}.field-note{font-size:13px;line-height:1.6;color:var(--muted);margin:12px 0}
#world{position:relative;height:100dvh;overflow:hidden;background:#e4ece4}#city{position:absolute;top:var(--header);bottom:var(--dock);left:0;width:100%;height:calc(100% - var(--header) - var(--dock));display:block;touch-action:none}.game-header{position:absolute;top:0;left:0;right:0;height:var(--header);padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fbfaf5;border-bottom:1px solid #dfe3da;z-index:4}.world-brand img{width:116px;height:43px;display:block}.world-tools{display:flex;gap:5px}.world-tools button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:44px;background:#eeece6;font-size:19px;padding:10px}.world-tools span{font-size:12px}.room-heading{display:none;min-width:0;align-items:center;gap:8px}.room-heading>button{padding:0;width:44px;flex-shrink:0;background:#eeece6;font-size:23px}.room-heading small{font-size:9px;letter-spacing:1px;color:var(--muted)}.room-heading h1{font-size:15px;line-height:1.2;letter-spacing:-.2px;margin:3px 0 0}.scene-labels{position:absolute;top:var(--header);bottom:var(--dock);left:0;right:0;pointer-events:none;z-index:2;overflow:hidden}.place-sign{position:absolute;top:0;left:0;pointer-events:auto;display:flex;align-items:center;gap:8px;max-width:170px;min-width:110px;text-align:left;padding:8px 10px;background:#fffef9;box-shadow:0 2px 0 #bfc7bc,0 5px 15px #33413412;border-left:4px solid var(--place-color)}.place-sign strong{font-size:12px;line-height:1.3}.place-sign small{font-size:10px;color:#72786f;display:block;margin-top:3px;font-weight:400}.sign-arrow{color:var(--place-color);font-size:18px}.world-bottom{position:absolute;bottom:0;left:0;right:0;height:var(--dock);padding:12px 16px calc(12px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:8px;background:#fbfaf5;border-top:1px solid #dfe3da;z-index:4}.world-bottom>button{background:#eeece6;padding:10px;min-width:44px}.world-bottom #hint{font-size:12px;color:#5a655e;margin-left:6px}.world-bottom #discovered{margin-left:auto;font-size:11px;color:#646c65;white-space:nowrap}#near{position:absolute;bottom:calc(var(--dock) + 12px);left:50%;transform:translateX(-50%);z-index:3;background:var(--purple);color:#fff;font-size:13px;max-width:80%;box-shadow:0 4px 20px #0002}.room-dock{display:none;position:absolute;bottom:0;left:0;right:0;height:var(--dock);padding:8px 14px calc(10px + env(safe-area-inset-bottom));background:#fbfaf5;border-top:1px solid #d4d7cf;z-index:4}.room-switch{display:grid;grid-template-columns:44px 1fr 44px;gap:5px;align-items:center}.room-switch>button:not(#room-picker){padding:0;font-size:22px;background:#eeece6}#room-picker{display:flex;flex-direction:column;align-items:center;padding:4px 6px;gap:3px;background:transparent;min-width:0}#room-count{font-size:9px;letter-spacing:1.1px;color:#7a7b75}#room-name{font-size:16px;line-height:1.3}#room-picker>span{font-size:10px;color:#797769;font-weight:400}.room-actions{display:flex;gap:8px;margin-top:8px}.room-actions .primary{flex:1;font-size:14px}.room-actions>button:first-child{background:#eeece6;font-size:13px}.in-room{--dock:152px}.in-room .room-heading{display:flex}.in-room .world-brand,.in-room .world-bottom,.in-room #near{display:none!important}.in-room .room-dock{display:block}.in-room .world-tools span,.in-room #help{display:none}.touch-pad{position:absolute;left:14px;bottom:calc(var(--dock) + 14px);z-index:3;display:grid;grid-template-columns:repeat(3,46px);gap:4px}.touch-pad button{padding:10px;background:#ffffffe0;touch-action:none;box-shadow:0 2px 10px #0001}.touch-pad button:first-child{grid-column:2}.touch-pad button:nth-child(2){grid-column:1}.scene-loading{position:absolute;inset:var(--header) 0 var(--dock);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;background:#e7ece5;z-index:7;pointer-events:none}.scene-loading strong{font-size:20px}.scene-loading p{font-size:13px;color:#657367}.spinner{width:32px;height:32px;border:3px solid #cfcedb;border-top-color:var(--purple);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
dialog{border:0;padding:0;color:var(--ink);background:#faf9f5;border-radius:22px;box-shadow:0 28px 100px #20233435}dialog::backdrop{background:#19232e65;backdrop-filter:blur(5px)}#editor{width:min(960px,95vw);height:min(800px,94dvh);max-width:none;max-height:none;overflow:hidden}.editor-layout{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 86px;height:100%}.avatar-stage{position:relative;grid-row:1/3;background:radial-gradient(ellipse at center,#f5f0fa,#ddd4e9);overflow:hidden}.avatar-stage h1{position:absolute;left:22px;top:22px;font-size:23px;z-index:3;pointer-events:none}.avatar-stage .close{display:none}#avatar-preview{position:absolute;inset:60px 0 55px;width:100%;height:calc(100% - 115px);touch-action:none;cursor:grab}.portrait-view{position:absolute;left:18px;bottom:14px;z-index:3;background:#fffc;font-size:12px}.preview-note{position:absolute;right:18px;bottom:28px;font-size:10px;color:#71677d}#avatar-status{position:absolute;left:22px;top:61px;font-size:11px;color:#71677d;max-width:75%;pointer-events:none}.editor-controls{padding:22px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.editor-controls label{display:block;font-size:14px;font-weight:600;color:#55545c;margin:14px 0}.name-label{margin:0 0 16px!important}.name-label input{width:100%;display:block;margin-top:8px;border:1px solid var(--line);border-radius:10px;padding:12px;background:#fffefa;font-size:16px;color:var(--ink)}.editor-tabs{display:flex;border-bottom:1px solid var(--line);margin-bottom:18px;position:sticky;top:-22px;z-index:2;background:#faf9f5}.editor-tabs button{flex:1;border-radius:0;background:none;font-size:14px;color:#76717d;border-bottom:3px solid transparent}.editor-tabs button[aria-selected=true]{color:var(--purple);border-bottom-color:var(--purple)}select{display:block;width:100%;border:1px solid var(--line);border-radius:9px;background:#fffdfa;padding:11px;margin-top:8px;color:#3e3c47;font-size:15px;min-height:44px}.custom-details{border-top:1px solid var(--line);padding:3px 0}.custom-details summary{cursor:pointer;font-size:14px;font-weight:650;padding:16px 0;min-height:48px}.custom-details[open] summary{padding-bottom:8px}#color-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:8px 0}.color-row{display:flex!important;flex-direction:column;gap:7px;align-items:flex-start;font-size:12px!important;margin:6px 0!important}.color-row input[type=color]{width:48px;height:40px;padding:3px;border:1px solid var(--line);border-radius:9px;background:white;cursor:pointer}.check-label{display:flex!important;gap:10px;align-items:center;min-height:44px}input[type=checkbox]{width:22px;height:22px}input[type=checkbox],input[type=range]{accent-color:var(--purple)}input[type=range]{width:100%;display:block;margin:10px 0 0;min-height:32px}#face-controls label{font-size:13px}.editor-text-actions{display:flex;flex-wrap:wrap;gap:16px}.editor-footer{padding:10px 24px 12px;border-top:1px solid var(--line);background:#faf9f5}.editor-footer .primary{width:100%;font-size:14px}.editor-footer>small{display:block;text-align:center;margin-top:6px;font-size:10px;color:#77727d}.photo-intro{font-size:14px;line-height:1.65;color:#5f5b68}.photo-buttons{display:flex;gap:8px;flex-wrap:wrap}.photo-buttons button{font-size:13px;background:#eeebf5;flex:1;min-width:130px}.privacy-note{font-size:12px;color:#726b7d;line-height:1.6;margin:16px 0 0}#photo-area{position:relative;margin:16px auto 0;width:170px}#photo-canvas,#camera-video{width:170px;height:198px;object-fit:cover;display:block;border-radius:12px}#take-photo{position:absolute;bottom:7px;left:8px;right:8px;font-size:12px}#photo-status{font-size:13px;line-height:1.6;color:#625390;margin:12px 0}#create-face{width:100%;font-size:14px}
#panel{position:relative;width:min(760px,94vw);max-height:90dvh;padding:28px;overflow:auto;overscroll-behavior:contain}#panel>.close{position:sticky;float:right;top:0;margin:0 0 -44px 10px}#panel-title{font-size:26px;line-height:1.25;padding-right:38px;margin:13px 0 18px}.panel-lead{font-size:15px;line-height:1.7;color:#66636c}.door-emblem{font-size:36px;border-radius:20px;width:72px;height:72px;display:grid;place-items:center;background:#eee9dd;margin-bottom:24px;color:var(--accent)}.door-list{display:grid;gap:8px;margin:20px 0}.pill{font-size:13px;padding:12px;border-radius:8px;background:#ebe8e0;color:#595661;line-height:1.4}.catalog-head{display:flex;gap:8px;margin:22px 0 18px}.catalog-head input{flex:1;min-width:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:white;font-size:16px}.catalog-head button{font-size:12px;background:#ece8f5}.catalog-list{display:grid;gap:9px}.catalog-item{display:grid;grid-template-columns:28px 1fr 20px;align-items:center;gap:10px;text-align:left;border:1px solid #e0ded6;background:#fffdfa;padding:16px 12px;border-radius:14px}.catalog-item .number{font-size:18px;color:var(--accent)}.catalog-item h3{font-size:14px;line-height:1.5;margin:0 0 6px;font-weight:600}.catalog-item p{font-size:12px;line-height:1.5;margin:0;color:#787380}.catalog-item .saved{color:var(--purple)}.catalog-empty{padding:24px;text-align:center;color:#756f7c;font-size:14px}.help-grid{display:grid;gap:12px;font-size:15px;line-height:1.7}.help-grid kbd{background:#eae6f4;padding:3px 7px;border-radius:5px;font-size:12px}#toast{position:fixed;bottom:calc(var(--dock) + 10px);left:50%;transform:translateX(-50%) translateY(10px);background:#29293a;color:white;z-index:20;padding:13px 18px;border-radius:12px;width:max-content;max-width:90vw;opacity:0;pointer-events:none;font-size:13px;line-height:1.5;transition:.2s}#toast.visible{opacity:1;transform:translateX(-50%) translateY(0)}
#panel.reading{padding:0;width:min(800px,95vw);background:#faf8f2}.reading>.close{top:12px!important;margin:12px 12px -56px 0!important}.story-hero{padding:38px 32px 28px;background:#e9e7df;position:relative;overflow:hidden;border-bottom:4px solid var(--course-accent)}.story-hero>.eyebrow{display:block;color:var(--course-accent);margin:2px 40px 20px 0;line-height:1.6}.story-hero #panel-title{font-size:30px;line-height:1.24;position:relative;padding-right:0}.story-hero>p{font-size:16px;line-height:1.75;position:relative;margin-bottom:0}.story-motif{position:absolute;right:-8px;top:-48px;font-size:230px;color:var(--course-accent);opacity:.07;transform:rotate(-12deg)}.story-meta{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0}.story-meta span{font-size:11px;padding:8px 10px;background:#fff9;border-radius:30px}.story-body{padding:24px 32px 100px}.story-body section{margin-bottom:28px}.audience-block{padding:0 0 24px;border-bottom:1px solid var(--line)}.story-body h3{font-size:21px;margin-bottom:12px}.story-body p{font-size:15px;line-height:1.75;color:#625f68;margin-bottom:0}.section-heading{margin:24px 0 18px}.section-heading small{font-size:12px;color:var(--muted)}.story-chapters{display:grid;gap:10px}.story-chapters details{border:1px solid #d8d5cc;border-radius:13px;background:#fffdf8;overflow:hidden}.story-chapters summary{list-style:none;display:flex;align-items:center;gap:12px;cursor:pointer;padding:18px 16px;font-size:15px;line-height:1.4;font-weight:600;min-height:56px}.story-chapters summary::-webkit-details-marker{display:none}.story-chapters summary>span{font-size:11px;color:var(--course-accent)}.story-chapters summary b{font-size:24px;margin-left:auto;font-weight:400;color:var(--course-accent)}.story-chapters details[open] summary b{transform:rotate(45deg)}.story-chapters details p{padding:0 18px 20px}.course-footer{font-size:12px;color:#78717b;line-height:1.6}.course-footer a{color:inherit}.enroll-fixed{position:sticky;bottom:0;padding:10px 20px calc(10px + env(safe-area-inset-bottom));background:#faf8f2f5;border-top:1px solid var(--line);display:flex;gap:8px;z-index:4}.enroll-fixed a{flex:1;font-size:14px;background:var(--course-accent)}.enroll-fixed button{width:48px;padding:0;font-size:23px;background:#eae5ef}.room-list{display:grid;gap:9px}.room-list button{text-align:left;display:flex;align-items:center;gap:14px;border:1px solid var(--line);padding:14px;background:#fffefa}.room-list span{font-size:13px;color:var(--purple)}.room-list strong{font-size:14px;line-height:1.4}.room-list small{display:block;font-size:12px;color:var(--muted);line-height:1.4;margin-top:5px;font-weight:400}.room-list [aria-current=true]{border-color:var(--purple);background:#efecfc}
@media(max-width:760px){:root{--header:68px;--dock:calc(76px + env(safe-area-inset-bottom))}.in-room{--dock:calc(152px + env(safe-area-inset-bottom))}.game-header{padding:8px 12px}.world-tools span{display:none}.world-tools{gap:5px}.world-bottom{padding:12px 12px calc(12px + env(safe-area-inset-bottom));gap:6px}.world-bottom #hint{display:none}.world-bottom #discovered{font-size:10px}.world-bottom #move-toggle{font-size:12px}.place-sign{max-width:150px;min-width:100px}.place-sign strong{font-size:11px}.place-sign small{font-size:10px}#editor{width:100vw;height:100dvh;border-radius:0;margin:0}.editor-layout{grid-template-columns:1fr;grid-template-rows:clamp(200px,32dvh,280px) 1fr calc(86px + env(safe-area-inset-bottom))}.avatar-stage{grid-row:auto;min-height:0}.avatar-stage h1{font-size:18px;left:18px;top:18px}.avatar-stage .close{display:block}#avatar-preview{inset:22px 0 24px;height:calc(100% - 46px)}#avatar-status{top:45px;left:18px;font-size:10px;max-width:40%}.portrait-view{bottom:10px;left:12px;min-height:40px;font-size:11px;padding:10px;background:#fff9}.preview-note{bottom:22px;right:12px;font-size:9px}.editor-controls{padding:18px 20px}.editor-tabs{top:-18px}.editor-footer{padding:10px 20px calc(10px + env(safe-area-inset-bottom))}.name-label input{font-size:16px}#panel,#panel.reading{width:100vw;max-width:none;max-height:100dvh;height:100dvh;margin:0;border-radius:0}#panel{padding:22px 20px}#panel-title{font-size:24px}.story-hero{padding:30px 22px 26px}.story-hero #panel-title{font-size:25px}.story-body{padding:24px 22px 40px}.reading>.close{right:10px}.story-meta{gap:6px}.story-meta span{font-size:10px}.story-body h3{font-size:20px}.catalog-item h3{font-size:14px}.catalog-head{flex-wrap:wrap}.catalog-head input{flex-basis:65%}.catalog-head button{flex:1}.room-heading h1{font-size:14px}}
@media(min-width:761px){.in-room #city,.in-room .scene-labels{left:calc(50% - 360px);width:720px}.room-dock{padding-left:max(20px,calc(50% - 340px));padding-right:max(20px,calc(50% - 340px))}.room-actions{max-width:680px}.avatar-stage .close:not([hidden]){display:block;right:12px}.world-bottom #move-toggle{font-size:13px}}
@media(prefers-reduced-motion:reduce){*{animation-duration:0s!important;transition:none!important}}

/* Course titles stay complete; the scene adapts to the actual dock height. */
.room-dock{height:auto;min-height:152px}#room-count{font-size:11px}#room-name{font-size:14px;line-height:1.4;overflow-wrap:anywhere;hyphens:none}#room-picker{gap:5px;padding:5px 2px}#room-picker>span{font-size:11px}.portrait-view{min-height:44px}.scene-camera{position:absolute;right:12px;top:calc(var(--header) + 12px);z-index:3;display:flex;gap:6px}.scene-camera button{font-size:12px;box-shadow:0 2px 10px #0001;background:#fffef7e8}.inspecting .scene-labels{visibility:hidden}.room-list strong{font-size:14px}

.scene-camera{left:12px;right:auto;gap:5px}.scene-camera button{padding:10px 12px;font-size:11px}.scene-zoom{position:absolute;right:12px;bottom:calc(var(--dock) + 14px);z-index:3;display:grid;gap:6px}.scene-zoom button{width:44px;height:44px;padding:0;font-size:24px;background:#fffef9e8;box-shadow:0 2px 10px #0001}.in-room #help{display:flex}.inspecting .scene-zoom{visibility:hidden}

@media(min-width:761px){.in-room .scene-camera{left:calc(50% - 348px)}.in-room .scene-zoom{right:calc(50% - 348px)}}

/* Camera and optional walking controls occupy their own rows, outside the playfield. */
:root{--camera:56px;--walk:0px;--header:calc(68px + env(safe-area-inset-top,0px))}
.game-header{padding:calc(8px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 8px max(12px,env(safe-area-inset-left,0px))}
.camera-toolbar{position:absolute;top:var(--header);height:var(--camera);left:0;right:0;padding:6px max(10px,env(safe-area-inset-right,0px)) 6px max(10px,env(safe-area-inset-left,0px));display:flex;align-items:center;justify-content:space-between;gap:6px;z-index:4;background:#f4f2eb;border-bottom:1px solid #dfe3da}
.camera-toolbar .scene-camera,.camera-toolbar .scene-zoom{position:static;display:flex;gap:4px;flex-shrink:0}
.camera-toolbar .scene-camera button{font-size:11px;padding:9px 10px;box-shadow:none;min-height:44px}
.camera-toolbar .scene-zoom button{width:44px;height:44px;box-shadow:none;font-size:23px}
#city,.scene-labels{top:calc(var(--header) + var(--camera));bottom:calc(var(--dock) + var(--walk));height:calc(100% - var(--header) - var(--camera) - var(--dock) - var(--walk))}
#city,.touch-pad,.camera-toolbar{-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
.world-bottom,.room-dock{bottom:var(--walk)}
.world-bottom{height:auto;min-height:76px;display:grid;grid-template-columns:44px 44px auto 1fr;gap:6px}
.world-bottom #hint{grid-column:1/-1;grid-row:3;margin:0}
#near{position:static;transform:none;max-width:none;width:100%;grid-column:1/-1;order:-1;box-shadow:none;margin:0}
.walking{--walk:calc(58px + env(safe-area-inset-bottom,0px))}
.walking .world-bottom,.walking .room-dock{padding-bottom:10px}
.touch-pad{left:0;right:0;bottom:0;height:var(--walk);padding:6px 12px calc(8px + env(safe-area-inset-bottom,0px));grid-template-columns:repeat(4,52px);justify-content:center;gap:8px;background:#f4f2eb;border-top:1px solid #deddd5;z-index:4}
.touch-pad button:first-child,.touch-pad button:nth-child(2){grid-column:auto}
.touch-pad button{box-shadow:none;min-height:44px;height:44px;background:#fffdf7}
.touch-pad button[data-move=left]{order:0}.touch-pad button[data-move=up]{order:1}.touch-pad button[data-move=down]{order:2}.touch-pad button[data-move=right]{order:3}
@media(min-width:761px){.in-room .camera-toolbar{left:calc(50% - 360px);right:auto;width:720px}.in-room .touch-pad{left:calc(50% - 360px);right:auto;width:720px}}
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){
 :root{--header:calc(52px + env(safe-area-inset-top,0px));--camera:52px;--aside:calc(clamp(224px,30vw,280px) + env(safe-area-inset-right,0px))}
 .game-header{padding-top:calc(4px + env(safe-area-inset-top,0px));padding-bottom:4px}.world-brand img{height:36px;width:auto}
 #city,.scene-labels,.in-room #city,.in-room .scene-labels{left:env(safe-area-inset-left,0px);width:calc(100% - var(--aside) - env(safe-area-inset-left,0px));bottom:var(--walk);height:calc(100% - var(--header) - var(--camera) - var(--walk))}
 .camera-toolbar,.in-room .camera-toolbar{left:env(safe-area-inset-left,0px);right:var(--aside);width:auto;padding:4px 8px}
 .room-dock,.world-bottom{left:auto;right:0;top:var(--header);bottom:0;width:var(--aside);height:auto;min-height:0;padding:10px max(10px,env(safe-area-inset-right,0px)) max(10px,env(safe-area-inset-bottom,0px)) 10px;border-top:0;border-left:1px solid #d4d7cf;overflow-y:auto}
 .room-dock{display:none}.in-room .room-dock{display:flex;flex-direction:column;justify-content:space-between;gap:8px}.room-switch{grid-template-columns:44px 1fr 44px}.room-actions{flex-wrap:wrap;margin-top:0}.room-actions>button{width:100%}.room-actions .primary{flex-basis:100%}#room-name{font-size:12px;line-height:1.35}.room-switch>button:not(#room-picker){align-self:start;margin-top:15px}
 .world-bottom{grid-template-columns:1fr 1fr;align-content:start}.world-bottom #move-toggle,.world-bottom #discovered{grid-column:1/-1;margin:0;text-align:center}.world-bottom #hint{display:none}
 .touch-pad,.in-room .touch-pad{left:env(safe-area-inset-left,0px);right:var(--aside);width:auto}.walking .room-dock{padding-bottom:max(10px,env(safe-area-inset-bottom,0px))}
}

/* First-run orientation stays compact enough for a phone editor. */
.start-guide{margin:-4px 0 18px;padding:13px;border:1px solid #d7d1f2;border-radius:14px;background:linear-gradient(135deg,#f2efff,#fbfaf5);color:#45415b}.start-guide strong{display:block;font-size:13px;color:#453eb5;margin-bottom:6px}.start-guide p{margin:0 0 10px;font-size:12px;line-height:1.48}.start-guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.start-guide-grid span{display:flex;align-items:center;gap:6px;min-width:0;padding:7px 8px;border-radius:9px;background:#fffdf9;font-size:11px;line-height:1.2}.start-guide-grid b{display:grid;flex:none;place-items:center;min-width:18px;height:18px;border-radius:6px;background:#e6e1ff;color:#4941b9;font-size:12px}.skip-photo{display:inline-flex;align-items:center;min-height:44px;margin-top:8px;padding:10px 0;color:#4b44b9;text-decoration:underline;text-underline-offset:3px}

@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){.room-switch{grid-template-columns:44px 1fr 44px;row-gap:4px}#room-picker{grid-column:1/-1;grid-row:1}#room-prev{grid-column:1;grid-row:2}#room-next{grid-column:3;grid-row:2}.room-switch>button:not(#room-picker){margin-top:0}#room-name{font-size:13px}#room-picker>span{display:none}}

button[aria-pressed=true]{box-shadow:inset 0 0 0 2px #7770d8}
@media(orientation:portrait) and (max-height:700px) and (max-width:760px){:root{--header:calc(60px + env(safe-area-inset-top,0px));--camera:52px}.camera-toolbar{padding-top:4px;padding-bottom:4px}.room-dock{min-height:0;padding:6px 10px calc(8px + env(safe-area-inset-bottom,0px))}#room-name{font-size:12px;line-height:1.35;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}#room-count{font-size:10px}#room-picker{padding:3px 2px;gap:3px}#room-picker>span{display:none}.room-actions{margin-top:6px}.room-actions .primary{min-height:44px;padding:10px 12px}}
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){.room-actions{flex-wrap:nowrap}.room-actions>button{width:auto;padding:10px}.room-actions .primary{flex:1;font-size:13px}.room-actions>button:first-child{font-size:12px}}

/* Dynamic course names never widen a card or escape its visual container. */
.catalog-item>div,.room-list button,.room-list strong,.room-heading>div,#room-picker,.place-sign{min-width:0}
.catalog-item h3,.catalog-item p,.pill,.room-list strong,.place-sign strong,.room-heading h1,#room-name,#panel-title,.story-hero #panel-title,.story-chapters summary{overflow-wrap:anywhere;hyphens:none}

/* The room CTA must read as the next action, not as a disabled utility button. */
.room-actions #room-read{background:linear-gradient(135deg,#6259dd 0%,#4a42c1 100%);color:#fff;border:1px solid #4a42c1;box-shadow:0 5px 14px #4a42c142;text-shadow:0 1px 0 #29216c33}.room-actions #room-read:hover{background:linear-gradient(135deg,#554bd1 0%,#4038ad 100%);box-shadow:0 7px 18px #4a42c152}.room-actions #room-read:focus-visible{outline-color:#4a42c1}.room-actions #room-read:disabled{background:#e5e1ee;color:#625d70;border-color:#e5e1ee;box-shadow:none;text-shadow:none}

/* New players meet the city before entering the avatar editor. */
#welcome{width:min(460px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);overflow:auto;border-radius:24px;background:#fbfaf6}#welcome::backdrop{background:#25254275;backdrop-filter:blur(7px)}.welcome-card{padding:26px 28px 24px;background:radial-gradient(circle at 94% 4%,#e3defa 0 18%,transparent 40%),linear-gradient(155deg,#fbfaf6 0%,#f4f0fb 100%)}.welcome-city{position:relative;height:94px;margin:0 0 24px;overflow:hidden;border-radius:17px;background:linear-gradient(135deg,#e8e1fb,#d6edf0)}.welcome-city::after{content:'';position:absolute;left:-8%;right:-8%;bottom:16px;height:4px;border-radius:999px;background:#fdfbf5;transform:rotate(-4deg);box-shadow:0 12px 0 #fffaf3}.welcome-city span{position:absolute;bottom:0;display:block;width:58px;border:4px solid #fdfbf5;border-bottom:0;border-radius:13px 13px 0 0;background:linear-gradient(180deg,#6b63dc,#4e48c5);box-shadow:0 6px 0 #433cad22}.welcome-city span:nth-child(1){left:16%;height:56px}.welcome-city span:nth-child(2){left:40%;height:76px;background:linear-gradient(180deg,#55a6a9,#328386)}.welcome-city span:nth-child(3){left:65%;height:45px;background:linear-gradient(180deg,#d58c70,#bc654d)}.welcome-city i{position:absolute;right:13%;top:13px;width:18px;height:18px;border-radius:50%;background:#ffe39a;box-shadow:0 0 0 7px #fff9}.welcome-card .eyebrow{margin:0 0 8px;color:#5650bd}.welcome-card h1{margin:0 0 13px;font-size:clamp(28px,6vw,36px);line-height:1.08;color:#29283a}.welcome-lead{margin:0;color:#5e5c6a;font-size:15px;line-height:1.62}.welcome-steps{display:grid;gap:8px;margin:21px 0;padding:0;list-style:none;counter-reset:welcome-step}.welcome-steps li{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:650;color:#4b4959}.welcome-steps li::before{counter-increment:welcome-step;content:counter(welcome-step);display:grid;place-items:center;width:24px;height:24px;flex:none;border-radius:50%;background:#e2ddfa;color:#4d46bd;font-size:11px;font-weight:800}.welcome-card #welcome-start{width:100%;min-height:54px;font-size:16px;box-shadow:0 7px 18px #403bb13b}.welcome-card>small{display:block;margin-top:9px;color:#77727d;text-align:center;font-size:11px;line-height:1.45}
.start-guide{margin:24px 0 8px}
@media(max-width:760px){#welcome{width:calc(100vw - 28px);max-height:calc(100dvh - 28px);border-radius:21px}.welcome-card{padding:20px 20px calc(20px + env(safe-area-inset-bottom,0px))}.welcome-city{height:78px;margin-bottom:18px}.welcome-city span{width:50px;border-width:3px}.welcome-city span:nth-child(1){height:46px}.welcome-city span:nth-child(2){height:64px}.welcome-city span:nth-child(3){height:39px}.welcome-card h1{font-size:29px}.welcome-lead{font-size:14px}.welcome-steps{margin:18px 0}.welcome-steps li{font-size:12px}}

/* Exploration HUD: the world stays primary, controls stay at its edges. */
:root{--camera:0px}
#city,.scene-labels{top:var(--header);bottom:var(--dock);height:calc(100% - var(--header) - var(--dock))}
.camera-toolbar{top:var(--header);height:0;padding:0;background:transparent;border:0;pointer-events:none}
.camera-toolbar .scene-camera,.camera-toolbar .scene-zoom{position:absolute;top:10px;display:flex;gap:6px;pointer-events:auto}
.camera-toolbar .scene-camera{left:max(10px,env(safe-area-inset-left,0px))}.camera-toolbar .scene-zoom{right:max(10px,env(safe-area-inset-right,0px))}
.camera-toolbar .scene-camera button,.camera-toolbar .scene-zoom button{min-width:42px;width:42px;height:42px;padding:0;border-radius:14px;background:#fffef9e6;box-shadow:0 3px 12px #2831211c;font-size:19px;backdrop-filter:blur(8px)}
.camera-toolbar #scene-board{width:auto;min-width:92px;padding:0 13px;font-size:12px;font-weight:700}.in-room #scene-hero,.in-room #scene-overview{display:none!important}
.world-bottom{height:calc(58px + env(safe-area-inset-bottom,0px));min-height:0;display:flex;align-items:center;gap:7px;padding:7px max(12px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));background:linear-gradient(0deg,#f5f3edec 35%,#f5f3ed00);border:0;pointer-events:none}
.world-bottom>button,.world-bottom>span{pointer-events:auto}.world-bottom>button{width:42px;height:42px;min-height:42px;padding:0;border-radius:14px;background:#fffef9e8;box-shadow:0 3px 12px #28312116}.world-bottom #hint{display:none}.world-bottom #discovered{margin-left:auto;padding:7px 9px;border-radius:12px;background:#fffef9d9;font-size:10px;color:#656a65;white-space:nowrap;box-shadow:0 2px 10px #28312112}
#near{position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);width:auto;max-width:min(86vw,370px);padding:11px 18px;min-height:44px;border-radius:14px;box-shadow:0 8px 24px #2e337430;font-size:13px;white-space:nowrap}
#move-joystick{display:none;position:absolute;left:max(14px,env(safe-area-inset-left,0px));bottom:calc(var(--dock) + 14px);z-index:5;width:68px;height:68px;touch-action:none;-webkit-touch-callout:none;user-select:none}
#move-stick{width:68px;height:68px;min-height:0;padding:0;border-radius:50%;border:1px solid #ffffff99;background:#f8f7f0b8;box-shadow:0 4px 18px #2b34201f;backdrop-filter:blur(8px);touch-action:none}.move-stick-active,#move-stick:active{background:#eeebfb}
#move-stick>span{display:block;width:27px;height:27px;margin:auto;border-radius:50%;background:#5750cc;box-shadow:0 2px 7px #3934a650;transform:translate(0,0);transition:transform .08s ease-out}
#stand-nav{position:absolute;z-index:7;left:50%;top:calc(var(--header) + 10px);transform:translateX(-50%);display:flex;align-items:center;gap:4px;max-width:calc(100vw - 24px);padding:4px;border:1px solid #ffffffa6;border-radius:15px;background:#fffef9eb;box-shadow:0 4px 18px #29342620;backdrop-filter:blur(9px)}
#stand-nav button{width:36px;height:36px;min-height:36px;padding:0;border-radius:11px;background:transparent;font-size:19px}#stand-title{min-width:0;max-width:min(43vw,260px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 5px;font-size:11px;font-weight:700;color:#4e5058}
.place-sign{min-width:0;max-width:132px;padding:7px 8px;border-left-width:3px;border-radius:11px;background:#fffef9e6;box-shadow:0 2px 8px #2c382016;backdrop-filter:blur(6px)}.place-sign strong{font-size:11px;line-height:1.2}.place-sign small{display:none}.place-sign .sign-arrow{font-size:15px}
.photo-transfer{width:100%;min-height:54px;margin:14px 0 4px;font-size:15px;box-shadow:0 7px 18px #403bb13b}.editor-footer .awaiting-photo{opacity:1!important;background:#e5e1ee!important;color:#625d70!important;box-shadow:none!important}
@media(max-width:760px){#move-joystick{display:block}.in-room .camera-toolbar .scene-zoom{right:max(10px,env(safe-area-inset-right,0px))}.in-room #city,.in-room .scene-labels{top:var(--header);height:calc(100% - var(--header) - var(--dock))}}
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){:root{--camera:0px}.camera-toolbar,.in-room .camera-toolbar{left:0;right:var(--aside);width:auto}.camera-toolbar .scene-camera{left:10px}.camera-toolbar .scene-zoom{right:10px}.in-room #city,.in-room .scene-labels{left:0;width:calc(100% - var(--aside));top:var(--header);bottom:0;height:calc(100% - var(--header))}.in-room #move-joystick{left:12px;bottom:14px}.in-room #stand-nav{left:calc((100% - var(--aside))/2)}.world-bottom{background:#fbfaf5}.world-bottom #near{bottom:10px}}

/* Camera controls are controls, not disabled-looking decoration. */
.camera-toolbar .scene-camera button,.camera-toolbar .scene-zoom button,.world-bottom>button{color:#282d38;background:#fffdf9;border:1px solid #d8d8d0;opacity:1;box-shadow:0 3px 12px #28312124}
#scene-hero{color:#423bb0!important;border-color:#bdb7ee!important;background:#f8f7ff!important}
.camera-toolbar button[aria-pressed=true]{color:#fff!important;background:#514acb!important;border-color:#514acb!important;box-shadow:0 4px 14px #403bb145!important}
.camera-toolbar button:active,.world-bottom>button:active{background:#ebe8fb}

/* A phone in landscape keeps the world full-width; HUD stays in compact edge strips. */
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){
 :root{--header:calc(52px + env(safe-area-inset-top,0px));--dock:calc(54px + env(safe-area-inset-bottom,0px));--camera:0px}
 .in-room{--dock:calc(98px + env(safe-area-inset-bottom,0px))}
 #world{min-height:100svh}
 .game-header{height:var(--header);padding:4px max(10px,env(safe-area-inset-right,0px)) 4px max(10px,env(safe-area-inset-left,0px))}
 .world-brand img{width:auto;height:34px}.world-tools{gap:4px}.world-tools button{width:40px;min-width:40px;height:40px;min-height:40px;padding:0;border-radius:12px}
 #city,.scene-labels,.in-room #city,.in-room .scene-labels{left:0!important;right:0!important;width:100%!important;top:var(--header)!important;bottom:var(--dock)!important;height:calc(100% - var(--header) - var(--dock))!important}
 .camera-toolbar,.in-room .camera-toolbar{left:0!important;right:0!important;width:auto!important;top:var(--header)!important;height:0!important;padding:0!important;background:transparent!important;border:0!important}
 .camera-toolbar .scene-camera{left:max(10px,env(safe-area-inset-left,0px))!important}.camera-toolbar .scene-zoom{right:max(10px,env(safe-area-inset-right,0px))!important}
 .world-bottom{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:auto!important;height:var(--dock)!important;min-height:0!important;padding:5px max(10px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))!important;display:flex!important;align-items:center!important;overflow:visible!important;border:0!important;background:linear-gradient(0deg,#f5f3edf2 55%,#f5f3ed00)!important}
 .world-bottom #discovered{grid-column:auto!important;margin-left:auto!important;text-align:left!important}.world-bottom #near{left:50%!important;right:auto!important;bottom:calc(100% + 6px)!important;width:auto!important;max-width:70vw!important}
 .room-dock{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:auto!important;height:var(--dock)!important;min-height:0!important;padding:4px max(10px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))!important;overflow:visible!important;border-top:1px solid #d4d7cf!important;border-left:0!important;background:#fbfaf5f2!important}
 .in-room .room-dock{display:block!important}.room-switch{grid-template-columns:38px minmax(0,1fr) 38px!important;gap:6px!important}.room-switch>button:not(#room-picker){width:38px;height:38px;min-height:38px;padding:0!important;align-self:center!important;margin:0!important}
 #room-picker{grid-column:auto!important;grid-row:auto!important;padding:1px 4px!important;gap:1px!important}#room-count{font-size:9px!important}#room-name{font-size:12px!important;line-height:1.18!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#room-picker>span{display:none!important}
 .room-actions{display:flex!important;margin-top:4px!important;gap:0!important}.room-actions .primary{min-height:38px!important;padding:8px 12px!important;font-size:12px!important}
 #move-joystick,.in-room #move-joystick{left:max(12px,env(safe-area-inset-left,0px))!important;bottom:calc(var(--dock) + 10px)!important;width:62px;height:62px}#move-stick{width:62px;height:62px}#move-stick>span{width:24px;height:24px}
 .in-room #stand-nav{left:50%!important;top:calc(var(--header) + 7px)!important;max-width:calc(100vw - 150px)}
 .world-tools span{display:none!important}
}

/* Landscape rooms use one safe-area row, never a two-row dock cut by the viewport. */
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){
 .in-room{--dock:calc(52px + env(safe-area-inset-bottom,0px))}
 .in-room .room-dock{display:grid!important;grid-template-columns:38px minmax(0,1fr) 38px auto;align-items:center;column-gap:6px;height:var(--dock)!important;min-height:0!important;padding:5px max(10px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))!important}
 .in-room .room-switch,.in-room .room-actions{display:contents!important}
 .in-room #room-prev{grid-column:1;grid-row:1}.in-room #room-picker{grid-column:2;grid-row:1;display:block!important;min-width:0;padding:0 3px!important;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .in-room #room-count{display:inline;font-size:9px!important;letter-spacing:.8px;margin-right:6px}.in-room #room-name{display:inline!important;font-size:12px!important;line-height:38px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.in-room #room-picker>span{display:none!important}
 .in-room #room-next{grid-column:3;grid-row:1}.in-room #room-read{grid-column:4;grid-row:1;min-height:38px!important;padding:8px 11px!important;font-size:12px!important;white-space:nowrap;flex:none!important;background:#514acb!important;color:#fff!important;border-color:#514acb!important;box-shadow:0 3px 10px #403bb138!important}.in-room #room-read:disabled{background:#e5e1ee!important;color:#625d70!important;border-color:#e5e1ee!important;box-shadow:none!important}
 .in-room #move-joystick{bottom:calc(var(--dock) + 8px)!important}
}
