/* Harmonia — page shell + loading screen. The game itself is drawn on <canvas>. */
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #efe6d2 url(../assets/img/bg_tile.png); overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; }
canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

/* ---------- loading screen (shown for a minimum of 5 s, hidden by JS) ---------- */
#loading {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #efe6d2 url(../assets/img/bg_tile.png); color: #2a2c66;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  transition: opacity 0.6s ease; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#loading.hide { opacity: 0; pointer-events: none; }
#loading .logo { width: min(38vmin, 220px); height: min(38vmin, 220px); animation: breathe 3s ease-in-out infinite; }
#loading h1 { margin: 18px 0 4px; font-size: clamp(28px, 7vmin, 52px); letter-spacing: 0.22em; font-weight: 600; }
#loading .sub { margin: 0 0 34px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: clamp(10px, 2vmin, 13px); letter-spacing: 0.32em; color: #7d7492; font-weight: 600; }
#loading .spinner { width: 44px; height: 44px; background: url(../assets/img/spinner.png) center / contain no-repeat; animation: spin 1.1s steps(12) infinite; }
#loading .bar { width: min(60vw, 260px); height: 6px; margin-top: 22px; border-radius: 3px; background: rgba(90, 70, 40, 0.18); overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, #c69a4a, #f0d38f); transition: width 0.25s linear; }
#loading .tip { margin-top: 18px; font-style: italic; font-size: 13px; color: #7d7492; min-height: 1.4em; }
#loading .error { color: #a5473a; font-family: system-ui, sans-serif; font-size: 13px; margin-top: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { #loading .logo { animation: none; } }
