/* ============================================================================
   PianoBoss — Q1 Upfront Nautilus Sample Loader
   Branded full-screen overlay shown on app boot. Holds the user behind a
   "Preparing your piano..." card while the 120 Nautilus sample files
   (30 notes × 4 velocity layers) download. Industry pattern (Simply Piano,
   Flowkey, Yousician). Eliminates oscillator fallback by ensuring samples
   are ready before any audible playback.
   ========================================================================= */

#pb-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at center, #1a1a22 0%, #0a0a12 60%, #050508 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.45s ease-out;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
#pb-loader[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

#pb-loader .pb-loader-card {
  text-align: center;
  padding: 40px 32px;
  max-width: 360px;
  width: min(360px, 88vw);
  animation: pb-loader-card-in 0.5s ease-out;
}

@keyframes pb-loader-card-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

#pb-loader .pb-loader-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
#pb-loader .pb-loader-brand .pb-loader-logo {
  display: inline-block;
  width: 36px; height: 36px;
  background: linear-gradient(180deg, var(--brass-hi, #e8c886), var(--brass, #b8860b));
  border-radius: 6px;
  position: relative;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}
#pb-loader .pb-loader-brand .pb-loader-logo::before,
#pb-loader .pb-loader-brand .pb-loader-logo::after {
  content: ''; position: absolute; top: 7px; height: 22px; width: 3px;
  background: #1a1a22; border-radius: 0 0 1px 1px;
}
#pb-loader .pb-loader-brand .pb-loader-logo::before { left: 11px; }
#pb-loader .pb-loader-brand .pb-loader-logo::after  { left: 22px; }
#pb-loader .pb-loader-brand .pb-loader-name {
  color: var(--text, #ece5d5);
}
#pb-loader .pb-loader-brand .pb-loader-name b {
  color: var(--brass-hi, #e8c886);
  font-style: italic;
}

#pb-loader .pb-loader-status {
  font-size: 14px;
  color: var(--text-dim, #b8b0a0);
  margin-bottom: 18px;
  min-height: 20px;
  letter-spacing: 0.2px;
}

#pb-loader .pb-loader-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}
#pb-loader .pb-loader-bar-fill {
  height: 100%;
  width: var(--pb-progress, 0%);
  background: linear-gradient(90deg, var(--brass, #b8860b), var(--brass-hi, #e8c886));
  border-radius: 3px;
  transition: width 0.18s ease-out;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

#pb-loader .pb-loader-percent {
  font-size: 12px;
  color: var(--brass-hi, #e8c886);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  font-weight: 600;
}

#pb-loader .pb-loader-hint {
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-dim, #b8b0a0);
  opacity: 0.85;
}

#pb-loader .pb-loader-fallback-btn {
  display: none;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text, #ece5d5);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-weight: 500;
}
#pb-loader.pb-loader-timeout .pb-loader-fallback-btn { display: inline-block; }
#pb-loader .pb-loader-fallback-btn:active { background: rgba(255, 255, 255, 0.12); }

/* While the loader is up, freeze the underlying app from interactions */
body.pb-loader-active { overflow: hidden; }
