/* GAMEX からくり解体屋 — steel cabinet and brass workshop console. */
.gx-karakuri{--kg-bg:#132831;--kg-cream:#ffedb6;--kg-gold:#cfaa63;--kg-safe-top:env(safe-area-inset-top,0px);--kg-safe-right:env(safe-area-inset-right,0px);--kg-safe-bottom:env(safe-area-inset-bottom,0px);--kg-safe-left:env(safe-area-inset-left,0px);color:var(--kg-cream);font-family:"MS Gothic","Yu Gothic",monospace;width:100%;margin:20px auto;max-width:820px;isolation:isolate}
.gx-karakuri *{box-sizing:border-box}.gx-karakuri [hidden]{display:none!important}.gx-karakuri button{font:inherit;font-size:13px;font-weight:700;line-height:1.35;min-width:44px;min-height:44px;margin:0;padding:8px 10px;border:2px solid #80999b;border-radius:0;background:#28434d;color:#fff0cb;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:inset 0 2px #49616a,inset 0 -3px #0c252d;text-shadow:1px 1px #10232e}
.gx-karakuri button:hover:not(:disabled){background:#385963}.gx-karakuri button:active:not(:disabled){transform:translateY(1px)}.gx-karakuri button:focus-visible,.kg-canvas:focus-visible{outline:3px solid #ffdf82;outline-offset:-4px}.gx-karakuri button:disabled{opacity:.45;cursor:default}.gx-karakuri button[aria-pressed=true]{border-color:#f6ce77;background:#315a61}
.kg-shell{background:#142e37;border:3px solid #57747b;border-radius:0;overflow:hidden;box-shadow:0 4px 0 #091c24,inset 0 0 0 2px #12232c}
.kg-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 12px;background:linear-gradient(#2c4650,#142d38);border-bottom:3px solid #0b1f29}.kg-brand strong{font-size:19px;color:#ffdfa0;white-space:nowrap;text-shadow:2px 2px #081923}.kg-brand small{display:block;font-size:9px;letter-spacing:.09em;color:#9db6bd}.kg-tools{display:flex;gap:5px;margin-left:auto}.kg-tools button{font-size:11px;padding:6px;min-width:44px}
.kg-hud{display:flex;justify-content:space-between;gap:5px;padding:7px 12px;background:#0e222a;border-bottom:2px solid #566c6e;font-size:12px}.kg-hud strong{font-size:19px;color:#ffe6a0;font-variant-numeric:tabular-nums}.kg-hud .kg-part{color:#a3e6ee}.kg-hud span{white-space:nowrap}
.kg-body{position:relative;width:100%;max-width:620px;margin:auto;aspect-ratio:1;background:#122832;min-height:0}.kg-canvas{display:block;width:100%;height:100%;touch-action:none}
.kg-panel{position:absolute;inset:12px;z-index:2;padding:22px;overflow:auto;overscroll-behavior:contain;background:linear-gradient(135deg,#1e3c48,#102733 75%);border:3px double #bda16a;box-shadow:0 0 0 3px #0a1c26,inset 0 0 0 2px #2a515c;text-align:center;scrollbar-width:thin;scrollbar-color:#aa9568 #18303b}
.kg-panel::before,.kg-panel::after{content:"";position:absolute;top:6px;width:6px;height:6px;background:#9babb0;box-shadow:1px 1px #091b25,inset 1px 1px #e7dcc1;pointer-events:none}.kg-panel::before{left:6px}.kg-panel::after{right:6px}
.gx-karakuri .kg-panel h2{color:#ffe6a6!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important;margin:8px 0 22px!important;font-family:inherit!important;font-size:27px!important;font-weight:900!important;line-height:1.3!important;text-align:center!important;text-indent:0!important;letter-spacing:.05em!important;text-shadow:2px 2px #0a1b24}
.gx-karakuri .kg-panel h2::before,.gx-karakuri .kg-panel h2::after{content:none!important;display:none!important}.gx-karakuri .kg-panel p{font-size:13px;line-height:1.6;margin:12px auto;color:#d8e4db;max-width:36em}.kg-subtitle{display:block;font-size:10px;letter-spacing:.18em;color:#b9c7c4}
.kg-shell:not([data-screen=playing]) .kg-brand,.kg-shell:not([data-screen=playing]) .kg-hud,.kg-shell:not([data-screen=playing]) .kg-note,.kg-shell:not([data-screen=playing]) .kg-controls,.kg-shell:not([data-screen=playing]) .kg-footer,.kg-shell:not([data-screen=playing]) .kg-head [data-act=pause]{display:none}
.kg-shell:not([data-screen=playing]) .kg-body{aspect-ratio:auto;max-width:620px;padding:14px}.kg-shell:not([data-screen=playing]) .kg-canvas{display:none}.kg-shell:not([data-screen=playing]) .kg-panel{position:relative;inset:auto;min-height:440px}
.kg-panel[data-kind=menu]{display:flex;flex-direction:column;justify-content:center;gap:0}.kg-title-art{margin:0 -16px 6px;position:relative}.kg-title-art .kg-subtitle{margin:2px 10px 8px;font-size:9px;letter-spacing:.12em}
.gx-karakuri .kg-panel .kg-title-logo{font-size:41px!important;line-height:1.08!important;letter-spacing:.08em!important;margin:8px auto 0!important;transform:skewY(-3deg);text-shadow:2px 2px #90683e,4px 4px #091c26,5px 5px #091c26}
.kg-title-logo span{display:block}.kg-title-logo span:first-child{font-size:.7em;letter-spacing:.18em;color:#d9eceb}.kg-title-logo span:last-child{color:#ffe0a0}.kg-title-scene{display:block;width:100%;height:auto;aspect-ratio:12/5;margin:6px auto 0;image-rendering:auto}
.kg-commands{display:flex;flex-direction:column;gap:4px;width:100%;max-width:330px;margin:12px auto}.gx-karakuri .kg-command{position:relative;width:100%;text-align:left;padding:11px 14px 11px 37px;min-height:48px;font-size:16px;background:#102934;border:2px solid transparent;box-shadow:none;text-shadow:2px 2px #091c28;letter-spacing:.06em;color:#ffedbe}
.gx-karakuri .kg-command:hover:not(:disabled){background:#102934}.gx-karakuri .kg-command.kg-cursor,.gx-karakuri .kg-command.kg-cursor:hover:not(:disabled){border-color:#f4d382;background:#2b4a52;box-shadow:inset 0 0 0 1px #162f3a}.kg-command::before{content:"";position:absolute;left:15px;top:50%;width:10px;height:10px;transform:translateY(-50%);background:#f6cf78;clip-path:polygon(0 0,50% 0,50% 25%,100% 50%,50% 75%,50% 100%,0 100%);opacity:0}.kg-command.kg-cursor::before{opacity:1;animation:kg-cursor-blink 1.3s steps(1,end) infinite}
@keyframes kg-cursor-blink{0%,65%,100%{opacity:1}70%,95%{opacity:.4}}
.gx-karakuri .kg-title-record{font-size:10px;margin:8px auto 4px;color:#d7d9c3;letter-spacing:.02em}.kg-menu-foot{font-size:8px;letter-spacing:.08em;color:#9cb0af;margin:12px auto 0;border-top:1px solid #506b70;padding-top:10px;max-width:330px;width:100%}
.kg-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;max-width:330px;margin:10px auto 25px}.kg-options button{font-size:13px;padding:8px 3px}.kg-setting-label{color:#e7c980!important;font-size:12px!important;letter-spacing:.12em}.kg-panel[data-kind=settings] .kg-commands{margin-top:20px}
.kg-stages{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:6px;max-width:390px;margin:16px auto}.gx-karakuri .kg-stages button{padding:4px;display:grid;place-content:center;gap:2px;font-size:15px;min-height:48px}.kg-stages small{font-size:9px;letter-spacing:0;color:#f4d183}.gx-karakuri .kg-stages .kg-cursor{outline:2px solid #fff0a9;outline-offset:-4px}.kg-job-name{font-size:14px!important;color:#f7e4ba!important;margin:10px auto 2px!important}.kg-difficulty-name{font-size:10px!important;color:#a8c0c0!important;margin:0 auto 10px!important}
.kg-panel[data-kind=paused],.kg-panel[data-kind=result],.kg-panel[data-kind=settings]{display:flex;flex-direction:column;justify-content:center}.kg-pause-job{font-size:12px!important;border-top:1px solid #496772;border-bottom:1px solid #496772;padding:12px 0;margin:0 auto 15px!important;width:100%}.kg-stars{font-size:32px;letter-spacing:8px;color:#f4cf78;text-shadow:2px 2px #7c5830}.kg-score{font-size:36px;color:#fff0bd;line-height:1.3;margin:10px 0;font-weight:900;text-shadow:2px 2px #091b23}.kg-result-stats{display:grid;grid-template-columns:1fr 1fr;width:min(100%,270px);gap:8px 16px;margin:12px auto;padding:12px 5px;border-block:1px solid #566e6d;font-size:12px}.kg-result-stats dt{text-align:left;color:#a8c1c1}.kg-result-stats dd{margin:0;text-align:right;color:#fff0bd}.kg-total{font-size:13px!important;color:#e8d9ad!important}.kg-warning{color:#ffba95!important;font-size:12px!important}
.kg-note{display:flex;align-items:center;justify-content:center;min-height:29px;padding:5px 10px;background:#132c34;font-size:12px;color:#daceaa;text-align:center}.kg-note[data-kind=warning]{color:#ffdb9e;background:#59362e}.kg-controls{display:grid;grid-template-columns:144px minmax(0,1fr);gap:12px;padding:12px 16px;background:linear-gradient(#304952,#1a333c);border-top:3px solid #617371;align-items:center}.kg-pad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:5px;justify-content:center}.kg-pad button{padding:0;font-size:23px;touch-action:none}.kg-up{grid-column:2}.kg-left{grid-column:1;grid-row:2}.kg-down{grid-column:2;grid-row:2}.kg-right{grid-column:3;grid-row:2}.kg-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.kg-actions button{height:66px;font-size:14px}.gx-karakuri .kg-bomb{background:#ad683c;border-color:#f1bf76;box-shadow:inset 0 2px #d39960,inset 0 -3px #633c2d}.kg-footer{display:flex;justify-content:flex-end;align-items:center;min-height:26px;padding:5px 12px;color:#a7bdb6;font-size:10px}.kg-footer span{overflow-wrap:anywhere}.kg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.kg-shell.kg-expanded,.kg-shell:fullscreen{position:fixed;inset:0;z-index:2147483600;width:100%;height:100dvh;max-width:none;border:0;border-radius:0;padding:var(--kg-safe-top) var(--kg-safe-right) var(--kg-safe-bottom) var(--kg-safe-left);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto auto auto;align-items:stretch;background:#112b35;overflow:hidden}.kg-shell.kg-expanded>*,.kg-shell:fullscreen>*{min-width:0}.kg-shell.kg-expanded .kg-head,.kg-shell:fullscreen .kg-head{padding:5px 10px}.kg-shell.kg-expanded .kg-hud,.kg-shell:fullscreen .kg-hud{padding:4px 10px}.kg-shell.kg-expanded .kg-body,.kg-shell:fullscreen .kg-body{width:100%;height:100%;max-width:none;aspect-ratio:auto;container-type:size;overflow:hidden;display:grid;place-items:center;padding:0}.kg-shell.kg-expanded .kg-canvas,.kg-shell:fullscreen .kg-canvas{width:min(100cqw,100cqh);height:min(100cqw,100cqh)}.kg-shell.kg-expanded .kg-controls,.kg-shell:fullscreen .kg-controls{padding:6px 10px;max-width:660px;width:100%;justify-self:center}.kg-shell.kg-expanded .kg-footer,.kg-shell:fullscreen .kg-footer{min-height:20px;padding:2px 10px}
.kg-shell.kg-expanded:not([data-screen=playing]),.kg-shell:fullscreen:not([data-screen=playing]){display:flex;flex-direction:column}.kg-shell.kg-expanded:not([data-screen=playing]) .kg-body,.kg-shell:fullscreen:not([data-screen=playing]) .kg-body{flex:1;min-height:0}.kg-shell.kg-expanded:not([data-screen=playing]) .kg-panel,.kg-shell:fullscreen:not([data-screen=playing]) .kg-panel{position:absolute;inset:8px;min-height:0;width:auto;max-width:620px;margin:0 auto}.kg-shell.kg-expanded .kg-panel[data-kind=menu],.kg-shell:fullscreen .kg-panel[data-kind=menu]{justify-content:center}
@media(max-width:480px){.kg-head{padding:6px 8px}.kg-brand strong{font-size:16px}.kg-brand small{font-size:7px}.kg-tools{gap:3px}.kg-tools button{font-size:10px;padding:4px}.kg-hud{font-size:10px;padding:6px 8px}.kg-hud strong{font-size:16px}.kg-controls{gap:8px;padding:9px 8px;grid-template-columns:142px minmax(0,1fr)}.kg-actions{gap:4px}.kg-actions button{font-size:11px;padding:4px}.kg-shell:not([data-screen=playing]) .kg-body{padding:12px}.kg-panel{padding:20px 12px}.gx-karakuri .kg-panel h2{font-size:23px!important}.gx-karakuri .kg-panel .kg-title-logo{font-size:40px!important}.kg-title-art{margin-inline:-7px}.gx-karakuri .kg-command{font-size:14px;padding-left:33px}.kg-command::before{left:12px}.kg-stages{grid-template-columns:repeat(4,minmax(44px,1fr));gap:5px}.kg-options button{font-size:12px}.kg-panel[data-kind=select] .kg-commands{margin-block:8px}.kg-menu-foot{font-size:7px}.kg-score{font-size:32px}}
@media(orientation:landscape) and (max-height:600px){.kg-shell:not([data-screen=playing]) .kg-panel[data-kind=menu]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:1fr auto auto;align-items:center;column-gap:20px;min-height:300px;padding:14px 20px}.kg-panel[data-kind=menu] .kg-title-art{grid-row:1 / 4;margin:0}.kg-panel[data-kind=menu] .kg-commands{margin:0;grid-column:2}.kg-panel[data-kind=menu] .kg-title-record{grid-column:2;margin:6px 0!important}.kg-panel[data-kind=menu] .kg-menu-foot{grid-column:2;margin:4px 0 0;padding-top:6px}.gx-karakuri .kg-panel .kg-title-logo{font-size:36px!important}.kg-title-scene{margin-top:10px}.kg-shell.kg-expanded[data-screen=playing],.kg-shell:fullscreen[data-screen=playing]{grid-template-columns:minmax(0,1fr) 210px;grid-template-rows:auto auto minmax(0,1fr) auto}.kg-shell.kg-expanded .kg-head,.kg-shell:fullscreen .kg-head{grid-column:1 / 3}.kg-shell.kg-expanded .kg-hud,.kg-shell:fullscreen .kg-hud{grid-column:2;grid-row:2;flex-wrap:wrap}.kg-shell.kg-expanded[data-screen=playing] .kg-body,.kg-shell:fullscreen[data-screen=playing] .kg-body{grid-column:1;grid-row:2 / 5}.kg-shell.kg-expanded .kg-controls,.kg-shell:fullscreen .kg-controls{grid-column:2;grid-row:3;grid-template-columns:1fr;gap:5px;padding:3px 8px;align-content:center;border-top:0}.kg-shell.kg-expanded .kg-actions,.kg-shell:fullscreen .kg-actions{gap:5px}.kg-shell.kg-expanded .kg-actions button,.kg-shell:fullscreen .kg-actions button{height:44px;font-size:11px}.kg-shell.kg-expanded .kg-note,.kg-shell:fullscreen .kg-note{grid-column:2;grid-row:4;font-size:10px;min-height:23px}.kg-shell.kg-expanded .kg-footer,.kg-shell:fullscreen .kg-footer{display:none}.kg-shell.kg-expanded:not([data-screen=playing]) .kg-panel[data-kind=menu],.kg-shell:fullscreen:not([data-screen=playing]) .kg-panel[data-kind=menu]{min-height:0;padding:10px 20px}.kg-shell.kg-expanded .kg-panel[data-kind=menu] .kg-title-scene,.kg-shell:fullscreen .kg-panel[data-kind=menu] .kg-title-scene{max-height:140px;object-fit:contain}.kg-shell.kg-expanded .kg-panel:not([data-kind=menu]),.kg-shell:fullscreen .kg-panel:not([data-kind=menu]){justify-content:flex-start}.kg-shell.kg-expanded .kg-panel h2,.kg-shell:fullscreen .kg-panel h2{margin-bottom:12px!important}}
@media(max-height:520px){.kg-shell.kg-expanded .kg-head,.kg-shell:fullscreen .kg-head{padding:2px 8px}.kg-shell.kg-expanded .kg-hud,.kg-shell:fullscreen .kg-hud{padding:2px 10px;line-height:18px}.kg-shell.kg-expanded .kg-hud strong,.kg-shell:fullscreen .kg-hud strong{font-size:15px}.kg-shell.kg-expanded .kg-footer,.kg-shell:fullscreen .kg-footer{display:none}}
@media(prefers-reduced-motion:reduce){.gx-karakuri *,.gx-karakuri *::before,.gx-karakuri *::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
