/* /css/incarnon.css — Rotations Incarnon
   - Carrousel simple (3 visibles max)
   - Aucune surcouche qui bloque le header
   - Aucune modif globale hors Incarnon
*/

/* ===================== Variables ===================== */
:root {
  --stage-pad-y: 36px;

  /* Carrousel */
  --gap: 16px;
  --card-w: 420px;
  --easing: cubic-bezier(.22,.61,.36,1);

  /* Carte */
  --card-h: 560px;
  --head-pad: 14px;

  /* Vitesses */
  --slide-speed: 640ms;
  --slide-ease: cubic-bezier(.22,.61,.36,1);
  --slide-speed-user: 460ms;
}

@media (max-width:1100px){
  :root { --card-w: 380px; --card-h: 520px; }
}
@media (max-width: 820px){
  :root { --card-w: 340px; --card-h: 500px; }
}
@media (max-width: 640px){
  :root { --card-w: 300px; --card-h: 480px; }
}

/* ====================== Scène ======================= */

.stage {
  background: var(--surface-section-dark, #050b10);
  padding: var(--stage-pad-y) 0 calc(var(--stage-pad-y) - 12px);
  position: relative;
  z-index: 0; /* toujours sous le header */
}

/* ================== Deck / Viewport ================= */

.deck {
  display: block;
}

.deck .viewport {
  width: calc(var(--card-w) * 3 + var(--gap) * 2);
  max-width: calc(100vw - 32px);
  margin-inline: auto;
  overflow: hidden;
  position: relative;
}

/* Voiles décoratifs: visuels seulement */
.deck .viewport::before,
.deck .viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  pointer-events: none; /* ne bloque rien */
  z-index: 1;
}
.deck .viewport::before {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,.18), transparent);
}
.deck .viewport::after {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,.18), transparent);
}

/* ======================== Track ===================== */

.deck .track {
  display: flex;
  gap: var(--gap);
  transform: translateX(0);
  transition: transform var(--slide-speed) var(--slide-ease);
  will-change: transform;
}

.deck.moving .track {
  transition-duration: var(--slide-speed-user);
}

/* ==================== Cell / états ================== */

.cell {
  flex: 0 0 var(--card-w);
  position: relative;
  z-index: 0;
}

.cell.is-left,
.cell.is-right {
  z-index: 1;
}
.cell.is-center {
  z-index: 2;
}

/* ====================== Carte ======================= */

.card {
  min-height: var(--card-h);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 12px;

  color: var(--text-primary, #eaf1f4);
  background: var(--card-bg, rgba(5,12,16,0.98));
  border: 1px solid var(--card-stroke, rgba(234,217,172,.14));
  border-radius: 16px;
  outline: 2px solid var(--card-outline, rgba(234,217,172,.06));
  outline-offset: -6px;
  box-shadow: var(--card-shadow, 0 14px 40px rgba(0,0,0,.5));

  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Halo doux */
.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(220px 220px at center,
              rgba(234,217,172,.16) 0%,
              rgba(234,217,172,.10) 40%,
              transparent 70%);
  transform: rotate(var(--halo-angle, 0deg));
  filter: blur(16px);
  pointer-events: none;
  opacity: .7;
  z-index: 0;
}

/* Focus centre vs côtés */
.cell .card {
  transition:
    transform calc(var(--slide-speed) * .4) var(--slide-ease),
    opacity calc(var(--slide-speed) * .4) ease;
  transform: scale(.95);
  opacity: .85;
}
.cell.is-center .card {
  transform: scale(1);
  opacity: 1;
}

/* ======================== En-tête ==================== */

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--head-pad);
  background: color-mix(in srgb,
              var(--card-bg, #050b10) 20%,
              #ffffff 65%);
  border: 1px solid color-mix(in srgb,
              var(--card-stroke, rgba(0,0,0,.4)) 80%,
              #ffffff 15%);
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

.meta h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
  color: var(--gold-strong, #d7bc83);
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(0,0,0,.08);
  color: #1f2124;
  border: 1px solid rgba(0,0,0,.12);
  margin-right: 8px;
}

.badge.now {
  background: #ead9ac;
  border-color: #ead9ac;
  color: #1f2124;
}

.follow-week {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(201,171,114,.9);
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg,#e3cc98 0%,#c9ab72 100%);
  color: #372a14;
  font-weight: 600;
  font-family: "Marcellus", serif;
}
.follow-week:hover {
  filter: brightness(1.03) saturate(1.02);
}

/* ===================== Liste d’armes ================= */

.list {
  padding: 10px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  overflow: auto;
  overscroll-behavior: contain;
}

.item {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.03);
}
.item:last-child {
  margin-bottom: 0;
}

.thumb {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.1);
  background: #000;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.name {
  font-size: 16px;
}

/* ======================== Dots ====================== */

#dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 0 6px;
}

#dots button {
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text-primary, #eaeff3);
  opacity: .95;
  position: relative;
  cursor: pointer;
  transition:
    transform .12s ease,
    background .2s ease,
    border-color .2s ease;
}

#dots button[aria-current="true"] {
  background: #ead9ac;
  border-color: #ead9ac;
  color: #0a1318;
  transform: translateY(-1px);
}

#dots .bar {
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0%;
  background: #ead9ac;
  border-radius: 2px;
  transition: width 6s linear;
}

#dots button.run .bar {
  width: 100%;
}

#dots.paused .bar {
  width: 0 !important;
  transition: none;
}

/* ============== Accessibilité motion-safe ============ */

@media (prefers-reduced-motion: reduce){
  .deck .track,
  .cell .card,
  #dots .bar {
    transition: none !important;
  }
}

/* ================== Sécurité header ================== */

/* Rien dans la scène Incarnon ne crée de voile global */
.stage::before,
.stage::after {
  content: none;
}

/* Les éléments purement décoratifs ne captent JAMAIS les clics */
.deck .viewport::before,
.deck .viewport::after,
.card::before {
  pointer-events: none;
}

/* On force la scène en-dessous de tout overlay global éventuel */
.stage,
.deck,
.deck * {
  z-index: 0;
}
