/*!
 * 6x6 — feuille de style (thème diable & flammes)
 */
:root {
  --night: #0b0405;
  --coal: #1a0709;
  --blood-dark: #4a0a0e;
  --blood: #b3121c;
  --crimson: #d1121b;
  --ember: #ff7a1a;
  --flame: #ffa62b;
  --gold: #ffd23f;
  --ash: #f1e3d6;
  --bone: #ffe3b0;
  --ink: #1b0a08;
  --panel: rgba(20, 4, 6, 0.72);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.6);
  --glow: 0 0 18px rgba(255,122,26,0.45);
  font-size: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ash);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(255,90,20,0.30), transparent 55%),
    linear-gradient(180deg, var(--night), var(--coal) 60%, #2a0a08);
  background-attachment: fixed;
}

/* Flammes qui vacillent en bas de l'écran */
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 150px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60px 110px at 8% 105%, rgba(255,140,30,0.55), transparent 70%),
    radial-gradient(80px 130px at 28% 108%, rgba(255,80,20,0.50), transparent 70%),
    radial-gradient(70px 100px at 50% 105%, rgba(255,170,40,0.45), transparent 70%),
    radial-gradient(90px 140px at 72% 108%, rgba(255,80,20,0.50), transparent 70%),
    radial-gradient(60px 110px at 92% 105%, rgba(255,140,30,0.55), transparent 70%);
  animation: flicker 2.6s ease-in-out infinite alternate;
}
@keyframes flicker {
  0%   { opacity: 0.55; transform: translateY(4px) scaleY(0.95); }
  50%  { opacity: 0.9;  transform: translateY(0) scaleY(1.05); }
  100% { opacity: 0.65; transform: translateY(3px) scaleY(1); }
}

a { color: var(--flame); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Header + menu ---------- */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,0.45);
  border-bottom: 3px solid var(--ember);
  box-shadow: 0 4px 22px rgba(255,90,20,0.25);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; min-width: 0; color: inherit; }
.brand img { width: 46px; height: 40px; display: block; flex: none; filter: drop-shadow(0 0 6px rgba(255,100,20,0.7)); }
.brand__name {
  font-size: 1.5rem; font-weight: 800; letter-spacing: 0.08em;
  color: var(--flame);
  text-shadow: 0 0 10px rgba(255,100,20,0.8);
}
.brand__tagline { display: block; font-size: 0.7rem; opacity: 0.85; white-space: nowrap; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 42px; height: 42px; border-radius: 8px;
  border: 1px solid rgba(255,122,26,0.5);
  background: rgba(255,122,26,0.08);
  cursor: pointer; padding: 0; flex: none;
}
.nav-toggle__bar { display: block; width: 20px; height: 2px; background: var(--flame); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle--active .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--active .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle--active .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav {
  position: absolute; top: 100%; right: 1.2rem; margin-top: 0.6rem;
  display: flex; flex-direction: column; gap: 0.2rem; min-width: 200px;
  background: var(--night); border: 1px solid var(--ember); border-radius: 10px;
  padding: 0.5rem; box-shadow: var(--shadow), var(--glow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 30;
}
.nav--open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav a {
  text-decoration: none; padding: 0.6rem 0.8rem; border-radius: 8px;
  font-weight: 700; font-size: 0.92rem; color: var(--ash);
  border: 1px solid transparent;
}
.nav a:hover { background: rgba(255,122,26,0.12); }
.nav__link--active { border-color: var(--ember); background: rgba(255,122,26,0.2); color: var(--gold); }

main {
  position: relative; z-index: 1;
  flex: 1; width: 100%; max-width: 1000px;
  margin: 0 auto; padding: 1.8rem 1.2rem 5rem;
}

.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 1rem 1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.78rem; color: rgba(241,227,214,0.6);
  border-top: 1px solid rgba(255,122,26,0.25);
  background: rgba(0,0,0,0.35);
}

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 700; border: none; border-radius: 10px;
  padding: 0.8rem 1.5rem; min-height: 44px; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  box-shadow: var(--shadow);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn--primary { background: linear-gradient(135deg, var(--flame), var(--crimson)); color: #fff6e6; text-shadow: 0 1px 2px rgba(0,0,0,0.5); box-shadow: var(--shadow), var(--glow); }
.btn--secondary { background: rgba(255,255,255,0.08); color: var(--ash); border: 1px solid rgba(255,122,26,0.5); }
.btn--ghost { background: transparent; color: var(--ash); border: 1px solid rgba(255,255,255,0.3); box-shadow: none; }

/* ---------- Accueil ---------- */
.hero { text-align: center; padding: 1.5rem 0 1rem; }
.hero__logo { filter: drop-shadow(0 0 16px rgba(255,100,20,0.75)); animation: pulseLogo 3s ease-in-out infinite; }
@keyframes pulseLogo { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.5rem); margin: 0.6rem 0; color: var(--flame); text-shadow: 0 0 18px rgba(255,90,20,0.7); }
.hero p { font-size: 1.02rem; max-width: 580px; margin: 0.6rem auto 1.6rem; opacity: 0.95; line-height: 1.5; }
.hero .actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin-top: 2.5rem; }
.feature-card { background: var(--panel); border: 1px solid rgba(255,122,26,0.35); border-radius: var(--radius); padding: 1.2rem; }
.feature-card h3 { margin-top: 0; color: var(--gold); font-size: 1.05rem; }
.feature-card p { margin-bottom: 0; font-size: 0.92rem; opacity: 0.92; line-height: 1.45; }

/* ---------- Dés ---------- */
.dice-row { display: flex; gap: 1rem; justify-content: center; min-height: 76px; flex-wrap: wrap; perspective: 700px; }

.die {
  position: relative; width: 66px; height: 66px; border-radius: 12px;
  background: linear-gradient(145deg, #e02a2a, #7d0a10);
  border: 2px solid #3b0508;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 0 8px rgba(255,255,255,0.15);
  padding: 0; cursor: default; display: grid; place-items: center;
  transform-style: preserve-3d;
}
button.die { cursor: pointer; }
button.die:hover { border-color: var(--gold); transform: translateY(-2px); }

.die--held {
  border-color: var(--gold);
  transform: translateY(-7px) scale(1.08);
  box-shadow: 0 0 0 4px rgba(255,166,43,0.85), 0 10px 18px rgba(0,0,0,0.6);
  animation: heldPulse 1.6s ease-in-out infinite;
}
button.die--held:hover { transform: translateY(-7px) scale(1.1); }
@keyframes heldPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,166,43,0.85), 0 10px 18px rgba(0,0,0,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(255,166,43,0.4), 0 10px 18px rgba(0,0,0,0.6); }
}
.die__held-pin {
  position: absolute; top: -10px; right: -9px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--flame); color: #2a0a00; font-size: 0.68rem; font-weight: 900;
  display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.die--rolling { box-shadow: 0 6px 14px rgba(0,0,0,0.6); }
.die--settle { animation: dieSettle 0.28s ease; }
@keyframes dieSettle {
  0% { transform: scale(1.2) rotate(0deg); }
  55% { transform: scale(0.9) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.die__face { width: 50px; height: 50px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 4px; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: var(--bone); box-shadow: 0 0 4px rgba(255,200,120,0.7); align-self: center; justify-self: center; }
.pip--tl { grid-area: 1 / 1; } .pip--tr { grid-area: 1 / 3; } .pip--ml { grid-area: 2 / 1; }
.pip--mid { grid-area: 2 / 2; } .pip--mr { grid-area: 2 / 3; } .pip--bl { grid-area: 3 / 1; } .pip--br { grid-area: 3 / 3; }

.dice-row--mini { min-height: 0; gap: 0.3rem; perspective: none; justify-content: flex-start; flex: none; }
.dice-row--mini .die { width: 30px; height: 30px; border-radius: 6px; border-width: 1px; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.dice-row--mini .die__face { width: 24px; height: 24px; padding: 2px; }
.dice-row--mini .pip { width: 5px; height: 5px; box-shadow: none; }

/* ---------- Tutoriel ---------- */
.tutorial-shell { background: var(--panel); border: 1px solid rgba(255,122,26,0.35); border-radius: var(--radius); padding: 1.6rem; }
.progress-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 1.4rem; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--crimson), var(--flame)); transition: width 0.25s ease; }
.tutorial-step { display: none; line-height: 1.5; }
.tutorial-step--active { display: block; }
.tutorial-step h2 { color: var(--flame); margin-top: 0; }
.tutorial-step li { margin-bottom: 0.4rem; }
.example-label { margin: 0.9rem 0 0.4rem; font-size: 0.9rem; color: var(--gold); }
.badge-32 { display: inline-block; background: var(--crimson); color: var(--bone); border-radius: 6px; padding: 0.1rem 0.5rem; font-weight: 800; font-size: 0.85rem; }
.tutorial-step .dice-row--mini { justify-content: flex-start; }

.quiz-hands { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin: 1.2rem 0; }
.quiz-hand, .quiz-choice {
  background: rgba(0,0,0,0.35); border: 2px solid transparent; border-radius: var(--radius);
  padding: 1rem; cursor: pointer; text-align: center; min-width: 160px; flex: 1 1 160px; max-width: 260px;
  color: var(--ash); font: inherit;
}
.quiz-choice { font-weight: 800; font-size: 1.1rem; max-width: 180px; }
.quiz-hand .dice-row { justify-content: center; margin-bottom: 0.6rem; }
.quiz-hand p { margin: 0.4rem 0 0; font-weight: 700; }
.quiz-hand:hover, .quiz-choice:hover { border-color: rgba(255,166,43,0.7); }
.quiz-hand--correct, .quiz-choice--correct { border-color: #4caf50 !important; background: rgba(76,175,80,0.18); }
.quiz-hand--wrong, .quiz-choice--wrong { border-color: var(--crimson) !important; background: rgba(209,18,27,0.22); }
.quiz-feedback { min-height: 1.4rem; text-align: center; font-weight: 700; margin-top: 0.6rem; }

.tutorial-nav { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 1.6rem; }
.tutorial-nav .btn { flex: 1 1 auto; }

/* ---------- Jeu : configuration ---------- */
.expression { text-align: center; font-style: italic; color: var(--gold); min-height: 1.4rem; margin: 0 0 1rem; text-shadow: 0 0 10px rgba(255,100,20,0.6); }
.setup-card { background: var(--panel); border: 2px solid var(--ember); box-shadow: var(--glow); border-radius: 16px; padding: 1.6rem; max-width: 620px; margin: 0 auto; }
.setup-card h2 { color: var(--flame); margin-top: 0; }
.setup-note { text-align: center; opacity: 0.88; font-size: 0.9rem; line-height: 1.45; }
.stepper { display: flex; align-items: center; gap: 0.9rem; justify-content: center; margin: 1rem 0 1.4rem; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ember); background: transparent; color: var(--flame); font-size: 1.3rem; cursor: pointer; }
.stepper__count { font-size: 1.6rem; font-weight: 800; color: var(--ash); min-width: 2.4ch; text-align: center; }

.seat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.seat-row { display: flex; gap: 0.5rem; }
.seat-row .seat-name {
  flex: 1; min-width: 0; padding: 0.55rem 0.7rem; border-radius: 8px; border: 1px solid var(--ember);
  background: #2a0d0b; color: var(--bone); font: inherit; font-weight: 700; min-height: 44px;
}
.seat-type-toggle {
  flex: none; padding: 0.5rem 0.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08); color: var(--ash); font: inherit; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; min-height: 44px; white-space: nowrap;
}
.seat-type-toggle--ai { border-color: var(--ember); background: rgba(255,122,26,0.22); color: var(--gold); }

/* ---------- Jeu : table ovale ---------- */
.table-arena { position: relative; width: 100%; max-width: 780px; margin: 1rem auto 2.6rem; aspect-ratio: 16 / 12; }
.felt-oval {
  position: absolute; inset: 19% 12% 15% 12%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 38% 30%, rgba(255,160,60,0.12), transparent 55%),
    radial-gradient(ellipse at center, #5a0f12 0%, #2a0507 100%);
  border: 8px solid var(--ember);
  box-shadow: inset 0 0 34px rgba(0,0,0,0.75), var(--shadow), 0 0 30px rgba(255,90,20,0.45);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.tray { width: 100%; max-width: 400px; text-align: center; }
.tray__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--flame); opacity: 0.9; margin-bottom: 0.5rem; }
.dice-row--six { gap: 0.55rem; max-width: 330px; margin: 0 auto; }
.dice-row--six .die { width: 46px; height: 46px; border-radius: 9px; }
.dice-row--six .die__face { width: 36px; height: 36px; padding: 3px; }
.dice-row--six .pip { width: 7px; height: 7px; }
.dice-row--six { min-height: 56px; }

.hand-label { min-height: 1.4rem; margin-top: 0.9rem; font-weight: 700; color: var(--gold); }
.throws-info { font-size: 0.8rem; opacity: 0.85; margin-top: 0.4rem; color: var(--bone); }
.controls { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.9rem; flex-wrap: wrap; }
.controls .btn { padding: 0.65rem 1rem; font-size: 0.9rem; }
.ai-controls { margin-top: 1.1rem; font-weight: 700; color: var(--flame); font-style: italic; }
.bonus-controls p { margin: 0.8rem 0 0; font-size: 0.88rem; font-weight: 700; color: var(--gold); }

.seats-layer { position: absolute; inset: 2.4rem 0 2rem 0; pointer-events: none; }
.seat {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 92px; text-align: center; opacity: 0.65; filter: grayscale(30%);
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease; z-index: 2;
}
.seat__avatar {
  position: relative; width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  background: var(--seat-color, var(--blood)); border: 3px solid #3b0508;
  display: grid; place-items: center; font-size: 1.7rem; box-shadow: 0 5px 12px rgba(0,0,0,0.6);
}
.seat__ai-tag, .seat__first-loser {
  position: absolute; top: -8px; font-size: 0.85rem; background: var(--night);
  border-radius: 50%; padding: 1px 3px; line-height: 1;
}
.seat__ai-tag { left: -8px; }
.seat__first-loser { right: -8px; }
.seat__name { margin-top: 0.4rem; font-weight: 800; font-size: 0.78rem; color: var(--ash); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat__points { font-size: 0.8rem; font-weight: 800; color: var(--gold); margin-top: 0.1rem; }
.seat__gauge { height: 5px; margin: 0.25rem 10px 0; border-radius: 999px; background: rgba(255,255,255,0.15); overflow: hidden; }
.seat__gauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), var(--flame)); transition: width 0.4s ease; }

.seat__flag {
  position: absolute; top: -1.9rem; left: 50%; transform: translateX(-50%) scale(0.85);
  background: var(--flame); color: #2a0a00; font-weight: 800; font-size: 0.68rem; white-space: nowrap;
  padding: 0.2rem 0.55rem; border-radius: 999px; box-shadow: 0 3px 8px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
}
.seat--flag-below .seat__flag { top: auto; bottom: -1.9rem; }

.seat--active { opacity: 1; filter: none; transform: translate(-50%, -50%) scale(1.2); z-index: 6; }
.seat--active .seat__avatar { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255,122,26,0.6), 0 8px 20px rgba(0,0,0,0.6); animation: seatPulse 1.5s ease-in-out infinite; }
.seat--active .seat__name { color: var(--gold); }
.seat--active .seat__flag { opacity: 1; transform: translateX(-50%) scale(1); }
@keyframes seatPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255,122,26,0.6), 0 8px 20px rgba(0,0,0,0.6); }
  50% { box-shadow: 0 0 0 10px rgba(255,122,26,0.28), 0 8px 20px rgba(0,0,0,0.6); }
}
.seat--eliminated { opacity: 0.3; filter: grayscale(100%); }

/* ---------- Révélation ---------- */
.reveal-table { margin-top: 1.2rem; }
.reveal-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; background: rgba(0,0,0,0.4); border-radius: 10px; padding: 0.6rem 0.9rem; margin-bottom: 0.5rem; border-left: 5px solid var(--ember); }
.reveal-row--loser { border-left-color: var(--crimson); background: rgba(209,18,27,0.25); }
.reveal-row--winner { border-left-color: #4caf50; background: rgba(76,175,80,0.16); }
.reveal-row__name { font-weight: 800; min-width: 120px; }
.reveal-row__hand { flex: 1; text-align: right; }
.reveal-title { text-align: center; color: var(--flame); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 1.4rem 0 0; }

.round-recap { text-align: center; font-size: 0.85rem; line-height: 1.35; }
.round-recap p { margin: 0 0 0.55rem; }
.round-recap__winner { font-weight: 800; font-size: 0.98rem; color: var(--gold); }
.round-recap__loser { color: #ffb9a0; }
#nextControls .btn { width: 100%; }

.tournee-banner { text-align: center; background: linear-gradient(135deg, rgba(255,122,26,0.25), rgba(209,18,27,0.3)); border: 2px dashed var(--ember); border-radius: 14px; padding: 1.2rem; margin: 1.2rem 0; }
.tournee-banner h2 { color: var(--gold); margin: 0.2rem 0; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.78); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 40; }
.modal { background: linear-gradient(160deg, #3b0a0d, var(--night)); border: 3px solid var(--ember); border-radius: 16px; padding: 2rem; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow), var(--glow); }
.modal h2 { color: var(--gold); margin-top: 0; }

/* ---------- Compteur hors ligne ---------- */
.compteur { max-width: 720px; margin: 0 auto; }
.compteur__title { text-align: center; color: var(--flame); margin: 0.2rem 0; text-shadow: 0 0 14px rgba(255,90,20,0.6); }
.compteur__intro { text-align: center; opacity: 0.92; margin: 0.3rem 0 1rem; line-height: 1.45; }
.compteur__bar { display: flex; justify-content: center; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.compteur__bar .stepper { margin: 0.4rem 0; }
.compteur__round { font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; }
.compteur__players { display: grid; gap: 0.7rem; }

.cp { background: var(--panel); border: 1px solid rgba(255,122,26,0.4); border-radius: var(--radius); padding: 0.7rem 0.9rem; }
.cp--out { opacity: 0.45; filter: grayscale(80%); }
.cp__top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.cp__name { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed rgba(255,255,255,0.35); color: var(--bone); font: inherit; font-weight: 700; font-size: 1.05rem; padding: 0.3rem 0; }
.cp__points { display: flex; align-items: baseline; gap: 0.25rem; }
.cp__points strong { font-size: 2rem; color: var(--gold); text-shadow: 0 0 10px rgba(255,100,20,0.6); line-height: 1; }
.cp__points small { opacity: 0.75; }
.cp__gauge { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; margin: 0.5rem 0; }
.cp__gauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), var(--flame)); transition: width 0.4s ease; }
.cp__actions { display: flex; gap: 0.4rem; align-items: center; }
.cp__score { flex: 1; min-width: 0; min-height: 44px; border-radius: 8px; border: 1px solid var(--ember); background: #2a0d0b; color: var(--bone); font: inherit; font-weight: 700; padding: 0.4rem 0.6rem; }
.cp__score::placeholder { color: rgba(255,227,176,0.45); font-weight: 400; }
.cp__adj { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid rgba(209,18,27,0.8); background: rgba(209,18,27,0.25); color: var(--ash); font: inherit; font-weight: 800; cursor: pointer; }
.cp__adj--plus { border-color: rgba(76,175,80,0.8); background: rgba(76,175,80,0.2); }
.cp__adj:disabled { opacity: 0.35; cursor: not-allowed; }

.compteur__cta { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.compteur__message { margin-top: 1rem; background: rgba(0,0,0,0.55); border: 2px solid var(--ember); border-radius: var(--radius); padding: 0.9rem 1rem; white-space: pre-line; line-height: 1.5; }
.compteur__rules { margin-top: 1rem; background: var(--panel); border-radius: var(--radius); padding: 0.6rem 1rem; }
.compteur__rules summary { cursor: pointer; font-weight: 700; }
.compteur__rules li { margin-bottom: 0.3rem; font-size: 0.92rem; line-height: 1.4; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  main { padding: 1.3rem 0.9rem 5rem; }
}
@media (max-width: 620px) {
  .header { padding: 0.8rem 0.9rem; gap: 0.5rem; }
  .brand__tagline { display: none; }
  .hero h1 { font-size: 1.6rem; }
  .table-arena { aspect-ratio: 3 / 6; max-width: 430px; margin-top: 0.6rem; }
  .felt-oval { inset: 14% 8% 19% 8%; border-radius: 50% / 30%; padding: 0.6rem; }
  .tray { padding: 0 0.2rem; }
  .seat { width: 62px; }
  .seat--top { display: flex; flex-direction: column-reverse; }
  .seat--top .seat__name { margin-top: 0; margin-bottom: 0.2rem; }
  .seat--top .seat__points, .seat--top .seat__gauge { margin-top: 0; margin-bottom: 0.1rem; }
  .seat__avatar { width: 40px; height: 40px; font-size: 1.1rem; }
  .seat__name { font-size: 0.62rem; }
  .seat__points { font-size: 0.66rem; }
  .seat__flag { font-size: 0.58rem; padding: 0.15rem 0.4rem; top: -1.5rem; }
  .seat--flag-below .seat__flag { top: auto; bottom: -1.5rem; }
  .dice-row--six { gap: 0.35rem; }
  .dice-row--six .die { width: 38px; height: 38px; }
  .dice-row--six .die__face { width: 30px; height: 30px; padding: 2px; }
  .dice-row--six .pip { width: 6px; height: 6px; }
  .controls { flex-direction: column; }
  .controls .btn { width: 100%; }
  .seat-grid { grid-template-columns: 1fr; }
  .seat-row { flex-wrap: wrap; }
  .seat-row .seat-name { min-width: 140px; }
  .reveal-row { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .reveal-row__hand { text-align: left; }
  .modal { padding: 1.4rem; }
  .tutorial-nav { flex-direction: column; }
  .quiz-hand, .quiz-choice { min-width: 0; width: 100%; max-width: none; }
}
@media (max-width: 380px) {
  .die { width: 54px; height: 54px; }
  .die__face { width: 40px; height: 40px; }
  .dice-row--six .die { width: 34px; height: 34px; }
  .dice-row--six .die__face { width: 26px; height: 26px; }
  .seat { width: 54px; }
  .seat__avatar { width: 34px; height: 34px; font-size: 1rem; }
}

/* Bonus 31 / 32 dans le compteur */
.cp__bonus { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; padding: 0.5rem 0.6rem; border-radius: 8px; background: rgba(255,122,26,0.14); border: 1px dashed var(--ember); }
.cp__bonus label { font-size: 0.82rem; color: var(--gold); line-height: 1.3; }
.cp__bonus input { min-height: 44px; border-radius: 8px; border: 1px solid var(--ember); background: #2a0d0b; color: var(--bone); font: inherit; font-weight: 700; padding: 0.4rem 0.6rem; }

/* Dés gardés : mis de côté sur le bord de la table */
.dice-zone { display: flex; align-items: flex-start; justify-content: center; gap: 0.8rem; }
.dice-zone .dice-row--six { flex: 1; max-width: 330px; margin: 0; align-content: flex-start; }
.kept-rail {
  flex: none; width: 50px; padding: 0.35rem 0.25rem 0.5rem; border-radius: 10px;
  background: rgba(0,0,0,0.38); border: 1px dashed rgba(255,166,43,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.kept-rail--empty { opacity: 0.45; }
.kept-rail__label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--flame); }
.dice-row--rail { flex-direction: column; flex-wrap: nowrap; gap: 0.3rem; min-height: 34px; perspective: none; justify-content: flex-start; }
.dice-row--rail .die { width: 34px; height: 34px; border-radius: 7px; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,166,43,0.55), 0 2px 5px rgba(0,0,0,0.5); }
.dice-row--rail .die__face { width: 26px; height: 26px; padding: 2px; }
.dice-row--rail .pip { width: 5px; height: 5px; box-shadow: none; }
@media (max-width: 620px) {
  .dice-zone { gap: 0.4rem; }
  .kept-rail { width: 44px; }
  .dice-row--rail .die { width: 30px; height: 30px; }
  .dice-row--rail .die__face { width: 22px; height: 22px; }
}

/* Compteur : tour du joueur */
.turn { background: rgba(0,0,0,0.55); border: 2px solid var(--ember); box-shadow: var(--glow); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0.8rem 0 1rem; }
.turn h2 { margin: 0 0 0.4rem; color: var(--gold); font-size: 1.15rem; }
.turn__name { color: var(--flame); }
.turn__q { margin: 0.3rem 0 0.7rem; line-height: 1.4; }
.turn__row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.turn__input { flex: 1 1 120px; min-width: 0; min-height: 52px; border-radius: 10px; border: 2px solid var(--ember); background: #2a0d0b; color: var(--bone); font: inherit; font-size: 1.4rem; font-weight: 800; text-align: center; padding: 0.4rem 0.6rem; }
.turn__row .btn { flex: 1 1 150px; }
.turn__preview { margin: 0.6rem 0 0; font-size: 0.88rem; color: var(--gold); min-height: 1.3em; line-height: 1.4; }
.turn--over { text-align: center; }
.cp--active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,166,43,0.6), var(--glow); }
.cp__tag { background: var(--flame); color: #2a0a00; font-weight: 800; font-size: 0.62rem; padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.cp__actions { justify-content: flex-end; }

@media (max-width: 620px) {
  .dice-row--six { gap: 0.3rem; flex-wrap: nowrap; justify-content: center; }
  .dice-row--six .die { width: 34px; height: 34px; border-radius: 7px; }
  .dice-row--six .die__face { width: 27px; height: 27px; padding: 2px; }
  .dice-row--six .pip { width: 5.5px; height: 5.5px; }
}

/* Boutons : sans soulignement, même largeur */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
a.btn, a.btn:hover, a.btn:visited, a.btn:focus { text-decoration: none; }
.actions, .controls, .compteur__cta, .tutorial-nav { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.actions .btn, .compteur__cta .btn, .tutorial-nav .btn, .turn__row .btn, .controls .btn, #nextControls .btn, .modal .btn {
  flex: 0 1 17rem; width: 17rem; max-width: 100%; min-width: 0;
}
.tray .controls { flex-direction: column; align-items: center; }
.tutorial-nav { flex-direction: row; }
@media (max-width: 560px) { .tutorial-nav { flex-direction: column; align-items: center; } }

/* Le diable qui ricane (élimination d'un joueur) */
.devil-overlay { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; padding: 1rem; background: rgba(8,2,3,0.86); cursor: pointer; animation: devilFade 0.25s ease both; }
.devil-overlay--out { animation: devilFadeOut 0.3s ease forwards; }
.devil-overlay__face { width: min(62vw, 250px); height: auto; filter: drop-shadow(0 0 30px rgba(255,90,20,0.85)); animation: devilPop 0.5s cubic-bezier(.2,1.6,.4,1) both, devilShake 0.16s linear 0.5s infinite alternate; }
.devil-overlay .devil-mouth { transform-box: fill-box; transform-origin: 50% 0%; animation: devilJaw 0.2s ease-in-out infinite alternate; }
.devil-overlay .devil-flames { transform-box: fill-box; transform-origin: 50% 100%; animation: devilFlames 0.5s ease-in-out infinite alternate; }
.devil-overlay .devil-tear { animation: devilTear 0.8s ease-in infinite; }
.devil-overlay .devil-tear--r { animation-delay: 0.3s; }
.devil-overlay__ha { font-family: var(--display, Georgia, serif); font-size: clamp(1.8rem, 9vw, 3rem); color: var(--gold); text-shadow: 0 0 16px rgba(255,100,20,0.9); display: flex; gap: 0.25em; }
.devil-overlay__ha span { display: inline-block; animation: devilHa 0.45s ease-in-out infinite alternate; }
.devil-overlay__ha span:nth-child(2) { animation-delay: 0.08s; }
.devil-overlay__ha span:nth-child(3) { animation-delay: 0.16s; }
.devil-overlay__ha span:nth-child(4) { animation-delay: 0.24s; }
.devil-overlay__ha span:nth-child(5) { animation-delay: 0.32s; color: var(--crimson); }
.devil-overlay__msg { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ash); text-align: center; text-wrap: balance; }
@keyframes devilFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes devilFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes devilPop { 0% { transform: scale(0.2) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes devilShake { from { transform: translate(-3px, 1px) rotate(-3deg); } to { transform: translate(3px, -2px) rotate(3deg); } }
@keyframes devilJaw { from { transform: scaleY(0.55); } to { transform: scaleY(1.08); } }
@keyframes devilFlames { from { transform: scale(0.96); } to { transform: scale(1.06); } }
@keyframes devilTear { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes devilHa { from { transform: translateY(0) scale(1); } to { transform: translateY(-9px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .devil-overlay__face, .devil-overlay .devil-mouth, .devil-overlay .devil-flames, .devil-overlay .devil-tear, .devil-overlay__ha span { animation: none !important; }
}

/* Boutons plus compacts (v1.4.1) : la largeur s'applique à la largeur, jamais à la hauteur */
.btn { padding: 0.55rem 1rem; min-height: 40px; font-size: 0.92rem; }
.actions .btn, .compteur__cta .btn, .tutorial-nav .btn, .turn__row .btn, .controls .btn, #nextControls .btn, .modal .btn {
  flex: 0 0 auto; width: 13rem; max-width: 100%;
}
.controls .btn, #nextControls .btn { font-size: 0.88rem; }
.turn__row { align-items: center; }
.turn__row .turn__input { flex: 1 1 8rem; }
.felt-oval { overflow: hidden; }
.tray .controls { gap: 0.5rem; margin-top: 0.7rem; }
.hand-label { font-size: 1rem; margin-top: 0.6rem; }
.throws-info { font-size: 0.78rem; line-height: 1.35; }
@media (max-width: 620px) {
  /* Sur téléphone : on retire les titres de la table pour garder les dés et les textes lisibles */
  .tray__label { display: none; }
  .expression { font-size: 0.9rem; }
  .throws-info { font-size: 0.74rem; }
  .round-recap { font-size: 0.8rem; }
  .felt-oval { padding: 0.5rem; }
}
@media (max-width: 380px) {
  .kept-rail { width: 38px; padding-inline: 0.15rem; }
  .kept-rail__label { font-size: 0.5rem; }
  .dice-row--rail .die { width: 28px; height: 28px; }
  .dice-row--rail .die__face { width: 20px; height: 20px; }
  .dice-zone { gap: 0.3rem; }
  .dice-row--six { gap: 0.2rem; }
  .dice-row--six .die { width: 30px; height: 30px; }
  .dice-row--six .die__face { width: 24px; height: 24px; }
  .dice-row--six .pip { width: 5px; height: 5px; }
}

/* v1.4.2 : dés gardés sur une ligne au-dessus des dés + somme avant de changer de joueur */
.dice-zone { flex-direction: column; align-items: center; gap: 0.5rem; }
.dice-zone .dice-row--six { flex: none; width: 100%; max-width: 330px; }
.kept-rail {
  width: auto; max-width: 100%; flex-direction: row; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.3rem 0.5rem; min-height: 44px;
}
.dice-row--rail { flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 0.25rem; min-height: 34px; min-width: 0; }
.kept-rail--empty .dice-row--rail { min-width: 0; }
.kept-rail--empty .kept-rail__label::after { content: " (aucun)"; text-transform: none; opacity: 0.7; }
.turn-result { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin-top: 0.5rem; }
.turn-result__label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--flame); }
.turn-result__sum { font-family: "Alfa Slab One", Georgia, serif; font-size: 2.6rem; line-height: 1; color: var(--gold); text-shadow: 0 0 14px rgba(255,122,26,0.7); }
.turn-result__note { font-size: 0.85rem; font-weight: 700; color: var(--bone); text-align: center; }
@media (max-width: 620px) {
  .kept-rail { width: auto; padding: 0.2rem 0.4rem; min-height: 38px; }
  .dice-row--rail .die { width: 28px; height: 28px; }
  .dice-row--rail .die__face { width: 20px; height: 20px; }
  .turn-result__sum { font-size: 2.2rem; }
}
@media (max-width: 380px) {
  .dice-row--rail { gap: 0.15rem; }
  .dice-row--rail .die { width: 25px; height: 25px; }
  .dice-row--rail .die__face { width: 18px; height: 18px; padding: 1px; }
  .dice-row--rail .pip { width: 4px; height: 4px; }
  .kept-rail { gap: 0.25rem; padding: 0.2rem 0.3rem; }
  .kept-rail__label { font-size: 0.45rem; }
}

/* v1.4.5 : CTA sur une seule ligne, sans emoji */
.btn, .actions .btn, .compteur__cta .btn, .tutorial-nav .btn, .turn__row .btn, .controls .btn, #nextControls .btn, .modal .btn {
  white-space: nowrap; width: auto; min-width: 15rem; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.seat-type-toggle { white-space: nowrap; }

/* Politique de confidentialité */
.legal h2 { margin-top: 1.4rem; font-size: 1.1rem; color: var(--gold); }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 1.2rem; }
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.btn, .actions .btn, .compteur__cta .btn, .tutorial-nav .btn, .turn__row .btn, .controls .btn, #nextControls .btn, .modal .btn { min-width: min(15rem, 100%); }
.tray .controls { width: 100%; align-items: center; }
.tray .controls .btn { width: 100%; max-width: 15rem; }
.tray .btn { padding-inline: 0.5rem; font-size: 0.84rem; }

/* SEO : titre accessible non visible + FAQ */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.faq { margin: 2rem auto 1rem; max-width: 760px; }
.faq h2 { color: var(--gold); font-size: 1.3rem; }
.faq h3 { color: var(--flame); font-size: 1rem; margin: 1.1rem 0 0.2rem; }
.faq p { margin: 0; line-height: 1.55; }

/* Lien légal sur sa propre ligne sous le footer */
.footer__legal { margin-top: 0.4rem; }
.footer__legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.faq-page .feature-grid, main > .feature-grid { margin-top: 1rem; }

/* Monétisation : bannière, pub plein écran (démo), fenêtre d'achat */
.ad-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 50px; display: flex; align-items: center; justify-content: center; background: #1a0709; border-top: 1px solid var(--ember); color: var(--bone); font-size: 0.8rem; }
body.has-ad-banner { padding-bottom: 60px; }
.ad-interstitial { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.92); padding: 1rem; }
.ad-interstitial__box { width: min(22rem, 100%); text-align: center; border: 1px dashed var(--flame); border-radius: var(--radius); padding: 1.5rem 1rem; background: var(--coal); }
.ad-interstitial__tag { color: var(--flame); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.6rem; }
.ad-interstitial__body { margin: 0 0 1rem; line-height: 1.45; }
.ad-msg { min-height: 1.2rem; color: var(--gold); font-weight: 700; font-size: 0.85rem; margin: 0.4rem 0; }
.modal .controls { flex-direction: column; align-items: center; }
