/* scenes.css — styles spécifiques aux écrans */

/* ============ ACCUEIL ============ */
.home-content {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  justify-items: center;
  gap: clamp(1.05rem, 4.5vh, 2.2rem);
  text-align: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + clamp(2.4rem, 5.8vh, 4rem))
    clamp(1rem, 4.2vw, 1.7rem)
    calc(env(safe-area-inset-bottom, 0px) + clamp(0.8rem, 2.8vh, 1.35rem));
  background: linear-gradient(to top, rgba(20, 6, 30, 0.85) 28%, rgba(20, 6, 30, 0) 72%);
}
.home-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.42rem, 1.7vh, 0.82rem);
  width: min(100%, 25rem);
  min-height: 0;
}
.home-logo {
  display: block;
  width: clamp(7.4rem, 38vmin, 10rem);
  max-height: clamp(5.5rem, 22vmin, 7.25rem);
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.46));
  pointer-events: none;
  user-select: none;
  animation:
    home-title-enter 0.9s ease both,
    home-title-float 3.6s ease-in-out 0.9s infinite;
}
.home-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.15rem, 9.5vmin, 3.1rem);
  line-height: 0.98;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3b12, 0 6px 18px rgba(0, 0, 0, 0.6);
  max-width: 10ch;
  text-wrap: balance;
  animation:
    home-title-enter 0.9s ease both,
    home-title-float 3.6s ease-in-out 0.9s infinite;
}
@keyframes home-title-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes home-title-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.home-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 5.1vmin, 1.48rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.18;
  color: var(--cream);
  max-width: min(100%, 23rem);
  margin: clamp(0.35rem, 1.4vh, 0.7rem) auto 0;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}
.home-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.68rem, 2.2vh, 0.95rem);
  width: min(100%, 22.5rem);
  padding-bottom: 0.1rem;
}
.home-actions .btn {
  width: 100%;
  min-height: clamp(3.45rem, 12vmin, 4rem);
  padding-inline: 1rem;
  font-size: clamp(1.06rem, 4.7vmin, 1.26rem);
  line-height: 1.05;
  white-space: normal;
}
@media (min-width: 700px) {
  .home-content {
    padding:
      calc(env(safe-area-inset-top, 0px) + clamp(4rem, 9vh, 6rem))
      1.7rem
      calc(env(safe-area-inset-bottom, 0px) + clamp(1.2rem, 3vh, 1.8rem));
  }
  .home-logo {
    width: clamp(7rem, 20vmin, 9.4rem);
    max-height: clamp(5rem, 14vmin, 6.8rem);
  }
  .home-title {
    font-size: clamp(2rem, 5.6vmin, 3rem);
  }
  .home-subtitle {
    font-size: clamp(1.05rem, 2.8vmin, 1.36rem);
  }
  .home-actions .btn {
    min-height: clamp(3.1rem, 7vmin, 3.75rem);
    font-size: clamp(1rem, 2.5vmin, 1.18rem);
  }
}
.menu-avatar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  margin: calc(env(safe-area-inset-top, 0px) + 0.55rem) 0.55rem 0.55rem;
  width: clamp(34px, 9vw, 44px);
  height: clamp(34px, 9vw, 44px);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  background: rgba(26, 6, 38, 0.6);
  animation: menu-avatar-pop 0.45s cubic-bezier(0.22, 1.2, 0.4, 1) both;
}
.menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes menu-avatar-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* Carte : réserver la place de l’avatar pour centrer les plumes entre lui et les boutons */
#game:has(.menu-avatar) .hud > .hud-group:first-child {
  width: clamp(34px, 9vw, 44px);
  flex-shrink: 0;
}
#game:has(.menu-avatar) .hud {
  column-gap: 0.45rem;
}
#game:has(.menu-avatar) .hud-feathers-slot {
  padding-inline-end: 0.35rem;
}
#game:has(.menu-avatar) .hud-feathers.has-gold {
  padding-right: 0.95rem;
}

/* ============ INTRO ============ */
.intro-stage {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.6rem;
  padding: 2rem;
  text-align: center;
}
.intro-text {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 6vmin, 2rem);
  line-height: 1.35;
  color: var(--cream);
  max-width: 24ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.intro-text.fade-in {
  animation: fade-in 0.5s ease both;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.intro-dots {
  display: flex;
  gap: 0.5rem;
}
.intro-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: rgba(255, 246, 233, 0.3);
  transition: background 0.2s, transform 0.2s;
}
.intro-dot.is-active {
  background: var(--pink);
  transform: scale(1.3);
}
.tap-hint {
  position: absolute;
  bottom: 2.2rem;
  font-size: clamp(0.98rem, 3.8vmin, 1.16rem);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: rgba(255, 246, 233, 0.7);
  animation: pulse 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---- Intro : planches de BD (parallaxe) ---- */
.comic-parallax {
  gap: 0.6rem;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, rgba(42, 18, 58, 0.55), transparent 58%),
    radial-gradient(ellipse 90% 60% at 80% 90%, rgba(18, 8, 32, 0.7), transparent 55%),
    rgba(8, 4, 14, 0.72);
}

.comic-parallax-viewport {
  --tilt-x: 0;
  --tilt-y: 0;
  --comic-depth: 0;
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  perspective: 1400px;
  touch-action: pan-y pinch-zoom;
}

.comic-parallax-bg {
  position: absolute;
  inset: -12%;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.35s ease-out;
}
.comic-parallax-bg--far {
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 120, 180, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 78% 72%, rgba(120, 180, 255, 0.1) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(255, 210, 140, 0.08) 0%, transparent 45%);
  transform: translate3d(
      calc(var(--tilt-x) * 28px + var(--comic-depth) * 22px),
      calc(var(--tilt-y) * 22px),
      0
    )
    scale(1.12);
  opacity: 0.9;
}
.comic-parallax-bg--mid {
  background:
    radial-gradient(ellipse 55% 40% at 50% 45%, rgba(255, 246, 233, 0.06) 0%, transparent 70%),
    linear-gradient(165deg, transparent 30%, rgba(0, 0, 0, 0.25) 100%);
  transform: translate3d(
      calc(var(--tilt-x) * 14px + var(--comic-depth) * 12px),
      calc(var(--tilt-y) * 10px),
      0
    )
    scale(1.05);
}

.comic-parallax-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.comic-parallax-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.1rem 3.4rem;
  overflow: hidden;
}

.comic-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-32%, 0, 0) scale(0.92);
  filter: blur(2px);
}

.comic-panel-layers {
  position: relative;
  max-width: min(100%, 560px);
  max-height: 72vh;
  width: 100%;
  transform-style: preserve-3d;
  transform: translate3d(
      calc(var(--tilt-x) * -16px),
      calc(var(--tilt-y) * -12px),
      0
    )
    rotateX(calc(var(--tilt-y) * -5deg))
    rotateY(calc(var(--tilt-x) * 5deg));
  transition: transform 0.32s ease-out;
}

.comic-panel-shadow {
  position: absolute;
  inset: 8% -4% -6%;
  background: radial-gradient(ellipse 80% 60% at 50% 80%, rgba(0, 0, 0, 0.55), transparent 70%);
  transform: translate3d(
      calc(var(--tilt-x) * 8px),
      calc(var(--tilt-y) * 6px + 12px),
      -40px
    )
    scale(0.98);
  filter: blur(8px);
  pointer-events: none;
}

.comic-panel-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 246, 233, 0.08);
}

.comic-panel-gloss {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 10px;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 38%,
    transparent 62%,
    rgba(255, 255, 255, 0.04) 100%
  );
  transform: translate3d(
      calc(var(--tilt-x) * -6px),
      calc(var(--tilt-y) * -4px),
      24px
    );
  pointer-events: none;
}

.comic-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  filter: none;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 0.5s ease,
    transform 0.65s cubic-bezier(0.22, 0.85, 0.3, 1),
    filter 0.5s ease;
}

.comic-panel.is-past {
  opacity: 0;
  transform: translate3d(108%, 0, 0) scale(0.9);
  filter: blur(4px);
}

.comic-panel.is-enter {
  animation: comic-panel-enter 0.92s cubic-bezier(0.22, 0.85, 0.3, 1) both;
  pointer-events: none;
}

.comic-panel.is-exit {
  animation: comic-panel-exit 0.88s cubic-bezier(0.45, 0.05, 0.2, 1) both;
  pointer-events: none;
  z-index: 0;
}

.comic-panel.is-enter,
.comic-panel.is-exit {
  z-index: 2;
}

@keyframes comic-panel-enter {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translate3d(-58%, 0, 0) scale(0.9) rotateY(7deg);
  }
  55% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 1;
    filter: none;
    transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
  }
}

@keyframes comic-panel-exit {
  from {
    opacity: 1;
    filter: none;
    transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
  }
  to {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(78%, 0, 0) scale(0.86) rotateY(-9deg);
  }
}

.comic-parallax .intro-dots {
  position: relative;
  z-index: 3;
  margin-bottom: 0.2rem;
}

.comic-parallax-hint {
  position: relative;
  z-index: 3;
  bottom: auto;
  margin: 0 0 1.6rem;
  padding: 0 1rem;
}

/* ---- Intro BD plein écran ---- */
.comic-parallax--fullscreen.intro-stage {
  gap: 0;
  padding: 0;
  justify-content: stretch;
  background: #08040e;
}

.comic-parallax--fullscreen .comic-parallax-viewport {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.comic-parallax--fullscreen .comic-parallax-bg--far,
.comic-parallax--fullscreen .comic-parallax-bg--mid {
  opacity: 0;
}

.comic-parallax--fullscreen .comic-parallax-track {
  position: absolute;
  inset: 0;
  padding: 0;
}

.comic-parallax--fullscreen .comic-panel {
  padding: 0;
}

.comic-parallax--fullscreen .comic-panel-layers--fullscreen {
  position: absolute;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  transform: none;
  transition: none;
}

.comic-panel-img--fullscreen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  box-shadow: none;
}

.comic-panel-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 42%, rgba(8, 4, 14, 0.42) 100%),
    linear-gradient(180deg, rgba(8, 4, 14, 0.22) 0%, transparent 28%, transparent 52%, rgba(8, 4, 14, 0.78) 100%);
}

.comic-panel-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: min(48vh, 22rem);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(26, 6, 38, 0.35) 38%,
    rgba(12, 4, 20, 0.88) 100%
  );
}

.comic-parallax--fullscreen .comic-panel-shadow,
.comic-parallax--fullscreen .comic-panel-gloss {
  display: none;
}

.comic-narration {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(3.6rem, 11vh, 5.2rem);
  z-index: 6;
  display: flex;
  justify-content: center;
  padding: 0 clamp(0.85rem, 4vw, 1.4rem);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease 0.22s,
    transform 0.55s cubic-bezier(0.22, 0.85, 0.3, 1) 0.22s;
}

.comic-panel-scrim--top {
  top: 0;
  bottom: auto;
  background: linear-gradient(
    180deg,
    rgba(12, 4, 20, 0.88) 0%,
    rgba(26, 6, 38, 0.35) 62%,
    transparent 100%
  );
}

.comic-narration.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.comic-narration--top {
  top: clamp(1rem, 4.5vh, 1.8rem);
  bottom: auto;
  transform: translateY(-18px);
}

.comic-narration--top.is-visible {
  transform: translateY(0);
}

.comic-narration__card {
  position: relative;
  width: min(100%, 28rem);
  padding: 0.72rem 0.95rem 0.82rem 1.1rem;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(255, 252, 245, 0.98) 0%, rgba(255, 246, 233, 0.96) 100%);
  border: 2px solid var(--gold);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 3px 0 rgba(201, 152, 44, 0.3);
  animation: comic-narration-card-in 0.55s cubic-bezier(0.22, 1.08, 0.36, 1) both;
}

.comic-narration.is-visible .comic-narration__card {
  animation: comic-narration-card-in 0.55s cubic-bezier(0.22, 1.08, 0.36, 1) both;
}

.comic-narration__card::after {
  content: '“';
  position: absolute;
  top: -0.1rem;
  left: 0.45rem;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: rgba(201, 152, 44, 0.4);
  pointer-events: none;
}

.comic-narration__text {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-left: 0.15rem;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4.6vmin, 1.2rem);
  font-weight: 700;
  line-height: 1.34;
  color: var(--ink);
  text-wrap: pretty;
  text-align: left;
  letter-spacing: 0.01em;
}

@keyframes comic-narration-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.comic-parallax--fullscreen .intro-dots {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 3.55rem);
  z-index: 8;
  transform: translateX(-50%);
  margin-bottom: 0;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  background: rgba(8, 4, 14, 0.42);
  backdrop-filter: blur(6px);
}

.comic-parallax--fullscreen .intro-dot {
  width: 0.5rem;
  height: 0.5rem;
}

.comic-parallax--fullscreen .comic-parallax-hint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.65rem);
  z-index: 8;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  margin: 0;
  padding: 0.42rem 1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  text-align: center;
  font-size: clamp(0.95rem, 3.8vmin, 1.08rem);
  font-weight: 600;
  color: rgba(255, 246, 233, 0.92);
  background: rgba(8, 4, 14, 0.48);
  border: 1px solid rgba(255, 246, 233, 0.14);
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  animation: pulse 1.6s ease-in-out infinite;
}

@media (max-width: 520px) {
  .comic-narration__text {
    font-size: clamp(1.12rem, 5.4vmin, 1.3rem);
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: 0.015em;
  }

  .comic-narration__card {
    padding: 0.8rem 1.05rem 0.9rem 1.2rem;
  }

  .comic-parallax--fullscreen .comic-parallax-hint {
    font-size: clamp(1rem, 4.2vmin, 1.12rem);
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comic-parallax-bg,
  .comic-panel-layers {
    transform: none;
    transition: none;
  }
  .comic-panel.is-enter,
  .comic-panel.is-exit {
    animation: none;
  }
  .comic-panel.is-active {
    transition: opacity 0.2s ease;
  }
  .comic-narration {
    transition: opacity 0.15s ease;
  }
  .comic-narration__card {
    animation: none;
  }
}

.intro-stage.is-leaving {
  animation: intro-stage-out 0.38s ease both;
  pointer-events: none;
}
@keyframes intro-stage-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.98); }
}

/* ---- Créateur d'avatar (étapes + aperçu) ---- */
.avatar-create .avatar-title,
.avatar-create .avatar-step,
.avatar-create .avatar-footer {
  opacity: 0;
}
.avatar-create.is-enter {
  animation: avatar-create-in 0.5s cubic-bezier(0.22, 0.85, 0.3, 1) both;
}
@keyframes avatar-create-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.avatar-create.is-enter .avatar-title {
  animation: home-title-enter 0.65s ease 0.06s both;
}
.avatar-create.is-enter .avatar-step {
  animation: fade-in 0.5s ease both;
}
.avatar-create.is-enter .avatar-step:nth-child(1) { animation-delay: 0.14s; }
.avatar-create.is-enter .avatar-step:nth-child(2) { animation-delay: 0.24s; }
.avatar-create.is-enter .avatar-step:nth-child(3) { animation-delay: 0.34s; }
.avatar-create.is-enter .avatar-footer {
  animation: fade-in 0.55s ease 0.4s both;
}
.avatar-create.is-enter .avatar-preview {
  animation: menu-avatar-pop 0.5s cubic-bezier(0.22, 1.2, 0.4, 1) 0.46s both;
}
.avatar-create.is-enter .avatar-confirm {
  animation: fade-in 0.45s ease 0.52s both;
}

/* ---- Intro : saisie du pseudo ---- */
.player-name-prompt {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    to top,
    rgba(12, 4, 22, 0.9) 0%,
    rgba(12, 4, 22, 0.42) 42%,
    transparent 72%
  );
  pointer-events: none;
  animation: fade-in 0.35s ease both;
}
.player-name-panel {
  pointer-events: auto;
  width: min(100%, 340px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(42, 12, 58, 0.95), rgba(22, 6, 34, 0.98));
  border: 2px solid rgba(245, 196, 81, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.player-name-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 4.2vmin, 1.15rem);
  color: var(--cream);
  text-align: center;
  line-height: 1.3;
}
.player-name-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.player-name-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 2px solid rgba(245, 196, 81, 0.45);
  background: rgba(255, 246, 233, 0.08);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
.player-name-input::placeholder {
  color: rgba(255, 246, 233, 0.45);
  font-weight: 500;
}
.player-name-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.25);
}
.player-name-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ff8fa8;
  text-align: center;
}
.player-name-submit {
  width: 100%;
  margin-top: 0.15rem;
}

/* ---- Intro : choix d'avatar (legacy grid) ---- */
.avatar-stage {
  justify-content: center;
  gap: 1.1rem;
}
.avatar-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 7vmin, 2.4rem);
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3b12, 0 6px 18px rgba(0, 0, 0, 0.6);
}
.avatar-desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 4.4vmin, 1.3rem);
  color: var(--cream);
  max-width: 26ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.8rem, 3.5vmin, 1.4rem);
  width: min(100%, 380px);
}
.avatar-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 3px solid rgba(255, 246, 233, 0.35);
  border-radius: 18px;
  background: rgba(26, 6, 38, 0.55);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.avatar-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.avatar-tile:hover,
.avatar-tile:focus-visible {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(245, 196, 81, 0.7);
}
.avatar-create .avatar-row .avatar-tile:hover,
.avatar-create .avatar-row .avatar-tile:focus-visible {
  transform: translateY(-4px) scale(1.06);
}
.avatar-tile.is-selected {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 79, 151, 0.4), 0 8px 22px rgba(0, 0, 0, 0.5);
}
.avatar-tile.is-selected::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 8px;
  color: #fff;
  background: var(--pink);
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.avatar-tile--custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.28rem 0.18rem;
  color: var(--cream);
}
.avatar-custom-icon {
  font-size: clamp(0.9rem, 3.9vmin, 1.25rem);
  line-height: 1;
  color: var(--gold);
}
.avatar-custom-label {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(0.55rem, 2.35vmin, 0.72rem);
  line-height: 0.92;
  text-transform: uppercase;
}
.avatar-tile--custom .avatar-custom-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.025);
  background: rgba(26, 6, 38, 0.55);
}
.avatar-tile--custom.has-photo .avatar-custom-icon,
.avatar-tile--custom.has-photo .avatar-custom-label {
  display: none;
}
.avatar-confirm {
  width: min(100%, 320px);
}
.avatar-confirm:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---- Créateur d'avatar (étapes + aperçu) ---- */
.avatar-create {
  justify-content: flex-start;
  gap: clamp(0.8rem, 2.2vh, 1.15rem);
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 0.82rem calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
}
.avatar-create .avatar-title {
  font-size: clamp(1.9rem, 8.2vmin, 2.75rem);
  line-height: 0.98;
  margin-bottom: 0.05rem;
}
.avatar-steps {
  flex: 1 1 auto;
  width: min(100%, 520px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: clamp(0.82rem, 2.2vh, 1.12rem);
  justify-content: flex-start;
  padding: 0.05rem 0.12rem 0.25rem;
  scrollbar-width: none;
}
.avatar-steps::-webkit-scrollbar {
  display: none;
}
.avatar-step {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}
.avatar-step-title {
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 5.15vmin, 1.5rem);
  line-height: 1.05;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.avatar-row {
  --avatar-count: 4;
  --avatar-gap: clamp(0.34rem, 1.8vmin, 0.62rem);
  --avatar-tile-size: clamp(3.4rem, 17vmin, 5.5rem);
  display: grid;
  grid-template-columns: repeat(var(--avatar-count), var(--avatar-tile-size));
  justify-content: center;
  align-items: stretch;
  gap: var(--avatar-gap);
  width: 100%;
  max-width: min(100%, 520px);
  margin: 0 auto;
  overflow: visible;
  padding: 0.32rem 0.18rem 0.38rem;
  scrollbar-width: none;
}
.avatar-row::-webkit-scrollbar {
  display: none;
}
.avatar-row .avatar-tile {
  width: var(--avatar-tile-size);
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
}
.avatar-tile--accessory {
  background: rgba(26, 6, 38, 0.4);
}
.avatar-tile--accessory img {
  object-fit: contain;
  padding: 8%;
}
.avatar-tile--none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 6, 38, 0.55);
}
.avatar-none-icon {
  font-size: clamp(1.5rem, 6.4vmin, 1.95rem);
  color: var(--cream);
  pointer-events: none;
}
.avatar-footer {
  display: flex;
  align-items: center;
  gap: 0.82rem;
  width: min(100%, 520px);
  flex-shrink: 0;
}
.avatar-preview {
  position: relative;
  flex-shrink: 0;
  width: clamp(104px, 30vw, 136px);
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid var(--gold);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 246, 233, 0.98), rgba(255, 229, 241, 0.92) 62%, rgba(245, 196, 81, 0.5));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48);
}
.avatar-preview--editor {
  width: min(100%, 300px);
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: min(58vw, 280px);
  max-height: min(62vh, 320px);
  touch-action: none;
}
.avatar-preview--editor.is-adjust-mode,
.avatar-preview.is-adjust-mode {
  box-shadow:
    0 0 0 2px rgba(245, 196, 81, 0.9),
    0 10px 24px rgba(0, 0, 0, 0.48);
}
.avatar-layer {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  object-fit: contain;
  pointer-events: none;
}
.avatar-layer.is-adjustable {
  pointer-events: auto;
  touch-action: none;
}
.avatar-layer.is-adjusting {
  cursor: grab;
  filter: drop-shadow(0 0 8px rgba(245, 196, 81, 0.75));
}
.avatar-layer.is-adjusting:active {
  cursor: grabbing;
}
.avatar-layer[hidden] {
  display: none !important;
}
.avatar-layer--head { z-index: 1; object-position: center; }
.avatar-layer--head.is-photo {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.025);
}
.avatar-layer--hair { z-index: 2; object-position: center top; }
.avatar-layer--glasses { z-index: 3; object-position: center; }

/* Modal d'ajustement accessoires (cheveux / lunettes). */
.avatar-adjust-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 0.75rem) 0.85rem
    calc(env(safe-area-inset-bottom, 0px) + 0.85rem);
  background: rgba(10, 2, 18, 0.82);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.avatar-adjust-overlay.is-visible {
  opacity: 1;
}
.avatar-adjust-overlay[hidden] {
  display: none !important;
}
.avatar-adjust-modal {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(100%, 400px);
  max-height: 100%;
  padding: 1rem 1rem 1.1rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(36, 10, 52, 0.98), rgba(22, 6, 34, 0.98));
  border: 1.5px solid rgba(245, 196, 81, 0.48);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.58);
  animation: avatar-adjust-modal-in 0.32s cubic-bezier(0.22, 1.12, 0.36, 1) both;
}
@keyframes avatar-adjust-modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.avatar-adjust-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.avatar-adjust-modal__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4.6vmin, 1.28rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--cream);
}
.avatar-adjust-modal__close {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: rgba(26, 6, 38, 0.75);
  color: var(--cream);
  border: 1.5px solid rgba(245, 196, 81, 0.35);
  font-size: 1.05rem;
}
.avatar-adjust-controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  background: rgba(26, 6, 38, 0.55);
  border: 1px solid rgba(245, 196, 81, 0.22);
}
.avatar-adjust-hint {
  margin: 0;
  font-size: clamp(0.8rem, 3.3vmin, 0.94rem);
  line-height: 1.38;
  color: rgba(255, 246, 233, 0.9);
  text-align: center;
}
.avatar-adjust-scale {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.avatar-adjust-scale-label {
  flex-shrink: 0;
  min-width: clamp(4.6rem, 21vw, 6rem);
  font-size: clamp(0.82rem, 3.4vmin, 0.95rem);
  font-weight: 700;
  color: var(--gold);
}
.avatar-adjust-scale--size .avatar-adjust-scale-label {
  min-width: clamp(3.2rem, 14vw, 4rem);
}
.avatar-adjust-slider {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--gold);
}
.avatar-adjust-reset {
  flex-shrink: 0;
  min-height: 2.2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}
.avatar-adjust-done {
  width: 100%;
  min-height: 2.65rem;
  font-size: clamp(1rem, 4.2vmin, 1.15rem);
}
.avatar-create .avatar-confirm {
  flex: 1 1 auto;
  width: auto;
  min-height: clamp(3rem, 10.5vmin, 3.65rem);
  padding-inline: 0.8rem;
  font-size: clamp(1.05rem, 4.4vmin, 1.28rem);
  white-space: nowrap;
}

/* Menu « Prendre / Importer une photo ». */
.avatar-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(12, 3, 20, 0.62);
  animation: fade-in 0.2s ease both;
}
.avatar-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(100%, 360px);
  padding: 1rem;
  border-radius: 20px;
  background: rgba(26, 6, 38, 0.96);
  border: 1.5px solid rgba(245, 196, 81, 0.4);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  animation: avatar-sheet-in 0.34s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
@keyframes avatar-sheet-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.avatar-sheet .btn {
  width: 100%;
}

/* Webcam desktop — prise de photo. */
.webcam-capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 3, 20, 0.78);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.webcam-capture-overlay.is-visible {
  opacity: 1;
}
.webcam-capture-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(100%, 360px);
  padding: 1rem;
  border-radius: 20px;
  background: rgba(26, 6, 38, 0.96);
  border: 1.5px solid rgba(245, 196, 81, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.webcam-capture-video {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
  background: #000;
  transform: scaleX(-1);
}
.webcam-capture-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.webcam-capture-actions .btn {
  width: 100%;
}

/* ============ DÉCRETS ROYAUX ============ */
.decree-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 3.05rem)
    clamp(0.1rem, 0.8vw, 0.3rem)
    max(0.3rem, env(safe-area-inset-bottom, 0px));
  background: rgba(10, 2, 18, 0.72);
  animation: fade-in 0.35s ease both;
  touch-action: manipulation;
}
.decree-overlay.is-locked {
  cursor: default;
}
.decree-overlay:not(.is-locked) {
  cursor: pointer;
}
.decree-overlay--view {
  opacity: 0;
}
.decree-overlay--view.is-visible {
  opacity: 1;
  transition: opacity 0.28s ease;
}
.decree-overlay.is-leaving {
  animation: fade-in 0.28s ease reverse both;
}
.decree-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.55rem, 1.8vh, 0.8rem);
  width: 100%;
  max-height: 100%;
  min-height: 0;
}
.decree-stage > .decree-poster {
  width: min(100%, calc(100vw - 0.2rem));
  max-height: min(79dvh, calc((100vw - 0.2rem) * 4.1 / 3));
  aspect-ratio: 3 / 4.1;
}
.decree-poster {
  position: relative;
  container-type: inline-size;
  transform-origin: 50% 0%;
  opacity: 0;
  transform: perspective(900px) rotateX(72deg) scaleY(0.12);
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.55));
  transition:
    transform 0.72s cubic-bezier(0.22, 1.05, 0.32, 1),
    opacity 0.45s ease,
    filter 0.45s ease;
}
.decree-poster.is-open {
  opacity: 1;
  transform: perspective(900px) rotateX(0deg) scaleY(1);
}
.decree-poster.is-collecting {
  animation: decree-collect 0.68s cubic-bezier(0.45, 0, 0.75, 0.2) forwards;
  pointer-events: none;
}
@keyframes decree-collect {
  0% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) scale(1);
  }
  55% {
    opacity: 1;
    transform: translate(18%, -8%) scale(0.72) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translate(42%, -38%) scale(0.12) rotate(14deg);
  }
}
.decree-poster__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.decree-poster__text {
  position: absolute;
  left: 24%;
  right: 24%;
  top: 25%;
  bottom: 17%;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(3.45cqi, 3.85cqi, 4.15cqi);
  line-height: 1.35;
  font-weight: 600;
  color: #3a2210;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}
.decree-poster--thumb,
.decrees-card-thumb .decree-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}
.decree-tap-hint {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(0.64rem, 2.4vmin, 0.78rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 246, 233, 0.82);
  transition: opacity 0.35s ease 0.45s, visibility 0.35s ease 0.45s;
}
.decree-tap-hint.is-waiting {
  opacity: 0;
  visibility: hidden;
}

/* Galerie des décrets */
.decrees-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 3.6rem)
    0.75rem
    calc(env(safe-area-inset-bottom, 0px) + 1rem);
  background: linear-gradient(to bottom, rgba(20, 6, 30, 0.35) 0%, rgba(20, 6, 30, 0.92) 28%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 196, 81, 0.72) rgba(26, 6, 38, 0.55);
}
.decrees-panel::-webkit-scrollbar {
  width: 7px;
}
.decrees-panel::-webkit-scrollbar-track {
  background: rgba(26, 6, 38, 0.55);
  border-radius: 999px;
  margin: 0.4rem 0;
}
.decrees-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-radius: 999px;
  border: 1.5px solid rgba(20, 6, 30, 0.45);
  box-shadow: 0 0 8px rgba(245, 196, 81, 0.28);
}
.decrees-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffe08a, var(--gold));
}
.decrees-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 6.2vmin, 2rem);
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3b12, 0 5px 14px rgba(0, 0, 0, 0.55);
  margin: 0 0 0.2rem;
}
.decrees-count {
  margin: 0 0 0.65rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.88rem, 3.6vmin, 1rem);
  color: rgba(255, 246, 233, 0.82);
}
.decrees-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  width: min(100%, 22rem);
  flex: 0 0 auto;
  align-content: start;
  padding-bottom: 0.5rem;
}
.decrees-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 2px solid rgba(245, 196, 81, 0.42);
  background: rgba(26, 6, 38, 0.72);
  color: var(--cream);
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.decrees-card.is-locked {
  border-color: rgba(255, 246, 233, 0.16);
  filter: grayscale(0.85) brightness(0.72);
}
.decrees-card.is-collected:active {
  transform: scale(0.98);
}
.decrees-card-thumb {
  position: relative;
  aspect-ratio: 3 / 4.1;
  border-radius: 8px;
  overflow: hidden;
  background: #f4e8d0;
}
.decrees-card.is-locked .decrees-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.66);
  pointer-events: none;
}
.decrees-card.is-unlocking .decrees-card-thumb::after {
  animation: decrees-thumb-overlay-out 1.1s ease 0.18s both;
}
@keyframes decrees-thumb-overlay-out {
  0%,
  28% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
.decrees-card.is-locked .decree-poster__bg {
  filter: grayscale(0.9) brightness(0.45);
}
.decrees-card-label {
  font-weight: 800;
  font-size: clamp(0.78rem, 3.2vmin, 0.92rem);
  line-height: 1.1;
}
.decrees-card-status {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: var(--gold);
  font-size: 0.92rem;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
}
.decrees-card.is-collected .decrees-card-status {
  top: 0.38rem;
  right: 0.38rem;
}
.decrees-card.is-locked .decrees-card-status {
  left: 50%;
  right: auto;
  top: 42%;
  width: 2.85rem;
  height: 2.85rem;
  font-size: 1.22rem;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.84);
  transform: translate(-50%, -50%);
}
.decrees-card.is-unlocking .decrees-card-status {
  left: 50%;
  right: auto;
  top: 42%;
  width: 2.95rem;
  height: 2.95rem;
  font-size: 1.28rem;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.86);
  transform: translate(-50%, -50%);
  animation: decrees-unlock-burst 1.1s ease-out 0.18s both;
}
.decrees-lock-open {
  position: absolute;
  opacity: 0;
}
.decrees-card.is-unlocking {
  animation: decrees-card-unlock 1.1s cubic-bezier(0.22, 1.2, 0.38, 1) 0.18s both;
  pointer-events: none;
}
.decrees-card.is-unlocking .decrees-card-thumb .decree-poster__bg {
  animation: decrees-image-unlock 1.1s ease 0.18s both;
}
.decrees-card.is-unlocking .decrees-card-label {
  animation: decrees-card-unlock 1.1s cubic-bezier(0.22, 1.2, 0.38, 1) 0.18s both;
}
.decrees-card.is-unlocking .decrees-lock-closed {
  animation: decrees-lock-closed-out 1.1s ease-out 0.18s both;
}
.decrees-card.is-unlocking .decrees-lock-open {
  animation: decrees-lock-open-in 1.1s ease-out 0.18s both;
}
.decrees-card.is-unlock-settled {
  animation: map-card-settled 0.4s ease-out both;
}
.decrees-card.is-unlock-settled .decrees-card-status.is-settled {
  animation: map-status-settled 0.4s ease-out both;
}
@keyframes decrees-card-unlock {
  0% {
    transform: scale(0.97);
    filter: grayscale(0.75) brightness(0.78);
    border-color: rgba(255, 246, 233, 0.24);
  }
  55% {
    transform: scale(1.02);
    filter: grayscale(0) brightness(1.1);
    border-color: var(--gold);
  }
  100% {
    transform: scale(1);
    filter: none;
  }
}
@keyframes decrees-image-unlock {
  0% {
    filter: grayscale(0.9) brightness(0.45);
  }
  55% {
    filter: saturate(1.3) contrast(1.1) brightness(1.15);
  }
  100% {
    filter: saturate(1.2) contrast(1.06) brightness(1.06);
  }
}
@keyframes decrees-unlock-burst {
  0% {
    transform: translate(-50%, -50%) scale(0.94) rotate(-8deg);
    box-shadow: 0 0 0 0 rgba(245, 196, 81, 0.75);
  }
  45% {
    transform: translate(-50%, -50%) scale(1.16) rotate(6deg);
    box-shadow: 0 0 0 14px rgba(245, 196, 81, 0);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
    box-shadow: 0 0 0 18px rgba(245, 196, 81, 0);
  }
}
@keyframes decrees-lock-closed-out {
  0%,
  30% {
    opacity: 1;
    transform: scale(1);
  }
  42%,
  100% {
    opacity: 0;
    transform: scale(0.55) rotate(-16deg);
  }
}
@keyframes decrees-lock-open-in {
  0%,
  30% {
    opacity: 0;
    transform: scale(0.55) rotate(16deg);
  }
  42%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============ CARTE / HUB ============ */
.map-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0.62rem 0.72rem 1rem;
  background: linear-gradient(to top, rgba(20, 6, 30, 0.98) 82%, rgba(20, 6, 30, 0) 100%);
  text-align: center;
}
.map-panel.is-map-intro,
.map-panel.is-map-auto-enter {
  pointer-events: none;
}
.map-header {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 6.8rem);
  z-index: 22;
  margin: 0 auto;
  padding: 0;
  max-width: 95%;
  pointer-events: none;
}
.map-logo {
  display: block;
  width: min(46vw, 168px);
  max-height: 6.4rem;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
  animation:
    home-title-enter 0.8s ease both,
    home-title-float 3.6s ease-in-out 0.8s infinite;
}
.map-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.88rem, 3.6vmin, 1.06rem);
  line-height: 1.12;
  color: var(--cream);
  margin: 0.28rem auto 0;
  max-width: min(94%, 24rem);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  width: min(100%, 540px);
  margin: 0 auto;
}
.map-card {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 0;
  padding: 0.72rem;
  border-radius: 8px;
  background: #14061e;
  color: var(--cream);
  font-weight: 800;
  text-align: left;
  box-shadow: var(--shadow);
  border: 2px solid rgba(245, 196, 81, 0.52);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
  transition: transform 0.12s ease, border-color 0.15s ease, filter 0.18s ease;
}
.map-room-card {
  aspect-ratio: 1;
}
.map-card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background: #14061e;
  pointer-events: none;
}
.map-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.22) contrast(1.08) brightness(1.08);
  transform: scale(1.08);
  transition: filter 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.map-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0 42%, rgba(0, 0, 0, 0.64) 74% 100%),
    radial-gradient(circle at 50% 18%, rgba(255, 246, 233, 0.16), transparent 42%);
  pointer-events: none;
}
.map-card:active {
  transform: scale(0.97);
}
.map-card:not(.is-locked):hover,
.map-card:not(.is-locked):focus-visible {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 196, 81, 0.42), 0 14px 26px rgba(0, 0, 0, 0.34);
}
.map-card.is-done:hover,
.map-card.is-done:focus-visible {
  border-color: #6ee87d;
  box-shadow: 0 0 0 3px rgba(110, 232, 125, 0.72), 0 14px 26px rgba(0, 0, 0, 0.34);
}
.map-card:not(.is-locked):hover .map-card-media img,
.map-card:not(.is-locked):focus-visible .map-card-media img {
  filter: saturate(1.34) contrast(1.12) brightness(1.18);
  transform: scale(1.14);
}
.map-card:not(.is-locked):not(.is-done):hover .map-card-status,
.map-card:not(.is-locked):not(.is-done):focus-visible .map-card-status {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.08);
}
.map-card.is-done {
  border-color: #6ee87d;
  box-shadow: 0 0 0 3px rgba(110, 232, 125, 0.72), 0 0 24px rgba(50, 214, 90, 0.28), var(--shadow);
}
.map-card.is-done::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0 38%, rgba(2, 48, 22, 0.7) 74% 100%),
    radial-gradient(circle at 50% 18%, rgba(110, 232, 125, 0.22), transparent 42%);
}
.map-card.has-gold-feather {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 196, 81, 0.5), 0 0 26px rgba(245, 196, 81, 0.22), var(--shadow);
}
.map-card.is-locked {
  color: rgba(255, 246, 233, 0.74);
  border-color: rgba(255, 246, 233, 0.24);
  filter: grayscale(0.76) brightness(0.78);
}
.map-card.is-locked .map-card-media img {
  filter: grayscale(0.9) brightness(0.45);
}
.map-card.is-locked::after {
  background: rgba(0, 0, 0, 0.66);
}
.map-card-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  min-height: 3.15rem;
  display: flex;
  align-items: center;
  padding: 0.48rem 0.62rem;
  background: rgba(0, 0, 0, 0.72);
  border-top: 1px solid rgba(255, 246, 233, 0.16);
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 3.45vmin, 1.06rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.map-card-status {
  position: absolute;
  right: 0.58rem;
  top: 0.58rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: var(--cream);
  font-size: 1.05rem;
  text-shadow: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
  transition: background 0.18s ease, transform 0.18s ease;
}
.map-card:not(.is-locked) .map-card-status {
  color: var(--gold);
}
.map-card.is-done .map-card-status {
  color: #6ee87d;
}
.map-card.is-locked .map-card-status {
  left: 50%;
  right: auto;
  top: 42%;
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.38rem;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.84);
  transform: translate(-50%, -50%);
}
.map-card.is-unlocking {
  animation: map-card-unlocked 2s cubic-bezier(0.2, 1.35, 0.45, 1) 0.9s both;
}
.map-card.is-unlocking .map-card-media img {
  animation: map-card-image-unlocked 2s ease 0.9s both;
}
.map-card.is-unlocking .map-card-status {
  left: 50%;
  right: auto;
  top: 42%;
  width: 3.35rem;
  height: 3.35rem;
  font-size: 1.42rem;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.86);
  transform: translate(-50%, -50%);
  animation: map-unlock-burst 2s ease-out 0.9s both;
}
.map-lock-open {
  position: absolute;
  opacity: 0;
}
.map-card.is-unlocking .map-lock-closed {
  animation: map-lock-closed-out 2s ease-out 0.9s both;
}
.map-card.is-unlocking .map-lock-open {
  animation: map-lock-open-in 2s ease-out 0.9s both;
}
.map-card.is-unlock-settled {
  animation: map-card-settled 0.62s cubic-bezier(0.2, 1.25, 0.45, 1) both;
}
.map-card.is-unlock-settled .map-card-status {
  animation: map-status-settled 0.62s cubic-bezier(0.2, 1.35, 0.45, 1) both;
}
.map-gold-feather-badge {
  position: absolute;
  right: 3.18rem;
  top: 0.58rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}
.map-gold-feather {
  width: 1.72rem;
  height: 1.72rem;
  object-fit: contain;
  pointer-events: none;
}
.map-gold-feather.is-found {
  filter: drop-shadow(0 0 6px rgba(245, 196, 81, 0.62));
}
.map-gold-feather.is-pink-found {
  filter: drop-shadow(0 0 8px rgba(255, 79, 151, 0.72));
}
.map-bedrooms {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.62rem auto 0;
  width: min(100%, 540px);
  min-height: 3.25rem;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  font-size: 1.05rem;
  color: var(--plum);
  text-shadow: none;
}
.map-bedrooms::before {
  display: none;
}
.map-bedrooms::after {
  display: none;
}
.map-bedrooms .map-card-name {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-top: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(0.95rem, 3.7vmin, 1.2rem);
}
.map-bed-lock {
  flex: 0 0 auto;
  font-size: 0.92em;
  color: var(--cream);
  opacity: 0.92;
}
.map-bedrooms.is-locked {
  background: rgba(0, 0, 0, 0.76);
  color: rgba(255, 246, 233, 0.82);
  border-color: rgba(255, 246, 233, 0.24);
  filter: none;
}
.map-bedrooms.is-unlocking {
  animation: map-bedrooms-unlock 2s cubic-bezier(0.2, 1.35, 0.45, 1) 0.9s both;
}
.map-bedrooms.is-unlock-settled {
  animation: map-card-settled 0.62s cubic-bezier(0.2, 1.25, 0.45, 1) both;
}
@keyframes map-bedrooms-unlock {
  0% { transform: scale(0.96); filter: grayscale(0.75) brightness(0.78); border-color: rgba(255, 246, 233, 0.24); }
  58% { transform: scale(1.03); filter: none; border-color: var(--gold); }
  100% { transform: scale(1); filter: none; }
}
@keyframes map-card-unlocked {
  0% { transform: scale(0.96); filter: grayscale(0.75) brightness(0.78); border-color: rgba(255, 246, 233, 0.24); }
  58% { transform: scale(1.03); filter: grayscale(0) brightness(1.12); border-color: var(--gold); }
  100% { transform: scale(1); filter: none; }
}
@keyframes map-unlock-burst {
  0% { transform: translate(-50%, -50%) scale(0.92) rotate(-10deg); box-shadow: 0 0 0 0 rgba(245, 196, 81, 0.78); }
  42% { transform: translate(-50%, -50%) scale(1.22) rotate(8deg); box-shadow: 0 0 0 18px rgba(245, 196, 81, 0); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); box-shadow: 0 0 0 22px rgba(245, 196, 81, 0); }
}
@keyframes map-lock-closed-out {
  0%, 34% { opacity: 1; transform: scale(1); }
  45%, 100% { opacity: 0; transform: scale(0.55) rotate(-18deg); }
}
@keyframes map-lock-open-in {
  0%, 34% { opacity: 0; transform: scale(0.55) rotate(18deg); }
  45%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes map-card-image-unlocked {
  0% { filter: grayscale(0.9) brightness(0.45); }
  58% { filter: saturate(1.34) contrast(1.12) brightness(1.18); }
  100% { filter: saturate(1.22) contrast(1.08) brightness(1.08); }
}
@keyframes map-card-settled {
  0% { filter: brightness(1.16); border-color: var(--gold); }
  100% { filter: none; }
}
@keyframes map-status-settled {
  0% { opacity: 0; transform: scale(0.45) rotate(-12deg); }
  58% { opacity: 1; transform: scale(1.18) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ============ OBJECTIF MINI-JEU ============ */
.objective-banner {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 4rem);
  transform: translateX(-50%);
  z-index: 33;
  width: max-content;
  max-width: calc(100% - 1rem);
  padding: 0.62rem 1.08rem;
  border-radius: 999px;
  background: rgba(255, 246, 233, 0.94);
  color: var(--ink);
  border: 2px solid var(--gold);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  font-family: var(--font-sans);
  font-size: var(--objective-font-size, clamp(0.9rem, 3.85vmin, 1.12rem));
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* ============ DÉCOUVERTE PERSONNAGE ============ */
.character-discover {
  position: absolute;
  inset: 0;
  z-index: 65;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(26, 6, 38, 0.14), rgba(26, 6, 38, 0.62) 56%, rgba(26, 6, 38, 0.9)),
    rgba(26, 6, 38, 0.36);
  backdrop-filter: blur(3px) saturate(1.08);
  animation: discover-in 0.35s ease both;
}
@keyframes discover-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
.character-discover-glow {
  position: absolute;
  left: -12%;
  top: 4%;
  width: 82%;
  height: 70%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 42%, rgba(255, 246, 233, 0.72), rgba(255, 143, 191, 0.22) 32%, rgba(245, 196, 81, 0.12) 48%, transparent 70%);
  filter: blur(3px);
  animation: discover-glow 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes discover-glow {
  0%, 100% { transform: scale(1); opacity: 0.86; }
  50% { transform: scale(1.04); opacity: 1; }
}
.character-discover-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.character-discover-art::after {
  content: '';
  position: absolute;
  left: 4%;
  bottom: 6%;
  width: 56%;
  height: 8%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  filter: blur(12px);
}
.character-discover-art img {
  position: absolute;
  left: 21%;
  bottom: 1%;
  height: 94%;
  max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.52));
  animation: discover-character-in 0.45s cubic-bezier(0.22, 0.85, 0.28, 1.15) both;
}
@keyframes discover-character-in {
  from { opacity: 0; transform: translateX(-56%) translateY(34px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.character-discover-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: auto;
  cursor: default;
  padding: 1.12rem 1.05rem 1rem 1.08rem;
  border-radius: 18px 18px 0 0;
  border-top: 2px solid rgba(245, 196, 81, 0.95);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background:
    linear-gradient(90deg, rgba(255, 246, 233, 0.72) 0%, rgba(255, 246, 233, 0.92) 38%, rgba(255, 246, 233, 0.98) 100%),
    linear-gradient(0deg, rgba(255, 239, 226, 0.88), rgba(255, 253, 248, 0.62));
  color: var(--ink);
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.28);
  animation: discover-card-in 0.45s 0.08s cubic-bezier(0.22, 0.85, 0.28, 1.12) both;
}
@keyframes discover-card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.character-discover-crest {
  position: absolute;
  right: 0.9rem;
  top: -1.25rem;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: var(--plum);
  border: 3px solid var(--cream);
  box-shadow: 0 8px 16px rgba(43, 21, 48, 0.25);
  font-size: 1.12rem;
}
.character-discover-role {
  max-width: calc(100% - 3.15rem);
  font-size: clamp(0.78rem, 3.05vmin, 0.94rem);
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--pink);
}
.character-discover-title {
  margin-top: 0.28rem;
  font-family: var(--font-display);
  font-size: clamp(1.14rem, 4.85vmin, 1.52rem);
  line-height: 1.04;
  color: var(--plum);
}
.character-discover-hook {
  position: relative;
  margin-top: 0.68rem;
  padding-left: 0.72rem;
  max-width: calc(100% - 0.2rem);
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 3.48vmin, 1.04rem);
  font-weight: 700;
  line-height: 1.18;
}
.character-discover-hook::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.12rem;
  bottom: 0.1rem;
  width: 3px;
  border-radius: 99px;
  background: var(--pink);
}
.character-discover-lore {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 6;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: max-height 0.34s ease, opacity 0.22s ease, transform 0.34s ease;
}
.character-discover.is-expanded .character-discover-lore {
  max-height: calc(100% - 1.5rem);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.character-discover-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(245, 196, 81, 0.82);
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(43, 21, 48, 0.18);
  transition: transform 0.15s ease;
}
.character-discover-close:active {
  transform: scale(0.92);
}
.character-discover-lore-inner {
  position: relative;
  max-height: calc(100dvh - 2.2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 3.15rem 5.15rem 1rem;
  border-radius: 16px;
  background: rgba(255, 246, 233, 0.98);
  color: var(--ink);
  border: 2px solid rgba(245, 196, 81, 0.82);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}
.character-discover-lore-kicker {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
}
.character-discover-lore h3 {
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--plum);
}
.character-discover-lore p:not(.character-discover-lore-kicker) {
  margin-top: 0.55rem;
  font-family: var(--font-serif);
  font-size: clamp(0.88rem, 3.35vmin, 1rem);
  line-height: 1.3;
}
.character-discover-actions {
  display: flex;
  gap: 0.64rem;
  margin-top: 0.88rem;
  max-width: 100%;
  position: relative;
  z-index: 8;
}
.character-discover.is-expanded .character-discover-actions {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 1.15rem;
  margin-top: 0;
}
.character-discover-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 0.68em 0.58em;
  font-size: clamp(0.78rem, 3.15vmin, 0.92rem);
  white-space: nowrap;
  border-radius: 999px;
}
.character-discover-more {
  border: 2px solid rgba(42, 14, 58, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}
.character-discover.is-expanded .character-discover-content {
  transform: translateY(0);
}

/* ============ DIALOGUE ============ */
.dialogue-box {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  width: min(92%, 460px);
  z-index: 40;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
  border: 3px solid var(--gold);
  animation: dialogue-in 0.3s ease both;
}
.dialogue-box--spoken {
  padding-top: 0.75rem;
}
@keyframes dialogue-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.dialogue-speaker {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  min-height: 3.3rem;
  margin: -0.35rem 0 0.22rem;
  padding-left: 0;
}
.dialogue-speaker::before,
.dialogue-speaker::after {
  display: none;
}
#game {
  --dialogue-portrait-bubble-size: 3.85rem;
  --dialogue-portrait-bubble-shift-x: -0.35rem;
  --dialogue-portrait-bubble-shift-y: -0.62rem;
}

.dialogue-portrait-bubble {
  position: relative;
  flex: 0 0 auto;
  --portrait-left: 50%;
  --portrait-top: -8%;
  --portrait-width: 172%;
  width: var(--dialogue-portrait-bubble-size);
  height: var(--dialogue-portrait-bubble-size);
  border-radius: 50%;
  background: #fffaf2;
  border: 4px solid var(--pink);
  box-shadow: 0 7px 16px rgba(43, 21, 48, 0.28), 0 0 0 4px rgba(255, 255, 255, 0.72);
  overflow: hidden;
  transform: translate(var(--dialogue-portrait-bubble-shift-x), var(--dialogue-portrait-bubble-shift-y));
  z-index: 2;
}
.dialogue-portrait-bubble::before,
.dialogue-portrait-bubble::after {
  display: none;
}
.dialogue-portrait-bubble[data-speaker="char_louis26"] {
  background: #0a020f;
  border-color: var(--gold);
  box-shadow: 0 7px 16px rgba(43, 21, 48, 0.4), 0 0 0 4px rgba(245, 196, 81, 0.35);
}

.dialogue-portrait {
  position: absolute;
  left: var(--portrait-left);
  top: var(--portrait-top);
  width: var(--portrait-width);
  max-width: none;
  height: auto;
  border-radius: 50%;
  display: block;
  transform: translateX(-50%);
}
.dialogue-name {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--pink);
  padding: 0.28em 0.85em;
  border-radius: 999px;
  margin-top: 0;
  margin-left: -0.55rem;
  box-shadow: 0 4px 10px rgba(43, 21, 48, 0.16);
  z-index: 1;
}
.dialogue-box:not(.dialogue-box--spoken) .dialogue-name {
  display: inline-block;
  width: max-content;
  max-width: calc(100% - 4.15rem);
  margin: 1.25rem 0 0.75rem 4.15rem;
}
.dialogue-box:not(.dialogue-box--spoken) .dialogue-name::before {
  content: '';
  position: absolute;
  left: -4.25rem;
  top: -1.42rem;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #fff6e9 0 18%, transparent 19%),
    radial-gradient(circle at 50% 82%, #fff6e9 0 30%, transparent 31%),
    linear-gradient(160deg, var(--pink), #e23a82);
  border: 4px solid var(--pink);
  box-shadow: 0 7px 16px rgba(43, 21, 48, 0.28), 0 0 0 4px rgba(255, 255, 255, 0.72);
}
.dialogue-box:not(.dialogue-box--spoken) .dialogue-name::after {
  display: none;
}
.dialogue-text {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 4.4vmin, 1.32rem);
  font-weight: 600;
  line-height: 1.33;
  text-align: center;
}
.dialogue-text::before {
  content: '«\00a0';
}
.dialogue-text::after {
  content: '\00a0»';
}
.dialogue-more {
  position: absolute;
  right: 0.9rem;
  bottom: 0.72rem;
  width: 0;
  height: 0;
  border-left: 0.46rem solid transparent;
  border-right: 0.46rem solid transparent;
  border-top: 0.58rem solid var(--pink);
  filter: drop-shadow(0 2px 2px rgba(43, 21, 48, 0.22));
  animation: dialogue-more-bob 0.9s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.dialogue-more.is-waiting {
  opacity: 0;
  visibility: hidden;
  animation: none;
}
.dialogue-box.is-typing {
  cursor: default;
}
.dialogue-box.is-typing .dialogue-text,
.dialogue-box.is-typing .dialogue-speaker {
  pointer-events: none;
}
.choice-list.is-waiting,
.choice-timer.is-waiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: 0;
  margin: 0;
  overflow: hidden;
}
.scene-next-room.is-next-room-hidden {
  display: none;
  pointer-events: none;
}
.scene-next-room {
  position: absolute;
  right: 0.65rem;
  bottom: 12%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42rem;
  padding: 0.35rem 0.2rem 0.2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  animation: scene-next-room-in 0.35s cubic-bezier(0.2, 1.35, 0.45, 1) both;
  transition: transform 0.22s ease, filter 0.22s ease;
}
.scene-next-room-head {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}
.scene-next-room-portrait {
  width: 4.85rem;
  height: 4.85rem;
  transform: none;
  border-width: 4px;
  flex: 0 0 auto;
  box-shadow: 0 12px 26px rgba(43, 21, 48, 0.34), 0 0 0 5px rgba(255, 255, 255, 0.78);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.scene-next-room-arrow {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--pink), #e23a82);
  color: #fff;
  font-size: clamp(1.05rem, 4.6vmin, 1.28rem);
  box-shadow: 0 8px 18px rgba(43, 21, 48, 0.28), 0 0 0 3px rgba(255, 255, 255, 0.82);
  filter: none;
  animation: dialogue-more-bob 0.9s ease-in-out infinite;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.scene-next-room-label {
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 3.2vmin, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plum);
  background: rgba(255, 246, 233, 0.94);
  padding: 0.28em 0.72em;
  border-radius: 999px;
  border: 2px solid rgba(245, 196, 81, 0.72);
  box-shadow: 0 6px 14px rgba(43, 21, 48, 0.18);
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.scene-next-room:hover {
  transform: translateY(-3px) scale(1.03);
}
.scene-next-room:hover .scene-next-room-portrait {
  transform: scale(1.05);
  box-shadow: 0 16px 32px rgba(43, 21, 48, 0.38), 0 0 0 5px rgba(255, 255, 255, 0.92);
}
.scene-next-room:hover .scene-next-room-arrow {
  transform: translateX(4px);
  background: linear-gradient(160deg, #ff5fa8, var(--pink));
  box-shadow: 0 10px 22px rgba(255, 79, 151, 0.42), 0 0 0 3px rgba(255, 255, 255, 0.95);
  animation: none;
}
.scene-next-room:hover .scene-next-room-label {
  background: var(--pink);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}
.scene-next-room:active {
  transform: translateY(0) scale(0.98);
}
.scene-next-room:active .scene-next-room-portrait {
  transform: scale(1.02);
}
.scene-next-room:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: 999px;
}
@keyframes scene-next-room-in {
  from { opacity: 0; transform: translateX(12px) scale(0.88); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes dialogue-more-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
.dialogue-gold {
  font-weight: 900;
  color: #b8860b;
  background: linear-gradient(120deg, #a86b08, #f5c451 55%, #ffe08a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Choix multiples. */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.choice-question {
  margin: 0 0 0.15rem;
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 4.3vmin, 1.16rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  text-align: center;
  text-wrap: pretty;
}
.choice-btn {
  width: 100%;
  background: rgba(42, 14, 58, 0.06);
  color: var(--ink);
  border: 2px solid rgba(42, 14, 58, 0.18);
  border-radius: 14px;
  padding: 0.7em 1em;
  font-weight: 700;
  font-size: clamp(1.02rem, 4.1vmin, 1.1rem);
  text-align: left;
}
.choice-btn:active {
  transform: scale(0.98);
}
.choice-btn.is-wrong {
  animation: shake 0.4s ease;
  border-color: #e74c3c;
  background: #ffe7e3;
}

/* Compte à rebours (quête plume en or). */
.choice-timer {
  height: 8px;
  margin: 0.35rem 0 0.55rem;
  border-radius: 999px;
  background: rgba(42, 14, 58, 0.22);
  border: 1px solid rgba(42, 14, 58, 0.14);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.choice-timer-fill {
  display: block;
  height: 100%;
  width: var(--pct, 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ffe08a);
  transition: width 0.1s linear;
}
.choice-timer.is-low .choice-timer-fill {
  background: linear-gradient(90deg, var(--pink), #ff8fc4);
}

/* Toast (message transitoire). */
.toast {
  position: absolute;
  top: 4.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 60;
  background: rgba(26, 6, 38, 0.94);
  color: var(--cream);
  border: 1.5px solid var(--pink);
  border-radius: 999px;
  padding: 0.72em 1.18em;
  font-weight: 800;
  font-size: clamp(1rem, 4vmin, 1.18rem);
  width: max-content;
  max-width: calc(100% - 1rem);
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.12;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ MINI-JEU CUISINE : service des dormeurs ============ */
.kitchen-service {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
.kitchen-guests {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.kitchen-guest {
  position: absolute;
  width: min(34vw, 11.5rem);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.kitchen-guest-sprite {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--kitchen-guest-sprite-dy, 0%) auto 0 var(--kitchen-guest-sprite-dx, 0%);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.38));
  transform-origin: 50% 100%;
  transition: transform 0.28s ease;
  pointer-events: auto;
  touch-action: none;
}
.kitchen-guest-request {
  position: absolute;
  left: 50%;
  top: -2.2rem;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 246, 233, 0.96);
  border: 3px solid var(--gold);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
  animation: kitchen-request-bob 1.2s ease-in-out infinite;
  pointer-events: none;
}
.kitchen-guest-request::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.38rem;
  width: 0.54rem;
  height: 0.54rem;
  border-radius: 50%;
  background: rgba(255, 246, 233, 0.96);
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateX(-50%) rotate(45deg);
}
.kitchen-guest-request img {
  position: relative;
  z-index: 1;
  width: 88%;
  height: auto;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.24));
}
@keyframes kitchen-request-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}
.kitchen-guest:not(.is-awake):not(.is-served) .kitchen-guest-sprite {
  animation: kitchen-guest-sleep-bob 2.6s ease-in-out infinite;
}
@keyframes kitchen-guest-sleep-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.kitchen-guest.is-awake {
  z-index: 4;
}
.kitchen-guest.is-awake .kitchen-guest-sprite {
  animation: kitchen-wake-up 0.38s cubic-bezier(0.2, 1.35, 0.45, 1) both;
}
.kitchen-guest.is-leaving {
  pointer-events: none;
  animation: kitchen-guest-leave 0.72s ease-in both;
}
.kitchen-guest.has-left {
  visibility: hidden;
}
@keyframes kitchen-wake-up {
  0% { transform: translateY(0) rotate(0) scale(0.92); }
  62% { transform: translateY(-0.55rem) rotate(4deg) scale(1.08); }
  100% { transform: translateY(-0.35rem) rotate(-2deg) scale(1.04); }
}
@keyframes kitchen-guest-leave {
  from { opacity: 1; transform: translate(-50%, -50%) translateX(0) rotate(0); }
  to { opacity: 0; transform: translate(-50%, -50%) translateX(42%) translateY(-0.45rem) rotate(5deg); }
}
.kitchen-guest.is-served .kitchen-guest-request {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px) scale(0.84);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.kitchen-tray {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  width: 96%;
  justify-content: center;
  pointer-events: auto;
}
.kitchen-dish-card {
  position: relative;
  background: rgba(26, 6, 38, 0.35);
  border: 2px solid rgba(245, 196, 81, 0.5);
  border-radius: 18px;
  padding: 0.4rem;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  flex: 1;
  max-width: 33%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  z-index: 28;
}
.kitchen-dish-card img {
  width: 100%;
  max-width: 150px;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.kitchen-dish-card:active,
.kitchen-dish-card.is-dragging {
  transform: scale(0.94);
}
.kitchen-dish-card.is-dragging {
  position: absolute;
  z-index: 80;
  cursor: grabbing;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
}
.kitchen-guest > .kitchen-dish-card.is-served {
  position: absolute;
  left: 50%;
  bottom: 1.05rem;
  width: 3.7rem !important;
  padding: 0.25rem;
  border-color: var(--gold);
  background: rgba(255, 246, 233, 0.92);
  transform: translateX(-50%) rotate(-4deg);
  animation: kitchen-served-pop 0.32s cubic-bezier(0.3, 1.4, 0.45, 1) both;
}
@keyframes kitchen-served-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) rotate(-4deg) scale(0.72); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) rotate(-4deg) scale(1); }
}

/* Récit d'un dormeur réveillé (cuisine). */
.kitchen-story-overlay {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  background:
    linear-gradient(to bottom, rgba(10, 2, 18, 0.2) 0%, rgba(10, 2, 18, 0.55) 42%, rgba(10, 2, 18, 0.88) 100%);
  opacity: 0;
  transition: opacity 0.32s ease;
  cursor: pointer;
  touch-action: manipulation;
}
.kitchen-story-overlay.is-comic-phase {
  justify-content: center;
  align-items: stretch;
  gap: 0;
  background:
    linear-gradient(to bottom, rgba(10, 2, 18, 0.45) 0%, rgba(10, 2, 18, 0.82) 100%);
}
.kitchen-story-overlay.is-visible {
  opacity: 1;
}
.kitchen-story-comic-stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 0;
  padding:
    calc(env(safe-area-inset-top, 0px) + 3rem)
    clamp(0.35rem, 2vw, 0.65rem)
    calc(env(safe-area-inset-bottom, 0px) + 0.45rem);
}
.kitchen-story-comic-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.4rem, 2vw, 0.65rem);
  width: min(100%, 28rem);
  max-width: 100%;
}
.kitchen-story-comic-viewport {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 887 / 350;
  border-radius: 14px;
  border: 2px solid rgba(245, 196, 81, 0.48);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  background: #0a0212;
  transform-origin: 50% 0%;
  opacity: 0;
  transform: perspective(920px) rotateX(68deg) scaleY(0.14);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
  transition:
    aspect-ratio 0.42s cubic-bezier(0.22, 1.05, 0.36, 1),
    transform 0.72s cubic-bezier(0.22, 1.05, 0.32, 1),
    opacity 0.45s ease,
    filter 0.45s ease;
}
.kitchen-story-comic-viewport.is-open {
  opacity: 1;
  transform: perspective(920px) rotateX(0deg) scaleY(1);
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.48));
}
.kitchen-story-comic-cards {
  position: relative;
  width: 100%;
  height: 100%;
}
.kitchen-story-comic-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}
.kitchen-story-comic-frame.is-active {
  z-index: 2;
}
.kitchen-story-comic-frame.is-exiting {
  z-index: 1;
  animation: kitchen-story-frame-out 0.34s cubic-bezier(0.45, 0, 0.75, 0.2) both;
}
.kitchen-story-comic-frame.is-entering {
  z-index: 3;
  animation: kitchen-story-frame-in 0.44s cubic-bezier(0.22, 1.08, 0.36, 1) both;
}
@keyframes kitchen-story-frame-in {
  from {
    opacity: 0;
    transform: translate(calc(-50% + 16px), -50%) scale(0.93) rotate(0.6deg);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}
@keyframes kitchen-story-frame-out {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% - 12px), -50%) scale(0.96);
  }
}
.kitchen-story-comic-counter {
  font-family: var(--font-sans);
  font-size: clamp(0.68rem, 2.6vmin, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 246, 233, 0.82);
}
.kitchen-story-comic-hint {
  display: none;
}
.kitchen-story-panel {
  display: none;
  flex-shrink: 0;
}
.kitchen-story-overlay.is-comic-phase .kitchen-story-panel,
.kitchen-story-overlay.is-dialogue-phase .kitchen-story-panel {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  align-items: end;
  gap: clamp(0.35rem, 2vw, 0.65rem);
  width: 100%;
}
.kitchen-story-overlay.is-comic-phase .kitchen-story-panel {
  padding: 0;
}
.kitchen-story-overlay.is-dialogue-phase .kitchen-story-panel {
  padding:
    0.35rem clamp(0.45rem, 2.5vw, 0.85rem)
    calc(env(safe-area-inset-bottom, 0px) + 0.7rem);
}
.kitchen-story-overlay.is-comic-phase .kitchen-story-bubble {
  margin-bottom: 0;
}
.kitchen-story-overlay.is-comic-phase .kitchen-story-bubble::before {
  left: -0.5rem;
  bottom: 1.35rem;
  top: auto;
  right: auto;
  transform: rotate(45deg);
}
.kitchen-story-overlay.is-ready {
  cursor: pointer;
}
.kitchen-story-character {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
}
.kitchen-story-character__img {
  display: block;
  width: min(100%, 9.5rem);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 100%;
  animation: kitchen-story-character-in 0.42s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.kitchen-story-character__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin-top: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(26, 6, 38, 0.72);
  border: 1.5px solid rgba(245, 196, 81, 0.45);
}
.kitchen-story-character__dots span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: kitchen-story-dot 1.1s ease-in-out infinite;
}
.kitchen-story-character__dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.kitchen-story-character__dots span:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes kitchen-story-dot {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}
@keyframes kitchen-story-character-in {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.kitchen-story-bubble {
  position: relative;
  margin-bottom: 0.35rem;
  padding: 0.72rem 0.82rem 0.62rem;
  border-radius: 18px;
  background: #fff6e9;
  border: 2.5px solid var(--gold);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  animation: kitchen-story-bubble-in 0.38s 0.08s cubic-bezier(0.22, 1.12, 0.36, 1) both;
}
.kitchen-story-bubble::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  bottom: 1.35rem;
  width: 0.9rem;
  height: 0.9rem;
  background: #fff6e9;
  border-left: 2.5px solid var(--gold);
  border-bottom: 2.5px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: -3px 3px 8px rgba(0, 0, 0, 0.08);
}
@keyframes kitchen-story-bubble-in {
  from { opacity: 0; transform: translateX(10px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.kitchen-story-bubble__name {
  display: block;
  margin-bottom: 0.28rem;
  font-family: var(--font-display);
  font-size: clamp(0.88rem, 3.6vmin, 1.05rem);
  font-weight: 800;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kitchen-story-bubble__text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(0.88rem, 3.6vmin, 1.04rem);
  font-weight: 600;
  line-height: 1.34;
  color: var(--ink);
  text-wrap: pretty;
}
.kitchen-story-bubble__more {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-sans);
  font-size: clamp(0.58rem, 2.2vmin, 0.68rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  color: rgba(43, 21, 48, 0.72);
}
.kitchen-story-bubble__more.is-waiting {
  opacity: 0;
  visibility: hidden;
}

/* ============ CUISINE — poêles repère plume en or ============ */
.kitchen-pans {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
}
.kitchen-pan {
  position: absolute;
  pointer-events: auto;
}
.kitchen-pan--sparkle {
  left: 4%;
  top: 12%;
  width: 22%;
  height: 18%;
  pointer-events: auto;
  cursor: pointer;
}
.kitchen-pan--shine {
  left: 20%;
  top: 2%;
  width: 32%;
  min-width: 72px;
  min-height: 96px;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.16s ease;
  transform-origin: center top;
  -webkit-tap-highlight-color: transparent;
}
.kitchen-pans--hidden {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none !important;
}
.kitchen-pan--shine img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transition: filter 0.16s ease;
}
.kitchen-pan--shine:hover img,
.kitchen-pan--shine:focus-visible img {
  filter: drop-shadow(0 0 16px rgba(245, 196, 81, 0.85)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}
.kitchen-pan.is-dulled {
  opacity: 0.72;
  filter: grayscale(0.35) brightness(0.88);
  pointer-events: auto;
}
.kitchen-pan--shine.is-dulled:hover img {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transform: none;
}

/* Cinématique quête poêle — zoom fort, pause, puis dialogue. */
.kitchen-gold-dim {
  position: absolute;
  inset: 0;
  z-index: 14;
  background: radial-gradient(circle at 50% 48%, rgba(20, 6, 30, 0.15), rgba(20, 6, 30, 0.82));
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
#game.is-kitchen-gold .kitchen-gold-dim {
  opacity: 1;
}
#game.is-kitchen-gold-out .kitchen-gold-dim {
  opacity: 0;
  transition: opacity 1.1s ease;
}

.character.is-gold-cinematic {
  left: 50%;
  right: auto;
  bottom: -2%;
  height: 92%;
  z-index: 16;
  transform: translateX(-50%) scale(0.42);
  opacity: 0;
  animation: none;
  transition:
    transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1),
    opacity 1.1s ease,
    filter 0.5s ease;
}
#game.is-kitchen-gold-zoom .character.is-gold-cinematic {
  transform: translateX(-50%) scale(1.38);
  opacity: 1;
}
#game.is-kitchen-gold-out .character.is-gold-cinematic {
  transform: translateX(-50%) scale(0.32) translateY(80px);
  opacity: 0;
  transition:
    transform 1.3s cubic-bezier(0.45, 0, 0.55, 1),
    opacity 1.1s ease;
}

#game.is-kitchen-gold .kitchen-pans,
#game.is-kitchen-gold .kitchen-service {
  opacity: 0;
  transition: opacity 0.55s ease;
}
#game.is-kitchen-gold .scene-bg {
  transition: transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1);
  transform: scale(1);
  transform-origin: 50% 52%;
}
#game.is-kitchen-gold-zoom .scene-bg {
  transform: scale(1.72);
}
#game.is-kitchen-gold-out .scene-bg {
  transform: scale(1);
  transition: transform 1.3s cubic-bezier(0.45, 0, 0.55, 1);
}
#game.is-kitchen-gold .dialogue-box {
  z-index: 55;
}

.dialogue-box.dialogue-box--gold-reveal {
  animation: gold-dialogue-in 0.75s cubic-bezier(0.22, 0.85, 0.3, 1) forwards;
}

/* ============ CUISINE — jeu de la taupe (plume en or) ============ */
#game.is-kitchen-mole .hud {
  z-index: 56;
}
#game.is-kitchen-mole .hud-back {
  position: relative;
  z-index: 1;
}
#game.is-kitchen-mole .objective-banner {
  z-index: 55;
}
#game.is-kitchen-mole .dialogue-box {
  z-index: 60;
}
#game.is-kitchen-mole-dialogue .kitchen-mole-game {
  pointer-events: none;
  cursor: default;
}
.kitchen-mole-game {
  position: absolute;
  inset: 0;
  z-index: 48;
  overflow: hidden;
  touch-action: none;
  cursor: none;
}
.kitchen-mole-board {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.kitchen-mole-hud {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 6.75rem);
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
  width: min(96%, 520px);
}
.kitchen-mole-score,
.kitchen-mole-timer,
.kitchen-mole-errors {
  font-family: var(--font-display);
  font-size: clamp(0.96rem, 4vmin, 1.18rem);
  font-weight: 800;
  letter-spacing: 0;
  color: var(--plum);
  background: rgba(255, 246, 233, 0.96);
  border: 2.5px solid rgba(245, 196, 81, 0.88);
  border-radius: 999px;
  padding: 0.52em 0.9em;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(43, 21, 48, 0.22);
}
.kitchen-mole-holes {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.kitchen-mole-hole {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  user-select: none;
}
.kitchen-mole-hole:focus,
.kitchen-mole-hole:focus-visible {
  outline: none;
  box-shadow: none;
}
.kitchen-mole-hole.is-whacked {
  animation: kitchen-mole-hole-recoil 0.34s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
.kitchen-mole-pop {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--mole-pop-width, 200%);
  height: var(--mole-pop-height, 200%);
  transform: translateX(-50%) translateY(108%) scale(0.65);
  opacity: 0;
  pointer-events: none;
  transition: none;
  background: transparent;
  overflow: visible;
}
.kitchen-mole-pop.is-dev-preview.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(var(--mole-pop-scale, 1.08));
  animation: none;
}
.kitchen-mole-pop.is-visible {
  animation: kitchen-mole-pop-up 0.22s cubic-bezier(0.2, 1.35, 0.45, 1) forwards;
}
.kitchen-mole-pop.is-hit {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(var(--mole-pop-scale, 1.08));
  animation: none;
}
.kitchen-mole-pop.is-hit-good {
  animation: kitchen-mole-pop-hit-good 0.72s cubic-bezier(0.2, 1.2, 0.35, 1) forwards;
}
.kitchen-mole-pop.is-hit-bad {
  animation: kitchen-mole-pop-hit-bad 0.72s ease forwards;
}
.kitchen-mole-pop.is-whacked {
  animation: kitchen-mole-hole-recoil-pop 0.34s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
.kitchen-mole-pop.is-wrong {
  animation: kitchen-mole-pop-wrong 0.34s ease both;
}
.kitchen-mole-pop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 88%;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  background: transparent;
}
.kitchen-mole-pop img[hidden] {
  display: none;
}
.kitchen-mole-pop.is-pheasant {
  width: var(--mole-pop-pheasant-width, 220%);
  height: var(--mole-pop-pheasant-height, 220%);
}
.kitchen-mole-pop.is-pheasant img {
  filter: drop-shadow(0 8px 12px rgba(255, 79, 151, 0.35));
}
.kitchen-mole-sleep {
  position: absolute;
  left: 50%;
  top: 2%;
  z-index: 4;
  display: none;
  pointer-events: none;
  transform: translateX(-50%);
}
.kitchen-mole-pop.is-sleeper.is-visible .kitchen-mole-sleep {
  display: block;
}
.kitchen-mole-pop.is-hit-good img {
  animation: kitchen-mole-char-hit-good 0.72s cubic-bezier(0.2, 1.2, 0.35, 1) forwards;
}
.kitchen-mole-pop.is-hit-bad img {
  animation: kitchen-mole-char-hit-bad 0.72s ease forwards;
}
.kitchen-mole-particles {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}
.kitchen-mole-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: kitchen-mole-particle 0.68s ease-out both;
  animation-delay: var(--delay, 0ms);
}
.kitchen-mole-particles--good .kitchen-mole-particle {
  background: radial-gradient(circle, #fff6a8 0 35%, #f5c451 36% 100%);
  box-shadow: 0 0 8px rgba(245, 196, 81, 0.65);
}
.kitchen-mole-particles--bad .kitchen-mole-particle {
  background: radial-gradient(circle, #ffd6de 0 35%, #ff4f97 36% 100%);
  box-shadow: 0 0 8px rgba(255, 79, 151, 0.55);
}
.kitchen-mole-pop.is-hit-good::after,
.kitchen-mole-pop.is-hit-bad::after {
  content: '';
  position: absolute;
  inset: 8% 10% 18%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.kitchen-mole-pop.is-hit-good::after {
  background: radial-gradient(circle, rgba(255, 246, 168, 0.85) 0, transparent 68%);
  animation: kitchen-mole-flash-good 0.72s ease-out forwards;
}
.kitchen-mole-pop.is-hit-bad::after {
  background: radial-gradient(circle, rgba(255, 120, 160, 0.75) 0, transparent 68%);
  animation: kitchen-mole-flash-bad 0.72s ease-out forwards;
}
.kitchen-mole-hit-fx {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.kitchen-mole-hit-word {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4.8vmin, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 2px var(--plum);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(43, 21, 48, 0.28);
  animation: kitchen-mole-hit-word 0.72s cubic-bezier(0.2, 1.35, 0.45, 1) both;
}
.kitchen-mole-hit-fx--good .kitchen-mole-hit-word {
  color: #fff6a8;
  -webkit-text-stroke-color: #a86b08;
}
.kitchen-mole-hit-fx--bad .kitchen-mole-hit-word {
  color: #ffd6de;
  -webkit-text-stroke-color: #8b1e45;
}
.kitchen-mole-hit-burst {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 233, 0.98) 0 16%, transparent 17%),
    radial-gradient(circle, rgba(245, 196, 81, 0.85) 0 34%, transparent 35%),
    radial-gradient(circle, rgba(255, 79, 151, 0.35) 0 52%, transparent 53%);
  animation: kitchen-mole-hit-burst 0.72s ease-out both;
}
.kitchen-mole-hit-burst--bad {
  background:
    radial-gradient(circle, rgba(255, 220, 228, 0.98) 0 16%, transparent 17%),
    radial-gradient(circle, rgba(255, 79, 151, 0.55) 0 34%, transparent 35%),
    radial-gradient(circle, rgba(139, 30, 69, 0.28) 0 52%, transparent 53%);
}
.kitchen-mole-pan {
  position: absolute;
  z-index: 4;
  width: clamp(7rem, 28vw, 10.5rem);
  height: clamp(7rem, 28vw, 10.5rem);
  pointer-events: none;
  --pan-anchor-y: -92%;
  transform: translate(-50%, var(--pan-anchor-y));
  transform-origin: 50% 88%;
  will-change: transform;
}
.kitchen-mole-pan img {
  width: 100%;
  height: auto;
  transform: scaleY(-1) rotate(-12deg);
  transform-origin: 50% 85%;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.38));
}
.kitchen-mole-pan.is-windup {
  transform: translate(-50%, -98%) scale(0.94) rotate(-8deg);
  transition: transform 0.11s ease-out;
}
.kitchen-mole-pan.is-striking {
  animation: kitchen-mole-pan-hit 0.38s cubic-bezier(0.2, 1.35, 0.45, 1) both;
}
.kitchen-mole-impact {
  position: absolute;
  z-index: 3;
  width: 4.8rem;
  height: 4.8rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 246, 233, 0.95) 0 18%, rgba(245, 196, 81, 0.55) 19% 34%, transparent 35%);
  animation: kitchen-mole-impact 0.38s ease-out both;
}
.kitchen-mole-impact--strong {
  width: 6rem;
  height: 6rem;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 14%, transparent 15%),
    radial-gradient(circle, rgba(245, 196, 81, 0.75) 0 32%, transparent 33%),
    radial-gradient(circle, rgba(255, 79, 151, 0.42) 0 50%, transparent 51%);
}
@keyframes kitchen-mole-pop-up {
  from { opacity: 0; transform: translateX(-50%) translateY(108%) scale(0.65); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
}
@keyframes kitchen-mole-hole-recoil-pop {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  40% { transform: translateX(-50%) translateY(6%) scale(1.02); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
}
@keyframes kitchen-mole-pop-hit-good {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  14% { transform: translateX(-50%) translateY(4%) scale(0.98) rotate(6deg); }
  38% { transform: translateX(-50%) translateY(-2%) scale(1.12) rotate(-4deg); }
  62% { opacity: 1; transform: translateX(-50%) translateY(8%) scale(0.96) rotate(3deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(38%) scale(0.5) rotate(8deg); }
}
@keyframes kitchen-mole-pop-hit-bad {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  18% { transform: translateX(-50%) translateY(0) scale(1.18) rotate(-8deg); }
  42% { transform: translateX(-50%) translateY(2%) scale(1.02) rotate(6deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(16%) scale(0.78) rotate(-5deg); }
}
@keyframes kitchen-mole-pop-wrong {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  35% { transform: translateX(-50%) translateY(0) scale(1.16) rotate(-6deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(18%) scale(0.88); }
}
@keyframes kitchen-mole-hole-recoil {
  0% { transform: translate(-50%, -50%) scale(1); }
  40% { transform: translate(-50%, -50%) scale(0.88); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes kitchen-mole-char-hit-good {
  0% { transform: scale(1) rotate(0); filter: drop-shadow(0 8px 12px rgba(255, 79, 151, 0.35)); }
  12% { transform: scale(0.72) rotate(-16deg); filter: brightness(1.55) saturate(1.35) sepia(0.25); }
  28% { transform: scale(1.08) rotate(12deg); filter: brightness(1.25) saturate(1.15); }
  52% { transform: scale(0.9) rotate(-8deg) translateY(6%); filter: brightness(0.95); opacity: 0.92; }
  100% { transform: scale(0.38) rotate(10deg) translateY(42%); opacity: 0; filter: brightness(0.6); }
}
@keyframes kitchen-mole-char-hit-bad {
  0% { transform: scale(1) rotate(0); filter: none; }
  16% { transform: scale(1.12) rotate(-12deg); filter: hue-rotate(-28deg) brightness(1.15) saturate(1.4); }
  36% { transform: scale(0.94) rotate(10deg); filter: hue-rotate(-12deg) brightness(0.88); }
  100% { transform: scale(0.68) rotate(-8deg) translateY(18%); opacity: 0; filter: grayscale(0.35) brightness(0.75); }
}
@keyframes kitchen-mole-particle {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0.15);
  }
}
@keyframes kitchen-mole-flash-good {
  0% { opacity: 0; transform: scale(0.6); }
  18% { opacity: 0.95; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.45); }
}
@keyframes kitchen-mole-flash-bad {
  0% { opacity: 0; transform: scale(0.6); }
  18% { opacity: 0.85; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes kitchen-mole-hit-word {
  0% { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  24% { opacity: 1; transform: scale(1.18) rotate(4deg); }
  100% { opacity: 0; transform: scale(0.92) translateY(-18px); }
}
@keyframes kitchen-mole-hit-burst {
  0% { opacity: 0; transform: scale(0.2); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.45); }
}
@keyframes kitchen-mole-pan-hit {
  0% { transform: translate(-50%, -98%) scale(0.94) rotate(-8deg); }
  32% { transform: translate(-50%, -78%) scale(1.16) rotate(10deg); }
  54% { transform: translate(-50%, -86%) scale(1.04) rotate(4deg); }
  100% { transform: translate(-50%, -92%) scale(1) rotate(0deg); }
}
@keyframes kitchen-mole-impact {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}
@keyframes gold-dialogue-in {
  from {
    opacity: 0;
    transform: translate(-50%, 28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* Horloge secrète — Cabinet des Énigmes. */
.enigmas-clock {
  position: absolute;
  top: 6%;
  right: -38%;
  z-index: 25;
  width: min(34vw, 132px);
  padding: 0;
  border: none;
  background: transparent;
  transform: rotate(14deg);
  transition:
    right 2.2s cubic-bezier(0.22, 0.85, 0.3, 1),
    transform 2.2s cubic-bezier(0.22, 0.85, 0.3, 1),
    opacity 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}
.enigmas-clock.is-arrived {
  right: 5%;
  transform: rotate(0deg);
}
.enigmas-clock img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}
.enigmas-clock.is-used {
  opacity: 0.72;
  pointer-events: none;
}

/* Sablier secret — Cabinet des Énigmes (étagère du haut). */
.enigmas-sablier {
  position: absolute;
  left: 35%;
  top: 7.4%;
  width: var(--enigmas-sablier-width, min(12%, 60px));
  z-index: 25;
  padding: 4px;
  min-width: 0;
  min-height: 0;
  border: none;
  background: transparent;
  transform-origin: center top;
  opacity: 0;
  transform: translateY(-12px) scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 0.85, 0.3, 1), filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.enigmas-sablier.is-arrived {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.enigmas-sablier.has-golden-sparkle {
  position: absolute;
}
.enigmas-sablier .golden-particles {
  inset: -14%;
}
.enigmas-sablier img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
.enigmas-sablier:hover,
.enigmas-sablier:focus-visible {
  filter: drop-shadow(0 0 14px rgba(245, 196, 81, 0.6));
}
.enigmas-sablier.is-arrived:hover,
.enigmas-sablier.is-arrived:focus-visible {
  transform: translateY(0) scale(1.1);
}
.enigmas-sablier:active {
  transform: translateY(0) scale(0.98);
}

/* ============ CLUEDO DU PASSÉ (secret énigmes) ============ */
.cluedo-stage {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0 2% calc(env(safe-area-inset-bottom, 0) + 1rem);
}
.cluedo-lineup {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.2rem, 1.8vw, 0.65rem);
  width: 100%;
  padding: 0 0.5%;
}
.cluedo-lineup.is-disabled {
  pointer-events: none;
}
.cluedo-suspect {
  position: relative;
  flex: 1 1 0;
  max-width: 23%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cluedo-suspect-figure {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
  align-items: end;
}
.cluedo-suspect-check {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: center;
  transform: translateY(calc(-100% - clamp(0.25rem, 1.2vmin, 0.45rem)));
  width: clamp(1rem, 4.2vmin, 1.3rem);
  height: clamp(1rem, 4.2vmin, 1.3rem);
  border: 2px solid rgba(212, 168, 67, 0.65);
  border-radius: 50%;
  background: rgba(26, 6, 38, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.62rem, 2.6vmin, 0.82rem);
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  z-index: 2;
  pointer-events: none;
}
.cluedo-suspect.is-questioned .cluedo-suspect-check {
  background: rgba(212, 168, 67, 0.22);
  border-color: var(--gold);
}
.cluedo-suspect.is-questioned .cluedo-suspect-check::before {
  content: "✓";
}
.cluedo-suspect img {
  grid-area: 1 / 1;
  width: 100%;
  max-height: 36vh;
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}
.cluedo-suspect-name {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(0.48rem, 1.85vmin, 0.72rem);
  color: var(--cream);
  background: rgba(26, 6, 38, 0.82);
  border-radius: 0.45rem;
  padding: 0.15em 0.35em;
  pointer-events: none;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.cluedo-suspect:hover,
.cluedo-suspect:focus-visible {
  transform: translateY(-6px) scale(1.03);
}
.cluedo-suspect.is-questioned {
  filter: grayscale(0.2) brightness(0.92);
}
.cluedo-lineup.is-accuse .cluedo-suspect:hover,
.cluedo-lineup.is-accuse .cluedo-suspect:focus-visible {
  filter: drop-shadow(0 0 18px rgba(255, 79, 151, 0.85));
}
.cluedo-accuse {
  align-self: center;
}
.cluedo-accuse:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* — Arrestation (Doc + garde) — */
.cluedo-arrest-doc {
  left: -7%;
  bottom: 14%;
  height: 64%;
  z-index: 16;
  max-width: 46%;
  object-position: bottom left;
}
.cluedo-arrest-guard {
  right: -8%;
  height: 70%;
  z-index: 17;
}
.cluedo-arrest-doc.is-escorted {
  animation: cluedo-doc-escort 0.9s ease-in forwards;
}
.cluedo-arrest-guard.is-escorting {
  animation: cluedo-guard-escort 0.9s ease-in forwards;
}
@keyframes cluedo-doc-escort {
  to {
    transform: translateX(14%) translateY(10px) rotate(4deg);
    opacity: 0.55;
  }
}
@keyframes cluedo-guard-escort {
  to {
    transform: translateX(-10%) translateY(6px);
    opacity: 0.75;
  }
}

/* — Révélation (chambres : Louis + Eugène) — */
.cluedo-louis-seat {
  right: -3%;
  bottom: 6%;
  width: min(74vw, 780px);
  height: auto;
  max-height: 64%;
  z-index: 15;
  object-position: bottom right;
}
.cluedo-eugene-son {
  left: 0;
  bottom: 0;
  height: 54%;
  z-index: 16;
}
.cluedo-eugene-son.is-fading-out {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

/* — Zoom Louis (coussin retrouvé) — */
.cluedo-cinematic-dim {
  position: absolute;
  inset: 0;
  z-index: 14;
  background: radial-gradient(circle at 50% 48%, rgba(20, 6, 30, 0.12), rgba(20, 6, 30, 0.84));
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
#game.is-cluedo-cinematic .cluedo-cinematic-dim {
  opacity: 1;
}
#game.is-cluedo-cinematic-out .cluedo-cinematic-dim {
  opacity: 0;
  transition: opacity 1.1s ease;
}
.character.cluedo-louis-cinematic {
  left: 50%;
  right: auto;
  bottom: -3%;
  width: min(96vw, 820px);
  height: auto;
  max-height: none;
  z-index: 16;
  transform: translateX(-50%) scale(0.42);
  opacity: 0;
  animation: none;
  object-fit: contain;
  transition:
    transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1),
    opacity 1.1s ease;
}
#game.is-cluedo-cinematic-zoom .character.cluedo-louis-cinematic {
  transform: translateX(-50%) scale(1.08);
  opacity: 1;
}
#game.is-cluedo-cinematic-out .character.cluedo-louis-cinematic {
  transform: translateX(-50%) scale(0.34) translateY(70px);
  opacity: 0;
  transition:
    transform 1.3s cubic-bezier(0.45, 0, 0.55, 1),
    opacity 1.1s ease;
}
#game.is-cluedo-cinematic .scene-bg {
  transition: transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1);
  transform: scale(1);
  transform-origin: 58% 64%;
}
#game.is-cluedo-cinematic-zoom .scene-bg {
  transform: scale(1.62);
}
#game.is-cluedo-cinematic-out .scene-bg {
  transform: scale(1);
  transition: transform 1.3s cubic-bezier(0.45, 0, 0.55, 1);
}
#game.is-cluedo-cinematic .dialogue-box {
  z-index: 55;
}

/* — Prison (plan intermédiaire) — */
.cluedo-prison-doc {
  left: -7%;
  height: 76%;
  z-index: 13;
}
.cluedo-prison-guard {
  right: -8%;
  height: 70%;
  z-index: 12;
}

/* — Fondus entre les plans — */
.cluedo-beat-fade {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #1a0626;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}
.cluedo-beat-fade.is-active {
  opacity: 1;
}

.cluedo-doc {
  left: -6%;
  bottom: 0;
  height: 56%;
  z-index: 16;
  max-width: 46%;
  object-position: bottom left;
}
.cluedo-doc.is-hauled {
  animation: cluedo-haul 1s ease forwards;
}
@keyframes cluedo-haul {
  to {
    transform: translateX(-18%) translateY(6px) rotate(-5deg);
    opacity: 0.95;
  }
}

.cluedo-prop {
  position: absolute;
  z-index: 18;
  pointer-events: none;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 0.85, 0.3, 1);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}
.cluedo-prop.is-visible {
  opacity: 1;
  transform: scale(1);
}
.cluedo-prop--cushion {
  left: 50%;
  bottom: 40%;
  width: min(58vw, 500px);
  transform: translateX(-50%) scale(0.94);
}
.cluedo-prop--cushion.is-visible {
  transform: translateX(-50%) scale(1);
}
.cluedo-prop--cushion-reveal {
  left: auto;
  right: 4%;
  bottom: 40%;
  width: min(44vw, 360px);
  transform: scale(0.94);
}
.cluedo-prop--cushion-reveal.is-visible {
  transform: scale(1);
}
#game.is-cluedo-cinematic-zoom .cluedo-prop--cushion-reveal {
  right: 10%;
  bottom: 42%;
  width: min(34vw, 290px);
  z-index: 18;
}
.cluedo-prop--louis {
  right: -4%;
  bottom: 8%;
  width: min(72vw, 800px);
  max-height: 62%;
}

/* ============ RANGÉE DE PLUMES (fin, partage…) ============ */
.feather-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
  margin-bottom: 0.55rem;
}
.feather-row-label {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pink);
}
.feather-row-icons {
  display: flex;
  gap: 0.1rem;
  align-items: center;
  justify-content: center;
}
.feather-row-slot {
  width: clamp(66px, 7.5vmin, 76px);
  height: clamp(66px, 7.5vmin, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feather-row-img {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}
.feather-row-img--pink {
  width: 68%;
  height: 88%;
  filter: drop-shadow(0 0 10px rgba(255, 79, 151, 0.7));
}
.feather-row-img--gold {
  filter: sepia(0.85) saturate(4) hue-rotate(5deg) brightness(1.12)
    drop-shadow(0 0 10px rgba(245, 196, 81, 0.7));
}
.feather-row--compact .feather-row-slot {
  width: clamp(40px, 8.5vmin, 52px);
  height: clamp(40px, 8.5vmin, 52px);
}
.feather-row--ending .feather-row-slot {
  width: clamp(48px, 10vmin, 58px);
  height: clamp(48px, 10vmin, 58px);
}
.feather-row--ending .feather-row-img--pink {
  width: 70%;
  height: 92%;
}
.feather-row--compact .feather-row-label {
  font-size: 0.58rem;
}
.feather-row--gold .feather-row-label {
  color: var(--gold);
}
.feather-row-slot.is-dual {
  flex-direction: row;
  gap: 0.08rem;
}
.feather-row-slot.is-dual .feather-row-img {
  width: 46%;
  height: 62%;
}
  opacity: 0.28;
  color: rgba(255, 246, 233, 0.45);
  font-size: 0.85rem;
  padding-bottom: 0.15rem;
}
.feather-row--compact {
  margin: 0.06rem 0 0.7rem;
}
.kitchen-dish-card:hover {
  background: rgba(255, 79, 151, 0.2);
  border-color: var(--pink);
}

/* ============ JARDIN (plumes cachées + leurres) ============ */
.garden-feathers {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
.garden-feathers > * {
  pointer-events: auto;
}
.search-layer {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: transparent;
  cursor: pointer;
}
.hidden-feather,
.decoy-feather {
  position: absolute;
  background: transparent;
  padding: 0;
  transform: rotate(var(--rot, -18deg));
}
.hidden-feather img,
.decoy-feather img {
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.hidden-feather.is-pink img {
  filter: drop-shadow(0 0 6px rgba(255, 79, 151, 0.45));
  opacity: 0.96;
}
.decoy-feather img {
  opacity: 0.88;
}
.hidden-feather:active,
.decoy-feather:active {
  transform: rotate(var(--rot, -18deg)) scale(0.9);
}

/* Faisan cliquable (plume rose puis or). */
.garden-pheasant {
  position: absolute;
  left: 4%;
  bottom: 0;
  width: min(46%, 210px);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 28;
  transform: translateX(-50%);
  transform-origin: center bottom;
  animation: pheasant-walk-x 5.5s linear infinite alternate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.garden-pheasant__sprite {
  display: block;
  transform: scaleX(-1);
  transform-origin: center bottom;
}
.garden-pheasant.is-walk-left .garden-pheasant__sprite {
  transform: scaleX(1);
}
.garden-pheasant img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  transform-origin: center bottom;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: pheasant-bob 0.58s ease-in-out infinite;
}
.garden-pheasant img.is-shake {
  animation: pheasant-shake 0.42s ease;
}
.garden-pheasant img.is-hop {
  animation: pheasant-hop 0.3s cubic-bezier(0.28, 1, 0.55, 1);
}
.garden-pheasant.is-done {
  opacity: 0.88;
  cursor: default;
}
.garden-pheasant.has-golden-sparkle {
  filter: drop-shadow(0 0 12px rgba(245, 196, 81, 0.45));
}

/* Portrait Louis 26 — capture photo (jardin). */
.garden-portrait-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 3, 20, 0.72);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.garden-portrait-overlay.is-visible {
  opacity: 1;
}
.garden-portrait-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(100%, 300px);
  padding: 1rem 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(26, 6, 38, 0.96);
  border: 1.5px solid rgba(245, 196, 81, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.garden-portrait-panel__speaker {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3.8vmin, 1.02rem);
  font-weight: 800;
  color: var(--gold);
  text-align: center;
}
.garden-portrait-panel__hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.88rem, 3.6vmin, 1rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--cream);
  text-align: center;
  text-wrap: balance;
  margin: 0;
}
.garden-portrait-refuse {
  font-size: clamp(0.78rem, 3.2vmin, 0.88rem) !important;
  line-height: 1.2;
  white-space: normal;
  text-wrap: balance;
}
.garden-portrait-preview {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0;
  border: 2px dashed rgba(245, 196, 81, 0.55);
  border-radius: 18px;
  background: rgba(255, 246, 233, 0.06);
  overflow: hidden;
  cursor: pointer;
}
.garden-portrait-preview__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 9vmin, 2.6rem);
  color: var(--gold);
}
.garden-portrait-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.garden-portrait-preview.has-photo .garden-portrait-preview__placeholder {
  display: none;
}
.garden-portrait-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.garden-portrait-actions .btn,
.garden-portrait-confirm {
  width: 100%;
}
.garden-portrait-confirm:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.garden-pheasant.is-hidden-for-boss,
.garden-feathers.is-hidden-for-boss,
.character.is-hidden-for-boss {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}
#game.is-garden-boss-cinematic .character.char-left.char-small,
#game.is-garden-boss .character.char-left.char-small {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
@keyframes pheasant-walk-x {
  from { left: 4%; }
  to { left: 96%; }
}
@keyframes pheasant-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes pheasant-shake {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
@keyframes pheasant-hop {
  0%, 100% { transform: translateY(0); }
  24% { transform: translateY(-44px); }
  48% { transform: translateY(-16px); }
  72% { transform: translateY(-4px); }
}
.garden-thrown-feather {
  position: absolute;
  z-index: 27;
  width: 11%;
  max-width: 52px;
  height: auto;
  pointer-events: none;
  opacity: 0;
  transform: translate(0, 0) rotate(-20deg);
}
.garden-thrown-feather.is-flying {
  animation: garden-feather-throw 0.85s cubic-bezier(0.25, 0.7, 0.35, 1) forwards;
}
@keyframes garden-feather-throw {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-25deg) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.85;
    transform: translate(-18vw, -32vh) rotate(35deg) scale(1);
  }
}

/* Cinématique mini-boss faisan — zoom sur le gros Faisan avant le combat. */
.garden-boss-cinematic-dim {
  position: absolute;
  inset: 0;
  z-index: 14;
  background: radial-gradient(circle at 50% 48%, rgba(20, 6, 30, 0.15), rgba(20, 6, 30, 0.82));
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
#game.is-garden-boss-cinematic .garden-boss-cinematic-dim {
  opacity: 1;
}
#game.is-garden-boss-cinematic-out .garden-boss-cinematic-dim {
  opacity: 0;
  transition: opacity 1.1s ease;
}

.character.garden-boss-cinematic {
  left: 50%;
  right: auto;
  bottom: -2%;
  width: min(118vw, 590px);
  height: auto;
  max-height: none;
  z-index: 16;
  transform: translateX(-50%) scale(0.38);
  opacity: 0;
  visibility: hidden;
  animation: none;
  pointer-events: none;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.55));
  transition:
    transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1),
    opacity 1.1s ease,
    visibility 0s linear 1.5s;
}
#game.is-garden-boss-cinematic .character.garden-boss-cinematic {
  visibility: visible;
  transition:
    transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1),
    opacity 1.1s ease,
    visibility 0s;
}
#game.is-garden-boss-cinematic-zoom .character.garden-boss-cinematic {
  transform: translateX(-50%) scale(1.42);
  opacity: 1;
}
#game.is-garden-boss-cinematic-out .character.garden-boss-cinematic {
  transform: translateX(-50%) scale(0.3) translateY(80px);
  opacity: 0;
  transition:
    transform 1.3s cubic-bezier(0.45, 0, 0.55, 1),
    opacity 1.1s ease;
}

#game.is-garden-boss-cinematic .scene-bg {
  transition: transform 1.5s cubic-bezier(0.22, 0.85, 0.3, 1);
  transform: scale(1);
  transform-origin: 50% 52%;
}
#game.is-garden-boss-cinematic-zoom .scene-bg {
  transform: scale(1.72);
}
#game.is-garden-boss-cinematic-out .scene-bg {
  transform: scale(1);
  transition: transform 1.3s cubic-bezier(0.45, 0, 0.55, 1);
}
#game.is-garden-boss-cinematic .dialogue-box {
  z-index: 42;
}

/* Mini-boss du faisan musclé. */
.garden-boss {
  position: absolute;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  background: transparent;
}
.garden-boss::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 232, 242, 0.18), rgba(255, 232, 242, 0) 22%),
    linear-gradient(180deg, rgba(26, 6, 38, 0.08), rgba(26, 6, 38, 0.26) 64%, rgba(26, 6, 38, 0.34));
  pointer-events: none;
}
.garden-boss-intro {
  position: absolute;
  left: 50%;
  top: 5.2rem;
  transform: translateX(-50%);
  width: min(88%, 420px);
  z-index: 3;
  text-align: center;
  padding: 1rem 1rem 1.1rem;
  border-radius: 24px;
  background: rgba(255, 247, 250, 0.92);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 117, 170, 0.42);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.garden-boss-intro.is-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-12px);
}
.garden-boss-kicker {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}
.garden-boss-intro h2 {
  margin-top: 0.22rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 5vmin, 1.7rem);
  color: #8f214f;
}
.garden-boss-intro p {
  margin-top: 0.3rem;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 4vmin, 1.12rem);
  color: var(--ink);
}
.garden-boss-meter {
  position: absolute;
  left: 50%;
  top: 5.2rem;
  transform: translateX(-50%);
  width: min(84%, 360px);
  z-index: 3;
}
.garden-boss-meter__label {
  display: block;
  margin-bottom: 0.34rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff3f8;
}
.garden-boss-meter__bar {
  display: block;
  width: 100%;
  height: 14px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 219, 231, 0.24);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}
.garden-boss-meter__fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd368, #ff7aac 72%, #fff0f7);
  box-shadow: 0 0 14px rgba(255, 122, 172, 0.4);
}
.garden-boss-arena {
  position: absolute;
  inset: 0;
  touch-action: none;
}
.garden-boss-pheasant {
  position: absolute;
  left: 76%;
  top: 1.8rem;
  width: min(104vw, 600px);
  transform: translateX(-50%);
  transform-origin: center top;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45));
}
.garden-boss-pheasant img {
  display: block;
  width: 100%;
  height: auto;
  animation: garden-boss-bob 1.2s ease-in-out infinite;
}
.garden-boss-player {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  pointer-events: none;
}
.garden-boss-player__glow,
.garden-boss-player__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.garden-boss-player__glow {
  background: radial-gradient(circle, rgba(255, 242, 161, 0.9), rgba(255, 242, 161, 0));
  transform: scale(1.45);
  opacity: 0.9;
}
.garden-boss-player__core {
  border: 3px solid #fff8d2;
  background:
    radial-gradient(circle at 35% 35%, #fff9ef, #ffc96d 48%, #ff7fb1 88%);
  box-shadow:
    0 0 20px rgba(255, 225, 120, 0.72),
    0 0 36px rgba(255, 127, 177, 0.26);
}
.garden-boss-player.has-avatar {
  width: 60px;
  height: 60px;
}
.garden-boss-player__avatar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff8d2;
  box-shadow:
    0 0 20px rgba(255, 225, 120, 0.72),
    0 0 36px rgba(255, 127, 177, 0.26);
}
.garden-boss-player__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.garden-boss-feather {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(36px, 9vw, 54px);
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter:
    brightness(1.08)
    drop-shadow(0 0 10px rgba(180, 24, 48, 0.85))
    drop-shadow(0 0 18px rgba(120, 12, 28, 0.55));
}
@keyframes garden-boss-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(8px) scale(1.015); }
}

/* ============ CELLIER ============ */
.cellar-secret-layer {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
}
.cellar-secret-layer .cellar-secret-bottle {
  pointer-events: auto;
}
.cellar-secret-bottle {
  position: absolute;
  right: var(--cellar-bottle-right, -20%);
  bottom: var(--cellar-bottle-bottom, 55%);
  width: var(--cellar-bottle-width, 24%);
  z-index: 1;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border: none;
  background: transparent;
  transform:
    rotate(var(--cellar-bottle-rotate, -22deg))
    translateX(var(--cellar-bottle-shift-x, -36%))
    translateY(var(--cellar-bottle-shift-y, 5%));
  transform-origin: bottom left;
  opacity: 0.85;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cellar-secret-bottle:focus,
.cellar-secret-bottle:focus-visible {
  outline: none;
}
.cellar-secret-bottle.has-golden-sparkle {
  position: absolute;
}
.cellar-secret-bottle .golden-particles {
  inset: -16%;
}
.cellar-secret-bottle img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
}
.cellar-secret-bottle:hover,
.cellar-secret-bottle:focus-visible {
  opacity: 1;
  transform:
    rotate(calc(var(--cellar-bottle-rotate, -22deg) - 8deg))
    translateX(calc(var(--cellar-bottle-shift-x, -36%) - 14%))
    translateY(calc(var(--cellar-bottle-shift-y, 5%) - 3%))
    scale(1.1);
  filter: drop-shadow(0 0 12px rgba(245, 196, 81, 0.45));
}
.cellar-secret-bottle:active {
  transform:
    rotate(calc(var(--cellar-bottle-rotate, -22deg) - 2deg))
    translateX(calc(var(--cellar-bottle-shift-x, -36%) + 4%))
    translateY(calc(var(--cellar-bottle-shift-y, 5%) + 1%))
    scale(1.02);
}

/* ============ CELLIER SECRET - DUEL ============ */
.cellar-duel-host {
  left: -6%;
  height: 74%;
}
.cellar-duel-host--reverse {
  aspect-ratio: 2 / 3;
  height: 74%;
  width: auto;
}
.cellar-duel-host.is-fallen {
  animation: cellar-host-fall 0.75s cubic-bezier(0.2, 0.72, 0.28, 1) forwards;
  transform-origin: 42% 88%;
}
.cellar-duel-host.is-already-fallen {
  animation: none;
  transform: translate(18px, 46px) rotate(-82deg);
}
.cellar-dropped-gold-feather {
  position: absolute;
  left: 33%;
  bottom: 12%;
  width: clamp(76px, 19vmin, 124px);
  z-index: 34;
  padding: 0;
  border: none;
  background: transparent;
  filter: drop-shadow(0 0 18px rgba(245, 196, 81, 0.9));
  transform-origin: center bottom;
  animation: cellar-gold-feather-drop 0.65s ease-out both, gold-feather-tap-hint 1.35s ease-in-out infinite 0.65s;
}
.cellar-dropped-gold-feather img {
  display: block;
  width: 100%;
  pointer-events: none;
}
.cellar-dropped-gold-feather:active {
  transform: scale(0.92);
}
@keyframes cellar-host-fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  45% {
    transform: translateY(18px) rotate(-18deg);
  }
  100% {
    transform: translate(18px, 46px) rotate(-82deg);
  }
}
@keyframes cellar-gold-feather-drop {
  0% {
    opacity: 0;
    transform: translateY(-70px) rotate(-28deg) scale(0.45);
  }
  70% {
    opacity: 1;
    transform: translateY(8px) rotate(8deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}
@keyframes gold-sparkle-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(245, 196, 81, 0.75));
  }
  50% {
    filter: drop-shadow(0 0 26px rgba(255, 224, 138, 1));
  }
}
@keyframes gold-feather-tap-hint {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 14px rgba(245, 196, 81, 0.8));
  }
  50% {
    transform: scale(1.14);
    filter: drop-shadow(0 0 28px rgba(255, 224, 138, 1));
  }
}
.cellar-guard-reveal {
  right: -8%;
  height: 72%;
  z-index: 18;
  animation: char-in 0.45s ease both;
}
.cellar-duel-intro {
  position: absolute;
  inset: auto 0 8.2rem;
  z-index: 35;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cellar-duel-intro .btn {
  pointer-events: auto;
}
.cellar-duel-scene {
  --cellar-drunk: 0;
  position: absolute;
  inset: 0;
  z-index: 22;
  animation: cellar-duel-sway 1.8s ease-in-out infinite;
  animation-play-state: paused;
}
.cellar-duel-scene.is-drunk {
  animation-play-state: running;
}
@keyframes cellar-duel-sway {
  0%, 100% {
    transform: translate(0, 0) rotate(calc(var(--cellar-drunk) * -1deg));
  }
  25% {
    transform: translate(calc(var(--cellar-drunk) * 5px), calc(var(--cellar-drunk) * -3px))
      rotate(calc(var(--cellar-drunk) * 0.9deg));
  }
  50% {
    transform: translate(calc(var(--cellar-drunk) * -5px), calc(var(--cellar-drunk) * 4px))
      rotate(calc(var(--cellar-drunk) * -1.2deg));
  }
  75% {
    transform: translate(calc(var(--cellar-drunk) * 4px), calc(var(--cellar-drunk) * 3px))
      rotate(calc(var(--cellar-drunk) * 0.75deg));
  }
}
.cellar-duel-title {
  position: absolute;
  top: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 390px);
  z-index: 24;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 20px;
  background: rgba(26, 6, 38, 0.78);
  border: 1.5px solid rgba(245, 196, 81, 0.5);
  box-shadow: var(--shadow);
}
.cellar-duel-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.9vmin, 1.4rem);
  color: var(--gold);
}
.cellar-duel-title p {
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 4vmin, 1.12rem);
  color: var(--cream);
}
.cellar-duel-bars {
  position: absolute;
  left: 50%;
  top: 12.8rem;
  transform: translateX(-50%);
  width: min(90%, 390px);
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cellar-duel-bar {
  padding: 0.75rem 0.85rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 246, 233, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.cellar-duel-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-weight: 900;
}
.cellar-duel-bar-label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cellar-duel-bar-value {
  color: var(--pink);
}
.cellar-duel-bar-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(42, 14, 58, 0.14);
}
.cellar-duel-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  transition: width 0.14s linear;
}
.cellar-duel-arena {
  position: absolute;
  inset: 18.8rem 0 0;
  z-index: 23;
}
.cellar-duel-bottle {
  --rot: 0deg;
  --dur: 280ms;
  position: absolute;
  left: 48%;
  top: 34%;
  width: clamp(170px, 34vw, 240px);
  padding: 0;
  border: none;
  background: transparent;
  transform: translate(-50%, -50%) rotate(var(--rot));
  transform-origin: center center;
  transition:
    left var(--dur) ease-out,
    top var(--dur) ease-out,
    transform var(--dur) ease-out,
    filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cellar-duel-bottle img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.45));
}
.cellar-duel-bottle span {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.16rem 0.7rem;
  border-radius: 999px;
  background: rgba(26, 6, 38, 0.88);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.82rem;
  pointer-events: none;
}
.cellar-duel-bottle:hover,
.cellar-duel-bottle:focus-visible {
  filter: drop-shadow(0 0 14px rgba(245, 196, 81, 0.5));
}
.cellar-duel-bottle:active {
  transform: translate(-50%, -50%) rotate(var(--rot)) scale(0.94);
}

/* ============ PRISON ============ */
.prison-guard {
  right: -8%;
  height: 70%;
  z-index: 12;
}
.prison-guard.is-leaving {
  animation: prison-guard-out 0.42s ease-in forwards;
}
.prison-doc {
  left: -7%;
  height: 76%;
  z-index: 13;
  filter: drop-shadow(0 0 20px rgba(245, 196, 81, 0.28))
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}
.prison-delorean {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(112vw, 620px);
  z-index: 26;
  pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(245, 196, 81, 0.75))
    drop-shadow(0 18px 18px rgba(0, 0, 0, 0.55));
  transform: translate(-50%, 68vh) scale(0.6);
  transform-origin: 50% 72%;
  animation: prison-delorean-timejump 3.15s cubic-bezier(0.18, 0.82, 0.18, 1) forwards;
}
.time-warp-flash {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 76%, rgba(255, 247, 199, 0.96), rgba(245, 196, 81, 0.22) 26%, transparent 58%),
    repeating-radial-gradient(circle at 50% 76%, transparent 0 24px, rgba(255, 255, 255, 0.14) 25px 30px);
  mix-blend-mode: screen;
  animation: time-warp-flash 3.15s ease-in forwards;
}
.time-warp-label {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(90%, 520px);
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 8vmin, 3.2rem);
  color: #fff8dc;
  text-shadow:
    0 3px 0 #8a4b16,
    0 0 16px rgba(245, 196, 81, 0.9),
    0 0 30px rgba(255, 255, 255, 0.78);
  opacity: 0;
  animation: time-warp-label 3.15s ease forwards;
}
@keyframes prison-guard-out {
  to {
    opacity: 0;
    transform: translateX(42%) translateY(12px);
  }
}
@keyframes prison-delorean-timejump {
  0% {
    opacity: 0;
    transform: translate(-50%, 68vh) scale(0.55) rotate(-2deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, 24vh) scale(0.86) rotate(1deg);
  }
  54% {
    opacity: 1;
    transform: translate(-50%, 7vh) scale(1.02) rotate(0deg);
  }
  76% {
    opacity: 1;
    transform: translate(-50%, -2vh) scale(1.34) rotate(-1deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -16vh) scale(2.55) rotate(1deg);
  }
}
@keyframes time-warp-flash {
  0%, 26% { opacity: 0; }
  48% { opacity: 0.22; }
  72% { opacity: 0.68; }
  100% { opacity: 1; }
}
@keyframes time-warp-label {
  0%, 28% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
  }
  42%, 78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.18);
  }
}

/* ============ PORTE GARDÉE ============ */
.gate-title {
  position: absolute;
  top: 4rem;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 20;
  font-family: var(--font-display);
  color: var(--gold);
}

/* ============ FINALE — 1-2-3 soleil (Eugène) ============ */
#game.is-eugene-soleil .dialogue-box {
  z-index: 56;
}
#game.is-eugene-soleil .hud {
  z-index: 55;
}
.eugene-soleil-game {
  position: absolute;
  inset: 0;
  z-index: 34;
}
.eugene-soleil-tap {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.eugene-soleil-game.is-danger::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 9999px rgba(180, 24, 48, 0.16);
  animation: eugene-soleil-pulse 0.55s ease-in-out infinite;
}
.eugene-soleil-game.is-shake {
  animation: eugene-soleil-shake 0.42s ease;
}
@keyframes eugene-soleil-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes eugene-soleil-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.eugene-soleil-hud {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 8.75rem);
  transform: translateX(-50%);
  z-index: 2;
  width: min(92%, 420px);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}
.eugene-soleil-status {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 4vmin, 1.12rem);
  font-weight: 800;
  color: #8fd46a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.eugene-soleil-status.is-danger {
  color: #ff6b7d;
}
.eugene-soleil-track {
  position: relative;
  height: clamp(0.65rem, 2.4vmin, 0.85rem);
  border-radius: 999px;
  background: rgba(26, 6, 38, 0.72);
  border: 2px solid rgba(245, 196, 81, 0.45);
  overflow: visible;
}
.eugene-soleil-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5c451, #ff4f97);
  transition: width 0.28s ease;
}
.eugene-soleil-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: clamp(0.85rem, 3.2vmin, 1.05rem);
  height: clamp(0.85rem, 3.2vmin, 1.05rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid #fff6e9;
  box-shadow: 0 0 10px rgba(255, 79, 151, 0.75);
  transition: left 0.28s ease;
  pointer-events: none;
}
#game.is-eugene-soleil .crown-draggable {
  display: none !important;
}
.character.eugene-soleil-character {
  right: -2%;
  height: 58%;
  z-index: 12;
  transform-origin: 50% 100%;
  transition: transform 0.32s ease, filter 0.32s ease, opacity 0.2s ease;
}
.character.eugene-soleil-character.is-playing {
  right: -15%;
  height: 85%;
  max-width: 66%;
  object-position: bottom right;
}
.character.eugene-soleil-character.is-watching {
  right: -2%;
  height: 58%;
  max-width: none;
  transform: none;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45)) brightness(1.06);
}
.character.eugene-soleil-character.is-caught {
  animation: eugene-soleil-caught 0.42s ease;
}
.character.eugene-soleil-character.is-step {
  transform: translateX(-2.5%);
}
.character.eugene-soleil-character.is-watching.is-step {
  transform: translateX(-2.5%);
}
@keyframes eugene-soleil-caught {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(3%) rotate(2deg); }
}

/* ============ FINALE (couronne + Louis 26 endormi) ============ */
.bed-scene {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}
.bed-scene .crown-target {
  pointer-events: none;
}
.character.king-sleeping {
  position: absolute;
  bottom: 30%;
  left: 15%;
  height: 24%;
  width: auto;
  max-width: 98%;
  z-index: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  animation: char-in 0.55s ease both;
}
.character.louis-intro-contreplonge {
  bottom: 5%;
  width: min(98%, 440px);
  height: auto;
  max-height: 62%;
  z-index: 12;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.48));
}
.crown-target {
  position: absolute;
  left: 23%;
  top: 57.5%;
  width: clamp(3.4rem, 17vw, 5rem);
  height: clamp(3rem, 12vw, 4.5rem);
  transform: translate(-100%, -50%);
  z-index: 2;
  border: 3px dashed var(--gold);
  border-radius: 50%;
  background: rgba(245, 196, 81, 0.28);
  box-shadow:
    0 0 0 5px rgba(245, 196, 81, 0.14),
    inset 0 0 18px rgba(245, 196, 81, 0.2);
  animation: pulse 1.4s ease-in-out infinite;
}
.crown-target.is-placed {
  border-color: var(--pink);
  background: rgba(255, 79, 151, 0.25);
  animation: none;
}
.crown-draggable {
  position: absolute;
  right: 6%;
  top: 22%;
  width: clamp(48px, 12vw, 56px);
  z-index: 35;
  touch-action: none;
}
.crown-draggable img {
  width: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 14px var(--gold));
}
.crown-draggable.is-dragging {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}
.crown-draggable.is-on-king {
  left: 18.5%;
  top: 56%;
  right: auto;
  width: 48px;
  transform: translate(-50%, -50%) rotate(-85deg);
  pointer-events: none;
  z-index: 12;
  filter: drop-shadow(0 0 18px var(--gold));
}
.crown-hint {
  position: absolute;
  top: 4.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(26, 6, 38, 0.85);
  color: var(--cream);
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: 0.68em 1.18em;
  font-weight: 800;
  font-size: clamp(1rem, 4vmin, 1.18rem);
  text-align: center;
  width: max-content;
  max-width: calc(100% - 1rem);
  white-space: nowrap;
}

/* ============ FIN — easter egg 4 plumes d'or ============ */
.ending-gold-peek {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) - 1.35rem);
  left: calc(env(safe-area-inset-left, 0px) + 0.85rem);
  z-index: 45;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: ending-gold-peek-bob 2.2s ease-in-out infinite;
}
.ending-gold-peek img {
  display: block;
  width: clamp(2.6rem, 11vmin, 3.4rem);
  filter: drop-shadow(0 0 14px rgba(245, 196, 81, 0.95))
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.ending-gold-peek .golden-particles {
  inset: -35%;
}
.ending-gold-peek.is-launched {
  animation: ending-gold-peek-launch 0.45s ease-in forwards;
  pointer-events: none;
}
@keyframes ending-gold-peek-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
@keyframes ending-gold-peek-launch {
  to {
    opacity: 0;
    transform: translateY(-120%);
  }
}

.ending-gold-secret {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(12, 4, 20, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, background 0.55s ease;
  overflow: hidden;
}
.ending-gold-secret.is-orbit,
.ending-gold-secret.is-burst {
  overflow: visible;
}
.ending-gold-secret.is-active {
  opacity: 1;
  pointer-events: auto;
  background: rgba(12, 4, 20, 0.88);
}
.ending-gold-secret.is-out {
  opacity: 0;
  pointer-events: none;
}
.ending-gold-secret-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 247, 199, 0.95), transparent 58%);
  opacity: 0;
  pointer-events: none;
}
.ending-gold-secret.is-burst .ending-gold-secret-flash {
  animation: ending-gold-flash 0.65s ease-out forwards;
}
@keyframes ending-gold-flash {
  0% { opacity: 0; transform: scale(0.7); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35); }
}

.ending-gold-secret-orbit {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(64vw, 300px);
  height: min(64vw, 300px);
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
}
.ending-gold-secret-orbit-spinner {
  position: absolute;
  inset: 0;
  animation: ending-gold-orbit-spin 1.45s linear infinite;
}
.ending-gold-secret.is-orbit .ending-gold-secret-orbit {
  animation: ending-gold-orbit-in 0.55s ease-out forwards;
}
.ending-gold-secret.is-burst .ending-gold-secret-orbit {
  animation: ending-gold-orbit-burst 0.55s ease-in forwards;
}
@keyframes ending-gold-orbit-in {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes ending-gold-orbit-burst {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
  }
}
.ending-gold-secret-orbit-feather {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(2.4rem, 12vmin, 3.4rem);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--i) * 90deg))
    translateY(calc(-1 * min(28vw, 132px)))
    rotate(calc(var(--i) * -90deg));
  filter: drop-shadow(0 0 16px rgba(245, 196, 81, 0.9));
}
@keyframes ending-gold-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.ending-gold-secret-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(72vw, 340px);
  height: min(72vw, 340px);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 160, 0.95) 0%, rgba(245, 196, 81, 0.45) 34%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}
.ending-gold-secret.is-burst .ending-gold-secret-burst {
  animation: ending-gold-burst-ring 0.7s ease-out forwards;
}
@keyframes ending-gold-burst-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

.ending-gold-secret-crest {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(92%, 360px);
  padding: 1rem 0.85rem 0.7rem;
  transform: scale(0.72);
  opacity: 0;
}
.ending-gold-secret.is-reveal .ending-gold-secret-crest {
  animation: ending-gold-crest-in 0.75s cubic-bezier(0.22, 0.85, 0.3, 1) forwards;
}
@keyframes ending-gold-crest-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.ending-gold-secret-crest-glow {
  width: clamp(3.8rem, 18vmin, 5rem);
  filter: drop-shadow(0 0 22px rgba(245, 196, 81, 0.95));
  animation: bob 2.2s ease-in-out infinite;
}
.ending-gold-secret-crest-feathers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.35rem, 2.2vw, 0.75rem);
  width: 100%;
  margin-top: -0.2rem;
}
.ending-gold-secret-crest-feathers img {
  position: relative;
  width: clamp(1.85rem, 8.5vmin, 2.5rem);
  height: auto;
  filter: drop-shadow(0 0 10px rgba(245, 196, 81, 0.85));
  animation: ending-gold-crest-feather 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.12s);
}
@keyframes ending-gold-crest-feather {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.ending-gold-secret-louis {
  width: clamp(4.8rem, 22vmin, 6.2rem);
  margin-top: 0.15rem;
  border-radius: 50%;
  border: 3px solid rgba(245, 196, 81, 0.85);
  box-shadow: 0 0 24px rgba(245, 196, 81, 0.55);
  object-fit: cover;
  animation: ending-gold-louis-pop 0.8s 0.15s ease both;
}
@keyframes ending-gold-louis-pop {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.ending-gold-secret-title {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 5vmin, 1.45rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3b12, 0 0 18px rgba(245, 196, 81, 0.75);
  line-height: 1.15;
}
.ending-gold-secret-sub {
  margin: 0;
  max-width: 28ch;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.78rem, 3.2vmin, 0.92rem);
  color: var(--cream);
  line-height: 1.3;
}
.ending-gold-secret-dismiss {
  margin-top: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 246, 233, 0.72);
  animation: pulse 1.5s ease-in-out infinite;
}

.ending-gold-secret-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.ending-gold-secret-rain-feather {
  position: absolute;
  top: -12%;
  left: var(--x);
  width: clamp(0.9rem, 4vmin, 1.25rem);
  opacity: 0;
  transform: rotate(var(--rot));
  filter: drop-shadow(0 0 8px rgba(245, 196, 81, 0.75));
  animation: ending-gold-rain-fall var(--dur) linear infinite;
  animation-delay: var(--delay);
}
.ending-gold-secret.is-rain .ending-gold-secret-rain-feather {
  opacity: 0.85;
}
@keyframes ending-gold-rain-fall {
  0% { transform: translateY(0) rotate(var(--rot)); opacity: 0; }
  8% { opacity: 0.9; }
  100% { transform: translateY(118vh) rotate(calc(var(--rot) + 180deg)); opacity: 0; }
}

#game.is-ending-gold-secret .ending-card {
  filter: blur(2px) brightness(0.55);
  transition: filter 0.45s ease;
}

/* ============ FIN — carte de titre ============ */
.ending-card {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.22rem;
  padding: 3.2rem 0.85rem 3.6rem;
  background: radial-gradient(circle at 50% 35%, rgba(42, 14, 58, 0.55), rgba(20, 6, 30, 0.92));
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.ending-crown {
  width: 20%;
  max-width: 82px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 18px var(--gold));
  animation: bob 2.4s ease-in-out infinite;
}
.ending-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 4.8vmin, 1.45rem);
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3b12, 0 6px 18px rgba(0, 0, 0, 0.6);
  line-height: 1.15;
  max-width: 92%;
  overflow-wrap: break-word;
  word-break: normal;
}
.ending-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.72rem, 3vmin, 0.88rem);
  color: var(--cream);
  max-width: 26ch;
  line-height: 1.25;
  padding: 0 0.35rem;
}
.ending-player-name {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 5vmin, 1.35rem);
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 10px rgba(245, 196, 81, 0.35);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.ending-stats {
  width: min(100%, 290px);
  margin: 0.15rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  background: rgba(26, 6, 38, 0.65);
  border: 2px solid rgba(245, 196, 81, 0.45);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}
.ending-stat-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 0.35rem;
}
.ending-stat-value {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(1.65rem, 8vmin, 2.15rem);
  color: var(--pink);
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 79, 151, 0.45);
}
.ending-stat-row {
  display: flex;
  justify-content: space-around;
  gap: 0.35rem;
}
.ending-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
.ending-stat-mini {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--cream);
}
.ending-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 246, 233, 0.7);
}
.ending-actions {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  width: min(100%, 290px);
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.ending-actions-split {
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  width: 100%;
}
.ending-actions-split .btn {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 0.48em 0.45em;
  font-size: clamp(0.72rem, 2.8vmin, 0.85rem);
}
.ending-actions .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5em 1em;
  font-size: clamp(0.78rem, 3vmin, 0.9rem);
}

/* Icône info (crédits) en bas de l'écran de fin. */
.ending-info {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom, 0), 0.6rem);
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(26, 6, 38, 0.65);
  color: var(--gold);
  font-size: 1.15rem;
  border: 1.5px solid rgba(245, 196, 81, 0.45);
  backdrop-filter: blur(6px);
  z-index: 25;
}
.ending-info:active {
  transform: scale(0.92);
}

/* Formulaire email — vertical, champs plus grands. */
.email-form {
  width: min(100%, 290px);
  max-width: 100%;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  flex-shrink: 0;
  font-family: var(--font-ui);
}
.email-label {
  font-family: var(--font-ui);
  font-size: clamp(0.78rem, 3.35vmin, 0.9rem);
  font-weight: 500;
  color: var(--cream);
  line-height: 1.35;
  text-wrap: balance;
}
.email-label-optional {
  font-weight: 400;
  font-size: 0.92em;
  color: rgba(255, 246, 233, 0.72);
  white-space: nowrap;
}
.email-input {
  width: 100%;
  border-radius: 12px;
  padding: 0.55em 0.85em;
  font-family: var(--font-ui);
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  font-weight: 400;
  border: 2px solid rgba(245, 196, 81, 0.5);
}
.email-input::placeholder {
  font-family: var(--font-ui);
  font-weight: 400;
  color: rgba(43, 21, 48, 0.48);
}
.email-submit {
  width: 100%;
  margin-top: 0;
  padding: 0.5em 1em;
  font-size: 0.88rem;
}
.privacy-link {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255, 246, 233, 0.75);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 0.25rem;
}
.privacy-link:active {
  color: var(--gold);
}
.email-thanks {
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 500;
  color: var(--gold);
  font-size: 1rem;
  padding: 0.5rem 0;
}

/* ============ CRÉDITS / LÉGAL (overlay) ============ */
.legal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(92%, 360px);
  background: linear-gradient(170deg, #fffdf8, #fff0e2);
  color: var(--ink);
  border-radius: 26px;
  border: 2px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 1.5rem 1.3rem 1.3rem;
  text-align: center;
  animation: settings-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.legal-panel-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.legal-crown {
  font-size: 1.8rem;
  color: var(--gold-deep);
}
.legal-panel h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--plum);
}
.credits-made {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pink);
  margin-bottom: 0.6rem;
}
.credits-list {
  list-style: none;
  margin-bottom: 1.2rem;
}
.credits-list li {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(42, 14, 58, 0.1);
}
.credits-list li:last-child {
  border-bottom: none;
}
.credits-icons {
  margin: -0.45rem 0 1rem;
  font-size: 0.78rem;
  color: rgba(43, 21, 48, 0.72);
}
.credits-icons a {
  color: var(--pink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-panel .btn {
  width: 100%;
}

/* ============ PARAMÈTRES ============ */
.settings-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(92%, 380px);
  max-height: 92%;
  overflow-y: auto;
  background: linear-gradient(170deg, #fffdf8, #fff0e2);
  color: var(--ink);
  border-radius: 26px;
  border: 2px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 0 0 4px rgba(255, 255, 255, 0.5);
  padding: 1.5rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  animation: settings-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes settings-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.settings-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.settings-crown {
  font-size: 1.9rem;
  color: var(--gold-deep);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}
.settings-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--plum);
  text-align: center;
}
.settings-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--plum);
  background: rgba(42, 14, 58, 0.08);
  font-size: 1.1rem;
}
.settings-close:active {
  transform: scale(0.92);
}
.settings-row-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pink);
  margin-top: 0.5rem;
}
.settings-row-label i {
  font-size: 0.9rem;
}

/* Langue : menu déroulant (paramètres). */
.settings-lang-picker {
  position: relative;
  width: 100%;
}
.settings-lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.72rem 0.9rem;
  background: #fff;
  border: 2px solid rgba(42, 14, 58, 0.12);
  border-radius: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}
.settings-lang-toggle .fi {
  width: 1.65rem;
  height: 1.2rem;
  background-size: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.settings-lang-toggle-label {
  flex: 1 1 auto;
  font-size: 0.95rem;
}
.settings-lang-chevron {
  font-size: 0.75rem;
  color: rgba(42, 14, 58, 0.45);
  transition: transform 0.2s ease;
}
.settings-lang-picker.is-open .settings-lang-chevron {
  transform: rotate(180deg);
}
.settings-lang-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: min(42vh, 14rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 79, 151, 0.55) rgba(42, 14, 58, 0.08);
  padding: 0.35rem;
  padding-right: 0.25rem;
  border-radius: 14px;
  background: #fff;
  border: 2px solid rgba(42, 14, 58, 0.12);
  box-shadow: 0 10px 24px rgba(42, 14, 58, 0.18);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.22s ease,
    visibility 0.2s ease;
}
.settings-lang-menu::-webkit-scrollbar {
  width: 6px;
}
.settings-lang-menu::-webkit-scrollbar-track {
  background: rgba(42, 14, 58, 0.08);
  border-radius: 999px;
  margin: 0.3rem 0;
}
.settings-lang-menu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pink-soft), var(--pink));
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 6px rgba(255, 79, 151, 0.25);
}
.settings-lang-menu::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffb3d4, var(--pink));
}
.settings-lang-picker.is-open .settings-lang-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.settings-lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
}
.settings-lang-option .fi {
  width: 1.5rem;
  height: 1.05rem;
  background-size: cover;
  flex-shrink: 0;
}
.settings-lang-option.is-active {
  background: linear-gradient(170deg, #fff, #ffeaf3);
  color: var(--ink);
}
.settings-lang-option.is-active .lang-option-check {
  color: var(--pink);
}

/* Langue : anciennes cartes (conservé pour compatibilité éventuelle). */
.lang-grid {
  display: flex;
  gap: 0.55rem;
}
.lang-card {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 0.5rem;
  background: #fff;
  border: 2px solid rgba(42, 14, 58, 0.12);
  border-radius: 16px;
  font-weight: 800;
  color: var(--ink);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.lang-card:active {
  transform: scale(0.96);
}
.lang-card.is-active {
  border-color: var(--pink);
  box-shadow: 0 6px 16px rgba(255, 79, 151, 0.25);
  background: linear-gradient(170deg, #fff, #ffeaf3);
}
.lang-flag {
  width: 2.6rem !important;
  height: 1.9rem !important;
  background-size: cover;
  border-radius: 6px;
}
.lang-name {
  font-size: 0.95rem;
}
.lang-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: var(--pink);
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.lang-card.is-active .lang-check {
  opacity: 1;
  transform: scale(1);
}

/* Son : interrupteur. */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 2px solid rgba(42, 14, 58, 0.12);
  border-radius: 14px;
  font-weight: 700;
  color: var(--ink);
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toggle-switch {
  position: relative;
  width: 3rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(42, 14, 58, 0.2);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.toggle-row.is-on .toggle-switch {
  background: var(--pink);
}
.toggle-row.is-on .toggle-knob {
  transform: translateX(1.4rem);
}

/* Son : carte unifiée (interrupteur + volume). */
.sound-card {
  width: 100%;
  padding: 0.7rem 0.9rem 0.85rem;
  background: #fff;
  border: 2px solid rgba(42, 14, 58, 0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.sound-card .toggle-row {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.sound-card .toggle-label i {
  width: 1.05rem;
  text-align: center;
  font-size: 0.95rem;
}
.volume-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px dashed rgba(42, 14, 58, 0.1);
}
.volume-control-head {
  cursor: default;
}
.volume-value {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.volume-track-shell {
  padding: 0.3rem;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fff8ef, #ffe8cc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 6px rgba(201, 152, 44, 0.2);
  overflow: visible;
}
.volume-track {
  position: relative;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(42, 14, 58, 0.18);
  border: 1px solid rgba(42, 14, 58, 0.14);
  box-shadow: inset 0 2px 5px rgba(26, 6, 38, 0.22);
  overflow: visible;
}
.volume-track-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5c451, #ff4f97);
  box-shadow: 0 0 10px rgba(255, 79, 151, 0.42);
  pointer-events: none;
  transition: width 0.1s ease;
}
.sound-card.is-muted .volume-track-fill {
  background: linear-gradient(90deg, rgba(42, 14, 58, 0.28), rgba(42, 14, 58, 0.42));
  box-shadow: none;
}
.volume-track-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff5fa8, var(--pink));
  border: 2px solid var(--cream);
  box-shadow:
    0 0 10px rgba(255, 79, 151, 0.75),
    0 2px 4px rgba(42, 14, 58, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.1s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}
.sound-card.is-muted .volume-track-thumb {
  background: rgba(42, 14, 58, 0.38);
  border-color: rgba(255, 246, 233, 0.75);
  box-shadow: 0 2px 4px rgba(42, 14, 58, 0.2);
}
.sound-card.is-muted .volume-track-shell {
  border-color: rgba(201, 152, 44, 0.38);
  background: linear-gradient(180deg, #faf7f3, #f0ebe4);
}
.volume-track:has(.volume-slider-input:active) .volume-track-thumb {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow:
    0 0 16px rgba(255, 79, 151, 0.9),
    0 2px 5px rgba(42, 14, 58, 0.3);
}
.volume-slider-input {
  position: absolute;
  inset: -0.55rem 0;
  width: 100%;
  height: calc(100% + 1.1rem);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.settings-actions .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Confirmation de reset. */
.confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20, 6, 30, 0.78);
  padding: 1.4rem;
  animation: fade-in 0.2s ease both;
}
.confirm-box {
  background: var(--cream);
  color: var(--ink);
  border-radius: 22px;
  padding: 1.5rem 1.3rem;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow);
  border: 2px solid var(--gold);
}
.confirm-icon {
  font-size: 2.2rem;
  color: #e74c3c;
  margin-bottom: 0.6rem;
}
.confirm-box p {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.confirm-actions .btn {
  flex: 1 1 7.5rem;
  min-width: 0;
}
.confirm-box .btn-ghost {
  background: rgba(42, 14, 58, 0.08);
  color: var(--ink);
  border: 2px solid rgba(42, 14, 58, 0.28);
  box-shadow: none;
}
.confirm-box .btn-ghost:active {
  background: rgba(42, 14, 58, 0.14);
}

/* ============ CONSIGNE SPLASH (aligné bulles de dialogue + flou scène) ============ */

.game-splash {
  --s-accent: var(--pink);

  position: absolute;
  inset: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  cursor: pointer;
  background: rgba(26, 6, 38, 0.38);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  backdrop-filter: blur(9px) saturate(1.05);
  animation: splash-veil-in 0.38s ease both;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.game-splash__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: min(92%, 420px);
  padding: 1.15rem 1.2rem 1rem;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--gold);
  box-shadow: var(--shadow);
  text-align: center;
  animation: splash-panel-in 0.38s ease both;
}

.game-splash__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.62rem, 2.5vmin, 0.74rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--s-accent);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(43, 21, 48, 0.14);
}

.game-splash__kicker {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.05rem, 4.8vmin, 1.38rem);
  line-height: 1.12;
  color: var(--plum);
}

.game-splash__text {
  margin: 0;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 2px solid rgba(42, 14, 58, 0.1);
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 4.4vmin, 1.22rem);
  line-height: 1.34;
  color: var(--ink);
}

.game-splash__tap {
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(0.64rem, 2.4vmin, 0.78rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(43, 21, 48, 0.78);
}
.game-splash__tap.is-waiting {
  opacity: 0;
  visibility: hidden;
}
.game-splash.is-locked {
  cursor: default;
}
.game-splash.is-locked .game-splash__panel {
  pointer-events: none;
}
.game-splash:not(.is-locked) {
  cursor: pointer;
}

.game-splash.is-leaving {
  animation: splash-out 0.3s ease forwards !important;
  pointer-events: none;
}
.game-splash.is-leaving .game-splash__panel {
  animation: splash-panel-out 0.3s ease forwards !important;
}

/* ---- Thèmes : accent du badge + entrée du panneau ---- */

.game-splash--kitchen { --s-accent: #d4882a; }
.game-splash--kitchen .game-splash__panel { animation: splash-rise 0.55s 0.04s ease both; }

.game-splash--mole { --s-accent: var(--pink); }
.game-splash--mole .game-splash__panel { animation: splash-pop 0.48s 0.03s cubic-bezier(.2, .75, .3, 1.25) both; }

.game-splash--cellar { --s-accent: #a83258; }
.game-splash--cellar .game-splash__panel { animation: splash-sway 0.58s 0.04s ease both; }

.game-splash--duel { --s-accent: var(--gold-deep); }
.game-splash--duel .game-splash__panel { animation: splash-tilt 0.52s 0.04s ease both; }

.game-splash--garden { --s-accent: #4a9e3f; }
.game-splash--garden .game-splash__panel { animation: splash-grow 0.52s 0.04s ease both; }

.game-splash--boss { --s-accent: #c93440; }
.game-splash--boss .game-splash__panel { animation: splash-jolt 0.5s 0.03s ease both; }

.game-splash--enigmas { --s-accent: #8f5bb8; }
.game-splash--enigmas .game-splash__panel { animation: splash-blurin 0.55s 0.04s ease both; }

.game-splash--cluedo { --s-accent: var(--gold-deep); }
.game-splash--cluedo .game-splash__panel { animation: splash-panel-in 0.55s 0.04s ease both; }

.game-splash--eugene { --s-accent: var(--pink); }
.game-splash--eugene .game-splash__panel { animation: splash-pop 0.48s 0.03s cubic-bezier(.2, .75, .3, 1.25) both; }

#game.is-cluedo .objective-banner {
  white-space: normal;
  border-radius: 0.85rem;
  max-width: min(calc(100% - 1.25rem), 19.5rem);
  line-height: 1.28;
  padding: 0.5rem 0.9rem;
  overflow: hidden;
}

/* ---- Jeu des 3 gobelets (Cabinet des Énigmes) ---- */
#game.is-shell-game .objective-banner {
  opacity: 0.7;
}

.shell-game {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.shell-game__table {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26%;
  height: 24%;
  pointer-events: auto;
}

.shell-game.is-wandering > .shell-cup {
  z-index: 8;
  pointer-events: auto;
}

.shell-game.is-wandering > .shell-cup .shell-cup__goblet {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.shell-cup {
  position: absolute;
  bottom: 0;
  width: 22%;
  max-width: 7.4rem;
  transform: translateX(-50%);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.38s cubic-bezier(0.2, 1.1, 0.35, 1);
}
.shell-cup:focus,
.shell-cup:focus-visible,
.shell-cup:active {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.shell-cup__stack {
  position: relative;
  width: 100%;
  display: block;
}

.shell-cup__goblet-wrap {
  position: relative;
  width: 100%;
  display: block;
  z-index: 2;
  transform-origin: 50% 92%;
  transition: transform 0.38s cubic-bezier(0.2, 1.1, 0.35, 1);
}

/* Une seule balle — invisible sauf révélation / victoire explicite */
.shell-game__ball {
  position: absolute;
  width: 7%;
  max-width: 2.1rem;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Boule au sol de la coupe : le gobelet se soulève, la boule reste visible sur la table */
.shell-cup > .shell-game__ball {
  left: 50%;
  bottom: 0;
  width: 34%;
  max-width: 2.1rem;
  z-index: 1;
  transform: translateX(-50%);
}

.shell-cup.is-lifted > .shell-game__ball.is-visible,
.shell-cup.is-revealing > .shell-game__ball.is-visible {
  z-index: 4;
}

.shell-game__ball.is-visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.shell-cup.is-lifted {
  z-index: 5;
}

.shell-cup__goblet {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.38));
}

.shell-cup.is-lifted .shell-cup__goblet-wrap {
  transform: translateY(-88%);
}

/* Effet miroir : les deux gobelets s'inclinent l'un vers l'autre */
.shell-cup.is-lifted.is-tilted-left .shell-cup__goblet-wrap {
  transform: translateY(-66%) translateX(-38%) rotate(-26deg);
}

.shell-cup.is-lifted.is-tilted-right .shell-cup__goblet-wrap {
  transform: translateY(-66%) translateX(38%) rotate(26deg);
}

.shell-game__slide-ball {
  position: absolute;
  width: 7%;
  max-width: 2.1rem;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.shell-cup.is-shake {
  animation: shell-cup-shake 0.48s ease;
}


.shell-game__table.is-turbo {
  filter: blur(1.4px);
}

.shell-game__table.is-turbo .shell-cup__goblet {
  animation: shell-turbo-wobble 0.06s linear infinite;
}

.shell-game > .shell-cup {
  pointer-events: auto;
}

@keyframes shell-cup-shake {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(calc(-50% - 6px)); }
  40% { transform: translateX(calc(-50% + 5px)); }
  60% { transform: translateX(calc(-50% - 4px)); }
  80% { transform: translateX(calc(-50% + 3px)); }
}

@keyframes shell-turbo-wobble {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

/* ---- Keyframes ---- */
@keyframes splash-veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes splash-panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-tap-pulse {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.82; }
}
@keyframes splash-out { to { opacity: 0; } }
@keyframes splash-panel-out {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-pop {
  0% { opacity: 0; transform: scale(0.9); }
  70% { opacity: 1; transform: scale(1.02); }
  100% { transform: scale(1); }
}
@keyframes splash-sway {
  0% { opacity: 0; transform: translateY(20px) rotate(-1.5deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes splash-tilt {
  0% { opacity: 0; transform: rotate(-2deg) scale(0.96); }
  100% { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes splash-grow {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes splash-jolt {
  0% { opacity: 0; transform: scale(1.03); }
  40% { opacity: 1; transform: translate(-4px, 2px); }
  55% { transform: translate(3px, -2px); }
  70% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}
@keyframes splash-blurin {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: blur(0); }
}

/* ============ Accessibilité : réduction des animations ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
