/* NPL - loading state for the public pages.
   While the real data is coming, the sample content written in the HTML stays
   invisible and a soft shimmer is shown. When the data is in, public pages call
   NPLPage (page-loading.js) and the page appears with the real data only. */

html.npl-loading body > .container { position: relative; min-height: 60vh; }
html.npl-loading body > .container > * { visibility: hidden; }
html.npl-loading body > .container::after {
  content: ""; position: absolute; inset: 24px 0 0 0; border-radius: 16px;
  background-color: rgba(255, 255, 255, .03);
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.07) 40%, rgba(255,255,255,0) 60%);
  background-size: 220% 100%; animation: nplShimmer 1.3s linear infinite;
}
@keyframes nplShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* the server is waking up (free hosting): tell the visitor, do not look stuck */
html.npl-loading.npl-slow body > .container::before {
  content: "Loading live data... the server may need a few seconds to wake up.";
  position: absolute; top: 120px; left: 0; right: 0; z-index: 2; text-align: center;
  font-size: 14px; color: var(--color-text-muted, #94a3b8);
}

/* hero parts that carry sample numbers / dates */
html.npl-loading :is(
  .tournament-hero h1, .tournament-hero .stat-value, .tournament-hero .value,
  .pts-hero .season-tag, .pts-hero .value,
  .live-auction-hero .auction-round, .live-auction-hero .auction-timer, .live-auction-hero .auction-header-actions .mono
) { visibility: hidden; }

html.npl-failed :is(
  .tournament-hero h1, .tournament-hero .stat-value, .tournament-hero .value,
  .pts-hero .season-tag, .pts-hero .value,
  .live-auction-hero .auction-round, .live-auction-hero .auction-timer, .live-auction-hero .auction-header-actions .mono
) { visibility: hidden; }

/* profile pages: the big sample hero sits outside the main container */
html.npl-loading :is(.team-profile-hero, .breadcrumb) { visibility: hidden; }
html.npl-failed :is(.team-profile-hero, .breadcrumb) { display: none; }

/* the data could not be loaded: show a clear message, never the sample content */
html.npl-failed body > .container > *:not(.npl-error-card) { display: none; }

@media (prefers-reduced-motion: reduce) { html.npl-loading body > .container::after { animation: none; } }