/* ============================================================
   Mokili — design system nocturne
   (application joueur + pages publiques)
   ============================================================ */

:root {
  /* Palette nuit */
  --night-900: #06070f;
  --night-800: #0a0c1a;
  --night-700: #101228;
  --night-600: #171a35;
  --night-500: #212545;
  --night-400: #2e3358;

  /* Lumieres */
  --gold: #e9bd6c;
  --gold-soft: #f5d79b;
  --violet: #8b7cf6;
  --violet-soft: #b4a8ff;
  --teal: #4fd1c5;
  --rose: #f27b9b;

  /* Texte */
  --ink: #eceefb;
  --ink-soft: #b9bedb;
  --ink-muted: #7d84a8;

  /* Surfaces */
  --card: rgba(23, 26, 53, 0.72);
  --card-solid: #14172e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Structure */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 45px -22px rgba(0, 0, 0, 0.85);
  --shadow-soft: 0 10px 30px -20px rgba(0, 0, 0, 0.9);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 68px;
}

[hidden] { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  background: var(--night-900);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ciel de nuit : deux halos + un fin grain d'etoiles */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% -5%, rgba(139, 124, 246, 0.28), transparent 46%),
    radial-gradient(circle at 88% 8%, rgba(233, 189, 108, 0.16), transparent 42%),
    radial-gradient(circle at 50% 120%, rgba(79, 209, 197, 0.12), transparent 55%),
    linear-gradient(180deg, #06070f 0%, #0a0c1a 45%, #08091a 100%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 22%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.2px 1.2px at 72% 14%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 42% 62%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.2px 1.2px at 84% 74%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.1px 1.1px at 8% 82%, rgba(255, 255, 255, 0.28), transparent);
  background-size: 100% 100%;
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 7vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 5vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 4vw, 1.35rem); }
p { color: var(--ink-soft); }

/* ------------------------------------------------------------
   Structure generale
   ------------------------------------------------------------ */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-height) + var(--safe-bottom) + 26px);
  flex: 1;
}
.page--plain { padding-bottom: 40px; }

/* En-tete collant : la zone de securite de l'encoche est respectee */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: rgba(6, 7, 15, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold), var(--violet));
  color: #10122a; flex: none;
}
.topbar__mark svg { width: 19px; height: 19px; }
.topbar__name { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.01em; }
.topbar__sub { font-size: 0.72rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.16em; }
.topbar__spacer { flex: 1; }
.topbar__action {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: 0.2s;
}
.topbar__action:hover { border-color: var(--gold); color: var(--gold-soft); }

/* Barre de navigation basse : presente sur toutes les pages */
.bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(8, 9, 20, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.bottombar__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px 4px;
  border-radius: 14px;
  color: var(--ink-muted);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  transition: 0.2s;
}
.bottombar__item svg { width: 21px; height: 21px; }
.bottombar__item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottombar__item.is-active { color: var(--gold-soft); background: rgba(233, 189, 108, 0.1); }
.bottombar__item:hover { color: var(--ink); }

/* ------------------------------------------------------------
   Typographie d'appoint
   ------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.lead { font-size: 1.02rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--ink-muted); font-size: 0.86rem; }
.center { text-align: center; }
.gold { color: var(--gold-soft); }

/* ------------------------------------------------------------
   Boutons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
  text-align: center;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary {
  background: linear-gradient(120deg, var(--gold), var(--gold-soft) 55%, var(--violet-soft));
  color: #0c0e1e;
  box-shadow: 0 12px 30px -14px rgba(233, 189, 108, 0.75);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(233, 189, 108, 0.85); }
.btn--ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn--quiet { background: transparent; color: var(--ink-muted); padding: 10px 14px; }
.btn--quiet:hover { color: var(--ink); }
.btn--danger { background: rgba(242, 123, 155, 0.14); border-color: rgba(242, 123, 155, 0.4); color: #ffc2d3; }
.btn--danger:hover { background: rgba(242, 123, 155, 0.22); }
.btn--small { padding: 9px 15px; font-size: 0.84rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ------------------------------------------------------------
   Cartes et blocs
   ------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card--flush { padding: 0; overflow: hidden; }
.card--glow { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.card__title { font-family: var(--font-display); font-size: 1.08rem; }
.card__hint { font-size: 0.8rem; color: var(--ink-muted); }

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding: 26px 20px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 7, 15, 0.35) 0%, rgba(6, 7, 15, 0.82) 55%, rgba(6, 7, 15, 0.96) 100%);
}
.hero__inner { position: relative; z-index: 1; }
.hero__title { font-size: clamp(1.7rem, 8vw, 3rem); }
.hero__text { color: var(--ink-soft); max-width: 54ch; margin-top: 10px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Bandeau de statistiques */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat__value { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-soft); line-height: 1.1; }
.stat__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-muted); }

/* ------------------------------------------------------------
   Grilles (mobile d'abord : une seule colonne)
   ------------------------------------------------------------ */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }

/* ------------------------------------------------------------
   Badges, puces, etoiles
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
}
.badge--gold { border-color: rgba(233, 189, 108, 0.45); color: var(--gold-soft); background: rgba(233, 189, 108, 0.1); }
.badge--violet { border-color: rgba(139, 124, 246, 0.45); color: var(--violet-soft); background: rgba(139, 124, 246, 0.12); }
.badge--teal { border-color: rgba(79, 209, 197, 0.4); color: var(--teal); background: rgba(79, 209, 197, 0.1); }
.badge--rose { border-color: rgba(242, 123, 155, 0.4); color: #ffc2d3; background: rgba(242, 123, 155, 0.12); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.84rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: 0.18s;
}
.chip:hover { border-color: var(--gold); color: var(--gold-soft); }
.chip.is-active { background: rgba(233, 189, 108, 0.15); border-color: var(--gold); color: var(--gold-soft); }

.stars { display: inline-flex; gap: 3px; }
.stars svg { width: 17px; height: 17px; color: rgba(255, 255, 255, 0.2); }
.stars svg.is-on { color: var(--gold); }
.stars--input svg { width: 30px; height: 30px; cursor: pointer; transition: transform 0.16s; }
.stars--input svg:hover { transform: scale(1.12); }

/* ------------------------------------------------------------
   Jauges et progression
   ------------------------------------------------------------ */
.gauge { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.gauge__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge--thin { height: 5px; }

.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 92px; height: 92px; }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring__track { stroke: rgba(255, 255, 255, 0.09); }
.ring__value { stroke: url(#ringGradient); }
.ring__label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
  font-family: var(--font-display); font-size: 1.25rem;
}
.ring__label small { display: block; font-family: var(--font-text); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }

/* ------------------------------------------------------------
   Chapitres
   ------------------------------------------------------------ */
.chapter {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.chapter:hover { transform: translateY(-3px); border-color: rgba(233, 189, 108, 0.35); }
.chapter__thumb { width: 96px; flex: none; background-size: cover; background-position: center; position: relative; }
.chapter__thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 12, 26, 0.15), rgba(16, 18, 40, 0.9)); }
.chapter__body { flex: 1; padding: 15px 16px 15px 0; min-width: 0; }
.chapter__num { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.chapter__title { font-family: var(--font-display); font-size: 1.16rem; margin: 2px 0 4px; }
.chapter__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 0.78rem; color: var(--ink-muted); }
.chapter.is-locked { opacity: 0.6; }
.chapter.is-locked .chapter__thumb { filter: grayscale(0.6); }

/* ------------------------------------------------------------
   Epreuves
   ------------------------------------------------------------ */
.trial { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.025); overflow: hidden; }
.trial__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.trial__index {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(139, 124, 246, 0.16);
  border: 1px solid rgba(139, 124, 246, 0.4);
  color: var(--violet-soft);
  font-size: 0.78rem;
}
.trial__body { padding: 12px 16px 16px; }
.trial__prompt { font-size: 1.02rem; color: var(--ink); }
.options { display: grid; gap: 9px; margin-top: 14px; }
.option {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: 0.18s;
  text-align: left;
  width: 100%;
  font-size: 0.95rem;
}
.option:hover { border-color: rgba(233, 189, 108, 0.5); background: rgba(233, 189, 108, 0.06); }
.option__dot {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 0.7rem; color: var(--ink-muted);
}
.option.is-chosen { border-color: var(--gold); background: rgba(233, 189, 108, 0.12); }
.option.is-chosen .option__dot { background: var(--gold); color: #10122a; border-color: var(--gold); }
.option.is-good { border-color: var(--teal); background: rgba(79, 209, 197, 0.12); }
.option.is-bad { border-color: rgba(242, 123, 155, 0.5); background: rgba(242, 123, 155, 0.1); }
.option[disabled] { cursor: default; }

.reveal-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 2px solid var(--gold);
  background: rgba(233, 189, 108, 0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.reveal-box p { color: var(--ink-soft); font-size: 0.92rem; }
.reveal-box--bad { border-left-color: var(--rose); background: rgba(242, 123, 155, 0.08); }

/* ------------------------------------------------------------
   Formulaires
   ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.82rem; color: var(--ink-soft); letter-spacing: 0.02em; }
.input, .textarea, .select {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  transition: 0.18s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-muted); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(233, 189, 108, 0.14);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select option { background: var(--card-solid); color: var(--ink); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--gold); }
.hint { font-size: 0.78rem; color: var(--ink-muted); }
.counter { font-size: 0.74rem; color: var(--ink-muted); text-align: right; }

/* ------------------------------------------------------------
   Publications du cercle
   ------------------------------------------------------------ */
.post { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px; }
.post__head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--violet), var(--teal));
  color: #0b0d1a; font-weight: 600; font-size: 0.95rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar--lg { width: 74px; height: 74px; font-size: 1.5rem; }
.post__name { font-size: 0.92rem; }
.post__time { font-size: 0.74rem; color: var(--ink-muted); }
.post__text { color: var(--ink); font-size: 0.97rem; white-space: pre-wrap; }
.post__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.iconbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.04);
  color: var(--ink-muted); font-size: 0.82rem; cursor: pointer; transition: 0.18s;
}
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.iconbtn.is-on { color: var(--rose); }
.iconbtn.is-on svg { fill: currentColor; }
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; font-size: 0.88rem; }
.comment__body { color: var(--ink-soft); }
.comment__name { color: var(--gold-soft); font-size: 0.82rem; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form .input { padding: 10px 13px; }

/* ------------------------------------------------------------
   Avis
   ------------------------------------------------------------ */
.review { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); padding: 16px; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.review__body { margin-top: 10px; color: var(--ink-soft); font-size: 0.94rem; }
.rating-summary { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.rating-big { font-family: var(--font-display); font-size: 2.8rem; line-height: 1; color: var(--gold-soft); }
.dist { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 5px; }
.dist__row { display: flex; align-items: center; gap: 9px; font-size: 0.78rem; color: var(--ink-muted); }
.dist__bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.dist__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--violet-soft)); }

/* ------------------------------------------------------------
   Classement
   ------------------------------------------------------------ */
.rank { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.rank__pos { font-family: var(--font-display); font-size: 1.05rem; width: 30px; color: var(--ink-muted); }
.rank.is-me { border-color: rgba(233, 189, 108, 0.5); background: rgba(233, 189, 108, 0.08); }
.rank__points { margin-left: auto; font-size: 0.85rem; color: var(--gold-soft); white-space: nowrap; }

/* ------------------------------------------------------------
   Messages d'etat, feuille modale, toasts
   ------------------------------------------------------------ */
.empty { text-align: center; padding: 34px 18px; color: var(--ink-muted); }
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: 0.6; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 5, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
}
.sheet__panel {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--night-600), var(--night-700));
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px 18px calc(24px + var(--safe-bottom));
  animation: sheet-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__title { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 14px; }

.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 14px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  background: rgba(20, 23, 46, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease-out;
}
.toast--ok { border-color: rgba(79, 209, 197, 0.5); }
.toast--err { border-color: rgba(242, 123, 155, 0.55); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------
   Reveal au scroll
   ------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   Pages publiques (presentation du jeu, connexion, inscription)
   ------------------------------------------------------------ */
.publicbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 14px) 16px 14px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.publicbar__nav { margin-left: auto; display: flex; gap: 8px; }

.feature { display: flex; flex-direction: column; gap: 10px; }
.feature__icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(139, 124, 246, 0.14);
  border: 1px solid rgba(139, 124, 246, 0.35);
  color: var(--violet-soft);
}
.feature__icon svg { width: 21px; height: 21px; }

.quote { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.5; color: var(--ink); }

.footer {
  margin-top: 40px;
  padding: 26px 16px calc(26px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.82rem;
}
.footer__inner { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.footer a:hover { color: var(--gold-soft); }

/* Installer l'application */
.install {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(233, 189, 108, 0.35);
  background: linear-gradient(120deg, rgba(233, 189, 108, 0.12), rgba(139, 124, 246, 0.12));
  border-radius: var(--radius);
  padding: 18px;
}
.install__icons { display: flex; gap: 10px; align-items: center; color: var(--gold-soft); }
.install__icons svg { width: 22px; height: 22px; }

.auth-wrap { max-width: 460px; margin: 0 auto; width: 100%; }

/* ------------------------------------------------------------
   Adaptations tablette et bureau
   ------------------------------------------------------------ */
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { padding: 22px 24px calc(var(--nav-height) + var(--safe-bottom) + 34px); }
  .chapter__thumb { width: 132px; }
  .footer__inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bottombar { max-width: 1080px; margin: 0 auto; border-radius: 22px 22px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* Deux blocs cote a cote sur grand ecran seulement */
@media (min-width: 768px) {
  .split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
}

/* Sous 768px : deux blocs cote a cote s'empilent toujours */
@media (max-width: 767px) {
  .split { display: flex; flex-direction: column; gap: 14px; }
  .hero { min-height: 300px; padding: 22px 18px; }
  .sheet__panel { max-height: 94vh; }
}
