/* Crédits : pastille du HUD « Verre de nuit », fenêtre « Mes crédits », vitrine de la boutique.
   Couleurs prises dans les jetons du HUD (--grad, --glass-line, --text…) : même rendu en Nuit et en Clair. */

/* Pastille : à gauche de la puce de profil */
.credits-pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 12px 3px 4px; border-radius: 999px; cursor: pointer;
  background: var(--surface-raised); border: 1px solid rgba(233, 181, 74, 0.6); color: var(--text);
  font: 900 15px var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 0 14px rgba(245, 205, 124, 0.22);
}
.credits-pill:hover { background: var(--surface-hover); }
.credits-pill:focus-visible { outline: 3px solid #f3b6c9; outline-offset: 2px; }
.credits-pill .credit-ico { width: 26px; height: 26px; display: block; }
.credits-pill.gain .credit-ico { animation: credit-bounce 0.6s ease; }
.credits-pop {
  position: absolute; right: 4px; top: -4px; pointer-events: none; padding: 1px 7px; border-radius: 999px;
  background: var(--grad); color: var(--btn-primary-text); font: 900 12px var(--font); animation: credit-pop 1.3s ease-out forwards;
}
@keyframes credit-pop { 0% { opacity: 0; transform: translateY(6px) scale(0.8); } 20% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes credit-bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-8deg); } }
@media (max-width: 900px) {
  .credits-pill { padding: 2px 9px 2px 3px; font-size: 13px; gap: 4px; }
  .credits-pill .credit-ico { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .credits-pill.gain .credit-ico, .credits-pop { animation: none; } }

/* Fenêtre « Mes crédits » */
.credits-wallet { display: grid; gap: 14px; max-width: 520px; margin: 0 auto; }
.credits-wallet h3 { margin: 0; font-size: 16px; }
.cw-balance {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, var(--tint-amber), var(--tint-rose)); border: 1px solid rgba(233, 181, 74, 0.45);
}
.cw-ico { width: 56px; height: 56px; flex: none; }
.cw-amt { display: grid; line-height: 1.1; }
.cw-amt strong { font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--text); }
.cw-amt span { color: var(--text-soft); font-size: 13px; }
.cw-today { display: grid; gap: 6px; }
.cw-today p { margin: 0; }
.cw-row, .cw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cw-row strong, .cw-head strong { font-variant-numeric: tabular-nums; }
.cw-meter { display: block; height: 8px; border-radius: 9px; background: var(--surface-hover); overflow: hidden; }
.cw-meter > span { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.cw-quests, .cw-moves, .cw-streak { list-style: none; margin: 0; padding: 0; }
.cw-quests { display: grid; gap: 8px; }
.cw-quest {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: var(--surface-raised); border: 1px solid var(--glass-line);
}
.cw-quest.done { background: var(--tint-sage); border-color: rgba(155, 224, 178, 0.45); }
.cw-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b9a3e3; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.cw-quest.done .cw-check { background: #9be0b2; border-color: #9be0b2; color: #12301f; }
.cw-q { display: grid; min-width: 0; }
.cw-q strong { font-size: 14px; }
.cw-reward { font-weight: 900; color: var(--accent-text); white-space: nowrap; }
.cw-streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cw-day {
  text-align: center; padding: 6px 0; border-radius: 10px; font-size: 12px; font-weight: 800;
  background: var(--surface-raised); border: 1px solid var(--glass-line); color: var(--muted); white-space: nowrap;
}
.cw-day.gift { border: 1px dashed var(--warn-text); color: var(--warn-text); }
.cw-day.on { background: var(--grad); color: var(--btn-primary-text); border: 1px solid transparent; }
.cw-moves { display: grid; gap: 6px; }
.cw-moves li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-soft); }
.cw-moves strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-moves .pos { color: var(--ok-text); }
.cw-moves .neg { color: var(--err-text); }
.cw-shop { justify-self: stretch; justify-content: center; }
@media (max-width: 420px) { .cw-day { font-size: 10px; padding: 5px 0; } }

/* Boutique : vitrine de la semaine */
.shop-card.vitrine { border-color: rgba(245, 205, 124, 0.6) !important; background: var(--tint-amber); }
.cr-price { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.cr-price .credit-ico { width: 16px; height: 16px; }
.cr-price s { font-size: 13px; }
.chip-vitrine { font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 999px; background: var(--hi-bg); color: var(--warn-text); }
@media (max-width: 480px) {
  /* téléphone : pastille resserrée pour laisser de la place au nom de la salle */
  .credits-pill { padding: 2px 7px 2px 2px; font-size: 12px; gap: 3px; }
  .credits-pill .credit-ico { width: 19px; height: 19px; }
}
.shop-mode .credit-ico { width: 22px; height: 22px; flex: none; }

/* Administration › Crédits : donner ou retirer des crédits (onglet réservé à l'administrateur principal) */
.adm-give input[type='text'] { width: 100%; margin-top: 6px; }
.adm-give-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-give-row .btn { margin-left: auto; }
.adm-give-target { margin: 8px 0; max-width: 260px; }
.adm-give-quick .adm-num { width: 90px; }
.adm-give-go { margin-top: 10px; }
.adm-give-go .btn { width: 100%; }
.adm-give-log { margin: 4px 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* Administration › Donner un objet : liste d'objets avec vignette (style Fanzine : bords d'encre, décalage rose) */
.adm-give-items-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.adm-give-item { padding: 6px 8px; border: 2px solid var(--ink, var(--outline)); background: var(--paper-2, var(--surface-raised)); box-shadow: 3px 3px 0 var(--pink, #ff5fae); }
.adm-give-item { flex-wrap: nowrap; }
.adm-give-item > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.25; }
.adm-give-item .btn { flex: none; white-space: nowrap; }
@media (max-width: 520px) { .adm-give-thumb, .adm-give-thumb canvas, .adm-give-thumb img { width: 36px; height: 36px; max-width: 36px; max-height: 36px; } .adm-give-item strong { font-size: 14px; } }
.adm-give-item.star { box-shadow: 3px 3px 0 var(--yellow, #ffd84a); }
.adm-give-thumb { width: 48px; height: 48px; flex: none; display: grid; place-items: center; overflow: hidden; }
.adm-give-thumb canvas, .adm-give-thumb img { max-width: 48px; max-height: 48px; image-rendering: auto; }
.adm-give-for { margin: 6px 0 0; }
.adm-give-for strong { color: var(--pink, #ff5fae); }
.adm-give-items input[type='search'] { width: 100%; box-sizing: border-box; }
/* Effets de pseudo à crédits : aperçu du pseudo sur toute la largeur de la carte */
.shop-card.cr-fx > div { min-width: 0; flex: 1; }
.cr-fx-prev { margin: 8px 0 4px; max-width: 100%; }
.cr-fx-prev .shop-name.grand { font-size: 18px; max-width: 100%; }
