/* V1.09: entry paths are actions; help and save maintenance stay folded. */
#start.panel{width:min(760px,calc(100% - 32px))!important;max-height:92dvh;overflow:auto;padding:30px!important;box-sizing:border-box;text-align:left;border:1px solid #647b7b;background:#111f29f5!important}
#start .kicker{color:#c8b58a;font:12px system-ui;letter-spacing:.12em}#start h1{font:600 clamp(30px,5vw,48px)/1.1 Georgia!important;margin:12px 0!important;color:#f5e8c9}#start>p{font:16px/1.5 system-ui;color:#b7cbcf}
#modeSelect,#modeSelect[hidden]{display:none!important}.entry-choices{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:26px 0}.entry-choices section{padding:18px;border:1px solid #69817b66;background:#1b3037;border-radius:10px}.entry-choices h2{font:600 21px/1.2 Georgia;margin:0 0 12px;color:#f5e8ca}.entry-choices p{font:14px/1.45 system-ui;color:#bdcecf;min-height:62px}
#start .entry-choices button{display:block;width:100%;min-height:48px;box-sizing:border-box;padding:12px;margin:10px 0 0!important;border:1px solid #8aaa9d;border-radius:6px;background:#3a655d;color:#fff3d7;font:600 15px system-ui;text-align:center;box-shadow:none}#start button[hidden]{display:none!important}#start .entry-options{font:13px/1.6 system-ui;color:#bbcece;border-top:1px solid #67817c66;padding-top:12px}#start summary{cursor:pointer;padding:10px 0;min-height:24px}.entry-options .keys{font-size:12px}.entry-options>button{min-height:44px}#start #millStartBtn{background:#243d49}
body.journey-school #hud .top.left{position:fixed!important;top:auto!important;left:20px!important;bottom:20px!important;right:auto;width:190px!important;padding:10px;background:#10212bdc;border:1px solid #6f8d8966;border-radius:8px;z-index:24}
body.journey-school #hud .top.left .name{display:none}body.journey-school #hud .top.left .meta{font-size:12px}body.journey-school #hud .top.left .bar{height:7px;margin:6px 0}
body.journey-active .objective,body.journey-active #tutorial,body.journey-active #verticalSliceHud,body.journey-active #vsTarget,body.journey-active #crosshair,body.journey-active #perunoffCasebook,body.journey-active #academyCasebook,body.journey-active #perunoffReputation,body.journey-active #hiddenPages,body.journey-active .collection-hud,body.journey-active #directorCard,body.journey-active #spellHelp,body.journey-active .actionbar{display:none!important}
body.journey-active #toast{top:auto!important;bottom:var(--journey-toast-bottom,154px)!important;left:50%!important;right:auto!important;transform:translateX(-50%);max-width:min(440px,calc(100% - 24px));box-sizing:border-box;z-index:26;font:13px/1.4 system-ui;padding:10px 15px}
#journeyHUD[hidden],#journeyDialogue[hidden],#journeyJournal[hidden],#journeyHUD [hidden],.resident-label[hidden]{display:none!important}
#journeyHUD{position:fixed;inset:0;z-index:23;pointer-events:none;color:#f4ebd4;font:14px system-ui}#journeyHUD button,#journeyDialogue button,#journeyJournal button{min-width:44px;min-height:44px;border:1px solid #88a69a;background:#17343df2;color:#f8ecd1;border-radius:7px;padding:10px 14px;font:14px system-ui;cursor:pointer;pointer-events:auto;touch-action:none}
.journey-goal{position:absolute;left:22px;top:20px;max-width:min(520px,calc(100% - 210px));border-left:2px solid #d0ad69;padding:8px 14px;background:linear-gradient(90deg,#132330e8,#13233055)}.journey-goal small{font:10px system-ui;letter-spacing:.14em;color:#c1b18c}.journey-goal p{font:18px/1.3 Georgia;margin:7px 0 0}.journey-tools{position:absolute;right:20px;top:20px;display:flex;gap:8px;pointer-events:auto}
#journeyCameraHelp{position:absolute;right:20px;bottom:22px;max-width:210px;font:11px/1.5 system-ui;color:#bfd1d0;background:#10232bc7;padding:9px;border-radius:6px}
.journey-actions{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);display:flex;gap:7px}.journey-dpad{display:none;position:absolute;left:12px;bottom:110px;grid-template-columns:repeat(3,44px);gap:3px}.journey-dpad button{width:44px;height:44px;padding:0!important;font-size:21px!important}.journey-dpad button:first-child{grid-column:2}.journey-dpad button:nth-child(2){grid-column:1}
#journeyInteract{position:absolute;bottom:88px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);font-weight:600!important;background:#315c50f2!important}
.resident-label{position:absolute;transform:translate(-50%,-100%);padding:5px 10px;max-width:260px;border-radius:4px;background:#0c1b23cc;color:#e4eadf;font:700 20px/1.3 system-ui;text-shadow:0 1px 2px #000;text-align:center}.resident-label.near{border:1px solid #e2bc78;color:#ffebbc}
#journeyDialogue,#journeyJournal{position:fixed;z-index:72;box-sizing:border-box;padding:20px;border:1px solid #a4b7a3;background:#132b35fa;color:#ede6d6;border-radius:10px;font:15px/1.55 system-ui;box-shadow:0 10px 40px #0006}#journeyDialogue{left:50%;bottom:105px;transform:translateX(-50%);width:min(560px,calc(100% - 28px));max-height:46dvh;overflow:auto}#journeyDialogue b{font:600 18px Georgia;color:#e5c38b}#journeyDialogue p{margin:12px 0}#journeyJournal{right:20px;top:80px;width:min(400px,calc(100% - 28px));max-height:calc(100dvh - 170px);overflow:auto}#journeyJournal h2{font:24px Georgia;margin:0 0 16px}
body.in-mill #journeyHUD .journey-goal,body.in-mill #journeyCameraHelp,body.in-mill .journey-actions,body.in-mill .journey-dpad{display:none}body.in-mill .journey-tools{top:125px}body.journey-active:has(#pause:not(.hidden)) #journeyHUD{visibility:hidden}
@media(max-width:740px){#start.panel{padding:20px!important}.entry-choices{grid-template-columns:1fr;margin:18px 0}.entry-choices section{padding:14px}.entry-choices h2{font-size:19px}.entry-choices p{min-height:0;margin:8px 0}.journey-goal{left:10px;top:10px;max-width:calc(100% - 150px);padding:7px 10px}.journey-goal small{font-size:8px}.journey-goal p{font-size:16px}.journey-tools{right:10px;top:10px;gap:5px}.journey-tools button{font-size:12px!important;padding:8px!important}#journeyCameraHelp{display:none}body.journey-school #hud .top.left{left:10px!important;bottom:12px!important;width:108px!important;padding:7px}.journey-actions{left:auto;right:10px;transform:none;bottom:12px;max-width:calc(100% - 146px);gap:4px;flex-wrap:wrap;justify-content:flex-end}.journey-actions button{font-size:12px!important;padding:8px!important}.journey-dpad{display:grid}#journeyInteract{bottom:90px;font-size:13px!important;max-width:calc(100% - 174px);left:auto;right:10px;transform:none}#journeyDialogue{bottom:215px;max-height:45dvh;font-size:14px;padding:15px}.resident-label{font-size:13px;max-width:170px}body.in-mill .journey-tools{top:208px}}
@media(pointer:coarse){.journey-dpad{display:grid}#journeyCameraHelp{display:none}}
@media(max-height:500px){.journey-goal{top:10px;padding:6px 10px}.journey-goal p{font-size:16px}.journey-tools{top:10px}.journey-dpad{left:auto;right:12px;bottom:72px}.journey-actions{bottom:12px;left:50%;transform:translateX(-50%);right:auto;max-width:60%}#journeyInteract{bottom:78px;left:50%;transform:translateX(-50%);right:auto;max-width:50%}#journeyDialogue{top:70px;bottom:auto;max-height:calc(100dvh - 145px);width:min(500px,calc(100% - 230px));padding:12px}body.journey-school #hud .top.left{bottom:12px!important;left:12px!important;width:130px!important}#journeyCameraHelp{display:none}body.in-mill .journey-tools{top:202px}}

/* Keep a touch orbit in the canvas instead of handing it to browser panning. */
body.journey-active #gl{touch-action:none}

body.journey-active:not(:has(#pause:not(.hidden))):not(:has(#journeyDialogue:not([hidden]))):not(:has(#journeyJournal:not([hidden]))) #gl{cursor:none!important}
#journeyWaypoint{position:fixed;z-index:18;transform:translate(-50%,-100%);padding:6px 10px;border-bottom:2px solid #e5c589;border-radius:5px;background:#172831e8;color:#fff0ca;font:600 14px/1.3 system-ui;pointer-events:none}
#journeyWaypoint[hidden]{display:none}
#pause.pause-screen{overflow:hidden;box-sizing:border-box}
#pause .pause-card{width:min(560px,calc(100vw - 24px));padding:24px;background:#14262cf5;border:1px solid #6e858a;border-radius:12px;box-sizing:border-box}
#pause h1{font:600 34px/1.1 Georgia,serif;text-transform:none;letter-spacing:0;margin:6px 0 12px}
#pause .pause-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0 0}
#pause button{min-height:44px!important;min-width:44px;padding:10px 14px!important;border-radius:6px;font:14px/1.2 system-ui;letter-spacing:0;background:#293e46;color:#f6ebd3;border:1px solid #667e85;width:auto!important}
#pause #resumeBtn{background:#ddbc7e;color:#17282b;border-color:#ddbc7e}
#pause [hidden]{display:none!important}
#pause .pause-card[data-page="settings"]>.pause-actions,#pause .pause-card[data-page="tools"]>.pause-actions{display:none}
#pause .diagnostic-actions{padding:0;margin:8px 0;border:0;gap:6px}
#pause .diagnostic-actions span{display:none}
#pause .pause-access{margin:8px 0}
@media(max-height:500px){#pause .pause-card{padding:14px 20px;width:min(600px,calc(100vw - 24px))}#pause h1{font-size:26px}#pause .pause-card>p{display:none}#pause .pause-actions{grid-template-columns:1fr 1fr 1fr}#pause .pause-access{display:flex;align-items:center;gap:16px}#pause .pause-access>b{display:none}}

@media(max-height:500px){#journeyDialogue:has(#waterLessonBtn:not([hidden])){display:grid;grid-template-columns:1fr 1fr;gap:8px}#journeyDialogue:has(#waterLessonBtn:not([hidden]))>b,#journeyDialogue:has(#waterLessonBtn:not([hidden]))>p{grid-column:1/-1}#journeyDialogue #waterLessonBtn{margin:0!important;padding:8px;min-height:44px}#journeyDialogue:has(#waterLessonBtn:not([hidden])) #journeyDialogueClose{margin:0;min-height:44px}#journeyDialogue p{margin:4px 0}#journeyDialogue b{font-size:14px}}
#shchepkaLabel{white-space:nowrap;max-width:none}
/* 27.11 п.4 «курсор не исчезает»: над сценой курсор скрыт, но плашка цели слева вверху его показывала — она только текст, мышь сквозь неё */
body.journey-active .top.left:not(:has(button)){pointer-events:none}
/* 27.11 (свод п.7ф «всё в экран, без вертикальных скроллов»): на телефоне лёжа (844×390) стартовой панели нужно было 584 точки при 357 —
   «Начать историю» уходила за край, панель прокручивалась внутри. На коротких экранах — без надзаголовка, подписи и описаний карточек. */
@media(max-height:520px){#start.panel{padding:10px 18px!important;max-height:calc(100dvh - 12px);overflow:visible}#start .kicker,#start>p:not(:has(#gravityLabLink)){display:none}#start h1{font-size:24px!important;margin:0 0 4px!important}#start .entry-choices{margin:4px 0!important;gap:10px}#start .entry-choices section{padding:8px 12px!important}#start .entry-choices h2{font-size:16px!important;margin:0!important}#start .entry-choices p{display:none}#start .entry-choices button{min-height:44px;margin:6px 0 0!important;padding:8px!important}#start>p:has(#gravityLabLink){margin:4px 0}#gravityLabLink{padding:8px 12px!important}#start .entry-options{margin:2px 0}}
/* Раскрытая «Сохранения и помощь» на тесном экране — отдельный вид: карточки игры прячутся, пока она открыта (на 844×390 страница росла до 456 точек, на 390×844 кнопка сброса уходила за край). */
/* 28.11 (Fable): раскрытая помощь — отдельный вид на любом экране (на 1280×720 сброс уходил за край); кнопки помощи ≥ 44 точек (были 38–41). */
#start:has(.entry-options[open]) .entry-choices,#start:has(.entry-options[open])>p{display:none}
#start .entry-options>summary,#start .campaign-file-actions button,#start .campaign-import-label,#academyClearStoriesBtn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
/* 390×844 с сохранениями кампании и мельницы панели нужно 811 точек при 774 — на узком экране без подписи и описаний карточек. */
@media(max-width:600px){#start>p:not(:has(#gravityLabLink)),#start .entry-choices section>p{display:none}#start .entry-choices{margin:10px 0!important}}
/* 28.11 (dym --telefon): на телефоне лёжа (844×390) окно разговора закрывало 89% центра кадра — боковая панель слева, центр свободен. */
@media(max-height:500px) and (orientation:landscape){#journeyDialogue{left:10px!important;right:auto!important;transform:none!important;top:10px!important;bottom:auto!important;width:min(300px,32vw)!important;max-height:calc(100dvh - 20px)!important;font-size:14px!important;padding:12px!important}#journeyWaypoint{max-width:calc(100vw - 16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:600px){#journeyWaypoint{max-width:calc(100vw - 16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
/* 28.11 (dym --telefon): на телефоне стоя (390×844) окно разговора закрывало 44% центра — нижняя полоса не выше трети экрана. */
@media(max-width:600px) and (orientation:portrait){#journeyDialogue{top:auto!important;bottom:10px!important;max-height:32vh!important;font-size:14px!important;padding:12px!important}}
/* 28.11 (dym, центр кадра): на десктопе окно разговора внизу по центру закрывало 44% центра — боковая панель слева под плашкой цели. */
@media(orientation:landscape) and (min-width:741px) and (min-height:501px){#journeyDialogue{left:24px!important;right:auto!important;transform:none!important;top:110px!important;bottom:auto!important;width:min(400px,28vw)!important;max-height:calc(100dvh - 130px)!important}}
/* 28.11 (Fable): на 844×390 подписи были десктопные (20 px, до 260 px) и налезали — как на телефоне стоя. Разговор 470 знаков не влезал: шире панель, 13 px; стоя — до 36% высоты. */
@media(max-height:500px) and (orientation:landscape){.resident-label{font-size:13px!important;max-width:170px!important}#journeyDialogue{width:min(360px,40vw)!important;font-size:13px!important;line-height:1.4!important;padding:10px 12px!important}}
@media(max-width:600px) and (orientation:portrait){#journeyDialogue{max-height:calc(100dvh - 120px)!important;font-size:13px!important;line-height:1.4!important;padding:10px 12px!important}}
/* 28.11 (Fable): на телефонах ниже 844 px окно, подогнанное под 38vh, резало «Понятно» — растёт до плашки цели; лёжа на узких — шире. */
@media(max-height:500px) and (orientation:landscape) and (max-width:800px){#journeyDialogue{width:min(420px,calc(50vw - 10px))!important}}
/* 29.11 «НА САЙТ» в паузе (п.29б) — как кнопки паузы, ≥ 44 точек. */
.pause-actions #toSite{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:180px;min-height:44px;border-radius:15px;padding:12px 30px;font:950 14px/1 inherit;letter-spacing:.09em;color:#e8f4ff;background:#1f3346;border:1px solid #6f8fa8;text-decoration:none}
@media(max-width:600px){.pause-actions #toSite{width:100%;min-width:0}}
