/* WordWeight — page shell + loading screen. The game itself is drawn on <canvas>. */
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #f3e9d6 url(../assets/img/paper.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 (visible for exactly CONFIG.loading.seconds, hidden by JS) ---------- */
#loading {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f3e9d6 url(../assets/img/paper.png); color: #2b2a33;
  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(40vmin, 220px); height: min(40vmin, 220px); filter: drop-shadow(0 10px 18px rgba(80, 50, 10, 0.25)); animation: seesaw 3.2s ease-in-out infinite; }
#loading h1 { margin: 18px 0 4px; font-size: clamp(28px, 7vmin, 52px); letter-spacing: 0.2em; font-weight: 700; color: #2b2a33; }
#loading .sub { margin: 0 0 30px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: clamp(10px, 2vmin, 13px); letter-spacing: 0.34em; color: #8a8199; font-weight: 700; }
#loading .spinner { width: 44px; height: 44px; animation: spin 1.1s steps(12) infinite; }
#loading .spinner img { display: block; width: 44px; height: 44px; }
#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, #c98a4b, #e0a33a); transition: width 0.25s linear; }
#loading .tip { margin-top: 18px; font-style: italic; font-size: 13px; color: #8a8199; min-height: 1.4em; }
#loading .error { color: #b8473a; font-family: system-ui, sans-serif; font-size: 13px; margin-top: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes seesaw { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { #loading .logo { animation: none; } }
