/* Direction : une veillee dans une grange. La table est sombre, tout ce qu'on
   lit est du papier vergé jauni imprime a l'encre, les actions fortes sont en
   cire rouge. Aucune carte translucide, aucun degrade de texte. */

:root {
  --night: #121918;
  --night-2: #1a2422;
  --paper: #ecdfc0;
  --paper-2: #e2d3ae;
  --paper-edge: #c9b68a;
  --ink: #1d1611;
  --ink-soft: #4a3f33;
  --wax: #8f2418;
  --wax-dark: #6d1a10;
  --village: #2e5a49;
  --loups: #9a2b1d;
  --solitaire: #a8741c;
  --ambigu: #34466e;
  --display: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --serif: "IM Fell English", Georgia, serif;
  --body: "Alegreya Sans", "Trebuchet MS", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--night);
  background-image:
    radial-gradient(120% 60% at 50% -10%, #23302d 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 9px);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }

.shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.1; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; margin-top: 18px; color: var(--ink-soft); }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- papier */

.sheet-paper {
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 1px 0 var(--paper-edge) inset, 0 10px 24px rgba(0,0,0,.35);
  position: relative;
}
.sheet-paper::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(29,22,17,.35);
  border-radius: 3px;
  pointer-events: none;
}
.sheet-paper > * { position: relative; z-index: 1; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-head > span { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }

/* ---------- boutons : blocs d'encre, la cire pour l'important */

.btn {
  font: 500 1rem var(--body);
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 4px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, opacity .15s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--solitaire); outline-offset: 2px; }
.btn.primary { background: var(--wax); border-color: var(--wax-dark); color: #f6ead0; box-shadow: 0 3px 0 var(--wax-dark); }
.btn.primary:active { box-shadow: 0 1px 0 var(--wax-dark); }
.btn.secondary { background: var(--village); border-color: #1f4033; color: #f1e7cf; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.danger { background: transparent; color: var(--wax); border-color: var(--wax); }
.btn.big { min-height: 54px; font-size: 1.08rem; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
.btn.link { background: none; border: 0; color: var(--paper-edge); text-decoration: underline; text-underline-offset: 4px; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.topbar .btn.ghost { color: var(--paper); border-color: rgba(236,223,192,.45); }

.row { display: flex; gap: 10px; align-items: center; }
.row > .btn { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > .btn { flex: 1 1 160px; }
.stack { display: grid; gap: 10px; }
.center-row { justify-content: center; }

/* ---------- champs */

.field { display: grid; gap: 6px; }
.field span { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.field input {
  font: 500 1.1rem var(--body);
  min-height: 50px;
  padding: 10px 12px;
  background: #f6edd6;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  width: 100%;
}
.field input:focus { outline: 3px solid var(--solitaire); outline-offset: 1px; }
.code-input { font-family: var(--display) !important; letter-spacing: .3em; text-transform: uppercase; font-size: 1.5rem !important; }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink); }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tab {
  background: transparent; color: var(--ink-soft); border: 0; border-radius: 0;
  font-family: var(--display); font-size: 1.12rem; padding: 8px 14px; min-height: 44px; flex: 0 0 auto;
}
.tab.on { color: var(--ink); background: transparent; box-shadow: inset 0 -4px 0 var(--wax); }

/* ---------- bandeaux */

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--solitaire); color: var(--ink); padding: 10px 14px; border-radius: 4px; font-weight: 500;
}
.banner.wait { background: var(--paper-edge); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .65; } }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; max-width: min(520px, calc(100% - 32px));
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  padding: 12px 16px; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 16px); opacity: 0; } }

/* ---------- accueil */

.hero { display: grid; justify-items: center; gap: 10px; padding: 18px 0 4px; text-align: center; }
.hero-cards { position: relative; width: 210px; height: 190px; }
.hero-cards .card { position: absolute; width: 112px; top: 6px; }
.hero-back { left: 22px; transform: rotate(-11deg); }
.hero-front { right: 22px; transform: rotate(9deg); animation: sway 6s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(6deg) translateY(-4px); } }
.title { font-size: clamp(2.6rem, 12vw, 3.6rem); color: var(--paper); }
.lead { font-family: var(--serif); font-style: italic; color: var(--paper-edge); max-width: 34ch; font-size: 1.08rem; }
.resume { grid-template-columns: 1fr; }

.recover summary { cursor: pointer; font-family: var(--serif); font-style: italic; color: var(--ink-soft); padding: 6px 0; }
.recover[open] summary { margin-bottom: 10px; }

.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.name-pick { background: #f6edd6; color: var(--ink); border-color: var(--ink); }
.name-pick.off { border-style: dashed; }

/* ---------- topbar */

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 4px; }
.topbar h1 { font-size: 2.1rem; letter-spacing: .08em; }
.kicker { font-family: var(--serif); font-style: italic; color: var(--paper-edge); }
.topbar-actions { display: flex; gap: 8px; }

/* ---------- cartes */

.card { aspect-ratio: 300 / 420; width: 100%; border-radius: 5.3% / 3.8%; overflow: hidden; box-shadow: 0 8px 18px rgba(0,0,0,.4); background: var(--paper); }
.card svg, .card .card-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card.mini { width: 64px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.card.micro { width: 30px; box-shadow: none; border-radius: 3px; }
.card.large { width: min(260px, 70vw); margin: 0 auto; }

.invite { grid-template-columns: auto 1fr; align-items: center; }
.invite img { border-radius: 4px; border: 2px solid var(--ink); }
.big-code { font-family: var(--display); font-size: 2.4rem; letter-spacing: .14em; line-height: 1.1; margin: 4px 0 8px; }
@media (max-width: 380px) { .invite { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.people { list-style: none; margin: 0; padding: 0; display: grid; }
.people li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 0; border-bottom: 1px dashed rgba(29,22,17,.3); }
.people li:last-child { border-bottom: 0; }
.people .who { font-weight: 500; }
.people .state { margin-left: auto; color: var(--ink-soft); font-size: .92rem; text-align: right; }
.people li.dead .who { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.thumb { border: 0; background: none; padding: 0; cursor: pointer; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; border: 2px solid var(--ink-soft); flex: none; }
.dot.on { background: var(--village); border-color: var(--village); }

.compo { display: grid; gap: 8px; }
.compo-item { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; }
.compo-card { border: 0; padding: 0; background: none; cursor: pointer; }
.compo-info { display: grid; }
.compo-info strong { font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.15; }
.count { font-family: var(--display); font-size: 1.4rem; }
.camp-text { font-family: var(--serif); font-style: italic; }
.camp-text.village, .camp-line.village { color: var(--village); }
.camp-text.loups, .camp-line.loups { color: var(--loups); }
.camp-text.solitaire, .camp-line.solitaire { color: #8a5d12; }
.camp-text.ambigu, .camp-line.ambigu { color: var(--ambigu); }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper b { min-width: 26px; text-align: center; font-family: var(--display); font-size: 1.35rem; }
.btn.step { width: 42px; min-height: 42px; padding: 0; font-size: 1.3rem; background: transparent; color: var(--ink); }

.tally { font-family: var(--serif); font-style: italic; color: var(--wax) !important; }
.tally.ok { color: var(--village) !important; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn.preset { display: grid; gap: 2px; background: #f6edd6; color: var(--ink); padding: 8px; min-height: 58px; }
.btn.preset b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.btn.preset small { color: var(--ink-soft); font-size: .8rem; }
@media (max-width: 380px) { .presets { grid-template-columns: 1fr; } }

.suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suggest-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.suggest-list strong { font-family: var(--display); font-weight: 400; font-size: 1.1rem; display: block; }

.start-zone { display: grid; gap: 8px; text-align: center; }
.start-zone .muted { color: var(--paper-edge); }

.secret summary { cursor: pointer; font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.secret .pin { font-family: var(--display); font-size: 1.3rem; letter-spacing: .12em; }

.welcome h2 { font-size: 1.7rem; }

/* ---------- carte du joueur */

.my-card-zone { display: grid; justify-items: center; gap: 10px; padding: 6px 0; }
.my-card { border: 0; padding: 0; background: none; width: min(250px, 66vw); perspective: 1200px; cursor: pointer; }
.flip-inner { position: relative; aspect-ratio: 300/420; transition: transform .6s cubic-bezier(.3,1.3,.5,1); transform-style: preserve-3d; }
.my-card.flipped .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.front { transform: rotateY(180deg); }
.hint { font-family: var(--serif); font-style: italic; color: var(--paper-edge); }
.role-text h2 { font-size: 1.6rem; }
.camp-line { font-family: var(--serif); font-style: italic; }
.dead-note { background: var(--wax); color: #f6ead0; padding: 12px 14px; border-radius: 4px; font-family: var(--serif); font-style: italic; }
.my-tags { font-family: var(--serif); font-style: italic; color: var(--solitaire); text-align: center; }

/* ---------- ecran du MJ */

.tally-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.tally-strip > div { flex: 1 1 70px; background: var(--night-2); border: 1px solid rgba(201,182,138,.3); border-top: 4px solid var(--paper-edge); padding: 8px 10px; border-radius: 4px; display: grid; }
.tally-strip b { font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.tally-strip span { font-size: .85rem; color: var(--paper-edge); }
.tally-strip .loups { border-top-color: var(--loups); }
.tally-strip .village { border-top-color: var(--village); }
.tally-strip .solitaire { border-top-color: var(--solitaire); }
.tally-strip .ambigu { border-top-color: var(--ambigu); }

.mj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mj-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; border-bottom: 1px dashed rgba(29,22,17,.3); padding-bottom: 6px; }
.mj-list li:last-child { border-bottom: 0; }
.mj-row { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; text-align: left; color: var(--ink); cursor: pointer; min-height: 52px; font: inherit; }
.mj-row .who { display: grid; }
.mj-row strong { font-size: 1.08rem; }
.mj-row small { color: var(--ink-soft); font-size: .86rem; }
.mj-list li.dead strong { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.role-peek {
  display: flex; align-items: center; gap: 8px; min-width: 132px; justify-content: center;
  background: repeating-linear-gradient(45deg, #d8c79f 0 6px, #e2d3ae 6px 12px);
  border: 2px solid var(--ink); border-radius: 4px; padding: 4px 8px; color: var(--ink); cursor: pointer; font: inherit;
}
.role-peek .masked { font-family: var(--serif); font-style: italic; font-size: .9rem; color: var(--ink-soft); }
.role-peek.shown { background: #f6edd6; justify-content: flex-start; }
.role-peek.shown span { font-family: var(--display); font-size: .98rem; text-align: left; line-height: 1.1; }
.role-peek.shown.loups { border-color: var(--loups); box-shadow: inset 4px 0 0 var(--loups); }
.role-peek.shown.village { box-shadow: inset 4px 0 0 var(--village); }
.role-peek.shown.solitaire { box-shadow: inset 4px 0 0 var(--solitaire); }
.role-peek.shown.ambigu { box-shadow: inset 4px 0 0 var(--ambigu); }

.night summary { cursor: pointer; font-family: var(--display); font-size: 1.35rem; list-style-position: inside; }
.night-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.night-steps li { padding-left: 4px; }
.night-steps li::marker { font-family: var(--display); }
.night-steps strong { display: block; font-weight: 500; }

.reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.reveal-item { display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font: inherit; }
.reveal-item .card.mini { width: 84px; }
.reveal-item.dead .card { filter: grayscale(.85) brightness(.85); }

/* ---------- fenetres */

.backdrop { position: fixed; inset: 0; background: rgba(8,12,11,.72); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  width: min(600px, 100%); margin: 0 auto;
  background: var(--paper); color: var(--ink);
  border-radius: 12px 12px 0 0;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.5);
}
.sheet.enter { animation: sheet-up .28s cubic-bezier(.2,.9,.3,1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; background: var(--paper); }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--paper-edge); }
.sheet h2 { margin-bottom: 4px; }

.catalogue { display: grid; gap: 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.cat-item { position: relative; display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit; }
.cat-item .card.mini { width: 100%; }
.cat-name { font-size: .86rem; line-height: 1.15; text-align: center; font-weight: 500; }
.corner { position: absolute; top: -6px; right: -4px; background: var(--wax); color: #f6ead0; font-family: var(--display); font-weight: 400; min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--paper); }
.corner-left { position: absolute; top: -6px; left: -4px; background: var(--solitaire); color: var(--ink); font-style: normal; font-size: .75rem; padding: 2px 6px; border-radius: 3px; }

.role-view { display: grid; gap: 10px; padding-bottom: 8px; }
.role-view h2 { text-align: center; font-size: 1.9rem; margin-top: 8px; }
.role-view .camp-line { text-align: center; }
.role-view .short { font-family: var(--serif); font-style: italic; font-size: 1.12rem; text-align: center; }

.player-sheet { display: grid; gap: 8px; }
.ps-head { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.ps-card { border: 0; padding: 0; background: none; cursor: pointer; }
.ps-card .card.mini { width: 76px; }
.tag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.btn.tag { background: transparent; color: var(--ink); font-size: .92rem; min-height: 42px; }
.btn.tag.on { background: var(--ink); color: var(--paper); }

/* plein ecran Voyante */
.fullscreen {
  position: fixed; inset: 0; z-index: 60; background: #0b0f0e;
  display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px;
  animation: fade .2s ease-out;
}
.fs-card { width: min(78vw, calc((100dvh - 150px) * .714)); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.fs-name { font-family: var(--serif); font-style: italic; color: var(--paper-edge); font-size: 1.1rem; min-height: 1.4em; }
.fs-role { font-family: var(--display); font-size: 2rem; color: var(--paper); }
.fs-hint { color: #6f6a5c; font-size: .85rem; }
@keyframes fade { from { opacity: 0; } }

/* ---------- ouverture de carte (booster) */

#fx:empty { display: none; }
.pack, .vision, .reveal {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(80% 60% at 50% 42%, #1f2a28 0%, #0a0e0d 70%);
  display: grid; place-items: center; overflow: hidden;
  padding: 16px;
}
.pack { grid-template-rows: 1fr auto; }
.pk-rays {
  position: absolute; left: 50%; top: 42%; width: 180vmax; height: 180vmax; transform: translate(-50%, -50%) scale(.2);
  background: repeating-conic-gradient(from 0deg, rgba(233,196,106,.22) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%);
  mask: radial-gradient(circle, #000 0%, transparent 55%);
  opacity: 0; pointer-events: none;
}
.pk-card { position: relative; width: min(64vw, 280px, calc((100dvh - 220px) * .714)); perspective: 1400px; cursor: pointer; z-index: 2; animation: float 3.2s ease-in-out infinite; align-self: center; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-1deg); } }
.pk-flip { position: relative; aspect-ratio: 300/420; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.25,1.5,.45,1); }
.pk-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pk-front { transform: rotateY(180deg); }
.pk-back .card, .pk-front .card { box-shadow: 0 24px 60px rgba(0,0,0,.65); }
.pk-back .seal { transform-origin: 150px 210px; transform-box: view-box; }
.pack:not(.charging) .pk-back .seal { animation: seal-pulse 1.8s ease-in-out infinite; }
@keyframes seal-pulse { 50% { transform: scale(1.06); } }

.pk-prompt {
  position: absolute; bottom: calc(26px + env(safe-area-inset-bottom)); left: 16px; right: 16px; text-align: center;
  font-family: var(--serif); font-style: italic; color: var(--paper-edge); font-size: 1.12rem; z-index: 3;
}

.pack.charging .pk-card { animation: shake 1.25s cubic-bezier(.36,.07,.19,.97) forwards; }
.pack.charging .pk-back .card { box-shadow: 0 0 0 2px rgba(233,196,106,.0), 0 24px 60px rgba(0,0,0,.65); animation: leak 1.25s ease-in forwards; }
.pack.charging .seal { animation: seal-crack 1.25s ease-in forwards; }
@keyframes shake {
  0% { transform: rotate(0); }
  10% { transform: translateX(-2px) rotate(-1deg); }
  20% { transform: translateX(3px) rotate(1deg); }
  30% { transform: translateX(-3px) rotate(-1.5deg); }
  40% { transform: translateX(4px) rotate(2deg) scale(1.01); }
  50% { transform: translateX(-5px) rotate(-2deg) scale(1.02); }
  60% { transform: translateX(6px) rotate(2.5deg) scale(1.03); }
  70% { transform: translateX(-7px) rotate(-3deg) scale(1.04); }
  80% { transform: translateX(8px) rotate(3deg) scale(1.05); }
  90% { transform: translateX(-8px) rotate(-3deg) scale(1.07); }
  100% { transform: translateX(0) rotate(0) scale(1.08); }
}
@keyframes leak { to { box-shadow: 0 0 0 3px rgba(233,196,106,.9), 0 0 60px 12px rgba(233,196,106,.45), 0 24px 60px rgba(0,0,0,.65); } }
@keyframes seal-crack { 60% { transform: scale(1.1) rotate(-4deg); } 100% { transform: scale(1.25) rotate(6deg); filter: brightness(1.6); } }

.pack.burst .pk-card { animation: pop .9s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes pop { 0% { transform: scale(1.08); } 30% { transform: scale(.94); } 100% { transform: scale(1); } }
.pack.burst .pk-flip { transform: rotateY(180deg); }
.pack.burst .pk-back .seal { opacity: 0; transition: opacity .15s; }
.pack.burst .pk-rays { animation: rays-in .9s ease-out forwards, spin 40s linear infinite; }
@keyframes rays-in { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes spin { to { rotate: 360deg; } }
.pack.burst .pk-prompt { opacity: 0; }

.pack::before {
  content: ""; position: absolute; inset: 0; background: #f6ead0; opacity: 0; pointer-events: none; z-index: 4;
}
.pack.burst::before { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

.pk-sparks { position: absolute; left: 50%; top: 42%; width: 0; height: 0; z-index: 3; pointer-events: none; }
.pk-sparks i {
  position: absolute; width: var(--sz); height: var(--sz); background: var(--c); border-radius: 50%;
  animation: fly var(--d) cubic-bezier(.1,.7,.3,1) forwards;
}
.pk-sparks i.scrap { border-radius: 1px; height: calc(var(--sz) * .6); }
@keyframes fly {
  0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 120px)) rotate(var(--rot)); opacity: 0; }
}

.pk-info {
  position: relative; z-index: 3; width: min(520px, 100%);
  background: var(--paper); color: var(--ink); border-radius: 6px; padding: 16px;
  display: grid; gap: 8px; max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(30px); transition: transform .5s cubic-bezier(.2,1.2,.4,1), opacity .4s;
  margin-bottom: env(safe-area-inset-bottom);
}
.pack.done { grid-template-rows: auto 1fr; align-content: start; overflow-y: auto; place-items: start center; }
.pack.done .pk-card { width: min(46vw, 210px); animation: none; margin-top: 8px; transition: width .4s ease; }
.pack.done .pk-info { max-height: none; opacity: 1; transform: none; margin-top: 18px; }
.pack.done .pk-rays { top: 22%; }
.pk-camp { font-family: var(--serif); font-style: italic; color: var(--camp); font-size: 1.05rem; }
.pk-info h2 { font-size: 2rem; }
.pk-short { font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.pk-goal { color: var(--ink-soft); font-size: .95rem; border-top: 1px dashed rgba(29,22,17,.35); padding-top: 8px; }

/* vision (carte envoyee par le MJ) et revelation publique */
.vision, .reveal { grid-template-rows: auto auto auto auto; align-content: center; gap: 16px; text-align: center; }
.v-title, .rv-title { font-family: var(--serif); font-style: italic; color: var(--paper-edge); font-size: 1.2rem; }
.v-card, .rv-card { width: min(62vw, 260px, calc((100dvh - 260px) * .714)); margin: 0 auto; }
.v-card { animation: rise .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes rise { from { transform: translateY(40px) scale(.9); opacity: 0; } }
.v-role, .rv-role { font-family: var(--display); font-size: 1.9rem; color: var(--paper); }
.vision .btn, .reveal .btn { width: min(360px, 100%); margin: 0 auto; }
.rv-card { perspective: 1400px; }
.rv-flip { position: relative; aspect-ratio: 300/420; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.25,1.4,.45,1) .5s; }
.reveal.go .rv-flip { transform: rotateY(180deg); }
.rv-role { opacity: 0; transition: opacity .5s 1.4s; }
.reveal.go .rv-role { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.start-zone .btn.danger { color: #f0b3a4; border-color: #c4523f; }
