/* Keep long presses and double taps on mobile from selecting the game page. */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#status {
  position: fixed; inset: 0; z-index: 1000; visibility: visible;
  background: white; color: #193451; font-family: ui-rounded, 'Trebuchet MS', sans-serif;
  overflow: hidden; transition: opacity .35s ease;
}
#status.with-art { background: var(--kworld-loading-backdrop, #123e4b); }
#loading-title { position: absolute; top: 40%; left: 5%; right: 5%; text-align: center; font-size: clamp(28px, 5vw, 56px); }
#status-splash { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; margin: auto; }
#status-splash-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) saturate(1.1); transform: scale(1.12); }
#loading-card {
  position: absolute; bottom: max(4%, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  box-sizing: border-box; width: min(420px, calc(100% - 40px)); padding: 16px 22px 20px;
  border: 2px solid #b4c7c4; border-radius: 20px; background: #fff9ed;
  box-shadow: 0 5px 0 #173f4c66, 0 8px 28px #08293444; color: #193451; text-align: center;
}
#loading-label { margin: 0 0 12px; font-size: clamp(16px, 2.2vw, 20px); font-weight: 800; }
#loading-progress-area { position: absolute; inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); pointer-events: none; }
#loading-progress-area > #loading-card { pointer-events: auto; }
#status-progress {
  position: static; display: block; box-sizing: border-box; appearance: none;
  width: 100%; height: 20px; margin: 0; border: 2px solid #bdcdd1; border-radius: 20px;
  background: var(--kworld-loading-track, #dbe3e6); padding: 2px; overflow: hidden;
}
/* Progress without a status line: just the bar, no card chrome. */
#loading-card.bar-only { width: min(320px, calc(100% - 64px)); padding: 0; border: 0; background: none; box-shadow: none; bottom: max(8%, env(safe-area-inset-bottom)); }
#status.with-art #loading-card.bar-only #status-progress { height: 14px; border-color: transparent; }
#status-progress::-webkit-progress-bar { background: var(--kworld-loading-track, #dbe3e6); border-radius: 20px; }
#status-progress::-webkit-progress-value { background: var(--kworld-loading-accent, linear-gradient(#81c6cd,#46929f)); border-radius: 20px; }
#status-progress::-moz-progress-bar { background: var(--kworld-loading-accent, linear-gradient(#81c6cd,#46929f)); border-radius: 20px; }
#status-notice { position: relative; margin: 12px 0; padding: 0; background: none; border: 0; color: #193451; font: inherit; }
#loading-retry, #loading-continue { margin-top: 10px; border: 2px solid #3c7785; border-radius: 12px; padding: 10px 26px; color: #173451; background: #bbe3e4; box-shadow: 0 3px 0 #81adb2; font: inherit; font-weight: 800; cursor: pointer; }
#status.leaving { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #status { transition: none; } }

#publisher-splash { position: absolute; inset: 0; z-index: 2; background: black; transition: opacity .3s ease; }
#publisher-splash img { width: 100%; height: 100%; object-fit: contain; }
#publisher-splash.leaving { opacity: 0; }


#status.framed-progress #loading-card.bar-only #status-progress { border: 3px solid var(--kworld-loading-border); height: 18px; box-shadow: 0 2px 8px #07205066; }

#loading-art-stage { position: absolute; overflow: hidden; pointer-events: none; }
#loading-art-safe { position: absolute; inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); visibility: hidden; pointer-events: none; }
#loading-art-stage img { position: absolute; max-width: none; max-height: none; will-change: transform, opacity; }
#loading-card { z-index: 1; }

#loading-continue { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); align-self: center; font-size: 24px; min-height: 64px; }

#loading-continue:not([hidden]) { animation: loading-continue-in 150ms ease-out; }
@keyframes loading-continue-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #loading-continue { animation: none !important; } }
