/* =============================================================================
   AUTRES PANNEAUX, habillage de la home (home-arena.css et voisins) : l'invitation au tutoriel,
   COMPTE, REJOINDRE UN SALON, DÉFIS, l'ouverture de la boutique et la fiche des
   commandes. La plage floutée sous le voile du thème, des blocs aux couleurs du thème, la menthe
   pour l'action principale, des pastilles du thème pour le reste. Seul l'habillage change :
   structure et comportement restent ceux de index-arcade.pug, arcade-home.js, account-arcade.css,
   challenges-arcade.css et support-corner.css. Les préfixes à id passent devant
   l'habillage commun des contrôles (game-controls.css).
   ============================================================================= */

/* ---- La plage en fond : le menu derrière s'efface, la scène floutée reste ---- */
.arcade-home-body .arcade-cabinet:has(:is(#arcade-panel-join, #arcade-panel-challenges, #arcade-panel-shop-launch, #arcade-panel-prestige):not([hidden])) :is(
  .arcade-menu-nav, .home-player-stage, .home-title-header, .arcade-hud-account, .arcade-challenges,
  .arcade-attract .home-bottom-bar > .language-switcher, .arcade-selection-hint
) { visibility: hidden; }
/* L'invitation passe devant l'écran titre : le logo, PRESS START et ses drapeaux s'effacent. */
.arcade-home-body .arcade-cabinet:has(.arcade-tutorial-invite:not([hidden])) :is(
  .home-title-header, .arcade-center, .arcade-attract .home-bottom-bar > .language-switcher
) { visibility: hidden; }

body.arcade-home-body .arcade-cabinet :is(#arcade-panel-join, #arcade-panel-challenges, #arcade-panel-shop-launch, #arcade-panel-prestige, .arcade-tutorial-invite) {
  background: var(--panel-veil); color: var(--home-white);

  /* En-tête : titre et logo comme la home, Retour (ou Plus tard) en pastille du thème. */
  .arcade-page-header { border-bottom: 0; padding-bottom: 0; }
  .arcade-page-header .arcade-page-title {
    color: var(--home-white); font: clamp(22px, 4.4cqh, 38px)/1 var(--game-display-font); letter-spacing: .02em;
    -webkit-text-stroke: .16em var(--home-outline); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--home-outline);
  }
  .arcade-page-header .game-brand {
    filter: drop-shadow(2px 0 0 var(--home-outline)) drop-shadow(-2px 0 0 var(--home-outline))
      drop-shadow(0 2px 0 var(--home-outline)) drop-shadow(0 -2px 0 var(--home-outline)) drop-shadow(0 .5cqh 0 var(--home-outline));
  }
  .arcade-page-header .arcade-page-back {
    display: inline-flex; align-items: center; gap: .8cqw;
    min-height: clamp(36px, 5.6cqh, 44px); padding: 0 1.6cqw; box-sizing: border-box;
    border: var(--btn-edge) solid var(--slab-edge); border-radius: 999px;
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box;
    box-shadow: inset 0 .35cqh 0 rgb(255 255 255 / .3), inset 0 -.7cqh 0 var(--slab-base); --drop-soft: var(--btn-soft);
    color: var(--home-white); font: clamp(14px, 2.4cqh, 20px)/1 var(--game-display-font); letter-spacing: .03em; text-transform: uppercase;
    filter: var(--drop-soft) var(--fx, );
    &::after { content: none; }
    kbd { color: var(--home-steel); font-size: 12px; }
    &:is(:hover, :focus-visible, .is-selected) { --fx: brightness(1.12); --drop-soft: var(--btn-soft-hover); background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box; color: var(--home-white); outline: 0; transform: none; translate: 0 -2px; }
    &:active { translate: 0 2px; --drop-soft: var(--btn-soft-press); }
  }
}

/* Lettres blanches contourées sur la plage : titres, libellés et consignes hors des blocs. */
body.arcade-home-body .arcade-cabinet :is(
  .arcade-tutorial-invite-title, #arcade-panel-join .join-lobby-label, #arcade-panel-account .account-field-label,
  #arcade-panel-account .account-player-name
) {
  color: var(--home-white); font-family: var(--game-display-font); font-style: normal; font-weight: 400;
  -webkit-text-stroke: .16em var(--home-outline); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--home-outline);
}

/* ---- L'action principale : le bouton menthe de JOUER, partout ----
   game-controls.css les habille aussi (états compris : il les laisse à cet habillage). */
body.arcade-home-body :is(
  .arcade-cabinet :is(#arcade-panel-join .join-lobby-submit, .arcade-tutorial-invite .arcade-tutorial-invite-start,
    #arcade-panel-account .account-submit, #arcade-panel-shop-launch .shop-launch-go,
    #arcade-panel-prestige .prestige-reveal-wear)
) {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: clamp(44px, 7.6cqh, 60px); padding: 0 clamp(18px, 2.4cqw, 32px); box-sizing: border-box;
  border: var(--btn-edge) solid var(--mint-ink); border-radius: 1cqh;
  background: linear-gradient(180deg, var(--mint-top), var(--mint-bottom)) padding-box;
  box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / .6), inset 0 -1.1cqh 0 var(--mint-base); --drop-soft: var(--btn-soft);
  color: var(--home-outline); font: clamp(18px, 3.2cqh, 26px)/1 var(--game-display-font); letter-spacing: .03em; text-transform: uppercase;
  filter: var(--drop-soft) var(--fx, );
  transition: translate 160ms cubic-bezier(0.22, 1, 0.36, 1), filter 120ms ease-out;
  &::before, &::after { content: none; }
  &:is(:hover, .is-selected, :focus-visible):not(:disabled) {
    background: linear-gradient(180deg, var(--mint-top), var(--mint-bottom)) padding-box; color: var(--home-outline);
    outline: 0; translate: 0 -2px; --fx: brightness(1.05); --drop-soft: var(--btn-soft-hover);
  }
  &:active:not(:disabled) {
    transform: none; translate: 0 2px; --drop-soft: var(--btn-soft-press);
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / .6), inset 0 -.6cqh 0 var(--mint-base);
  }
  @media (prefers-reduced-motion: reduce) { transition: none; }
}

/* ======================================================= PREMIÈRE PARTIE ? */
/* Devant l'écran titre : le voile du thème, sans flou. */
body.arcade-home-body .arcade-cabinet .arcade-tutorial-invite { backdrop-filter: none; -webkit-backdrop-filter: none; }
/* Les 8 étapes : une liste numérotée à plat (puce menthe + nom), pas des boutons. */
body.arcade-home-body .arcade-cabinet .arcade-tutorial-invite {
  .arcade-tutorial-invite-title { font-size: clamp(40px, 9cqh, 76px); line-height: 1; letter-spacing: .02em; }
  /* Deux rangées de quatre : les pastilles tiennent dans l'écran à toutes les tailles. */
  .arcade-tutorial-invite-steps { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .arcade-tutorial-invite-steps li {
    gap: .5em; padding: 0;
    border: 0; border-radius: 0; background: none; box-shadow: none; filter: none;
    color: var(--screen-ink); font: clamp(14px, 2.4cqh, 20px)/1 var(--game-display-font); white-space: nowrap;
  }
  .arcade-tutorial-invite-steps li::before {
    width: 1.4em; height: 1.4em; border-radius: 50%;
    background: var(--mint-bottom); color: var(--home-outline); font: .8em/1 var(--game-display-font);
  }
  .arcade-tutorial-invite-start { min-width: min(100%, 300px); font-size: clamp(22px, 4cqh, 32px); }
}
/* Les drapeaux de l'en-tête : la pastille de la home (home-arena.css). */
body.arcade-home-body .arcade-cabinet .arcade-tutorial-invite-lead > .language-switcher {
  gap: 1.1cqw; height: 4.4cqh; padding: 0 .9cqw; box-sizing: border-box;
  border: var(--btn-edge) solid var(--home-outline); border-radius: 999px;
  background: var(--home-panel); filter: var(--btn-soft);
}
body.arcade-home-body .arcade-cabinet #arcade-main .arcade-tutorial-invite-lead > .language-switcher button {
  width: auto; height: auto; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 3px;
  background: none; box-shadow: none; filter: none;
  transition: scale 160ms cubic-bezier(0.22, 1, 0.36, 1);
  &::after { content: none; }
  &:is(:hover, :focus-visible, .is-selected) { scale: 1.12; outline: 0; background: none; }
  &[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--home-gold); }
  .language-flag { width: 2.8cqw; height: 2.1cqw; }
  @media (prefers-reduced-motion: reduce) { transition: none; }
}

/* ================================================================ COMPTE */
body.arcade-home-body .arcade-cabinet #arcade-panel-account {
  /* Les formulaires ne sont plus centrés : la bascule Connexion / Inscription reste à la même
     hauteur dans les trois vues (connexion, inscription, oubli), seul le bas du formulaire bouge. */
  .account-layout { align-items: start; flex: 1 1 auto; margin-block: 0; padding-top: calc(20px + 10cqh); }
  .account-preview { align-self: center; padding-bottom: 10cqh; }

  /* Connexion / Inscription : deux onglets dans une pastille du thème, l'actif en menthe. */
  .account-mode {
    display: inline-flex; flex-wrap: nowrap; gap: .4cqw; justify-self: start; width: auto;
    min-height: 0; padding: .5cqh .5cqw; box-sizing: border-box;
    border: var(--btn-edge) solid var(--slab-edge); border-radius: 999px;
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box;
    box-shadow: inset 0 .3cqh 0 rgb(255 255 255 / .25), inset 0 -.5cqh 0 var(--slab-base);
    filter: var(--btn-soft);
    &::after { content: none; }
    &:is(.is-selected, :focus-visible, :hover) { outline: 0; filter: var(--btn-soft-hover) brightness(1.08); }
  }
  .account-mode-option {
    padding: .7cqh 1.4cqw; border-radius: 999px;
    color: var(--home-steel); font: clamp(15px, 2.6cqh, 21px)/1 var(--game-display-font); letter-spacing: .03em;
  }
  .account-mode-option.is-active {
    background: linear-gradient(180deg, var(--mint-top), var(--mint-bottom));
    box-shadow: inset 0 -.4cqh 0 var(--mint-base); color: var(--home-outline);
  }
  .account-mode-option.is-active::before { content: none; }

  /* Champs : des blocs du thème, la saisie en lettres du bloc ; actif, le contour passe en menthe. */
  .account-field-label { font-size: clamp(14px, 2.4cqh, 19px); letter-spacing: .03em; text-transform: uppercase; }
  .account-field-entry {
    min-height: clamp(42px, 7.4cqh, 56px); padding: 0 1.2cqw; box-sizing: border-box;
    border: var(--btn-edge) solid var(--block-edge); border-radius: 1cqh;
    background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
    box-shadow: inset 0 .35cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.8cqh 0 var(--block-base);
    filter: var(--btn-soft);
    &::after { content: none; }
    &:focus-within { border-color: var(--mint-ink); background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box; }
  }
  .account-field-mark, .account-field-entry:focus-within .account-field-mark { color: var(--block-accent); font: clamp(20px, 3.4cqh, 26px)/1 var(--game-display-font); }
  /* Ce qu'on tape (email, mot de passe) se lit en Nunito, pas en capitales Bungee. */
  .account-field-entry input {
    color: var(--block-ink); caret-color: var(--block-accent);
    font: 700 20px/1.2 var(--game-text-font); letter-spacing: 0;
  }
  .account-field-entry input:-webkit-autofill {
    -webkit-text-fill-color: var(--block-ink); box-shadow: 0 0 0 40px var(--block-bottom) inset;
  }
  /* Erreur : une pastille corail. */
  .auth-screen-message {
    padding: 1cqh 1.2cqw; border: var(--btn-edge) solid #9c2f22; border-radius: 1cqh;
    background: #ffd6cd; box-shadow: none; color: #9c2f22; font: clamp(14px, 2.4cqh, 18px)/1.25 var(--game-display-font);
  }
  .account-submit { width: 100%; margin-top: .4cqh; }
  /* Mot de passe oublié : un lien discret sous le CTA, sans bord ; visé, il passe en encre. */
  .account-forgot {
    justify-self: center; min-height: 0; padding: .8cqh 1.4cqw;
    border: 0; border-radius: 8px; background: none; box-shadow: none; filter: none;
    color: var(--screen-muted); font: clamp(13px, 2.2cqh, 17px)/1 var(--game-display-font); letter-spacing: .02em;
    &::after { content: none; }
    &:is(.is-selected, :focus-visible, :hover) {
      background: none; color: var(--screen-ink); outline: 0; translate: none; filter: none;
      text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
    }
  }
  .account-forgot-lead { margin: -.6cqh 0 0; color: var(--screen-muted); font: 700 clamp(15px, 2.4cqh, 18px)/1.3 var(--game-text-font); }
  .account-forgot-lead[hidden] { display: none; }
}

/* ===================================================== REJOINDRE UN SALON */
body.arcade-home-body .arcade-cabinet #arcade-panel-join {
  /* Le formulaire prend la largeur des cinq cases : le bouton aussi, l'aide et l'erreur s'y plient
     (contain: inline-size, elles n'élargissent pas la colonne). L'erreur garde sa place, mais sous
     le bouton, pour qu'il reste près de l'aide. */
  .join-lobby { width: fit-content; max-width: 100%; gap: clamp(12px, 2.8cqh, 24px); }
  .join-lobby-hint, .join-lobby-message { justify-self: stretch; contain: inline-size; }
  .join-lobby-message { order: 1; }
  .join-lobby-submit { justify-self: stretch; }
  .join-lobby-label { font-size: clamp(18px, 3.4cqh, 28px); letter-spacing: .04em; text-transform: uppercase; }
  /* Cinq cases : des blocs du thème ; la case à remplir en menthe, une erreur en corail. */
  .join-lobby-cell {
    box-sizing: border-box;
    border: var(--btn-edge) solid var(--block-edge); border-radius: 1.2cqh;
    background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -1cqh 0 var(--block-base);
    color: var(--block-ink); font: clamp(30px, 6.4cqh, 54px)/1 var(--game-display-font); filter: var(--btn-soft);
  }
  .join-lobby-field:focus-within .join-lobby-cell { background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box; }
  .join-lobby-field:focus-within .join-lobby-cell.is-current {
    border-color: var(--mint-ink); background: linear-gradient(180deg, var(--mint-top), var(--mint-bottom)) padding-box;
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / .6), inset 0 -1cqh 0 var(--mint-base); color: var(--home-outline);
    translate: 0 -2px; filter: var(--btn-soft-hover);
  }
  .join-lobby.has-error .join-lobby-cell { border-color: #9c2f22; }
  .join-lobby-hint {
    color: var(--home-white); font: clamp(14px, 2.4cqh, 19px)/1.2 var(--game-display-font);
    text-shadow: 0 2px 0 var(--home-outline);
  }
  .join-lobby-message:not(:empty) {
    padding: .8cqh 1.4cqw; border: var(--btn-edge) solid #9c2f22; border-radius: 999px;
    background: #ffd6cd; color: #9c2f22; font: clamp(14px, 2.4cqh, 19px)/1.2 var(--game-display-font);
  }
}

/* ================================================================== DÉFIS */
/* Chaque défi prend la couleur de sa difficulté (data-tier, arcade-home.js) : facile en lagon, moyen en
   sable doré, difficile en corail. La couleur porte la puce du numéro, l'étiquette et la jauge ; la carte
   elle-même reste plate et sombre, à liseré fin. Réussi, tout passe en menthe. */
body.arcade-home-body .arcade-cabinet #arcade-panel-challenges {
  .challenge-objective { --tier: var(--screen-mint); --tier-ink: var(--home-outline); }
  .challenge-objective[data-tier='easy'] { --tier: #7fd0dc; }
  .challenge-objective[data-tier='medium'] { --tier: #f6cd72; }
  .challenge-objective[data-tier='hard'] { --tier: #ff9c88; }
  .challenge-objective.is-done { --tier: var(--screen-mint); }

  /* Le résumé du jour et l'échéance. */
  .challenges-summary { color: var(--screen-muted); font: clamp(13px, 2.4cqh, 18px)/1 var(--game-display-font); letter-spacing: .03em; text-shadow: none; }
  .challenges-summary strong {
    padding: .35em .8em; border-radius: 999px; background: color-mix(in srgb, var(--screen-mint) 18%, var(--screen-panel));
    color: var(--screen-mint);
  }
  .challenges-board { gap: 12px; }
  .challenge-objective {
    padding: 12px 20px;
    border: 1px solid var(--screen-line); border-radius: 12px;
    background: var(--screen-panel) padding-box; box-shadow: none;
  }
  .challenge-objective:last-child { border-bottom: 1px solid var(--screen-line); }
  .challenge-objective-number {
    display: grid; place-items: center; width: 5.6cqh; min-width: 0; height: 5.6cqh; box-sizing: border-box; border-radius: 50%;
    border: 0; background: var(--tier); box-shadow: inset 0 -.35cqh 0 color-mix(in srgb, var(--tier) 60%, #000);
    color: var(--tier-ink); font: clamp(15px, 2.8cqh, 22px)/1 var(--game-display-font);
  }
  .challenge-objective-number.is-done { font-size: clamp(14px, 2.4cqh, 20px); }
  /* The level in muted ink: its colour stays on the chip and the bar. */
  .challenge-objective-tier { color: var(--screen-muted); font: clamp(11px, 2cqh, 15px)/1 var(--game-display-font); letter-spacing: .03em; }
  .challenge-objective-label { color: var(--screen-ink); font: 800 clamp(16px, 3.2cqh, 25px)/1.1 var(--game-text-font); }
  .challenge-objective-bar { height: clamp(7px, 1.3cqh, 10px); border-radius: 4px; background: var(--screen-bg); mask-image: none; overflow: hidden; }
  .challenge-objective-bar i { border-radius: 4px; background: var(--tier); }
  .challenge-objective-count { color: var(--screen-muted); font: clamp(13px, 2.4cqh, 18px)/1 var(--game-display-font); }
  .challenge-objective-xp { color: var(--screen-accent); font: clamp(16px, 3.2cqh, 26px)/1 var(--game-display-font); }
  .challenge-objective-score .challenge-coins { font: clamp(15px, 3cqh, 24px)/1 var(--game-display-font); }
  .challenge-coins { color: var(--screen-accent); }
  /* Réussi : la carte en menthe, le libellé apaisé, VALIDÉ en menthe. */
  .challenge-objective.is-done .challenge-objective-count { color: var(--screen-mint); }
  .challenge-objective.is-done .challenge-objective-label { color: var(--screen-muted); }
  .challenge-objective.is-done :is(.challenge-objective-xp, .challenge-coins) { opacity: .6; }

  /* La série : un bloc plat, sept jours en pastilles dorées, le coffre au bout. */
  .challenges-chest {
    padding: 12px 20px; border: 1px solid var(--screen-line); border-radius: 12px;
    background: var(--screen-panel) padding-box; box-shadow: none;
  }
  /* The 64px pixel chest at 1:1 (half size on small screens), never at a blurry in-between scale. */
  .challenges-chest-icon { width: 64px; height: 64px; image-rendering: pixelated; filter: none; }
  @media (max-width: 760px), (max-height: 620px) { .challenges-chest-icon { width: 32px; height: 32px; } }
  .challenges-chest-label { color: var(--screen-muted); font: clamp(13px, 2.6cqh, 19px)/1 var(--game-display-font); }
  .challenges-chest-label > span:first-child { color: var(--screen-ink); }
  .challenges-chest-next { color: var(--screen-muted); font-family: var(--game-display-font); }
  .challenges-chest-days i { height: clamp(9px, 1.8cqh, 14px); border-radius: 4px; background: var(--screen-bg); }
  .challenges-chest-days .is-done { background: var(--screen-accent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--screen-accent) 62%, #000); }
  .challenges-chest-reward { color: var(--screen-ink); font-family: var(--game-display-font); }
  .challenges-chest-reward strong { color: var(--screen-accent); }
}

/* ================================================== OUVERTURE DE LA BOUTIQUE */
body.arcade-home-body .arcade-cabinet #arcade-panel-shop-launch {
  /* Le cadeau dans un bloc du thème, au centre de la plage. */
  .arcade-panel-body.shop-launch {
    justify-self: center; align-self: center; width: min(100%, 560px); margin: auto;
    padding: 3cqh 3cqw; box-sizing: border-box;
    border: 3px solid var(--home-outline); border-radius: 2cqh;
    background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.9cqh 0 var(--block-base);
    filter: drop-shadow(0 .7cqh 0 var(--home-outline));
  }
  .shop-launch-title { color: var(--block-ink); font: clamp(28px, 5.6cqh, 48px)/1 var(--game-display-font); letter-spacing: .01em; }
  .shop-launch-copy { color: var(--block-ink); font: clamp(16px, 3cqh, 24px)/1.15 var(--game-display-font); }
  .shop-launch-gift { color: var(--block-ink); font: clamp(34px, 7cqh, 60px)/1 var(--game-display-font); }
  .shop-launch-gift span:last-child { color: var(--block-muted); }
}

/* ===================================================== FICHE DES COMMANDES */
/* La bulle du bouton clavier (hors de l'écran, en px) : un bloc du thème, les touches en touches de
   clavier comme dans COMMANDES. */
body.arcade-home-body #controls-card {
  gap: 12px; padding: 14px 12px 18px;
  border: 2px solid var(--block-edge); border-radius: 12px;
  background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -7px 0 var(--block-base);
  filter: drop-shadow(0 6px 8px rgb(0 0 0 / .4)); color: var(--block-ink);
  .controls-card-head { padding-bottom: 10px; border-bottom: 2px solid var(--block-line); }
  /* The card is only as wide as the room left of the screen: the title follows its width (cqi). */
  .controls-card-head { gap: 6px; }
  .controls-card-head h2 { min-width: 0; color: var(--block-ink); font: min(17px, 12.5cqi)/1 var(--game-display-font); letter-spacing: .01em; }
  .controls-card-name { color: var(--block-ink); font: 17px/1 var(--game-display-font); }
  .controls-card-or { color: var(--block-muted); font: 14px/1 var(--game-display-font); }
  .controls-card-caps kbd {
    min-width: 26px; padding: 5px 6px; box-sizing: border-box;
    border: 2px solid var(--home-outline); border-radius: 6px;
    background: linear-gradient(180deg, #ffffff, #e9e4d6); box-shadow: inset 0 -3px 0 #c9c2b2;
    color: var(--home-outline); font: 13px/1 var(--game-display-font);
  }
  .controls-card-caps kbd.is-pressed { box-shadow: inset 0 -1px 0 #c9c2b2; transform: translateY(2px); }
}
/* Fermer : une pastille ronde du thème (la touche H reste dans l'infobulle du bouton clavier). */
body.arcade-home-body #controls-card .controls-card-head .controls-card-close {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0 0 2px;
  border: 2px solid var(--slab-edge); border-radius: 999px;
  background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .3), inset 0 -3px 0 var(--slab-base);
  color: var(--home-white); font: 18px/1 var(--game-display-font); filter: none;
  &::after { content: none; }
  kbd { display: none; }
  &:is(:hover, :focus-visible) {
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box; color: var(--home-white);
    outline: 0; filter: brightness(1.15);
  }
}

/* ======================================================== PRESTIGE GAGNÉ */
/* Ouvert une fois après un prestige (arcade-home.js offerPrestigeReveal) : le même bloc du thème que
   l'ouverture de la boutique. L'emblème du rang, « Prestige IV ! », puis ce qui a été gagné : le perso
   du joueur dans sa nouvelle couleur, et les coins. */
body.arcade-home-body .arcade-cabinet #arcade-panel-prestige {
  .arcade-panel-body.prestige-reveal {
    display: grid; justify-items: center; align-content: center; gap: clamp(8px, 2cqh, 18px);
    justify-self: center; align-self: center; width: min(100%, 620px); margin: auto;
    padding: 3cqh 3cqw; box-sizing: border-box; text-align: center;
    border: 3px solid var(--home-outline); border-radius: 2cqh;
    background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.9cqh 0 var(--block-base);
    filter: drop-shadow(0 .7cqh 0 var(--home-outline));
  }
  .prestige-reveal-emblem { line-height: 0; animation: prestige-reveal-drop 420ms steps(6) backwards; }
  .prestige-reveal-emblem .prestige-emblem { --pe-px: 3px; filter: drop-shadow(0 .5cqh 0 var(--home-outline)); }
  @container (max-height: 699px) { .prestige-reveal-emblem .prestige-emblem { --pe-px: 2px; } }
  .prestige-reveal-title {
    margin: 0; color: var(--pe-scene-ink, var(--block-ink)); font: clamp(30px, 6.4cqh, 56px)/1 var(--game-display-font);
    -webkit-text-stroke: .14em var(--home-outline); paint-order: stroke fill; text-shadow: 0 .08em 0 var(--home-outline);
  }
  .prestige-reveal-copy { margin: 0; color: var(--block-ink); font: clamp(15px, 2.8cqh, 22px)/1.15 var(--game-display-font); }
  .prestige-reveal-rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2cqw, 20px); }
  .prestige-reveal-reward {
    display: grid; justify-items: center; align-content: end; gap: 4px;
    min-width: clamp(120px, 18cqw, 170px); padding: 1.4cqh 1.6cqw; box-sizing: border-box;
    border-radius: 1.4cqh; background: rgb(0 0 0 / .12);
    animation: prestige-reveal-drop 300ms steps(4) 260ms backwards;
  }
  .prestige-reveal-reward[hidden] { display: none; }
  .prestige-reveal-coins { animation-delay: 380ms; }
  .prestige-reveal-blob { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; }
  /* La grande pièce de l'ouverture de la boutique (coins.css .shop-launch-gift), centrée sur la hauteur du perso. */
  .prestige-reveal-coins .coin-icon {
    width: 64px; height: 64px; margin: 16px; background-image: url('/images/coin.png'); background-size: 64px 64px;
  }
  .prestige-reveal-label { color: var(--block-muted); font: clamp(12px, 2.1cqh, 16px)/1 var(--game-display-font); letter-spacing: .06em; text-transform: uppercase; }
  .prestige-reveal-reward strong { color: var(--block-ink); font: clamp(22px, 4.2cqh, 34px)/1 var(--game-display-font); font-weight: normal; }
  .prestige-reveal-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px clamp(12px, 2cqw, 20px); }
  .prestige-reveal-actions [hidden] { display: none; }
  .prestige-reveal-keep {
    min-height: clamp(36px, 6cqh, 48px); padding: 0 clamp(14px, 2cqw, 24px);
    border: var(--btn-edge) solid var(--slab-edge); border-radius: 1cqh;
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box;
    box-shadow: inset 0 .3cqh 0 rgb(255 255 255 / .3), inset 0 -.6cqh 0 var(--slab-base);
    color: var(--home-white); font: clamp(14px, 2.6cqh, 20px)/1 var(--game-display-font); text-transform: uppercase; cursor: pointer;
    &:is(:hover, .is-selected, :focus-visible) { outline: 0; filter: brightness(1.12); translate: 0 -2px; }
  }
}
@keyframes prestige-reveal-drop { from { transform: translateY(-1.5cqh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  body.arcade-home-body .arcade-cabinet #arcade-panel-prestige :is(.prestige-reveal-emblem, .prestige-reveal-reward) { animation: none; }
}

/* ---- Bouton PRESTIGE de MON PERSO : il annonce la récompense (bille + couleur, coins) ---- */
body.arcade-home-body #arcade-panel-player .character-prestige-button {
  gap: .6em;
  .character-prestige-idle { display: inline-flex; align-items: center; gap: .7em; }
  .character-prestige-idle[hidden] { display: none; }
  .character-prestige-reward { display: inline-flex; align-items: center; gap: .3em; text-transform: none; letter-spacing: 0; }
  .character-prestige-swatch { width: 1.2em; height: 1.2em; background: center / contain no-repeat; image-rendering: pixelated; }
  .coin-icon { width: 1.2em; height: 1.2em; }
}

/* ---- Bandeau du haut : niveau 100, le prestige attend ---- */
/* Une petite étiquette d'accent posée sous la pastille du niveau, en Nunito pour rester lisible,
   qui respire doucement (pas de clignotement sec) jusqu'au prestige. */
body.arcade-home-body .arcade-cabinet .arcade-hud-line:has(.arcade-hud-record) {
  .arcade-hud-prestige-ready {
    grid-area: 1 / 1 / 3 / 2; align-self: end; justify-self: center; z-index: 4; translate: 0 60%;
    padding: .4cqh 1cqh; border: .3cqh solid var(--home-outline); border-radius: .9cqh;
    background: var(--theme-accent, var(--screen-accent)); color: var(--home-outline);
    box-shadow: inset 0 .3cqh 0 rgb(255 255 255 / .45), 0 .4cqh 0 var(--home-outline);
    /* Nunito 800 (la police des textes du jeu) : la police des titres devient illisible à cette taille. */
    font: 800 clamp(10px, 1.9cqh, 16px)/1.1 var(--game-text-font, 'Nunito', sans-serif); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
    cursor: pointer; animation: hud-prestige-breathe 2.6s ease-in-out 600ms infinite;
    &:hover { filter: brightness(1.12); animation-play-state: paused; }
  }
  /* L'étiquette dit déjà tout (et un clic ouvre MON PERSO) : pas d'infobulle du niveau par-dessus,
     qui serait recouverte par elle ou buterait sur la bulle du Plop. Le lecteur d'écran garde
     « Prestige disponible » dans l'aria-label (arcade-home.js renderHudProgression). */
  &:has(.arcade-hud-prestige-ready:not([hidden])) .arcade-hud-xp-copy { display: none; }
}
.arcade-hud-prestige-ready[hidden] { display: none !important; }
@keyframes hud-prestige-breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  body.arcade-home-body .arcade-cabinet .arcade-hud-prestige-ready { animation: none; }
}
