/* Virtual laboratory: instruments, live observation and an experiment notebook. */
#panel-card:has(.lab-room){width:min(1220px,100%);padding:0;background:#eef3f3;border-color:#91aaa9;max-height:calc(100dvh - 28px)}
.lab-room{background:none!important;padding:0!important;border:0!important;min-width:0}
.lab-room:before,.lab-room:after{display:none!important}
.lab-room .interior-top{padding:22px 28px;margin:0;background:#102c35;color:#e4eeee;border:0;border-radius:15px 15px 0 0;align-items:center}
.lab-room .interior-top small{font-size:9px;letter-spacing:2px;color:#8cc7c2}.lab-room .interior-top h2{font:27px Georgia;color:#fff5d9;margin:5px 0 0}.lab-room .interior-top .icon-btn{background:#23444d!important;color:#e7eeee;border-color:#47616a!important;flex-shrink:0}
.lab-room .interior-tool-strip{display:block;padding:0;background:#173944;border:0;margin:0;border-radius:0}.lab-room .learning-props{display:none}.lab-room .learning-apps{display:flex;gap:0;overflow-x:auto;padding:0 20px;scrollbar-width:thin;border:0;background:none;border-radius:0;margin:0}
.lab-room .learning-app-btn{flex:0 0 auto;width:auto;max-width:220px;min-height:52px;padding:12px 16px;border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:#b5cdcf;box-shadow:none;font-size:11px;white-space:normal;text-align:left;display:flex;align-items:center;gap:9px}
.lab-room .learning-app-btn img{width:25px;height:25px;object-fit:contain}.lab-room .learning-app-btn.selected{background:#234852;color:#fff4d1;border-bottom-color:#edbd6d}.lab-room .learning-app-btn:hover{background:#244954;transform:none}
.lab-room .interior-stage.single{display:block;padding:0;margin:0;background:none;border:0}.lab-room #book-reader.app-mode{display:block;background:none;padding:0;border:0;border-radius:0;box-shadow:none;min-height:0;overflow:visible}.lab-room .interior-actions{margin:0;padding:14px 28px;border-top:1px solid #c4d4d3;background:#e3ebea;display:flex;align-items:center;justify-content:space-between}.lab-room .interior-actions small{font-size:11px;color:#5b767a;max-width:60%}
.virtual-lab{color:#203d48;min-width:0}.lab-header{display:flex;gap:16px;align-items:center;padding:26px 28px;background:linear-gradient(110deg,#f9faf5,#e9f1ef);border-bottom:1px solid #cedcd9}.lab-monogram{display:grid;place-items:center;width:57px;height:57px;flex:0 0 57px;border:1px solid #9cbab5;background:#e0eeea;border-radius:15px;font:36px Georgia;color:#287f7b;box-shadow:inset 0 0 0 5px #eff5f1}.lab-header>div:nth-child(2){flex:1;min-width:0}.lab-header small{font:800 9px Nunito,sans-serif;letter-spacing:1.7px;color:#58817f}.lab-header h3{font:29px/1.15 Georgia,serif;margin:6px 0;color:#193e46}.lab-header p{font:12px/1.6 Nunito,sans-serif;color:#5c7379;margin:0;max-width:650px}.lab-live{color:#267c6f;background:#dcece3;border:1px solid #b5cec1;border-radius:20px;padding:7px 11px;font-size:9px;letter-spacing:1px;white-space:nowrap}
.lab-workspace{display:grid;grid-template-columns:270px minmax(0,1fr);min-width:0}.lab-controls{padding:24px;background:#f6f8f5;border-right:1px solid #cddbd7;margin:0}.lab-section-label{display:flex;align-items:center;gap:9px;margin-bottom:14px}.lab-section-label>span{font:11px ui-monospace,monospace;color:#5a8886;border:1px solid #b7ceca;padding:4px 6px;border-radius:5px}.lab-section-label h4{font:700 14px Nunito,sans-serif;margin:0;letter-spacing:.1px;color:#264851}.lab-section-label>small{margin-left:auto;color:#638280;font-size:9px;letter-spacing:.5px}.lab-controls>p{font-size:11px;line-height:1.6;color:#647e80;margin:0 0 20px}.lab-field{display:block;margin:0 0 19px!important;font-size:12px;font-weight:700;color:#3a5a62}.lab-field>span{display:block;margin-bottom:7px}.lab-field input[type=text]{width:100%;height:42px;padding:9px 12px;border:1px solid #b4c9c7;border-radius:7px;background:white;color:#244a53;font:600 15px ui-monospace,monospace;box-shadow:0 2px 3px #163b3810;min-width:0}.lab-field input[type=text]:focus{outline:2px solid #258a86;outline-offset:2px}.lab-field input[type=range]{display:block;width:100%;height:26px;margin:8px 0 0;accent-color:#23877f;cursor:pointer;padding:0;box-shadow:none;border:0;background:none}.lab-field>small{display:block;color:#748b8b;font-size:9px;font-weight:400;line-height:1.5;margin-top:3px}.lab-control-actions{display:grid;gap:9px;border-top:1px solid #d8e1db;padding-top:18px}.lab-control-actions .btn{font-size:11px;min-height:42px;padding:10px}.lab-control-actions .primary{background:#247f79;border-color:#247f79;box-shadow:0 3px 0 #16564f}.lab-control-actions .ghost{color:#557575}
.lab-observation{padding:24px 28px;min-width:0;background:#eaf0ef}.lab-screen{border:1px solid #b0c7c7;border-radius:12px;overflow:hidden;background:#fcfdfb;box-shadow:0 8px 20px #19444b0a}.lab-screen-bar{display:flex;justify-content:space-between;padding:12px 16px;background:#1b3d48;color:#b8d6d6;font:9px ui-monospace,monospace;letter-spacing:1px}.lab-screen-bar>span:last-child{color:#84ceba}.lab-visual{min-height:290px;padding:24px;background-image:linear-gradient(#90ada515 1px,transparent 1px),linear-gradient(90deg,#90ada515 1px,transparent 1px);background-size:22px 22px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;overflow-x:auto}.lab-visual .generated-graph{width:100%;max-width:650px;height:auto;max-height:320px;min-height:200px;display:block;background:transparent;border:0;border-radius:0;margin:0}.lab-visual svg text{font-family:Nunito,sans-serif}.lab-visual>.generated-graph+strong,.lab-visual>strong{font-size:13px;text-align:center;color:#305b62}.lab-figure{width:100%;margin:0}.lab-figure svg{display:block;width:100%;max-height:320px}.lab-figure figcaption{text-align:center;font-size:11px;color:#6e888a;margin-top:6px}.lab-readout{margin-top:15px;padding:17px 20px;border:1px solid #b9d1c8;border-left:4px solid #3a9c89;border-radius:8px;background:#f7fbf6}.lab-readout>small{color:#639283;font-size:9px;letter-spacing:1.5px}.lab-readout output{display:block;font:600 16px/1.65 Nunito,sans-serif;color:#244d4b;margin-top:6px;overflow-wrap:anywhere}.lab-readout.invalid{background:#fff3e9;border-color:#d4a276;border-left-color:#b96b40}.lab-readout.invalid output{color:#985537}.lab-prompt{display:flex;gap:12px;margin:18px 0;background:transparent}.lab-prompt>span{color:#b28c48;font-size:25px}.lab-prompt strong{font-size:12px;color:#586965}.lab-prompt p{font-size:11px;line-height:1.6;margin:4px 0;color:#647e7d}.lab-record{font-size:11px;background:#f6f9f3;border-color:#b0c6bb;box-shadow:none;color:#326b5e;min-height:40px}.lab-equation{display:grid;gap:20px;justify-items:center;text-align:center;padding:28px 0;color:#254e58;max-width:100%}.lab-equation small{font:10px Nunito;letter-spacing:1.5px;color:#6d8c8e}.lab-equation strong{font:clamp(26px,4vw,46px) Georgia;overflow-wrap:anywhere}.lab-equation span{font-size:11px;color:#6d8c8e}.lab-empty{display:grid;text-align:center;gap:12px;color:#789192}.lab-empty>span{font:60px Georgia;color:#9dbbb7}.lab-empty p{font-size:12px}.lab-notebook{padding:22px 28px;border-top:1px solid #c8d8d3;background:#f9faf5}.lab-history{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.lab-history>p{margin:0;font-size:12px;color:#81918b;line-height:1.6}.lab-history article{padding:15px;border:1px solid #d5dcc8;border-radius:8px;background:repeating-linear-gradient(#fbf9ee,#fbf9ee 25px,#d8e0d755 26px);overflow-wrap:anywhere}.lab-history article>small{font-size:9px;letter-spacing:1px;color:#9c834f}.lab-history dl{font-size:11px;line-height:1.6}.lab-history dl>div{display:flex;justify-content:space-between;gap:10px}.lab-history dt{color:#76877c}.lab-history dd{margin:0;color:#446455;max-width:60%}.lab-history p{font-size:12px;line-height:1.7;color:#345747}.lab-visual .generated-table{width:100%;font-size:12px;border-collapse:collapse;background:#fffdf5}.lab-visual .generated-table th{background:#e0ede7;color:#315b59;padding:12px}.lab-visual .generated-table td{border-bottom:1px solid #d1ded8;padding:10px;text-align:center}.lab-quartiles{display:flex;align-items:center;gap:15px;width:100%;color:#56837e}.lab-quartiles>span{display:grid;gap:8px;font-size:12px}.lab-quartiles strong{font-size:24px;color:#245a5b}.lab-quartiles>div{flex:1;display:grid;text-align:center;gap:15px}.lab-quartiles i{height:60px;background:#6fb8a77a;border:2px solid #3d9689;border-radius:3px}.lab-quartiles b{font-size:14px}.lab-probability{width:215px;height:215px;border-radius:50%;padding:23px;background:conic-gradient(#269387 var(--portion),#d8e7e2 0);box-shadow:0 0 0 8px #eef4ef}.lab-probability>div{width:100%;height:100%;background:#fbfdf8;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px}.lab-probability strong{font:32px Georgia;color:#235c58}.lab-probability span,.lab-legend{font-size:10px;color:#64857e}.lab-legend{display:flex;gap:20px}
@media(max-width:700px){.lab-workspace{grid-template-columns:1fr}.lab-header{padding:18px;gap:12px}.lab-monogram{display:none}.lab-header h3{font-size:24px}.lab-live{display:none}.lab-room .interior-top{padding:16px 18px}.lab-room .interior-top h2{font-size:23px}.lab-room .learning-apps{padding:0 6px}.lab-room .learning-app-btn{font-size:10px;max-width:175px;min-height:52px;padding:10px}.lab-controls{border-right:0;border-bottom:1px solid #cddbd7;padding:18px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.lab-controls>.lab-section-label,.lab-controls>p,.lab-control-actions{grid-column:1/-1}.lab-field:has(input[type=text]:not([inputmode])){grid-column:1/-1}.lab-field input[type=text]{font-size:16px}.lab-controls>p{margin-bottom:14px}.lab-field{margin-bottom:14px!important}.lab-control-actions{display:flex;flex-wrap:wrap;padding-top:12px}.lab-control-actions .btn{flex:1}.lab-observation{padding:18px}.lab-visual{min-height:230px;padding:12px}.lab-visual .generated-graph{min-height:170px}.lab-readout{padding:14px}.lab-readout output{font-size:14px}.lab-notebook{padding:18px}.lab-room .interior-actions{padding:12px 18px}.lab-room .interior-actions small{display:none}.lab-room .interior-actions .btn{width:100%}.lab-notebook .lab-section-label{flex-wrap:wrap}.lab-notebook .lab-section-label>small{flex-basis:100%;margin-left:0}.lab-history{grid-template-columns:1fr}.lab-screen-bar{font-size:8px}}
@media(orientation:landscape) and (max-height:550px){.lab-workspace{grid-template-columns:230px minmax(0,1fr)}.lab-controls{display:block;padding:18px;border-right:1px solid #cddbd7}.lab-header{padding:16px 22px}.lab-header h3{font-size:23px}.lab-header p{display:none}.lab-observation{padding:18px}.lab-visual{min-height:200px}.lab-room .interior-top{padding:12px 22px}.lab-room .interior-top h2{font-size:22px}}
/* Both phone orientations remain playable, with safe areas and thumb-size targets. */
html,body,#app{height:100%;height:100dvh;min-height:0!important}#game-canvas{max-width:none!important;max-height:none!important}.orientation-guard{display:none!important}
html.mobile-device #touch-controls:not(.hidden){display:flex!important;bottom:max(15px,env(safe-area-inset-bottom));padding-inline:max(14px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right))}
html.mobile-device #app:has(.modal:not(.hidden)) #touch-controls{display:none!important}
html.mobile-device .dpad{width:144px;height:144px;display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,46px);gap:3px}
html.mobile-device .dpad [data-dir=up]{grid-column:2;grid-row:1}html.mobile-device .dpad [data-dir=left]{grid-column:1;grid-row:2}html.mobile-device .dpad [data-dir=down]{grid-column:2;grid-row:3}html.mobile-device .dpad [data-dir=right]{grid-column:3;grid-row:2}
html.mobile-device .dpad button{border:1px solid #d7c79288;border-radius:12px;background:#133d32de;color:#f2deb1;font-size:16px;padding:0;box-shadow:0 3px 10px #112d2c55;min-width:44px;min-height:44px}html.mobile-device .joystick-base,html.mobile-device .joystick-knob{display:none}html.mobile-device .touch-action{width:66px;height:66px;border:2px solid #ecd4a6;background:#d0ac6a;box-shadow:0 4px 15px #102b2a66}html.mobile-device .touch-action img{width:100%;height:100%}
html.mobile-device #hud{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));gap:5px;flex-wrap:nowrap}html.mobile-device .hud-brand{display:none!important}html.mobile-device .hud-icon,html.mobile-device .hud-stat{min-width:42px;min-height:44px;height:44px}html.mobile-device .hud-icon{width:44px}html.mobile-device #mission-pill,html.mobile-device #explore-controls{display:none!important}html.mobile-device #world-compass{display:none}html.mobile-device #quest-compass{top:max(66px,calc(env(safe-area-inset-top) + 56px));max-width:calc(100vw - 24px);padding:8px 12px}html.mobile-device #interaction-hint{bottom:max(175px,calc(env(safe-area-inset-bottom) + 155px));max-width:calc(100vw - 30px);white-space:normal;text-align:center}html.mobile-device #interaction-hint kbd{display:none}html.mobile-device #toast-stack{bottom:180px;right:12px;width:min(280px,80vw)}html.mobile-device .street-task{bottom:180px;max-height:calc(100dvh - 320px);overflow:auto}
@media(orientation:portrait){html.mobile-device .reputation{display:none}html.mobile-device #title-screen{padding-top:max(80px,calc(env(safe-area-inset-top) + 55px));padding-bottom:55px}html.mobile-device .title-footer{position:absolute}html.mobile-device .dialog-card{grid-template-columns:70px minmax(0,1fr)}html.mobile-device .dialog-card>img#dialog-portrait{min-height:0;align-self:start;margin-top:25px}html.mobile-device .dialog-copy{padding:18px 14px}html.mobile-device .dialog-actions{display:grid}html.mobile-device .street-task{left:12px;right:12px;width:auto;transform:none}}
@media(orientation:landscape) and (max-height:550px){html.mobile-device .dpad{width:132px;height:132px;grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,42px)}html.mobile-device #touch-controls:not(.hidden){bottom:max(8px,env(safe-area-inset-bottom))}html.mobile-device .dpad button{min-width:42px;min-height:42px}html.mobile-device #interaction-hint{bottom:max(15px,env(safe-area-inset-bottom));max-width:45vw}html.mobile-device #quest-compass{display:none}html.mobile-device .street-task{top:65px;bottom:auto;right:90px;left:auto;width:min(360px,50vw);max-height:calc(100dvh - 95px)}html.mobile-device #toast-stack{bottom:65px;right:88px;width:250px}html.mobile-device #title-screen .title-card{width:min(630px,85vw);max-height:none;overflow:visible}html.mobile-device #title-screen .title-actions{max-width:630px;grid-template-columns:repeat(3,minmax(0,1fr));margin-left:0}html.mobile-device #title-screen .title-actions #continue-btn,html.mobile-device #title-screen .title-actions .btn.primary,html.mobile-device #title-screen .title-actions .profile-button{grid-column:auto!important}}
.modal{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}.panel-card,.dialog-card{max-height:calc(100dvh - 24px);overflow:auto}button:focus-visible{outline:3px solid #d8b465;outline-offset:3px}

.lab-room .learning-apps{flex-wrap:nowrap}.lab-visual .generated-comparison,.lab-visual .generated-pie-wrap{width:100%;max-width:600px}.lab-visual .generated-comparison{display:grid;gap:18px}.lab-visual .comparison-row{grid-template-columns:100px minmax(0,1fr) 85px;font-size:12px}.lab-visual .comparison-row i{height:18px;background:#dce8e1;border:0}.lab-visual .comparison-row i b{border-radius:4px}.lab-visual .generated-gauge{width:100%}.lab-visual .generated-table{min-width:0}

.lab-room .interior-top{position:sticky;top:0;z-index:4}html.mobile-device #action-cameo{display:none!important}
