:root {
  color-scheme: light;
  --paper: oklch(96% 0 0);
  --paper-soft: oklch(99% 0 0);
  --paper-warm: oklch(91% 0 0);
  --ink: oklch(14% 0 0);
  --ink-soft: oklch(26% 0 0);
  --muted: oklch(48% 0 0);
  --line: oklch(14% 0 0 / 0.14);
  --line-strong: oklch(14% 0 0 / 0.32);
  --blue: oklch(68% 0.18 220);
  --blue-deep: oklch(46% 0.14 220);
  --danger: oklch(58% 0.08 24);
  --danger-dark: oklch(34% 0.07 24);
  --machine: oklch(23% 0 0);
  --violet: oklch(28% 0 0);
  --font-title: "Open Sans", "Segoe UI", Arial, sans-serif;
  --font-sans: "Dosis", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Courier New", monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Tactile button design system */
  --btn-h-sm: 44px;      /* compact (icon-only / chip) */
  --btn-h-md: 56px;      /* default tactile baseline */
  --btn-h-lg: 68px;      /* primary action, easy to tap */
  --btn-radius: 14px;    /* unified rounded shape */
  --btn-radius-pill: 999px;
  --btn-pad-x: 18px;
  --btn-font: 13px;
  --btn-letter: 0.14em;
  --btn-border: 1.5px;

  /* Tap FX system (universal interaction language) */
  --tap-dur-press:   90ms;
  --tap-dur-release: 320ms;
  --tap-dur-ripple:  620ms;
  --tap-ease-press:   cubic-bezier(0.4, 0, 0.6, 1);
  --tap-ease-release: cubic-bezier(0.34, 1.56, 0.64, 1); /* overshoot */
  --tap-recoil:    -2px;
  --tap-scale:     0.96;
  --tap-shadow-down: oklch(0% 0 0 / 0.18);
  --ripple-ink:    oklch(98% 0 0 / 0.55);
  --ripple-paper:  oklch(8% 0 0 / 0.18);
  --tap-x: 50%;
  --tap-y: 50%;
  --kiosk-edge-safe: 0px;
}

/* --------------------------------------------------
   Stacking Context Layers (Unified z-index map)
   --------------------------------------------------
   - Canvas / Background layers:     -1 to 2
   - Main content / Cards:            10 to 120
   - Nav / Footer / Layout frames:    200 to 400
   - Overlays / Popups / Welcomes:    2200 to 2210
   - Debug layer / Emergency stop:    2295 to 2310
   -------------------------------------------------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: oklch(10% 0 0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 24px;
  line-height: 1.35;
  box-sizing: border-box;
}

html {
  box-sizing: border-box;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border-radius: 6px;
}

svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  position: relative;
  width: 480px;
  height: 800px;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--paper-soft), var(--paper));
  box-shadow: 0 22px 70px oklch(0% 0 0 / 0.42);
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 260;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px oklch(10% 0 0 / 0.28),
    inset 0 0 18px oklch(10% 0 0 / 0.18);
}

.stage-transition {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 52px;
  left: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(
      180deg,
      oklch(98% 0.006 84 / 0),
      oklch(98% 0.006 84 / 0.24) 48%,
      oklch(98% 0.006 84 / 0)
    );
  transform: translateY(8px);
  will-change: opacity, transform;
}

.stage-transition.is-animating {
  animation: stage-page-soft 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stage-page-soft {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  38% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* START overlay - minimalist ring-pulse intro screen */
.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0% 0 0 / 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.5s var(--ease-out);
  overflow: hidden;
}

.start-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.start-overlay::before {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%,
      oklch(100% 0 0 / 0.95) 0 9%,
      oklch(100% 0 0 / 0.36) 10% 18%,
      oklch(100% 0 0 / 0) 32%);
  transform: scale(0.2);
}

.start-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.start-overlay.is-leaving {
  pointer-events: none;
  opacity: 1;
  animation: startOverlayOut 0.9s var(--ease-out) forwards;
  transition: none;
}

.start-overlay.is-leaving::before {
  animation: startPulseOut 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.start-overlay-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 20px;
}

.start-btn-touch {
  background: oklch(99% 0 0);
  color: var(--ink);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(13px, 3.7vw, 20px);
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.18;
  padding: 20px 32px;
  border-radius: 36px;
  border: none;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  pointer-events: none;
  box-shadow:
    0 16px 40px oklch(0% 0 0 / 0.15),
    0 4px 12px oklch(0% 0 0 / 0.1);
  animation: startBtnBreathing 3.6s ease-in-out infinite;
}

.start-overlay.is-leaving .start-overlay-content {
  animation: startContentOut 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes startBtnBreathing {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 16px 40px oklch(0% 0 0 / 0.15),
      0 4px 12px oklch(0% 0 0 / 0.1),
      0 0 0px oklch(100% 0 0 / 0);
  }
  50% {
    transform: scale(1.03);
    box-shadow:
      0 20px 50px oklch(0% 0 0 / 0.2),
      0 6px 16px oklch(0% 0 0 / 0.12),
      0 0 30px oklch(100% 0 0 / 0.25);
  }
}

@keyframes startContentOut {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  42% { opacity: 1; transform: scale(0.92); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.22); filter: blur(8px); }
}

@keyframes startPulseOut {
  0% { opacity: 0; transform: scale(0.12); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(2.6); }
}

@keyframes startOverlayOut {
  0%, 62% { opacity: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  100% { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
}

/* =========================================================
   GLOBAL NAV - Barre de navigation permanente
   Barre noire fixe en haut, coins inférieurs arrondis,
   ombre portée dessous, effet glossy discret.
   Visible sur toutes les pages.
   ========================================================= */
.global-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 0 12px;
  background: oklch(8% 0 0);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  /* Shadow portée dessous */
  box-shadow:
    0 6px 18px oklch(0% 0 0 / 0.45),
    0 2px 6px oklch(0% 0 0 / 0.28);
  /* Glossy highlight interne — fine ligne lumineuse en haut */
  background-image: linear-gradient(
    180deg,
    oklch(100% 0 0 / 0.07) 0%,
    oklch(100% 0 0 / 0.02) 30%,
    transparent 100%
  );
  /* Ombre interne subtile en bas */
  outline: none;
}

/* Trait de finition interne (ombre interne basse) */
.global-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: inset 0 -2px 4px oklch(0% 0 0 / 0.35);
  pointer-events: none;
}

/* Bouton de base dans la nav */
.nav-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  background: transparent;
  color: oklch(96% 0 0);
  border: none;
  border-radius: 8px;
  transition:
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: oklch(100% 0 0 / 0.08);
  outline: none;
}

.nav-btn.is-active {
  background: oklch(100% 0 0 / 0.12);
  color: oklch(100% 0 0);
}

/* Icône SVG dans la nav */
.nav-icon {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.nav-chapel-icon,
.kiosk-end-chapel-icon,
.choreo-end-chapel-icon {
  object-fit: contain;
  filter: brightness(0);
}

.nav-chapel-icon {
  filter: brightness(0) invert(1);
}

.btn-icon-chapel-svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bouton urgence - logo PNG teinté jaune */
.nav-btn-emergency .nav-icon {
  /* L'icône utilise ses propres fills jaunes */
  stroke: none;
}

/* Logo stop PNG — teinté #F0A830 via filtre CSS */
.nav-stop-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  /* Filtre pour passer une image noire → jaune #F0A830
     brightness(0) = tout noir, puis saturation + teinte */
  filter:
    brightness(0)
    saturate(100%)
    invert(72%)
    sepia(85%)
    saturate(700%)
    hue-rotate(5deg)
    brightness(105%);
  display: block;
}

/* Bouton langue - texte FR/EN au lieu d'icône */
.nav-btn-lang {
  gap: 1px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: oklch(96% 0 0);
}

.nav-btn-lang .lang-toggle-text {
  opacity: 0.4;
  transition: opacity 0.2s var(--ease-out);
}

.nav-btn-lang .lang-toggle-text[data-lang-current] {
  opacity: 1;
}

.nav-btn-lang .lang-toggle-sep {
  opacity: 0.3;
  padding: 0 1px;
}

/* Feedback tap-fx-invert sur fond noir = flash blanc discret */
.nav-btn.tap-fx-invert.is-tapping {
  background: oklch(100% 0 0 / 0.15) !important;
  color: oklch(100% 0 0) !important;
  transform: scale(0.93);
}

/* Compatibilité : garder les anciens .header-action fonctionnels au cas où */
.global-header { display: none !important; }
.vase-nav-toggle { display: none !important; }

.global-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  background: oklch(10% 0 0);
  color: var(--paper-soft);
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  font-family: var(--font-title);
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 0.28s var(--ease-out), transform 0.32s var(--ease-out);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow:
    0 -10px 26px oklch(0% 0 0 / 0.24),
    inset 0 1px 0 oklch(100% 0 0 / 0.08);
}

/* Visible sur les pages a footer fixe */
.app-shell[data-route="home"] .global-footer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.global-footer span {
  display: block;
  width: auto;
  white-space: normal;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  padding-top: 60px; /* espace pour la global-nav */
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 60px 24px 20px;
  transform: translateY(12px) scale(0.992);
  transition: opacity 0.5s var(--ease-out), visibility 0.5s, transform 0.5s var(--ease-out);
}

.screen.is-active {
  z-index: 30;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.screen-home {
  padding: 0;
  inset: 0 0 52px;
}

.screen-console,
.screen-info,
.screen-vase {
  overflow-y: auto;
  scrollbar-width: none;
}

.screen-emergency {
  overflow: hidden;
}

.screen-console,
.screen-info,
.screen-emergency {
  padding-top: 92px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.screen-console::-webkit-scrollbar,
.screen-info::-webkit-scrollbar,
.screen-emergency::-webkit-scrollbar,
.screen-vase::-webkit-scrollbar {
  display: none;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  font-size: 40px;
  line-height: 1.05;
}

.kicker {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.screen-page-header {
  min-height: 44px;
  margin-bottom: 30px;
}

.screen-page-title {
  font-family: var(--font-title);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
}

.screen-page-header .scenario-close {
  position: static;
  flex: 0 0 auto;
  color: var(--ink) !important;
  margin-left: 18px;
}

.sketch-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, oklch(99% 0 0 / 0.96), oklch(95% 0 0 / 0.98)),
    var(--paper);
}

.sketch-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease-out);
}

.sketch-container {
  position: relative;
  display: inline-block;
  width: 92%;
  max-height: 88%;
}

.sketch-base {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.86;
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.08);
  pointer-events: none;
}

.sketch-hotspots {
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.sketch-preview-layer {
  position: absolute;
  inset: 0;
  z-index: 2210;
  pointer-events: none;
}

.sketch-stage.has-sheet .sketch-preview-layer {
  z-index: 2210;
}

.sketch-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  outline: none;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  will-change: transform, opacity;
}

.sketch-stage.has-sheet .sketch-hotspots {
  z-index: 2290;
}

.sketch-hotspot::before {
  display: none;
}

.pickup-core {
  position: relative;
  width: 26px;
  height: 26px;
  background:
    radial-gradient(circle at 35% 28%, oklch(100% 0 0 / 0.20), transparent 28%),
    oklch(6% 0 0);
  border: 1.5px solid oklch(99% 0 0);
  border-radius: 10px;
  box-shadow:
    0 4px 10px oklch(0% 0 0 / 0.26),
    inset 0 0 0 4px oklch(100% 0 0 / 0.08);
  transition: transform 0.26s var(--ease-out), filter 0.26s var(--ease-out), box-shadow 0.26s var(--ease-out);
  will-change: transform;
}

.pickup-core::before,
.pickup-core::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1.5px solid oklch(0% 0 0 / 0.32);
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.72);
  pointer-events: none;
}

.pickup-core::after {
  inset: -22px;
  border-color: oklch(0% 0 0 / 0.18);
}

.hotspot-circle .pickup-core {
  animation: hotspot-pulse 2.2s ease-in-out infinite;
  animation-delay: var(--shimmer-delay, 0s);
}

.hotspot-diamond .pickup-core {
  animation: hotspot-pulse 2.2s ease-in-out infinite;
  animation-delay: var(--shimmer-delay, 0s);
}

@keyframes hotspot-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px oklch(0% 0 0 / 0.20));
  }
  50% {
    transform: scale(1.14);
    filter: drop-shadow(0 0 14px oklch(0% 0 0 / 0.45));
  }
}

.sketch-hotspot:hover .pickup-core,
.sketch-hotspot:focus-visible .pickup-core {
  transform: scale(1.22);
}

.sketch-stage.has-sheet .sketch-hotspot .pickup-core {
  animation: none;
}

.sketch-stage.has-sheet .sketch-hotspot:not(.is-active) .pickup-core {
  opacity: 0.58;
  transform: scale(0.94);
}

.sketch-hotspot.is-active .pickup-core {
  animation: none;
  transform: scale(1.08);
  background:
    radial-gradient(circle at 35% 28%, oklch(100% 0 0 / 0.28), transparent 28%),
    oklch(12% 0 0);
  border-color: oklch(100% 0 0);
  box-shadow:
    0 0 0 5px oklch(0% 0 0 / 0.10),
    0 10px 20px oklch(0% 0 0 / 0.28),
    inset 0 0 0 7px oklch(100% 0 0 / 0.14);
}

.sketch-hotspot.is-active .pickup-core::before,
.sketch-hotspot.is-active .pickup-core::after {
  animation: pickup-wave 3.2s ease-out infinite;
}

.sketch-hotspot.is-active .pickup-core::after {
  animation-delay: 1.15s;
}

.sketch-hotspot.is-revealed {
  opacity: 1;
  pointer-events: auto;
}

@keyframes pickup-wave {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  28% {
    opacity: 0.38;
  }
  100% {
    opacity: 0;
    transform: scale(1.46);
  }
}

.sketch-preview {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: min(48vw, 300px);
  height: min(48vw, 300px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  transform: translate(-50%, calc(-100% + 26px)) scale(0.3) rotate(-6deg);
  transform-origin: 50% 100%;
  opacity: 0;
  filter: blur(8px);
  pointer-events: auto;
  cursor: pointer;
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.sketch-preview:disabled {
  pointer-events: none;
}

.sketch-preview.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, -100%) scale(1) rotate(0deg);
  transition:
    opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.35s ease-out;
}

.sketch-preview.is-leaving {
  opacity: 0;
  filter: blur(12px);
  transform: translate(-50%, calc(-100% + 20px)) scale(0.2) rotate(8deg);
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.sketch-preview.is-animating {
  transform: translate(-50%, calc(-100% - 8px)) scale(1.03) rotate(0deg);
}

.sketch-preview-shell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.22);
  border: 1.5px solid rgba(244, 239, 228, 0.10);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 3px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sketch-preview-canvas,
.sketch-preview-snapshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.sketch-preview-canvas {
  opacity: 0;
  transition: opacity 0.3s var(--ease-out), filter 0.45s var(--ease-out);
  filter: blur(10px);
}

.sketch-preview.is-ready .sketch-preview-canvas {
  opacity: 1;
  filter: blur(0);
}

.sketch-preview-snapshot {
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  filter: blur(4px) scale(0.95);
  transition: opacity 0.35s var(--ease-out), filter 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.sketch-preview.is-frozen .sketch-preview-snapshot {
  opacity: 1;
  filter: blur(0) scale(1);
}



@keyframes star-spin {
  to { rotate: 360deg; }
}

@keyframes star-pulse {
  0%, 100% { scale: 0.86; opacity: 0.58; }
  48% { scale: 1.12; opacity: 0.86; }
}

@keyframes star-burst-spin {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter:
      drop-shadow(0 0 10px oklch(82% 0.17 72 / 0.78))
      drop-shadow(0 0 22px oklch(86% 0.19 72 / 0.55));
  }
  55% {
    transform: scale(0.76) rotate(760deg);
    opacity: 1;
    filter:
      drop-shadow(0 0 16px oklch(90% 0.2 78 / 0.95))
      drop-shadow(0 0 30px oklch(88% 0.18 74 / 0.7));
  }
  82% {
    transform: scale(0.22) rotate(1320deg);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.55) rotate(1480deg);
    opacity: 0;
    filter:
      drop-shadow(0 0 28px oklch(100% 0.14 85 / 0))
      drop-shadow(0 0 46px oklch(100% 0.14 85 / 0));
  }
}

@keyframes star-burst-flash {
  0% { opacity: 0.45; }
  62% { opacity: 1; }
  100% { opacity: 0; }
}

.scenario-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -52px;
  z-index: 2400;
  width: auto;
  min-height: 320px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  padding: 20px 18px max(24px, calc(18px + env(safe-area-inset-bottom, 0px)));
  background: var(--ink);
  color: var(--paper-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 0.32s var(--ease-out), transform 0.42s cubic-bezier(0.5, 0, 0.2, 1);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  will-change: transform, opacity;
}

.scenario-sheet.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scenario-sheet.is-leaving {
  opacity: 1;
  visibility: visible;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.5, 0, 0.75, 0);
  pointer-events: none;
}

.scenario-sheet.is-entering {
  opacity: 1;
  visibility: visible;
  transform: translateY(100%);
  transition: none;
  pointer-events: none;
}

.scenario-sheet.is-switching-out {
  transform: translateY(58%);
  opacity: 1;
  pointer-events: none;
  transition: transform 0.14s cubic-bezier(0.5, 0, 0.75, 0);
}

.scenario-sheet.is-switching-in {
  animation: scenarioSheetRiseSwap 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes scenarioSheetRiseSwap {
  0% { transform: translateY(58%); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
}

.scenario-header h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 37px;
  margin: 0;
  line-height: 1.1;
}

.scenario-sheet-welcome .scenario-header h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 28px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.scenario-sheet-welcome .scenario-header h2 strong {
  font-family: var(--font-title);
  font-weight: 800 !important;
  font-size: 28px;
}

.scenario-motion {
  display: none;
}

.scenario-sheet-welcome .scenario-motion {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 23px;
}

.scenario-sheet-welcome .scenario-motion strong {
  font-family: var(--font-title);
  font-weight: 800 !important;
  font-size: inherit;
}

.scenario-copy {
  display: block;
  margin: 0;
  padding: 0 16px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.18;
  color: oklch(96% 0 0 / 0.78);
}

.scenario-sheet-welcome {
  min-height: unset;
  height: auto;
  gap: 10px;
  overflow: hidden;
}

.scenario-motion-welcome {
  display: block !important;
  padding: 0 16px;
  line-height: 1.35;
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.scenario-motion-welcome-text {
  margin-right: 6px;
}

.scenario-motion-welcome-stars {
  display: flex;
  align-items: center;
  gap: 18px;
}

.welcome-shape {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: oklch(14% 0 0);
  border: 1.5px solid oklch(96% 0 0);
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px oklch(96% 0 0 / 0.08);
  vertical-align: middle;
}

.welcome-circle {
  border-radius: 8px;
}

.welcome-diamond {
  border-radius: 8px;
}

.scenario-actions {
  margin: 0;
  padding: 0 16px;
}

.icon-action,
.scenario-open {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.scenario-open {
  width: 100%;
  height: 58px;
  min-height: 58px;
  padding: 0 16px 0 18px;
  font-size: 13px;
  border-radius: 8px;
  justify-content: space-between;
}

.scenario-close {
  position: absolute;
  top: 12px;
  left: auto;
  right: 16px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  background: transparent !important;
  color: var(--paper-soft) !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0;
  z-index: 2310;
  cursor: pointer;
  pointer-events: auto;
}

.scenario-close svg {
  width: 18px;
  height: 18px;
}

.console-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.console-status[data-state="sending"] { background: oklch(36% 0 0); }
.console-status[data-state="error"] { background: oklch(20% 0 0); }
.console-status[data-state="done"] { background: oklch(30% 0 0); }

.printer-debug {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: oklch(99% 0 0 / 0.76);
  border: 1px solid var(--line);
}

.printer-debug-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 5px oklch(50% 0 0 / 0.12);
}

.printer-debug strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
}

.printer-debug small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 25px;
}

.printer-debug[data-state="connected"] .printer-debug-dot { background: oklch(34% 0 0); }
.printer-debug[data-state="busy"] .printer-debug-dot { background: oklch(42% 0 0); }
.printer-debug[data-state="disconnected"] .printer-debug-dot { background: oklch(30% 0 0); }

.octo-error-toggle {
  width: 100%;
  min-height: 40px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: oklch(99% 0 0 / 0.62);
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.octo-error-toggle strong {
  min-width: 42px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: oklch(12% 0 0);
  color: var(--paper-soft);
  text-align: center;
}

.octo-error-toggle.is-off strong {
  background: transparent;
  color: var(--ink);
}

.console-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.console-command {
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: none;
  border-radius: 16px;
  background: #EBEBEB;
  color: oklch(12% 0 0);
  box-shadow:
    0 4px 12px oklch(0% 0 0 / 0.12),
    0 1px 3px oklch(0% 0 0 / 0.08);
  transition: transform 0.22s var(--ease-out), background 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}

/* Chorégraphie — gold */
.console-command[data-icon="choreo"] {
  background: #B37F37;
  color: oklch(8% 0 0);
}

/* Atelier — coral */
.console-command[data-icon="atelier"] {
  background: #EF7D7D;
  color: oklch(8% 0 0);
}

.console-command svg {
  width: 22px;
  height: 22px;
}

.console-command span {
  font-family: var(--font-title);
  font-size: clamp(11px, 2.6vw, 15px);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.console-command span strong {
  font-weight: 800;
  display: block;
}

.console-command:hover,
.console-command:focus-visible,
.console-command.is-loading {
  transform: translateY(-3px);
  box-shadow:
    0 8px 20px oklch(0% 0 0 / 0.18),
    0 2px 6px oklch(0% 0 0 / 0.10);
  outline: none;
}

.console-history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 8px;
  font-family: var(--font-title);
  font-weight: 800;
}

.console-history-head span {
  font-size: 21px;
}

.console-history-head small {
  color: var(--muted);
  font-size: 14px;
}

.console-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 142px;
  overflow-y: auto;
  padding: 0 8px 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.history-item,
.history-empty {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.history-empty {
  grid-template-columns: 1fr;
}

.history-item time,
.history-item code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
}

.history-item strong,
.history-empty strong {
  display: block;
  font-family: var(--font-title);
  font-size: 16px;
}

.history-item span,
.history-empty span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.history-item[data-state="done"] strong::before {
  content: "OK ";
  color: oklch(34% 0 0);
  font-family: var(--font-mono);
  font-size: 11px;
}

.history-item[data-state="error"] strong::before {
  content: "ERR ";
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
}

.choreo-panel {
  display: none;
}

.emergency-stop {
  width: 100%;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper-soft);
  border: 1px solid var(--ink);
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.screen-info {
  background:
    linear-gradient(180deg, oklch(99% 0 0 / 0.7), transparent),
    var(--paper);
}

.info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 0 22px;
}

.info-lead {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 37px;
  color: var(--ink-soft);
}

.info-copy {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 37px;
  color: var(--muted);
}

.screen-info strong {
  font-weight: 700;
}

.screen-vase {
  padding: 0;
  overflow: hidden;
  background: var(--paper);
}

.screen-vase .topbar {
  display: none !important;
}

.vase-heading {
  position: relative;
  min-height: 112px;
  pointer-events: auto;
}

.vase-heading > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 116px;
  padding: 0 24px;
}

.vase-detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vase-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: oklch(13% 0 0);
}

.carousel-viewport {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  touch-action: pan-x pan-y;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.carousel-viewport::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  background: oklch(13% 0 0);
  border: none;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
}

/* Flèches de navigation flottantes — grosses zones tactiles kiosk */
.swiper-button-prev-floating,
.swiper-button-next-floating {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: #fff;
  border: none;
  z-index: 100;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.swiper-button-prev-floating {
  left: 0;
}

.swiper-button-next-floating {
  right: 0;
}

.swiper-button-prev-floating svg,
.swiper-button-next-floating svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}

.swiper-button-prev-floating:hover,
.swiper-button-prev-floating:focus-visible,
.swiper-button-next-floating:hover,
.swiper-button-next-floating:focus-visible {
  opacity: 1;
}

.swiper-button-prev-floating:active {
  transform: translateY(-50%) scale(0.94);
}
.swiper-button-next-floating:active {
  transform: translateY(-50%) scale(0.94);
}

.swiper-button-prev-floating:disabled,
.swiper-button-next-floating:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Slide Poème (Musée Contemporain minimaliste) */
.slide-poem {
  background: #ffffff !important;
  color: #000000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.poem-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Centered container but left-aligned text */
  justify-content: center;
  text-align: left;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.poem-line {
  font-family: var(--font-title);
  font-size: 21px; /* Highly readable large size */
  font-weight: 400;
  line-height: 1.65;
  color: oklch(12% 0 0); /* Elegant dark charcoal/black ink */
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(12px);
  animation: poemLineFadeIn 0.8s var(--ease-out) forwards;
}

.poem-line:nth-child(1) { animation-delay: 0.1s; }
.poem-line:nth-child(2) { animation-delay: 0.4s; }
.poem-line:nth-child(3) { animation-delay: 0.7s; }

.poem-author {
  font-family: var(--font-title);
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  color: oklch(45% 0 0); /* Beautiful muted grey */
  margin-top: 16px;
  opacity: 0;
  transform: translateY(12px);
  animation: poemLineFadeIn 0.8s var(--ease-out) 1.2s forwards;
}

@keyframes poemLineFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Kiosk End Actions (Large stacked buttons on a white slide) */
.slide-kiosk-end {
  background: #ffffff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.kiosk-end-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px; /* Vertical gap between buttons */
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

/* Rounded-square premium iOS-style buttons */
.kiosk-end-btn {
  position: relative;
  width: 176px;
  height: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: oklch(95% 0 0); /* Very light grey */
  border: none;
  border-radius: 36px; /* Smooth rounded corners */
  box-shadow:
    0 14px 28px oklch(0% 0 0 / 0.12),
    0 3px 10px oklch(0% 0 0 / 0.08);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.2s var(--ease-out),
    box-shadow 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: 50% 50%;
}

.kiosk-end-btn:active {
  transform: translateY(3px) scale(0.985) !important;
  background: oklch(92% 0 0);
  box-shadow:
    0 6px 12px oklch(0% 0 0 / 0.10),
    0 1px 4px oklch(0% 0 0 / 0.08) !important;
  filter: saturate(0.96);
}

/* Chapel icon styling inside the home button */
.kiosk-end-chapel-icon {
  width: 68px;
  height: 68px;
  fill: #000000;
  stroke: none;
}

.kiosk-end-chapel-icon path,
.kiosk-end-chapel-icon circle {
  fill: #000000;
  stroke: #000000;
  stroke-width: 0.5;
}

/* Replay button text styling */
.kiosk-end-replay-text {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 500;
  color: #000000;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kiosk-end-replay-text strong {
  font-weight: 800;
}

.vase-image,
.vase-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: oklch(12% 0 0);
}

.video-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  border: 2px solid oklch(96% 0 0 / 0.34);
  border-top-color: var(--paper-soft);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: video-loader-spin 0.9s linear infinite;
}

.video-shell.is-loading .video-loader {
  opacity: 1;
}

@keyframes video-loader-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.video-controls {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  display: flex;
  gap: 16px;
  padding: 0;
  background: transparent;
}

.video-btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: var(--btn-radius);
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.3);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  overflow: hidden;
}

.video-btn:active {
  transform: scale(0.92);
  background: #f4efe4;
  box-shadow: 0 3px 8px oklch(0% 0 0 / 0.25);
}

.video-btn svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.poem-panel,
.vase-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.poem-panel span,
.vase-placeholder span {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.poem-panel p,
.vase-placeholder strong {
  font-size: 30px;
  font-weight: 400;
}

.slider-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 10px 12px 14px;
  background: oklch(96% 0 0 / 0.96);
  border-top: 1px solid var(--line);
}

.choreo-progress {
  position: relative;
  height: 22px;
  margin-bottom: 6px;
}

.choreo-progress-track {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  height: 16px;
  background: oklch(14% 0 0);
  overflow: hidden;
  border: 1px solid oklch(14% 0 0);
  border-radius: 3px;
  box-shadow: inset 0 2px 3px oklch(0% 0 0 / 0.6), inset 0 -1px 0 oklch(100% 0 0 / 0.06);
}

.choreo-progress-track span {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  background:
    linear-gradient(180deg, oklch(82% 0.16 220) 0%, oklch(62% 0.18 220) 45%, oklch(48% 0.16 220) 100%);
  box-shadow:
    inset 0 1px 0 oklch(96% 0.1 220 / 0.75),
    inset 0 -2px 3px oklch(20% 0.1 220 / 0.7),
    0 0 8px oklch(68% 0.18 220 / 0.55);
  transform-origin: left center;
  transition: width 0.18s linear;
}

.choreo-progress-track span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, oklch(100% 0 0 / 0.45) 50%, transparent 100%);
  transform: translateX(-100%);
  pointer-events: none;
}

.choreo-progress-track span.is-running {
  animation: choreo-download linear forwards;
}

.choreo-progress-track span.is-running::after {
  animation: mana-shine 1.6s linear infinite;
}

@keyframes choreo-download {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes mana-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.choreo-steps {
  position: absolute;
  inset: 4px 4px auto 4px;
  height: 16px;
  pointer-events: none;
}

.choreo-step {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: oklch(100% 0 0 / 0.32);
  box-shadow: 0 0 2px oklch(0% 0 0 / 0.5);
  pointer-events: auto;
}

.choreo-step.is-done {
  background: oklch(96% 0.1 220 / 0.85);
}

.choreo-step.is-active {
  width: 3px;
  height: 16px;
  background: oklch(100% 0 0);
  box-shadow: 0 0 6px oklch(68% 0.18 220 / 0.9);
}

.arrow-btn {
  width: 100%;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 0 18px;
  background: var(--ink);
  color: var(--paper-soft);
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  transition: transform 0.22s var(--ease-out), background 0.22s var(--ease-out), color 0.22s var(--ease-out);
}

.arrow-btn svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.arrow-btn.is-running svg {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  animation: none;
}

@keyframes button-eye-up {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(-4px); }
}

.arrow-btn.is-done svg {
  animation: none;
}

@keyframes replay-spin {
  to { transform: rotate(360deg); }
}

.arrow-btn:hover,
.arrow-btn:focus-visible,
.arrow-btn.is-running {
  background: oklch(24% 0 0);
  border-color: oklch(24% 0 0);
}

.look-stage-callout {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 120;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(0.94);
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}

.look-stage-callout.is-visible {
  animation: look-stage-fade 4s var(--ease-out) both;
}

.look-stage-callout svg {
  width: 128px;
  height: 128px;
  color: var(--ink);
  animation: look-arrow-up 1.25s var(--ease-out) infinite;
  opacity: 0.78;
}

.look-stage-callout span {
  display: none;
}

@keyframes look-stage-fade {
  0% { opacity: 0; transform: translate(-50%, -34%) scale(0.96); }
  14%, 72% { opacity: 0.95; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}

@keyframes look-arrow-up {
  0%, 100% { transform: translateY(5px); }
  50% { transform: translateY(-6px); }
}

.vase-copy {
  display: none;
}

.toast {
  position: absolute;
  top: 84px;
  right: 10px;
  z-index: 220;
  width: min(238px, calc(100% - 20px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-message {
  padding: 8px 10px;
  background: var(--ink);
  color: var(--paper-soft);
  border: 1px solid oklch(96% 0 0 / 0.18);
  opacity: 0;
  transform: translateX(-105%);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}

.toast-message.is-visible {
  opacity: 0.92;
  transform: translateX(0);
}

.toast-message.is-success { background: #1f7a3a; border-color: #2ea24d; color: #ffffff; }
.toast-message.is-error   { background: #b3261e; border-color: #e64841; color: #ffffff; }
.toast-message.is-warning { background: #b8860b; border-color: #e0a51e; color: #ffffff; }
.toast-message.is-info    { background: #1f4f8a; border-color: #2e6dbf; color: #ffffff; }

.toast-message strong {
  display: block;
  font-family: var(--font-title);
  font-size: 13px;
  line-height: 1.1;
}

.toast-message span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.84;
}

@media (max-width: 600px) and (max-height: 900px) {
  body {
    display: flex;
    padding: 0;
  }

  .app-shell {
    width: 480px;
    height: 800px;
    margin: 0 auto;
  }
}

@media (max-width: 420px) {
  .start-btn-touch {
    white-space: normal;
    text-wrap: balance;
    max-width: 276px;
  }

  .global-header {
    width: min(86%, 260px);
  }

  .console-command-grid {
    gap: 6px;
  }

  .console-command {
    height: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

@media (hover: none) {
  .sketch-hotspot:hover .pickup-core {
    transform: none;
    filter:
      drop-shadow(0 0 8px oklch(68% 0.18 220 / 0.48))
      drop-shadow(12px 22px 7px oklch(12% 0 0 / 0.2));
  }

  .console-command:hover:not(.is-loading) {
    transform: none;
    background: var(--paper-soft);
    color: var(--ink);
    outline: none;
  }
  .arrow-btn:hover:not(.is-running) {
    background: var(--ink);
    border-color: var(--ink);
  }
  .header-action:hover:not(.is-active) {
    background: var(--paper-soft);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: none;
  }
  .header-action-emergency:hover {
    background: oklch(96% 0.018 24 / 0.92);
    color: var(--danger-dark);
    border-color: oklch(52% 0.08 24 / 0.5);
  }
}

/* ===== Choreo route ===== */
.screen-choreo {
  position: absolute;
  inset: 0;
  background: oklch(100% 0 0);
  color: oklch(0% 0 0);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.choreo-center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  transform: translateY(-40px);
  z-index: 10;
}

.choreo-eye-logo {
  width: 140px;
  height: 140px;
}

.choreo-eye-logo .eye-contour {
  fill: none;
  stroke: oklch(0% 0 0);
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choreo-eye-logo .eye-iris {
  fill: oklch(0% 0 0);
}

.choreo-eye-logo .eye-pupil {
  fill: oklch(100% 0 0);
}

.choreo-eye-logo .eye-reflection {
  fill: oklch(100% 0 0);
}

.choreo-text-callout {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: oklch(0% 0 0);
  text-align: center;
  margin: 0;
  padding: 0 20px;
  line-height: 1.4;
  animation: choreoTextFade 2s ease-in-out infinite alternate;
}

@keyframes choreoTextFade {
  from { opacity: 0.8; }
  to   { opacity: 1; }
}

@keyframes eyeIrisLookUp {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1.5px, -4px);
  }
  50% {
    transform: translate(0, -9.5px);
  }
  75% {
    transform: translate(1.5px, -7px);
  }
}

.eye-iris-group {
  animation: eyeIrisLookUp 8s ease-in-out infinite;
  transform-origin: 50px 50px;
}

.choreo-stage {
  position: absolute;
  inset: 0;
}

.choreo-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  transform: translateY(-75px);
  touch-action: none;
}

/* ===== 3D printer loader ===== */
.choreo-loader {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: oklch(6% 0 0);
  color: var(--paper-soft);
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.42s var(--ease-out), visibility 0.42s;
}

.choreo-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.choreo-loader-svg {
  width: 200px;
  height: 260px;
  fill: none;
  stroke: var(--paper-soft);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choreo-loader-frame path {
  stroke-width: 1.5;
  opacity: 0.55;
}

.choreo-loader-vase {
  stroke-width: 1.4;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: loaderDraw 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.choreo-loader-nozzle {
  stroke-width: 1.6;
}

.choreo-loader-nozzle path {
  fill: var(--paper-soft);
  stroke: none;
}

.choreo-loader-nozzle {
  animation: loaderNozzle 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  transform-origin: 50% 50%;
}

@keyframes loaderDraw {
  0%   { stroke-dashoffset: 320; opacity: 0.2; }
  8%   { opacity: 1; }
  82%  { stroke-dashoffset: 0;   opacity: 1; }
  92%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: 320; opacity: 0; }
}

@keyframes loaderNozzle {
  0%   { transform: translate(0, 0); opacity: 0.4; }
  8%   { opacity: 1; }
  20%  { transform: translate(15px, 22px); }
  35%  { transform: translate(-13px, 42px); }
  50%  { transform: translate(18px, 58px); }
  65%  { transform: translate(-16px, 78px); }
  82%  { transform: translate(12px, 96px); opacity: 1; }
  92%  { transform: translate(0, 102px);   opacity: 0.6; }
  100% { transform: translate(0, 102px);   opacity: 0; }
}

.choreo-loader-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 220px;
}

.choreo-loader-tag {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  opacity: 0.7;
  animation: loaderTag 1.6s ease-in-out infinite;
}

@keyframes loaderTag {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

.choreo-loader-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: oklch(100% 0 0 / 0.18);
  overflow: hidden;
}

.choreo-loader-bar-fill {
  display: block;
  width: 30%;
  height: 100%;
  background: var(--paper-soft);
  animation: loaderBar 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes loaderBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(380%); }
}

@media (prefers-reduced-motion: reduce) {
  .choreo-loader-vase,
  .choreo-loader-nozzle,
  .choreo-loader-tag,
  .choreo-loader-bar-fill {
    animation: none;
  }
  .choreo-loader-vase { stroke-dashoffset: 0; }
}

.choreo-free-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(8% - 50px);
  z-index: 35;
  display: flex;
  justify-content: center;
  color: oklch(96% 0 0 / 0.78);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.36s var(--ease-out);
}

.screen-choreo[data-run-state="finished"] .choreo-free-hint {
  opacity: 1;
}

.choreo-free-hint svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choreo-hint-finger {
  animation: choreoHintFinger 1.6s ease-in-out infinite;
}

@keyframes choreoHintFinger {
  0%, 100% { transform: translateY(-6px) rotate(180deg); opacity: 0.55; }
  50%      { transform: translateY(10px) rotate(180deg); opacity: 1; }
}

.choreo-look-callout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 130px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--paper-soft);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.32s var(--ease-out), transform 0.36s var(--ease-out);
}

.choreo-look-callout.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: choreoEyeFloat 2.6s ease-in-out infinite;
}

.choreo-look-callout svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}

.choreo-look-callout span {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

@keyframes choreoEyeFloat {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50%      { transform: translateY(-4px); opacity: 1; }
}

.choreo-gauge {
  --progress: 0%;
  --progress-ratio: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  z-index: 40;
  background: oklch(0% 0 0);
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  overflow: visible;
}

.choreo-gauge::before {
  display: none;
}

.choreo-gauge.is-running::before,
.choreo-gauge.is-full::before {
  display: none;
}

.choreo-gauge.is-full::before {
  display: none;
}

.choreo-gauge-dots {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  height: 100%;
  z-index: 2;
}

.choreo-gauge-dots span {
  width: 6px;
  height: 6px;
  background: oklch(100% 0 0);
  border-radius: 50%;
  opacity: 0.22; /* Dim upcoming/inactive dots by default */
  transition: opacity 0.2s ease, scale 0.2s ease;
}

.choreo-gauge-dots span.is-active {
  opacity: 1; /* Bright white active dots */
  scale: 1.15;
}

/* Sliding grey playhead triangle (▶) */
.choreo-gauge-playhead {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  color: oklch(55% 0 0); /* Elegant medium grey play indicator color */
  transition: left 0.15s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.choreo-gauge-playhead svg {
  width: 100%;
  height: 100%;
}

.choreo-end-actions {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 76px;
  z-index: 50;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  padding: 0;
  pointer-events: none;
}

.choreo-end-actions.is-visible {
  pointer-events: auto;
}

/* iOS app-icon style squircle tiles */
.choreo-end-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 1 / 1.05;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  background: oklch(95% 0 0);
  color: oklch(8% 0 0);
  border: none;
  border-radius: 28px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(30px);
  box-shadow:
    0 14px 28px oklch(0% 0 0 / 0.18),
    0 3px 10px oklch(0% 0 0 / 0.10);
  transition:
    transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.2s var(--ease-out),
    box-shadow 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: 50% 50%;
}

.choreo-end-btn strong {
  font-weight: 800;
  display: inline;
}

/* Mixed-weight label text */
.choreo-end-label {
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}

/* Chapel icon inside btn-home */
.choreo-end-chapel-icon {
  width: 56px;
  height: 56px;
  fill: oklch(8% 0 0);
  stroke: none;
}

.choreo-end-chapel-icon path,
.choreo-end-chapel-icon circle {
  fill: oklch(8% 0 0);
  stroke: oklch(8% 0 0);
  stroke-width: 0.5;
}

.choreo-end-btn:active {
  transform: translateY(3px) scale(0.985);
  background: oklch(92% 0 0);
  box-shadow:
    0 6px 12px oklch(0% 0 0 / 0.12),
    0 1px 4px oklch(0% 0 0 / 0.08);
  filter: saturate(0.96);
}

.choreo-end-actions.is-visible .btn-home {
  animation: choreoBtnInUp 0.6s cubic-bezier(0.5, 0, 0.2, 1) 0.05s forwards;
}

.choreo-end-actions.is-visible .btn-replay {
  animation: choreoBtnInUp 0.6s cubic-bezier(0.5, 0, 0.2, 1) 0.10s forwards;
}

.choreo-end-actions.is-visible .btn-slides {
  animation: choreoBtnInUp 0.6s cubic-bezier(0.5, 0, 0.2, 1) 0.15s forwards;
}

@keyframes choreoBtnInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes choreoHintPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.85; }
}

/* Back arrow (shown only on choreo + vase) */
.back-arrow-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 230;
  height: 48px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: oklch(96% 0 0 / 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.back-arrow-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell[data-route="choreo"] .back-arrow-btn,
.app-shell[data-route="vase"] .back-arrow-btn {
  display: inline-flex;
}

.app-shell[data-route="choreo"] .back-arrow-btn {
  background: oklch(99% 0 0);
  border-color: var(--ink);
  color: var(--ink);
}

/* Details topbar and 3D shell are now fully visible and active */

/* No footer on vase/choreo: screens take full height */
.app-shell[data-route="vase"] .screen-vase,
.app-shell[data-route="choreo"] .screen-choreo {
  inset: 0;
  padding: 0;
}

/* Slider-controls no longer rendered (kept rules harmless if stragglers remain) */
.slider-controls { display: none !important; }

/* =========================================================
   TACTILE BUTTON SYSTEM
   - Min hit 44px (compact), default 56px, primary 68px
   - Crisp 1.5px borders, generous padding, uppercase label
   - Use .btn + size modifier + variant
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-height: var(--btn-h-md);
  padding: 0 var(--btn-pad-x);
  background: var(--paper-soft);
  color: var(--ink);
  border: var(--btn-border) solid var(--ink);
  border-radius: var(--btn-radius);
  font-family: var(--font-title);
  font-size: var(--btn-font);
  font-weight: 800;
  letter-spacing: var(--btn-letter);
  line-height: 1.15;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease-out), background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
  background: oklch(86% 0 0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* Sizes */
.btn--sm { min-height: var(--btn-h-sm); font-size: 11px; padding: 0 14px; }
.btn--md { min-height: var(--btn-h-md); }
.btn--lg { min-height: var(--btn-h-lg); font-size: 14px; padding: 0 22px; }

/* Variants */
.btn--invert {
  background: var(--ink);
  color: var(--paper-soft);
  border-color: var(--ink);
}
.btn--invert:active { background: oklch(28% 0 0); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--pill { border-radius: var(--btn-radius-pill); }

.btn--block { width: 100%; }

.btn--icon {
  padding: 0;
  width: var(--btn-h-md);
  min-height: var(--btn-h-md);
  border-radius: var(--btn-radius);
}
.btn--icon.btn--sm { width: var(--btn-h-sm); min-height: var(--btn-h-sm); }
.btn--icon.btn--lg { width: var(--btn-h-lg); min-height: var(--btn-h-lg); }

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Existing components aligned with btn tokens === */

/* ===========================================================
   BRUTALIST ACTION BUTTONS (JOUER / REJOUER / VOIR INFOS)
   Hard-shadow offset, thick border, huge label.
   =========================================================== */
.scenario-open {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 0.95;
  color: oklch(8% 0 0);
  background: oklch(99% 0 0);
  border: 3px solid oklch(8% 0 0);
  border-radius: 18px;
  box-shadow: 6px 6px 0 0 oklch(8% 0 0);
  transition:
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.12s var(--ease-out),
    background 0.18s var(--ease-out);
  isolation: isolate;
  overflow: hidden;
}

.scenario-open::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    oklch(8% 0 0 / 0.04) 12px 13px
  );
  z-index: -1;
}

.scenario-open:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 0 oklch(8% 0 0);
  background: oklch(92% 0 0);
}

/* JOUER (primary in scenario modal) */
.scenario-open {
  width: 100%;
  min-height: 72px;
  height: 72px;
  padding: 0 22px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 25px;
}
.scenario-open span {
  flex: 1;
  text-align: center;
}
.scenario-open svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}



/* Back arrow aligned with system */
.back-arrow-btn {
  border-radius: var(--btn-radius);
  border-width: var(--btn-border);
}

/* =================================================================
   UNIVERSAL TAP FX
   - .tap-fx       : opt-in for any button to get ripple + recoil
   - .tap-fx-invert: header-style invert flash on press
   - .tap-fx-slide : back-arrow style slide-back on press
   - .tap-fx-morph : hamburger style morph (handled inline)
   JS sets --tap-x / --tap-y from pointerdown position, then
   adds .is-tapping; class is removed on transition end / timeout.
   ================================================================= */
.tap-fx {
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--tap-dur-release) var(--tap-ease-release),
    box-shadow var(--tap-dur-release) var(--tap-ease-release);
  will-change: transform;
}

.tap-fx:not(.scenario-close):not(.vase-nav-toggle):not(.back-arrow-btn) {
  position: relative;
}

.tap-fx::after {
  display: none;
}

.tap-fx > * { position: relative; z-index: 1; }

.tap-fx.is-tapping {
  transform: translateY(var(--tap-recoil)) scale(var(--tap-scale));
  transition:
    transform var(--tap-dur-press) var(--tap-ease-press),
    box-shadow var(--tap-dur-press) var(--tap-ease-press);
}

.tap-fx.is-tapping::after {
  animation: none;
}

/* Variants: invert flash (header utility) */
.tap-fx-invert {
  transition:
    background var(--tap-dur-press) var(--tap-ease-press),
    color var(--tap-dur-press) var(--tap-ease-press),
    transform var(--tap-dur-release) var(--tap-ease-release);
}

.tap-fx-invert:not(.scenario-close):not(.vase-nav-toggle):not(.back-arrow-btn) {
  position: relative;
}
.tap-fx-invert.is-tapping {
  background: var(--ink) !important;
  color: var(--paper-soft) !important;
  transform: scale(0.96);
}
.tap-fx-invert.is-tapping svg {
  stroke: currentColor;
}

/* Variants: slide-back (back arrow) */
.tap-fx-slide {
  transition:
    transform var(--tap-dur-release) var(--tap-ease-release),
    background var(--tap-dur-press) var(--tap-ease-press),
    color var(--tap-dur-press) var(--tap-ease-press);
}
.tap-fx-slide.is-tapping {
  transform: translateX(-6px) scale(0.97);
  background: var(--ink);
  color: var(--paper-soft);
}
.tap-fx-slide.is-tapping svg {
  stroke: currentColor;
  animation: tap-arrow-pull 0.32s var(--tap-ease-release);
}
@keyframes tap-arrow-pull {
  0%   { transform: translateX(0); }
  40%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* Brutalist hero override: scenario-open keeps offset-press; choreo-end-btn uses soft scale */
.scenario-open.tap-fx.is-tapping {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 0 oklch(8% 0 0);
  background: oklch(94% 0 0);
}

.choreo-end-btn.tap-fx.is-tapping {
  transform: translateY(3px) scale(0.985);
  background: oklch(92% 0 0);
  box-shadow:
    0 6px 12px oklch(0% 0 0 / 0.12),
    0 1px 4px oklch(0% 0 0 / 0.08);
  filter: saturate(0.96);
}

.kiosk-end-btn.tap-fx.is-tapping {
  transform: translateY(3px) scale(0.985);
  background: oklch(92% 0 0);
  box-shadow:
    0 6px 12px oklch(0% 0 0 / 0.10),
    0 1px 4px oklch(0% 0 0 / 0.08);
  filter: saturate(0.96);
}

/* Hamburger press feedback (no rotation) */
.vase-nav-toggle.tap-fx.is-tapping {
  transform: scale(0.92);
}

/* Focus visible: keyboard-only highlight */
.tap-fx:focus-visible,
.tap-fx-invert:focus-visible,
.tap-fx-slide:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Reduced motion fallback: keep press feedback minimal */
@media (prefers-reduced-motion: reduce) {
  .tap-fx,
  .tap-fx-invert,
  .tap-fx-slide {
    transition: background 0.12s linear, color 0.12s linear;
  }
  .tap-fx::after,
  .tap-fx.is-tapping::after {
    display: none;
  }
  .tap-fx.is-tapping,
  .tap-fx-invert.is-tapping,
  .tap-fx-slide.is-tapping {
    transform: none;
  }
}

/* =========================================================
   EMERGENCY SCREEN
   ========================================================= */
.screen-emergency {
  background: var(--paper);
  color: var(--ink);
  z-index: 1000;
}

.emergency-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.emergency-text-wrapper {
  width: 100%;
  margin-bottom: 18px;
}

.emergency-warning-text {
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 12px;
  text-align: left;
}

.emergency-warning-text strong {
  font-weight: 700;
}

.emergency-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 20px;
}

.emergency-stop-btn {
  position: relative;
  width: 140px;
  height: 140px;
  background:
    linear-gradient(180deg, oklch(15% 0 0), oklch(3% 0 0));
  border: 4px solid oklch(88% 0.19 92);
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.42),
    0 0 0 8px rgba(255, 214, 0, 0.18),
    inset 0 2px 8px rgba(255, 255, 255, 0.12),
    inset 0 -6px 14px rgba(0, 0, 0, 0.55);
  animation: emergencyPulse 2s infinite ease-in-out;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.emergency-stop-btn:active {
  transform: scale(0.95);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    0 0 0 8px rgba(255, 214, 0, 0.28),
    inset 0 3px 12px rgba(0, 0, 0, 0.75);
  animation: none;
}

.emergency-icon-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter:
    brightness(0)
    saturate(100%)
    invert(72%)
    sepia(85%)
    saturate(700%)
    hue-rotate(5deg)
    brightness(105%);
}

@keyframes emergencyPulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.42),
      0 0 0 8px rgba(255, 214, 0, 0.18),
      inset 0 2px 8px rgba(255, 255, 255, 0.12),
      inset 0 -6px 14px rgba(0, 0, 0, 0.55);
  }
  50% {
    transform: scale(1.04);
    box-shadow:
      0 18px 38px rgba(0, 0, 0, 0.52),
      0 0 0 16px rgba(255, 214, 0, 0),
      inset 0 2px 8px rgba(255, 255, 255, 0.12),
      inset 0 -6px 14px rgba(0, 0, 0, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.42),
      0 0 0 8px rgba(255, 214, 0, 0),
      inset 0 2px 8px rgba(255, 255, 255, 0.12),
      inset 0 -6px 14px rgba(0, 0, 0, 0.55);
  }
}

/* =========================================================
   HOME GUIDE HAND
   ========================================================= */
.home-guide-hand {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 120px;
  z-index: 100;
  pointer-events: none;
  animation: bounceHand 1.5s infinite ease-in-out;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.home-guide-hand.is-hidden {
  opacity: 0;
  transform: translate(-50%, 20px);
}

.guide-hand-img {
  height: 120px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) opacity(0.5) drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

@keyframes bounceHand {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -24px); }
}

/* =========================================================
   CAROUSEL DRAG & DROP SUPPORT
   ========================================================= */
.carousel-viewport {
  cursor: grab;
}

.carousel-viewport.is-grabbing {
  cursor: grabbing;
  user-select: none;
}

.carousel-viewport.is-grabbing * {
  pointer-events: none;
}

/* =========================================================
   TYPOGRAPHY AND UTIL CLASSES
   ========================================================= */
.typo-extra-bold {
  font-weight: 800 !important;
}

.text-nowrap {
  white-space: nowrap !important;
}

/* =========================================================
   PREMIUM CONSOLE FURRY VIEW
   ========================================================= */
.screen-console {
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 70px 32px 20px !important;
  box-sizing: border-box;
  overflow: hidden !important;
}

.console-panel {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: transparent !important;
  padding: 10px 0 !important;
  box-sizing: border-box;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden !important;
  height: 100%;
}

.console-panel::-webkit-scrollbar {
  display: none;
}

.console-vase-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-shell[data-route="console"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('assets/images/layer-frame.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
}

/* L'ancien pied de page console est supprime car le footer est masque */

.console-panel-title {
  font-family: var(--font-title);
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 8px;
  color: #000000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.printer-debug {
  width: 100%;
  background: transparent !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px;
  padding: 10px 14px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  box-sizing: border-box;
}

.printer-debug-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000000;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px oklch(50% 0 0 / 0.12);
}

.printer-debug strong {
  font-family: var(--font-sans);
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #000000 !important;
  line-height: 1.2 !important;
}

.printer-debug small {
  font-family: var(--font-sans);
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #666666 !important;
  margin-top: 2px;
  line-height: 1.2 !important;
}

.console-command-grid {
  width: 100%;
  max-width: min(100%, calc((100vh - 230px) * 3 / 4)) !important;
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4px !important;
  margin: 0 auto !important;
}

.console-command {
  position: relative;
  aspect-ratio: 1 / 1 !important;
  width: calc(100% - 0px) !important;
  height: auto !important;
  margin: 5px auto !important;
  background: url('assets/images/frame-console-button.png') no-repeat center center !important;
  background-size: 100% 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.45)) !important;
  color: #000000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  cursor: pointer;
  box-sizing: border-box;
  transform: none !important;
  transition: transform 0.1s var(--ease-out);
}

.console-command:active {
  transform: scale(0.95) !important;
}

.console-command span {
  font-family: var(--font-title);
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  color: #000000;
  display: block;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.35);
}

.console-command span strong {
  display: inline;
  font-weight: 800;
}

/* =========================================================
   INFO SCREEN CENTERED VIEW
   ========================================================= */
.screen-info {
  background: #ffffff !important;
  color: #000000 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 52px 20px 24px !important;
  box-sizing: border-box;
  overflow: hidden !important;
}

.info-panel {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  flex-grow: 1;
  height: 100%;
}

.info-nez-img {
  width: 95%;
  max-width: 420px;
  margin: 20px auto 10px;
  align-self: center;
  height: auto;
  max-height: 35vh;
  object-fit: contain;
}

.info-project-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
  margin: 0 0 8px;
  color: #000000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.info-qr-container {
  width: min(240px, 30vh);
  height: min(240px, 30vh);
  margin: 0 0 8px;
}

.info-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.info-scan-text {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  color: #000000;
  max-width: none;
  margin: auto 0 0;
}
