/* ============================================================
   WOLFOU - DESIGN SYSTEM & FEUILLE DE STYLES PREMIUM
   Thème : Conte Gothique, Claymation & Dark Fantasy Médio-Médiéval
   ============================================================ */

:root {
  /* Palette Principale Dark Fantasy */
  --nuit: #0A0612;
  --nuit-abyssale: #06030A;
  --nuit2: #160D24;
  --pourpre: #2D1A42;
  --argile: #D49B6A;
  --parchemin: #F7EEDD;
  --lune: #F5E8D0;
  --braise: #FFAE33;
  --braise-eclat: #FFD275;
  --or-forge: #E6C280;
  --or-cadre: #8A662D;
  --or-glow: rgba(230, 194, 128, 0.45);
  --poison: #4AE099;
  --poison-glow: rgba(74, 224, 153, 0.4);
  --sang: #B82E39;
  --sang-glow: rgba(184, 46, 57, 0.45);
  --sang-sombre: #541116;

  /* Typographie */
  --ff-display: 'Noto Serif Dives Akuru', 'Iowan Old Style', Georgia, serif;
  --ff-body: 'Karla', 'Avenir Next', system-ui, -apple-system, sans-serif;

  /* Espacements & Rayons */
  --pad: clamp(16px, 4.5vw, 32px);
  --r-clay: 20px 24px 20px 22px / 22px 20px 24px 20px;
  --r-card: 18px;
  --r-btn: 16px;
  
  /* Ombres Physiques & Reliefs */
  --shadow-clay: inset 0 1px 1px rgba(255, 235, 205, 0.25), inset 0 -2px 6px rgba(0, 0, 0, 0.6), 0 16px 36px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(230, 194, 128, 0.22);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--nuit-abyssale);
  color: var(--lune);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img, video {
  display: block;
  max-width: 100%;
  user-drag: none;
  -webkit-user-drag: none;
}

/* GESTION UNIFORME ET PROPORTIONNÉE DES ICÔNES */
.icon-img {
  width: 1.25em;
  height: 1.25em;
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.sound-toggle .icon-img {
  width: 24px;
  height: 24px;
  max-width: none;
  max-height: none;
}

.opt-close .icon-img,
.rp-close .icon-img,
#riX .icon-img {
  width: 18px;
  height: 18px;
  max-width: none;
  max-height: none;
}

/* ============ ATMOSPHÈRE & PERFORMANCE ============ */
#ciel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  transition: background 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}
#ciel.nuit {
  background: 
    radial-gradient(110% 80% at 75% 5%, #321B4E 0%, #160D26 40%, #0A0612 85%), 
    var(--nuit-abyssale);
}
#ciel.jour {
  background: 
    radial-gradient(110% 80% at 25% 5%, #B86B38 0%, #5E313C 45%, #180D26 85%), 
    var(--nuit-abyssale);
}
#ciel.sang {
  background: 
    radial-gradient(110% 80% at 50% 15%, #8C1C24 0%, #330B1E 50%, #0A0612 90%), 
    var(--nuit-abyssale);
}

#grain {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}

#vignette {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 55;
  pointer-events: none;
  box-shadow: inset 0 0 min(45vw, 360px) rgba(2, 1, 6, 0.94);
}

/* ============ STRUCTURE DE L'APPLICATION GAME HUD ============ */
#app {
  position: relative;
  z-index: 10;
  height: 100dvh;
  height: var(--app-vh, 100dvh);
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100dvh;
  height: var(--app-vh, 100dvh);
  padding: 0;
  overflow: hidden;
  position: relative;
}

.screen:not(#scr-accueil) {
  padding-top: 0;
}

.screen.on {
  display: flex;
  animation: screenIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* COMPOSANTS GAME HUD (HEADER, BODY & DOCK) */
.game-header {
  flex: none;
  width: 100%;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 8px;
  text-align: center;
  position: relative;
  z-index: 25;
  background: linear-gradient(180deg, rgba(10, 6, 18, 0.95) 0%, rgba(10, 6, 18, 0.6) 80%, transparent 100%);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header h2 {
  margin: 0 0 0.15em;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.game-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px var(--pad) 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 194, 128, 0.3) transparent;
  display: flex;
  flex-direction: column;
}

.game-body.center-hero {
  align-items: center;
  justify-content: center;
}

.game-body::-webkit-scrollbar {
  width: 5px;
}
.game-body::-webkit-scrollbar-thumb {
  background: rgba(230, 194, 128, 0.3);
  border-radius: 999px;
}

.game-dock {
  flex: none;
  width: 100%;
  padding: 10px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(6, 3, 12, 0.98) 0%, rgba(14, 9, 24, 0.88) 75%, transparent 100%);
  border-top: 1.5px solid rgba(230, 194, 128, 0.24);
  backdrop-filter: blur(12px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 35;
}

.game-dock .btn,
.game-dock .btn-row {
  max-width: 440px;
  width: 100%;
}

/* ============ MODE SWITCH & BALANCE BAR ============ */
.mode-switch {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 16px;
  background: rgba(14, 9, 24, 0.75);
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.3), 0 6px 16px rgba(0, 0, 0, 0.4);
  max-width: 420px;
  width: 100%;
  margin: 4px 0 6px;
}

.mode-opt {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: var(--lune);
  opacity: 0.6;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-opt.on {
  opacity: 1;
  color: #FFF3D6;
  font-weight: 800;
  background: linear-gradient(165deg, rgba(124, 92, 168, 0.65), rgba(45, 26, 66, 0.85));
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.5), 0 4px 12px rgba(124, 92, 168, 0.4);
  animation: modePulse 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modePulse {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.balance {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  text-align: center;
  background: rgba(14, 9, 24, 0.7);
  border: 1px solid rgba(230, 194, 128, 0.3);
  color: #FFF3D6;
  max-width: 420px;
  width: 100%;
}

.balance.ok {
  border-color: rgba(90, 210, 140, 0.5);
  color: #A3FFCE;
}

.balance.warn {
  border-color: rgba(255, 174, 51, 0.6);
  color: #FFE699;
}

.balance.err {
  border-color: rgba(255, 90, 90, 0.6);
  color: #FFB3B3;
}

/* ============ GRILLE ET CARTES DE PERSONNAGES COMPACTES & AÉRÉES ============ */
.role-rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 6px 0 12px;
  width: 100%;
  max-width: 1000px;
}

@media (min-width: 480px) {
  .role-rows {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (min-width: 760px) {
  .role-rows {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1050px) {
  .role-rows {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
}

.role-row {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
  border: 1.5px solid var(--or-cadre);
  background: linear-gradient(165deg, #241638 0%, #0E0818 100%);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.6), 
    0 0 0 1px rgba(230, 194, 128, 0.2) inset,
    inset 0 1px 0 rgba(255, 240, 215, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s;
}

.role-row::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  border-radius: inherit;
  border: 1px solid rgba(255, 174, 51, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.role-row:hover {
  border-color: var(--or-forge);
  transform: translateY(-2px) scale(1.012);
  box-shadow: 
    0 12px 28px rgba(0, 0, 0, 0.75), 
    0 0 16px rgba(255, 174, 51, 0.3),
    inset 0 1px 0 rgba(255, 240, 215, 0.4);
}

.role-row.active {
  border-color: var(--or-forge);
  box-shadow: 
    0 12px 28px rgba(0, 0, 0, 0.8), 
    0 0 20px rgba(255, 174, 51, 0.35);
}

.rr-media {
  position: relative;
  width: 100%;
  padding-top: 78%;
  overflow: hidden;
  background: #08040E;
  border-bottom: 1.5px solid #6E4926;
  flex: none;
}

.rr-media video,
.rr-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-row:hover .rr-media video,
.role-row:hover .rr-media img {
  transform: scale(1.06);
}

.role-team-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(10, 6, 18, 0.85);
  border: 1px solid rgba(230, 194, 128, 0.35);
  color: var(--lune);
  backdrop-filter: blur(4px);
}

.role-team-tag.loups {
  border-color: rgba(255, 120, 120, 0.6);
  color: #FFB3B3;
}

.role-row .meta {
  padding: 8px 10px 4px;
  min-width: 0;
  z-index: 3;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.role-row .meta b {
  font-family: var(--ff-display);
  font-size: clamp(0.98rem, 2.5vw, 1.15rem);
  display: block;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #FFF3D6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.role-row .meta span {
  font-size: clamp(0.66rem, 1.7vw, 0.76rem);
  color: var(--lune);
  opacity: 0.84;
  display: block;
  margin-top: 3px;
  line-height: 1.25;
}

/* MINI-STEP ALIGNÉ EN BAS DE TOUTES LES CARTES */
.mini-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: auto 8px 8px;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(6, 3, 12, 0.85);
  box-shadow: inset 0 0 0 1.5px rgba(138, 102, 45, 0.6), 0 3px 8px rgba(0, 0, 0, 0.6);
  z-index: 3;
  flex: none;
}

.step-btn {
  width: clamp(32px, 7vw, 38px);
  height: clamp(32px, 7vw, 38px);
  border-radius: 8px;
  background: linear-gradient(145deg, #4A2B18, #21120A);
  flex: none;
  box-shadow: inset 0 0 0 1.5px #8A662D, 0 3px 8px rgba(0, 0, 0, 0.5);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--lune);
  transition: transform 0.12s ease, background 0.14s, border-color 0.14s;
  border: 1px solid #C4793B;
  cursor: pointer;
}

.step-btn:active {
  transform: scale(0.86);
  background: linear-gradient(145deg, #FFAE33, #C4793B);
  color: #140E22;
}

.mini-step .val {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  line-height: 1;
  min-width: 1.4ch;
  text-align: center;
  color: var(--braise);
  text-shadow: 0 2px 10px rgba(255, 174, 51, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-row.active .mini-step .val {
  color: #FFAE33;
  text-shadow: 0 0 12px rgba(255, 174, 51, 0.7);
}

.compo-options {
  flex: none;
  width: 100%;
  max-width: 580px;
  margin: 8px auto 0;
}

/* ============ TYPOGRAPHIE ============ */
.eyebrow {
  font-size: clamp(0.68rem, 1.8vw, 0.78rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--argile);
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 10px rgba(212, 155, 106, 0.2);
}
h1 {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 13.5vw, 4.6rem);
  line-height: 0.88;
  margin: 0.15em 0 0.1em;
  letter-spacing: -0.01em;
}
h2 {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(1.65rem, 7.5vw, 2.5rem);
  line-height: 1.05;
  margin: 0 0 0.35em;
  color: #FFF3D6;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.85), 0 0 15px rgba(255, 243, 214, 0.2);
}
h3 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 0.25em;
  color: var(--lune);
}
p {
  margin: 0 0 0.8em;
}
.lede {
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  opacity: 0.88;
  max-width: 36ch;
  line-height: 1.45;
}
.mono {
  font-family: var(--ff-body);
  font-variant-numeric: tabular-nums;
}

.jitter {
  animation: jitter 0.85s steps(1, end) infinite;
}
@keyframes jitter {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(0.6px, -0.6px) rotate(0.2deg); }
  66% { transform: translate(-0.6px, 0.5px) rotate(-0.15deg); }
}

/* ============ BOUTONS PREMIUM ============ */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  width: 100%;
  min-height: 52px;
  padding: 0.9em 1.4em;
  border-radius: var(--r-btn);
  background: linear-gradient(175deg, #E6A055 0%, #C4793B 55%, #9E5624 100%);
  color: #210F03;
  font-weight: 800;
  font-size: 1.04rem;
  letter-spacing: 0.03em;
  box-shadow: 
    0 7px 0 #613414, 
    0 12px 28px rgba(0, 0, 0, 0.55), 
    inset 0 2px 1px rgba(255, 240, 215, 0.55),
    inset 0 -2px 3px rgba(70, 30, 5, 0.4);
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.12s ease, filter 0.15s;
  text-align: center;
  border: 1px solid #FFAE42;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.btn:hover::before {
  left: 140%;
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow: 
    0 8px 0 #613414, 
    0 16px 32px rgba(230, 160, 85, 0.3), 
    inset 0 2px 1px rgba(255, 240, 215, 0.7);
}

.btn:active {
  transform: translateY(5px);
  box-shadow: 
    0 2px 0 #613414, 
    0 6px 14px rgba(0, 0, 0, 0.5), 
    inset 0 2px 1px rgba(255, 240, 215, 0.3);
}

.btn.ghost {
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.1), rgba(245, 232, 208, 0.03));
  color: var(--lune);
  border: 1.5px solid rgba(230, 194, 128, 0.35);
  box-shadow: 
    0 5px 0 rgba(10, 6, 18, 0.6), 
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 12px rgba(230, 194, 128, 0.08);
  font-weight: 700;
}

.btn.ghost:hover {
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.16), rgba(245, 232, 208, 0.06));
  border-color: rgba(230, 194, 128, 0.6);
  box-shadow: 
    0 6px 0 rgba(10, 6, 18, 0.6), 
    0 10px 24px rgba(230, 194, 128, 0.2);
}

.btn.ghost:active {
  transform: translateY(3px);
  box-shadow: 
    0 2px 0 rgba(10, 6, 18, 0.6), 
    inset 0 0 8px rgba(230, 194, 128, 0.12);
}

.btn.danger {
  background: linear-gradient(175deg, #D4404C 0%, #9E2129 60%, #70141A 100%);
  color: #FFE6E6;
  border-color: #FF6670;
  box-shadow: 
    0 7px 0 #4A0B10, 
    0 12px 28px rgba(184, 46, 57, 0.35), 
    inset 0 2px 1px rgba(255, 200, 200, 0.45);
}

.btn.danger:hover {
  filter: brightness(1.1);
  box-shadow: 
    0 8px 0 #4A0B10, 
    0 16px 32px rgba(212, 64, 76, 0.45);
}

.btn.danger:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #4A0B10, inset 0 2px 1px rgba(255, 200, 200, 0.3);
}

.btn.poison {
  background: linear-gradient(175deg, #56EFAD 0%, #2CB77D 60%, #1B7A52 100%);
  color: #042416;
  border-color: #7BFFC8;
  box-shadow: 
    0 7px 0 #0E482F, 
    0 12px 28px rgba(74, 224, 153, 0.35), 
    inset 0 2px 1px rgba(220, 255, 235, 0.65);
}

.btn.poison:hover {
  filter: brightness(1.08);
  box-shadow: 
    0 8px 0 #0E482F, 
    0 16px 32px rgba(74, 224, 153, 0.45);
}

.btn.poison:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #0E482F, inset 0 2px 1px rgba(220, 255, 235, 0.4);
}

.btn[disabled] {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.6);
}

.btn-row {
  display: flex;
  gap: 12px;
}
.btn-row .btn {
  flex: 1;
}

/* ICÔNE DE LUNE AVEC RESPIRATION ET ILLUMINATION AU CLIC */
.btn-moon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-left: 0.2em;
  filter: drop-shadow(0 0 6px rgba(255, 174, 51, 0.5)) brightness(0.85);
  animation: moonBreathe 3.2s ease-in-out infinite;
  transition: filter 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
}

@keyframes moonBreathe {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(255, 174, 51, 0.4)) brightness(0.85);
    transform: scale(0.95);
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255, 210, 117, 0.95)) brightness(1.25);
    transform: scale(1.14);
  }
}

.btn:active .btn-moon-icon {
  filter: drop-shadow(0 0 20px rgba(255, 235, 170, 1)) brightness(2);
  transform: scale(1.35) rotate(-14deg);
}

/* ============ CONTENEUR CLAY / SLATE ============ */
.clay {
  position: relative;
  border-radius: var(--r-clay);
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.1), rgba(16, 10, 26, 0.7));
  box-shadow: 
    inset 0 0 0 1.5px rgba(230, 194, 128, 0.2), 
    inset 0 1px 0 rgba(255, 240, 215, 0.2),
    0 16px 36px rgba(0, 0, 0, 0.55);
  padding: 20px;
  backdrop-filter: blur(8px);
}


/* ============ REDESIGN DES CARTES DARK FANTASY MÉDIÉVAL ============ */
.role-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(145px, 27vw, 210px), 1fr));
  gap: clamp(12px, 2.5vw, 20px);
  margin: 14px 0 18px;
}

.role-row {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 2px solid var(--or-cadre);
  background: linear-gradient(165deg, #241638 0%, #0E0818 100%);
  box-shadow: 
    0 14px 32px rgba(0, 0, 0, 0.7), 
    0 0 0 1px rgba(230, 194, 128, 0.25) inset,
    inset 0 1px 0 rgba(255, 240, 215, 0.25);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.2s;
}

.role-row::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  border-radius: inherit;
  border: 1px solid rgba(255, 174, 51, 0.25);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.65);
}

.role-row:hover {
  border-color: var(--or-forge);
  transform: translateY(-4px) scale(1.018);
  box-shadow: 
    0 22px 44px rgba(0, 0, 0, 0.8), 
    0 0 22px rgba(255, 174, 51, 0.35),
    inset 0 1px 0 rgba(255, 240, 215, 0.4);
}

.role-row:active {
  transform: scale(0.97);
}

.rr-media {
  position: relative;
  width: 100%;
  padding-top: 130%;
  overflow: hidden;
  background: #08040E;
  border-bottom: 2px solid #6E4926;
}

.rr-media video,
.rr-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-row:hover .rr-media video,
.role-row:hover .rr-media img {
  transform: scale(1.06);
}

.rr-media img.rr-photo {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.rr-media.ended video {
  opacity: 0;
}
.rr-media.ended img.rr-photo {
  opacity: 1;
}

.rr-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(14, 8, 24, 0.96) 0%, rgba(14, 8, 24, 0.25) 38%, transparent 70%);
}

.role-row .meta {
  padding: 10px 12px 2px;
  min-width: 0;
  z-index: 3;
  text-align: center;
}

.role-row .meta b {
  font-family: var(--ff-display);
  font-size: clamp(1rem, 2.8vw, 1.22rem);
  display: block;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #FFF3D6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.role-row .meta span {
  font-size: clamp(0.68rem, 1.8vw, 0.78rem);
  color: var(--lune);
  opacity: 0.84;
  display: block;
  margin-top: 3px;
  line-height: 1.3;
}

.mini-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 8px 10px 10px;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(6, 3, 12, 0.75);
  box-shadow: inset 0 0 0 1.5px rgba(138, 102, 45, 0.6), 0 3px 8px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.mini-step button {
  width: clamp(34px, 8vw, 42px);
  height: clamp(34px, 8vw, 42px);
  border-radius: 9px;
  background: linear-gradient(145deg, #4A2B18, #21120A);
  flex: none;
  box-shadow: inset 0 0 0 1.5px #8A662D, 0 3px 8px rgba(0, 0, 0, 0.5);
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--lune);
  transition: transform 0.12s ease, background 0.14s, border-color 0.14s;
  border: 1px solid #C4793B;
}

.mini-step button:active {
  transform: scale(0.86);
  background: linear-gradient(145deg, #FFAE33, #C4793B);
  color: #140E22;
}

.mini-step .val {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 3.2vw, 1.5rem);
  line-height: 1;
  min-width: 1.4ch;
  text-align: center;
  color: var(--braise);
  text-shadow: 0 2px 10px rgba(255, 174, 51, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#scr-compo .mode-switch {
  margin: 6px 0 4px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(230, 194, 128, 0.35);
  max-width: 440px;
  width: 100%;
}
#scr-compo .mode-hint {
  margin: 0 0 8px;
  font-size: clamp(0.72rem, 1.6vw, 0.8rem);
  max-width: 440px;
}
.compo-options {
  flex: none;
  width: 100%;
  max-width: 580px;
  margin: 8px auto 0;
}
#scr-compo .balance {
  padding: 10px 16px;
  font-size: 0.82rem;
  margin: 4px 0 10px;
  text-align: center;
  border-radius: 14px;
}

/* ============ TOGGLES CLASSY DARK FANTASY ============ */
.chaos-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  margin: 6px 0;
  cursor: pointer;
  background: linear-gradient(165deg, rgba(45, 26, 66, 0.4), rgba(16, 10, 26, 0.6));
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.28), 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.chaos-toggle:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.45), 0 8px 20px rgba(0, 0, 0, 0.45);
}
.chaos-toggle.on {
  background: linear-gradient(165deg, rgba(62, 34, 94, 0.6), rgba(28, 16, 46, 0.8));
  box-shadow: inset 0 0 0 1.5px var(--braise), 0 0 16px rgba(255, 174, 51, 0.25);
}
.ct-txt { display: flex; flex-direction: column; text-align: left; min-width: 0; flex: 1; }
.ct-txt b { font-family: var(--ff-display); font-size: 1.04rem; line-height: 1.12; color: #FFF3D6; display: flex; align-items: center; gap: 8px; }
.ct-txt small { font-size: 0.75rem; opacity: 0.78; line-height: 1.25; margin-top: 3px; }

.checkbox-wrapper { position: relative; display: block; flex: none; }
.checkbox-wrapper input[type="checkbox"] { visibility: hidden; display: none; }
.checkbox-wrapper .label { cursor: pointer; display: block; }
.checkbox-wrapper .label svg { vertical-align: middle; color: var(--lune); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.checkbox-wrapper .path1 { stroke-dasharray: 400; stroke-dashoffset: 400; transition: 0.5s stroke-dashoffset; opacity: 0; }
.checkbox-wrapper .check:checked + label svg g path { stroke-dashoffset: 0; opacity: 1; stroke: var(--braise); }
.checkbox-wrapper .check:checked + label svg rect { stroke: var(--braise); }

@media (min-width: 760px) {
  .role-rows {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }
  .rr-media {
    padding-top: 115%;
  }
  .role-row .meta span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ============ RÉVÉLATION DU RÔLE (CENTRAL & INTEGRATED) ============ */
#scr-reveal {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.reveal-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.reveal-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 2px solid var(--or-cadre);
  background: linear-gradient(165deg, #241638, #0E0818 80%);
  box-shadow: 
    0 18px 42px rgba(0, 0, 0, 0.75), 
    0 0 0 1px rgba(230, 194, 128, 0.3) inset, 
    0 0 80px rgba(255, 174, 51, 0.12);
}

.reveal-media {
  position: relative;
  width: 100%;
  padding-top: 78%;
  overflow: hidden;
  background: #08040E;
  border-bottom: 2px solid #6E4926;
}

.reveal-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.reveal-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 800;
  background: rgba(6, 3, 14, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.35);
}

.reveal-body {
  padding: 18px 20px 20px;
  text-align: left;
}

.reveal-name {
  font-family: var(--ff-display);
  font-weight: 800;
  line-height: 0.92;
  margin: 0 0 0.2em;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  color: #FFF3D6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.reveal-power {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--braise);
  margin: 0 0 10px;
}

.reveal-desc {
  font-size: 0.9rem;
  line-height: 1.48;
  color: var(--lune);
  opacity: 0.9;
  margin: 0;
  max-width: 46ch;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, #211438 0 16px, #140B24 16px 32px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-radius: inherit;
}

.veil.hidden {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.veil .veil-mark {
  width: 60px;
  height: 3px;
  background: var(--or-forge);
  opacity: 0.6;
  margin: 0 auto 16px;
  border-radius: 2px;
}

.veil .vtxt {
  font-family: var(--ff-display);
  font-size: 0.96rem;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin: 0;
  max-width: 22ch;
  text-align: center;
  color: #FFF3D6;
}

.veil .vtxt2 {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 8px;
  text-align: center;
  color: var(--argile);
}

.reveal-actions-inline {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.reveal-actions-inline .btn-row {
  display: flex;
  gap: 10px;
}

.reveal-actions-inline .btn-row .btn {
  padding: 0.7em 0.9em;
  font-size: 0.82rem;
  min-height: 44px;
}

/* ============ FICHE JOUEUR (BESPOKE AAA PROFILE CARD) ============ */
.profile-hero-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 22px 20px;
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(38, 22, 58, 0.94) 0%, rgba(12, 7, 22, 0.98) 100%);
  border: 2px solid var(--or-cadre);
  box-shadow: 
    0 24px 55px rgba(0, 0, 0, 0.85), 
    0 0 35px rgba(255, 174, 51, 0.18),
    inset 0 1px 0 rgba(255, 240, 215, 0.3);
  backdrop-filter: blur(14px);
  text-align: center;
}

.ph-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--argile);
  margin-bottom: -4px;
}

.ph-title {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  color: #FFF3D6;
  margin: 0;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.ph-avatar-wrap {
  position: relative;
  margin: 4px 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ph-avatar-wrap:hover {
  transform: scale(1.04);
}

.ph-avatar-wrap .avatar-slot {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: linear-gradient(145deg, #2D1A42, #120A1E);
  border: 3px solid var(--or-forge);
  box-shadow: 
    0 0 25px rgba(255, 174, 51, 0.35), 
    inset 0 0 15px rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
}

.ph-avatar-wrap .avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph-avatar-wrap .avatar-slot .plus {
  font-size: 2.2rem;
  color: var(--or-forge);
  opacity: 0.8;
  font-weight: 300;
}

.ph-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FFAE33, #C4793B);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  border: 2px solid #140A22;
}

.ph-photo-btn {
  padding: 0.65em 1.2em;
  font-size: 0.82rem;
  min-height: 42px;
  border-radius: 14px;
  width: auto;
}

.ph-input-wrap {
  width: 100%;
  margin-top: 2px;
}

.ph-input-wrap input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(10, 6, 18, 0.85);
  border: 1.5px solid rgba(230, 194, 128, 0.35);
  color: #FFF3D6;
  font-family: var(--ff-display);
  font-size: 1.12rem;
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ph-input-wrap input:focus {
  outline: none;
  border-color: var(--braise);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 174, 51, 0.35);
}

.ph-cta {
  width: 100%;
  margin-top: 4px;
  padding: 0.9em 1.4em;
  font-size: 1rem;
}

.ph-privacy {
  font-size: 0.72rem;
  color: var(--argile);
  opacity: 0.8;
  margin-top: 2px;
}

/* ============ NARRATEUR EN JEU (CARD CENTRALE HERO) ============ */
#scr-narr {
  justify-content: center;
  align-items: center;
}

.narr-body.center-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px var(--pad);
}

.narr-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100dvh - 28px);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(34, 20, 52, 0.95) 0%, rgba(12, 7, 20, 0.98) 100%);
  border: 2px solid var(--or-cadre);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.85), 
    0 0 30px rgba(255, 174, 51, 0.18),
    inset 0 1px 0 rgba(255, 240, 215, 0.25);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

/* TOPBAR INTÉGRÉE AVEC GLOBO-PULSATION EN CONTINU */
.topbar-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 1.5px solid rgba(230, 194, 128, 0.25);
  flex: none;
}

@keyframes pulseBadgeGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 174, 51, 0.3), inset 0 0 0 1.5px rgba(230, 194, 128, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 174, 51, 0.8), inset 0 0 0 1.5px rgba(255, 174, 51, 0.9);
    transform: scale(1.03);
  }
}

.phase-chip.pulse-glow {
  animation: pulseBadgeGlow 2.8s ease-in-out infinite;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(14, 9, 24, 0.85);
  border: 1.5px solid rgba(230, 194, 128, 0.35);
  color: var(--lune);
}

.phase-chip.chip-btn {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s;
}

.phase-chip.chip-btn:hover {
  background: rgba(45, 26, 66, 0.9);
}

.phase-chip.chip-btn:active {
  transform: scale(0.94);
}

#narrContent {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 194, 128, 0.35) transparent;
}

#narrContent::-webkit-scrollbar {
  width: 4px;
}
#narrContent::-webkit-scrollbar-thumb {
  background: rgba(230, 194, 128, 0.35);
  border-radius: 999px;
}

#narrContent .script {
  font-family: var(--ff-display);
  font-size: clamp(1.02rem, 2.5vw, 1.2rem);
  line-height: 1.4;
  color: #FFF3D6;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#narrContent .hint {
  font-size: clamp(0.76rem, 1.8vw, 0.84rem);
  color: var(--argile);
  opacity: 0.92;
  margin: 0;
  line-height: 1.35;
}

.narr-actions-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  flex: none;
}

/* ============ CARTES JOUEURS EN JEU (DARK FANTASY MYSTÉRIEUSES) ============ */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 10px;
  max-height: 230px;
  overflow-y: auto;
  padding: 6px 4px 8px;
  margin: 4px 0;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 194, 128, 0.4) transparent;
}

.pgrid::-webkit-scrollbar {
  width: 4px;
}
.pgrid::-webkit-scrollbar-thumb {
  background: rgba(230, 194, 128, 0.4);
  border-radius: 999px;
}

.ptile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(165deg, #281742 0%, #10081C 75%, #08040E 100%);
  border: 1.8px solid var(--or-cadre);
  box-shadow: 
    0 8px 22px rgba(0, 0, 0, 0.7), 
    0 0 0 1px rgba(230, 194, 128, 0.2) inset,
    inset 0 1px 0 rgba(255, 240, 215, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: tilePopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes tilePopIn {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.ptile-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  overflow: hidden;
  background: linear-gradient(165deg, #241438, #0E0716);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ptile-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  z-index: 1;
}

.ptile .pimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.ptile .pinit {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3A2254, #180D28);
  border: 2px solid var(--or-forge);
  box-shadow: 0 0 20px rgba(255, 174, 51, 0.35), inset 0 0 10px rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 2rem;
  color: #FFF3D6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  margin-bottom: 12px;
}

.ptile .role-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  z-index: 0;
  pointer-events: none;
}

.ptile .photo-ov {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  z-index: 1;
  pointer-events: none;
}

.ptile-glow-ov {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 4, 14, 0.15) 0%, transparent 35%, rgba(8, 4, 14, 0.92) 100%);
  z-index: 2;
}

.ptile .roleflag {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--or-forge);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}
.ptile .roleflag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptile .pname {
  position: absolute;
  bottom: 6px;
  left: 5px;
  right: 5px;
  z-index: 4;
  padding: 5px 6px;
  border-radius: 10px;
  background: rgba(10, 6, 18, 0.92);
  border: 1px solid rgba(230, 194, 128, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 240, 215, 0.2);
  backdrop-filter: blur(6px);
  text-align: center;
}

.ptile .pname-txt {
  font-family: var(--ff-display);
  font-size: clamp(0.78rem, 2.2vw, 0.88rem);
  font-weight: 800;
  color: #FFF3D6;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  line-height: 1.1;
}

.ptile:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--or-forge);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 16px rgba(230, 194, 128, 0.3);
}

.ptile:active {
  transform: scale(0.96);
}

/* ÉTAT SÉLECTIONNÉ : AMBRE SACRÉ (Sorcière / Vote / Actions Neutres) */
.ptile.sel {
  border-color: #FFAE33;
  box-shadow: 
    0 0 26px rgba(255, 174, 51, 0.85), 
    0 0 0 2px rgba(255, 174, 51, 0.4),
    inset 0 0 12px rgba(255, 174, 51, 0.4);
  transform: scale(1.04);
}

.ptile.sel::before {
  content: "✨";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FFAE33, #C4793B);
  color: #140A22;
  font-size: 0.76rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 174, 51, 0.8);
  z-index: 6;
  animation: selBadgePulse 1.8s ease-in-out infinite;
}

/* ÉTAT CIBLÉ POUR ÉLIMINATION : SANG / ATTAQUE DE LA MEUTE (`.sel-danger`) */
.ptile.sel-danger {
  border-color: #FF3B3B;
  box-shadow: 
    0 0 28px rgba(220, 38, 38, 0.9), 
    0 0 0 2px rgba(220, 38, 38, 0.5),
    inset 0 0 14px rgba(220, 38, 38, 0.5);
  transform: scale(1.04);
  animation: dangerPulse 1.6s ease-in-out infinite;
}

.ptile.sel-danger::before {
  content: "🐺";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(145deg, #E62E3B, #8C1C24);
  color: #fff;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8), 0 0 12px rgba(220, 38, 38, 0.9);
  z-index: 6;
  animation: wolfBadgePulse 1.4s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(220, 38, 38, 0.8), inset 0 0 12px rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 36px rgba(255, 59, 59, 1), inset 0 0 18px rgba(255, 59, 59, 0.6); }
}

@keyframes wolfBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes selBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.ptile.dead {
  filter: grayscale(1) brightness(0.42);
}

.ptile.dead::after {
  content: "✝";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: rgba(245, 232, 208, 0.6);
  text-shadow: 0 3px 10px #000;
}

.ptile .votes {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sang);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}

.ptile .roleflag {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), inset 0 0 0 1.5px rgba(245, 232, 208, 0.45);
}

/* Écran Accueil & Vidéo */
#scr-accueil {
  position: relative;
  overflow: hidden;
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
}

.acc-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #0A0612;
}

.acc-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 6, 18, 0.72) 0%, rgba(10, 6, 18, 0.15) 26%, rgba(10, 6, 18, 0.2) 55%, rgba(10, 6, 18, 0.85) 100%),
              radial-gradient(120% 60% at 50% 40%, rgba(10, 6, 18, 0) 40%, rgba(10, 6, 18, 0.38) 100%);
}

.acc-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(10px, 2vh, 18px);
  padding: calc(env(safe-area-inset-top) + 22px) 20px calc(env(safe-area-inset-bottom) + 20px);
}

.acc-content .moon {
  width: clamp(108px, 22vh, 160px);
  height: auto;
  margin: 0;
  filter: drop-shadow(0 0 55px rgba(255, 174, 51, 0.65));
  animation: moonGlow 4.5s ease-in-out infinite, moonFloat 6s ease-in-out infinite;
}

@keyframes moonGlow {
  0%, 100% { filter: drop-shadow(0 0 50px rgba(255, 174, 51, 0.6)); }
  50% { filter: drop-shadow(0 0 85px rgba(255, 210, 117, 0.9)); }
}
@keyframes moonFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.wolfou-title {
  white-space: nowrap;
  font-size: clamp(2.8rem, 14.5vw, 4.6rem);
  line-height: 0.86;
  margin: 0;
  letter-spacing: -0.01em;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 174, 51, 0.4), 0 2px 20px rgba(0, 0, 0, 0.8);
}

.acc-card {
  width: 100%;
  max-width: 400px;
  padding: 18px 20px 16px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(170deg, rgba(14, 9, 24, 0.82), rgba(14, 9, 24, 0.62));
  backdrop-filter: blur(6px);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 6px 0 4px;
}

.step-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(245, 232, 208, 0.12), rgba(245, 232, 208, 0.04));
  box-shadow: inset 0 0 0 2px rgba(230, 194, 128, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
  font-size: 2rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 0;
  padding-bottom: 5px;
  color: var(--lune);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.step-btn:active {
  transform: scale(0.88);
  box-shadow: inset 0 0 0 2px var(--braise), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.step-btn[disabled] {
  opacity: 0.28;
  pointer-events: none;
}

.count {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 15vw, 4.6rem);
  line-height: 0.8;
  min-width: 2ch;
  color: var(--braise);
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 25px rgba(255, 174, 51, 0.4);
  text-align: center;
}

.count-label {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.72;
  margin: 0;
}


.acc-cta {
  width: 100%;
  max-width: 400px;
  margin-top: 4px;
}

.acc-help {
  margin-top: 2px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lune);
  background: rgba(243, 231, 208, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(243, 231, 208, 0.24), 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s;
}
.acc-help:active {
  transform: scale(0.94);
}

/* Modales & Panneaux */
.sound-toggle {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 70;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(165deg, #221636, #0D0816 70%);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(201, 138, 91, 0.55);
  display: grid;
  place-items: center;
}
.sound-toggle:active {
  transform: translate(1px, 1px);
}

.sound-panel {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  right: 12px;
  z-index: 71;
  width: min(260px, calc(100vw - 24px));
  padding: 14px 16px;
  display: none;
  background: linear-gradient(165deg, #221636, #0D0816 70%);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(201, 138, 91, 0.4);
}
.sound-panel.on {
  display: block;
  animation: screenIn 0.2s ease both;
}
.sound-panel label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lune);
}
.sound-panel output { color: var(--braise); letter-spacing: 0; }
.sound-panel input { margin: 12px 0 2px; }

.opt-toggle {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 64px;
  z-index: 79;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(165deg, #3A1A20, #1E0D10 70%);
  box-shadow: inset 0 0 0 2px rgba(199, 69, 81, 0.55), 3px 3px 0 rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s linear 0.25s;
}
.opt-toggle.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s linear 0s;
}
.opt-toggle:active {
  transform: translate(1px, 1px) scale(0.96);
}

.opt-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  background: rgba(9, 5, 18, 0.72);
  backdrop-filter: blur(6px);
}
.opt-panel.on {
  display: flex;
  animation: screenIn 0.26s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.opt-panel.confirm {
  align-items: center;
  justify-content: center;
  z-index: 82;
  padding: 20px;
}
.opt-panel.confirm .opt-inner {
  max-width: 330px;
  text-align: center;
  padding: 22px;
}
.opt-inner {
  width: 100%;
  max-width: 370px;
  padding: 18px;
}
.opt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.opt-close {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(243, 231, 208, 0.1);
  box-shadow: inset 0 0 0 1.5px rgba(243, 231, 208, 0.25);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.opt-close:active { transform: scale(0.9); }

.pause-slider {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lune);
  opacity: 0.85;
  margin: 14px 0 4px;
  display: flex;
  justify-content: space-between;
}
.pause-slider output { color: var(--braise); letter-spacing: 0; text-transform: none; font-weight: 700; }

/* Modales Règles */
.rules-panel {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rules-panel.in, .rules-panel.out { display: flex; }
.rp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 5, 18, 0.75);
  backdrop-filter: blur(5px);
}
.rp-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px 22px;
}
.rp-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(243, 231, 208, 0.1);
  box-shadow: inset 0 0 0 1.5px rgba(243, 231, 208, 0.25);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.rp-sec {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 0;
  border-top: 1px solid rgba(243, 231, 208, 0.12);
}
.rp-sec b { font-family: var(--ff-display); font-size: 1.04rem; display: flex; align-items: center; gap: 6px; }
.rp-sec span { font-size: 0.86rem; line-height: 1.45; opacity: 0.8; }

.role-intro {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.role-intro.in, .role-intro.out { display: flex; }
.ri-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 3, 14, 0.82);
  backdrop-filter: blur(4px);
}
.ri-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 24px;
  background: linear-gradient(170deg, #1E1436, #140E22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 0 1.5px rgba(243, 231, 208, 0.14);
  padding: 0 0 26px;
}
.ri-vidwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2.1;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}
.ri-vidwrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
}
.ri-vidwrap .ri-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #1E1436 4%, transparent 55%);
}
.ri-inner { padding: 2px 22px 0; }
.ri-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 8px;
}
.ri-badge.village { background: rgba(233, 160, 59, 0.18); color: var(--braise); }
.ri-badge.loups { background: rgba(163, 47, 56, 0.24); color: #FF9A9A; }
.ri-badge.special { background: rgba(124, 92, 168, 0.3); color: #CBB6F2; }
.ri-title { font-family: var(--ff-display); font-weight: 800; font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 0.9; margin: 0 0 6px; }
.ri-power { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; color: var(--argile); opacity: 0.9; margin-bottom: 14px; }
.ri-body { font-size: 0.93rem; line-height: 1.55; opacity: 0.9; margin-bottom: 8px; }
.ri-warn { font-size: 0.83rem; line-height: 1.45; opacity: 0.78; padding: 10px 14px; border-radius: 14px; background: rgba(243, 231, 208, 0.07); border-left: 3px solid var(--braise); margin-bottom: 18px; }

/* Flash & Toast */
.flash {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}
.flash.go { animation: flashAnim 0.5s ease-out; }
@keyframes flashAnim { 0% { opacity: 0.9; } 100% { opacity: 0; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  z-index: 90;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(20, 14, 34, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px rgba(243, 231, 208, 0.22);
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05ms !important; }
}

/* ============ UTILITAIRES MANQUANTS ============ */
.small { font-size: 0.78rem; opacity: 0.72; line-height: 1.4; }
.sp { height: 12px; }
.center { text-align: center; }
.hidden-input { display: none; }

.lune-txt { color: var(--lune); }
.braise-txt { color: var(--braise); }

.acc-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--argile);
  opacity: 0.85;
}

.tagline {
  font-size: clamp(0.88rem, 2.2vw, 1.04rem);
  max-width: 30ch;
  text-align: center;
  opacity: 0.82;
  line-height: 1.45;
  margin: 0;
}

.pulse {
  animation: pulseAnim 2s ease-in-out infinite;
}
@keyframes pulseAnim {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.45; }
}

/* ============ MODE SWITCH (COMPO) ============ */
.mode-switch {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(14, 9, 24, 0.65);
  box-shadow: inset 0 0 0 2px rgba(180, 150, 230, 0.2);
}
.mode-opt {
  flex: 1;
  padding: 11px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: var(--lune);
  opacity: 0.55;
  background: transparent;
  transition: opacity 0.2s, background 0.2s;
  border: none;
  cursor: pointer;
}
.mode-opt.on {
  opacity: 1;
  background: rgba(124, 92, 168, 0.35);
  box-shadow: inset 0 0 0 1.5px rgba(203, 182, 242, 0.45);
}
.mode-hint {
  font-size: 0.74rem;
  opacity: 0.6;
  line-height: 1.35;
}

/* ============ BALANCE INDICATOR ============ */
.balance {
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}
.balance.ok {
  background: rgba(84, 215, 154, 0.12);
  color: var(--poison);
  box-shadow: inset 0 0 0 1.5px rgba(84, 215, 154, 0.25);
}
.balance.warn {
  background: rgba(233, 160, 59, 0.12);
  color: var(--braise);
  box-shadow: inset 0 0 0 1.5px rgba(233, 160, 59, 0.25);
}
.balance.bad {
  background: rgba(163, 47, 56, 0.15);
  color: #FF9A9A;
  box-shadow: inset 0 0 0 1.5px rgba(163, 47, 56, 0.35);
}

/* ============ NARRATEUR SCRIPT & HINT ============ */
.script {
  font-family: var(--ff-display);
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  line-height: 1.32;
  color: #F5EA9B;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  margin: 4px 0 16px;
}
.script em {
  font-style: normal;
  color: var(--braise);
  text-decoration: underline;
  text-decoration-color: rgba(233, 160, 59, 0.35);
  text-underline-offset: 4px;
}

.hint {
  font-size: 0.84rem;
  line-height: 1.45;
  opacity: 0.72;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(243, 231, 208, 0.06);
  border-left: 3px solid var(--argile);
  margin: 0 0 10px;
  text-align: left;
}

/* ============ TOPBAR NARRATEUR & PACTE ============ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) calc(124px + env(safe-area-inset-right)) 10px 16px;
  background: linear-gradient(180deg, rgba(10, 6, 18, 0.95) 0%, rgba(10, 6, 18, 0.75) 80%, transparent 100%);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.12), rgba(245, 232, 208, 0.04));
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.28), 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  color: var(--lune);
}
.chip-btn {
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.chip-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.5), 0 6px 16px rgba(0, 0, 0, 0.5);
}
.chip-btn:active {
  transform: scale(0.93);
}

.moon-mini {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--braise);
  box-shadow: 0 0 10px rgba(255, 174, 51, 0.7);
  transition: background 0.4s, box-shadow 0.4s;
}
.moon-mini.jour {
  background: #FFF3D6;
  box-shadow: 0 0 14px rgba(255, 243, 214, 0.85);
}

/* ============ NARRATEUR BODY & ACTIONS ============ */
#scr-narr {
  padding-top: calc(64px + var(--pad) + env(safe-area-inset-top));
  padding-bottom: 0;
  gap: 0;
}

.narr-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 14px;
  min-height: 0;
}
.narr-body::-webkit-scrollbar { display: none; width: 0; height: 0; }

.narr-body::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 680px);
  height: min(92vw, 680px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 174, 51, 0.12) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.narr-center {
  position: relative;
  z-index: 1;
  flex: none;
  width: 100%;
  max-width: 580px;
  min-height: min(52vh, 440px);
  margin: auto auto 0;
  padding: clamp(22px, 5.5vw, 34px) clamp(20px, 5.5vw, 28px) clamp(20px, 4.5vw, 26px);
  border-radius: var(--r-clay);
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.09), rgba(10, 6, 18, 0.78));
  box-shadow: 
    0 22px 50px rgba(0, 0, 0, 0.65), 
    inset 0 0 0 1.5px rgba(230, 194, 128, 0.28), 
    inset 0 1px 0 rgba(255, 240, 215, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: screenIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.narr-center::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 174, 51, 0.75), transparent);
}

.narr-center .pgrid,
.narr-center .clay {
  text-align: left;
}

.narr-center .pgrid {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.narr-center .pgrid::-webkit-scrollbar { display: none; width: 0; height: 0; }
.narr-center .pgrid.scrollable {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
}

.narr-actions {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 14px var(--pad) calc(env(safe-area-inset-bottom) + 16px);
}

/* ============ CHRONO RING ============ */
.chrono-ring {
  position: relative;
  width: clamp(185px, 50vw, 265px);
  height: clamp(185px, 50vw, 265px);
  margin: 14px auto;
}
.chrono-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}
.ring-bg {
  fill: none;
  stroke: rgba(245, 232, 208, 0.09);
  stroke-width: 9;
}
.ring-fg {
  fill: none;
  stroke: var(--braise);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke 0.4s, stroke-dashoffset 0.9s linear;
}
.chrono {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  color: var(--lune);
  line-height: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}
.chrono.urgent {
  color: var(--sang);
  text-shadow: 0 0 20px rgba(184, 46, 57, 0.8);
  animation: pulseAnim 0.6s ease-in-out infinite;
}

/* ============ CORPSE CARD ============ */
.corpse {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1.5px solid rgba(184, 46, 57, 0.35);
  background: linear-gradient(165deg, rgba(84, 17, 22, 0.4), rgba(14, 8, 24, 0.7));
}
.person-thumb {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  object-position: 50% 20%;
  flex: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 0 1.5px rgba(245, 232, 208, 0.25);
}
.cinfo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cinfo b {
  font-family: var(--ff-display);
  font-size: 1.12rem;
  line-height: 1.15;
  color: #FFF3D6;
}
.cinfo span {
  font-size: 0.8rem;
  opacity: 0.78;
  line-height: 1.3;
  margin-top: 3px;
}

/* ============ REGISTRE SECRET ============ */
#registre {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(170deg, #1C1130, #0A0612 80%);
}
#registre.on {
  display: flex;
  animation: screenIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 620px;
  margin: 16px 0;
  flex: 1;
  overflow-y: auto;
}

.rcard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(245, 232, 208, 0.08), rgba(10, 6, 18, 0.6));
  box-shadow: inset 0 0 0 1.5px rgba(230, 194, 128, 0.2), 0 6px 16px rgba(0, 0, 0, 0.4);
}
.rcard.loup {
  background: linear-gradient(165deg, rgba(184, 46, 57, 0.25), rgba(10, 6, 18, 0.7));
  box-shadow: inset 0 0 0 1.5px rgba(184, 46, 57, 0.45), 0 6px 16px rgba(184, 46, 57, 0.2);
}
.rcard.mort {
  opacity: 0.45;
  filter: grayscale(0.5);
}
.rcard .face {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
.rcard .rinit {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(245, 232, 208, 0.12);
  display: grid;
  place-items: center;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1.15rem;
  flex: none;
  color: var(--lune);
}
.rcard .rmeta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rcard .rmeta b {
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFF3D6;
}
.rcard .rmeta span {
  font-size: 0.72rem;
  opacity: 0.72;
  line-height: 1.25;
  margin-top: 2px;
}

/* ============ BOUTON MON RÔLE (INFO BUTTON) ============ */
#roleInfoBtn {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(165deg, #2A1742, #0E0818 75%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(230, 194, 128, 0.5);
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.25s;
  border: none;
  cursor: pointer;
  color: var(--lune);
}
#roleInfoBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}
#roleInfoBtn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(230, 194, 128, 0.3), inset 0 0 0 2px var(--or-forge);
}
#roleInfoBtn:active {
  transform: scale(0.88);
}

/* ============ PASSAGE & IDENTITÉ SCREENS ============ */
#scr-passage {
  justify-content: stretch;
  align-items: center;
  text-align: center;
  gap: 0;
}

.pass-num {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(4.8rem, 24vw, 8.5rem);
  line-height: 0.85;
  color: var(--braise);
  text-shadow: 0 8px 0 rgba(0, 0, 0, 0.45), 0 0 70px rgba(255, 174, 51, 0.35);
  margin: 0;
  animation: passNumIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes passNumIn {
  from { opacity: 0; transform: scale(0.6) translateY(24px); }
  to { opacity: 1; transform: none; }
}

.pass-hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vh, 20px);
  padding: 0 18px;
}

.pass-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80vw, 400px);
  height: min(80vw, 400px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 174, 51, 0.26) 0%, rgba(255, 174, 51, 0.08) 42%, transparent 72%);
  pointer-events: none;
  animation: emberPulse 3.8s ease-in-out infinite;
}

.pass-hero > * {
  position: relative;
  z-index: 1;
}

@keyframes emberPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.pass-hero h2 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.95rem, 8vw, 2.8rem);
  animation: fadeIn 0.5s ease both;
}

.pass-actions {
  position: relative;
  flex: none;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0 calc(env(safe-area-inset-bottom) + 18px);
}

.pass-actions::before {
  content: "";
  width: 64px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 174, 51, 0.6), transparent);
}

.pass-progress {
  min-height: 1.2em;
}

#scr-identite {
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#scr-identite::before {
  content: "";
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(80vw, 400px);
  height: min(80vw, 400px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 174, 51, 0.22) 0%, rgba(255, 174, 51, 0.06) 42%, transparent 72%);
  pointer-events: none;
  animation: emberPulse 3.8s ease-in-out infinite;
}

#scr-identite > * {
  position: relative;
  z-index: 1;
}

.ident-card {
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(170deg, rgba(14, 9, 24, 0.82), rgba(14, 9, 24, 0.6));
  backdrop-filter: blur(6px);
}

.ident-card .btn.ghost {
  width: 100%;
}

.avatar-slot {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(245, 232, 208, 0.09);
  box-shadow: inset 0 0 0 3px rgba(230, 194, 128, 0.3), 0 10px 28px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s;
  margin: 0 auto 10px;
}
.avatar-slot:hover {
  transform: scale(1.04);
  box-shadow: inset 0 0 0 3px var(--braise), 0 12px 32px rgba(255, 174, 51, 0.25);
}
.avatar-slot:active {
  transform: scale(0.92);
}
.avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-slot .plus {
  font-size: 2.5rem;
  color: rgba(245, 232, 208, 0.4);
  font-weight: 300;
}

#nameInput {
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--r-btn);
  border: 2px solid rgba(230, 194, 128, 0.28);
  background: rgba(10, 6, 18, 0.7);
  color: var(--lune);
  font-family: var(--ff-body);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#nameInput:focus {
  border-color: var(--braise);
  box-shadow: 0 0 0 4px rgba(255, 174, 51, 0.2);
}

/* ============ FIN DE PARTIE ============ */
#scr-fin {
  align-items: center;
  text-align: center;
  padding-top: calc(64px + var(--pad) + env(safe-area-inset-top));
}
#scr-fin > .eyebrow {
  margin-bottom: 8px;
}

.victory-mark {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  line-height: 1;
  margin: 0 0 8px;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.4);
}

.badges {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.badge {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
}
.badge .bico {
  font-size: 1.6rem;
  flex: none;
  line-height: 1;
}
.badge b {
  display: block;
  font-family: var(--ff-display);
  font-size: 0.96rem;
  line-height: 1.15;
  margin-bottom: 3px;
  color: #FFF3D6;
}
.badge span {
  font-size: 0.8rem;
  opacity: 0.78;
  line-height: 1.35;
}

.chronique {
  width: 100%;
  max-width: 480px;
  text-align: left;
  margin: 6px 0 0;
}
.chronique .line {
  padding: 7px 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  border-left: 2px solid rgba(245, 232, 208, 0.15);
}
.chronique .line.nuit {
  border-left-color: var(--braise);
  margin-top: 10px;
  color: #FFF3D6;
}
.chronique .line.mort {
  color: #FF9A9A;
  border-left-color: var(--sang);
}


/* ============ ANIMATION RULES PANEL ============ */
.rules-panel.in .rp-backdrop {
  animation: fadeIn 0.3s ease both;
}
.rules-panel.in .rp-card {
  animation: slideUp 0.35s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.rules-panel.out .rp-backdrop {
  animation: fadeOut 0.25s ease both;
}
.rules-panel.out .rp-card {
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 1, 1) both;
}

.role-intro.in .ri-backdrop {
  animation: fadeIn 0.3s ease both;
}
.role-intro.in .ri-sheet {
  animation: slideUp 0.35s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.role-intro.out .ri-backdrop {
  animation: fadeOut 0.25s ease both;
}
.role-intro.out .ri-sheet {
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes slideDown {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(40px) scale(0.96); }
}

/* ============ RESPONSIVE LAST FIXES ============ */
.rp-lead {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.45;
  margin-bottom: 10px;
}
.rp-note {
  font-size: 0.78rem;
  opacity: 0.6;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(243, 231, 208, 0.05);
  margin: 8px 0 14px;
  border-left: 3px solid var(--argile);
}
.opt-desc {
  font-size: 0.88rem;
  opacity: 0.76;
  line-height: 1.42;
  margin: 0 0 14px;
}

/* ============ CURSEURS DE VOLUME (style pâte à modeler) ============ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  --val: 75%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--braise) 0%, var(--braise) var(--val), rgba(0, 0, 0, 0.4) var(--val), rgba(0, 0, 0, 0.4) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(201, 138, 91, 0.4), inset 0 2px 5px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1.5px rgba(201, 138, 91, 0.4), inset 0 2px 5px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-progress {
  height: 9px;
  border-radius: 999px 0 0 999px;
  background: var(--braise);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: linear-gradient(155deg, #E9A03B, #B9784B 60%, #9A6039);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 235, 205, 0.5), 0 0 0 3px rgba(9, 5, 18, 0.55);
  transition: transform 0.12s ease;
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.14);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(155deg, #E9A03B, #B9784B 60%, #9A6039);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 235, 205, 0.5), 0 0 0 3px rgba(9, 5, 18, 0.55);
  transition: transform 0.12s ease;
}
input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.14);
}
input[type="range"]:focus-visible {
  outline: 2px solid var(--braise);
  outline-offset: 3px;
}

/* rp-close hover */
.rp-close:active { transform: scale(0.88); }

/* ============ COMPO FOOTER ACTIONS ============ */
.compo-footer .narr-actions {
  margin-top: 12px;
}

/* ============ RESPONSIVE GAME SCREENS ============ */

/* Small phones — tighter spacing, keep content visible */
@media (max-height: 700px) {
  .pass-num {
    font-size: clamp(3.2rem, 18vw, 5.5rem);
  }
  .pass-hero h2 {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }
  .script {
    font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  }
  .narr-center {
    min-height: 0;
  }
  .narr-actions {
    gap: 8px;
    padding: 8px var(--pad) calc(env(safe-area-inset-bottom) + 8px);
  }
  .reveal-media {
    padding-top: 60%;
  }
  #scr-reveal {
    gap: 8px;
  }
  .reveal-body {
    padding: 10px 14px 12px;
  }
  .pgrid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
  }
  .narr-center .pgrid {
    max-height: 30vh;
  }
}

/* Tall phones — more breathing room */
@media (min-height: 750px) {
  .script {
    font-size: clamp(1.35rem, 4.8vw, 1.85rem);
    margin-bottom: 18px;
  }
  .hint {
    padding: 14px 18px;
    margin-bottom: 14px;
  }
}

/* Tablet portrait & wider */
@media (min-width: 760px) {
  .narr-center {
    max-width: 640px;
  }
  .narr-actions {
    max-width: 640px;
  }
  .pass-actions {
    max-width: 480px;
  }
  .reveal-card {
    max-width: 440px;
  }
  .reveal-actions {
    max-width: 440px;
  }
  .pgrid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Large desktop / landscape tablet */
@media (min-width: 1024px) {
  .narr-center {
    max-width: 720px;
  }
  .narr-actions {
    max-width: 720px;
  }
  .script {
    font-size: 1.9rem;
  }
  .pgrid {
    max-width: 760px;
  }
}
