:root{color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#11131b;color:#f4f1e9;font-synthesis:none;text-rendering:optimizeLegibility}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;background:#11131b}
body{overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer}
.shell{width:100%;max-width:none;height:100dvh;margin:0;padding:calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 9px) calc(env(safe-area-inset-left) + 16px);display:flex;flex-direction:column;gap:12px;background:radial-gradient(ellipse at 18% 12%,rgba(231,166,91,.09),transparent 38%),#11131b}
.header{display:flex;align-items:center;justify-content:space-between;gap:18px;flex:0 0 auto;min-height:48px}
.brand{color:#f4f1e9;text-decoration:none;font-size:21px;font-weight:950;letter-spacing:.06em;white-space:nowrap}
.brand .i1{color:#f28d68}.brand .i2{color:#f2c66d}.brand .i3{color:#72c9c2}.brand .i4{color:#a99be9}
.brand small{display:block;margin-top:1px;color:#7f817f;font-size:7px;letter-spacing:.35em}
.stats{display:flex;gap:clamp(14px,3vw,38px)}
.stats div{display:grid;gap:3px}.stats small{color:#8e918e;font-size:8px;font-weight:850;letter-spacing:.16em}.stats b{font-size:clamp(12px,1.7vw,16px);font-variant-numeric:tabular-nums}
.game{display:grid;grid-template-columns:minmax(0,1fr) 226px;gap:13px;flex:1;min-height:0}
.stage{position:relative;align-self:stretch;width:100%;height:100%;min-height:0;aspect-ratio:auto;max-height:none;overflow:hidden;border:1px solid rgba(229,190,133,.2);border-radius:15px;background:#20232a;box-shadow:0 18px 60px rgba(0,0,0,.28)}
canvas{display:block;width:100%;height:100%;touch-action:none}
.toast{position:absolute;left:14px;top:12px;padding:7px 10px;border:1px solid rgba(255,255,255,.1);border-radius:7px;background:rgba(16,18,23,.7);color:#d8c5a4;font-size:8px;font-weight:900;letter-spacing:.15em;pointer-events:none}
.side{display:flex;flex-direction:column;gap:9px;min-height:0;padding:14px;border:1px solid rgba(229,190,133,.15);border-radius:14px;background:rgba(30,32,38,.86)}
.side-head{display:flex;justify-content:space-between;gap:6px;color:#c5ad87;font-size:8px;font-weight:900;letter-spacing:.13em}.side-head span:last-child{color:#92928c}
.tools{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.tool{min-width:0;padding:10px 6px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:#272a31;color:#f2eee5;text-align:left}
.tool b{display:block;font-size:11px}.tool small{display:block;margin-top:5px;color:#92948e;font-size:7px;font-weight:800;white-space:nowrap}
.tool.active{border-color:#d6a76c;background:rgba(198,139,76,.16);box-shadow:inset 0 0 0 1px rgba(214,167,108,.12)}
.ignite{padding:14px;border:0;border-radius:9px;background:linear-gradient(100deg,#e9a35f,#e6c477);color:#211b14;font-size:12px;font-weight:950;letter-spacing:.16em;box-shadow:0 7px 22px rgba(211,149,82,.16)}
.ignite span{float:right;font-size:17px;line-height:12px}.ignite:disabled{opacity:.4}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.actions button,.bottom-actions button{padding:10px 5px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#252830;color:#d6d4ce;font-size:8px;font-weight:850;letter-spacing:.06em}
.divider{height:1px;background:rgba(255,255,255,.1);margin:3px 0}
.mode-row{display:flex;align-items:center;justify-content:space-between;gap:5px}.mode-row strong{color:#b9b8b1;font-size:8px;letter-spacing:.13em}.mode-row button{padding:7px 9px;border:1px solid rgba(255,255,255,.12);border-radius:7px;background:#272a31;color:#c9c4b8;font-size:8px;font-weight:900}
.material-row{display:none;grid-template-columns:repeat(3,1fr);gap:5px}.material-row.visible{display:grid}.material{padding:8px 2px;border:1px solid rgba(255,255,255,.1);border-radius:6px;background:#252830;color:#a8a8a0;font-size:7px;font-weight:900}.material.active{border-color:#d6a76c;color:#f1c78c}
.instructions{margin-top:3px}.instructions b{color:#c5ad87;font-size:8px;letter-spacing:.14em}.instructions p{margin:7px 0;color:#a6a59d;font-size:10px;line-height:1.65}.instructions .keys{color:#797d7c;font-size:8px;font-weight:850;letter-spacing:.04em}
.bottom-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:auto}
.game-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;color:#a4a69f;font-size:8px;font-weight:850;letter-spacing:.08em}.game-footer-title{min-width:0}.game-footer-brand{flex:0 0 auto;color:#d1c7b3;text-decoration:none;text-align:right;white-space:nowrap}
.result{position:absolute;inset:0;display:grid;place-items:center;padding:15px;background:rgba(11,13,17,.58);backdrop-filter:blur(5px)}
.result.hidden{display:none}.result-card{width:min(360px,94%);padding:25px;border:1px solid rgba(229,190,133,.28);border-radius:16px;background:linear-gradient(145deg,#303039,#1d2028);text-align:center;box-shadow:0 20px 70px rgba(0,0,0,.4)}
.result-card small{color:#d9ad75;font-size:8px;font-weight:900;letter-spacing:.2em}.result-card h1{margin:10px 0 3px;font-size:clamp(24px,5vw,36px);letter-spacing:.04em}.stars{color:#f0c46d;font-size:30px;letter-spacing:.12em}.result-card p{margin:9px 0 18px;color:#b9b8b2;font-size:12px;line-height:1.6}.result-card button{padding:12px 20px;border:0;border-radius:999px;background:#e8b36e;color:#201a13;font-size:10px;font-weight:950;letter-spacing:.13em}
@media(max-width:760px){.shell{padding:calc(env(safe-area-inset-top) + 7px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 8px);gap:7px}.header{min-height:38px}.brand{font-size:16px}.stats{gap:12px}.stats small{font-size:7px}.stats b{font-size:12px}.game{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:7px}.stage{width:100%;height:100%;max-height:none;aspect-ratio:auto;justify-self:stretch;align-self:stretch;border-radius:11px}.side{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px;border-radius:10px}.side-head{grid-column:1/-1}.tools{grid-column:1/-1}.tool{padding:7px 5px}.tool b{font-size:10px}.tool small{font-size:6px}.ignite{padding:10px;font-size:10px}.actions{gap:5px}.actions button{padding:9px 3px;font-size:7px}.divider,.instructions{display:none}.mode-row{grid-column:1/-1}.material-row.visible{grid-column:1/-1}.bottom-actions{margin-top:0;gap:5px}.bottom-actions button{padding:8px 2px;font-size:7px}.game-footer{font-size:7px;letter-spacing:.04em}.game-footer-brand{font-size:7px}}
@media(max-width:390px){.brand{font-size:14px}.stats{gap:8px}.stats b{font-size:11px}.side{gap:5px}.tool small{white-space:normal}.result-card{padding:18px}}
@media(orientation:landscape) and (max-height:540px){.shell{padding:5px 9px;gap:5px}.header{min-height:30px}.brand{font-size:14px}.game{grid-template-columns:minmax(0,1fr) 190px;grid-template-rows:minmax(0,1fr);gap:7px}.stage{width:100%;height:100%;max-height:none;aspect-ratio:auto;align-self:stretch}.side{display:flex;padding:8px;gap:6px}.instructions{display:none}.bottom-actions{margin-top:auto}.game-footer{display:flex;font-size:7px}}
