/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   SYNAXIS — le Codex en plein écran et le panneau STARDUST (19/11/2026)
   1. Le Codex occupe toute la fenêtre : en haut, une barre fixe (les onglets sur une ligne, « ✕ Astrolabe » au bout) ;
      dessous, le titre en petit puis la rubrique sur toute la largeur et toute la hauteur restante.
      Téléphone (320-430 px) : la ligne d'onglets défile du doigt, le titre disparaît, ✕ devient une pastille ronde.
   2. « Que faire de tes STARDUST » (plateau-stardust.js) : panneau ouvert par la pastille STARDUST de l'en-tête.
   Chargée après plateau.seuil.css. Préfixe html body.pl. Aucune ressource externe.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Le Codex, plein écran ─────────────────────────────────────────────────────────────────── */
html body.pl .pl-codex {
  --cx-bar: 60px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto;
  align-content: start; gap: 0; padding: 0;
  scroll-padding-top: var(--cx-bar);
}
html body.pl .pl-codex[hidden] { display: none; }

/* la barre : onglets + retour, toujours visibles */
html body.pl .pl-codex > .cx-tabs,
html body.pl .pl-codex > .cx-close {
  position: sticky; top: 0; z-index: 6; grid-row: 1;
  min-height: var(--cx-bar); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(22, 16, 62, .97), rgba(12, 9, 38, .95));
  border-bottom: 1px solid rgba(232, 195, 106, .32);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html body.pl .pl-codex > .cx-tabs {
  grid-column: 1; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 6px;
  margin: 0; padding: 8px 12px 8px max(12px, env(safe-area-inset-left, 0px));
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
html body.pl .pl-codex > .cx-tabs::-webkit-scrollbar { display: none; }
html body.pl .pl-codex > .cx-tabs .cx-tab {
  flex: 0 0 auto; flex-direction: row; scroll-snap-align: center; white-space: nowrap;
  min-width: 0; min-height: 40px; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: 12px; letter-spacing: .1em;
}
html body.pl .pl-codex > .cx-tabs .cx-tab span { display: inline-grid; place-items: center; width: 15px; height: 15px; font-size: 13px; line-height: 1; }
html body.pl .pl-codex > .cx-tabs .cx-tab[hidden] { display: none !important; }
@media (min-width: 1280px) { html body.pl .pl-codex > .cx-tabs { justify-content: safe center; } }

html body.pl .pl-codex > .cx-close {
  grid-column: 2; justify-self: stretch; align-self: stretch; margin: 0;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 8px 18px;
  border: 0; border-left: 1px solid rgba(232, 195, 106, .32); border-bottom: 1px solid rgba(232, 195, 106, .32); border-radius: 0;
  box-shadow: none;
}
@media (hover: hover) { html body.pl .pl-codex > .cx-close:hover { background: linear-gradient(180deg, rgba(48, 36, 110, .98), rgba(22, 16, 62, .96)); } }
html body.pl .pl-codex > .cx-close:focus-visible { outline-offset: -4px; }

/* le titre, discret, sous la barre */
html body.pl .pl-codex > .cx-head { grid-column: 1 / -1; grid-row: 2; padding: 14px 16px 4px; gap: 2px; }
html body.pl .pl-codex > .cx-head::before { display: none; }
html body.pl .pl-codex > .cx-head .cx-title,
html body.pl .pl-codex > .cx-head h2 { font-size: clamp(17px, 1.9vw, 24px); margin: 0; }

/* la rubrique : toute la largeur, toute la hauteur restante */
html body.pl .pl-codex > .cx-body {
  grid-column: 1 / -1; grid-row: 3; align-self: start; min-width: 0;
  padding: 16px max(16px, calc((100vw - 1440px) / 2)) calc(96px + env(safe-area-inset-bottom, 0px));
}
html body.pl .pl-codex > .cx-seul {
  grid-column: 1 / -1; grid-row: 3; align-self: start; min-width: 0; margin: 10px 0 0;
  border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: none;
  min-height: calc(100vh - var(--cx-bar) - 64px); min-height: calc(100dvh - var(--cx-bar) - 64px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html body.pl .pl-codex > .cx-seul[hidden] { display: none; }
html body.pl .pl-codex .cx-seul-frame:not(.is-modal) { min-height: calc(100vh - var(--cx-bar) - 64px); min-height: calc(100dvh - var(--cx-bar) - 64px); }
html body.pl .pl-codex .cx-seul-frame.is-modal { min-height: 0; }

/* la rubrique qui n'a pas pu s'afficher (plateau.codex.js, seulFail) */
html body.pl .cx-seul-fail { display: grid; justify-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 56px 20px; text-align: center; color: #E9E3F6; }
html body.pl .cx-seul-fail[hidden] { display: none; }
html body.pl .cx-seul-fail p { margin: 0; }
html body.pl .cx-seul-fail .pl-p-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* téléphone : tout pour la rubrique */
@media (max-width: 759px) {
  html body.pl .pl-codex { --cx-bar: 56px; }
  html body.pl .pl-codex > .cx-head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body.pl .pl-codex > .cx-tabs { padding-left: 10px; padding-right: 6px; gap: 5px; }
  html body.pl .pl-codex > .cx-tabs .cx-tab { min-height: 40px; padding: 6px 12px; font-size: 11px; letter-spacing: .07em; border-radius: 999px; }
  html body.pl .pl-codex > .cx-close { padding-left: 10px; padding-right: max(10px, env(safe-area-inset-right, 0px)); min-width: 56px; justify-content: center; }
  html body.pl .pl-codex > .cx-close .cx-close-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html body.pl .pl-codex > .cx-close > span:first-child {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(232, 195, 106, .6); background: rgba(10, 8, 32, .7); font-size: 15px;
  }
  html body.pl .pl-codex > .cx-body { padding: 14px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  html body.pl .pl-codex > .cx-seul { margin-top: 0; min-height: calc(100vh - var(--cx-bar)); min-height: calc(100dvh - var(--cx-bar)); }
  html body.pl .pl-codex .cx-seul-frame:not(.is-modal) { min-height: calc(100vh - var(--cx-bar)); min-height: calc(100dvh - var(--cx-bar)); }
}

/* ── 2. « Que faire de tes STARDUST » ─────────────────────────────────────────────────────────── */
html.psp-on, html.psp-on body { overflow: hidden; }
.psp-ov {
  position: fixed; inset: 0; z-index: 9800; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 3, 18, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.psp-box {
  position: relative; box-sizing: border-box; width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 18px; border-radius: 22px;
  color: #EFE9FF; font-family: var(--pl-body, Georgia, serif);
  border: 1px solid transparent;
  background: radial-gradient(90% 60% at 50% 0%, rgba(150, 110, 240, .28), transparent 70%) padding-box,
              linear-gradient(180deg, #1b1450, #0c0a2a) padding-box,
              linear-gradient(180deg, #f6dc98, rgba(232, 195, 106, .35) 45%, rgba(120, 90, 200, .5)) border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.psp-box:focus { outline: none; }
.psp-x {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(232, 195, 106, .45); background: rgba(10, 8, 32, .6); color: #f3e6c4; font-size: 15px;
}
.psp-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.psp-coin { flex: 0 0 auto; width: 56px; height: 56px; filter: drop-shadow(0 0 12px rgba(190, 160, 255, .55)); }
.psp-eyebrow, .psp-k { margin: 0; font-family: var(--pl-display, Cinzel, serif); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: rgba(232, 195, 106, .9); }
.psp-title { margin: 2px 0 0; font-family: var(--pl-display, Cinzel, serif); font-size: clamp(18px, 4.6vw, 22px); line-height: 1.2; color: #FFF4D6; }
.psp-bal { margin: 4px 0 0; font-size: 15px; color: #CFC6EC; }
.psp-bal b { color: #FFF4D6; }
.psp-cta { display: grid; gap: 6px; margin: 18px 0 4px; }
.psp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font-family: var(--pl-display, Cinzel, serif); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  color: #F3E6C4; border: 1px solid rgba(232, 195, 106, .55); background: rgba(16, 12, 48, .8);
}
.psp-btn--pri { color: #1a1405; border-color: transparent; background: linear-gradient(180deg, #f8e2a4, #e2b95a); box-shadow: 0 0 18px rgba(232, 195, 106, .3); }
.psp-btn--big { min-height: 54px; font-size: 14px; color: #1a1405; border-color: transparent; background: linear-gradient(180deg, #fbe7ad, #e2b95a 70%, #c99a3a); box-shadow: 0 0 26px rgba(232, 195, 106, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }
@media (hover: hover) { .psp-btn:hover { filter: brightness(1.08); } .psp-x:hover { border-color: #e8c36a; } }
.psp-btn:focus-visible, .psp-x:focus-visible, .psp-link:focus-visible, .psp-list button:focus-visible { outline: 2px solid #7FF3E6; outline-offset: 2px; }
.psp-fine { margin: 0; font-size: 13px; color: #A9A3C8; text-align: center; }
.psp-wait { padding: 18px 0; }
.psp-feat {
  margin-top: 16px; padding: 16px; border-radius: 16px;
  border: 1px solid rgba(232, 195, 106, .38); background: linear-gradient(160deg, rgba(70, 46, 150, .38), rgba(16, 12, 48, .5));
}
.psp-feat--empty .psp-t { margin: 6px 0 0; font-size: 15px; }
.psp-name { margin: 6px 0 2px; font-family: var(--pl-display, Cinzel, serif); font-size: 18px; color: #FFF4D6; }
.psp-meta { display: flex; justify-content: space-between; gap: 10px; margin: 0; font-size: 13.5px; color: #CFC6EC; }
.psp-meta b, .psp-list b { color: #F6DC98; white-space: nowrap; }
.psp-why { margin: 8px 0 0; font-size: 14.5px; color: #E4DDF6; }
.psp-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.psp-row .psp-btn { flex: 1 1 160px; }
.psp-k--list { margin-top: 18px; }
.psp-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.psp-list button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 12px; cursor: pointer;
  border-radius: 12px; border: 1px solid rgba(232, 195, 106, .22); background: rgba(14, 10, 40, .6); color: #EFE9FF; font: inherit; font-size: 14.5px; text-align: left;
}
.psp-list small { display: block; font-size: 12px; color: #A9A3C8; }
@media (hover: hover) { .psp-list button:hover { border-color: rgba(232, 195, 106, .55); } }
.psp-foot { display: grid; gap: 4px; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(232, 195, 106, .2); }
.psp-link { min-height: 40px; padding: 6px 4px; border: 0; background: none; cursor: pointer; color: #F6DC98; font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
@media (max-width: 559px) {
  .psp-ov { align-items: flex-end; padding: 0; }
  .psp-box { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .psp-coin { width: 46px; height: 46px; }
}
