.kb-workshop{padding:10px 12px 12px;background:#f5e9c988;min-height:0}.kb-bar{display:flex;justify-content:space-between;align-items:center;padding:0 5px 7px;color:#6b7858;font-size:11px}.kb-bar>div{display:flex;gap:6px}.kb-tool{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;min-width:43px;min-height:44px;padding:3px 5px;border:1px solid #d3bd96;border-radius:11px;background:linear-gradient(#fff7e1,#e4d1aa);box-shadow:0 2px #c5ae85;color:#617750;font:inherit;cursor:pointer;touch-action:manipulation}.kb-tool>.kg-art{width:35px;height:35px}.kb-tool>small{font-size:9px;line-height:1.2;white-space:nowrap}.kb-tool b{position:absolute;right:-4px;top:-5px;min-width:20px;height:20px;border:2px solid #fff1d2;border-radius:20px;background:#91a36f;color:#fff9df;font-size:10px;display:grid;place-items:center}.kb-tool.selected{background:#d9e5bf;border-color:#90a377}.kb-tool:active{translate:0 2px;box-shadow:none}.kb-main{background:linear-gradient(#e6edcd,#bfd09f);border-color:#afbe8f;min-width:61px}.kb-materials{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:8px;flex-wrap:wrap;padding:8px;border:1px solid #fff0d0;border-radius:14px;background:linear-gradient(#f8eacd,#e4ceaa)}.kb-materials>.kb-tool>.kg-art{width:43px;height:43px}.kb-materials>.kb-tool{min-width:52px;min-height:54px}.kb-work-area{min-width:0}.kb-board{width:100%;display:block;max-height:calc(100dvh - 360px);touch-action:none}.kb-board .kb-piece{pointer-events:all}.kb-board polygon{stroke-linecap:round}.kb-board .kb-piece.selected{filter:drop-shadow(0 0 4px #f6e7bc)}.kb-with-picture{display:grid;grid-template-columns:170px minmax(0,1fr);gap:10px;align-items:center}.kb-with-picture .kb-board{max-height:calc(100dvh - 330px)}.kb-picture-card{position:relative;padding:12px 6px;border:5px solid #c9ad83;border-radius:10px;background:#fff4d8;box-shadow:0 5px 8px #82704a2a;rotate:-2deg;cursor:zoom-in;color:#687554;font:inherit}.kb-picture-card>small{font-size:10px}.kb-picture-card>strong{display:block;font-size:12px;margin-top:5px}.kb-picture-card>span{position:absolute;right:5px;bottom:4px;font-size:24px;color:#a0865f}.kb-reference-svg{display:block;width:100%;height:auto;max-height:330px}.kb-block-source{position:relative;width:60px;height:63px;flex:none;border:1px solid #c6ad84;border-radius:12px;background:#f5e6c6;box-shadow:0 3px #c9af85;cursor:pointer}.kb-block-source>svg{width:100%;height:100%;pointer-events:none}.kb-block-source>b{position:absolute;right:-3px;top:-4px;min-width:21px;height:21px;border-radius:50%;background:#92a275;color:#fff4cf;font-size:11px;display:grid;place-items:center}.kb-block-source.selected{outline:2px solid #839962;outline-offset:2px}.kb-reference-large{position:absolute;inset:18px;z-index:15;display:flex;flex-direction:column;align-items:center;justify-content:center;border:8px solid #c8a57b;border-radius:18px;background:#fff3d6f7;box-shadow:0 6px 25px #5d4e344d;color:#5e7450}.kb-reference-large>.kb-reference-svg{width:min(100%,650px);max-height:78%}.kb-reference-large>button{position:absolute;right:8px;top:8px;width:44px;height:44px;border:1px solid #cfb78d;border-radius:12px;background:#fff7e6;color:#7d7154;font-size:25px;cursor:pointer}.kb-reference-large>strong{font-size:20px}.kb-catalog{position:absolute;inset:12px;z-index:20;display:flex;flex-direction:column;gap:10px;padding:14px;border:5px solid #c8ad82;border-radius:17px;background:#fff4d9;box-shadow:0 6px 25px #5d4e3455;color:#5b714f}.kb-catalog>header{display:flex;align-items:center;justify-content:space-between}.kb-level-grid{overflow:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-content:start;padding:3px}.kb-level-grid>button{position:relative;min-width:0;border:1px solid #d4be96;border-radius:12px;padding:6px;background:linear-gradient(#fffbe9,#eadab5);box-shadow:0 3px #d2bb8f;cursor:pointer;font:inherit;color:#5c704f}.kb-level-grid .kb-reference-svg{height:117px;max-height:117px}.kb-level-grid>button>span{display:block;font-size:11px;line-height:1.5;padding:5px 0}.kb-level-grid>button>i{position:absolute;right:8px;top:5px;color:#8fa26e;font-style:normal}.kb-map-thumb{height:112px;display:flex!important;flex-direction:column;align-items:center;justify-content:center;background:#d9e3bf}.kb-map-thumb>.kg-art{width:65px;height:65px}.kb-map-thumb>b{font-size:13px}.kg-story-pages>.kb-chapter-button{display:flex;border-radius:20px;gap:5px;padding:4px 8px;align-items:center}.kb-chapter-button>.kg-art{width:28px;height:28px}.kb-chapter-button>b{font-size:12px}
.kg-overlay:has(.kg-window-rail){padding:0}.kg-overlay:has(.kg-window-rail)>#kg-content{width:100%;height:100%;max-height:100%;padding:0;overflow:hidden}.kg-window-rail{height:100%;max-height:100dvh;border-radius:0;max-width:none;display:flex}.kg-window-rail .kg-window-head{padding:7px 12px 4px;min-height:48px}.kg-window-rail .kg-window-head h2{font-size:20px}.kg-window-rail .kg-window-head small{font-size:9px}.kg-window-rail .kg-goal{margin:0 10px 5px;padding:3px 7px;min-height:34px}.kg-window-rail .kg-goal>span,.kg-window-rail .kg-goal .kg-portrait{width:28px;height:28px}.kg-window-rail .kg-goal p{font-size:11px;line-height:1.4}.kg-window-rail .kg-window-foot{min-height:48px;padding:4px 10px}.kg-window-rail .kg-window-foot .kg-teacher-help{min-height:40px}.kg-window-rail .kg-game-scene{overflow:hidden;display:flex;background:#eae2c4}.kb-rail{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}.kb-route-stations{display:flex;gap:5px;justify-content:center;padding:4px 8px;min-height:44px;flex:none;background:#f3ecd1}.kb-route-stations>button{display:flex;gap:4px;align-items:center;min-height:37px;border:1px solid #d6c49d;border-radius:10px;background:#fff5da;color:#6e7957;cursor:pointer;font:inherit;padding:3px 6px}.kb-route-stations .kg-art{width:27px;height:27px}.kb-route-stations span{font-size:10px}.kb-route-stations b{font-size:11px;color:#8d7d58}.kb-map-wrap{position:relative;flex:1;min-height:0}.kb-map-scroll{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;background:radial-gradient(#f7f0da,#e4dec0)}.kb-rail-board{display:block;height:auto;max-height:none;min-width:540px;margin:0 auto;touch-action:none;font-family:inherit}.kb-rail-board text{font:12px inherit;fill:#7e8062;pointer-events:none}.kb-rail-board g[data-rail-cell]{cursor:crosshair}.kb-rail-board [data-rail-cell] rect,.kb-rail-board [data-rail-cell] path{pointer-events:all}.kb-rail-board [data-rail-cell]:focus-visible{outline:2px solid #80955d}.kb-map-station{cursor:pointer}.kb-map-station text{font-size:11px;fill:#657350;font-weight:800}.kb-train{pointer-events:none;filter:drop-shadow(0 2px 2px #68583866)}.kb-rail-tools{display:flex;justify-content:center;gap:6px;padding:5px 7px 7px;flex-wrap:wrap;background:linear-gradient(#f7edce,#e3d2ac);border-top:1px solid #fff4d9;flex:none}.kb-rail-tools .kb-tool{min-width:42px;min-height:44px}.kb-rail-tools .kb-tool>.kg-art{width:32px;height:32px}.kb-station-card{position:absolute;z-index:5;right:12px;top:10px;width:242px;padding:13px;border:4px solid #ccb086;border-radius:15px;background:#fff3d9f7;box-shadow:0 5px 20px #70603d55;color:#62754e}.kb-station-card>strong{font-size:17px;display:block;padding-right:25px}.kb-station-card>p{font-size:12px;line-height:1.5;margin:7px 0}.kb-station-card>small{font-size:11px}.kb-info-close{position:absolute;right:4px;top:4px;width:36px;height:36px;border:1px solid #c7b184;border-radius:10px;background:#fff7e5;font-size:23px;color:#8d7f5a;cursor:pointer}.kb-target{display:flex;align-items:center;gap:5px;padding:5px 7px;border-radius:8px;background:#e3e9c9;font-size:13px}.kb-target .kg-art{width:32px;height:32px}.kb-target>span{margin-left:auto}.kb-station-stock{margin:8px 0;min-height:53px}.kb-station-stock>small{font-size:10px}.kb-station-stock>div{display:flex;gap:2px;flex-wrap:wrap;min-height:37px;border-bottom:3px solid #d2b98e}.kb-station-stock button{width:37px;height:37px;padding:0;border:0;background:none;cursor:pointer}.kb-station-stock .kg-art{width:37px;height:37px}.kb-station-card>.kb-main{margin:8px auto 0;width:70px}
@media(max-width:650px){.kb-with-picture{grid-template-columns:1fr}.kb-picture-card{display:flex;align-items:center;gap:10px;padding:5px;border-width:3px;rotate:0;max-height:112px}.kb-picture-card .kb-reference-svg{width:130px;max-height:95px}.kb-picture-card>strong{font-size:12px}.kb-picture-card>small{font-size:9px}.kb-board,.kb-with-picture .kb-board{max-height:none}.kb-materials{gap:6px;padding:7px}.kb-block-source{width:43px;height:48px}.kb-materials>.kb-tool{min-width:43px;min-height:46px}.kb-level-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.kb-level-grid .kb-reference-svg{height:100px}.kb-catalog{inset:5px;padding:8px;border-width:3px}.kb-route-stations{overflow-x:auto;justify-content:flex-start}.kb-route-stations>button{flex:none}.kb-route-stations span{font-size:9px}.kb-rail-tools{gap:4px}.kb-rail-tools .kb-tool{min-width:35px;min-height:39px;padding:2px}.kb-rail-tools .kb-tool>.kg-art{width:28px;height:28px}.kb-rail-tools .kb-tool>small{font-size:8px}.kb-station-card{right:6px;top:6px;width:220px}.kg-window-rail .kg-held-object{display:none}.kg-window-rail .kg-window-foot .kg-play-notice{font-size:10px}}
@media(max-height:540px) and (orientation:landscape){.kg-window-rail .kg-goal{display:none}.kg-window-rail .kg-window-head{min-height:42px;padding:3px 8px}.kg-window-rail .kg-window-head h2{font-size:17px}.kb-route-stations{min-height:33px;padding:2px 6px}.kb-route-stations>button{min-height:28px}.kb-route-stations .kg-art{width:23px;height:23px}.kb-rail-tools .kb-tool{min-height:37px}.kb-rail-tools .kb-tool>.kg-art{width:27px;height:27px}.kb-rail-tools .kb-tool>small{font-size:8px}.kg-window-rail .kg-window-foot{min-height:43px}.kb-station-card{max-height:calc(100dvh - 90px);overflow:auto}.kb-board,.kb-with-picture .kb-board{max-height:none}.kb-with-picture{grid-template-columns:145px minmax(0,1fr)}}
.kg-overlay:has(.kg-window-shadow),.kg-overlay:has(.kg-window-blocks){padding:0}.kg-overlay:has(.kg-window-shadow)>#kg-content,.kg-overlay:has(.kg-window-blocks)>#kg-content{width:100%;height:100%;max-height:100%;padding:0;overflow:hidden}.kg-window-shadow,.kg-window-blocks{height:100%;max-height:100dvh;border-radius:0;max-width:none}.kg-window-shadow .kg-window-head,.kg-window-blocks .kg-window-head{padding:7px 12px 4px;min-height:48px}.kg-window-shadow .kg-window-head h2,.kg-window-blocks .kg-window-head h2{font-size:21px}.kg-window-shadow .kg-goal,.kg-window-blocks .kg-goal{margin:0 10px 5px;padding:3px 7px;min-height:34px}.kg-window-shadow .kg-goal p,.kg-window-blocks .kg-goal p{font-size:11px}.kg-window-shadow .kg-window-foot,.kg-window-blocks .kg-window-foot{min-height:48px;padding:4px 10px}.kg-window-shadow .kg-game-scene,.kg-window-blocks .kg-game-scene{display:flex;overflow:hidden}.kb-workshop{height:100%;width:100%;display:flex;flex-direction:column;min-height:0}.kb-work-area{flex:1;min-height:0}.kb-bar,.kb-materials{flex:none}.kb-board,.kb-with-picture .kb-board{height:100%;max-height:none!important}.kb-reference-svg polygon{stroke-linejoin:round}.kb-rail-tools button:disabled{opacity:.4;cursor:default}.kb-rail-board text{font-family:inherit;font-size:12px}
/* Keep the SVG inside its allocated grid row, including tablet and phone sizes. */
.kb-with-picture{grid-template-rows:minmax(0,1fr);align-items:stretch}.kb-with-picture>.kb-picture-card{align-self:center}.kb-board{min-height:0;min-width:0}
@media(max-width:650px){.kb-with-picture{grid-template-rows:105px minmax(0,1fr);gap:6px}.kb-with-picture>.kb-picture-card{height:100%;margin:0}}
@media(max-height:540px) and (orientation:landscape){.kg-window-shadow .kg-goal,.kg-window-blocks .kg-goal{display:none}.kg-window-shadow .kg-window-head,.kg-window-blocks .kg-window-head{min-height:42px;padding:3px 8px}.kg-window-shadow .kg-window-head h2,.kg-window-blocks .kg-window-head h2{font-size:17px}.kb-workshop{padding:5px 8px 7px}.kb-bar{padding-bottom:4px}.kb-materials{margin-top:5px;padding:4px;gap:6px}.kb-block-source{width:43px;height:45px}.kb-materials>.kb-tool{min-width:43px;min-height:45px}.kb-with-picture{grid-template-rows:minmax(0,1fr)}}
.kb-rail-board .kb-station-name{font-size:8px;font-weight:800;fill:#766342}.kb-rail-board .kb-gate-label{font-size:10px;font-weight:800;fill:#7f7855}.kb-forest{pointer-events:none}.kb-river-ripples{animation:kb-river-flow 5s linear infinite;pointer-events:none}@keyframes kb-river-flow{to{stroke-dashoffset:-28}}@media(prefers-reduced-motion:reduce){.kb-river-ripples{animation:none}}
.kb-rail-board g[data-rail-cell]:has(path[stroke="#bd9b6d"]){cursor:pointer}
