/* CarpTracker — carp-fx.css : splash boot + confirmations animées + lisibilité PNG */

/* ——— Boot splash ——— */
#carpBootSplash {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: rgba(6, 12, 6, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.28s ease, visibility 0.28s ease;
  pointer-events: all;
}
#carpBootSplash.is-done,
#carpBootSplash[aria-hidden="true"],
body:not(.carp-booting) #carpBootSplash {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}
body.carp-booting > header,
body.carp-booting > main,
body.carp-booting > nav.bottom-nav {
  filter: blur(5px) brightness(0.55);
  transition: filter 0.25s ease;
}
body:not(.carp-booting) > header,
body:not(.carp-booting) > main,
body:not(.carp-booting) > nav.bottom-nav {
  filter: none;
}
.carp-boot-logo-stage {
  position: relative;
  width: 9.25rem;
  height: 9.25rem;
  /* Halo discret hors silhouette */
  filter: drop-shadow(0 0 18px rgba(134, 239, 172, 0.22));
}
.carp-boot-logo-ghost,
.carp-boot-logo-solid {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 9.25rem;
  height: 9.25rem;
  object-fit: contain;
  display: block;
  /* Pas de filtre ui-icon : silhouette nette du vrai logo.png */
  filter: none !important;
  -webkit-filter: none !important;
}
.carp-boot-logo-ghost {
  opacity: 0.4;
  filter: brightness(0.88) saturate(0.7) !important;
}
/* Remplissage bas→haut : clip + même PNG (alpha = silhouette exacte) */
.carp-boot-logo-clip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  overflow: hidden;
  will-change: height;
  transition: height 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.carp-boot-logo-solid {
  filter: brightness(1.08) saturate(1.05) !important;
}
/* Voile « énergie » limité à la silhouette via mask = logo.png */
.carp-boot-logo-energy {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 9.25rem;
  height: 9.25rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.15) 0%, rgba(34, 197, 94, 0.28) 55%, rgba(22, 163, 74, 0.35) 100%);
  -webkit-mask-image: url('../logo.webp');
  mask-image: url('../logo.webp');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
  opacity: 0.85;
}
.carp-boot-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86efac;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.carp-boot-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  max-width: 16rem;
  text-align: center;
  line-height: 1.35;
}

/* Mobile : flou moins coûteux, identité visuelle conservée */
@media (max-width: 640px) {
  #carpBootSplash {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
  }
  body.carp-booting > header,
  body.carp-booting > main,
  body.carp-booting > nav.bottom-nav {
    filter: blur(3px) brightness(0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  #carpBootSplash { transition: opacity 0.15s linear; }
  .carp-boot-logo-clip { transition: none !important; }
  body.carp-booting > header,
  body.carp-booting > main,
  body.carp-booting > nav.bottom-nav { filter: brightness(0.55); }
}

/* ——— Confirmations premium ——— */
#carpFxToastHost {
  position: fixed;
  inset: 0;
  z-index: 190000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}
.carp-fx-toast {
  pointer-events: none;
  width: min(92vw, 22rem);
  background: rgba(10, 18, 10, 0.92);
  border: 1px solid rgba(134, 239, 172, 0.4);
  border-radius: 18px;
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(74, 110, 60, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: carpFxIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.carp-fx-toast.is-out {
  animation: carpFxOut 0.32s ease forwards;
}
.carp-fx-toast.tone-alert {
  border-color: rgba(251, 146, 60, 0.55);
}
.carp-fx-toast.tone-neutral {
  border-color: rgba(148, 163, 184, 0.4);
}
.carp-fx-icon-wrap {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carp-fx-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -0.15rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(134, 239, 172, 0.28) 0%, rgba(134, 239, 172, 0) 70%);
  animation: carpFxHalo 0.9s ease-out both;
}
.carp-fx-toast.tone-alert .carp-fx-icon-wrap::before {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.3) 0%, rgba(251, 146, 60, 0) 70%);
}
.carp-fx-icon {
  width: 5rem !important;
  height: 5rem !important;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.25))
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75))
    brightness(1.2)
    contrast(1.15) !important;
  animation: carpFxPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.carp-fx-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #86efac;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.carp-fx-toast.tone-alert .carp-fx-title { color: #fdba74; }
.carp-fx-sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0fdf4;
  line-height: 1.35;
}
.carp-fx-meta {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #bbf7d0;
  line-height: 1.35;
}
.carp-fx-wink {
  margin: 0.55rem 0 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86efac;
  opacity: 0.75;
}

@keyframes carpFxIn {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes carpFxOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.96); }
}
@keyframes carpFxPop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes carpFxHalo {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .carp-fx-toast,
  .carp-fx-toast.is-out,
  .carp-fx-icon,
  .carp-fx-icon-wrap::before {
    animation: none !important;
  }
  .carp-fx-toast { opacity: 1; }
  .carp-fx-toast.is-out { opacity: 0; }
}

/* ——— Lisibilité petites PNG (taille inchangée) ———
   Cible uniquement .ui-icon* — jamais .nav-icon, .header-logo, photos, splash. */
img.ui-icon,
img.ui-icon-sm,
img.ui-icon-md,
img.ui-icon-lg,
img.ui-icon-xl {
  /* dimensions : laisser style.css — ne PAS forcer width/height ici */
  filter:
    drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.35))
    drop-shadow(0 1px 2.5px rgba(0, 0, 0, 0.85))
    brightness(1.32)
    contrast(1.22)
    saturate(1.06);
  -webkit-filter:
    drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.35))
    drop-shadow(0 1px 2.5px rgba(0, 0, 0, 0.85))
    brightness(1.32)
    contrast(1.22)
    saturate(1.06);
}
/* Fonds très sombres / listes : halo un peu plus présent */
.live-feed img.ui-icon,
.records-entry img.ui-icon,
.podium-thumb-fallback img,
.wx-strat-factor summary img.ui-icon,
.wx-strategy-title-row img.ui-icon,
label img.ui-icon,
.card-title img.ui-icon,
.btn img.ui-icon,
.btn-secondary img.ui-icon,
.subtab-btn img.ui-icon {
  filter:
    drop-shadow(0 0 0.8px rgba(255, 255, 255, 0.4))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9))
    brightness(1.36)
    contrast(1.24)
    saturate(1.08);
  -webkit-filter:
    drop-shadow(0 0 0.8px rgba(255, 255, 255, 0.4))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9))
    brightness(1.36)
    contrast(1.24)
    saturate(1.08);
}

/* Exclusions explicites — grandes illust. onglets + logo/titre + splash + photos */
nav.bottom-nav .nav-icon,
nav.bottom-nav img.nav-icon,
.nav-icon-wrapper img,
.header-logo,
.header-title-img,
#carpBootSplash img,
.carp-boot-logo-ghost,
.carp-boot-logo-solid,
.carp-fx-icon,
img.catch-photo,
img.session-catch-photo,
.records-entry-photo img,
.podium-photo img,
.prospect-photo img,
.mapboxgl-marker img,
.leaflet-marker-icon {
  /* ne pas hériter des boosts ui-icon si une classe est partagée par erreur */
}

nav.bottom-nav .nav-icon,
nav.bottom-nav img.nav-icon {
  filter: none !important;
  -webkit-filter: none !important;
  /* tailles inchangées — styles bottom-nav existants */
}
.header-logo,
.header-title-img {
  filter: none !important;
  -webkit-filter: none !important;
}
