/* The Last — le bouton de compte et son panneau (assets/compte.js), au bout de la barre de l'en-tête (.top-outils) de
   chaque page. S'appuie sur nether.css (--u, --notch, .btn, .pxl, .sr, les crochets --svg-crochets-*). Le bouton se
   comporte comme un lien de la barre sans en porter la classe (les scripts de page réécrivent chaque « .top .tbtn » en
   police du jeu, et videraient la tête) : la tête posée dans la barre, sans boîte, et des crochets-viseurs au survol. */

/* --cpt-b : la hauteur de la cible, --cpt-w sa largeur (la même, sauf sur les plus petits écrans) ;
   --cpt-chain-r : la chaîne de droite du panneau tombe au milieu du bouton */
.cpt { position: relative; flex: none; --cpt-soul: #6fe6f2; --cpt-b: 36px; --cpt-w: var(--cpt-b); --cpt-s: 22px; --cpt-chain-r: calc(var(--cpt-w) / 2 - 2px); }

/* ---------- le bouton : une cible nue, le cadre carré dedans ---------- */
.cpt-btn {
  position: relative; display: grid; place-items: center; flex: none; width: var(--cpt-w); height: var(--cpt-b); padding: 0; margin: 0;
  background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  border: 0 solid transparent; border-image: var(--bt-vide) 6 / 6px / 4px stretch; transition: border-image-outset 80ms steps(2);
}
.cpt-frame { position: relative; display: grid; place-items: center; width: var(--cpt-w); height: var(--cpt-b); pointer-events: none; }
.cpt-btn:hover { border-image-source: var(--svg-crochets-or); border-image-outset: 0px; }
.cpt-btn:active .cpt-frame { transform: translateY(2px); }
/* le focus clavier : l'anneau cyan commun (nether.css) ; panneau ouvert : des crochets cyan ; connecté : une pastille cyan */
.cpt.ouvert .cpt-btn { border-image-source: var(--svg-crochets-cyan); border-image-outset: 0px; }
.cpt-btn.est-connecte .cpt-frame::after {
  content: ""; position: absolute; right: 4px; top: 4px; width: 4px; height: 4px; background: var(--soul); box-shadow: 0 0 0 2px #060304;
}
.cpt-btn .cpt-head { --s: var(--cpt-s); }

/* ---------- la tête : un cube CSS, fixe, de trois quarts ---------- */
.cpt-head { position: relative; display: block; width: var(--s); height: var(--s); perspective: calc(var(--s) * 7); flex: none; }
.cpt-cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-6deg) rotateY(-18deg); }
.cpt-f {
  position: absolute; inset: -.25px; background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
  backface-visibility: hidden;
}
.f-front  { transform: translateZ(calc(var(--s) / 2)); }
.f-back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f-right  { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(.78); }
.f-left   { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(.78); }
.f-top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(1.08); }
.f-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(.55); }

/* les yeux de braise du vagabond (invité) : ils brillent, clignent, et s'avivent quand le panneau s'ouvre */
.cpt-eye {
  position: absolute; width: 12.5%; height: 12.5%; background: #ffc069;
  box-shadow: 0 0 calc(var(--s) * .14) calc(var(--s) * .02) rgb(255 107 44 / .95);
  transform-origin: 50% 60%; transition: transform .06s, background-color .06s, box-shadow .25s;
}
.cpt-eye.ferme { transform: scaleY(.18); background: #ff6b2c; box-shadow: none; }
.cpt-eye.vif { background: #ffe0a8; box-shadow: 0 0 calc(var(--s) * .3) calc(var(--s) * .06) rgb(255 120 50 / 1); }

/* ---------- l'enseigne : deux chaînes, une lanterne d'âme, la plaque ---------- */
.cpt-panel { position: absolute; right: 0; top: 100%; width: 368px; z-index: 2; }
.cpt-sign { position: relative; padding-top: 16px; transform-origin: 50% 0; filter: drop-shadow(0 14px 18px rgb(0 0 0 / .55)); }
.cpt-panel.balance .cpt-sign { animation: cpt-balance .9s cubic-bezier(.3, .7, .3, 1) both; }
/* à la fermeture, le miroir de l'arrivée sans son balancement : l'enseigne remonte en s'inclinant et s'efface, aussi vite
   qu'elle était descendue (l'arrivée est en place vers 0,15 s, le reste n'est que le balancement) ; compte.js cache le
   panneau quand elle finit */
.cpt-panel.retour { pointer-events: none; }
.cpt-panel.retour .cpt-sign { animation: cpt-depart .25s ease-in both; }
@keyframes cpt-depart { to { transform: translateY(-10px) rotate(-3.5deg); opacity: 0; } }
@keyframes cpt-balance {
  0%   { transform: translateY(-10px) rotate(-3.5deg); opacity: 0; }
  22%  { opacity: 1; }
  40%  { transform: translateY(0) rotate(2deg); }
  65%  { transform: rotate(-.9deg); }
  85%  { transform: rotate(.35deg); }
  100% { transform: none; }
}
.cpt-chain {
  position: absolute; top: -2px; width: 4px; height: 21px; z-index: 1;
  background: repeating-linear-gradient(#9aa0ad 0 2px, #4a4e58 2px 4px, #1d1f24 4px 6px, #6f7480 6px 8px);
  box-shadow: 0 0 0 1px #050304;
  -webkit-mask: linear-gradient(transparent, #000 45%); mask: linear-gradient(transparent, #000 45%);
}
.cpt-chain.l { left: 22px; }
.cpt-chain.r { right: var(--cpt-chain-r); }
.cpt-plaque {
  position: relative; overflow: hidden;
  background: linear-gradient(rgb(18 11 12 / .9), rgb(11 7 8 / .95)), var(--cpt-pierre, none) 0 0 / 48px auto, #130c0d;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 var(--u) #050304, inset calc(var(--u) * 2) calc(var(--u) * 2) 0 #4f3a35, inset calc(var(--u) * -2) calc(var(--u) * -2) 0 #0b0707;
  clip-path: var(--notch);
}
/* la lumière de la lanterne, sur le coin haut droit de la plaque */
.cpt-lueur {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(150px 120px at calc(100% - 21px) 30px, rgb(111 230 242 / .22), rgb(111 230 242 / .07) 55%, transparent 78%),
    linear-gradient(200deg, rgb(111 230 242 / .07), transparent 45%);
  animation: cpt-flamme 4.6s ease-in-out infinite;
}
@keyframes cpt-flamme { 0%, 100% { opacity: 1; } 18% { opacity: .82; } 31% { opacity: .96; } 52% { opacity: .78; } 70% { opacity: .93; } }
.cpt-lant { position: absolute; z-index: 2; right: calc(var(--cpt-chain-r) - 22px); top: 14px; width: 48px; pointer-events: none; }
.cpt-lant-ch { display: block; width: 4px; height: 4px; margin: 0 auto; background: #4a4e58; box-shadow: 0 0 0 1px #050304; }
.cpt-lant-i {
  display: block; width: 48px; height: 48px; margin-top: -9px; background: center / 48px no-repeat; image-rendering: pixelated;
  filter: drop-shadow(0 0 5px rgb(111 230 242 / .75)) drop-shadow(0 0 14px rgb(111 230 242 / .35));
}

/* ---------- contenu, sobre ---------- */
.cpt-in { position: relative; padding: 20px 20px 16px; image-rendering: auto; }
.cpt-in > :first-child { margin-right: 30px; }
.cpt-in > .cpt-id:first-child { margin-right: 0; }
.cpt-titre { margin: 2px 0 12px; color: #ffe9c9; font-size: inherit; }
.cpt-titre .pxl { --fs: 2px; flex-wrap: wrap; row-gap: 6px; }
.cpt-titre.sans-px { font: 700 15px/1.3 "Sora", sans-serif; letter-spacing: .04em; }
.cpt-plus { margin: 0 0 14px; color: #dccfc5; font-size: 14.5px; line-height: 1.5; }
.cpt-wait {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px;
  color: #ffd9a0; font-size: 14px; font-weight: 600; line-height: 1.4;
  background: rgb(5 3 4 / .6); box-shadow: inset 0 0 0 2px rgb(255 181 71 / .3);
}
.cpt-wait-i { flex: none; width: 8px; height: 8px; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: blink 1.6s step-end infinite; }
.cpt-go { margin: 0 0 14px; }
.cpt-main { display: flex; width: 100%; }
.cpt-how { margin: 0; padding: 12px 14px; color: #dccfc5; font-size: 13.5px; line-height: 1.5; background: rgb(5 3 4 / .6); box-shadow: inset 0 0 0 2px rgb(111 230 242 / .22); }
.cpt-how b { color: #f6efe8; font-weight: 600; }
.cpt-dl { margin: 8px 0 0; color: #cbbcb3; font-size: 13px; }
.cpt-trust { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; color: #dccfc5; font-size: 13px; line-height: 1.4; }
.cpt-picto { flex: none; width: 16px; height: 16px; color: var(--gold); }
.cpt-why { display: inline-block; padding: 4px 0; color: #c9b7a8; font-size: 13px; }
.cpt-why:hover { color: var(--gold); }

/* connecté : l'identité (variante C), puis la liste (variante A : une ligne, l'objet du jeu et le libellé en gras) */
.cpt-id { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 2px solid rgb(255 255 255 / .06); }
.cpt-slot { flex: none; display: block; padding: 4px; background: #0d0809; box-shadow: inset 2px 2px 0 #050304, inset -2px -2px 0 #3a2a27, 0 0 18px rgb(111 230 242 / .12); }
.cpt-face { display: block; width: 48px; height: 48px; image-rendering: pixelated; }
.cpt-qui { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cpt-pseudo { margin: 0; color: var(--gold); }
.cpt-pseudo .pxl { --fs: 3px; }
.cpt-pseudo.sans-px { font: 700 20px/1.2 "Sora", sans-serif; }
/* « Compte Minecraft vérifié » : le vert du jeu (§a, #55FF55) et son ombre (le quart de la couleur, comme le jeu) */
.cpt-verif { display: flex; align-items: center; gap: 8px; margin: 0; color: #55ff55; }
.cpt-verif > span { min-width: 0; }
.cpt-verif .pxl { --fs: 1.5px; flex-wrap: wrap; row-gap: 4px; }
.cpt-verif .pxl svg { filter: drop-shadow(var(--fs) var(--fs) 0 #153f15); }
.cpt-verif .sans-px { font-size: 13px; font-weight: 700; }
.cpt-coche { flex: none; width: 14px; height: 12px; image-rendering: pixelated; filter: drop-shadow(1.5px 1.5px 0 #153f15); }

.cpt-liste { list-style: none; margin: 8px -10px 0; padding: 0; }
.cpt-ent {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; margin: 0; padding: 4px 10px;
  border: 0; background: none; cursor: pointer; text-align: left; text-decoration: none;
  color: #f2e6dc; font: 600 14px/1.3 "Inter", system-ui, sans-serif;
}
.cpt-ent:hover, .cpt-ent:focus-visible { background: rgb(255 107 44 / .11); color: #fff; }
.cpt-ent:hover::before, .cpt-ent:focus-visible::before, .cpt-ent[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--ember); }
.cpt-ent:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.cpt-ent[disabled] { cursor: progress; opacity: .7; }
.cpt-ic { flex: none; width: 32px; height: 32px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.cpt-sep { height: 2px; margin: 6px 0; border: 0; background: rgb(255 255 255 / .06); }
.cpt-bas { margin: 0 -10px; }
.cpt-sortie { color: #d8c7bb; }
.cpt-err { margin: 8px 0 0; color: #ffb3a0; font-size: 13px; line-height: 1.45; }

/* ---------- la barre sur téléphone : le logo laisse sa place (Accueil, ou le haut de page, mène au même endroit) ----------
   Le panneau passe en position fixe, à 8 px des bords ; la chaîne suit le milieu du bouton, qui finit à --tp du bord
   (la marge de l'en-tête, nether.css). Les tailles de la barre elle-même sont dans nether.css. */
@media (max-width: 480px) {
  .top.a-compte .brand { display: none; }
  .cpt { --cpt-chain-r: calc(var(--tp, 10px) - 10px + var(--cpt-w) / 2); --cpt-s: 19px; }
  .cpt-panel { position: fixed; top: 48px; left: 8px; right: 8px; width: auto; }
  .cpt-in { padding: 18px 16px 14px; }
  .cpt-liste, .cpt-bas { margin-left: -6px; margin-right: -6px; }
}
@media (max-width: 420px) { .cpt { --cpt-s: 18px; } }
@media (max-width: 360px) { .cpt-panel { top: 47px; } }
/* écran tactile : les boutons de la barre font 44 px de haut (nether.css) ; le cadre reste carré, 44 x 44, et c'est la cible */
@media (pointer: coarse) {
  .cpt { --cpt-b: 44px; --cpt-s: 23px; }
  .cpt-panel { top: 100%; }
  .cpt-ent { min-height: 44px; }
  .cpt-why, .cpt-dl a { display: inline-flex; align-items: center; min-height: 44px; }
  .cpt-main { min-height: 44px; }
}
@media (pointer: coarse) and (max-width: 480px) { .cpt-panel { top: 54px; } }
@media (pointer: coarse) and (max-width: 345px) { .cpt { --cpt-w: 36px; } }      /* 36 × 44 : la barre tient à 320 px */
/* ordinateur : le compte est au bout de l'îlot (.top-outils, nether.css), après « Français · English » ; le panneau
   (368 px) est plus large que l'îlot (~300 px) : sa chaîne de gauche s'accroche sous l'îlot, pas dans le vide */
@media (min-width: 1024px) and (pointer: fine) {
  .top-outils .cpt { --cpt-b: 44px; --cpt-s: 24px; }
  .top-outils .cpt-chain.l { left: 108px; }
}
@media (min-width: 1360px) and (pointer: fine) { .top-outils .cpt { --cpt-s: 26px; } }
@media (min-width: 2200px) and (pointer: fine) { .top-outils .cpt { --cpt-b: 48px; --cpt-s: 30px; } }

@media (prefers-reduced-motion: reduce) {
  .cpt-panel.balance .cpt-sign, .cpt-panel.retour .cpt-sign, .cpt-lueur, .cpt-wait-i { animation: none; }
  .cpt-eye, .cpt-btn { transition: none; }
  .cpt-btn:active .cpt-frame { transform: none; }
}
