:root {
  --night: #1E0B17;
  --plum: #34122A;
  --plum-2: #4A1A3A;
  --ivory: #F8EFE6;
  --rose: #EBC1BC;
  --brass: #C9A45C;
  --ink: #2A1220;
  --muted: #B99AA8;
  --acc: #B3294E;
  --fig-a: #8E1F45;
  --fig-b: #C2913F;
  --fig-line: #E2D0C2;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-pack="resolutions"] { --acc: #1F6B58; --fig-a: #1F6B58; --fig-b: #C2913F; }
[data-pack="potes"] { --acc: #3F3D9A; --fig-a: #3F3D9A; --fig-b: #DE9A2B; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 70% at 50% -10%, var(--plum-2) 0%, transparent 60%),
    radial-gradient(90% 50% at 100% 100%, #3a1026 0%, transparent 70%),
    var(--night);
  background-attachment: fixed;
  color: var(--ivory);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app {
  min-height: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }

/* ---------- Titres ---------- */
.brand {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 14vw, 62px);
  line-height: .95;
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 144;
}
.brand em { font-style: italic; font-weight: 400; color: var(--rose); display: block; }
.edition { color: var(--brass); margin-top: 12px; font-size: 15px; }
.title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -.01em;
}
.lead { color: var(--muted); margin-top: 10px; }

/* ---------- Boutons ---------- */
.btn {
  display: block; width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1.5px rgba(248,239,230,.28); }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 4px; padding: 10px; font-size: 15px; }
.stack { display: grid; gap: 12px; }
.bottom { margin-top: auto; padding-top: 28px; }

/* ---------- Porte d'entrée ---------- */
.gate { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.gate .seal {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--brass);
  font-family: var(--display); font-size: 26px; color: var(--brass);
}

/* ---------- Accueil ---------- */
.home-head { padding: 22px 0 26px; }
.marque { display: block; width: 74px; margin-bottom: 16px; }
.today {
  background: var(--ivory); color: var(--ink);
  border-radius: 22px; padding: 20px;
  display: grid; gap: 12px;
}
.today .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: #7A5B68; }
.today .txt { font-family: var(--display); font-size: 22px; line-height: 1.22; }
.today .done-btn {
  justify-self: start; padding: 10px 18px; border-radius: 999px;
  background: #1F6B58; color: #fff; font-weight: 600; font-size: 15px;
}
.today .done-btn[disabled] { background: transparent; color: #1F6B58; box-shadow: inset 0 0 0 1.5px #1F6B58; cursor: default; }

.packs { display: grid; gap: 14px; margin-top: 26px; }
.pack {
  position: relative; overflow: hidden;
  text-align: left; width: 100%;
  border-radius: 22px; padding: 18px 104px 20px 20px;
  background: var(--acc); color: #fff;
  min-height: 150px;
  display: grid; align-content: space-between; gap: 6px;
  transition: transform .12s ease;
}
.pack:active { transform: scale(.985); }
.pack .name { font-family: var(--display); font-size: 28px; line-height: 1.05; font-weight: 500; }
.pack .desc { font-size: 15px; opacity: .86; max-width: 26ch; }
.pack .count { font-size: 14px; opacity: .8; margin-bottom: 14px; }
.pack .mini {
  position: absolute; right: -14px; top: 14px; width: 104px; aspect-ratio: 5/7;
  background: var(--ivory); border-radius: 12px; transform: rotate(10deg);
  box-shadow: -10px 6px 0 rgba(0,0,0,.14);
  display: grid; place-items: center; padding: 10px;
}
.pack .mini svg { width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 26px; }

/* ---------- Barre haute ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back { display: inline-flex; align-items: center; gap: 8px; padding: 10px 10px 10px 0; color: var(--ivory); }
.back svg { width: 18px; height: 18px; }
.counter { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }

/* ---------- Choix d'intensité ---------- */
.levels { display: grid; gap: 12px; margin-top: 26px; }
.level {
  text-align: left; width: 100%;
  padding: 18px 20px; border-radius: 20px;
  background: rgba(248,239,230,.06);
  box-shadow: inset 0 0 0 1.5px rgba(248,239,230,.14);
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
}
.level .n { font-family: var(--display); font-size: 24px; font-weight: 500; }
.level .d { grid-column: 1; color: var(--muted); font-size: 15px; }
.heat { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 5px; }
.heat i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rose); }
.heat i.on { background: var(--rose); }

.level:not(:has(.heat)) { grid-template-columns: 1fr; }
.note { margin-top: 22px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- La carte ---------- */
.table { flex: 1; display: grid; place-items: center; padding: 18px 0; perspective: 1400px; }
.card {
  width: min(100%, 330px, calc((100dvh - 260px) * 5 / 7));
  min-width: 240px;
  aspect-ratio: 5 / 7;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.3,.9,.3,1);
  cursor: pointer;
}
.card.open { transform: rotateY(180deg); }
.card.enter { animation: deal .38s cubic-bezier(.2,.8,.3,1); }
@keyframes deal { from { transform: translateY(26px) rotate(-3deg); opacity: 0; } }
.face {
  position: absolute; inset: 0; border-radius: 22px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 26px 50px -22px rgba(0,0,0,.7);
  overflow: hidden;
}
.face.back {
  background: var(--acc);
  display: grid; place-items: center; text-align: center; color: #fff;
}
.face.back::before {
  content: ""; position: absolute; inset: 12px; border-radius: 13px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45);
  background-image: radial-gradient(rgba(255,255,255,.22) 1.4px, transparent 1.6px);
  background-size: 16px 16px;
}
.face.back .mono { position: relative; font-family: var(--display); font-style: italic; font-size: 64px; line-height: 1; }
.face.back .hint { position: absolute; bottom: 30px; left: 0; right: 0; font-size: 14px; opacity: .85; }
.face.front {
  background: var(--ivory); color: var(--ink);
  transform: rotateY(180deg);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column;
}
.front .top { display: flex; justify-content: space-between; align-items: center; }
.front .type { font-weight: 600; color: var(--acc); font-size: 15px; }
.front .heat i { box-shadow: inset 0 0 0 1.5px var(--acc); }
.front .heat i.on { background: var(--acc); }
.front .art { flex: 0 1 38%; min-height: 0; display: grid; place-items: center; margin: 8px 0 4px; }
.front .art svg { height: 100%; max-width: 100%; }
.front.has-pose .art { flex-basis: 46%; }
.front .nom { font-family: var(--display); font-size: 25px; line-height: 1.1; font-weight: 600; margin-bottom: 8px; }
.front .txt { font-family: var(--display); font-size: clamp(19px, 5.6vw, 23px); line-height: 1.24; font-weight: 450; }
.front.has-pose .txt { font-family: var(--text); font-size: 15.5px; line-height: 1.42; color: #4d2d3c; }
.front .sign { margin-top: auto; padding-top: 10px; font-size: 12.5px; color: #9A7C88; display: flex; justify-content: space-between; }

.actions { display: grid; gap: 6px; justify-items: center; }
.rule { text-align: center; color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Conditions ---------- */
.legal .title { margin-top: 14px; }
.legal h2 { font-family: var(--display); font-weight: 500; font-size: 21px; margin: 28px 0 8px; color: var(--rose); }
.legal p:not(.lead) { color: #E6D6DC; font-size: 16px; line-height: 1.6; margin-bottom: 10px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.foot .link { padding: 8px; }
.gate .link { text-align: center; }

/* ---------- Offre, achat, code ---------- */
.offer { margin-bottom: 14px; padding: 18px 20px 12px; border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--brass); display: grid; gap: 12px; }
.offer .o-t { font-family: var(--display); font-size: 20px; line-height: 1.2; }
.offer .o-s { font-size: 14px; color: var(--muted); text-align: center; }
.offer .link { padding: 4px; font-size: 14px; }
.promo { display: grid; gap: 4px; justify-items: start; }
.promo .p-tag { background: var(--brass); color: var(--ink); font-weight: 600; font-size: 13.5px; padding: 4px 12px; border-radius: 999px; }
.promo .p-prix { font-family: var(--display); font-size: clamp(26px, 8vw, 34px); line-height: 1.1; margin-top: 6px; white-space: nowrap; }
.promo .p-prix b { font-weight: 600; color: var(--ivory); }
.promo .p-prix s { font-size: 18px; color: var(--muted); margin-left: 8px; text-decoration-thickness: 2px; }
.promo .p-note { font-size: 14px; color: var(--muted); }
.unlock .promo, .end .promo { margin-top: 20px; }
.unlock .title { margin-top: 14px; }
.form { display: grid; gap: 16px; margin: 26px 0 8px; }
.form label { display: grid; gap: 7px; font-size: 15px; color: var(--rose); }
.form input {
  font: inherit; font-size: 18px; color: var(--ivory);
  background: rgba(248,239,230,.06); border: 0; border-radius: 14px; padding: 15px 16px;
  box-shadow: inset 0 0 0 1.5px rgba(248,239,230,.2);
}
.form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brass); }
.form input::placeholder { color: rgba(248,239,230,.3); }
.form .err { color: #FFB4A8; font-size: 15px; min-height: 1.4em; }
.form .err:empty { display: none; }
.btn[disabled] { opacity: .55; cursor: default; }
.unlock .swap { display: block; margin: 0 auto; }
.bigcode { font-family: var(--display); font-size: 34px; letter-spacing: .04em; color: var(--brass); padding: 18px 0; user-select: all; }
.foot .code { color: var(--ivory); font-weight: 600; letter-spacing: .04em; user-select: all; }
.foot a.link { display: inline-block; }
[hidden] { display: none !important; }

/* ---------- Fin de paquet ---------- */
.end { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }

/* Pas de version à imprimer au lancement : l'impression du navigateur donne une page vide. */
@media print { body { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .pack { transition: none; }
  .card.enter { animation: none; }
}
