/* ==========================================================================
   Le Suspect — thème "planche de jeu"
   Palette encre/mystère + accents bonbon, typo costaude, cartes façon
   autocollants avec bordures épaisses et ombres décalées.
   ========================================================================== */

:root {
  --bg: #FFE9B8;
  --bg-dot: #F2D998;
  --ink: #241C3D;
  --ink-soft: #6E6489;
  --paper: #FFFDF6;
  --coral: #FF5D5D;
  --coral-dark: #D63E3E;
  --mint: #2FC1A3;
  --mint-dark: #1D9F86;
  --mustard: #FFB627;
  --mustard-dark: #E29A0A;
  --line: #241C3D;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-off: 5px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 2px, transparent 2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
}

h1, h2, h3, .section-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 0;
}

main#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 20px 80px;
}

/* Boutons ------------------------------------------------------------- */

.btn-primary, .btn-secondary {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
  background: var(--mustard);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  font-size: 15px;
  padding: 13px 22px;
  box-shadow: 0 var(--shadow-off) 0 var(--ink);
}
.btn-primary:hover { background: #FFC85A; transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn-primary:disabled {
  background: #E4DCC4;
  color: #9C947F;
  border-color: #C9BFA3;
  box-shadow: 0 var(--shadow-off) 0 #C9BFA3;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink-soft);
  border: 2px solid var(--line);
  font-size: 13px;
  padding: 7px 14px;
  box-shadow: 0 3px 0 var(--ink);
}
.btn-secondary:hover { color: var(--coral-dark); border-color: var(--coral); transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn-secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* Badge coin ------------------------------------------------------------ */

.stamp-corner {
  position: fixed;
  top: 14px;
  right: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  border: 2.5px solid var(--ink);
  padding: 5px 12px;
  border-radius: 999px;
  transform: rotate(3deg);
  background: var(--mint);
  box-shadow: 0 3px 0 var(--ink);
  z-index: 10;
}

/* Bouton copier-coller (code de room) ------------------------------------ */

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  vertical-align: middle;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-copy:hover { transform: translateY(-1px) scale(1.08); background: rgba(36, 28, 61, 0.08); }
.btn-copy:active { transform: translateY(0) scale(0.94); }
.btn-copy.copied { color: var(--mint-dark); }
.stamp-corner .btn-copy.copied { color: var(--paper); }
.btn-copy .icon-check { color: var(--mint-dark); }
.stamp-corner .btn-copy .icon-check { color: var(--paper); }

@keyframes copy-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.btn-copy.copied svg { animation: copy-pop 0.35s ease; }
@media (prefers-reduced-motion: reduce) {
  .btn-copy.copied svg { animation: none; }
}

/* Écrans ------------------------------------------------------------- */

.screen { display: none; }
.screen.active { display: block; animation: pop-in 0.3s cubic-bezier(.2,.9,.3,1.3); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
  .btn-primary:hover, .btn-secondary:hover { transform: none; }
}

/* Carte principale ----------------------------------------------------- */

.case-file {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: 0 8px 0 var(--ink);
  position: relative;
}

.case-file::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 36px;
  width: 64px;
  height: 26px;
  background: var(--coral);
  border: 2.5px solid var(--ink);
  border-radius: 5px;
  transform: rotate(-4deg);
}

.case-file::after {
  content: "";
  position: absolute;
  top: -12px;
  right: 40px;
  width: 44px;
  height: 22px;
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  border-radius: 5px;
  transform: rotate(6deg);
}

.home-card {
  position: relative;
  overflow: visible;
}

.paint-blob {
  position: absolute;
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  opacity: 0.9;
  pointer-events: none;
  animation: blob-float 5s ease-in-out infinite;
}
.paint-blob-1 {
  top: -22px;
  left: -20px;
  width: 62px;
  height: 56px;
  background: var(--mint);
  border: 2.5px solid var(--ink);
  transform: rotate(-8deg);
  animation-delay: 0s;
}
.paint-blob-2 {
  top: -16px;
  right: -18px;
  width: 46px;
  height: 46px;
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  border-radius: 50% 50% 45% 55% / 55% 45% 55% 45%;
  transform: rotate(10deg);
  animation-delay: 0.8s;
}
.paint-blob-3 {
  bottom: -18px;
  right: 20%;
  width: 34px;
  height: 34px;
  background: var(--coral);
  border: 2.5px solid var(--ink);
  transform: rotate(-4deg);
  animation-delay: 1.5s;
}

@keyframes blob-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-8px) rotate(calc(var(--r, 0deg) + 6deg)); }
}

.brand-wrap { position: relative; margin-bottom: 6px; }

.brand-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 4px 0 12px;
  text-shadow: 3px 3px 0 var(--coral);
}

@media (prefers-reduced-motion: reduce) {
  .brand-title { animation: none; }
  .paint-blob { animation: none; }
}

@media (max-width: 640px) {
  .brand-title { font-size: 38px; }
  .paint-blob-1 { width: 44px; height: 40px; }
  .paint-blob-2 { width: 34px; height: 34px; }
  .paint-blob-3 { width: 26px; height: 26px; }
}

.section-title {
  font-size: 27px;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
  max-width: 52ch;
  margin: 0 0 22px;
}

.eyebrow-plain {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
}

/* Onglets --------------------------------------------------------------- */

.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  background: var(--mint);
  box-shadow: 0 3px 0 var(--ink);
}

.tab-panel { display: none; flex-direction: column; gap: 14px; }
.tab-panel.active { display: flex; }

/* Formulaires ------------------------------------------------------------ */

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

input[type="text"], input[type="number"], select {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  padding: 11px 13px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus, button:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 1px;
}

/* On désactive le halo rouge natif du navigateur sur les champs requis/invalides :
   c'est lui, et non notre design, qui produit ce dégradé rouge. */
input, select, textarea {
  box-shadow: none;
}
input:invalid, select:invalid, textarea:invalid,
input:-moz-ui-invalid, select:-moz-ui-invalid {
  box-shadow: none;
  outline: none;
}

.row { display: flex; gap: 16px; }
.row label { flex: 1; }

.error-msg { color: var(--coral-dark); font-weight: 600; font-size: 13px; min-height: 18px; margin-top: 14px; }

/* Liste des joueurs (témoins) -------------------------------------------- */

.witness-list { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.witness-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14px;
  font-weight: 600;
}
.witness-list.compact li { padding: 6px 12px; font-size: 13px; border-width: 2px; }
.witness-list .host-tag {
  color: var(--ink);
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
}
.witness-list .active-turn {
  border-color: var(--mint-dark);
  background: #EAFBF6;
  box-shadow: 3px 3px 0 var(--mint);
}

.drawing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--mint);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.host-crown {
  display: inline-block;
  font-size: 13px;
  margin-right: 3px;
  vertical-align: middle;
  filter: drop-shadow(1px 1px 0 rgba(36,28,61,0.25));
}

.player-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  vertical-align: middle;
  margin-right: 7px;
  flex-shrink: 0;
}

.player-name {
  font-weight: 700;
}
.witness-list li button {
  margin-left: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.witness-list li button:hover { background: var(--coral); color: var(--paper); }
.witness-list li button:disabled { opacity: 0.35; cursor: not-allowed; background: var(--paper); color: var(--ink); }

.host-settings {
  border-top: 3px dashed var(--ink-soft);
  padding-top: 20px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.host-settings h3 {
  font-size: 13px;
  font-weight: 800;
  font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.hint { color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-top: 12px; }

/* Écran de jeu ------------------------------------------------------------ */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.role-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: var(--mint);
  color: var(--ink);
}
.role-badge.is-white { border-color: var(--coral); background: var(--coral); color: var(--paper); }
.round-info { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.timer {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 28px;
  min-width: 54px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 4px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.timer.urgent {
  color: var(--paper);
  background: var(--coral);
  border-color: var(--coral-dark);
  animation: tick 0.6s ease-in-out infinite;
}
@keyframes tick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .timer.urgent { animation: none; }
}

.turn-status { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin: 0 0 14px; min-height: 20px; }

.canvas-wrap {
  border: 3px solid var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 18px;
  box-shadow: 0 6px 0 var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 2px dashed var(--ink-soft);
  border-radius: 8px;
  touch-action: none;
  cursor: crosshair;
}

/* Vote / hypothèse / résultats -------------------------------------------- */

#vote-players li { cursor: default; }
#form-guess { display: flex; gap: 10px; margin-top: 14px; }
#form-guess input { flex: 1; }

@media (max-width: 640px) {
  main#app { padding: 30px 14px 60px; }
  .case-file { padding: 26px 18px; }
  .row { flex-direction: column; }
  .tabs { flex-wrap: wrap; }
}

/* Écran d'ouverture (splash) --------------------------------------------- */

.splash-hero {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--ink);
  background-image: radial-gradient(rgba(255,255,255,0.06) 2px, transparent 2px);
  background-size: 26px 26px;
}

.hero-blob {
  position: absolute;
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  border: 3px solid var(--paper);
  opacity: 0.95;
  pointer-events: none;
  animation: hero-blob-float 6s ease-in-out infinite;
}
.hero-blob-1 { top: 12%; left: 8%; width: 90px; height: 80px; background: var(--mint); transform: rotate(-10deg); animation-delay: 0s; }
.hero-blob-2 { top: 16%; right: 10%; width: 58px; height: 58px; background: var(--mustard); border-radius: 50%; animation-delay: 0.7s; }
.hero-blob-3 { bottom: 18%; left: 10%; width: 50px; height: 50px; background: var(--coral); animation-delay: 1.3s; }
.hero-blob-4 { bottom: 14%; right: 12%; width: 96px; height: 86px; background: #6B4FA0; transform: rotate(8deg); animation-delay: 0.4s; }

@keyframes hero-blob-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--r, 0deg) + 8deg)); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 560px;
  padding: 0 24px;
}

.hero-logo {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 0 auto 26px;
  animation: hero-logo-pop 0.7s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes hero-logo-pop {
  0% { transform: scale(0.55) rotate(-8deg); opacity: 0; }
  65% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.hero-tagline {
  color: var(--paper);
  font-size: 16.5px;
  line-height: 1.6;
  opacity: 0.92;
  max-width: 44ch;
  margin: 0 auto 30px;
}

.hero-btn {
  font-size: 17px;
  padding: 16px 32px;
  box-shadow: 0 6px 0 var(--paper);
}
.hero-btn:hover { box-shadow: 0 8px 0 var(--paper); }
.hero-btn:active { box-shadow: 0 2px 0 var(--paper); }

.hero-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--mustard);
  border-top: 3px solid var(--ink);
  padding: 10px 0;
  z-index: 2;
}
.hero-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 16s linear infinite;
}
.hero-marquee-track span {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  padding-right: 6px;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  .hero-blob { animation: none; }
  .hero-marquee-track { animation: none; }
}

@media (max-width: 640px) {
  .hero-logo { max-width: 190px; }
  .hero-blob-1 { width: 56px; height: 50px; }
  .hero-blob-2 { width: 40px; height: 40px; }
  .hero-blob-3 { width: 34px; height: 34px; }
  .hero-blob-4 { width: 60px; height: 54px; }
  .hero-marquee-track span { font-size: 13px; }
}


/* Bouton musique de fond -------------------------------------------------- */

.fab-btn {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  z-index: 20;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.fab-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.fab-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) {
  }

@media (max-width: 640px) {
  .fab-btn { bottom: 14px; right: 14px; width: 42px; height: 42px; }
}

/* Résultat : victoire / défaite ------------------------------------------ */

.result-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 13px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(.3,.6,.6,1);
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(480px) rotate(var(--rot, 180deg)); opacity: 0; }
}

.case-file.shake-defeat { animation: shake-defeat 0.5s ease; }

@keyframes shake-defeat {
  10%, 90% { transform: translateX(-3px) rotate(-0.3deg); }
  20%, 80% { transform: translateX(5px) rotate(0.3deg); }
  30%, 50%, 70% { transform: translateX(-9px) rotate(-0.4deg); }
  40%, 60% { transform: translateX(9px) rotate(0.4deg); }
  100% { transform: translateX(0) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece { animation: none; display: none; }
  .case-file.shake-defeat { animation: none; }
}

/* Révélation du rôle en début de partie ----------------------------------- */

.role-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(36, 28, 61, 0.93);
  background-image: radial-gradient(rgba(255,255,255,0.06) 2px, transparent 2px);
  background-size: 26px 26px;
  cursor: pointer;
  animation: reveal-fade-in 0.2s ease;
}
.role-reveal-overlay[hidden] { display: none; }

@keyframes reveal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.role-reveal-splash-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 82vw;
  max-height: 82vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-reveal-splash {
  position: absolute;
  inset: 8%;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background: var(--mint);
  border: 3px solid var(--ink);
  transform: scale(0);
}
.role-reveal-splash.is-white { background: var(--coral); }

.role-reveal-splash-wrap.playing .role-reveal-splash {
  animation: splash-expand 0.6s cubic-bezier(.22, 1.5, .4, 1) forwards;
}

@keyframes splash-expand {
  0% { transform: scale(0) rotate(0deg); }
  70% { transform: scale(1.08) rotate(10deg); }
  100% { transform: scale(1) rotate(5deg); }
}

.role-reveal-droplet {
  position: absolute;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid var(--ink);
  opacity: 0;
}
.role-reveal-droplet.is-white { background: var(--coral); }

.role-reveal-droplet-1 { width: 20px; height: 20px; top: 8%;  left: 12%; --tx: -46px; --ty: -34px; }
.role-reveal-droplet-2 { width: 14px; height: 14px; top: 10%; right: 10%; --tx: 42px;  --ty: -38px; }
.role-reveal-droplet-3 { width: 16px; height: 16px; bottom: 10%; left: 8%;  --tx: -40px; --ty: 40px; }
.role-reveal-droplet-4 { width: 12px; height: 12px; bottom: 8%;  right: 12%; --tx: 44px;  --ty: 36px; }
.role-reveal-droplet-5 { width: 10px; height: 10px; top: 46%; left: 2%;   --tx: -54px; --ty: 4px; }
.role-reveal-droplet-6 { width: 11px; height: 11px; top: 44%; right: 0%;  --tx: 52px;  --ty: -6px; }

.role-reveal-splash-wrap.playing .role-reveal-droplet-1 { animation: droplet-fly 0.6s ease-out 0.08s forwards; }
.role-reveal-splash-wrap.playing .role-reveal-droplet-2 { animation: droplet-fly 0.6s ease-out 0.14s forwards; }
.role-reveal-splash-wrap.playing .role-reveal-droplet-3 { animation: droplet-fly 0.6s ease-out 0.2s forwards; }
.role-reveal-splash-wrap.playing .role-reveal-droplet-4 { animation: droplet-fly 0.6s ease-out 0.26s forwards; }
.role-reveal-splash-wrap.playing .role-reveal-droplet-5 { animation: droplet-fly 0.6s ease-out 0.1s forwards; }
.role-reveal-splash-wrap.playing .role-reveal-droplet-6 { animation: droplet-fly 0.6s ease-out 0.18s forwards; }

@keyframes droplet-fly {
  0% { opacity: 0; transform: translate(0, 0) scale(0.3); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1); }
}

.role-reveal-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  text-align: center;
  color: var(--ink);
  opacity: 0;
}
.role-reveal-content.is-white { color: var(--paper); }

.role-reveal-splash-wrap.playing .role-reveal-content {
  animation: content-pop-in 0.4s ease 0.4s forwards;
}

@keyframes content-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.role-reveal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  color: var(--ink);
}
.role-reveal-content.is-white .role-reveal-icon { color: var(--paper); }
.role-reveal-icon svg { width: 100%; height: 100%; }

.role-reveal-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
}

.role-reveal-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  max-width: 30ch;
}

.role-reveal-word {
  position: relative;
  display: inline-block;
  margin-top: 4px;
  padding: 4px 6px;
}

.role-reveal-word-paint {
  position: absolute;
  inset: -8px -16px;
  background: #FFD23F;
  border: 2.5px solid var(--ink);
  border-radius: 38% 62% 58% 42% / 60% 36% 64% 40%;
  transform: rotate(-2.5deg);
  z-index: 0;
}

.role-reveal-word-text {
  position: relative;
  z-index: 1;
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.role-reveal-hint {
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .role-reveal-overlay { animation: none; }
  .role-reveal-splash-wrap.playing .role-reveal-splash { animation: none; transform: scale(1) rotate(5deg); }
  .role-reveal-splash-wrap.playing .role-reveal-droplet-1,
  .role-reveal-splash-wrap.playing .role-reveal-droplet-2,
  .role-reveal-splash-wrap.playing .role-reveal-droplet-3,
  .role-reveal-splash-wrap.playing .role-reveal-droplet-4,
  .role-reveal-splash-wrap.playing .role-reveal-droplet-5,
  .role-reveal-splash-wrap.playing .role-reveal-droplet-6 { animation: none; opacity: 0; }
  .role-reveal-splash-wrap.playing .role-reveal-content { animation: none; opacity: 1; transform: none; }
}

/* Mise en avant du tour de dessin ------------------------------------------ */

.turn-status.your-turn-banner {
  position: relative;
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: #FFD23F;
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 11px 20px;
  margin: 14px 0 20px;
  transform: rotate(-1.5deg);
  animation: hazard-rock 1s ease-in-out infinite;
}

.turn-status.your-turn-banner::before,
.turn-status.your-turn-banner::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  height: 7px;
  background-image: repeating-linear-gradient(135deg, var(--ink) 0 6px, #FFD23F 6px 12px);
  border: 1px solid var(--ink);
}
.turn-status.your-turn-banner::before { top: -9px; }
.turn-status.your-turn-banner::after { bottom: -9px; }

@keyframes hazard-rock {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

.canvas-wrap.your-turn {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 4px rgba(47, 193, 163, 0.3), 0 6px 0 var(--ink);
}

/* Effet oppressant quand le temps presse ----------------------------------- */

.canvas-wrap.time-urgent {
  border-color: var(--coral-dark);
  animation: canvas-urgent-pulse 0.8s ease-in-out infinite;
}

@keyframes canvas-urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 93, 93, 0.45), 0 6px 0 var(--ink); }
  50% { box-shadow: 0 0 0 11px rgba(255, 93, 93, 0.12), 0 6px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .turn-status.your-turn-banner { animation: none; }
  .canvas-wrap.time-urgent { animation: none; box-shadow: 0 0 0 6px rgba(255, 93, 93, 0.35), 0 6px 0 var(--ink); }
}
