/* ==========================================================================
   EFFET MER — Showcase animé (em-showcase.css)
   Deux modes : data-mode="ring"  → anneau 3D rotatif
                data-mode="wheel" → roue de la fortune
   Reprend le thème du site : verre sombre, Arial, cyan #83deed.
   ========================================================================== */

.em-show {
  /* Primitifs */
  --em-cyan: #83deed;
  --em-blue-1: #00b4d8;
  --em-blue-2: #0077b6;
  --em-ink: #f6fafc;
  --em-muted: #e0e9ee;
  /* Sémantiques */
  --em-panel: rgba(16, 24, 31, .68);
  --em-border: rgba(255, 255, 255, .18);
  --em-line: rgba(255, 255, 255, .14);
  --em-accent: var(--em-cyan);
  --em-cta: linear-gradient(135deg, var(--em-blue-1), var(--em-blue-2));
  /* Composant */
  --em-radius: 14px;
  --em-pad: clamp(18px, 3.4vw, 40px);

  position: relative; z-index: 1;
  margin-top: 32px;
  padding: clamp(24px, 4vw, 46px) 0;
  background: var(--em-panel);
  border: 1px solid var(--em-border);
  border-radius: 22px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .27);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--em-ink);
  overflow: hidden;
  color-scheme: dark;
}
@media (max-width: 600px) { .em-show { margin-top: 22px; border-radius: 18px; } }

.em-show__items { display: none; }          /* source des photos, lue par le JS */
.em-show:not(.em-ready) .em-show__items {   /* sans JS : simple grille défilante */
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0; padding: 0 var(--em-pad); list-style: none;
}
.em-show:not(.em-ready) .em-show__items li { flex: 0 0 60%; max-width: 260px; scroll-snap-align: start; }
.em-show:not(.em-ready) .em-show__items img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--em-radius); }

.em-show__head { padding: 0 var(--em-pad); margin-bottom: clamp(8px, 2vw, 18px); }
.em-show__eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--em-accent); }
.em-show__title { margin: 0; color: var(--em-accent); font-size: clamp(26px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.em-show__title em { font-style: normal; color: var(--em-ink); }

/* ---------- Barre de contrôle commune ---------- */
.em-show__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--em-pad) 0;
}
.em-show__cap { flex: 1; min-width: 0; text-align: center; }
.em-show__tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--em-accent); }
.em-show__alt { display: block; margin-top: 4px; font-size: clamp(15px, 1.6vw, 18px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-show__count { display: block; margin-top: 2px; font-size: 12px; color: var(--em-muted); opacity: .7; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.em-ctl {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--em-border); background: rgba(255,255,255,.04); color: var(--em-ink);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.em-ctl:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.em-ctl svg { width: 18px; height: 18px; }
.em-show button:focus-visible, .em-ring:focus-visible, .em-wheel-box:focus-visible { outline: 3px solid var(--em-accent); outline-offset: 4px; }

/* ==========================================================================
   A. ANNEAU 3D
   ========================================================================== */
.em-ring {
  --card-w: clamp(150px, 40vw, 230px);
  position: relative;
  height: calc(var(--card-w) * 1.25 + 70px);
  perspective: 1100px;
  perspective-origin: 50% 42%;
  touch-action: pan-y;                 /* le scroll vertical de la page reste libre */
  user-select: none; -webkit-user-select: none;
  cursor: grab;
  outline: none;
}
.em-ring.is-dragging { cursor: grabbing; }
.em-ring::after {                      /* ombre au sol */
  content: ""; position: absolute; left: 50%; bottom: 14px;
  width: min(80%, 620px); height: 40px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent);
  pointer-events: none;
}
.em-ring__stage {
  position: absolute; left: 50%; top: 22px;
  width: var(--card-w); height: calc(var(--card-w) * 1.25);
  margin-left: calc(var(--card-w) / -2);
  transform-style: preserve-3d;
  will-change: transform;
}
.em-ring__card {
  position: absolute; inset: 0;
  padding: 0; border: 0; border-radius: var(--em-radius);
  overflow: hidden; cursor: pointer;
  background: rgba(255,255,255,.06);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  -webkit-tap-highlight-color: transparent;
}
.em-ring__card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.em-ring__card.is-front { box-shadow: 0 0 0 2px var(--em-accent), 0 22px 50px rgba(0,0,0,.45); }

/* ==========================================================================
   B. ROUE DE LA FORTUNE
   ========================================================================== */
.em-wheel-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: clamp(20px, 4vw, 48px);
  padding: 0 var(--em-pad);
}
.em-feature {
  position: relative; margin: 0;
  aspect-ratio: 4 / 5; max-width: 100%; max-height: 560px;
  justify-self: center; width: min(100%, 448px);
  border-radius: var(--em-radius); overflow: hidden;
  box-shadow: 0 22px 50px rgba(0,0,0,.4);
  cursor: zoom-in;
  background: rgba(255,255,255,.06);
}
.em-feature img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .55s ease, transform 1.4s cubic-bezier(.22,.8,.24,1);
}
.em-feature img.is-hidden { opacity: 0; transform: scale(1.06); }
.em-feature button { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }

.em-wheel-box {
  --size: clamp(300px, 36vw, 460px);
  position: relative; width: var(--size); max-width: 100%;
  padding-top: 22px;                   /* place pour le pointeur */
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  outline: none;
}
.em-wheel {
  position: relative; width: var(--size); height: var(--size); max-width: 100%;
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle, rgba(8,25,35,.0) 58%, rgba(8,25,35,.55) 100%),
    repeating-conic-gradient(from calc(var(--seg) / -2),
      rgba(131,222,237,.20) 0 var(--seg),
      rgba(255,255,255,.04) var(--seg) calc(var(--seg) * 2));
  border: 6px solid rgba(131,222,237,.55);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 24px 60px rgba(0,0,0,.45), inset 0 0 40px rgba(0,0,0,.35);
  will-change: transform;
  cursor: grab;
}
.em-wheel-box.is-dragging .em-wheel { cursor: grabbing; }
.em-wheel__thumb {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--size) * .16); height: calc(var(--size) * .16);
  margin: calc(var(--size) * -.08) 0 0 calc(var(--size) * -.08);
  transform: rotate(var(--a)) translateY(calc(var(--size) * -.37));
  padding: 0; border: 2px solid rgba(255,255,255,.75); border-radius: 50%;
  overflow: hidden; cursor: pointer; background: #10232d;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  transition: border-color .3s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
}
.em-wheel__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.em-wheel__thumb.is-active { border-color: var(--em-accent); box-shadow: 0 0 0 3px rgba(131,222,237,.45), 0 6px 16px rgba(0,0,0,.4); }

.em-wheel__hub {
  position: absolute; left: 50%; top: calc(22px + var(--size) / 2);
  width: calc(var(--size) * .27); height: calc(var(--size) * .27);
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 4px solid rgba(255,255,255,.9);
  background: var(--em-cta); color: #fff;
  box-shadow: 0 10px 26px rgba(0,119,182,.45);
  font-family: inherit; font-weight: 700; font-size: clamp(12px, 1.3vw, 15px); line-height: 1.15;
  text-transform: uppercase; letter-spacing: .06em;
  cursor: pointer; z-index: 2;
  transition: transform .2s;
}
.em-wheel__hub:hover { transform: translate(-50%, -50%) scale(1.05); }
.em-wheel__hub:active { transform: translate(-50%, -50%) scale(.96); }
.em-wheel__hub small { display: block; font-size: .72em; font-weight: 400; opacity: .85; letter-spacing: .1em; }

.em-wheel__pointer {
  position: absolute; left: 50%; top: 4px; z-index: 3;
  width: 30px; height: 36px; margin-left: -15px;
  background: var(--em-accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.45));
  transform-origin: 50% 10%;
}
.em-wheel__pointer.is-tick { animation: em-tick .16s ease-out; }
@keyframes em-tick { 0% { transform: rotate(-22deg); } 100% { transform: rotate(0); } }

.em-wheel-wrap { min-width: 0; display: grid; justify-items: center; }
.em-wheel-hint { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--em-muted); opacity: .75; }

/* Mobile : grande photo en haut, demi-roue en dessous */
@media (max-width: 760px) {
  .em-wheel-layout { grid-template-columns: 1fr; gap: 16px; }
  .em-feature { width: 100%; max-height: 50svh; }
  .em-wheel-box { --size: min(calc(100vw - 64px), 420px); justify-self: center; height: calc(22px + var(--size) * .64); overflow: hidden; }
}

/* ==========================================================================
   Lightbox commune
   ========================================================================== */
.em-lb {
  position: fixed; inset: 0; z-index: 9999;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5, 15, 22, .97); color: #fff;
  overscroll-behavior: contain;
}
.em-lb::backdrop { background: rgba(5,15,22,.9); }
.em-lb[open] { display: flex; flex-direction: column; animation: em-fade .3s ease; }
@keyframes em-fade { from { opacity: 0; } to { opacity: 1; } }
.em-lb__top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; }
.em-lb__count { font-size: 13px; letter-spacing: .14em; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.em-lb__close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.em-lb__track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0; padding: 0; list-style: none; }
.em-lb__track::-webkit-scrollbar { display: none; }
.em-lb__item { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; padding: 0 12px; }
.em-lb__item img { max-width: 100%; max-height: 100%; aspect-ratio: 4/5; object-fit: contain; border-radius: var(--em-radius, 14px); user-select: none; }
.em-lb__cap { margin: 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 16px; min-height: 3.2em; }

@media (prefers-reduced-motion: reduce) {
  .em-show *, .em-lb { animation: none !important; transition: none !important; }
}
