/* A full-viewport workshop with a light, touch-friendly game HUD. */
:root{--hud:#19343fdf;--hud-soft:#203b46b8;--hud-line:#e1f1ec2c;--hud-ink:#f5f7f0;--hud-muted:#c3d4d2;--hud-gold:#f4cc83;--hud-shadow:0 5px 18px #092b3324}
html,body,#app{width:100%;height:100%;height:100dvh;margin:0;overflow:hidden;overscroll-behavior:none}
body{background:#bac8bf}
.shell.game-screen{position:relative;isolation:isolate;width:100%;height:100%;min-height:0;max-width:none;margin:0;padding:0;overflow:hidden;background:#bac8bf;box-shadow:none}
.game-screen .scene-frame,.game-screen .scene-frame.scene-unavailable{position:absolute;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;overflow:hidden}
.game-screen #sceneMount,.game-screen .workshop-world,.game-screen .workshop-world canvas{position:absolute;inset:0;width:100%;height:100%;max-width:none}
.game-screen .scene-heading{display:none}
.game-screen .scene-loading{inset:45% 12px auto;font-size:13px;text-align:center;background:#f8f7ebeb;padding:14px;border-radius:20px;max-width:320px;margin:auto}
.game-screen .icon{width:18px;height:18px;vertical-align:-.22em}
.game-screen button{transition:background-color .16s,border-color .16s,box-shadow .16s,transform .16s;-webkit-tap-highlight-color:transparent}
.game-screen button:focus-visible{outline:2px solid #ffe1a3;outline-offset:2px}
.game-screen button:active:not(:disabled):not(.scene-label){transform:scale(.97)}
.game-screen .hud-top,.game-screen .hud-bottom{position:absolute;z-index:5;pointer-events:none;color:var(--hud-ink)}
.game-screen .hud-top{top:max(9px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));max-width:440px}
.game-screen .hud-top button,.game-screen .hud-bottom button,.game-screen .hud-top select{pointer-events:auto}
.game-screen .top{display:flex;gap:1px;align-items:center;min-height:44px;padding:0;margin:0;background:none;border:0;color:var(--hud-ink)}
.game-screen .top h1{flex:1;width:max-content;max-width:max-content;margin-right:auto;padding:7px 11px;font-size:14px;font-weight:750;line-height:20px;letter-spacing:.065em;background:var(--hud-soft);border:1px solid var(--hud-line);border-radius:18px;box-shadow:var(--hud-shadow);backdrop-filter:blur(12px)}
/* Transparent borders leave a 44px hit area around a smaller visible disc. */
.game-screen .top button,.game-screen .camera-tools button{display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;color:var(--hud-ink);background:var(--hud-soft);background-clip:padding-box;border:5px solid transparent;border-radius:50%;box-shadow:none;filter:drop-shadow(0 3px 6px #14313a25);backdrop-filter:blur(8px)}
.game-screen .top .icon,.game-screen .camera-tools .icon{width:18px;height:18px}
.game-screen .goal{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 7px;position:relative;width:max-content;max-width:calc(100% - 48px);margin:3px 0 0;padding:7px 10px;background:linear-gradient(115deg,#1c3844d9,#294850b8);border:1px solid var(--hud-line);border-radius:14px;backdrop-filter:blur(12px);box-shadow:var(--hud-shadow)}
.game-screen .goal-line{grid-column:1/-1;gap:6px;align-items:center;min-width:0}
.game-screen .goal-line h2{min-width:0;margin:0;font-size:14px;line-height:1.25;color:var(--hud-ink);font-weight:750}
.game-screen .goal-line>.icon{width:15px;height:15px;color:#a9d7bc}
.game-screen .stage-chip{font-size:9px;line-height:14px;letter-spacing:.04em;background:#f4cc831a;color:#f3d59c;border:1px solid #f4cc8345;padding:1px 5px;border-radius:6px}
.game-screen .goal p{margin:1px 0 0;color:#dce8e2;font-size:11px;line-height:1.4;max-width:300px}
.game-screen .goal-line .budget-chip{margin:0 0 0 auto;flex:none;padding:2px 4px;font-size:10px;background:transparent;color:#f0d69d;white-space:nowrap}
.game-screen .budget-chip .icon{width:13px;height:13px}
.game-screen .tabs{width:max-content;max-width:calc(100% - 48px);display:flex;gap:2px;padding:2px;margin:5px 0 0;background:var(--hud-soft);border:1px solid var(--hud-line);border-radius:20px;backdrop-filter:blur(10px)}
.game-screen .tabs button{min-height:34px;min-width:52px;padding:5px 10px;border:0;border-radius:16px;background:transparent;color:#dbe7e2;font-size:11px;white-space:nowrap;box-shadow:none}
.game-screen .tabs button.active{background:#f0d7a7;color:#3e433a;font-weight:750;box-shadow:0 1px 3px #14353f26}
.game-screen .tabs.scenes{margin-top:4px}
.game-screen .scenario-caption{width:max-content;max-width:90%;margin:3px 0 0!important;padding:3px 7px!important;color:#e4ece6;background:#1f3d476e;border-radius:9px;font-size:10px}
.game-screen .hud-bottom{left:50%;bottom:max(11px,env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:560px;transform:translateX(-50%);display:flex;flex-direction:column;gap:5px}
.game-screen .hud-bottom::before{content:'';position:absolute;z-index:-1;left:-28px;right:-28px;top:-38px;bottom:calc(-1 * max(12px,env(safe-area-inset-bottom)));pointer-events:none;background:linear-gradient(transparent,#153a4312 22%,#163a4559);border-radius:34px 34px 0 0}
.game-screen .staff-title{display:flex;justify-content:space-between;align-items:center;min-height:28px;margin:0;padding:0 5px;font-size:11px;color:#f3f5e9;text-shadow:0 1px 5px #142e39;font-weight:650}
.game-screen .staff-title>span{padding:3px 7px;background:#1a374b6e;border:1px solid #d8e9e214;border-radius:12px;max-width:calc(100% - 66px);line-height:1.3}
.game-screen .staff-title #hint{display:flex;align-items:center;gap:4px;min-height:30px!important;height:30px;padding:3px 8px!important;color:#f5deb3;background:#203b46ad;border:1px solid var(--hud-line);border-radius:16px;font-size:11px!important;line-height:20px;text-shadow:none}
.game-screen .staff-title #hint .icon{width:15px;height:15px}
.game-screen .staff{display:flex;align-items:stretch;justify-content:center;gap:4px;margin:0;padding:4px;min-width:0;width:100%;align-self:center;background:linear-gradient(130deg,#203c46bc,#19353fce);border:1px solid var(--hud-line);border-radius:18px;box-shadow:var(--hud-shadow);backdrop-filter:blur(16px)}
.game-screen .staff[data-count="2"]{max-width:244px}
.game-screen .staff[data-count="3"]{max-width:362px}
.game-screen .person{position:relative;flex:1;max-width:112px;min-width:0;min-height:56px;display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto auto auto;gap:0 4px;align-items:center;justify-content:center;padding:5px 6px;background:#fff0;color:var(--hud-ink);border:1px solid transparent;border-radius:13px;text-align:left;box-shadow:none;backdrop-filter:none}
.game-screen .person:not(:has(.bars)){min-height:44px;grid-template-rows:auto auto}
.game-screen .person>.portrait{grid-column:1;grid-row:1/span 2;width:32px;height:32px;filter:drop-shadow(0 2px 2px #0e2c3b32)}
.game-screen .person strong{font-size:12px;line-height:1.25;white-space:nowrap;color:var(--hud-ink);font-weight:650}
.game-screen .person .skills{display:flex;float:none;gap:3px;font-size:11px;line-height:1.2;justify-content:flex-start;min-height:14px}
.game-screen .person .skills .icon{width:14px;height:14px}
.game-screen .person .skill-P{color:#f5d08e}.game-screen .person .skill-Q{color:#a7dac1}.game-screen .person .skill-R{color:#a9d7ec}
.game-screen .person .bars{grid-column:1/-1;display:flex;gap:2px;align-items:center;justify-content:center;white-space:nowrap;font-size:9px;line-height:1.2;margin:4px 0 0;color:#c3d6d3;font-variant-numeric:tabular-nums}
.game-screen .person .bars .icon{width:10px;height:10px}
.game-screen .person .availability{grid-column:1/-1;margin:3px 0 0;gap:4px;justify-content:center;line-height:1}
.game-screen .availability i{width:4px;height:4px;border-color:#abc8c14a;background:#32525d}
.game-screen .availability i.on{background:#aad6bd;border-color:#aad6bd}
.game-screen .person .over{color:#ffc1ad}
.game-screen .person.selected{padding:5px 6px;background:linear-gradient(150deg,#f4cc8324,#f4cc830b);border:1px solid #f1ce89c7;box-shadow:inset 0 0 0 1px #fff1c014,0 2px 8px #0a2d342b;color:var(--hud-ink);transform:translateY(-2px)}
.game-screen .person.selected::after{content:'';position:absolute;top:4px;right:5px;width:4px;height:4px;border-radius:50%;background:#ffe4a9;box-shadow:0 0 5px #f5d38f99}
.game-screen .person.selected strong{color:#fff0ce}
.game-screen .person.unavailable{background:#344a511f;filter:saturate(.4);opacity:.55}
.game-screen .time-tools{display:flex;gap:5px;align-items:stretch;min-width:0}
.game-screen .scene-time{flex:1;display:flex;align-items:center;gap:2px;min-width:0;max-width:none;padding:2px;margin:0;background:var(--hud-soft);border:1px solid var(--hud-line);border-radius:23px;backdrop-filter:blur(12px);box-shadow:var(--hud-shadow)}
.game-screen .scene-time>span{display:none}
.game-screen .scene-time button{flex:1;min-width:0;min-height:38px;padding:5px 3px;background:transparent;border:0;border-radius:19px;font-size:11px;color:#dce8e3;white-space:nowrap}
.game-screen .scene-time button.active{background:#e3eee5;color:#2f4c4a;font-weight:750;box-shadow:0 1px 3px #13364224}
.game-screen .scene-time #toggleBoard{flex:1.12;background:#ffffff0b;color:#f1f5e8;box-shadow:inset 1px 0 #d9eae11c;border-radius:0 18px 18px 0}
.game-screen .scene-time #toggleBoard .icon{width:14px;height:14px}
.game-screen .scene-training{flex:none;display:flex;flex-direction:column;justify-content:center;gap:1px;width:auto;min-width:54px;min-height:44px;max-width:88px;margin:0;padding:4px 8px;border:1px solid #eace995e;border-radius:20px;color:#f4dca9;background:#3c4841ce;font-size:11px;text-align:center;backdrop-filter:blur(10px)}
.game-screen .scene-training .icon{display:none}
.game-screen .scene-training span{flex:none;text-align:center;font-size:9px;line-height:1.2;max-width:68px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#d4d8bc}
.game-screen .footer{position:static;display:flex;gap:5px;width:100%;max-width:none;margin:0;padding:0;border:0;background:none;backdrop-filter:none;z-index:auto}
.game-screen .footer button{min-width:44px;min-height:44px;padding:6px 12px;border:1px solid var(--hud-line);border-radius:22px;background:var(--hud-soft);color:#eef4e8;font-size:13px;box-shadow:var(--hud-shadow);backdrop-filter:blur(12px)}
.game-screen .footer button:not(.primary):has(>.icon:only-child){display:grid;place-items:center;width:44px;flex:none;padding:0;background-clip:padding-box;border:4px solid transparent;box-shadow:none}
.game-screen .footer button.primary,.game-screen .continue.primary{background:linear-gradient(120deg,#f6dba1,#eec07c);color:#37453e;border:1px solid #ffebbf;box-shadow:0 2px 0 #81765077,0 6px 20px #1a354628,inset 0 1px #fff6;text-shadow:0 1px #fff5;letter-spacing:.04em;font-weight:750;backdrop-filter:none}
.game-screen .feedback{align-self:center;max-width:100%;min-height:0;padding:6px 10px;margin:0;border:1px solid #e3eee22e;border-radius:14px;background:#233f48e8;color:#f1f5eb;font-size:11px;line-height:1.35;box-shadow:var(--hud-shadow);pointer-events:none}
.game-screen .feedback>.icon{width:14px;height:14px}
.game-screen .feedback.error{background:#674d40eb;border-color:#ecc6a75e;color:#fff0da}
.game-screen .feedback.success{background:#2d5149eb;border-color:#b4dfc24f;color:#e9f8e5}
.game-screen .camera-tools{position:absolute;z-index:4;top:50%;right:max(8px,env(safe-area-inset-right));left:auto;bottom:auto;transform:translateY(-50%);display:flex;flex-direction:column;gap:0;padding:0;pointer-events:none}
.game-screen .camera-tools button{pointer-events:auto}
.game-screen .scene-gesture{top:max(12px,env(safe-area-inset-top));bottom:auto;left:50%;right:auto;transform:translateX(-50%);padding:5px 10px;border:1px solid #fff2;border-radius:20px;background:#21414c72;color:#eaf2e8;font-size:10px;letter-spacing:.03em;text-shadow:0 1px 3px #183641;z-index:3}
.game-screen .scene-label{min-width:44px;min-height:44px;max-width:150px;padding:5px 10px;border:1px solid #fff9;border-radius:17px;color:#314c4e;background:#f7f6eceb;box-shadow:0 4px 12px #13384825;font-size:12px;backdrop-filter:blur(8px)}
/* Projected labels use transform for their map anchor. Press feedback must keep it. */
.game-screen .scene-label{transition:background-color .16s,border-color .16s,box-shadow .16s}
.game-screen .scene-label:active:not(:disabled){box-shadow:inset 0 0 0 2px #a17b3d,0 2px 8px #13384835}
.game-screen .scene-label.is-ready{background:#f4ddb0ed;border-color:#fff0cf;box-shadow:0 0 0 2px #ffe3a930,0 4px 14px #183a4830}
.game-screen .scene-label.is-filled{background:#e4eee6eb;border-color:#c8e1d0}
.game-screen .scene-label .scene-label-mark{font-size:12px;color:#9b743c}
.game-screen .scene-label .scene-label-mark .icon{width:14px;height:14px}
.game-screen .scene-label[data-kind="Q"] .scene-label-mark{color:#467f68}
.game-screen .scene-label[data-kind="R"] .scene-label-mark{color:#4d8098}
.game-screen .scene-label .scene-label-name{font-size:11px;font-weight:750}
.game-screen .scene-label .scene-label-seats{font-size:9px;line-height:1.25;color:#66827a}
.game-screen .scene-labels{position:absolute;inset:0;z-index:2;pointer-events:none}
.game-screen .storage-note{pointer-events:auto;display:flex;align-items:center;gap:4px;width:max-content;max-width:calc(100% - 48px);margin:4px 0 0;padding:0;background:none;border:0;color:#f3dbaf;font-size:10px;line-height:1.25}
.game-screen .storage-note span{max-width:230px}
.game-screen .storage-note button{min-height:32px;min-width:54px;margin:0;padding:4px 8px;border:1px solid #edc98b35;background:#45504cd6;color:#f5dfb5;border-radius:16px;font-size:10px;white-space:nowrap}
.game-screen .storage-note .icon{width:13px;height:13px}
.game-screen .qa{position:absolute;z-index:6;right:10px;bottom:1px;max-width:70vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;padding:0 4px;border-radius:4px;background:#d8caa575;color:#3e4b40;font-size:8px;line-height:10px;pointer-events:none}
.game-screen.menu-screen .hud-bottom{max-width:320px;gap:10px;bottom:max(26px,env(safe-area-inset-bottom));text-align:center}
.game-screen.menu-screen .hud-bottom::before{top:-65px;bottom:-30px;left:-80px;right:-80px;background:radial-gradient(ellipse at 50% 100%,#1e3d4b8c,transparent 72%)}
.game-screen .lobby-title{color:#fff4da;text-align:center;text-shadow:0 2px 4px #203c43,0 3px 20px #16343966;pointer-events:none}
.game-screen .lobby-title h2{font-size:clamp(28px,4vw,40px);line-height:1.2;letter-spacing:.08em;margin:0;font-weight:800}
.game-screen .lobby-title small{display:block;margin-top:5px;font-size:10px;letter-spacing:.18em;color:#e3e9df}
.game-screen .campaign-progress{display:flex;align-items:center;justify-content:center;gap:9px;margin:0 24px;color:#e6ede0;font-size:10px;text-shadow:0 1px 5px #1a3837}
.game-screen .campaign-progress progress{height:4px;width:100%;accent-color:#edc784}
.game-screen .lobby-actions{display:flex;flex-direction:column;align-items:center;gap:7px}
.game-screen .continue{min-height:48px;height:48px;margin:0;padding:8px 16px;border-radius:24px;font-size:16px}
.game-screen #chooseLevels{align-self:center;min-height:44px;width:max-content;min-width:124px;padding:7px 16px;color:#ecf2e6;background:var(--hud-soft);background-clip:padding-box;border:4px solid transparent;border-radius:24px;font-size:12px;box-shadow:none}
.game-screen #chooseLevels .icon{width:15px;height:15px}
/* Panels float above the stage and scroll within the viewport. */
dialog#panel{box-sizing:border-box;max-width:540px;width:calc(100% - 24px);max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin:auto;border:1px solid #edf6edb0;border-radius:22px;background:#f0f3ea;color:#304e50;overflow:auto;overscroll-behavior:contain;box-shadow:0 20px 80px #092c3a59}
dialog#panel::backdrop{background:#15333f66;backdrop-filter:blur(5px)}
#panel .panel-head{padding:6px 12px 6px 16px;background:#25414b;color:#f2f5e9;border-bottom:1px solid #ffffff15;min-height:56px}
#panel .panel-head h3{font-size:15px;font-weight:700;letter-spacing:.04em}
#panel #closePanel{display:grid;place-items:center;width:44px;min-width:44px;min-height:44px;height:44px;padding:0;background:#ffffff0e;background-clip:padding-box;border:5px solid transparent;border-radius:50%;color:#f3f5e9}
#panel #closePanel .icon{width:17px;height:17px}
#panel .panel-body{padding:13px 14px;background:#f2f4ec;color:#304e50;font-size:13px}
#panel .panel-body button{border-radius:13px}
#panel .menu-section{padding:0 0 4px}
#panel .menu-section h3{font-size:12px;margin:12px 0 7px;font-weight:750;color:#658078;letter-spacing:.03em}
#panel .menu-section h3 .icon{width:15px;height:15px;color:#658078}
#panel .levels{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#panel .level{min-width:0;min-height:58px;padding:7px;background:#fffef7;border-color:#dce4da;gap:7px;box-shadow:0 2px 5px #234f4310}
#panel .level-art{width:25px;height:25px;border-radius:50%;background:#f4e8cd;color:#877449}
#panel .level-art .icon{width:15px;height:15px}
#panel .level:nth-child(3n+2) .level-art{background:#e2edef;color:#618391}
#panel .level:nth-child(3n) .level-art{background:#e6e4ef;color:#817697}
#panel .level-info strong{font-size:11px;font-weight:650;line-height:1.35}
#panel .level-info .num{font-size:9px;color:#78938d}
#panel .level-state .icon{width:13px;height:13px}
#panel .level.cleared{background:#e6efe4;border-color:#c1d7c3}
#panel .board{margin:4px 0;border:1px solid #b2c5bb;grid-template-columns:60px repeat(3,minmax(0,1fr));border-radius:14px}
#panel .board .label{background:#e5ece2}
#panel .board .cell{min-height:52px;border-radius:0}
#panel .board .gridhead{background:#46696e}
#panel .board .cell .portrait{width:29px;height:29px}
#panel .board .training-pair .portrait{width:21px;height:21px}
#panel .tabs{margin:4px 0 8px;padding:0}
#panel .tabs button{min-height:40px;padding:7px 4px}
#panel .panel-body button.primary{background:#386d60;color:#fff;border:1px solid #2a6056;box-shadow:0 2px 0 #28574d33}
#panel .pick-grid{grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:5px}
#panel .pick-person{border-color:#d7e1d8;background:#fffef7;padding:6px 3px;gap:3px}
#panel .pick-person.qualified{background:#e9f1e5;border-color:#b7cfb7}
#panel .pick-person[aria-pressed=true]{outline:2px solid #6f9b7c;outline-offset:-2px;background:#dfeeda}
#panel .pick-person .portrait{width:30px;height:30px}
#panel .result-title{text-align:center;font-size:24px;color:#346655}
#panel .win-art{width:58px;height:58px;margin-top:8px;margin-bottom:15px;background:radial-gradient(circle at 35% 25%,#fff0c5,#eec580);box-shadow:0 0 0 4px #f6e9c6,0 0 0 9px #f1dfb333}
#panel .win-art .icon{width:29px;height:29px}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
@media(min-width:900px){
 .game-screen .hud-top{top:max(18px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left))}
 .game-screen .hud-bottom{bottom:max(18px,env(safe-area-inset-bottom));gap:6px}
 .game-screen .camera-tools{right:18px}
 .game-screen.menu-screen .hud-bottom{bottom:30px}
}
@media(max-width:600px){
 .game-screen .hud-bottom{gap:4px}
 .game-screen .staff{gap:2px;padding:3px;border-radius:16px}
 .game-screen .staff[data-count="2"]{max-width:222px}
 .game-screen .staff[data-count="3"]{max-width:330px}
 .game-screen .person{max-width:104px;padding:4px 5px;grid-template-columns:29px minmax(0,1fr);gap:0 3px}
 .game-screen .person.selected{padding:4px 5px}
 .game-screen .person>.portrait{width:29px;height:29px}
 .game-screen .person strong{font-size:11px}
 .game-screen .person .skills{gap:2px}
 .game-screen .person .skills .icon{width:13px;height:13px}
 .game-screen .staff[data-count="4"] .person,.game-screen .staff[data-count="5"] .person{display:flex;flex-direction:column;gap:1px;text-align:center;min-height:75px;padding:4px 2px}
 .game-screen .staff[data-count="4"] .person .skills,.game-screen .staff[data-count="5"] .person .skills{justify-content:center}
 .game-screen .person .bars{font-size:9px;letter-spacing:-.02em;margin-top:3px}
 .game-screen .scene-training{max-width:66px;min-width:52px;padding:4px 5px}
 .game-screen .scene-training span{max-width:54px}
 .game-screen .scene-label{max-width:125px;padding:5px 8px}
 .game-screen.play-screen .scene-gesture{display:none}
 .game-screen.menu-screen .scene-gesture{top:calc(max(9px,env(safe-area-inset-top)) + 48px);left:auto;right:12px;bottom:auto;transform:none;font-size:9px}
 .game-screen.menu-screen .camera-tools{top:42%}
}
@media(max-width:360px){
 .game-screen .hud-top{left:8px;right:8px;top:max(7px,env(safe-area-inset-top))}
 .game-screen .top h1{font-size:13px;padding:6px 9px}
 .game-screen .goal{max-width:calc(100% - 46px);padding:6px 8px}
 .game-screen .goal-line h2{font-size:13px}
 .game-screen .goal p{font-size:10px}
 .game-screen .tabs{max-width:calc(100% - 46px)}
 .game-screen .tabs button{font-size:10px;padding:5px 7px;min-height:32px;min-width:48px}
 .game-screen .hud-bottom{width:calc(100% - 16px);bottom:max(9px,env(safe-area-inset-bottom))}
 .game-screen .person{padding:4px 3px;grid-template-columns:26px minmax(0,1fr)}
 .game-screen .person.selected{padding:4px 3px}
 .game-screen .person>.portrait{width:26px;height:26px}
 .game-screen .person .bars{font-size:8px}
 .game-screen .person .bars .icon{width:9px;height:9px}
 .game-screen .person .skills .icon{width:12px;height:12px}
 .game-screen .scene-time button{font-size:10px;padding:4px 2px}
 .game-screen .scene-time #toggleBoard{flex:1.05}
 .game-screen .scene-training{min-width:47px;padding:3px;font-size:10px}
 .game-screen .footer button{padding:6px 9px;font-size:12px}
 .game-screen .camera-tools{right:4px}
 .game-screen .scene-label{padding:5px 7px;max-width:113px}
 .game-screen .scene-label .scene-label-name{font-size:10px}
 .game-screen .feedback{font-size:10px;padding:5px 8px}
 #panel .board{grid-template-columns:52px repeat(3,minmax(0,1fr))}
}
@media(max-height:640px) and (max-width:600px){
 .game-screen .hud-bottom{gap:3px}
 .game-screen .staff-title{min-height:26px}
 .game-screen .staff-title #hint{min-height:28px!important;height:28px;line-height:18px}
 .game-screen .person{min-height:52px}
 .game-screen .person .availability{display:none}
 .game-screen .staff[data-count="4"] .person,.game-screen .staff[data-count="5"] .person{min-height:68px}
 .game-screen .person>.portrait{width:25px;height:25px}
 .game-screen .goal{margin-top:2px}
 .game-screen .tabs{margin-top:3px}
 .game-screen .tabs button{min-height:30px}
 .game-screen .camera-tools{top:43%}
 .game-screen.menu-screen .camera-tools{top:39%}
 .game-screen.menu-screen .hud-bottom{bottom:16px;gap:6px}
 .game-screen .lobby-title h2{font-size:28px}
 .game-screen .continue{min-height:46px;height:46px}
}
/* A shallow side-by-side dock keeps a useful view in phone landscape. */
@media(max-height:500px) and (min-width:601px){
 .game-screen .hud-top{top:max(6px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:auto;width:280px;max-width:40vw}
 .game-screen .top h1{padding:6px 8px;font-size:12px;line-height:20px}
 .game-screen .goal{margin-top:2px;padding:6px 8px;max-width:100%;gap:2px 6px}
 .game-screen .goal-line h2{font-size:12px}
 .game-screen .goal p{font-size:10px;max-width:250px}
 .game-screen .tabs{margin-top:3px;max-width:100%}
 .game-screen .tabs button{min-height:30px;padding:4px 7px;font-size:10px}
 .game-screen .scenario-caption{display:none}
 .game-screen .camera-tools{top:max(5px,env(safe-area-inset-top));right:max(7px,env(safe-area-inset-right));transform:none;flex-direction:row}
 .game-screen .scene-gesture{top:52px;right:max(12px,env(safe-area-inset-right));left:auto;bottom:auto;transform:none;font-size:8px;padding:3px 7px}
 .game-screen.play-screen .hud-bottom{max-width:740px;width:calc(100% - 24px);display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);grid-template-rows:auto auto;gap:4px 9px;bottom:max(8px,env(safe-area-inset-bottom));align-items:end}
 .game-screen.play-screen .staff-title{grid-column:1;grid-row:1;min-height:27px;font-size:10px}
 .game-screen .staff-title #hint{min-height:28px!important;height:28px;font-size:10px!important;line-height:18px}
 .game-screen .staff-title>span{padding:3px 6px}
 .game-screen.play-screen .staff{grid-column:1;grid-row:2;gap:2px;padding:3px;justify-self:center;border-radius:15px}
 .game-screen .person{min-height:57px;padding:3px;grid-template-columns:25px minmax(0,1fr);border-radius:11px;max-width:none;gap:0 2px}
 .game-screen .person>.portrait{width:25px;height:25px}
 .game-screen .person strong{font-size:10px}
 .game-screen .person .skills{gap:1px}
 .game-screen .person .skills .icon{width:11px;height:11px}
 .game-screen .person .bars{font-size:8px;margin-top:2px;letter-spacing:-.03em}
 .game-screen .person .bars .icon{display:none}
 .game-screen .person .availability{margin-top:2px;gap:3px}
 .game-screen .person.selected{padding:3px}
 .game-screen.play-screen .time-tools{grid-column:2;grid-row:1;gap:4px}
 .game-screen .scene-time{padding:2px;gap:1px}
 .game-screen .scene-time button{min-height:34px;font-size:10px;padding:3px}
 .game-screen .scene-training{min-height:40px;min-width:47px;max-width:64px;font-size:10px;padding:3px}
 .game-screen .scene-training span{font-size:8px}
 .game-screen.play-screen .footer{grid-column:2;grid-row:2;align-self:stretch;align-items:end;gap:4px}
 .game-screen .footer button{height:44px;min-width:44px;padding:5px 8px;font-size:12px}
 .game-screen .feedback{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);width:max-content;max-width:70vw;font-size:10px;padding:5px 8px}
 .game-screen .storage-note{margin-top:3px;max-width:100%;font-size:9px}
 .game-screen .storage-note button{font-size:9px;min-height:28px}
 .game-screen.menu-screen .hud-bottom{max-width:274px;left:auto;right:20px;transform:none;bottom:15px;gap:6px}
 .game-screen .lobby-title h2{font-size:26px}
 .game-screen .lobby-title small{font-size:9px;margin-top:3px}
 .game-screen .continue{height:44px;min-height:44px;font-size:15px}
 .game-screen #chooseLevels{font-size:11px;min-height:40px;padding:3px 15px}
 .game-screen .campaign-progress{font-size:9px}
 .game-screen .scene-label{padding:4px 7px}
 .game-screen .scene-label .scene-label-name{font-size:10px}
 dialog#panel{max-height:calc(100dvh - 16px);width:min(540px,calc(100% - 32px))}
 #panel .panel-head{min-height:50px;padding:3px 10px 3px 13px}
 #panel .panel-body{padding:10px 12px}
}
@media(prefers-reduced-motion:reduce){.game-screen button{transition:none}}
