/* ============================================================
   ASTRA GENESIS, 33-tutorial.css
   v0.87.1 : accompagnement du tutoriel (js/04e-tutorial-guide.js).
   Compas (.tc-*), bulle de pas (.tuto-bubble), célébration d'une phase
   (.tuto-celebrate), graduation (.tuto-grad). v0.89.7.4 : l'accueil en
   trois slides est remplacé par le prologue (css/06c-prologue.css).
   La surbrillance dorée (.tuto-glow) reste dans css/05-screens.css.
   Aucune image : formes, dégradés et animations déjà au jeu (dv2Pop,
   dv2Sparkle : css/design-system.css ; palActivePulse : css/11-quests.css).
   « Effets réduits » (html.fx-reduced) et prefers-reduced-motion coupent
   toutes les animations, en fin de feuille.
   ============================================================ */

/* ---------- Compas (écran Planète, #phase-panel) ---------- */
.tc-body{display:flex;flex-direction:column;gap:calc(5px*var(--scale));}
/* frise des phases : la grammaire de la frise des paliers (pastille
   faite, pastille en cours qui pulse, pastille à venir en pointillés) */
.tc-frise{position:relative;display:flex;justify-content:space-between;align-items:center;min-height:calc(26px*var(--scale));}
.tc-frise::before{
  content:"";position:absolute;left:10px;right:10px;top:50%;height:2px;transform:translateY(-50%);
  background:linear-gradient(90deg, var(--cyan) 0, var(--cyan) var(--tc-progress,0%), rgba(148,163,184,.25) var(--tc-progress,0%), rgba(148,163,184,.25) 100%);
}
.tc-pip{
  position:relative;z-index:1;flex:none;box-sizing:border-box;
  width:calc(20px*var(--scale));height:calc(20px*var(--scale));border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono);font-size:.58rem;font-weight:700;color:var(--ink-3);
  background:#0B1320;border:2px solid rgba(148,163,184,.35);transition:border-color .15s;
}
.tc-pip:hover{border-color:var(--cyan);}
.tc-pip.done{border-color:var(--cyan);color:var(--cyan);background:#0A2426;}
.tc-pip.active{
  width:calc(24px*var(--scale));height:calc(24px*var(--scale));
  border-color:var(--amber);color:var(--amber);background:#2A1D05;
}
/* v0.89.2.2 : l'anneau qui s'élargit est un ::after qui grandit et
   s'efface (compositeur seul), au lieu d'une ombre redessinée à chaque
   image : environ 40 % d'un cœur de moins, mesuré en 3440 px. Images
   clés : palActivePulseSmall, css/11-quests.css. */
.tc-pip.active::after{
  content:"";position:absolute;inset:-2px;border-radius:50%;pointer-events:none;
  border:3px solid rgba(245,158,11,.45);opacity:0;
  animation:palActivePulseSmall 2.2s ease-in-out infinite;
}
.tc-pip.next{border-style:dashed;}
.tc-phase{font-family:var(--font-head);font-weight:600;font-size:.86rem;color:var(--ink-1);}
.tc-intro,.tc-note{margin:0;font-size:.76rem;line-height:1.4;color:var(--ink-2);}
/* l'étape en cours, dépliée : pourquoi (le conseil est dans la bulle) */
.tc-explain{
  margin:0 0 calc(3px*var(--scale));padding:calc(6px*var(--scale)) calc(9px*var(--scale));
  border-left:2px solid var(--amber);border-radius:0 8px 8px 0;background:rgba(245,158,11,.07);
}
.tc-explain p{margin:0;font-size:.74rem;line-height:1.4;color:var(--ink-2);}
.tc-explain b{
  display:block;font-family:var(--font-mono);font-size:.58rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--amber);
}
.tc-acts{display:flex;gap:8px;margin-top:calc(5px*var(--scale));}
.tc-acts .btn{flex:1 1 auto;min-width:0;justify-content:center;white-space:nowrap;}
/* « Voir » est le geste attendu : il prend la place, « Passer » reste discret */
.tc-acts #btn-skip-tutorial{flex:0 0 auto;}
/* une étape qui n'est pas en cours tient sur une ligne (texte entier au survol) */
.tc-body .dv2-mission-step:not(.current) .dv2-mission-label{
  flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ---------- bulle de pas ----------
   Posée près de l'élément en surbrillance (left/top écrits par le script),
   ou en haut de l'écran quand l'endroit n'est pas visible (.docked). Elle
   ne reçoit JAMAIS le pointeur : rien de ce qu'elle couvre n'est bloqué,
   et elle s'efface quand le pointeur passe dessous (.ghost). */
.tuto-bubble{
  position:fixed;left:0;top:0;z-index:820;box-sizing:border-box;
  width:max-content;max-width:min(300px, calc(100vw - 16px));
  padding:10px 13px;border-radius:12px;pointer-events:none;
  background:rgb(18,28,43);border:1px solid var(--amber);color:var(--ink-1);
  box-shadow:0 10px 30px rgba(0,0,0,.55), 0 0 22px rgba(245,158,11,.22);
  transition:opacity .15s ease;animation:dv2Pop .35s cubic-bezier(.34,1.56,.64,1) both;
}
.tuto-bubble[hidden]{display:none;}
.tuto-bubble.ghost{opacity:.1;}
/* l'endroit est dans la fenêtre du jeu : la bulle passe devant elle */
.tuto-bubble.in-modal{z-index:855;}
.tuto-bubble.docked{right:0;margin:0 auto;top:calc(var(--hud-h) + var(--ribbon-h) + 12px);}
.tuto-bubble.compact{max-width:min(250px, calc(100vw - 16px));padding:8px 12px;}
.tb-eyebrow{
  font-family:var(--font-mono);font-size:.56rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--amber);margin-bottom:3px;
}
.tb-goal{font-size:.84rem;font-weight:600;line-height:1.35;}
.tb-tip{margin-top:6px;font-size:.76rem;line-height:1.4;color:var(--ink-2);}
.tb-tip b{
  margin-right:6px;font-family:var(--font-mono);font-size:.58rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--amber);
}
.tuto-bubble.compact .tb-tip{display:none;}
/* la pointe : --tb-arrow est sa place le long du bord, écrite par le script */
.tb-arrow{
  display:none;position:absolute;width:12px;height:12px;
  background:rgb(18,28,43);border:1px solid var(--amber);transform:rotate(45deg);
}
.tuto-bubble[data-side="below"] .tb-arrow{display:block;left:var(--tb-arrow,50%);margin-left:-6px;top:-7px;border-right-color:transparent;border-bottom-color:transparent;}
.tuto-bubble[data-side="above"] .tb-arrow{display:block;left:var(--tb-arrow,50%);margin-left:-6px;bottom:-7px;border-left-color:transparent;border-top-color:transparent;}
.tuto-bubble[data-side="right"] .tb-arrow{display:block;top:var(--tb-arrow,50%);margin-top:-6px;left:-7px;border-right-color:transparent;border-top-color:transparent;}
.tuto-bubble[data-side="left"] .tb-arrow{display:block;top:var(--tb-arrow,50%);margin-top:-6px;right:-7px;border-left-color:transparent;border-bottom-color:transparent;}

/* ---------- célébration d'une phase finie ----------
   Une carte sous la barre du haut, pas une fenêtre : elle ne bloque
   rien et s'en va seule. */
.tuto-celebrate{
  position:fixed;left:0;right:0;margin:0 auto;top:calc(var(--hud-h) + var(--ribbon-h) + 14px);z-index:840;
  box-sizing:border-box;width:min(640px, calc(100vw - 24px));
  /* v0.92.5 : la DA des fenêtres du jeu (demande du 11/11/2026, « pas
     dans le design du jeu, fond bleu ») : quatre coins coupés, noir
     fumé, liseré ambre fin, onglet de titre ; ni pastille lumineuse, ni
     étincelles, ni halo */
  --rf-cut:12px;--pn-c:var(--rf-amber);
  isolation:isolate;padding:0 0 12px;
  filter:drop-shadow(0 14px 30px rgba(0,0,0,.6));
  animation:tcbIn .35s ease-out both;
}
.tuto-celebrate::before{
  content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:var(--rf-bg);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);clip-path:var(--rf-oct);
}
.tuto-celebrate::after{
  content:'';position:absolute;inset:0;z-index:5;pointer-events:none;
  background:color-mix(in srgb, var(--rf-amber) 70%, transparent);clip-path:var(--rf-ring);
}
@keyframes tcbIn{from{opacity:0;transform:translateY(-8px);}to{opacity:1;transform:none;}}
.tcb-head{display:flex;margin:0 0 10px;border-bottom:1px solid var(--rf-line-soft);}
.tcb-head .pn-tab{min-height:32px;}
.tcb-main{display:flex;gap:14px;align-items:flex-start;padding:0 14px;}
.tcb-art{
  --rf-cut:8px;flex:none;width:132px;aspect-ratio:3/2;overflow:hidden;
  clip-path:polygon(var(--rf-cut) 0, 100% 0, 100% calc(100% - var(--rf-cut)), calc(100% - var(--rf-cut)) 100%, 0 100%, 0 var(--rf-cut));
  background:#08121D;
}
.tcb-art-img{width:100%;height:100%;object-fit:cover;display:block;}
.tcb-text{flex:1 1 auto;min-width:0;}
.tcb-title{font-family:var(--font-head);font-weight:700;font-size:1.08rem;letter-spacing:.02em;color:var(--rf-text-hi);}
.tcb-text p{margin:4px 0 0;font-family:var(--font-head);font-size:.86rem;line-height:1.45;color:var(--rf-text);}
.tcb-text p.tcb-next{margin-top:8px;font-size:.8rem;font-weight:600;color:var(--rf-amber);}
.tcb-foot{display:flex;justify-content:flex-end;padding:10px 14px 0;}
.tuto-celebrate .btn{flex:none;position:relative;z-index:1;}
@media(max-width:560px){
  .tcb-main{flex-direction:column;}
  .tcb-art{width:100%;aspect-ratio:3/1;}
  .tuto-celebrate .btn{width:100%;justify-content:center;}
}

/* ---------- graduation (fenêtre du jeu, habillage doré .modal-celebrate) ---------- */
.tuto-grad{position:relative;padding:calc(14px*var(--scale)) calc(22px*var(--scale));text-align:center;}
.tg-spark{
  position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(circle 3px at 14% 12%, #fff, transparent),
    radial-gradient(circle 3px at 32% 5%, var(--amber), transparent),
    radial-gradient(circle 3px at 68% 7%, #fff, transparent),
    radial-gradient(circle 3px at 86% 14%, var(--amber), transparent),
    radial-gradient(circle 3px at 50% 2%, #fff, transparent);
  animation:dv2Sparkle 1.1s ease-out both;
}
.tg-badge{
  position:relative;width:44px;height:44px;margin:0 auto 8px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:1.2rem;color:#1a1305;background:radial-gradient(circle at 30% 30%, var(--amber), var(--amber-dim));
  box-shadow:0 0 26px rgba(245,158,11,.5);animation:dv2Pop .6s cubic-bezier(.34,1.56,.64,1) both;
}
.tuto-grad h2{position:relative;margin:0 0 6px;font-family:var(--font-head);font-size:1.25rem;color:var(--ink-1);}
.tg-recap{margin:0 0 4px;font-size:.84rem;line-height:1.45;color:var(--amber);}
.tg-intro{margin:0 0 10px;font-size:.84rem;line-height:1.45;color:var(--ink-2);}
.tuto-grad .sp-list-label{text-align:left;}
.tg-routes{display:flex;flex-direction:column;gap:6px;text-align:left;}
/* une piste : un bouton entier, habillé à la charte (aucun style du navigateur) */
.tg-route{
  display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:10px;margin:0;
  background:rgba(255,255,255,.03);border:1px solid var(--line);
  font:inherit;color:inherit;text-align:left;cursor:pointer;transition:border-color .15s, background .15s;
}
.tg-route:hover{border-color:var(--amber);background:rgba(245,158,11,.07);}
.tg-route:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;}
.tg-go{
  flex:none;align-self:center;font-family:var(--font-mono);font-size:.62rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--amber);white-space:nowrap;
}
.tg-ic{
  flex:none;width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  background:rgba(245,158,11,.1);color:var(--amber);
}
.tg-ic svg{width:16px;height:16px;}
.tg-route-text{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px;}
.tg-route-text b{font-size:.84rem;color:var(--ink-1);}
.tg-route-text span{font-size:.76rem;line-height:1.4;color:var(--ink-2);}
.tg-close{width:100%;justify-content:center;margin-top:12px;}


/* ---------- libellé d'un bouton au bord droit d'une carte (v0.87.1.1) ----------
   Le bouton Affecter touche le bord droit de sa carte, qui coupe ce qui
   dépasse : son libellé « ▼ » se cale à droite au lieu de se centrer
   (css/05-screens.css). Sans animation, il reste calé à droite. */
.bld-staff-btn.tuto-glow::before, #modal-close.tuto-glow::before{left:auto;right:0;transform:none;animation-name:tutoBounceRight;}
@keyframes tutoBounceRight{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-9px);}
}

/* ---------- endroit amené à l'écran, libellé sans place au-dessus (v0.88.0) ----------
   Le guide amène son endroit à l'écran (scrollIntoView) : la marge garde
   la place du libellé « ▼ » au-dessus de lui. Un endroit collé sous la
   barre du haut (un onglet) n'a pas cette place : le libellé passe
   dessous, flèche vers le haut (.tuto-label-low, posée par le script). */
.tuto-glow{scroll-margin:calc(44px*var(--scale)) 10px 10px;}
.tuto-glow.tuto-label-low::before{content:"▲ " attr(data-tuto-label);top:auto;bottom:calc(-1*(36px*var(--scale)));}
/* une carte de bâtiment coupe ce qui dépasse d'elle : posé au-dessus ou
   dessous, son libellé ne se voyait pas. Il se pose dedans, en haut. */
/* v0.89.2.2 : la carte de bâtiment coupe ce qui dépasse (overflow:hidden) :
   un halo porté par son ::after serait invisible. Elle garde la pulsation
   par l'ombre, redessinée à chaque image (css/05-screens.css). */
.bld-card.tuto-glow{animation:tutoPulseShadow 1.6s ease-in-out infinite;}
.bld-card.tuto-glow::after{display:none;}
.bld-card.tuto-glow::before, .bld-card.tuto-glow.tuto-label-low::before{content:"▼ " attr(data-tuto-label);top:calc(8px*var(--scale));bottom:auto;z-index:3;}
/* la carte « Phase terminée » se ferme d'un clic, où qu'il tombe */
.tuto-celebrate{cursor:pointer;}
/* note du Compas sur le déficit de Scrip : une ligne discrète */
.tc-scrip{padding:calc(4px*var(--scale)) calc(8px*var(--scale));border-radius:8px;background:rgba(148,163,184,.08);font-size:.72rem;}

/* v0.89.7.9 : Rurik ne parle plus que dans sa boîte de dialogue
   (css/34-rurik.css) : plus de figure dans le Compas, sur la carte de
   phase ni dans la graduation. */

/* ---------- effets réduits : aucune animation du tutoriel ----------
   Deux déclencheurs, mêmes règles : le réglage du jeu « Effets réduits »
   (html.fx-reduced) et le réglage du système (prefers-reduced-motion).
   Tout reste lisible et à sa place, sans mouvement. */
html.fx-reduced .tuto-glow, html.fx-reduced .tuto-glow::before, html.fx-reduced .tuto-glow::after, html.fx-reduced .bld-card.tuto-glow, html.fx-reduced .tc-pip.active::after,
html.fx-reduced .tuto-bubble, html.fx-reduced .tuto-celebrate, html.fx-reduced .tg-badge,
html.fx-reduced #phase-panel .dv2-mission-check{animation:none !important;}
html.fx-reduced .tg-spark{display:none;}
html.fx-reduced .tuto-bubble, html.fx-reduced .tc-pip, html.fx-reduced .tg-route{transition:none;}
@media (prefers-reduced-motion: reduce){
  .tuto-glow, .tuto-glow::before, .tuto-glow::after, .bld-card.tuto-glow, .tc-pip.active::after,
  .tuto-bubble, .tuto-celebrate, .tg-badge,
  #phase-panel .dv2-mission-check{animation:none !important;}
  .tg-spark{display:none;}
  .tuto-bubble, .tc-pip, .tg-route{transition:none;}
}

/* ---------- repère du tutoriel (v0.92.0.1) ----------
   Posé au-dessus de la page par js/04e-tutorial-guide.js (tutoMarkShow),
   il ne capte aucun clic et n'est jamais rogné par un conteneur. Dans les
   couleurs des boutons du jeu (ambre --rf-hero, texte sombre) : liseré
   ambre, coins de visée, libellé en forme de bouton (coins coupés), et
   trois chevrons de chaque côté qui s'allument l'un après l'autre vers
   l'endroit (demande de l'utilisateur : « style <<< >>> »). Un côté sans
   place à l'écran perd ses chevrons (.no-top...). La place prise autour
   de l'élément est tenue par AG.TUTO_MARK_REACH : la changer avec les
   tailles et écarts ci-dessous. */
#tuto-mark{
  --tm-c:var(--rf-hero, #F59E0B);
  --tm-hi:var(--rf-hero-hi, #FBBF24);
  position:fixed;left:0;top:0;z-index:825;pointer-events:none;box-sizing:border-box;
  border:2px solid var(--tm-c);border-radius:2px;will-change:transform;
  box-shadow:0 0 0 1px rgba(26,16,3,.75), 0 0 22px 3px rgba(245,158,11,.3), inset 0 0 14px rgba(245,158,11,.18);
}
#tuto-mark[hidden]{display:none;}
#tuto-mark.in-modal{z-index:856;}
/* coins de visée, plus clairs que le liseré */
#tuto-mark::before{
  content:"";position:absolute;inset:-7px;
  background:
    linear-gradient(var(--tm-hi), var(--tm-hi)) top left / 16px 3px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) top left / 3px 16px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) top right / 16px 3px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) top right / 3px 16px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) bottom left / 16px 3px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) bottom left / 3px 16px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) bottom right / 16px 3px no-repeat,
    linear-gradient(var(--tm-hi), var(--tm-hi)) bottom right / 3px 16px no-repeat;
}
/* une onde discrète qui part du liseré */
#tuto-mark::after{
  content:"";position:absolute;inset:-2px;border:2px solid var(--tm-c);border-radius:2px;
  opacity:0;animation:tutoMarkRing 1.8s ease-out infinite;
}
@keyframes tutoMarkRing{0%{opacity:.6;transform:scale(1);}100%{opacity:0;transform:scale(1.1);}}
#tuto-mark .tm-label{
  position:absolute;left:50%;bottom:calc(100% + 74px);transform:translateX(-50%);
  background:var(--tm-c);color:var(--rf-hero-ink, #1A1003);
  font-family:var(--font-head);font-weight:700;font-size:.85rem;letter-spacing:.08em;text-transform:uppercase;
  white-space:nowrap;padding:5px 16px;
  clip-path:polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
#tuto-mark .tm-label:empty{display:none;}
#tuto-mark.no-top .tm-label{bottom:auto;top:calc(100% + 74px);}
#tuto-mark.no-top.no-bottom .tm-label{top:50%;left:calc(100% + 74px);transform:translateY(-50%);}
#tuto-mark .tm-arrow{position:absolute;width:56px;height:56px;}
#tuto-mark .tm-arrow svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 0 1.5px rgba(10,6,0,.95)) drop-shadow(0 0 6px rgba(245,158,11,.35));}
#tuto-mark .tm-arrow polyline{
  fill:none;stroke:var(--tm-c);stroke-width:5.5;stroke-linecap:square;stroke-linejoin:miter;
  opacity:.5;animation:tmChevron 1.2s linear infinite;
}
/* du plus loin au plus près de l'endroit */
#tuto-mark .tm-arrow polyline:nth-child(2){animation-delay:.4s;}
#tuto-mark .tm-arrow polyline:nth-child(3){animation-delay:.8s;}
@keyframes tmChevron{0%, 45%, 100%{opacity:.5;} 15%{opacity:1;}}
#tuto-mark .tm-top{left:50%;bottom:calc(100% + 10px);margin-left:-28px;}
#tuto-mark .tm-bottom{left:50%;top:calc(100% + 10px);margin-left:-28px;}
#tuto-mark .tm-bottom svg{transform:rotate(180deg);}
#tuto-mark .tm-left{top:50%;right:calc(100% + 10px);margin-top:-28px;}
#tuto-mark .tm-left svg{transform:rotate(-90deg);}
#tuto-mark .tm-right{top:50%;left:calc(100% + 10px);margin-top:-28px;}
#tuto-mark .tm-right svg{transform:rotate(90deg);}
#tuto-mark.no-top .tm-top, #tuto-mark.no-bottom .tm-bottom, #tuto-mark.no-left .tm-left, #tuto-mark.no-right .tm-right{display:none;}
/* le repère porte le libellé : celui posé sur l'élément ferait doublon */
html.tuto-marked .tuto-glow::before{display:none !important;}
html.fx-reduced #tuto-mark::after{animation:none !important;}
html.fx-reduced #tuto-mark .tm-arrow polyline{animation:none !important;opacity:1;}
@media (prefers-reduced-motion: reduce){
  #tuto-mark::after{animation:none !important;}
  #tuto-mark .tm-arrow polyline{animation:none !important;opacity:1;}
}
