/*!
 * Teamz Lab games — loading skeleton styles (paired with tz-game-loader.js).
 * 3x3 board skeleton that mirrors the native Flutter grid shimmer
 * (game_webview_screen.dart), so the native-splash -> Flutter loader -> HTML
 * loader hand-off is seamless for EVERY game with no per-game work. Light by
 * default; dark when html has no data-theme="light" (tz-game-theme convention).
 */

#tz-game-loader {
  position: fixed;
  inset: 0;
  z-index: 2147482000; /* above the game, below the ad-sim overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2fb; /* light default */
  transition: opacity 0.4s ease;
}

#tz-game-loader.tz-game-loader--out {
  opacity: 0;
  pointer-events: none;
}

.tz-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.tz-loader-board {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 9px;
}

.tz-loader-tile {
  border-radius: 11px;
  background: linear-gradient(
    100deg,
    rgba(15, 23, 42, 0.06) 30%,
    rgba(15, 23, 42, 0.13) 50%,
    rgba(15, 23, 42, 0.06) 70%
  );
  background-size: 200% 100%;
  animation: tz-loader-shimmer 1.3s linear infinite;
}

/* Centre accent tile — pulses (matches arrow's loader + the Flutter centre). */
.tz-loader-tile--accent {
  background: #1d4ed8;
  animation: tz-loader-pulse 1.3s ease-in-out infinite;
}

@keyframes tz-loader-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes tz-loader-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.tz-loader-text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(15, 23, 42, 0.5);
}

/* Dark variant — matches tz-game-theme dark + the Flutter grid shimmer (#0c1322). */
html:not([data-theme="light"]) #tz-game-loader {
  background: #0c1322;
}
html:not([data-theme="light"]) .tz-loader-tile {
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.05) 70%
  );
}
html:not([data-theme="light"]) .tz-loader-tile--accent {
  background: #4a86e8;
}
html:not([data-theme="light"]) .tz-loader-text {
  color: rgba(232, 237, 247, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .tz-loader-tile,
  .tz-loader-tile--accent { animation: none; }
}
