:root{--bg:#0e2038;--panel:#142b45;--panel2:#193958;--ink:#f4fbff;--muted:#c0d4e4;--gold:#ffce58;--aqua:#47d8ed;--stroke:#417195;--shadow:0 12px 35px #02091665}*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden;font-family:system-ui,-apple-system,'Segoe UI',Arial,sans-serif;color:var(--ink);background:var(--bg);-webkit-tap-highlight-color:transparent}body{user-select:none}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;border:1px solid #5d89a8;background:linear-gradient(#274969,#153550);border-radius:12px;padding:9px 14px;font-weight:750;letter-spacing:.01em;white-space:normal;min-height:37px;box-shadow:0 2px 0 #081a2e}button:hover:not(:disabled){filter:brightness(1.16)}button:active:not(:disabled){transform:translateY(1px);box-shadow:none}button:focus-visible{outline:3px solid #fbc84b;outline-offset:2px}button:disabled{opacity:.36;cursor:not-allowed}button.primary,.start-btn{color:#213044;border-color:#ffdb88;background:linear-gradient(160deg,#ffe87c,#ffb944);box-shadow:0 3px 0 #a87816}button.big{font-size:16px;padding:12px 17px}button.small{padding:6px 10px;min-height:34px}#app{width:100%;height:100%;height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:radial-gradient(circle at 50% 0,#254768,#0b1a32 70%)}#topbar{height:47px;min-height:47px;display:flex;gap:10px;align-items:center;padding:4px max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left));border-bottom:1px solid #466786;background:#10263d}.brand{font-size:17px;background:transparent;border:0;box-shadow:none;padding:4px 3px;font-weight:950;white-space:nowrap}.top-status{font-weight:800;font-size:12px;color:#ffdc8b;margin-left:auto;white-space:nowrap}.top-buttons{display:flex;gap:5px}#main{min-height:0;flex:1;position:relative;display:flex}.screen{display:none;width:100%;height:100%;min-height:0}.screen.visible{display:flex}.home{align-items:stretch;justify-content:center;background:#1a456a url('cover_bg.jpg') center 46%/cover no-repeat}.hero{display:flex;align-items:center;flex:1;background:linear-gradient(90deg,#081b32ea 0%,#0a2845da 35%,#0b28415c 66%,#0b284110 100%);padding:clamp(12px,3vw,40px)}.home-text{max-width:525px}.eyebrow{color:#6de7ef;font-size:12px;font-weight:900;letter-spacing:.14em}.home-text h1{font-size:clamp(29px,4.6vw,61px);margin:8px 0 12px;font-weight:1000;line-height:1.02;letter-spacing:-.045em;text-shadow:0 3px 9px #0008}.home-text h1 span{display:block;color:#ffda5e;font-size:.58em;letter-spacing:0;margin-top:7px}.home-text p{max-width:460px;font-size:clamp(13px,1.8vw,17px);font-weight:600;color:#e7f8ff;text-shadow:0 2px 8px #000}.home-actions{display:flex;gap:8px;flex-wrap:wrap;max-width:490px;margin-top:23px}.home-actions button{font-size:13px}.home-actions .big{font-size:17px}.home-progress{margin-top:19px;font-size:12px;color:#c8f5fc;font-weight:750}.panel-screen{overflow-y:auto;display:none;padding:12px;align-items:flex-start;justify-content:center}.panel-screen.visible{display:flex}#panelContent{width:min(100%,1040px);margin:auto}.panel-title{font-size:clamp(20px,3vw,32px);margin:0 0 6px}.panel-desc{font-size:13px;color:var(--muted);line-height:1.55;margin:4px 0 16px}.panel-header{display:flex;gap:10px;align-items:center;margin-bottom:10px;flex-wrap:wrap}.cardgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(175px,1fr));gap:10px}.cardgrid.levelgrid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.panel-card{background:linear-gradient(142deg,#23496d,#122a46);border:1px solid #4c789d;border-radius:14px;padding:13px;box-shadow:var(--shadow);min-width:0}.panel-card h3{margin:3px 0 8px;font-size:16px;color:#f9f7e4}.panel-card p{font-size:12px;color:#cddae5;margin:4px 0 12px;line-height:1.5}.panel-card button{width:100%;margin-top:5px}.panel-card.locked{opacity:.5}.tiny{font-size:11px;color:#bad2e0}.accent{color:var(--gold)}.medal{font-size:22px}.panel-buttons{display:flex;gap:8px;flex-wrap:wrap}.play-screen{flex-direction:column;min-height:0}#gameHeading{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:6px 12px 4px;min-height:43px;background:#13324d}.level-info{display:flex;flex-direction:column;gap:0;min-width:0}.level-info b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.level-info small{font-size:10px;color:#a3d7dd}.stats-line{display:flex;gap:13px;font-size:11px;font-weight:750;align-items:center;flex-wrap:wrap;justify-content:flex-end}#stabilityInfo{color:#b3f5b3}#gameView{flex:1;min-height:65px;position:relative;display:flex;align-items:center;justify-content:center;background:#182c43;overflow:hidden;touch-action:none}#gameCanvas{width:100%;height:100%;display:block;touch-action:none;object-fit:contain;cursor:crosshair}#gameToast{position:absolute;left:50%;top:12%;transform:translateX(-50%);max-width:90%;font-size:clamp(12px,1.7vw,20px);font-weight:800;color:#fff;pointer-events:none;padding:9px 16px;border-radius:14px;background:#102743d6;box-shadow:var(--shadow);opacity:0;transition:opacity .2s;text-align:center}#gameToast.show{opacity:1}.game-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#061831b4;overflow-y:auto;padding:8px}.game-overlay.hidden{display:none}.result-card{width:min(93%,500px);max-height:100%;overflow:auto;border-radius:17px;padding:clamp(12px,2vw,22px);text-align:center;background:linear-gradient(#274d73,#102842);border:1px solid #76b3d9;box-shadow:0 25px 55px #000b}.result-card h2{font-size:clamp(18px,2.3vw,29px);margin:3px 0 8px}.result-card p{font-size:12px;line-height:1.45;margin:6px 0;color:#dfe9f1}.result-card .gold{color:#ffdc64;letter-spacing:.07em;font-size:28px}.result-actions{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin-top:12px}.result-actions button{font-size:12px}.objective{text-align:center;font-size:12px;line-height:1.25;font-weight:650;color:#effbff;background:#142b41;padding:5px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-top:1px solid #325579}#playToolbar{background:#102943;border-top:1px solid #2f5878;display:flex;flex-direction:column;gap:5px;padding:5px 7px 7px}.tool-group{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;flex-wrap:wrap}.tool-group button{padding:5px 10px;min-height:34px;font-size:11px}.tool-group button.selected{background:linear-gradient(#47acc1,#237b98);border-color:#6deeff}.tool-group.bottom-buttons{flex-wrap:nowrap}.tool-group.bottom-buttons button{flex:1 1 0;min-width:0;padding:7px 5px;font-size:12px}.tool-group.bottom-buttons .start-btn{flex:1.6 1 0;font-size:14px}#footer{height:21px;min-height:21px;display:flex;align-items:center;justify-content:space-between;padding:0 12px;font-size:10px;color:#a7c3d5;background:#0b1e33}#footer span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selected-color{outline:3px solid #ffd55c;outline-offset:1px}input[type=range]{width:100%;accent-color:#35c0e2}select{font:inherit;background:#204260;color:white;border:1px solid #72a4c2;border-radius:8px;padding:8px;max-width:100%}.colorchip{display:inline-block;width:23px;height:23px;border-radius:50%;border:2px solid #ffffff9a;margin:2px}.notification{background:#24455d;border-radius:12px;padding:12px;margin:8px 0}.hidden{display:none!important}@media(max-width:600px){#topbar{height:42px;min-height:42px;gap:5px}.brand{font-size:14px}.brand span{display:none}.top-status{font-size:11px}.top-buttons button{min-height:30px;padding:4px 8px}.home{background-position:58% center}.hero{background:linear-gradient(90deg,#061b34ed 0%,#102c4fcf 60%,#15334b8c)}.home-text h1{font-size:32px}.home-text p{font-size:13px}.home-actions{gap:7px;margin-top:13px}.home-actions button{min-height:36px;padding:6px 8px;font-size:12px}.home-actions .big{font-size:14px}.eyebrow{font-size:10px}#gameHeading{padding:4px 7px;min-height:45px;gap:5px}.level-info b{font-size:12px;max-width:130px}.stats-line{gap:4px 8px;font-size:10px}#stabilityInfo{display:none}#playToolbar{padding:3px;gap:3px}.tool-group{gap:3px}.tool-group button{padding:4px 5px;font-size:10px;min-height:31px}.tool-group.bottom-buttons{flex-wrap:wrap}.tool-group.bottom-buttons button{flex:1 0 calc(25% - 4px);font-size:10px;min-height:31px;padding:4px 2px}.tool-group.bottom-buttons button span{display:none}.tool-group.bottom-buttons .start-btn{flex:2 0 calc(45% - 4px);font-size:13px}.objective{font-size:10px;padding:5px 8px;white-space:normal;max-height:35px}#footer{height:17px;min-height:17px;font-size:9px}#footer span:first-child{display:none}.panel-screen{padding:7px}.cardgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.panel-card{padding:9px}.panel-card h3{font-size:13px}.panel-card button{font-size:12px}.result-card{padding:12px}.result-card .gold{font-size:24px}}@media(max-height:505px){#topbar{height:38px;min-height:38px}#gameHeading{min-height:34px;padding:2px 8px}.objective{font-size:10px;padding:3px}.tool-group button{min-height:28px;padding:3px 6px}#playToolbar{gap:2px;padding:2px 6px 3px}.tool-group.bottom-buttons button{min-height:29px}#footer{height:15px;min-height:15px}.hero{padding:10px 20px}.home-text h1{font-size:clamp(24px,3vw,38px);margin:4px 0}.home-text p{margin:7px 0;font-size:12px}.home-actions{margin-top:9px}.home-actions button{min-height:31px;padding:5px 9px}.home-progress{margin-top:8px}}
