/* fredoka-latin-500-normal */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(./fredoka-latin-500-normal-B0JifZgm.woff2) format('woff2'), url(./fredoka-latin-500-normal-BL692wg7.woff) format('woff');
}/* fredoka-latin-600-normal */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./fredoka-latin-600-normal-C4zohCW5.woff2) format('woff2'), url(./fredoka-latin-600-normal-CcrEjrB4.woff) format('woff');
}/* fredoka-latin-700-normal */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fredoka-latin-700-normal-BOIZVyIN.woff2) format('woff2'), url(./fredoka-latin-700-normal-C8FeHd3X.woff) format('woff');
}/* vt323-latin-400-normal */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./vt323-latin-400-normal-wDgJuOC9.woff2) format('woff2'), url(./vt323-latin-400-normal-Dqn9ZSPj.woff) format('woff');
}* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  color-scheme: light;
  /* encres : prune profonde (texte) et prune moyenne (texte secondaire).
     Foncies lors de la refonte lisibilité : l'ancienne --ink-soft #c391b1
     tombait sous 3:1 sur le verre. */
  --ink: #6d4260;
  --ink-soft: #a06f8e;
  --pink: #ff8fab;
  --purple: #c98be0;
  /* LE dégradé signature du jeu (CTA, accents) — un seul, partout pareil */
  --grad: linear-gradient(135deg, var(--pink), var(--purple));
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.78);
  /* panneaux plein écran : un poil plus opaques qu'avant (lisibilité sur
     n'importe quel monde derrière) */
  --glass-panel: rgba(255, 251, 253, 0.55);
  /* tuiles internes (stickers, articles, chips) : verre clair, jamais d'aplat blanc */
  --tile: rgba(255, 255, 255, 0.42);
  --tile-edge: rgba(255, 255, 255, 0.6);
  /* gélule sombre du HUD (posée sur le canvas, opaque assez pour tout monde) */
  --hud-chip: rgba(70, 35, 70, 0.34);
  --hud-chip-edge: rgba(255, 255, 255, 0.22);
  /* échelle de rayons (le reste = pilules 999px) */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  /* deux ombres, pas six */
  --shadow: 0 6px 20px rgba(150, 90, 140, 0.16);
  --shadow-pop: 0 12px 30px rgba(190, 95, 165, 0.3);
  /* police de marque du jeu (logo, titres, boutons, chiffres du HUD) */
  --title-font: "Fredoka", ui-rounded, "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  /* anneau de focus clavier, cohérent sur tous les boutons */
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 6px rgba(201, 139, 224, 0.55);
  /* marges sûres (encoches, barre d'état, indicateur d'accueil) */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
html,
body {
  width: 100%;
  height: 100%;
  /* hauteur dynamique : suit la barre d'URL mobile qui se rétracte */
  height: 100dvh;
  overflow: hidden;
  /* pas de touch-action:none ici : un ancêtre `none` bloque le défilement de
     TOUS ses descendants (modales comprises). On le met sur le canvas seul. */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family:
    ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  background: #ffeef5;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  /* la zone de jeu ne défile/zoome pas : le jeu gère les gestes lui-même */
  touch-action: none;
}
.ic {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

/* ----- HUD minimaliste : EN BAS, sans fond (le haut reste libre pour jouer) ----- */
#hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* grille fixe : le score central ne bouge JAMAIS, quelle que soit la
     largeur des colonnes latérales */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  padding: 0 calc(10px + var(--sar)) calc(10px + var(--sab)) calc(14px + var(--sal));
  pointer-events: none;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(70, 35, 70, 0.7),
    0 0 10px rgba(70, 35, 70, 0.5);
}
#hudL,
#hudR {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 6px;
}
#hudL {
  align-items: flex-start;
  justify-self: start;
}
#hudR {
  align-items: flex-end;
  justify-self: end;
}
/* puces : chaque info du HUD vit dans une petite gélule sombre, alignée.
   Opacité montée + fin liseré : lisible sur les mondes sombres comme clairs. */
.hudLine,
#combo,
#quest {
  background: var(--hud-chip);
  border: 1px solid var(--hud-chip-edge);
  border-radius: 999px;
  padding: 4px 11px;
}
.hudLine {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--title-font);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hudLine .ic {
  width: 15px;
  height: 15px;
  filter: drop-shadow(0 1px 1px rgba(70, 35, 70, 0.5));
}
#scoreCard {
  text-align: center;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
#scoreCard.bump {
  transform: scale(1.05);
}
#scoreCard .value {
  font-family: var(--title-font);
  font-size: clamp(26px, 8vmin, 36px);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 2px 4px rgba(70, 35, 70, 0.6),
    0 0 16px rgba(70, 35, 70, 0.4);
}
#lvlbarTrack {
  width: 130px;
  height: 5px;
  border-radius: 999px;
  background: rgba(70, 35, 70, 0.32);
  margin: 6px auto 0;
  overflow: hidden;
}
#lvlbar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transition: width 0.25s ease;
}
/* Bouton pause : pastille ronde en verre dépoli, coin HAUT-GAUCHE, bien
   visible (retour joueurs : introuvable quand il était en bas à droite). */
#pauseBtn {
  position: fixed;
  top: calc(10px + var(--sat));
  left: calc(10px + var(--sal));
  z-index: 6;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 4px 14px rgba(180, 110, 150, 0.22);
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform 0.12s;
}
#pauseBtn:active {
  transform: scale(0.9);
}
#pauseBtn .ic {
  width: 22px;
  height: 22px;
}

/* ----- combo (colonne de gauche) & notifications (sous la colonne de droite) ----- */
#combo {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(3px) scale(0.92);
  transform-origin: left center;
  transition:
    opacity 0.32s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}
#combo.show {
  opacity: 1;
  transform: none;
}
#combo .ic {
  width: 15px;
  height: 15px;
  filter: drop-shadow(0 1px 1px rgba(70, 35, 70, 0.5));
}
#notifs {
  position: fixed;
  top: calc(96px + var(--sat));
  right: calc(14px + var(--sar));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
  z-index: 5;
}
.notif {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  /* même gélule sombre que le HUD : lisible sur les mondes clairs aussi */
  background: var(--hud-chip);
  border: 1px solid var(--hud-chip-edge);
  border-radius: 999px;
  padding: 5px 12px;
  text-shadow: 0 1px 2px rgba(70, 35, 70, 0.6);
  transition: opacity 0.45s;
  animation: notifIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 72vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes notifIn {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
}
.notif .ic {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 1px rgba(70, 35, 70, 0.4));
}

#comboBar {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: rgba(70, 35, 70, 0.32);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s;
  margin: -2px 0 0 12px;
}
#comboFill {
  display: block;
  height: 100%;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
}
#quest {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}
#quest b {
  font-weight: 700;
  opacity: 0.9;
}
.qDot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}
/* barre de progrès de l'objectif, intégrée à la puce */
.qBar {
  display: block;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.qBar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.25s ease;
}
#quest .ic {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 1px 1px rgba(70, 35, 70, 0.5));
}
#quest.show {
  opacity: 1;
  transform: none;
}

/* ----- indice & boutons ----- */
#hint {
  position: fixed;
  top: calc(132px + var(--sat));
  left: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-shadow:
    0 1px 2px rgba(70, 35, 70, 0.7),
    0 0 10px rgba(70, 35, 70, 0.5);
  pointer-events: none;
  white-space: nowrap;
  animation: floaty 2.6s ease-in-out infinite;
  transition: opacity 1s;
}
#hint .ic {
  filter: drop-shadow(0 1px 1px rgba(70, 35, 70, 0.5));
}
@keyframes floaty {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

/* ----- disposition de l'interface (réglable dans les options) -----
   data-hudinfo : position des infos persistantes (score/combo/niveau/quête).
   data-notifs  : position des messages éphémères (notifications, indice).
   Les valeurs par défaut (hudinfo=bottom, notifs=top) sont le style ci-dessus ;
   on ne surcharge que les variantes. */
body[data-hudinfo="top"] #hud {
  top: 0;
  bottom: auto;
  align-items: start;
  padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 0 calc(14px + var(--sal));
}
/* laisse la place au bouton pause (pastille ronde, coin haut-gauche) */
body[data-hudinfo="top"] #hudL {
  margin-top: 52px;
}
body[data-notifs="bottom"] #notifs {
  top: auto;
  bottom: calc(96px + var(--sab));
}
body[data-notifs="bottom"] #hint {
  top: auto;
  bottom: calc(150px + var(--sab));
}

/* ----- panneaux ----- */
#settings,
#album,
#shop,
#buddy {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  touch-action: pan-y;
}
#settings.open,
#album.open,
#shop.open,
#buddy.open {
  opacity: 1;
  visibility: visible;
}
/* quand un panneau est ouvert, on efface l'interface en dessous : derrière le
   verre on ne voit que le monde, jamais un autre menu en transparence */
body:has(#settings.open, #album.open, #shop.open, #buddy.open) #menuScreen,
body:has(#settings.open, #album.open, #shop.open, #buddy.open) #zenBar {
  opacity: 0 !important;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  /* panneau plein écran en verre dépoli : le monde reste visible derrière,
     flouté — c'est lui qui fait l'effet « glass », pas un aplat */
  background: var(--glass-panel);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100vh; /* fallback si dvh non géré */
  height: 100dvh;
  overflow: hidden; /* le défilement vit dans .cardBody */
  padding: calc(16px + var(--sat)) calc(18px + var(--sar)) calc(16px + var(--sab))
    calc(18px + var(--sal));
  transform: translateY(4vh);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.open .card {
  transform: translateY(0);
}
/* le contenu reste lisible sur grand écran : colonne centrée */
.cardBody > *,
.card h2,
#shopWallet,
#albumStats {
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
/* corps défilant commun : en-tête figé au-dessus, contenu qui défile */
.cardBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* indispensable : le body a touch-action:none, on réautorise le défilement vertical ici */
  touch-action: pan-y;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 2px 4px;
}
.card h2 {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: clamp(19px, 5.5vmin, 24px);
  background: linear-gradient(135deg, #f0709a, #a86fd0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.closeX {
  position: absolute;
  top: calc(14px + var(--sat));
  right: calc(14px + var(--sar));
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(200, 145, 185, 0.16);
  color: #a96a8e;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.closeX:active {
  transform: scale(0.9);
}
.optRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(180, 120, 160, 0.16);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.optRow span {
  display: flex;
  align-items: center;
  gap: 9px;
}
.switch {
  width: 50px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(190, 140, 175, 0.22);
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
  touch-action: manipulation;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.switch.on {
  background: linear-gradient(135deg, var(--pink), var(--purple));
}
.switch.on::after {
  transform: translateX(20px);
}
/* sélecteur de langue (contrôle segmenté FR / EN) */
.langSeg {
  display: flex;
  gap: 4px;
  background: rgba(190, 140, 175, 0.22);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.langBtn {
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.2s;
}
.langBtn.on {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
}
/* sélecteur de palette de bulles (bloc avec libellé puis échantillons) */
.optBlock {
  padding: 14px 2px 10px;
  border-bottom: 1px solid rgba(180, 120, 160, 0.16);
}
.optBlockLabel {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 11px;
}
.palRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.palSwatch {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.2s,
    transform 0.15s;
}
.palSwatch:hover {
  transform: translateY(-1px);
}
.palSwatch.on {
  border-color: var(--purple);
}
.palSwatch.auto {
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0 12px;
}
.palSwatch.auto.on {
  color: var(--purple);
}
.palDot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.palSwatch.locked .palDot {
  opacity: 0.55;
}
.palLock {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 3px;
  padding: 1px 6px 1px 4px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.16);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.palLock svg {
  vertical-align: -1px;
}
/* sélecteur de forme (skin) de bulles */
.skinRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skinSwatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.2s,
    transform 0.15s;
}
.skinSwatch:hover {
  transform: translateY(-1px);
}
.skinSwatch.on {
  border-color: var(--purple);
}
.skinSwatch.auto {
  min-height: 60px;
  padding: 0 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-soft);
}
.skinSwatch.auto.on {
  color: var(--purple);
}
.skinPrev {
  display: block;
  width: 60px;
  height: 60px;
}
.skinSwatch.locked .skinPrev {
  opacity: 0.6;
}
.skinSwatch .palLock {
  position: absolute;
  right: 2px;
  bottom: 2px;
  margin: 0;
}
/* slider de volume */
.vol {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(96px, 30vw, 130px);
  height: 6px;
  border-radius: 999px;
  background: rgba(190, 140, 175, 0.22);
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.vol::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.vol:focus-visible {
  box-shadow: var(--focus-ring);
}
.cardBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s;
}
.cardBtn:active {
  transform: scale(0.97);
}
#albumStats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}
#albumStats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tile);
  border: 1px solid var(--tile-edge);
  color: #9c5e82;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}
#albumGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sticker {
  background: var(--tile);
  border: 1px solid var(--tile-edge);
  border-radius: 18px;
  padding: 12px 6px 10px;
  text-align: center;
}
.sticker .em {
  width: 46px;
  height: 46px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--tile-edge);
  border-radius: 50%;
}
.sticker .nm {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.sticker .ds {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
}
.sticker.locked {
  opacity: 0.6;
  filter: grayscale(0.85);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
}
/* ----- écran titre & pause ----- */
/* trois zones empilées : barre du haut, héros centré, actions du bas.
   `space-between` cale automatiquement le héros au milieu, quel que soit l'écran. */
#menuScreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--sat)) calc(14px + var(--sar))
    calc(14px + var(--sab)) calc(14px + var(--sal));
  pointer-events: none;
  z-index: 8;
  /* même verre plein écran que les autres panneaux : le monde flotte derrière */
  background: var(--glass-panel);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    opacity 0.45s,
    visibility 0.45s;
}
#menuScreen.hidden {
  opacity: 0;
  visibility: hidden;
}
/* barre du haut : porte-monnaie à gauche, réglages à droite */
#menuTop {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
/* pastille verre dépoli regroupant Réglages + Compte (haut droite) */
#menuTopRight {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(180, 110, 150, 0.16);
}
/* héros central : logo, titre, sélecteur de monde, Jouer, défi */
#menuInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2.2vmin, 15px);
  text-align: center;
  padding: clamp(20px, 4.5vmin, 30px) clamp(24px, 6vmin, 38px);
  /* le verre est porté par #menuScreen tout entier : le bloc central reste nu */
  max-width: min(440px, 100%);
  min-height: 0;
  overflow-y: auto;
  pointer-events: auto;
  touch-action: pan-y;
}
/* barre d'actions du bas : boutons libellés */
#menuActions {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.menuAction {
  pointer-events: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 90px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 251, 253, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 8px 22px rgba(120, 60, 110, 0.16);
  color: #8a5a7a;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease;
}
.menuAction .ic {
  width: 22px;
  height: 22px;
}
.menuAction:active {
  transform: scale(0.95);
}
@media (hover: hover) {
  .menuAction:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(120, 60, 110, 0.22);
  }
}
.menuAction:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
#menuLogo {
  width: clamp(60px, 19vmin, 92px);
  height: clamp(60px, 19vmin, 92px);
  filter: drop-shadow(0 8px 18px rgba(120, 60, 110, 0.35));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}
#menuTitle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.26em;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: clamp(36px, 13vmin, 56px);
  line-height: 1;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.7))
    drop-shadow(0 9px 20px rgba(120, 60, 110, 0.38));
}
#menuTitle span {
  background: linear-gradient(150deg, #ff85b0 0%, #ff7aa8 38%, #b07ad6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#menuTitle span:last-child {
  font-size: 0.82em;
  background: linear-gradient(150deg, #c98be0, #9a6fd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: rotate(-4deg);
  transform-origin: bottom left;
}
#menuSub {
  color: var(--ink-soft);
  font-size: clamp(12.5px, 3.6vmin, 15px);
  font-weight: 700;
  margin-top: -8px;
}
.bigBtn {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-size: 16px; /* taille FIXE : plus de texte qui gonfle selon l'écran (vmin) */
  font-weight: 700;
  font-family: inherit;
  padding: 14px 40px;
  border-radius: 999px;
  box-shadow:
    0 12px 32px rgba(200, 100, 180, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  margin-top: 8px;
  /* on anime le halo, pas la taille : l'appui reste net et réactif */
  transition:
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease;
  animation: pulseGlow 2.6s ease-in-out infinite;
}
.bigBtn:active {
  transform: scale(0.95);
}
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow:
      0 12px 30px rgba(200, 100, 180, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  50% {
    box-shadow:
      0 16px 42px rgba(200, 100, 180, 0.62),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}
.menuRow {
  display: flex;
  gap: 12px;
  pointer-events: none;
}
/* boutons-icônes minimalistes : pas de fond, juste l'icône + un retour discret */
.menuSmall {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: #8a5a7a;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.15s ease;
}
.menuSmall:active {
  transform: scale(0.9);
  background: rgba(124, 79, 109, 0.12);
}
#menuWallet {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 4px 14px rgba(180, 110, 150, 0.16);
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  padding: 8px 16px;
  border-radius: 999px;
  transition:
    transform 0.14s,
    background 0.15s;
}
#menuWallet:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.8);
}
#menuWallet:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
@media (hover: hover) {
  #menuWallet:hover {
    background: rgba(255, 255, 255, 0.74);
  }
}
.wal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a5a7a;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wal .ic {
  width: 18px;
  height: 18px;
}
/* ----- boutique ----- */
#shopWallet {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
/* liste verticale : une ligne par article (mobile-first, jamais sur 2 lignes) */
#shopGrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shopCat {
  /* en-tête de rayon : collant pendant le défilement, toujours lisible */
  position: sticky;
  top: -1px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--title-font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
  margin: 10px 0 1px;
  padding: 7px 10px;
  border-radius: var(--r-s);
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.shopCat:first-child {
  margin-top: 0;
}
.shopCat .ic {
  width: 15px;
  height: 15px;
}
/* une ligne = aperçu · nom · bouton */
.shopRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tile);
  border: 1px solid var(--tile-edge);
  border-radius: 14px;
  padding: 8px 10px 8px 12px;
}
.shopRow.best {
  border-color: var(--purple);
}
.shopPreview {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}
.shopPreview.prod {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.compDot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.shopNm {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shopBtn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.12s,
    filter 0.15s;
}
.shopBtn:active {
  transform: scale(0.95);
}
.shopBtn.price {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 100, 180, 0.32);
}
.shopBtn.price.noFunds {
  background: rgba(150, 120, 145, 0.22);
  color: #8a6f82;
  box-shadow: none;
}
.shopBtn.owned {
  background: rgba(200, 145, 185, 0.18);
  color: #9c5e82;
}
.shopBtn.owned.equipped {
  background: rgba(120, 200, 150, 0.24);
  color: #3f8c62;
}
#menuWorldRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  pointer-events: none;
}
#menuDaily {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  max-width: 280px;
  color: var(--ink-soft);
  font-size: clamp(12px, 3.2vmin, 13px);
  font-weight: 700;
  text-align: center;
}
#menuDaily .ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/*
 * App NATIVE (body.native, posé par initNative) : la WebView Android glitche
 * sur les backdrop-filter pendant l'animation du clavier (grand voile
 * blanc/noir sur la moitié de l'écran). Sur la carte de connexion — le seul
 * panneau à champs texte — on remplace le verre dépoli par un fond quasi
 * opaque équivalent. !important : le style d'origine est inline.
 */
body.native #accountCard {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 250, 252, 0.97) !important;
}
body.native #menuWallet,
body.native #menuTopRight,
body.native #menuSaveHint,
body.native #pauseBtn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 252, 253, 0.9);
}
/*
 * Vide NOIR sous le formulaire quand le clavier s'ouvre : c'est le MÊME glitch
 * WebView que le voile blanc, mais provenant des grandes couches verre plein
 * écran restées floutées DERRIÈRE la fenêtre de connexion (#menuScreen quand on
 * l'ouvre depuis le menu, .card quand on l'ouvre depuis la boutique). On
 * neutralise leur backdrop-filter le temps que le modal de compte est ouvert
 * (classe account-open posée par ui/account.ts) : le menu garde son verre
 * dépoli en temps normal.
 */
body.native.account-open #menuScreen,
body.native.account-open .card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 251, 253, 0.98) !important;
}

/* Rappel discret « crée un compte pour sauvegarder » (menu, hors connexion). */
#menuSaveHint {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(340px, 100%);
  margin-top: 4px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 14px rgba(180, 110, 150, 0.16);
  cursor: pointer;
}
#menuSaveHint .ic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: #a86fd0;
}
.menuSaveHintText {
  flex: 1;
  text-align: left;
  line-height: 1.3;
  font-size: clamp(12px, 3.1vmin, 13px);
  font-weight: 700;
  color: #8a5a78;
}
#menuSaveHintClose {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(200, 145, 185, 0.16);
  color: #a06a8a;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
#menuWorld {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a5a7a;
  font-size: 14px;
  font-weight: 700;
  min-width: 132px;
  justify-content: center;
}
.worldArrow {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: #b07ad6;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.15s ease;
}
.worldArrow:active {
  transform: scale(0.88);
  background: rgba(124, 79, 109, 0.12);
}

/* ----- états cohérents des boutons : survol (souris) + focus clavier ----- */
@media (hover: hover) {
  .bigBtn:hover {
    transform: translateY(-2px);
  }
  .menuSmall:hover,
  .worldArrow:hover {
    background: rgba(124, 79, 109, 0.09);
  }
  #pauseBtn:hover {
    transform: scale(1.06);
  }
  .cardBtn:hover {
    filter: brightness(1.04);
  }
  .closeX:hover {
    background: rgba(200, 145, 185, 0.28);
  }
}
#pauseBtn:focus-visible,
.closeX:focus-visible,
.switch:focus-visible,
.langBtn:focus-visible,
.cardBtn:focus-visible,
.menuSmall:focus-visible,
.worldArrow:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.bigBtn:focus-visible {
  outline: none;
  box-shadow:
    0 12px 32px rgba(200, 100, 180, 0.45),
    var(--focus-ring);
}


/* ----- barre flottante du mode contemplation ----- */
#zenBar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--sab));
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 999px;
  max-width: calc(100vw - 16px);
  background: rgba(255, 251, 253, 0.82);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 40px rgba(120, 60, 110, 0.28);
  z-index: 9;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.3s;
}
#zenBar.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#zenWorld {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a5a7a;
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
  min-width: 0;
  max-width: 38vw;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
}
#zenWorld span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.zenBtn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 50%;
  color: #8a5a7a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.14s,
    background 0.15s;
}
.zenBtn:active {
  transform: scale(0.9);
  background: rgba(124, 79, 109, 0.12);
}
.zenBtn .ic {
  width: 20px;
  height: 20px;
}
.zenSep {
  width: 1px;
  height: 22px;
  background: rgba(124, 79, 109, 0.2);
  margin: 0 2px;
}
@media (hover: hover) {
  .zenBtn:hover {
    background: rgba(124, 79, 109, 0.09);
  }
}
.zenBtn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

body.inMenu :is(#hud, #combo, #comboBar, #quest, #hint, #pauseBtn, #notifs),
body.inZen :is(#hud, #combo, #comboBar, #quest, #hint, #pauseBtn, #notifs) {
  display: none;
}

/* restauration d'achats */
.shopRestoreBtn {
  display: block;
  margin: 8px auto 0;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.shopNote {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 12px 0;
}

/* ----- éditeur de compagnon ----- */
#buddyPreview {
  display: block;
  flex-shrink: 0;
  width: 240px;
  height: 170px;
  margin: 0 auto 4px;
}
.buddyColor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(180, 120, 160, 0.16);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.buddyColor input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 52px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 0;
  background: none;
  cursor: pointer;
}
.buddyColor input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}
.buddyColor input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}
.propRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
}
.propCell {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.2s,
    transform 0.15s;
}
.propCell:hover {
  transform: translateY(-1px);
}
.propCell.on {
  border-color: var(--purple);
  background: rgba(255, 255, 255, 0.75);
}
.propCell.locked {
  opacity: 0.55;
}
.propCell .propPrev {
  width: 56px;
  height: 56px;
  pointer-events: none;
}
.propLock {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(90, 74, 82, 0.75);
  color: #fff;
}
.propNone {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-soft);
}
.shopRow .propPrev {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.shopRow .shopSkinPrev {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.shopRow .shopSky {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--tile-edge);
}
/* aperçu palette : petite grille 2×2 de pastilles, alignée sur 46px */
.shopPreview.pal {
  width: 46px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}
.shopEditBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.shopEditBtn:active {
  transform: scale(0.98);
}

/* petits écrans : on resserre le HUD et la barre zen */
@media (max-width: 380px) {
  #hudL,
  #hudR {
    min-width: 72px;
  }
  .hudLine,
  #combo {
    font-size: 12px;
  }
  .zenBtn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .zenBtn .ic {
    width: 18px;
    height: 18px;
  }
}

/* écrans courts (téléphone en paysage) : on compacte les panneaux pour tout voir */
@media (max-height: 520px) {
  #menuInner {
    transform: none;
    gap: 8px;
    padding: 16px 24px;
  }
  #menuLogo {
    display: none;
  }
}

/* respect du réglage système « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  #menuLogo,
  .bigBtn {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ===================================================================
   Refonte UI 1.3 : Fredoka sur l'interface, fenêtre compte en classes,
   sections d'options, tiers boutique, album hiérarchisé, contraste HUD.
   =================================================================== */

/* La police de marque habille aussi les contrôles (elle n'était que sur
   les titres : tout le reste rendait en police système générique). */
.bigBtn,
.menuAction,
.cardBtn,
.shopEditBtn,
.langBtn,
.shopBtn,
.shopRestoreBtn,
.menuSmall,
#menuDaily,
.wal b {
  font-family: var(--title-font);
}

/* --- fenêtre compte : même langage verre que le reste du jeu --- */
#accountModal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(58, 30, 56, 0.5);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
#accountCard {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-l);
  padding: 28px 24px;
  width: min(360px, 86vw);
  box-shadow: var(--shadow-pop);
  text-align: center;
}
#accountCard .closeX {
  position: absolute;
  top: 12px;
  right: 14px;
}
#accountCard h2 {
  margin: 6px 0 18px;
  font-family: var(--title-font);
  font-weight: 600;
  color: var(--ink);
}
.authUserIc {
  width: 40px;
  height: 40px;
  color: var(--purple);
}
.btnGoogle {
  background: #fff; /* charte Google : seule exception au « jamais de blanc plein » */
  color: #3c4043;
  border: 1.5px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  white-space: nowrap;
  margin-bottom: 14px;
  animation: none; /* pas de pulsation : réservée au CTA principal */
}
.authSep {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 14px;
}
.authSepLine {
  flex: 1;
  height: 1px;
  background: rgba(180, 140, 170, 0.32);
}
.authInput {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  margin-bottom: 10px;
}
.authInput::placeholder {
  color: var(--ink-soft);
}
.authInput:focus {
  outline: none;
  border-color: var(--purple);
}
.authPwRow {
  position: relative;
  margin-bottom: 8px;
}
.authInputPw {
  padding-right: 46px;
  margin-bottom: 0;
}
.authEye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-soft);
}
.authForgot {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  padding: 0;
  background: none;
  border: none;
  color: var(--purple);
  font: inherit;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
}
.authHint {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin: 10px 0 0;
}
.authMsg {
  color: var(--ink-soft);
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 13.5px;
}
.btnSoft {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid var(--glass-edge);
  box-shadow: none;
  animation: none;
}
.btnDanger {
  background: transparent;
  color: #c0506e;
  border: 1.5px solid #f0b8c8;
  box-shadow: none;
  animation: none;
}

/* --- options : sections titrées --- */
.optSection {
  margin: 20px 0 2px;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cardBody > .optSection:first-child {
  margin-top: 2px;
}

/* --- boutique : rareté visible + interactivité --- */
.shopRow {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
@media (hover: hover) {
  .shopRow:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }
}
.shopRow[data-tier="rare"] {
  border: 1px solid rgba(255, 143, 171, 0.55);
}
.shopRow[data-tier="epique"] {
  border: 1px solid rgba(201, 139, 224, 0.7);
}
.shopRow[data-tier="signature"] {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--tile), var(--tile)) padding-box,
    var(--grad) border-box;
}

/* --- album : progression en tête, carnet de stats après la grille --- */
.albumCount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: var(--title-font);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.albumCarnet {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  border-top: 1px dashed rgba(180, 120, 160, 0.35);
  padding-top: 14px;
  margin-top: 16px;
}
.albumCarnet span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tile);
  border: 1px solid var(--tile-edge);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* --- contraste élevé : le HUD devient franchement opaque --- */
body.hc .hudLine,
body.hc #combo,
body.hc #quest,
body.hc .notif {
  background: rgba(58, 26, 56, 0.62);
  border-color: rgba(255, 255, 255, 0.5);
}
body.hc #lvlbarTrack,
body.hc #comboBar {
  background: rgba(58, 26, 56, 0.62);
}

/* --- focus clavier : compléter la liste des interactifs --- */
.shopRow:focus-visible,
.palSwatch:focus-visible,
.skinSwatch:focus-visible,
.propCell:focus-visible,
.buddyPreset:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* --- contrats post-refonte : .shopRow est désormais un <button> --- */
.shopRow {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
/* le bouton « Personnaliser » vit dans l'en-tête de la section props */
.shopCat .shopEditBtn {
  margin-left: auto;
  text-transform: none;
  letter-spacing: normal;
}

/* ----- fenêtre de mise à jour (native : rappel doux ou blocage) ----- */
.updOverlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 30, 56, 0.5);
}
.updCard {
  width: min(360px, 88vw);
  padding: 26px 24px 22px;
  border-radius: var(--r-l);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.updIcon {
  color: var(--purple);
  margin-bottom: 6px;
}
.updTitle {
  margin: 0 0 10px;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 21px;
  color: var(--ink);
}
.updBody {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.updActions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.updBtn {
  padding: 13px 20px;
  border: none;
  border-radius: 999px;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  background: var(--grad);
  cursor: pointer;
  touch-action: manipulation;
}
.updLater {
  padding: 10px;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}
/* natif : le verre dépoli glitche sur certaines WebView → fond quasi opaque */
body.native .updCard {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 250, 252, 0.98);
}
