/* Конструктор трасс из блоков */
html, body { background: #05061a; overflow: hidden; }
body { touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--font); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#top { position: fixed; z-index: 5; top: max(6px, env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); display: flex; align-items: center; gap: 6px; }
#top .round { flex: none; width: 42px; height: 42px; line-height: 40px; padding: 0; font-size: 18px; text-align: center; text-decoration: none; }
.chip { flex: none; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 2px solid #ffffff44; background: #06192bcc; color: #fff; font: 800 14px var(--font); cursor: pointer; white-space: nowrap; }
.chip.go { background: linear-gradient(180deg, #8df0a0, #2fb45c); color: #06301a; border-color: #d8ffe0; font-size: 16px; }
.chip:disabled { opacity: .5; }
.chip.fix { background: linear-gradient(180deg, #ffe07a, #f0a92a); color: #3a2400; border-color: #fff3c4; }
.chip[hidden] { display: none; }
#top .grow { flex: 1; min-width: 0; }
#status { position: fixed; z-index: 5; top: calc(max(6px, env(safe-area-inset-top)) + 48px); left: calc(10px + env(safe-area-inset-left)); max-width: 70vw; padding: 2px 10px; border-radius: 10px; background: #000a; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#btn-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
#status.bad { color: #ffd447; }
#fly-keys { position: fixed; z-index: 5; right: calc(10px + env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
#fly-keys button { width: 56px; height: 56px; border-radius: 14px; border: 2px solid #ffffff55; background: #06192bbb; font-size: 24px; touch-action: none; cursor: pointer; }
#fly-keys button.on { background: #6fe3ff; }
#hotbar { position: fixed; z-index: 5; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 3px; padding: 4px; background: #000a; border: 3px solid #2a2d55; border-radius: 6px; }
#hotbar button { position: relative; width: clamp(38px, 8.6vw, 62px); max-width: 62px; height: clamp(38px, 8.6vw, 62px); max-height: 62px; padding: 0; border: 3px solid #4a4e7c; border-radius: 3px; background: #14163a center / 76% no-repeat; image-rendering: pixelated; cursor: pointer; touch-action: none; font-size: 22px; color: #fff; }
#hotbar button.on { border-color: #ffd447; box-shadow: 0 0 0 2px #ffd447; }
#tip { position: fixed; z-index: 5; left: 50%; bottom: calc(clamp(52px, 11vw, 80px) + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: #000a; color: #fff; font-size: 13px; font-weight: 700; pointer-events: none; white-space: nowrap; }
#toast { bottom: auto; top: 86px; }
#quest { position: fixed; z-index: 6; right: calc(8px + env(safe-area-inset-right)); top: calc(max(6px, env(safe-area-inset-top)) + 52px); width: min(270px, 42vw); border-radius: 14px; background: #06192be6; border: 2px solid #ffd447; color: #fff; font-size: 13px; }
#quest[hidden] { display: none; }
#quest .ad-btn { display: block; width: calc(100% - 16px); margin: 0 8px 8px; min-height: 38px; border-radius: 10px; border: 2px solid #8fd0ff; background: #0b2a44; color: #fff; font: 800 13px var(--font); cursor: pointer; }
#quest .ad-btn:disabled { opacity: .55; }
#quest-head { width: 100%; min-height: 40px; padding: 4px 10px; border: 0; background: none; color: #fff; font: 800 14px var(--font); text-align: left; cursor: pointer; }
#quest-head b { color: #ffd447; }
#quest-list { display: none; max-height: calc(100vh - 200px); overflow-y: auto; padding: 0 8px 8px; }
#quest.open #quest-list { display: block; }
#quest-list .t { display: flex; gap: 6px; align-items: flex-start; padding: 4px 2px; border-top: 1px solid #ffffff1a; line-height: 1.2; }
#quest-list .t.done { opacity: .55; }
#quest-list .t .p { margin-left: auto; color: #ffd447; font-weight: 800; white-space: nowrap; }
#quest-list .shop { display: block; margin-top: 6px; padding: 6px; border-radius: 10px; background: #ffd447; color: #3a2400; font-weight: 800; text-align: center; text-decoration: none; }
@media (max-width: 900px) { #btn-pub .t, #btn-fixfork .t { display: none; } #btn-name { max-width: 130px; } }
@media (max-width: 720px) { #btn-name { display: none; } #status { font-size: 12px; } .chip { padding: 0 8px; font-size: 13px; } }
@media (max-width: 480px) { #btn-diff { display: none; } #top .round { width: 38px; } }
