/* ================================================================
   KOPHI'S MUSIC STUDIO v4.9 — Thèmes festifs
   Les couleurs du thème (--ksm-gold, --ksm-violet…) sont injectées dans
   <head> par includes/festive.php ; ce fichier gère l'habillage commun.
   ================================================================ */

/* Ruban de fête en haut de l'écran */
html.ksm-fete body::before {
  content: ''; position: fixed; top: var(--ksm-top, 0px); left: 0; right: 0; height: 4px; z-index: 100001; pointer-events: none;
  background: var(--ksm-ribbon, linear-gradient(90deg, var(--ksm-violet), var(--ksm-gold), var(--ksm-violet)));
  background-size: 200% 100%; animation: ksmRibbon 8s linear infinite;
}
html.ksm-fete-independance body::before, html.ksm-fete-paix body::before { background-size: 100% 100%; animation: none; }
@keyframes ksmRibbon { to { background-position: 200% 0; } }

/* Pages plein écran du studio : fond teinté aux couleurs de la fête */
html.ksm-fete body.kophi-fullwidth,
html.ksm-fete body.kophi-fullwidth .site,
html.ksm-fete body.kophi-fullwidth #page {
  background: radial-gradient(120% 70% at 50% -10%, rgba(var(--ksm-violet-rgb), .22), transparent 60%),
              linear-gradient(160deg, #0D0D0D 0%, var(--ksm-bg2, #1e0938) 100%) !important;
  background-attachment: fixed !important;
}

/* ── Carte de vœux ────────────────────────────────────────────── */
.ksm-fete-card {
  --c1: var(--ksm-gold, #E8B84B); --c2: var(--ksm-violet, #8B3FD9);
  position: relative; display: flex; align-items: center; gap: 16px; box-sizing: border-box;
  padding: 16px 20px; border-radius: 20px; overflow: hidden; text-align: left;
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif; color: #fff;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c1) 28%, transparent), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--c2) 32%, transparent), transparent 60%),
    rgba(12, 11, 20, .88);
  border: 1px solid color-mix(in srgb, var(--c1) 45%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: ksmCardIn .7s cubic-bezier(.2, .9, .3, 1.2) both;
}
.ksm-fete-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .10) 50%, transparent 65%);
  transform: translateX(-100%); animation: ksmShine2 6s ease-in-out 1s infinite;
}
@keyframes ksmShine2 { 40%, 100% { transform: translateX(100%); } }
@keyframes ksmCardIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.ksm-fete-emoji {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1; color: var(--ic, var(--ksm-gold, #E8B84B));
  background: color-mix(in srgb, var(--ic, #E8B84B) 16%, rgba(255, 255, 255, .04));
  border: 1px solid color-mix(in srgb, var(--ic, #E8B84B) 55%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--ic, #E8B84B) 30%, transparent);
  animation: ksmBob 3.2s ease-in-out infinite; cursor: pointer; user-select: none;
}
@keyframes ksmBob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.ksm-fete-emoji .ksm-fete-ico, .ksm-fete-pill .ksm-fete-ico { width: 58%; height: 58%; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.ksm-fete-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ksm-fete-txt strong {
  font-family: 'Bebas Neue', 'Inter', sans-serif; font-weight: 400; font-size: 26px; letter-spacing: 1.5px; line-height: 1;
  background: linear-gradient(90deg, #fff, var(--c1)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ksm-fete-txt span { font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
.ksm-fete-txt em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--c1); }
.ksm-fete-x {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .7); font-size: 15px; line-height: 28px; text-align: center; padding: 0;
}
.ksm-fete-x:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.ksm-fete-x:focus-visible, .ksm-fete-pill:focus-visible { outline: 2px solid var(--ksm-gold, #E8B84B); outline-offset: 2px; }

/* Emplacements intégrés (accueil, réserver, boutique) */
[data-ksm-fete-slot]:empty { display: none; }
[data-ksm-fete-slot] { max-width: 760px; margin: 0 auto 22px; padding: 0 4px; }
[data-ksm-fete-slot="reserver"] { padding-top: 18px; max-width: 920px; }
[data-ksm-fete-slot="beats"] { max-width: 1100px; padding-top: 14px; }
[data-ksm-fete-slot="accueil"] { margin-bottom: 26px; }
[data-ksm-fete-slot="accueil"] .ksm-fete-card { justify-content: center; text-align: left; }

/* Carte flottante (pages sans emplacement) */
.ksm-fete-toast {
  position: fixed; left: 18px; bottom: 18px; z-index: 99995; width: min(380px, calc(100vw - 36px));
  transition: transform .45s cubic-bezier(.2, .9, .3, 1), opacity .3s;
}
.ksm-fete-toast .ksm-fete-card { padding-right: 40px; }
.ksm-fete-toast.is-min { transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }
body.kp-has-dock .ksm-fete-toast, body.kp-has-dock .ksm-fete-pill { bottom: 108px; }
.ksm-fete-pill {
  position: fixed; left: 18px; bottom: 18px; z-index: 99994; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 24px; line-height: 48px; text-align: center; padding: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(12, 11, 20, .9); box-shadow: 0 8px 24px rgba(0, 0, 0, .45), 0 0 0 2px color-mix(in srgb, var(--ic, var(--ksm-gold, #E8B84B)) 70%, transparent);
  transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.ksm-fete-pill.is-on { transform: scale(1); }
.ksm-fete-preview {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 100002; padding: 6px 12px; border-radius: 999px;
  background: #111; color: #fff; font: 700 11px/1.4 'Inter', sans-serif; letter-spacing: .5px; border: 1px solid var(--ksm-gold, #E8B84B);
}

/* Couche d'animation */
.ksm-fete-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 99993; transition: opacity 1.2s; }

@media (max-width: 600px) {
  .ksm-fete-card { padding: 14px 16px; gap: 12px; border-radius: 16px; }
  .ksm-fete-emoji { width: 46px; height: 46px; font-size: 24px; }
  .ksm-fete-txt strong { font-size: 21px; }
  .ksm-fete-txt span { font-size: 12.5px; }
  .ksm-fete-toast { left: 10px; bottom: 10px; width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  html.ksm-fete body::before, .ksm-fete-card, .ksm-fete-card::after, .ksm-fete-emoji { animation: none !important; }
  .ksm-fete-fx { display: none !important; }
}

/* 4.9.1 — icône de la fête en chapeau sur les logos */
.ksm-fete-chapeau {
  position: absolute; z-index: 5; pointer-events: none; display: block; width: 26px; height: 26px; padding: 3px; border-radius: 50%;
  background: rgba(12, 11, 20, .92); box-shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 0 0 1.5px color-mix(in srgb, var(--ic, #E8B84B) 75%, transparent);
  transform: rotate(14deg); animation: ksmChapeau .6s cubic-bezier(.3, 1.6, .5, 1) both;
}
.ksm-fete-chapeau svg { width: 100%; height: 100%; display: block; }
@keyframes ksmChapeau { from { transform: rotate(14deg) scale(0); } to { transform: rotate(14deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .ksm-fete-chapeau { animation: none; } }
