/* Мінімальний UI поверх 3D-сцени */
:root { --bg: #10151a; }
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
canvas { display: block; }

/* ---- Завантажувальний екран ---- */
#loader {
  position: fixed; inset: 0; z-index: 10;
  background: radial-gradient(1200px 700px at 50% 30%, #2b3a2e, #10151a);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .8s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; color: #dfe8dc; }
.loader-title { font-size: 1.4rem; letter-spacing: .08em; margin-bottom: 18px; }
.bar {
  width: 260px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.12); overflow: hidden; margin: 0 auto;
}
#bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7fbf6a, #f2d06b);
  transition: width .25s ease;
}
#loader-status { margin-top: 10px; font-size: .8rem; opacity: .7; min-height: 1.2em; }
#loader.error .loader-title::before { content: "⚠️ "; }
#loader-status.err { color: #ffb0a0; opacity: 1; }

/* ---- UI overlay ---- */
#ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; color: #eef3e6; }
#fps {
  position: absolute; top: 14px; right: 14px; padding: 5px 10px; border-radius: 8px;
  background: rgba(12,18,10,.45);
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  backdrop-filter: blur(6px);
}
#sound-btn {
  position: absolute; top: 52px; right: 14px; pointer-events: auto; cursor: pointer;
  border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; color: #eef3e6; background: rgba(12,18,10,.45);
  backdrop-filter: blur(6px); transition: background .2s;
}
#sound-btn:hover { background: rgba(30,44,26,.6); }
#hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 12px; padding: 6px 12px; border-radius: 10px;
  background: rgba(12,18,10,.4); backdrop-filter: blur(6px);
  opacity: .85; white-space: nowrap;
}
@media (max-width: 640px) { #hint { font-size: 10px; bottom: 8px; } }
