:root { color-scheme: light; font-family: "Trebuchet MS", system-ui, sans-serif; color: #123e59; }
* { box-sizing: border-box; letter-spacing: 0; }
html,body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #68c7ed; }
#world { position: fixed; inset: 0; }
#world canvas { display: block; width: 100%; height: 100%; touch-action: none; }
[hidden] { display: none !important; }
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible { outline: 4px solid #fff29b; outline-offset: 4px; }
.scene-hud { position: fixed; inset: 20px 24px auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; pointer-events: none; }
.wood-brand,.wood-score { background: linear-gradient(#c7873d60,#4e2c12bb),url('../zaisti-3d/assets/material-atlas.png'); background-size: auto,200% 200%; background-position: center,right bottom; border: 5px solid #925c2a; border-radius: 8px; box-shadow: inset 0 3px 0 #e7bb76,inset 0 -3px 0 #57371b,0 5px 0 #57351d,0 8px 20px #1b5b6838; }
.wood-brand { display: flex; gap: 10px; align-items: center; padding: 9px 18px 12px 10px; transform: rotate(-3deg); }
.wood-brand img { width: 64px; height: 64px; border-radius: 8px; }
h1 { font-size: 29px; line-height: .98; margin: 0; color: #ffde51; font-weight: 1000; text-shadow: 0 3px 0 #512d0e,1px 0 #6d4315,-1px 0 #6d4315; }
h1 span { display: block; color: #4cc7fb; font-size: 35px; text-align: center; }
.stone-label { position: absolute; left: 50%; transform: translateX(-50%); padding: 14px 28px; color: #fff; font-size: 25px; font-weight: 900; text-shadow: 0 3px 0 #384951; border: 5px solid #9da9a6; border-radius: 8px; background: linear-gradient(#54717b77,#334b57b9),url('../zaisti-3d/assets/material-atlas.png'); background-size: auto,200% 200%; background-position: center,left bottom; box-shadow: inset 0 3px 0 #c6c8ad,0 5px 0 #47525d,0 10px 20px #23536630; white-space: nowrap; }
.wood-score { display: flex; align-items: center; gap: 8px; color: #fff6d2; padding: 9px 16px 9px 10px; text-shadow: 0 2px 0 #553215; }
.wood-score strong { font-size: 32px; color: #ffe462; }
.wood-score {position:relative;}
.score-gain {position:absolute;right:30px;top:50px;color:#ffef70;font-weight:900;opacity:0;pointer-events:none;}
.wood-score.earned .score-gain {animation:score-gain .65s ease-out;}
@keyframes score-gain {0%{opacity:1;transform:translateY(0) scale(.8)}50%{opacity:1;transform:translateY(-15px) scale(1.15)}100%{opacity:0;transform:translateY(-32px) scale(1)}}
.wood-score>span:nth-child(3) { font-size: 20px; font-weight: 900; }
.score-star { font-size: 46px; line-height: 1; color: #ffdf50; text-shadow: 0 3px 0 #b78116,0 0 2px #fff8bc; }
.portal-task { position: fixed; left: 60%; top: 41%; width: 306px; transform: translate(-50%,-50%); padding: 17px; border: 4px solid #ffe8b0; border-radius: 8px; background: linear-gradient(#fff9e7,#f8eac5); box-shadow: inset 0 2px 0 #fff,0 8px 24px #225b7850; }
.portal-task h2 { text-align: center; margin: 0 0 17px; font-size: 37px; line-height: 1.1; color: #0c3a5d; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answers button { min-width: 0; height: 61px; border: 2px solid #a5ed8c; border-radius: 8px; color: #fff; font-size: 28px; font-weight: 900; text-shadow: 0 2px 0 #325c8555; background: linear-gradient(#6fda48,#36b351); box-shadow: inset 0 2px 0 #baf391,0 4px 0 #219344; }
.answers button:nth-child(2) { background: linear-gradient(#52b7ff,#237ee9); border-color: #80d4ff; box-shadow: inset 0 2px 0 #a1dfff,0 4px 0 #1b63ba; }
.answers button:nth-child(3) { background: linear-gradient(#ffd86e,#f6ab27); border-color: #ffedaf; box-shadow: inset 0 2px 0 #fff0ba,0 4px 0 #cd8821; }
.answers button:nth-child(4) { background: linear-gradient(#c587ff,#9d55e3); border-color: #dfb5ff; box-shadow: inset 0 2px 0 #e0bcff,0 4px 0 #7942b9; }
.answers button:hover { filter: brightness(1.1); }
.answers button:active { transform: translateY(3px); box-shadow: none; }
.answers button.correct { outline: 4px solid #b4ff91; outline-offset: 3px; }
.answers button.wrong { animation: shake .35s; }
.scene-tools { position: fixed; right: 22px; bottom: 25px; display: flex; gap: 8px; }
.scene-tools button { width: 46px; height: 46px; padding: 10px; border: 2px solid #f3fcff; border-radius: 8px; background: #e9f9ffe0; box-shadow: 0 3px 0 #438ab4,0 4px 15px #17456238; display: grid; place-items: center; }
.scene-tools img { width: 24px; height: 24px; }
footer { position: fixed; bottom: 5px; right: 24px; font-size: 10px; }
footer a { color: #173c50; text-decoration: none; font-weight: 800; text-shadow: 0 1px 3px #fff; }
#loading { position: fixed; z-index: 20; inset: 0; background: #e4f7fb; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; padding: 28px; text-align: center; }
#loading img { width: 90px; height: 90px; border-radius: 8px; }
#loading strong { font-size: 24px; }
#loading progress { width: min(300px,80%); height: 12px; accent-color: #13a9c7; }
#loading span { font-size: 13px; color: #547b88; }
body.clean .scene-hud,body.clean .portal-task { display: none; }
@keyframes shake { 25%,75% {transform:translateX(-4px)} 50% {transform:translateX(4px)} }
@media(max-width:700px) {
 .scene-hud { inset: 12px 12px auto; gap: 8px; }
 .wood-brand { padding: 6px 10px 8px 7px; gap: 7px; border-width: 3px; }
 .wood-brand img { width: 38px; height: 38px; }
 h1 { font-size: 17px; } h1 span { font-size: 22px; }
 .stone-label { top: 74px; left: 0; transform: none; padding: 7px 14px; font-size: 17px; border-width: 3px; }
 .wood-score { padding: 6px 8px; gap: 4px; border-width: 3px; }
 .wood-score strong { font-size: 22px; }.wood-score>span:nth-child(3) { font-size: 12px; }.score-star { font-size: 29px; }
 .portal-task { width: 246px; padding: 12px; }
 .portal-task h2 { font-size: 28px; margin-bottom: 12px; }.answers {gap: 9px;}.answers button {height: 49px;font-size: 23px;}
 .scene-tools { right: 14px; bottom: 28px; gap: 7px; }.scene-tools button {width: 41px;height:41px;padding:8px;}
}
@media(prefers-reduced-motion:reduce) {button {animation:none!important;}}
.level-progress {position:fixed;left:24px;top:134px;display:flex;gap:16px;align-items:center;background:#effbffe8;padding:9px 14px;border-radius:8px;font-size:14px;font-weight:700;box-shadow:0 2px 5px #153a4a33;pointer-events:none;}
.reward-flights {position:fixed;inset:0;z-index:30;pointer-events:none;overflow:hidden;}
.reward-flight {position:absolute;top:0;left:0;width:38px;height:38px;object-fit:contain;will-change:transform;filter:drop-shadow(0 2px 4px #a66a3344);}
#level-map {position:fixed;right:24px;top:120px;width:150px;height:150px;background:#d5f5ffdc;border:2px solid #fff;border-radius:8px;box-shadow:0 3px 8px #123e5933;}
#move-stick {position:fixed;left:24px;bottom:30px;width:112px;height:112px;border:3px solid #e6faffaa;border-radius:50%;background:#ecfbff35;touch-action:none;display:grid;place-items:center;}
#move-stick span {width:49px;height:49px;border:3px solid #fff;border-radius:50%;background:#e6faffb8;pointer-events:none;}
#interact {position:fixed;right:24px;bottom:90px;min-height:48px;padding:10px 17px;border:2px solid #fff4a8;border-radius:8px;background:#ffda65;color:#173a51;font-weight:900;box-shadow:0 4px 0 #b39136;}
body.clean .level-progress,body.clean #level-map {display:none;}
@media(max-width:700px){
 .level-progress {left:12px;right:12px;top:132px;gap:10px;padding:8px 10px;font-size:12px;flex-wrap:wrap;}
 #gate-status {flex-basis:100%;}
 #level-map {top:208px;right:12px;width:105px;height:105px;}
 #move-stick {left:12px;bottom:30px;width:96px;height:96px;}
 #interact {right:12px;bottom:84px;font-size:14px;}
}
@media(max-height:500px){.level-progress{top:70px;left:14px;gap:10px;font-size:12px;}#level-map{top:74px;width:90px;height:90px;}#move-stick{width:88px;height:88px;bottom:20px;}html[data-level] .scene-tools{left:auto;right:14px;bottom:20px;}}
@media(max-height:500px) and (min-width:701px) {
 .scene-hud { inset:10px 14px auto; }
 .wood-brand { padding:5px 10px;gap:7px;border-width:3px; }
 .wood-brand img { width:34px;height:34px; }
 h1 { font-size:16px; } h1 span {font-size:20px;}
 .stone-label {padding:8px 18px;font-size:18px;border-width:3px;}
 .wood-score {padding:5px 10px;border-width:3px;}
 .wood-score strong {font-size:23px;}.score-star {font-size:31px;}.wood-score>span:nth-child(3) {font-size:14px;}
 .portal-task {width:224px;padding:10px;}
 .portal-task h2 {font-size:26px;margin-bottom:9px;}.answers {gap:8px;}.answers button {height:42px;font-size:22px;}
 .scene-tools {left:14px;right:auto;bottom:22px;}.scene-tools button {width:36px;height:36px;padding:6px;}
}
