/* ===========================================================
   RÉSISTE ! — velours pourpre, cœur battant, tension rouge
   =========================================================== */
body.resiste-jeu .pts, body.resiste-jeu .mise b, body.resiste-jeu .p-texte, body.resiste-jeu .regles-manche p, body.resiste-jeu .ordre-boite p, body.resiste-jeu .anneau-centre b, body.resiste-jeu .f-score { font-variant-numeric: lining-nums tabular-nums; }
body.resiste-jeu {
  --theme: #ff3d77;
  --theme-2: #ff9ab4;
  --rose: #ff4f8b;
  --braise: #ff5a3c;
  --panneau: rgba(26, 8, 18, 0.9);
  --titre: 'Cormorant Garamond', var(--serif);
  background: #12050c;
}
.velours {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 45% at 50% 30%, rgba(255, 61, 119, 0.2), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(120, 20, 60, 0.35), transparent 70%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #22081a, #0b0308);
  transition: background 0.6s;
}
body.infernale .velours {
  background:
    radial-gradient(70% 45% at 50% 30%, rgba(255, 90, 60, 0.32), transparent 70%),
    radial-gradient(80% 50% at 50% 100%, rgba(200, 40, 20, 0.4), transparent 70%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #2a0a0a, #0d0303);
}
.affiche { margin: 0; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--rose); }

/* ---------- Réglages ---------- */
.marque h1 { font-family: var(--titre); font-weight: 700; }
.marque h1 em { color: var(--rose); text-shadow: 0 0 26px rgba(255, 61, 119, 0.55); }
.mini-coeur {
  width: 74px; height: 74px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  font-size: 2.4rem; color: #fff; background: radial-gradient(circle at 35% 30%, #ff7aa3, #c2124d 70%);
  box-shadow: 0 0 0 6px rgba(255, 61, 119, 0.15), 0 10px 34px rgba(255, 61, 119, 0.45);
  animation: battement 1.2s ease-in-out infinite;
}
@keyframes battement { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(0.98); } 45% { transform: scale(1.07); } }

/* ---------- Jeu ---------- */
.ecran.jeu { gap: 10px; }
.tableau-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.joueur {
  --c: var(--p0);
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto auto; column-gap: 8px; row-gap: 3px; align-items: center;
  padding: 6px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.joueur.p1 { --c: var(--p1); }
.joueur .perso { grid-row: 1 / 4; width: 40px; height: 52px; }
.joueur .nom { font-weight: 800; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; grid-column: 2 / 4; grid-row: 1; }
.joueur .role { grid-column: 3; grid-row: 2; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.joueur.tente { border-color: var(--rose); box-shadow: 0 0 18px rgba(255, 61, 119, 0.35); }
.joueur.tente .role { background: var(--rose); color: #fff; }
.joueur .pts { grid-column: 2; grid-row: 2; font-family: var(--titre); font-size: 1.45rem; line-height: 1; color: #fff; }
.joueur .jauge { grid-column: 2 / 4; grid-row: 3; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.joueur .jauge span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c2124d, var(--theme-2)); transition: width 0.6s ease; }

.anneau-zone {
  --d: min(42vw, 170px, 22dvh);
  position: relative; flex: none; display: grid; grid-template-columns: 1fr var(--d) 1fr; align-items: center; gap: 8px;
}
.anneau { position: relative; grid-column: 2; width: var(--d); height: var(--d); border-radius: 50%; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 14px rgba(255, 61, 119, 0.45)); }
.anneau circle { fill: none; stroke-width: 9; }
.anneau .fond { stroke: rgba(255, 255, 255, 0.08); fill: rgba(20, 4, 12, 0.85); }
.anneau .arc { stroke: var(--rose); stroke-linecap: round; transition: stroke-dashoffset 0.12s linear, stroke 0.3s; }
body[data-niveau="2"] .anneau .arc { stroke: #ff7a45; }
body[data-niveau="3"] .anneau .arc { stroke: #ff2e4d; }
.anneau-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anneau-centre b { font-family: var(--titre); font-size: calc(var(--d) * 0.36); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(255, 61, 119, 0.6); }
.anneau-centre small { margin-top: 2px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--theme-2); }
.anneau.bat .anneau-centre b { animation: battement 1s ease-in-out infinite; }
.anneau.urgent svg { filter: drop-shadow(0 0 22px rgba(255, 40, 60, 0.9)); }
.anneau.urgent .anneau-centre b { color: #ff6b7d; animation-duration: 0.45s; }
.anneau.craque { animation: secousse 0.5s; }
@keyframes secousse { 20% { transform: translateX(-6px) rotate(-3deg); } 40% { transform: translateX(6px) rotate(3deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

.mise { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mise small { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mise b { font-family: var(--titre); font-size: 2.1rem; line-height: 1; color: var(--theme-2); text-shadow: 0 0 14px rgba(255, 61, 119, 0.5); }
body.infernale .mise b { color: #ffb36b; }

.panneau-jeu {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center;
  padding: 14px; border-radius: 22px; background: var(--panneau); border: 1px solid rgba(255, 61, 119, 0.25);
  overflow-y: auto;
}
.panneau-jeu.entree { animation: entree 0.3s ease; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panneau-jeu.infernale { border-color: var(--braise); box-shadow: 0 0 30px rgba(255, 90, 60, 0.25); }
.panneau-jeu.tentation.n2 { border-color: rgba(255, 122, 69, 0.55); }
.panneau-jeu.tentation.n3 { border-color: rgba(255, 46, 77, 0.65); box-shadow: 0 0 30px rgba(255, 46, 77, 0.2); }
.panneau-jeu.craque { border-color: #ff2e4d; background: linear-gradient(180deg, rgba(70, 8, 20, 0.94), rgba(26, 8, 18, 0.92)); }
.panneau-jeu.tenu { border-color: #ff9ab4; }
.p-titre { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--theme-2); text-align: center; }
.panneau-jeu.infernale .p-titre { color: #ffb36b; }
.panneau-jeu.craque .p-titre { color: #ff8b97; }
.p-texte { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(1.2rem, 5.4vw, 1.55rem); line-height: 1.25; text-align: center; color: #fff; }
.p-texte:empty { display: none; }
.panneau-jeu.en-cours .p-texte { font-size: clamp(1rem, 4.4vw, 1.25rem); opacity: 0.9; }

.regles-manche { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 61, 119, 0.1); border: 1px dashed rgba(255, 61, 119, 0.5); text-align: center; }
.regles-manche[hidden] { display: none; }
.regles-titre { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose); }
.regles-manche p { margin: 0; font-family: var(--titre); font-style: italic; font-weight: 700; font-size: clamp(1.15rem, 5vw, 1.4rem); line-height: 1.2; color: #ffe3ec; }
.panneau-jeu.en-cours .regles-manche p { font-size: 1.05rem; }
.panneau-jeu.infernale .regles-manche, body.infernale .regles-manche { background: rgba(255, 90, 60, 0.12); border-color: rgba(255, 120, 60, 0.6); }

.p-actions { display: grid; gap: 8px; margin-top: auto; position: sticky; bottom: 0; }
.p-actions.n2 { grid-template-columns: 1fr 1fr; }
.p-actions .btn { margin: 0; flex-direction: column; gap: 2px; line-height: 1.15; }
.p-actions .btn small { font-size: 0.7rem; font-weight: 600; opacity: 0.85; }
.btn.danger { color: #fff; border: 0; background: linear-gradient(180deg, #ff5a6e, #b3122e); box-shadow: 0 6px 0 #6a0a1b, 0 12px 26px rgba(229, 72, 77, 0.35); }
.btn.double-btn { color: #2a0a00; border: 0; background: linear-gradient(180deg, #ffe08a, #ffad3b 55%, #e2591b); box-shadow: 0 6px 0 #7a2c06, 0 12px 26px rgba(255, 150, 60, 0.35); }
.sanction-chrono { width: 100%; }

/* ---------- Fin ---------- */
.fin { justify-content: safe center; overflow-y: auto; gap: 12px; }
.fin h2 { font-family: var(--titre); font-size: clamp(1.6rem, 7.5vw, 2.2rem); color: var(--rose); text-align: center; }
.fin-persos { display: flex; justify-content: center; align-items: flex-end; gap: 22px; --fh: clamp(90px, 16dvh, 130px); }
.fin-perso { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fin-perso .perso { height: calc(var(--fh) * 0.8); width: calc(var(--fh) * 0.8 * 100 / 130); }
.fin-perso.gagnant .perso { height: var(--fh); width: calc(var(--fh) * 100 / 130); }
.fin-perso.gagnant span::before { content: '👑 '; }
.fin-perso span { font-weight: 800; font-size: 0.85rem; }
.f-score { margin: 0; font-family: var(--titre); font-size: 2.2rem; color: #fff; }
.f-bilan { margin: 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
.ordre-boite { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--rose); }
.ordre-boite span { font-size: 0.72rem; font-weight: 800; color: var(--rose); letter-spacing: 0.1em; text-transform: uppercase; }
.ordre-boite p { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; line-height: 1.3; }
.fin.revele .fin-persos { display: none; }
.fin .actions-fin { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 380px; }
.fin .actions-fin .primary { grid-column: 1 / -1; }
.fin .actions-fin .btn { margin: 0; }

@media (max-height: 700px) {
  .anneau-zone { --d: min(36vw, 130px, 19dvh); }
  .joueur .perso { width: 32px; height: 42px; }
  .p-texte { font-size: clamp(1.05rem, 4.8vw, 1.3rem); }
  .regles-manche p { font-size: 1.05rem; }
}
@media (max-height: 600px) {
  .fin-persos { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mini-coeur, .anneau.bat .anneau-centre b, .anneau.craque, .panneau-jeu.entree { animation: none; }
}
