/* ══════════════════════════════════════════════════════════════════════════
   plateau.mobile.css — §73 SYNAXIS au téléphone (28/10/2026)
   ──────────────────────────────────────────────────────────────────────────
   Une vraie mise en page de smartphone pour le plateau, sans rien reconstruire : les composants existants
   sont réordonnés et resserrés. Chargée en DERNIER (après plateau.anneau.css) pour primer sur les couches
   précédentes sans !important ; toutes les règles sont sous max-width, l'ordinateur (≥ 1024 px) est donc
   identique.
   De haut en bas (≤ 559 px) : identité · recherche pleine largeur · PI, STARDUST, NIVEAU, COMPTE (quatre
   capsules égales ; deux par deux sous 360 px) · astrolabe · consigne courte (§78 : « Explore ton univers ») ·
   « Éveiller le cristal » · « Réglages de l'astrolabe » · Grimoire · Codex.
   Aucune ressource externe, aucune animation nouvelle, aucune propriété de mise en page animée.
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 559px) {
  /* ── 1. En-tête ── */
  html body.pl .pl-status {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "id id id id" "search search search search" "res res prog me";
    column-gap: 6px; row-gap: 10px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px));
  }
  html body.pl .pl-hd-id { gap: 10px; }
  html body.pl .pl-brand { width: 40px; height: 40px; }
  html body.pl .pl-brand img { width: 34px; height: 34px; }
  html body.pl .pl-hd-id .pl-wordmark { font-size: 21px; letter-spacing: .15em; }
  html body.pl .pl-hd-id .pl-title { font-size: clamp(11px, 3.5vw, 13.5px); letter-spacing: .05em; color: rgba(243, 238, 228, .82); }

  /* la recherche : une capsule sur toute la largeur, 46 px */
  html body.pl .pl-hd-search .pl-search { max-width: none; }
  html body.pl .pl-hd-search .pl-search input { min-height: 46px; font-size: 16px;   /* 16 px : iOS Safari ne zoome pas la page au focus */ padding-left: 42px; text-overflow: ellipsis; }

  /* les quatre capsules : mêmes largeur et hauteur, libellé en haut, valeur dessous (jamais coupée) */
  html body.pl .pl-hd-right .pl-res { grid-area: res; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex-wrap: nowrap; align-self: stretch; }
  html body.pl .pl-hd-prog { grid-area: prog; display: flex; align-self: stretch; min-width: 0; }
  html body.pl .pl-hd-prog[hidden] { display: none; }
  html body.pl .pl-lvl { display: flex; flex: 1 1 auto; min-width: 0; }
  html body.pl .pl-hd-right .pl-me-wrap { grid-area: me; justify-self: stretch; align-self: stretch; display: flex; min-width: 0; }
  html body.pl .pl-hd-right .pl-res .pl-chip,
  html body.pl .pl-lvl .pl-chip {
    display: grid; grid-template-columns: auto auto; justify-content: center; align-content: center; align-items: center;
    column-gap: 4px; row-gap: 2px; width: 100%; min-width: 0; min-height: 50px; padding: 6px 6px 8px; border-radius: 16px;
  }
  html body.pl .pl-hd-right .pl-chip .pl-ci { width: 15px; height: 15px; grid-row: 1; grid-column: 1; border-width: 0; box-shadow: none; }
  html body.pl .pl-hd-right .pl-chip .pl-ci::after { display: none; }
  html body.pl .pl-hd-right .pl-chip .pl-ci svg { width: 13px; height: 13px; }
  html body.pl .pl-hd-right .pl-chip .pl-cval { display: contents; }
  html body.pl .pl-hd-right .pl-chip small {
    display: block; position: static; width: auto; height: auto; overflow: visible; clip: auto; grid-row: 1; grid-column: 2;
    font-size: 9px; letter-spacing: .06em; line-height: 1; white-space: nowrap;
  }
  html body.pl .pl-hd-right .pl-chip b { grid-row: 2; grid-column: 1 / -1; justify-self: center; font-size: 15px; line-height: 1.1; white-space: nowrap; }
  html body.pl .pl-hd-right .pl-chip--lvl b { font-size: 16px; }
  html body.pl .pl-hd-right .pl-chip--lvl .pl-cval { min-width: 0; padding: 0; }
  html body.pl .pl-hd-right .pl-chip--lvl .pl-bar { left: 12px; right: 12px; bottom: 5px; }
  /* Mon compte : le sceau à l'initiale au-dessus, le nom dessous */
  html body.pl .pl-hd-right .pl-me.is-user {
    flex: 1 1 auto; min-width: 0; min-height: 50px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px;
    padding: 5px 4px 6px; border-radius: 16px;
  }
  html body.pl .pl-hd-right .pl-me.is-user .pl-av { width: 22px; height: 22px; font-size: 12px; }
  html body.pl .pl-hd-right .pl-me.is-user .pl-me-name { display: block; font-size: 9px; letter-spacing: .06em; line-height: 1; white-space: nowrap; }
  html body.pl .pl-me-menu { right: 0; left: auto; max-width: calc(100vw - 24px); }
  /* visiteur : « Se connecter » seul, centré sous la recherche */
  html body.pl .pl-status:has(.pl-hd-prog[hidden]) .pl-me-wrap { grid-area: auto; grid-row: 3; grid-column: 1 / -1; justify-self: center; }
  html body.pl .pl-hd-right .pl-me:not(.is-user) { min-height: 44px; padding: 6px 18px; }

  /* ── 2. Astrolabe : plus large, moins de vide autour ── */
  html body.pl .pl-main { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); row-gap: 10px; }
  html body.pl .pl-stage { gap: 12px; }
  html body.pl .pl-astro { width: 100%; max-width: min(100%, 560px); aspect-ratio: 1; }

  /* ── 5. Couronne : les noms des médaillons latéraux se rapprochent du centre (plus rien au bord de l'écran) ── */
  html body.pl .pl-medal:is([data-k="exploration"], [data-k="athanor"]) > .pl-med-n { transform: translateX(-18px); }
  html body.pl .pl-medal:is([data-k="archives"], [data-k="inventaire"]) > .pl-med-n { transform: translateX(18px); }

  /* ── 6. Consigne courte (§78) : « Explore ton univers », puis le geste ; la consigne complète (clavier compris) reste lue ── */
  html body.pl .pl-hint { margin: 6px 0 0; }
  html body.pl .pl-hint-x { display: none; }
  html body.pl .pl-hint-t { gap: 8px; }
  html body.pl .pl-hint-t::before, html body.pl .pl-hint-t::after { flex-basis: 40px; }
  html body.pl .pl-hint-t b { font-size: 14px; letter-spacing: .17em; }
  html body.pl .pl-hint-s { font-size: 15px; line-height: 1.35; }

  /* ── 7. « Éveiller le cristal » : l'appel à l'action, sur toute la largeur ── */
  html body.pl .pl-actbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin-top: 12px; width: 100%; }
  html body.pl .pl-stage .pl-actbar > .pl-cristal-btn.pl-dice-btn {
    display: flex; width: 100%; margin: 0; gap: 12px; min-height: 68px; padding: 8px 44px 8px 12px; border-radius: 20px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, rgba(255, 244, 214, .10), rgba(255, 244, 214, 0) 42%) padding-box,
                radial-gradient(120% 160% at 10% 50%, rgba(157, 107, 255, .42), transparent 62%) padding-box,
                linear-gradient(135deg, #261a62, #120f3a 58%, #1f0f45) padding-box,
                linear-gradient(135deg, #F6DC98, #B98C3E 40%, #E8C36A 70%, #8F6A2C) border-box;
    box-shadow: inset 0 1px 0 rgba(255, 244, 214, .22), 0 0 0 3px rgba(5, 6, 15, .5), 0 10px 26px -10px rgba(123, 79, 214, .7);
  }
  html body.pl .pl-stage .pl-actbar > .pl-cristal-btn::after {
    content: "\203A"; position: absolute; right: 16px; top: 50%; transform: translateY(-52%);
    font: 400 28px/1 var(--pl-display, Georgia, serif); color: #F1D891; pointer-events: none;
  }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-ico { width: 46px; height: 46px; }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-txt b { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; }
  html body.pl.pl-at-coeur .pl-actbar > .pl-cristal-btn .pl-cristal-txt b { font-size: 15px; }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-txt small { font-size: 13px; line-height: 1.3; color: rgba(232, 228, 250, .86); }

  /* ── 8. « Réglages de l'astrolabe » sous le Cristal, centré ; son panneau prend la largeur de la page (marges et zones sûres
     de .pl-main) ; puis le Grimoire, quand une dimension est choisie ── */
  html body.pl .pl-set { position: static; }
  html body.pl .pl-actbar { position: relative; }
  html body.pl .pl-set-panel { left: 0; right: 0; width: auto; transform: none; }
  html body.pl .pl-set-help-t { font-size: 14.5px; }
  html body.pl .pl-stage > .pl-panel { order: 1; }
  /* les sceaux POLARIS et AETHER ne couvrent pas le panneau ouvert */
  html body.pl.pl-set-on :is(.pg-orb, .ps-mus-fab) { opacity: 0; pointer-events: none; }

  /* Cœur Atlante : le cartouche SYNAXIS descend sur la couronne, sous le noyau ; moins d'ornements autour */
  html body.pl .pl-astro.pl-atlante.pl-at-heart3d .pl-core-t1 { transform: translateY(55.5px); }   /* cartouche et nom descendent ensemble de 7 (synaxis-atlante.css : 48,5) */
  html body.pl .pl-at-front .pl-at-plate { transform: translateY(7px); }
  html body.pl .pl-at-heart .pl-at-core > path, html body.pl .pl-at-heart .pl-at-conv text { display: none; }

  /* ── 9. POLARIS et AETHER : sceaux de 48 px (zone tactile), dans les zones sûres, au-dessus des barres du
     téléphone ; le pied de page garde de quoi ne jamais finir sous eux ; ils s'effacent quand le clavier est ouvert ── */
  html body.pl .pg-orb { width: 48px; height: 48px; left: max(10px, env(safe-area-inset-left, 0px)); bottom: calc(12px + var(--ps-bottomnav-h, 0px) + env(safe-area-inset-bottom, 0px)); }
  html body.pl .pg-orb .pg-star { width: 36px; height: 36px; }
  html body.pl .ps-mus-fab { width: 48px; height: 48px; right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html body.pl .pl-foot { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  /* … et ils s'effacent tant que « Éveiller le cristal » traverse leur bande (body.pl-cta-low, posée par
     plateau.page.js) : la capsule reste entière et touchable ; un sceau qui a le focus clavier reste visible */
  html body.pl.pl-cta-low :is(.pg-orb, .ps-mus-fab):not(:focus-visible) { opacity: 0; pointer-events: none; }

  /* les six fonctions de SYNAXIS autour du cœur : zone de toucher agrandie jusqu'au bord du cœur (r 21,5 × 1,6 = 34 ;
     anneau à 129, cœur à 94) sans le recouvrir ; le dessin ne change pas */
  html body.pl .pl-sxf > .pl-sxf-hit { r: 21.5px; }
}

/* ── 3. Les cinq pierres : un cartouche compact et lisible (synaxis-atlante.css le retirait à 560 px) ── */
@media (max-width: 560px) {
  html body.pl .pl-at-lab {
    padding: 3px 7px; border: 1px solid rgba(232, 195, 106, .55); border-radius: 999px;
    background: linear-gradient(180deg, rgba(22, 18, 52, .92), rgba(9, 8, 28, .92));
    box-shadow: 0 1px 6px rgba(4, 4, 18, .75), inset 0 1px 0 rgba(255, 236, 190, .08); text-shadow: 0 1px 2px rgba(6, 8, 30, .9);
  }
  html body.pl .pl-at-lab b { font-size: 10.5px; letter-spacing: .07em; }
}

/* ── Sous 360 px : les quatre capsules deux par deux, en ligne (emblème, libellé, valeur) pour rester basses ── */
@media (max-width: 359px) {
  html body.pl .pl-status { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "id id" "search search" "res res" "prog me"; row-gap: 8px; }
  html body.pl .pl-hd-right .pl-res .pl-chip, html body.pl .pl-lvl .pl-chip {
    grid-template-columns: auto minmax(0, 1fr); justify-content: start; column-gap: 7px; min-height: 44px; padding: 4px 10px 4px 6px; border-radius: 999px;
  }
  html body.pl .pl-hd-right .pl-chip .pl-ci { width: 26px; height: 26px; grid-row: 1 / span 2; }
  html body.pl .pl-hd-right .pl-chip b { grid-row: 2; grid-column: 2; justify-self: start; font-size: 14.5px; }
  html body.pl .pl-hd-right .pl-chip--lvl { padding-bottom: 8px; }
  html body.pl .pl-hd-right .pl-chip--lvl .pl-bar { left: 39px; right: 12px; bottom: 4px; }
  html body.pl .pl-hd-right .pl-me.is-user { flex-direction: row; justify-content: center; gap: 8px; min-height: 44px; padding: 4px 10px; border-radius: 999px; }
  html body.pl .pl-hd-right .pl-me.is-user .pl-av { width: 26px; height: 26px; }
  html body.pl .pl-hd-right .pl-me.is-user .pl-me-name { font-size: 9px; }
  /* « Éveiller le cristal » tient sur une ligne */
  html body.pl .pl-stage .pl-actbar > .pl-cristal-btn.pl-dice-btn { gap: 10px; padding: 8px 32px 8px 10px; }
  html body.pl .pl-stage .pl-actbar > .pl-cristal-btn::after { right: 12px; }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-ico { width: 40px; height: 40px; }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-txt b, html body.pl.pl-at-coeur .pl-actbar > .pl-cristal-btn .pl-cristal-txt b { font-size: 13px; letter-spacing: .06em; }
  html body.pl .pl-actbar > .pl-cristal-btn .pl-cristal-txt small { font-size: 12.5px; }
  /* la consigne : filets plus courts, le titre garde sa ligne */
  html body.pl .pl-hint-t::before, html body.pl .pl-hint-t::after { flex-basis: 22px; }
  html body.pl .pl-hint-t b { font-size: 13px; letter-spacing: .14em; }
  html body.pl .pl-set-btn { letter-spacing: .1em; }
  /* la couronne fait 300 px : la zone de toucher des huit médaillons repasse à 44 px et plus (r 41,5 × 1,38) */
  html body.pl .pl-medal:not(.pl-medal--sc) > .pl-med-hit { r: 41.5px; }
}

/* ── Jusqu'à 374 px : le Grimoire resserre ses marges internes et ses sur-titres (une ligne au lieu de deux) ── */
@media (max-width: 374px) {
  html body.pl .pl-stage > .pl-panel { padding-left: 12px; padding-right: 12px; }
  html body.pl .pl-panel .pl-gr-sec { padding-left: 10px; padding-right: 10px; }
  html body.pl .pl-panel .pl-p-eyebrow { letter-spacing: .1em; }
  html body.pl .pl-panel .pl-gr-k { gap: 6px; letter-spacing: .08em; }
}

/* ── Clavier virtuel ouvert (champ actif, écran tactile) : les sceaux flottants ne couvrent pas la saisie ── */
@media (max-width: 1023px) and (hover: none) {
  html body.pl:has(:is(input:not([type=checkbox], [type=radio], [type=range], [type=button], [type=submit], [type=reset], [type=color], [type=file]), textarea, select):focus) :is(.pg-orb, .ps-mus-fab) { opacity: 0; pointer-events: none; }
}

/* ── Téléphone à l'horizontale (560 px et plus) : l'en-tête en deux rangées au lieu de trois (identité et recherche,
   puis ressources, niveau et compte) : l'astrolabe commence plus haut ── */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) and (max-width: 1023px) {
  html body.pl .pl-status {
    grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "id search search search" "res more prog me";
    row-gap: 6px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 8px;
  }
  html body.pl .pl-hd-search .pl-search input { min-height: 44px; }
}

/* ── Téléphone à l'horizontale : l'astrolabe tient entier dans la hauteur de l'écran ── */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  html body.pl .pl-astro { max-width: min(100%, calc(100svh - 24px)); }
  /* l'astrolabe a alors sa taille de téléphone : mêmes tailles de textes qu'en portrait */
  html body.pl .pl-medal { transform-box: fill-box; transform-origin: center; transform: scale(1.38); }
  html body.pl .pl-medal > .pl-med-n { font-size: 13px; letter-spacing: .05em; }
  html body.pl .pl-medal:not(.pl-medal--sc) > .pl-med-hit { r: 37px; }
  html body.pl .pl-medal:is([data-k="exploration"], [data-k="athanor"]) > .pl-med-n { transform: translateX(-18px); }
  html body.pl .pl-medal:is([data-k="archives"], [data-k="inventaire"]) > .pl-med-n { transform: translateX(18px); }
  html body.pl .pl-astro.pl-atlante .pl-sxf-n { display: none; }
  html body.pl .pl-at-lab {
    padding: 3px 7px; border: 1px solid rgba(232, 195, 106, .55); border-radius: 999px;
    background: linear-gradient(180deg, rgba(22, 18, 52, .92), rgba(9, 8, 28, .92)); box-shadow: 0 1px 6px rgba(4, 4, 18, .75);
  }
  html body.pl .pl-at-lab b { font-size: 10.5px; letter-spacing: .07em; }
  html body.pl .pl-at-lab small { display: none; }
}
