/* ═══════════════════════════════════════════════════════
   e1-polish.css — E1 Visual Director Masterpiece Polish
   Added 2026-04-07: particles, countdowns, sheets, empty
   states, error retry cards, toast gradients, a11y guards.
   Loaded LAST so it overrides base tokens via specificity.
   ═══════════════════════════════════════════════════════ */

/* ── Bottom nav: tap particle burst ─────────────────── */
.p-nav-particle {
  position: absolute;
  top: 20px; left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #F9C843, #F07020);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 0);
  box-shadow: 0 0 10px rgba(249,200,67,.6);
}
.p-nav-item.just-activated .p-nav-particle {
  animation: navParticleBurst .75s cubic-bezier(.34,1.56,.64,1) forwards;
}
.p-nav-item.just-activated .p-nav-particle:nth-child(2) { animation-delay: .04s; --pdx: 14px;  --pdy: -14px; }
.p-nav-item.just-activated .p-nav-particle:nth-child(3) { animation-delay: .08s; --pdx: -14px; --pdy: -14px; }
.p-nav-item.just-activated .p-nav-particle:nth-child(4) { animation-delay: .12s; --pdx: 0;     --pdy: -22px; }
.p-nav-item.just-activated .p-nav-particle:nth-child(5) { animation-delay: .06s; --pdx: 20px;  --pdy: -4px;  }
.p-nav-item.just-activated .p-nav-particle:nth-child(6) { animation-delay: .10s; --pdx: -20px; --pdy: -4px;  }
@keyframes navParticleBurst {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  20%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0;
         transform: translate(calc(-50% + var(--pdx, 0px)), var(--pdy, -18px)) scale(.6); }
}

/* ── Hero countdown pill: smooth gentle pulse ───────── */
.p-hero-countdown {
  animation: heroCountdownPulse 3.2s ease-in-out infinite;
  will-change: transform, box-shadow;
}
@keyframes heroCountdownPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,112,32,0); }
  50%      { transform: scale(1.045); box-shadow: 0 0 0 6px rgba(240,112,32,.08); }
}

/* ── More sheet: staggered item entry + hover state ─── */
.p-sheet.show .p-sheet-item {
  opacity: 0;
  animation: sheetItemIn .42s cubic-bezier(.34,1.56,.64,1) forwards;
}
.p-sheet.show .p-sheet-item:nth-child(2)  { animation-delay: .04s; }
.p-sheet.show .p-sheet-item:nth-child(3)  { animation-delay: .08s; }
.p-sheet.show .p-sheet-item:nth-child(4)  { animation-delay: .12s; }
.p-sheet.show .p-sheet-item:nth-child(5)  { animation-delay: .16s; }
.p-sheet.show .p-sheet-item:nth-child(6)  { animation-delay: .20s; }
.p-sheet.show .p-sheet-item:nth-child(7)  { animation-delay: .24s; }
.p-sheet.show .p-sheet-item:nth-child(8)  { animation-delay: .28s; }
.p-sheet.show .p-sheet-item:nth-child(9)  { animation-delay: .32s; }
.p-sheet.show .p-sheet-item:nth-child(10) { animation-delay: .36s; }
.p-sheet.show .p-sheet-item:nth-child(11) { animation-delay: .40s; }
@keyframes sheetItemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.p-sheet-item {
  transition: background .2s cubic-bezier(.4,0,.2,1), transform .15s cubic-bezier(.34,1.56,.64,1);
}
.p-sheet-item:hover {
  background: linear-gradient(90deg, rgba(249,200,67,.06), rgba(240,112,32,.02)) !important;
  transform: translateX(2px);
}
.p-sheet-item:active {
  transform: translateX(2px) scale(.985);
}

/* ── Card/stat hover elevation (desktop/trackpad) ───── */
@media (hover: hover) {
  .p-card:hover {
    box-shadow: 0 4px 0 rgba(194,186,176,.06), 0 10px 28px rgba(26,23,19,.06);
    transform: translateY(-1px);
  }
  .p-stat:hover {
    box-shadow: 0 4px 0 rgba(194,186,176,.10), 0 8px 22px rgba(240,112,32,.08);
    transform: translateY(-1px);
    border-color: rgba(249,200,67,.25);
  }
}

/* ── Premium empty-state mascot variant ─────────────── */
.p-empty-mascot-icon {
  width: 88px; height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #FFF5E1, #FDE68A);
  box-shadow: 0 10px 32px rgba(240,112,32,.15), 0 0 0 3px rgba(249,200,67,.2);
  animation: emptyMascotFloat 3.5s ease-in-out infinite;
}
.p-empty-mascot-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes emptyMascotFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}

/* ── Premium retry-error card ───────────────────────── */
.p-error-retry {
  text-align: center;
  padding: 40px 24px 32px;
  background: linear-gradient(180deg, #FFFBF4 0%, #FFF5E6 100%);
  border-radius: 24px;
  border: 1px solid rgba(240,112,32,.12);
  margin: 16px 0;
  animation: cardIn .4s cubic-bezier(.4,0,.2,1) both;
}
.p-error-retry-icon {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(240,112,32,.08), rgba(249,200,67,.12));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(240,112,32,.12);
}
.p-error-retry-title {
  font-size: 16px; font-weight: 800;
  color: #1A1713;
  letter-spacing: -.2px;
  margin-bottom: 4px;
}
.p-error-retry-text {
  font-size: 13px;
  color: #6B6459;
  line-height: 1.5;
  margin: 0 auto 18px;
  max-width: 280px;
}
.p-error-retry-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #F9C843, #F07020);
  color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #C47A10, 0 6px 18px rgba(240,112,32,.25);
  transition: transform .12s ease, box-shadow .15s ease;
}
.p-error-retry-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #C47A10, 0 3px 10px rgba(240,112,32,.18);
}

/* ── Shimmer ripple on nav-slider (subtle ambient) ──── */
.p-nav-slider {
  position: relative;
  overflow: hidden;
}
.p-nav-slider::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%);
  animation: navSliderShine 3.2s ease-in-out infinite;
}
@keyframes navSliderShine {
  0%, 40%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(300%); }
}

/* ── Premium toast polish with left glow-bar ────────── */
.p-toast-item {
  background: linear-gradient(135deg, #221C16 0%, #1A1713 100%) !important;
  padding: 14px 20px 14px 24px !important;
  box-shadow: 0 14px 44px rgba(26,23,19,.28), 0 4px 14px rgba(26,23,19,.18), inset 0 1px 0 rgba(255,255,255,.06) !important;
  animation: toastIn .42s cubic-bezier(.34,1.56,.64,1) !important;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.04);
}
.p-toast-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #F9C843, #F07020);
  box-shadow: 0 0 14px rgba(249,200,67,.5);
}
.p-toast-item.toast-success { background: linear-gradient(135deg, #0E3B26 0%, #0A2A1B 100%) !important; }
.p-toast-item.toast-success::before { background: linear-gradient(180deg, #3EDC8F, #1DB954); box-shadow: 0 0 14px rgba(29,185,84,.5); }
.p-toast-item.toast-error { background: linear-gradient(135deg, #401414 0%, #2A0D0D 100%) !important; }
.p-toast-item.toast-error::before { background: linear-gradient(180deg, #FF6B6B, #E53E3E); box-shadow: 0 0 14px rgba(229,62,62,.5); }
.p-toast-item.toast-info { background: linear-gradient(135deg, #152A44 0%, #0B1A2B 100%) !important; }
.p-toast-item.toast-info::before { background: linear-gradient(180deg, #63B3ED, #2B6CB0); box-shadow: 0 0 14px rgba(43,108,176,.5); }

/* ── Lektury/Wiersze skeleton wrap fade ─────────────── */
.lekt-skel-wrap, .wier-skel-wrap {
  animation: fadeIn .25s ease both;
}

/* ── Stronger reduced-motion guards (safety net) ────── */
@media (prefers-reduced-motion: reduce) {
  .p-hero-countdown,
  .p-nav-slider::after,
  .p-empty-mascot-icon,
  .p-sheet.show .p-sheet-item,
  #homeHero .p-hero::before,
  #homeHero .p-hero::after,
  .p-lessons-hero-card::after,
  .p-nav-item.just-activated .p-nav-particle,
  .p-toast-item {
    animation: none !important;
  }
}
