:root {
  --bg: #F9FAFB;
  --ink: #09090B;
  --soft: #52525B;
  --faint: #A1A1AA;
  --card: #FFFFFF;
  --card-2: #F4F4F5;
  --line: #E4E4E7;
  --accent: #000000;
  --radius: 24px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Supprimer le ciel éclaté */
.sky { display: none !important; }

/* en-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 640px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px 10px; }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 4px;
  font: 700 24px/1 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.brand svg { width: 24px; height: 24px; fill: var(--ink); }
.duo { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); white-space: nowrap; max-width: 35vw; overflow: hidden; text-overflow: ellipsis; font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; transition: background .3s; }
.dot.on { background: #10B981; }
.vs { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

main { max-width: 640px; margin: 0 auto; padding: 10px 20px 40px; }
.screen { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* typographie */
.eyebrow { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--soft); font-weight: 700; margin: 0 0 12px; }
h1 { font: 400 clamp(36px, 10vw, 52px)/1.05 var(--serif); letter-spacing: -.03em; margin: 20px 0 16px; color: var(--ink); }
h1 em, h2 em { font-style: italic; color: var(--soft); }
h2 { font: 400 clamp(24px, 7vw, 32px)/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 12px; color: var(--ink); }
.lead { color: var(--soft); font-size: 17px; margin: 0 0 32px; font-weight: 400; }
.muted { color: var(--soft); }
.small { font-size: 13.5px; color: var(--faint); }

/* cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.05); }
.card + .card, .stack > * + * { margin-top: 16px; }

/* champs */
label.f { display: block; font-size: 13.5px; color: var(--soft); margin: 0 0 8px; font-weight: 600; }
.input, textarea.input { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; font-size: 16px; outline: none; transition: all .2s; resize: none; color: var(--ink); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.input::placeholder { color: var(--faint); font-weight: 400; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.code-input { text-transform: uppercase; letter-spacing: .4em; text-align: center; font: 700 24px var(--sans); }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; font-weight: 600; font-size: 16px; letter-spacing: .01em;
  transition: all .2s; background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; border: none; box-shadow: 0 8px 20px -8px rgba(0,0,0,0.3); }
.btn.primary:hover { background: #27272A; box-shadow: 0 12px 24px -8px rgba(0,0,0,0.4); transform: translateY(-1px); }
.btn.ghost { background: var(--card-2); border: none; }
.btn.ghost:hover { background: #E4E4E7; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 24px 0; font-weight: 500; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* menu et jeux */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; }
.game { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.game:hover { border-color: var(--faint); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.04); }
.game.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.game .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: var(--card-2); border: none; }
.game b { font: 600 16px/1.2 var(--serif); letter-spacing: -0.01em; color: var(--ink); }
.game span:last-child { color: var(--soft); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 10px 18px; font-size: 14.5px; font-weight: 500;
  transition: all .2s; color: var(--soft); }
.chip:hover { background: var(--card-2); color: var(--ink); }
.chip.sel { background: var(--ink); border-color: var(--ink); color: #fff; }
.sec-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin: 32px 0 12px; }

/* divers */
.gamehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 20px; }
.pill { font-size: 13px; padding: 6px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--soft); font-weight: 500; }
.score { display: flex; gap: 8px; }
.score .pill b { color: var(--ink); margin-left: 4px; }

.question { font: 400 clamp(24px, 6vw, 30px)/1.3 var(--serif); margin: 0; color: var(--ink); }
.pts { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; font-weight: 600; margin-left: auto; }
.pts.p1 { background: #FEF3C7; color: #D97706; }
.pts.p0 { background: var(--card-2); color: var(--soft); }
.comment { margin-top: 10px; font-style: italic; color: var(--soft); font-size: 14.5px; }
.relance { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: 20px;
  background: #F3F4F6; border: 1px solid #E5E7EB; color: var(--ink); }
.relance::before { content: "💬"; font-size: 20px; }

/* portrait & histoire */
.theme-row + .theme-row { margin-top: 16px; }
.portrait { font: 400 18.5px/1.6 var(--serif); color: var(--ink); }
.portrait::first-letter { font-size: 2.6em; float: left; line-height: .9; margin: 6px 10px 0 0; color: var(--ink); font-weight: 300; }
.pairs { display: grid; gap: 0; margin-top: 20px; font-size: 14.5px; border-top: 1px solid var(--line); }
.pairs div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pairs span:first-child { color: var(--soft); }
.pairs span:last-child { text-align: right; font-weight: 500; }

.story-title { font: italic 400 clamp(32px, 8vw, 42px)/1.1 var(--serif); margin: 6px 0 24px; color: var(--ink); }
.chapter { font: 400 18.5px/1.7 var(--serif); color: var(--ink); }
.chapter + .chapter { margin-top: 24px; }
.chapter .num { display: block; font: 700 11.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.chose { margin-top: 12px; font: 600 14px var(--sans); color: var(--soft); }
.chose::before { content: "→ "; }
.options { display: grid; gap: 10px; }
.opt { text-align: left; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
  font-size: 15.5px; transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.02); color: var(--ink); }
.opt:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,0.05); transform: translateY(-1px); }
.opt:active { transform: scale(.99); }
.fin { text-align: center; font: italic 400 28px var(--serif); margin: 32px 0 12px; color: var(--ink); }

/* chargement */
.thinking { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 20px; }
.orb { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(from 0deg, #E4E4E7, #18181B, #E4E4E7);
  animation: spin 2s linear infinite; position: relative; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { transform: rotate(1turn); } }
.thinking p { margin: 0; font: italic 400 22px var(--serif); color: var(--soft); }

.error { padding: 20px; border-radius: 20px; background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0;
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 16px; font-size: 14.5px; font-weight: 500;
  transition: .3s; pointer-events: none; max-width: calc(100% - 40px); box-shadow: 0 20px 40px rgba(0, 0, 0, .2); z-index: 9; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { text-align: center; font-size: 13px; color: var(--faint); padding: 0 20px 32px; font-weight: 500; }
.mt { margin-top: 24px; }
.center { text-align: center; }

/* action ou vérité */
.aov { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aov-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 12px; border-radius: 24px;
  border: 1px solid var(--line); background: #fff; transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.aov-btn:hover { border-color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,0.06); transform: translateY(-2px); }
.aov-btn:active { transform: scale(.97); }
.aov-btn span { font-size: 38px; margin-bottom: 8px; }
.aov-btn b { font: 600 24px var(--serif); color: var(--ink); }
.aov-btn small { color: var(--soft); font-size: 13.5px; font-weight: 500; }
.aov-btn.act { border-color: #FCD34D; background: #FFFBEB; }
.aov-btn.ver { border-color: #C4B5FD; background: #F5F3FF; }
.q-card.q-act { background: #FFFBEB; border-color: #FDE68A; }
.react { justify-content: center; }
.react .chip { font-size: 24px; padding: 12px 18px; border-radius: 20px; }
.reaction { font-size: 34px; margin-top: 10px; animation: rise .5s both; }

/* nouveaux jeux : composants partagés */
.vote-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px;
  border-radius: 24px; border: 1px solid var(--line); background: #fff; font: 600 20px var(--serif); color: var(--ink);
  transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.vote-btn:hover { border-color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,0.06); transform: translateY(-2px); }
.vote-btn:active { transform: scale(.97); }
.vote-btn span { font-size: 32px; }
.vote-btn.agree { border-color: #34D399; background: #ECFDF5; }
.vote-btn.disagree { border-color: #F87171; background: #FEF2F2; }

.agree-badge { text-align: center; font: 700 16px var(--sans); padding: 14px; border-radius: 16px; margin-top: 20px; }
.agree-badge.yes { background: #ECFDF5; color: #059669; border: 1px solid #6EE7B7; }
.agree-badge.no { background: #FEF2F2; color: #DC2626; border: 1px solid #FCA5A5; }

/* dilemme */
.dilemme-row { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.dilemme-btn { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; text-align: left; color: var(--ink);
  font-size: 17px; font-weight: 500; transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.dilemme-btn:hover { border-color: var(--ink); box-shadow: 0 8px 20px rgba(0,0,0,0.06); transform: translateY(-2px); }
.dilemme-btn:active { transform: scale(.97); }
.dilemme-label { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font: 700 17px var(--sans); background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.dilemme-ou { text-align: center; font: 700 13px var(--sans); color: var(--faint); text-transform: uppercase;
  letter-spacing: .15em; }

/* culture flash */
.qcm { display: grid; gap: 12px; }
.qcm-btn { text-align: left; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  font-size: 16.5px; color: var(--ink); font-weight: 500; transition: all .2s; box-shadow: 0 1px 4px rgba(0,0,0,0.02); }
.qcm-btn:hover { border-color: var(--ink); box-shadow: 0 6px 16px rgba(0,0,0,0.06); transform: translateY(-1px); }
.qcm-btn:active { transform: scale(.98); }
.qcm-result { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line); font-size: 16px; font-weight: 500; color: var(--ink); flex-wrap: wrap; }
.qcm-result.correct { border-color: #10B981; background: #ECFDF5; }
.qcm-result.wrong { border-color: #EF4444; background: #FEF2F2; }
.qcm-check { color: #10B981; font-weight: 800; }
.qcm-who { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--card-2); color: var(--soft); margin-left: auto; font-weight: 600; }

/* bouton déconnexion */
.leave-btn { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; padding: 8px 16px; font: 600 13px var(--sans); border-radius: 99px; margin-left: auto; transition: all .2s; }
.leave-btn:hover { background: #FEE2E2; border-color: #FCA5A5; transform: scale(1.05); }
.leave-btn:active { transform: scale(.95); }

/* utilitaires supplémentaires pour rendre ça propre */
.ans { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ans:last-child { border: none; padding-bottom: 0; }
.who-l { font-weight: 600; color: var(--soft); font-size: 14.5px; width: 35%; flex: none; }
.said { font-weight: 500; font-size: 16px; color: var(--ink); }
.reveal { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 10px 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
