/* In-page loading state for chess_engine.html / trifangx_live.html (no full-screen blur). */
.trifangx-shell-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(380px, 52vh);
  margin: 0 auto;
  max-width: 1400px;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

.trifangx-shell-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 1.75rem 2.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(52, 152, 219, 0.12);
}

.trifangx-shell-loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(52, 152, 219, 0.18);
  border-top-color: #3498db;
  border-right-color: #2980b9;
  animation: trifangx-shell-spin 0.9s linear infinite;
  box-shadow: 0 0 24px rgba(52, 152, 219, 0.15);
}

.trifangx-shell-loading-text {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #5a6a7a;
  letter-spacing: 0.01em;
}

.trifangx-shell-loading--hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.trifangx-shell-loading--gone {
  display: none !important;
}

/* Game shell mounts invisibly while loading; shown when the board is ready. */
#choose-side.trifangx-shell-pending,
#game-container.trifangx-shell-pending {
  opacity: 0;
  pointer-events: none;
}

@keyframes trifangx-shell-spin {
  to {
    transform: rotate(360deg);
  }
}

.page-theme-dark .trifangx-shell-loading-inner,
.page-theme-midnight .trifangx-shell-loading-inner,
.page-theme-space .trifangx-shell-loading-inner {
  background: rgba(26, 32, 44, 0.94);
  border-color: rgba(93, 173, 226, 0.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.page-theme-dark .trifangx-shell-loading-text,
.page-theme-midnight .trifangx-shell-loading-text,
.page-theme-space .trifangx-shell-loading-text,
.page-theme-cyber .trifangx-shell-loading-text {
  color: rgba(236, 240, 241, 0.82);
}

.page-theme-dark .trifangx-shell-loading-spinner,
.page-theme-midnight .trifangx-shell-loading-spinner {
  border-color: rgba(236, 240, 241, 0.12);
  border-top-color: #5dade2;
  border-right-color: #3498db;
}
