/* ═══════════════════════════════════════════════════════════════
   Pokémon Breeder Life — Style complet
   ═══════════════════════════════════════════════════════════════ */

:root {
  --white:       #fff;
  --cream:       #fdf6ee;
  --text:        #3a2a1a;
  --text-dim:    #8a7a6a;
  --orange:      #f07830;
  --yellow:      #f8d030;
  --pink:        #f878a8;
  --gold:        #ffd700;
  --basic-c:     #68c050;
  --advanced-c:  #5890f8;
  --legendary-c: #f8c820;
  --shadow:      rgba(60,30,10,.18);
  --nav-h:       88px;
  --font-main:   'Nunito', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background: #d8f0f8;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════════════════════════
   ÉCRANS
   ══════════════════════════════════════════════════════════════ */
.screen {
  position: fixed; inset: 0;
  bottom: var(--nav-h);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ══════════════════════════════════════════════════════════════
   HUD
   ══════════════════════════════════════════════════════════════ */
.hud-top {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px; z-index: 30;
}
.hud-coins, .hud-eggs {
  background: rgba(255,255,255,.94);
  border-radius: 20px; padding: 4px 12px 4px 8px;
  display: flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px var(--shadow);
  font-weight: 800; font-size: .85rem;
}
.coin-icon {
  background: var(--yellow); color: #7a5000;
  font-family: sans-serif; font-size: .72rem;
  min-width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-weight: 900; line-height: 1;
}
.coin-icon.small { font-size: .62rem; min-width: 15px; height: 15px; }
.coin-label { font-size: .6rem; color: var(--text-dim); font-weight: 600; }
.egg-mini { font-size: .9rem; }

/* Bouton Options (rouage) */
.options-btn {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.94);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px var(--shadow);
  color: var(--text); z-index: 30;
  transition: transform .15s, background .15s;
}
.options-btn:hover  { background: white; transform: rotate(30deg); }
.options-btn:active { transform: rotate(60deg) scale(.9); }

/* Bouton Succès (entre Options et Cacher) */
/* Bouton Cacher/Afficher les Pokémon */
.hide-btn {
  position: absolute; top: 64px; left: 12px;
  background: rgba(255,255,255,.94);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px var(--shadow);
  font-size: 1.3rem;
  z-index: 30;
  transition: transform .15s, background .15s;
}
.hide-btn:hover  { background: white; transform: scale(1.08); }
.hide-btn:active { transform: scale(.92); }
.hide-btn.hidden-mode {
  background: rgba(80,60,150,.94);
  color: white;
}

/* ══════════════════════════════════════════════════════════════
   Bouton SUCCÈS flottant (sous l'œil) — Chambre uniquement
   ══════════════════════════════════════════════════════════════ */
.achievements-btn-room {
  position: absolute; top: 116px; left: 12px;
  background: linear-gradient(135deg, #f8d020, #d89000);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(220,160,0,.45);
  font-size: 1.3rem;
  z-index: 30;
  transition: transform .15s, filter .15s;
}
.achievements-btn-room:hover  { filter: brightness(1.15); transform: scale(1.08); }
.achievements-btn-room:active { transform: scale(.92); }

/* Badge du bouton Succès (point d'exclamation rouge) */
.ach-room-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: #e74c3c;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 800;
  display: grid; place-items: center;
  line-height: 1;
  animation: achBadgePulse 1.5s ease-in-out infinite;
}
@keyframes achBadgePulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(231,76,60,.5); }
  50%      { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

/* ══════════════════════════════════════════════════════════════
   CHAMBRE (fond image)
   ══════════════════════════════════════════════════════════════ */
.room-scene {
  flex: 1; position: relative; overflow: hidden;
}
.room-backdrop {
  position: absolute; inset: 0;
  background:
    url('https://i.imgur.com/NENZEGv.png') center center / cover no-repeat,
    linear-gradient(180deg, #f5e0c8 0%, #f0d0b0 100%);
  background-position: center 30%;
  background-size: cover;
}
.room-backdrop::after {
  /* Léger voile pour adoucir */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.08) 100%);
  pointer-events: none;
}

/* Pokémon dans la chambre */
.pokemon-playground {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
}
.room-pokemon {
  position: absolute;
  width: 130px; height: 130px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform .3s ease;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
  animation: roomIdle 2.5s ease-in-out infinite;
}
@keyframes roomIdle {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.room-pokemon img {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.room-pokemon:hover { transform: scale(1.12) translateY(-6px); }
.room-pokemon.flipped img { transform: scaleX(-1); }
.room-pokemon.shiny img  { filter: drop-shadow(0 0 12px gold); }

/* Badge XP qui flotte */
.xp-float {
  position: absolute;
  background: var(--basic-c);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .65rem; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  animation: xpFloat 2s ease forwards;
  pointer-events: none;
  z-index: 6;
}
@keyframes xpFloat {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  20%  { transform: translateY(-10px) scale(1); opacity: 1; }
  80%  { transform: translateY(-30px) scale(1); opacity: 1; }
  100% { transform: translateY(-45px) scale(.8); opacity: 0; }
}

/* Bulle dernier Pokémon */
.last-pokemon-bubble {
  position: absolute;
  bottom: 60px; left: 50%; transform: translateX(-50%);
  background: white;
  border-radius: 16px; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  animation: bubbleIn .4s cubic-bezier(.34,1.56,.64,1);
  z-index: 40; max-width: 80%;
}
.last-pokemon-bubble[hidden] { display: none; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-50%) scale(.6) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}
.bubble-sprite { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.bubble-info { display: flex; flex-direction: column; gap: 2px; }
.bubble-name { font-weight: 900; font-size: .9rem; color: var(--text); }
.bubble-shiny { font-size: .7rem; color: var(--gold); font-weight: 800; }

.room-info-badge {
  position: absolute; bottom: 12px; left: 148px;
  background: rgba(255,255,255,.94);
  padding: 6px 12px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; color: var(--text-dim);
  box-shadow: 0 2px 6px var(--shadow);
  z-index: 30;
}
.room-info-badge[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════════
   Panneau d'infos chambre : météo + bonus + EXP/min + P$/min
   ══════════════════════════════════════════════════════════════ */
.room-stats-panel {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(255,255,255,.95);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
  backdrop-filter: blur(6px);
  z-index: 30;
  min-width: 150px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .72rem;
  color: var(--text-dim, #555);
  /* Transitions pour la bascule mini/étendu (pas sur top/left → drag instantané) */
  transition: background .15s, padding .2s, border-radius .2s, width .2s, height .2s, min-width .2s, max-width .2s;
  user-select: none;
  touch-action: none; /* nécessaire pour le drag tactile */
}
.room-stats-row {
  display: flex; align-items: center; gap: 8px;
}
.room-stats-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.room-stats-text {
  display: flex; flex-direction: column;
  line-height: 1.15;
  flex: 1; min-width: 0;
}
.room-stats-label {
  font-size: .62rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.room-stats-value {
  font-size: .82rem;
  font-weight: 800;
  color: #333;
}
.room-stats-bonus {
  font-size: .65rem;
  font-weight: 600;
  color: #4a7c59;
  background: rgba(74,124,89,.10);
  border-radius: 8px;
  padding: 4px 8px;
  text-align: center;
  line-height: 1.25;
}
.room-stats-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,.12), transparent);
  margin: 2px 0;
}
.room-stats-panel[hidden] { display: none; }

/* Bouton réduire/agrandir — en haut à droite du panneau */
.room-stats-toggle {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.06);
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-dim, #555);
  line-height: 1;
  padding: 0;
  z-index: 2;
  transition: background .15s, transform .12s;
}
.room-stats-toggle:hover  { background: rgba(0,0,0,.15); }
.room-stats-toggle:active { transform: scale(.9); }

/* ─── État RÉDUIT : bulle ronde 56×56, déplaçable ─── */
.room-stats-panel.mini {
  min-width: 0;
  max-width: none;
  width: 56px; height: 56px;
  padding: 0;
  border-radius: 50%;
  gap: 0;
  align-items: center;
  justify-content: center;
  cursor: grab;
  overflow: hidden;
}
.room-stats-panel.mini:active { cursor: grabbing; }
/* En mode mini, on cache tous les contenus détaillés */
.room-stats-panel.mini .room-stats-row,
.room-stats-panel.mini .room-stats-bonus,
.room-stats-panel.mini .room-stats-divider {
  display: none;
}
/* Icône météo dédiée au mode mini : cachée par défaut, visible en mini */
.room-stats-mini-icon {
  display: none;
  font-size: 1.7rem;
  line-height: 1;
}
.room-stats-panel.mini .room-stats-mini-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
/* En mode mini, le bouton toggle est plus petit, en haut à droite, en dehors */
.room-stats-panel.mini .room-stats-toggle {
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  font-size: .85rem;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.08);
}

/* Pendant un drag : pas de transition + ombre prononcée */
.room-stats-panel.dragging {
  transition: none !important;
  cursor: grabbing;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  z-index: 50;
}

@media (max-width: 380px) {
  .room-stats-panel {
    min-width: 130px;
    max-width: 150px;
    padding: 8px 10px;
    font-size: .68rem;
  }
  .room-stats-icon { font-size: 1rem; width: 20px; }
  .room-stats-value { font-size: .76rem; }
}

/* ══════════════════════════════════════════════════════════════
   PANNEAUX COMMUNS
   ══════════════════════════════════════════════════════════════ */
.panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px;
  background: white;
  border-bottom: 2px solid #f0e8e0;
  flex-shrink: 0;
}
.btn-back {
  background: #f0ece8; border: none; border-radius: 12px;
  width: 36px; height: 36px; font-size: 1.1rem;
  cursor: pointer; display: grid; place-items: center;
  font-weight: 900;
}
.btn-back:hover { background: #e8e0d8; }
.panel-title { font-size: 1.1rem; font-weight: 900; }

/* ══════════════════════════════════════════════════════════════
   BOUTIQUE
   ══════════════════════════════════════════════════════════════ */
.shop-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background: var(--cream);
}
.shop-counter {
  display: flex; align-items: center; gap: 6px;
  font-weight: 900; font-size: 1.1rem;
  margin-bottom: 14px;
}

.shop-cards { display: flex; flex-direction: column; gap: 14px; }

.shop-egg-card {
  background: white; border-radius: 18px;
  padding: 14px;
  box-shadow: 0 3px 12px var(--shadow);
  border-left: 6px solid;
  display: flex; flex-direction: column; gap: 10px;
}
.shop-egg-card.basic     { border-color: var(--basic-c); }
.shop-egg-card.advanced  { border-color: var(--advanced-c); }
.shop-egg-card.mystery   { border-color: #a050e0; }
.shop-egg-card.legendary { border-color: var(--legendary-c); animation: legendaryShimmer 3s ease-in-out infinite; }
@keyframes legendaryShimmer {
  0%,100% { box-shadow: 0 3px 12px var(--shadow); }
  50%     { box-shadow: 0 3px 20px rgba(248,200,32,.4), 0 0 30px rgba(248,200,32,.2); }
}
.shop-egg-card.mystery {
  animation: mysteryShimmer 4s ease-in-out infinite;
}
@keyframes mysteryShimmer {
  0%,100% { box-shadow: 0 3px 12px var(--shadow); }
  50%     { box-shadow: 0 3px 18px rgba(160,80,224,.45), 0 0 26px rgba(200,130,255,.25); }
}

/* Visuel œuf mystère (violet) */
.mystery-egg {
  background: radial-gradient(circle at 40% 35%, #e0b0ff, #a050e0);
}
.btn-open.mystery {
  background: linear-gradient(135deg, #a050e0, #8030c0);
}

.shop-egg-header { display: flex; gap: 12px; align-items: center; }

.shop-egg-visual {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.basic-egg     { background: radial-gradient(circle at 40% 35%, #a8f098, var(--basic-c)); }
.advanced-egg  { background: radial-gradient(circle at 40% 35%, #a0c0ff, var(--advanced-c)); }
.legendary-egg { background: radial-gradient(circle at 40% 35%, #fff0a0, var(--legendary-c)); }
.shop-egg-svg {
  font-size: 1.8rem; width: 56px; height: 56px;
  border-radius: 50%; display: grid; place-items: center;
  animation: shopEggFloat 2.5s ease-in-out infinite;
}
@keyframes shopEggFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

.shop-egg-info { flex: 1; min-width: 0; }
.shop-egg-info h3 { font-weight: 900; font-size: .95rem; margin-bottom: 3px; }
.shop-egg-info p  { font-size: .7rem; color: var(--text-dim); line-height: 1.4; }
.shop-egg-pool-count {
  font-size: .62rem; color: var(--text-dim); margin-top: 3px; font-weight: 600;
}
.shop-egg-price {
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 900; font-size: .78rem;
  color: var(--text);
}

/* Ligne des boutons d'ouverture */
.shop-egg-buttons {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px;
}
.btn-open {
  font-family: var(--font-main); font-weight: 900;
  font-size: .7rem; padding: 8px 4px;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform .1s, filter .1s;
  white-space: nowrap;
  color: white;
}
.btn-open:hover  { filter: brightness(1.1); }
.btn-open:active { transform: scale(.92); }
.btn-open.basic     { background: var(--basic-c); }
.btn-open.advanced  { background: var(--advanced-c); }
.btn-open.legendary { background: #d0a000; }

/* ── Couleurs par région ── */
.egg-kanto  { border-color: #e3350d !important; }
.egg-kanto  .btn-open { background: #e3350d; }
.egg-johto  { border-color: #9b59b6 !important; }
.egg-johto  .btn-open { background: #9b59b6; }
.egg-hoenn  { border-color: #27ae60 !important; }
.egg-hoenn  .btn-open { background: #27ae60; }
.egg-sinnoh { border-color: #2980b9 !important; }
.egg-sinnoh .btn-open { background: #2980b9; }
.egg-unys   { border-color: #7f8c8d !important; }
.egg-unys   .btn-open { background: #7f8c8d; }
.egg-kalos  { border-color: #e91e8c !important; }
.egg-kalos  .btn-open { background: #e91e8c; }
.egg-alola  { border-color: #f39c12 !important; }
.egg-alola  .btn-open { background: #f39c12; }
.egg-galar  { border-color: #6c3483 !important; }
.egg-galar  .btn-open { background: #6c3483; }
.egg-paldea { border-color: #c0392b !important; }
.egg-paldea .btn-open { background: #c0392b; }

/* 🌟 Genération Dreamy */
.egg-dreamy {
  border-color: #a78bfa !important;
  background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 50%, #1e1b4b 100%) !important;
  box-shadow: 0 0 18px rgba(167,139,250,0.45), 0 4px 16px rgba(0,0,0,0.3) !important;
  animation: dreamyShimmer 3s ease-in-out infinite;
}
.egg-dreamy h3, .egg-dreamy p, .egg-dreamy .shop-egg-pool-count { color: #e9d5ff !important; }
.egg-dreamy .shop-egg-price { color: #c4b5fd !important; }
.egg-dreamy .btn-open {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 2px 8px rgba(124,58,237,0.5);
}
.egg-dreamy .btn-open:hover { filter: brightness(1.15); transform: translateY(-2px); }
@keyframes dreamyShimmer {
  0%,100% { box-shadow: 0 0 18px rgba(167,139,250,0.45), 0 4px 16px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 0 32px rgba(167,139,250,0.8), 0 4px 20px rgba(0,0,0,0.4); }
}

/* Silhouette pour les Pokémon Dreamy non encore capturés */
/* ══════════════════════════════════════════════════════════════════
   🖤 SILHOUETTE — Pokémon Dreamy (Gen 10, IDs ≥ 1026) non capturé
   C'est ICI que la silhouette des Pokémon Dreamy est colorée
   en violet/indigo au lieu du noir standard.

   👉 C'est la SEULE règle spéciale Dreamy pour la silhouette.
      Les Pokémon Dreamy héritent aussi de .pokedex-cell.locked img
      (noire), mais celle-ci la remplace par une teinte violette.
   ══════════════════════════════════════════════════════════════════ */
.pokedex-cell.locked.dreamy-cell img {
  filter: brightness(0) opacity(.22) sepia(1) hue-rotate(240deg) saturate(4);
}
.pokedex-cell.dreamy-cell {
  background: linear-gradient(135deg, #1e1b4b55, #2e106533);
  border: 1.5px solid #7c3aed55;
  border-radius: 10px;
}
.pokedex-cell.dreamy-cell.owned {
  background: linear-gradient(135deg, #2e1065aa, #4c1d95aa);
  border-color: #a78bfa;
  box-shadow: 0 0 10px rgba(167,139,250,0.4);
}
.pokedex-cell.dreamy-cell .pokedex-number { color: #a78bfa; }
.pokedex-cell.dreamy-cell.owned .pokedex-name { color: #e9d5ff; font-weight: 700; }

/* Résultats d'ouverture */
.shop-results {
  margin-top: 20px; background: white;
  border-radius: 18px; padding: 16px;
  box-shadow: 0 3px 12px var(--shadow);
}
.shop-results[hidden] { display: none; }
.results-title { font-weight: 900; font-size: 1rem; margin-bottom: 12px; }
.results-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin-bottom: 14px;
  max-height: 400px; overflow-y: auto;
  padding: 2px;
}
.result-cell {
  aspect-ratio: 1; background: #f8f4f0;
  border-radius: 10px; display: grid; place-items: center;
  position: relative; cursor: pointer;
  transition: transform .1s;
  border: 2px solid transparent;
  animation: cellPop .3s cubic-bezier(.34,1.56,.64,1) both;
}
.result-cell:active { transform: scale(.92); }
.result-cell.shiny { border-color: var(--gold); background: #fffbe8; }
@keyframes cellPop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}
.result-cell img { width: 85%; height: 85%; object-fit: contain; image-rendering: pixelated; }
.result-cell .cell-star { position: absolute; top: 1px; right: 3px; font-size: .55rem; color: var(--gold); }

.results-highlight {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: #f8f4f0; border-radius: 12px;
}
.results-highlight img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.hi-info { flex: 1; }
.hi-name { font-weight: 900; font-size: .95rem; display: block; }
.hi-sub  { font-size: .72rem; color: var(--text-dim); }
.hi-shiny{ color: var(--gold); font-weight: 900; font-size: .75rem; }

/* ══════════════════════════════════════════════════════════════
   INVENTAIRE
   ══════════════════════════════════════════════════════════════ */
#screenInventory { background: var(--cream); }

.inv-tabs {
  display: flex; background: white;
  border-bottom: 2px solid #f0e8e0;
  flex-shrink: 0;
}
.inv-tab {
  flex: 1; padding: 12px 8px;
  font-family: var(--font-main); font-weight: 800; font-size: .85rem;
  background: none; border: none; cursor: pointer;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: color .2s, border-color .2s;
}
.inv-tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab-count {
  background: var(--orange); color: white;
  border-radius: 20px; padding: 1px 7px; font-size: .7rem;
}

.inv-panel { display: none; flex: 1; overflow-y: auto; padding: 14px; }
.inv-panel.active { display: block; }

.box-filters {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}
.box-select {
  font-family: var(--font-main); font-size: .78rem;
  padding: 6px 10px; border: 2px solid #e8ddd8;
  border-radius: 12px; background: white; color: var(--text);
  font-weight: 700; cursor: pointer;
}
.box-shiny-filter {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 700; cursor: pointer;
  color: var(--text-dim);
}
.box-shiny-filter input { accent-color: var(--gold); cursor: pointer; }
.box-size-btn {
  margin-left: auto;
  background: white; border: 2px solid #e8ddd8;
  border-radius: 12px; width: 40px; height: 40px;
  cursor: pointer; font-size: 1rem;
  display: grid; place-items: center;
  transition: background .15s, transform .1s;
}
.box-size-btn:hover  { background: #f8f0e8; }
.box-size-btn:active { transform: scale(.93); }

/* Barre de recherche */
.box-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.box-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  color: var(--text-dim);
  pointer-events: none;
}
.box-search-input {
  width: 100%;
  font-family: var(--font-main); font-size: .85rem;
  padding: 10px 36px 10px 34px;
  border: 2px solid #e8ddd8;
  border-radius: 14px;
  background: white; color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.box-search-input:focus { border-color: var(--orange); }
.box-search-input::placeholder { color: var(--text-dim); font-weight: 600; }
.box-search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: #f0ece8;
  border: none; border-radius: 50%;
  width: 22px; height: 22px;
  cursor: pointer;
  font-size: .65rem; color: var(--text-dim);
  display: grid; place-items: center;
}
.box-search-clear:hover { background: #e8dfd5; color: var(--text); }

/* Chips de filtre rapide */
.box-chip-filters {
  display: flex; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.box-chip {
  font-family: var(--font-main); font-weight: 800; font-size: .68rem;
  padding: 6px 10px;
  border: 2px solid #e8ddd8;
  border-radius: 14px;
  background: white;
  color: var(--text-dim);
  cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s, color .15s;
}
.box-chip:hover  { background: #fff8f0; border-color: var(--orange); }
.box-chip:active { transform: scale(.95); }
.box-chip.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* Compteur de capacité de la boîte */
.box-capacity {
  margin-top: 14px;
  padding: 8px 12px;
  background: white;
  border-radius: 10px;
  text-align: center;
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-dim);
  box-shadow: 0 2px 6px var(--shadow);
}
.box-capacity.near-full { color: #e08030; }
.box-capacity.full      { color: #e03050; background: #ffe8e8; }

/* Cœur favori sur les cellules de la boîte */
.box-cell .favorite-heart {
  position: absolute;
  top: 2px; right: 16px;
  font-size: .65rem;
  filter: drop-shadow(0 0 2px white);
  z-index: 3;
}
.box-grid.size-xsmall .favorite-heart { display: none; }

/* Bouton favori actif dans modal actions */
.action-btn.is-favorite {
  background: #ffe8f0;
  border-color: #ff70a0;
  color: #c02060;
}

/* Toggles audio */
.audio-toggles {
  display: flex; flex-direction: column; gap: 8px;
}
.audio-toggle {
  display: flex; align-items: center; gap: 10px;
  background: white;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700; font-size: .85rem;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.audio-toggle:hover { border-color: var(--orange); }
.audio-toggle input {
  accent-color: var(--orange);
  transform: scale(1.3);
  cursor: pointer;
}

/* Bouton Actualités */
.option-btn.news { background: #7c4dff; }

/* Modal Actualités */
.news-card {
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
}
.news-title {
  font-weight: 900; font-size: 1.25rem;
  text-align: center;
  margin-bottom: 4px;
}
.news-content {
  width: 100%;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--text);
}
.news-entry {
  background: #f8f4f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.news-date {
  font-weight: 900;
  color: var(--orange);
  font-size: .85rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px dashed #e8d8c0;
}
.news-content ul {
  padding-left: 18px;
}
.news-content li {
  margin-bottom: 6px;
}

/* Switch Pokédex / Shinydex */
.pokedex-mode-switch {
  display: flex;
  background: white;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 12px;
  gap: 4px;
  box-shadow: 0 2px 6px var(--shadow);
}
.pokedex-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-family: var(--font-main); font-weight: 800; font-size: .85rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.pokedex-mode-btn.active {
  background: var(--orange);
  color: white;
}
.pokedex-mode-btn.active[data-mode="shiny"] {
  background: linear-gradient(135deg, var(--gold), #e0a000);
  color: #3a2410;
}

/* Shinydex : cellules dorées */
.pokedex-grid.shinydex-mode .pokedex-cell.owned {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffbe8, white);
  box-shadow: 0 2px 8px rgba(255,215,0,.3);
}

/* Charme Chroma : style spécial de l'objet */
.item-card[data-item-id="charme-chroma"] {
  background: linear-gradient(135deg, #fff8ff, #ffe8ff);
  border: 2px solid #c090ff;
  box-shadow: 0 0 12px rgba(192,144,255,.4);
  animation: charmeGlow 2s ease-in-out infinite;
}
@keyframes charmeGlow {
  0%,100% { box-shadow: 0 0 12px rgba(192,144,255,.4); }
  50%     { box-shadow: 0 0 20px rgba(192,144,255,.6), 0 0 30px rgba(255,192,255,.3); }
}

/* Tailles de grille — xsmall ajouté pour le dézoom maximal */
.box-grid { display: grid; }
.box-grid.size-xsmall { grid-template-columns: repeat(8, 1fr); gap: 3px; }
.box-grid.size-small  { grid-template-columns: repeat(6, 1fr); gap: 5px; }
.box-grid.size-medium { grid-template-columns: repeat(5, 1fr); gap: 7px; }
.box-grid.size-large  { grid-template-columns: repeat(3, 1fr); gap: 10px; }

.box-empty {
  grid-column: 1/-1; text-align: center;
  padding: 40px 20px; color: var(--text-dim);
  font-size: .85rem; line-height: 2;
}

.box-cell {
  aspect-ratio: 1; background: white;
  border-radius: 12px; display: grid; place-items: center;
  position: relative; cursor: pointer;
  border: 2px solid #f0e8e0;
  transition: transform .1s, box-shadow .1s;
  animation: cellPop .3s cubic-bezier(.34,1.56,.64,1) both;
}
.box-cell:active { transform: scale(.9); }
.box-cell.shiny  { border-color: var(--gold); background: #fffbe8; box-shadow: 0 0 8px rgba(255,215,0,.4); }
.box-cell img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.box-cell .cell-star { position: absolute; top: 2px; right: 4px; font-size: .55rem; color: var(--gold); }
.box-cell .equipped-dot {
  position: absolute; bottom: 2px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #40d060; box-shadow: 0 0 6px #40d060;
}
.box-cell .cell-level {
  position: absolute; bottom: 2px; left: 4px;
  font-size: .5rem; color: white;
  background: rgba(0,0,0,.55);
  padding: 1px 4px; border-radius: 6px; font-weight: 900;
}
.box-grid.size-xsmall .cell-level,
.box-grid.size-xsmall .cell-star,
.box-grid.size-xsmall .equipped-dot { display: none; }
.box-grid.size-xsmall .box-cell { border-radius: 6px; border-width: 1px; }

.box-cell.type-basic     { border-top: 3px solid var(--basic-c); }
.box-cell.type-advanced  { border-top: 3px solid var(--advanced-c); }
.box-cell.type-legendary { border-top: 3px solid var(--legendary-c); }

/* Halo Pokémon évoluable — brille d'une lumière arc-en-ciel */
.box-cell.can-evolve {
  animation: canEvolveGlow 1.8s ease-in-out infinite;
  border-color: #8ee0ff !important;
}
.box-cell.can-evolve::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(45deg, #ff90ff, #90f0ff, #fff090, #90ffa0);
  background-size: 300% 300%;
  opacity: .35;
  animation: canEvolveBg 3s linear infinite;
  z-index: -1;
  pointer-events: none;
}
.box-cell.can-evolve::after {
  content: '✨';
  position: absolute;
  top: 2px; right: 4px;
  font-size: .7rem;
  animation: evoSparkle 1.5s ease-in-out infinite;
  z-index: 3;
}
@keyframes canEvolveGlow {
  0%,100% { box-shadow: 0 0 6px rgba(142,224,255,.6); }
  50%     { box-shadow: 0 0 16px rgba(142,224,255,.9), 0 0 28px rgba(255,200,255,.4); }
}
@keyframes canEvolveBg {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes evoSparkle {
  0%,100% { transform: scale(1) rotate(0deg); opacity: .9; }
  50%     { transform: scale(1.25) rotate(15deg); opacity: 1; }
}

/* Pokémon de la chambre qui peut évoluer */
.room-pokemon.can-evolve {
  filter: drop-shadow(0 0 10px #8ee0ff) drop-shadow(0 0 18px #ff90ff);
  animation: roomIdle 2.5s ease-in-out infinite, canEvolveRoom 1.8s ease-in-out infinite;
}
@keyframes canEvolveRoom {
  0%,100% { filter: drop-shadow(0 0 10px #8ee0ff) drop-shadow(0 0 18px #ff90ff); }
  50%     { filter: drop-shadow(0 0 16px #8ee0ff) drop-shadow(0 0 30px #ff90ff); }
}

/* Mode sélection */
.box-cell.selectable {
  cursor: pointer;
}
.box-cell.selected {
  border-color: var(--orange) !important;
  background: #fff4e0;
  box-shadow: 0 0 0 3px rgba(240,120,48,.35);
}
.box-cell .selection-check {
  position: absolute;
  top: 2px; left: 4px;
  width: 18px; height: 18px;
  background: white;
  border: 2px solid var(--orange);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .7rem; color: var(--orange);
  font-weight: 900;
  z-index: 4;
}
.box-cell.selected .selection-check {
  background: var(--orange); color: white;
}
.box-cell.selected .selection-check::before {
  content: '✓';
}

/* Barre d'actions groupées */
.bulk-bar {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fff8f0, white);
  border: 2px solid var(--orange);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
  animation: bulkIn .3s ease;
}
.bulk-bar[hidden] { display: none; }
@keyframes bulkIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bulk-count {
  flex: 1;
  font-size: .8rem; font-weight: 900;
  color: var(--orange);
  min-width: 100%;
  margin-bottom: 4px;
}
.bulk-btn {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--font-main); font-weight: 800; font-size: .72rem;
  border: none; border-radius: 10px;
  background: #f0ece8; color: var(--text);
  cursor: pointer;
  transition: transform .1s, filter .15s;
  min-width: 72px;
  white-space: nowrap;
}
.bulk-btn:hover  { filter: brightness(1.08); }
.bulk-btn:active { transform: scale(.94); }
.bulk-btn.equip   { background: var(--basic-c);     color: white; }
.bulk-btn.unequip { background: var(--advanced-c);  color: white; }
.bulk-btn.danger  { background: #e03050;            color: white; }
.bulk-btn.favorite {
  background: linear-gradient(135deg, #ff6680, #e03050);
  color: white;
  box-shadow: 0 2px 6px rgba(224,48,80,.3);
}
.bulk-btn.favorite:hover { filter: brightness(1.12); }
.bulk-btn.berry { background: linear-gradient(135deg, #a8e063, #56ab2f); color: white; box-shadow: 0 2px 6px rgba(86,171,47,.35); }
.bulk-btn.berry:hover { filter: brightness(1.12); }
.bulk-feed-card { max-width: 440px; width: 95%; }
.bulk-feed-berry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; margin: 10px 0 14px; padding: 4px; }
.bulk-feed-berry-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: #f7f4f0; border: 2px solid transparent; cursor: pointer; transition: border-color .15s, background .15s; font-size: .72rem; font-weight: 700; text-align: center; }
.bulk-feed-berry-cell:hover { background: #eef8e0; border-color: #a8e063; }
.bulk-feed-berry-cell.selected { border-color: #56ab2f; background: linear-gradient(135deg, #eef8e0, #d4f0a8); }
.bulk-feed-berry-cell.empty { opacity: .4; cursor: not-allowed; }
.bulk-feed-berry-icon { font-size: 1.5rem; }
.bulk-feed-berry-name { font-size: .65rem; color: var(--text); line-height: 1.2; }
.bulk-feed-berry-qty { font-size: .68rem; color: #56ab2f; font-weight: 900; }
.bulk-feed-berry-aff { font-size: .62rem; color: #888; }
.bulk-feed-footer { display: flex; justify-content: center; padding-top: 4px; }
.bulk-feed-confirm-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #a8e063, #56ab2f); color: white; border: none; border-radius: 12px; font-family: var(--font-main); font-weight: 900; font-size: .9rem; cursor: pointer; transition: filter .15s; }
.bulk-feed-confirm-btn:disabled { background: #ccc; cursor: not-allowed; }
.bulk-feed-confirm-btn:not(:disabled):hover { filter: brightness(1.08); }

/* Bouton Évoluer dans modal actions (style spécial) */
.action-btn#evolveBtn {
  background: linear-gradient(135deg, #fff4ff, #e8f4ff);
  border-color: #c090ff;
  color: #8030c0;
  font-weight: 900;
  animation: evoBtnShimmer 2s ease-in-out infinite;
}
.action-btn#evolveBtn:hover {
  background: linear-gradient(135deg, #ffe8ff, #d8ecff);
  border-color: #a060f0;
}
@keyframes evoBtnShimmer {
  0%,100% { box-shadow: 0 0 0 rgba(192,144,255,0); }
  50%      { box-shadow: 0 0 14px rgba(192,144,255,.5); }
}

/* Pokédex : silhouettes masquées complètement pour les non-trouvés */
.pokedex-detail-sprite.locked {
  display: none !important;
}
.pokedex-detail-placeholder {
  width: 110px; height: 110px;
  margin: 0 auto 10px;
  background: #f0ece8;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 3rem; color: var(--text-dim);
}
.pokedex-detail-placeholder[hidden] { display: none !important; }

/* Objets */
.items-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.item-card {
  background: white; border-radius: 16px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 2px 8px var(--shadow);
  text-align: center; cursor: pointer;
  transition: transform .1s, box-shadow .15s;
  animation: cellPop .3s cubic-bezier(.34,1.56,.64,1) both;
}
.item-card:hover  { box-shadow: 0 4px 14px rgba(0,0,0,.15); transform: translateY(-2px); }
.item-card:active { transform: scale(.95); }
.item-icon { font-size: 1.8rem; }
.item-img {
  width: 42px; height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}
.item-name { font-size: .65rem; font-weight: 800; color: var(--text); }
.item-qty  {
  background: #f0ece8; border-radius: 10px; padding: 2px 8px;
  font-size: .7rem; font-weight: 900; color: var(--text-dim);
}
.items-empty {
  grid-column: 1/-1; text-align: center;
  padding: 40px 20px; color: var(--text-dim);
  font-size: .85rem; line-height: 2;
}

/* ══════════════════════════════════════════════════════════════
   MODALS (HARD FIX hidden)
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; bottom: var(--nav-h);
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay[hidden] { display: none !important; }

.modal-card {
  background: white; border-radius: 24px; padding: 22px 20px;
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: relative;
  animation: modalIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: #f0ece8; border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: .9rem;
  z-index: 10;
}
.modal-close:hover { background: #e8e0d8; }
.modal-shiny-badge {
  background: var(--gold); color: #6a4000;
  padding: 4px 12px; border-radius: 20px; font-size: .7rem; font-weight: 900;
  animation: shinePulse 1.2s ease-in-out infinite alternate;
}
@keyframes shinePulse {
  from { box-shadow: 0 0 8px var(--gold); }
  to   { box-shadow: 0 0 20px var(--gold), 0 0 35px rgba(255,215,0,.5); }
}
.modal-frame {
  width: 130px; height: 130px; border-radius: 16px;
  background: #f8f4f0; display: grid; place-items: center;
  border: 3px solid #f0e8e0;
}
.modal-frame.shiny { border-color: var(--gold); background: #fffbe8; }
.modal-sprite { width: 110px; height: 110px; object-fit: contain; image-rendering: pixelated; }
.modal-type-badge {
  font-size: .65rem; font-weight: 800;
  padding: 3px 12px; border-radius: 20px;
}
.modal-type-badge.basic     { background: #e8fce0; color: #2a7020; }
.modal-type-badge.advanced  { background: #e0ecff; color: #1a40a0; }
.modal-type-badge.legendary { background: #fff8d8; color: #806000; }

/* Actions */
.actions-card { max-width: 300px; }
.actions-header {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 4px 14px;
  border-bottom: 2px solid #f0e8e0;
  margin-bottom: 8px;
  width: 100%;
}
.modal-frame.small { width: 72px; height: 72px; }
.actions-sprite { width: 62px; height: 62px; object-fit: contain; image-rendering: pixelated; }
.actions-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.actions-name { font-weight: 900; font-size: 1.05rem; color: var(--text); }
.actions-sub  { font-size: .72rem; color: var(--text-dim); }
.actions-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.action-btn {
  display: flex; align-items: center; gap: 12px;
  background: #f8f4f0; border: 2px solid transparent;
  border-radius: 14px; padding: 12px 16px;
  font-family: var(--font-main); font-weight: 800; font-size: .9rem;
  color: var(--text); cursor: pointer; text-align: left;
  transition: background .15s, transform .1s, border-color .15s;
}
.action-btn:hover  { background: #fff8f0; border-color: var(--orange); }
.action-btn:active { transform: scale(.97); }
.action-btn.active-equip { background: #e0fce8; border-color: #40b060; color: #1a7030; }
.action-btn.danger { color: #c02040; }
.action-btn.danger:hover { background: #fff0f0; border-color: #e03050; }
.action-ico { font-size: 1.25rem; flex-shrink: 0; }
.action-text { flex: 1; }

/* Résumé */
.summary-card { max-width: 320px; }
.summary-info { width: 100%; margin-top: 8px; }
.summary-name-row {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; margin-bottom: 4px;
}
.summary-number { font-size: .72rem; color: var(--text-dim); font-weight: 700; }
.summary-name   { font-size: 1.25rem; font-weight: 900; color: var(--text); }
.summary-gender {
  font-size: 1rem; font-weight: 900;
  padding: 2px 7px; border-radius: 50%; line-height: 1;
}
.summary-gender.male   { color: #4a90e8; background: #dfeeff; }
.summary-gender.female { color: #e84a8a; background: #ffdfee; }
.summary-species { font-size: .75rem; color: var(--text-dim); text-align: center; margin-bottom: 14px; }
.summary-stats {
  display: flex; flex-direction: column; gap: 10px;
  background: #f8f4f0;
  border-radius: 14px; padding: 14px;
  width: 100%;
}
.stat-row { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.stat-label { font-weight: 800; color: var(--text-dim); min-width: 80px; flex-shrink: 0; }
.stat-value { font-weight: 900; color: var(--text); }
.xp-bar, .affection-bar {
  flex: 1; height: 14px;
  background: #e8ddd0; border-radius: 10px;
  overflow: hidden; position: relative;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--basic-c), #8ee078);
  border-radius: 10px;
  transition: width .6s cubic-bezier(.34,1.56,.64,1);
}
.xp-text, .affection-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 900; color: #3a2a1a;
  text-shadow: 0 0 3px white;
}
.affection-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), #ffaac0);
  border-radius: 10px;
  transition: width .5s ease;
}

/* Renommer */
.rename-card { max-width: 300px; gap: 12px; }
.rename-title { font-weight: 900; font-size: 1.1rem; }
.rename-sprite {
  width: 80px; height: 80px; object-fit: contain;
  image-rendering: pixelated;
  background: #f8f4f0; border-radius: 16px; padding: 6px;
}
.rename-sub { font-size: .8rem; color: var(--text-dim); font-weight: 700; }
.rename-input {
  width: 100%;
  font-family: var(--font-main); font-size: 1rem; font-weight: 700;
  text-align: center; padding: 12px 14px;
  border: 2px solid #e8ddd8; border-radius: 14px;
  background: #fff8f0; color: var(--text); outline: none;
  transition: border-color .15s;
}
.rename-input:focus { border-color: var(--orange); background: white; }
.rename-buttons { display: flex; gap: 8px; width: 100%; }
.rename-btn {
  flex: 1; font-family: var(--font-main);
  font-weight: 900; font-size: .85rem;
  padding: 11px 14px; border: none; border-radius: 14px;
  cursor: pointer; transition: transform .1s, filter .1s;
}
.rename-btn:hover  { filter: brightness(1.08); }
.rename-btn:active { transform: scale(.96); }
.rename-btn.primary   { background: var(--orange); color: white; }
.rename-btn.secondary { background: #f0ece8;       color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   MODAL CHOIX UTILISER / VENDRE
   ══════════════════════════════════════════════════════════════ */
.choice-card { max-width: 320px; gap: 16px; }
.choice-header {
  text-align: center;
  padding: 6px 0 12px;
  border-bottom: 2px solid #f0e8e0;
  width: 100%;
}
.choice-big-icon {
  font-size: 3.2rem;
  margin-bottom: 6px;
  display: inline-block;
  animation: choiceIconFloat 2s ease-in-out infinite;
}
@keyframes choiceIconFloat {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-4px) rotate(3deg); }
}
.choice-item-name {
  font-size: 1.15rem; font-weight: 900;
  color: var(--text); margin-bottom: 4px;
}
.choice-item-desc {
  font-size: .78rem; color: var(--text-dim);
  margin-bottom: 8px; line-height: 1.4;
}
.choice-item-owned {
  font-size: .75rem; font-weight: 800;
  color: var(--orange);
  background: #fff4e0;
  display: inline-block;
  padding: 3px 12px; border-radius: 10px;
}

.choice-buttons {
  display: flex; gap: 10px;
  width: 100%;
}
.choice-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  padding: 14px 10px;
  border: none; border-radius: 16px;
  cursor: pointer;
  font-family: var(--font-main);
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform .1s, filter .15s, box-shadow .15s;
}
.choice-btn:hover  { filter: brightness(1.1); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.choice-btn:active { transform: scale(.95); }
.choice-btn.use {
  background: linear-gradient(135deg, var(--basic-c), #40a030);
}
.choice-btn.sell {
  background: linear-gradient(135deg, var(--legendary-c), #d0a000);
  color: #3a2410;
}
.choice-btn-ico { font-size: 1.6rem; line-height: 1; margin-bottom: 2px; }
.choice-btn-main { font-size: .95rem; font-weight: 900; }
.choice-btn-sub  { font-size: .65rem; font-weight: 700; opacity: .9; }

/* Utiliser objet */
.useitem-card { max-width: 340px; }
.useitem-title { font-weight: 900; font-size: 1.05rem; text-align: center; }
.useitem-sub { font-size: .78rem; color: var(--text-dim); margin-bottom: 10px; text-align: center; }
.useitem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; width: 100%;
  max-height: 340px; overflow-y: auto;
}
.useitem-cell {
  aspect-ratio: 1; background: #f8f4f0;
  border-radius: 10px; display: grid; place-items: center;
  position: relative; cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s, border-color .15s;
}
.useitem-cell:hover  { border-color: var(--orange); background: white; }
.useitem-cell:active { transform: scale(.9); }
.useitem-cell.disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.useitem-cell img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.useitem-cell .cell-star { position: absolute; top: 1px; right: 3px; font-size: .55rem; color: var(--gold); }
.useitem-cell .level-badge {
  position: absolute; bottom: 1px; left: 3px;
  font-size: .55rem; color: white; background: var(--orange);
  padding: 1px 4px; border-radius: 6px; font-weight: 900;
}
.useitem-empty {
  grid-column: 1/-1;
  padding: 24px; text-align: center;
  color: var(--text-dim); font-size: .82rem; line-height: 1.8;
}

/* Quantité (bonbons) */
.quantity-card { max-width: 320px; gap: 12px; }
.quantity-title { font-weight: 900; font-size: 1.05rem; text-align: center; }
.quantity-target {
  display: flex; align-items: center; gap: 10px;
  background: #f8f4f0; border-radius: 12px; padding: 8px 12px;
  width: 100%;
}
.quantity-target img {
  width: 48px; height: 48px; object-fit: contain;
  image-rendering: pixelated;
}
.quantity-target-name { font-weight: 900; font-size: .92rem; }
.quantity-target-level { font-size: .72rem; color: var(--text-dim); }
.quantity-owned {
  font-size: .75rem; color: var(--text-dim); font-weight: 700;
  text-align: center;
}
.quantity-controls {
  display: flex; align-items: center; gap: 6px;
  width: 100%; justify-content: center;
}
.qty-btn {
  background: #f0ece8; border: none;
  border-radius: 10px; padding: 10px 12px;
  font-family: var(--font-main); font-weight: 900; font-size: .78rem;
  cursor: pointer; color: var(--text);
  transition: background .1s, transform .1s;
  min-width: 44px;
}
.qty-btn:hover  { background: #e8e0d8; }
.qty-btn:active { transform: scale(.94); }
.qty-display {
  flex: 1; text-align: center;
  font-size: 1.8rem; font-weight: 900; color: var(--orange);
  background: #fff8f0;
  border: 2px solid var(--orange);
  border-radius: 14px; padding: 6px 12px;
  min-width: 70px;
}
.qty-shortcuts {
  display: flex; gap: 5px; width: 100%; justify-content: center;
}
.qty-shortcut {
  flex: 1;
  background: #f8f4f0; border: 2px solid transparent;
  border-radius: 10px; padding: 6px 10px;
  font-family: var(--font-main); font-weight: 800; font-size: .74rem;
  cursor: pointer; color: var(--text);
  transition: background .1s, border-color .15s;
}
.qty-shortcut:hover { background: #fff8f0; border-color: var(--orange); }
.qty-preview {
  font-size: .85rem; font-weight: 900; color: var(--basic-c);
  background: #e8fce0; padding: 8px 14px; border-radius: 12px;
  text-align: center; width: 100%;
}
.qty-actions { display: flex; gap: 8px; width: 100%; }

/* Options */
.options-card {
  max-width: 340px;
  max-height: 85vh;
  overflow-y: auto;
  align-items: stretch;
  gap: 12px;
  padding: 20px 18px;
}
.options-title { font-weight: 900; font-size: 1.15rem; text-align: center; }
.options-section {
  background: #f8f4f0; border-radius: 12px; padding: 12px;
}
.options-section h4 { font-size: .88rem; font-weight: 900; margin-bottom: 4px; }
.options-section p  { font-size: .7rem; color: var(--text-dim); margin-bottom: 8px; line-height: 1.5; }
.option-btn {
  width: 100%;
  background: var(--basic-c); color: white;
  border: none; border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-main); font-weight: 900; font-size: .82rem;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.option-btn:hover  { filter: brightness(1.1); }
.option-btn:active { transform: scale(.96); }
.option-btn.load   { background: var(--advanced-c); }
.option-btn.danger { background: #e03050; }
.options-version  { text-align: center; font-size: .68rem; color: var(--text-dim); }

/* Toast */
.toast {
  position: fixed;
  top: calc(var(--nav-h) + 20px);
  left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 12px 20px; border-radius: 20px;
  font-weight: 900; font-size: .85rem;
  z-index: 400;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1), toastOut .3s 2.2s ease forwards;
}
.toast.success { background: linear-gradient(135deg, var(--basic-c), #40a030); }
.toast.warning { background: linear-gradient(135deg, #f8a030, #e07800); }
.toast.info    { background: linear-gradient(135deg, #5890f8, #3070d8); }
.toast.evolve  { background: linear-gradient(135deg, var(--gold), #e0a000); color: #3a2a1a; }
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -20px); } }

/* Welcome popup */
.welcome-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,5,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: welcomeFadeIn .4s ease;
}
.welcome-overlay.closing { animation: welcomeFadeOut .3s ease forwards; }
.welcome-overlay[hidden] { display: none !important; }
@keyframes welcomeFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcomeFadeOut { from { opacity: 1; } to { opacity: 0; } }
.welcome-card {
  background: linear-gradient(160deg, #fff 0%, #fff8f0 100%);
  border-radius: 28px; padding: 32px 24px 26px;
  width: 100%; max-width: 340px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: welcomeCardIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes welcomeCardIn {
  from { transform: scale(.6) translateY(40px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.welcome-icon {
  font-size: 4rem; margin-bottom: 8px;
  animation: welcomeBounce 1.5s ease-in-out infinite;
  display: inline-block;
}
@keyframes welcomeBounce {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%     { transform: translateY(-8px) rotate(5deg); }
}
.welcome-title { font-weight: 900; font-size: 1.4rem; margin-bottom: 10px; line-height: 1.2; }
.welcome-text  { font-size: .88rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; font-weight: 600; }
.welcome-tips  { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 24px; text-align: left; }
.welcome-tip {
  display: flex; align-items: center; gap: 10px;
  background: #fff8f0; border-radius: 14px; padding: 10px 14px;
  font-size: .8rem; font-weight: 700; border: 2px solid #f0e0d0;
}
.tip-icon { font-size: 1.1rem; flex-shrink: 0; }
.welcome-btn {
  background: linear-gradient(135deg, var(--orange), #f85c20);
  color: white; border: none; border-radius: 20px;
  padding: 14px 26px;
  font-family: var(--font-main); font-weight: 900; font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(240,120,48,.4);
  transition: transform .15s;
  width: 100%;
}
.welcome-btn:active { transform: scale(.96); }

/* ══════════════════════════════════════════════════════════════
   FLASH ÉCLOSION
   ══════════════════════════════════════════════════════════════ */
.hatch-overlay { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.hatch-overlay[hidden] { display: none !important; }
.hatch-flash { position: absolute; inset: 0; background: white; opacity: 0; }
.hatch-overlay.active .hatch-flash { animation: flashAnim .5s ease forwards; }
@keyframes flashAnim { 0%{opacity:0} 20%{opacity:1} 100%{opacity:0} }

/* ══════════════════════════════════════════════════════════════
   ANIMATION D'ÉVOLUTION
   ══════════════════════════════════════════════════════════════ */
.evolution-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(40,20,80,.85) 0%, rgba(10,5,30,.95) 80%);
  z-index: 350;
  display: flex; align-items: center; justify-content: center;
  animation: evoFadeIn .4s ease;
}
.evolution-overlay[hidden] { display: none !important; }
@keyframes evoFadeIn { from { opacity: 0; } to { opacity: 1; } }

.evolution-scene {
  position: relative;
  width: 280px; height: 340px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
}

.evolution-sprite-wrap {
  position: relative;
  width: 180px; height: 180px;
  display: grid; place-items: center;
}
.evo-sprite {
  position: absolute;
  width: 180px; height: 180px;
  object-fit: contain;
  image-rendering: pixelated;
}
.evo-sprite.before {
  filter: brightness(0) drop-shadow(0 0 20px white);
  animation: evoFlashIn 3.5s ease forwards;
}
.evo-sprite.after {
  filter: brightness(0) drop-shadow(0 0 20px white);
  opacity: 0;
  animation: evoFlashOut 3.5s ease 1.5s forwards;
}

@keyframes evoFlashIn {
  0%   { filter: brightness(1); }
  20%  { filter: brightness(0) drop-shadow(0 0 10px white); }
  100% { filter: brightness(0) drop-shadow(0 0 40px white); transform: scale(1.1); opacity: 0; }
}
@keyframes evoFlashOut {
  0%   { opacity: 0; filter: brightness(0) drop-shadow(0 0 30px white); transform: scale(1.1); }
  60%  { opacity: 1; filter: brightness(0) drop-shadow(0 0 30px white); }
  100% { opacity: 1; filter: brightness(1); transform: scale(1); }
}

/* Étoiles d'évolution */
.evolution-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.evo-star {
  position: absolute;
  font-size: 1.2rem;
  color: var(--gold);
  animation: evoStar 2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px white);
}
@keyframes evoStar {
  0%, 100% { transform: scale(.5) rotate(0deg); opacity: 0; }
  50%      { transform: scale(1.4) rotate(180deg); opacity: 1; }
}

.evolution-text {
  display: flex; align-items: center; gap: 14px;
  color: white;
  font-weight: 900; font-size: 1.2rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: evoTextIn 1s ease 3.3s both;
}
@keyframes evoTextIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.evo-arrow {
  color: var(--gold);
  font-size: 1.4rem;
  animation: arrowPulse 1s ease-in-out infinite alternate;
}
@keyframes arrowPulse {
  from { transform: translateX(-3px); opacity: .6; }
  to   { transform: translateX(3px);  opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   ÉCRAN AMIS
   ══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   ÉCRAN AMIS — CSS COMPLET
   Colle ce bloc dans ton Style.css (remplace TOUTES les anciennes
   règles friends / fr- / add-friend / trade-friend-picker)
   ═══════════════════════════════════════════════════════════════ */

/* ── Écran de base ── */
#screenFriends {
  background: #eaf6ff;
}
#screenFriends.active {
  display: flex !important;
  flex-direction: column;
}

/* ── Corps scrollable ── */
.fr-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Barre de statut connexion ── */
.fr-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-dim);
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.fr-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #d0c0b0;
  flex-shrink: 0;
  transition: background .3s;
}
.fr-status.connected .fr-dot {
  background: #68c050;
  box-shadow: 0 0 0 3px rgba(104,192,80,.25);
  animation: frPulse 2s ease-in-out infinite;
}
.fr-status.error .fr-dot { background: #e03050; }
.fr-status.local  .fr-dot { background: #f0a020; }
@keyframes frPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:.7; transform:scale(1.25); }
}

/* ── Carte ID joueur ── */
.fr-id-card {
  background: linear-gradient(135deg, #fff4e0, #fce8c8);
  border-radius: 20px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(160,100,40,.15);
  border: 1.5px solid rgba(240,120,48,.2);
}
.fr-id-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fr-id-pokeball {
  font-size: 2rem;
  width: 52px; height: 52px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  flex-shrink: 0;
  color: #f07830;
}
.fr-id-label {
  font-size: .65rem;
  font-weight: 900;
  color: #a06030;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 4px;
}
.fr-id-value {
  font-family: 'Courier New', monospace;
  font-size: 1.55rem;
  font-weight: 900;
  color: #f07830;
  letter-spacing: .2em;
  user-select: all;
}
.fr-id-btns {
  display: flex;
  gap: 8px;
}
.fr-id-btn {
  flex: 1;
  background: white;
  border: 1.5px solid rgba(240,120,48,.35);
  border-radius: 10px;
  padding: 9px;
  font-size: .8rem;
  font-weight: 800;
  color: #f07830;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background .15s, border-color .15s, transform .1s;
}
.fr-id-btn:hover  { background: #fff0e4; border-color: #f07830; }
.fr-id-btn:active { transform: scale(.97); }
.fr-id-btn.copied { background: #e8f8e0; color: #4a8030; border-color: #68c050; }
.fr-id-hint {
  font-size: .72rem;
  color: #a06030;
  text-align: center;
  font-style: italic;
}

/* ── Boutons d'action principaux ── */
.fr-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: white;
  border: 2.5px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  font-family: var(--font-main);
  text-align: left;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  transition: transform .12s, box-shadow .15s, border-color .15s;
  width: 100%;
}
.fr-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.fr-action-btn:active { transform: scale(.98); }

.fr-action-icon {
  font-size: 1.7rem;
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fr-btn-add .fr-action-icon  { background: #e8f8e0; }
.fr-btn-add:hover            { border-color: #68c050; }
.fr-btn-trade .fr-action-icon { background: #fff0e0; }
.fr-btn-trade:hover           { border-color: #f07830; }

.fr-action-texts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fr-action-title {
  font-size: .97rem;
  font-weight: 900;
  color: #2a2418;
}
.fr-action-sub {
  font-size: .72rem;
  color: var(--text-dim);
  font-weight: 600;
}
.fr-action-arrow {
  font-size: 1.4rem;
  color: #d0c0b0;
}
.fr-trade-badge {
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f0ece8;
  color: #9a8a7a;
  white-space: nowrap;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.fr-trade-badge.has-friends {
  background: #e8f8e0;
  color: #4a8030;
}

/* ── Cartes (liste amis / demandes) ── */
.fr-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
}
.fr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  font-weight: 900;
  color: #2a2418;
}
.fr-badge {
  background: #f07830;
  color: white;
  border-radius: 20px;
  padding: 1px 9px;
  font-size: .68rem;
  font-weight: 900;
}
.fr-empty {
  text-align: center;
  padding: 12px;
  color: var(--text-dim);
  font-size: .8rem;
  font-style: italic;
}

/* ── Items dans les listes ── */
.fr-friend-item,
.fr-request-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdf4e8;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.fr-friend-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f0e0c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1.5px solid #e8d0b8;
}
.fr-friend-info,
.fr-request-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fr-friend-name,
.fr-request-name {
  font-size: .85rem;
  font-weight: 900;
  color: #2a2418;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fr-friend-code {
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  color: #a08060;
  letter-spacing: .08em;
}
.fr-request-sub {
  font-size: .72rem;
  color: var(--text-dim);
  font-style: italic;
}
.fr-friend-actions,
.fr-request-btns {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.fr-friend-btn,
.fr-req-btn {
  border: none;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
  font-family: var(--font-main);
  transition: filter .15s, transform .1s;
}
.fr-friend-btn.trade  { background: #f07830; color: white; }
.fr-friend-btn.remove { background: #e03050; color: white; }
.fr-req-btn.accept    { background: #68c050; color: white; }
.fr-req-btn.reject    { background: #e03050; color: white; }
.fr-friend-btn:hover,
.fr-req-btn:hover  { filter: brightness(1.1); }
.fr-friend-btn:active,
.fr-req-btn:active { transform: scale(.95); }
.fr-friend-id {
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  font-weight: 900;
  color: #2a2418;
  letter-spacing: .08em;
  flex: 1;
}
.fr-item-btn {
  background: #f07830;
  color: white;
  border: none;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font-main);
  transition: filter .15s, transform .1s;
}
.fr-item-btn:hover  { filter: brightness(1.1); }
.fr-item-btn:active { transform: scale(.95); }
.fr-item-btn.accept { background: #68c050; }
.fr-item-btn.danger { background: #e03050; }

/* ── MODALS ── */
.fr-modal-card {
  max-width: 340px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
}
.fr-modal-icon {
  font-size: 2.8rem;
  width: 76px; height: 76px;
  background: linear-gradient(135deg, #fff4e0, #fce8c8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.fr-modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #2a2418;
  margin: 0;
}
.fr-modal-sub {
  font-size: .82rem;
  color: var(--text-dim);
  margin: 0;
}
.fr-modal-tip {
  font-size: .7rem;
  color: var(--text-dim);
  font-style: italic;
}
.fr-input {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: .22em;
  padding: 12px;
  border: 2px solid #e8ddd8;
  border-radius: 12px;
  text-transform: uppercase;
  outline: none;
  background: white;
  color: #2a2418;
  transition: border-color .15s;
}
.fr-input:focus { border-color: #f07830; }
.fr-submit-btn {
  width: 100%;
  background: #68c050;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: .92rem;
  font-weight: 900;
  cursor: pointer;
  font-family: var(--font-main);
  transition: filter .15s, transform .1s;
}
.fr-submit-btn:hover  { filter: brightness(1.08); }
.fr-submit-btn:active { transform: scale(.98); }

/* ── Picker liste amis (modal échange) ── */
.fr-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
}
.fr-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf4e8;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .1s;
}
.fr-picker-item:hover  { border-color: #f07830; }
.fr-picker-item:active { transform: scale(.97); }
.fr-picker-item .fr-friend-id { flex: 1; }
.fr-picker-item .fr-arrow { font-size: 1.2rem; color: #f07830; }
/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: white;
  border-top: 2px solid #f0e8e0;
  display: flex; align-items: stretch; justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 2px;
  transition: background .15s;
  position: relative;
}
.nav-btn:active { background: #f8f0e8; }
.nav-icon { font-size: 1.3rem; }
.nav-label {
  font-family: var(--font-main); font-weight: 900;
  font-size: .46rem; color: var(--text-dim);
  text-align: center; line-height: 1.2;
  letter-spacing: .03em;
}
.nav-badge {
  position: absolute;
  top: 4px; right: 12px;
  background: #e03050; color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: .6rem; font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  animation: badgePulse 1.5s ease-in-out infinite;
}
.nav-badge[hidden] { display: none; }
@keyframes badgePulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.15); }
}
.nav-center { flex: 1.3; position: relative; }
.nav-center-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--basic-c), var(--advanced-c), var(--legendary-c), var(--orange), var(--basic-c));
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  position: relative;
  margin-top: -18px;
  animation: centerRing 6s linear infinite;
}
@keyframes centerRing { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
.nav-center-ring::before {
  content: ''; position: absolute; inset: 3px;
  background: white; border-radius: 50%;
}
.nav-center-icon { font-size: 1.4rem; position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════════
   ÉCRAN QUÊTES
   ══════════════════════════════════════════════════════════════ */
#screenQuests { background: var(--cream); }
.quests-body { flex: 1; overflow-y: auto; padding: 14px; }
.quests-intro {
  background: white; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 14px;
  box-shadow: 0 2px 8px var(--shadow);
}
.quests-intro p { font-size: .85rem; line-height: 1.5; color: var(--text); }
.quests-intro-sub { font-size: .75rem; color: var(--text-dim); margin-top: 6px; }
.quests-empty {
  text-align: center; padding: 30px 20px;
  color: var(--text-dim); font-size: .85rem;
}

.quests-list { display: flex; flex-direction: column; gap: 12px; }
.quest-card {
  background: white; border-radius: 18px;
  padding: 14px;
  box-shadow: 0 3px 10px var(--shadow);
  border-left: 6px solid;
  display: flex; flex-direction: column; gap: 10px;
  animation: cellPop .35s cubic-bezier(.34,1.56,.64,1) both;
}
.quest-card.diff-easy   { border-color: var(--basic-c); }
.quest-card.diff-medium { border-color: var(--advanced-c); }
.quest-card.diff-hard   { border-color: var(--legendary-c); }
.quest-card.diff-epic   { border-color: var(--orange); animation: epicShimmer 3s infinite; }
@keyframes epicShimmer {
  0%,100% { box-shadow: 0 3px 10px var(--shadow); }
  50%      { box-shadow: 0 3px 18px rgba(240,120,48,.4); }
}

.quest-header {
  display: flex; align-items: flex-start; gap: 12px;
}
.quest-icon {
  font-size: 2rem;
  width: 48px; height: 48px;
  flex-shrink: 0;
  background: #f8f4f0; border-radius: 12px;
  display: grid; place-items: center;
}
.quest-info { flex: 1; min-width: 0; }
.quest-title {
  font-weight: 900; font-size: .95rem;
  margin-bottom: 2px; color: var(--text);
}
.quest-desc {
  font-size: .75rem; color: var(--text-dim);
  line-height: 1.4;
}
.quest-diff-badge {
  display: inline-block;
  font-size: .62rem; font-weight: 800;
  padding: 2px 8px; border-radius: 10px;
  margin-top: 4px;
}
.quest-diff-badge.easy   { background: #e8fce0; color: #2a7020; }
.quest-diff-badge.medium { background: #e0ecff; color: #1a40a0; }
.quest-diff-badge.hard   { background: #fff8d8; color: #806000; }
.quest-diff-badge.epic   { background: #fde0d0; color: #a03010; }

.quest-progress-bar {
  height: 16px; background: #f0e8e0;
  border-radius: 10px; overflow: hidden;
  position: relative;
}
.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--basic-c), #8ee078);
  border-radius: 10px;
  transition: width .4s cubic-bezier(.34,1.56,.64,1);
}
.quest-progress-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 900; color: var(--text);
  text-shadow: 0 0 3px white;
}

.quest-rewards {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px;
  background: #fff8f0;
  border-radius: 10px;
  align-items: center;
}
.quest-rewards-label {
  font-size: .68rem; font-weight: 800; color: var(--text-dim);
  margin-right: 4px;
}
.quest-reward {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 900; color: var(--text);
}
.quest-reward-icon { font-size: 1rem; }

.quest-claim-btn {
  width: 100%;
  padding: 10px 14px;
  border: none; border-radius: 12px;
  font-family: var(--font-main); font-weight: 900; font-size: .9rem;
  color: white; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.quest-claim-btn.ready {
  background: linear-gradient(135deg, var(--basic-c), #40a030);
  animation: claimPulse 1.5s ease-in-out infinite;
}
.quest-claim-btn.ready:hover  { filter: brightness(1.1); }
.quest-claim-btn.ready:active { transform: scale(.96); }
.quest-claim-btn.locked {
  background: #d8ccc0; color: #8a7a6a;
  cursor: not-allowed;
}
@keyframes claimPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(104,192,80,.5); }
  50%      { box-shadow: 0 0 0 8px rgba(104,192,80,0); }
}

/* ══════════════════════════════════════════════════════════════
   POKÉDEX
   ══════════════════════════════════════════════════════════════ */
.pokedex-header {
  background: white;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.pokedex-progress {
  display: flex; align-items: center; gap: 10px;
}
.pokedex-label {
  font-size: .75rem; font-weight: 800; color: var(--text-dim);
  min-width: 90px;
}
.pokedex-progress-bar {
  flex: 1; height: 16px;
  background: #f0e8e0; border-radius: 10px;
  overflow: hidden; position: relative;
}
.pokedex-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #f85c20);
  border-radius: 10px;
  transition: width .5s cubic-bezier(.34,1.56,.64,1);
}
.pokedex-progress-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 900; color: var(--text);
  text-shadow: 0 0 3px white;
}
.pokedex-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.pokedex-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
/* Tailles pour Pokédex */
.pokedex-grid.size-xsmall { grid-template-columns: repeat(8, 1fr); gap: 3px; }
.pokedex-grid.size-small  { grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pokedex-grid.size-medium { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pokedex-grid.size-large  { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pokedex-grid.size-xsmall .pokedex-name,
.pokedex-grid.size-xsmall .pokedex-number { font-size: 0; }
.pokedex-grid.size-xsmall .pokedex-cell { padding: 2px; }
.pokedex-cell {
  aspect-ratio: 1;
  background: white;
  border-radius: 10px;
  border: 2px solid #f0e8e0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  padding: 4px;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.pokedex-cell:active { transform: scale(.92); }
.pokedex-cell.owned {
  border-color: var(--basic-c);
  box-shadow: 0 2px 6px rgba(104,192,80,.2);
}
.pokedex-cell.locked {
  background: #f0ece8;
  cursor: default;
}
.pokedex-cell img {
  width: 70%; height: 70%;
  object-fit: contain;
  image-rendering: pixelated;
}
/* ══════════════════════════════════════════════════════════════════
   🖤 SILHOUETTE — Pokédex (grille principale)
   C'est ICI que le sprite d'un Pokémon non-capturé devient une
   silhouette noire dans la grille du Pokédex ET du Shinydex.

   • brightness(0)  → rend l'image entièrement noire
   • opacity(.15)   → la rend très transparente (quasi-invisible)

   👉 Pour rendre la silhouette plus visible : augmente opacity (ex: .35)
   👉 Pour une silhouette grise au lieu de noire :
        remplace par  filter: grayscale(1) opacity(.4);
   👉 Pour masquer totalement le sprite (pas de silhouette du tout) :
        remplace par  visibility: hidden;
   ══════════════════════════════════════════════════════════════════ */
.pokedex-cell.locked img {
  filter: brightness(0) opacity(.15);
}
.pokedex-number {
  position: absolute;
  top: 2px; left: 4px;
  font-size: .55rem;
  font-weight: 900;
  color: var(--text-dim);
}
.pokedex-cell.owned .pokedex-number { color: var(--basic-c); }
.pokedex-name {
  font-size: .55rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pokedex-cell.locked .pokedex-name { color: var(--text-dim); font-size: 0; }
.pokedex-cell.locked .pokedex-name::before {
  content: '???';
  font-size: .55rem;
  font-weight: 700;
}

/* Modal détail pokédex (cellule cliquée) */
.pokedex-detail {
  text-align: center;
  width: 100%;
}
.pokedex-detail-sprite {
  width: 110px; height: 110px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #f8f4f0;
  border-radius: 16px;
  padding: 6px;
  margin: 0 auto 10px;
  display: block;
}
/* ══════════════════════════════════════════════════════════════════
   🖤 SILHOUETTE — Modal détail Pokédex (quand on clique sur une case)
   C'est ICI que le grand sprite dans la fenêtre de détail devient
   une silhouette quand le Pokémon n'a pas encore été capturé.

   • brightness(0)  → rend l'image entièrement noire
   • opacity(.1)    → encore plus transparent que dans la grille

   👉 Même logique que .pokedex-cell.locked img ci-dessus,
      mais appliqué au grand sprite de la modal de détail.
   ══════════════════════════════════════════════════════════════════ */
.pokedex-detail-sprite.locked {
  filter: brightness(0) opacity(.1);
}
.pokedex-detail-name {
  font-size: 1.2rem; font-weight: 900;
  margin-bottom: 4px;
}
.pokedex-detail-number {
  font-size: .75rem; color: var(--text-dim);
  font-weight: 700; margin-bottom: 6px;
}
.pokedex-detail-status {
  display: inline-block;
  padding: 4px 12px; border-radius: 12px;
  font-size: .75rem; font-weight: 800;
  margin-top: 6px;
}
.pokedex-detail-status.owned   { background: #e8fce0; color: #2a7020; }
.pokedex-detail-status.missing { background: #f0ece8; color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8c8b8; border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════
   BOUTONS CHAMBRE (Casino + Dialogue)
   ══════════════════════════════════════════════════════════════ */
.casino-btn {
  position: absolute; top: 168px; left: 12px;
  background: linear-gradient(135deg, #d0a000, #f8c820);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(200,150,0,.4);
  font-size: 1.3rem; z-index: 30;
  transition: transform .15s, filter .15s;
  animation: casinoGlow 2s ease-in-out infinite;
}
@keyframes casinoGlow {
  0%,100% { box-shadow: 0 2px 8px rgba(200,150,0,.4); }
  50%     { box-shadow: 0 2px 16px rgba(248,200,32,.7), 0 0 20px rgba(248,200,32,.3); }
}
.casino-btn:hover  { filter: brightness(1.15); transform: scale(1.08); }
.casino-btn:active { transform: scale(.92); }

.dialogue-btn {
  position: absolute; top: 220px; left: 12px;
  background: linear-gradient(135deg, #5890f8, #3060d0);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(80,120,240,.4);
  font-size: 1.3rem; z-index: 30;
  transition: transform .15s, filter .15s;
}
.dialogue-btn:hover  { filter: brightness(1.15); transform: scale(1.08); }
.dialogue-btn:active { transform: scale(.92); }

.partner-pick-btn {
  position: absolute; top: 272px; left: 12px;
  background: linear-gradient(135deg, #f8d020, #e0a000);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(240,180,0,.45);
  font-size: 1.3rem; z-index: 30;
  transition: transform .15s, filter .15s;
}
.partner-pick-btn:hover  { filter: brightness(1.12); transform: scale(1.08); }
.partner-pick-btn:active { transform: scale(.92); }

/* ══════════════════════════════════════════════════════════════
   STARTER SELECTION
   ══════════════════════════════════════════════════════════════ */
.starter-card {
  max-width: 380px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 16px 20px;
}
.starter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
  max-height: 50vh;
  overflow-y: auto;
}
.starter-cell {
  background: #f8f4f0;
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 6px 4px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .15s, transform .15s, background .15s;
  position: relative;
}
.starter-cell:hover  { background: #fff8f0; border-color: var(--orange); transform: translateY(-2px); }
.starter-cell:active { transform: scale(.94); }
.starter-cell.selected { border-color: var(--basic-c); background: #e8fce0; }
.starter-cell img {
  width: 52px; height: 52px;
  object-fit: contain; image-rendering: pixelated;
}
.starter-cell-name {
  font-size: .55rem; font-weight: 900; color: var(--text);
  text-align: center; line-height: 1.1;
}
.starter-cell-num {
  font-size: .5rem; color: var(--text-dim); font-weight: 700;
}
.starter-confirm {
  background: #f8f4f0; border-radius: 16px; padding: 12px;
  margin-top: 4px; animation: cellPop .3s cubic-bezier(.34,1.56,.64,1);
}
.starter-selected-preview {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.starter-selected-preview img {
  width: 64px; height: 64px;
  object-fit: contain; image-rendering: pixelated;
}
.starter-selected-preview .starter-info { text-align: left; }
.starter-selected-preview .starter-info strong { font-size: 1rem; font-weight: 900; }
.starter-selected-preview .starter-info span { font-size: .72rem; color: var(--text-dim); display: block; }

/* ══════════════════════════════════════════════════════════════
   WELCOME — CHAMP PSEUDO
   ══════════════════════════════════════════════════════════════ */
.welcome-nickname-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 14px 0 18px;
  width: 100%;
}
.welcome-nickname-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 900;
  padding: 14px 16px;
  border: 2.5px solid #e8ddd8;
  border-radius: 14px;
  background: white;
  color: #2a2418;
  outline: none;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.welcome-nickname-input::placeholder { color: #c8b8a8; font-weight: 600; }
.welcome-nickname-input:focus { border-color: #f07830; box-shadow: 0 0 0 3px rgba(240,120,48,.15); }
.welcome-nickname-input.valid   { border-color: #68c050; }
.welcome-nickname-input.invalid { border-color: #e03050; }
.welcome-nickname-counter {
  font-size: .72rem;
  color: var(--text-dim);
  text-align: right;
  font-weight: 700;
}
.welcome-nickname-hint {
  font-size: .78rem;
  font-weight: 700;
  min-height: 1.1em;
  margin: 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   CASINO MODAL
   ══════════════════════════════════════════════════════════════ */
.casino-card {
  max-width: 340px;
  gap: 12px;
  padding: 24px 20px;
}
.casino-title {
  font-weight: 900; font-size: 1.2rem; text-align: center;
  background: linear-gradient(135deg, #f8c820, #f07830);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.casino-balance {
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  font-weight: 900; font-size: 1.1rem;
  background: #fffbe8; border-radius: 12px; padding: 8px 16px;
}
.casino-label { font-size: .78rem; font-weight: 800; color: var(--text-dim); text-align: center; }
.casino-bet-controls {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin: 6px 0;
}
.casino-bet-shortcuts {
  display: flex; gap: 5px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 4px;
}
.casino-odds {
  font-size: .7rem; color: var(--text-dim); text-align: center; line-height: 1.5;
  background: #f8f4f0; border-radius: 10px; padding: 6px 10px;
}
.casino-play-btn {
  background: linear-gradient(135deg, #d0a000, #f8c820) !important;
  font-size: 1rem !important; margin-top: 4px;
  box-shadow: 0 4px 14px rgba(200,150,0,.35) !important;
}
.casino-result {
  background: #f8f4f0; border-radius: 14px; padding: 12px;
  text-align: center; animation: cellPop .3s cubic-bezier(.34,1.56,.64,1);
}
.casino-result.win { background: #e8fce0; border: 2px solid var(--basic-c); }
.casino-result.lose { background: #fde0e0; border: 2px solid #e03050; }
.casino-result-emoji { font-size: 2.5rem; }
.casino-result-text { font-weight: 900; font-size: 1.05rem; margin: 4px 0; }
.casino-result-amount { font-size: .85rem; color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   MACHINE À JACKPOT
   ══════════════════════════════════════════════════════════════ */
.slot-card {
  max-width: 300px;
  gap: 14px;
  padding: 24px 20px;
  background: linear-gradient(160deg, #1a0a30, #2a1050);
  border: 3px solid var(--gold);
}
.slot-card .casino-title { -webkit-text-fill-color: var(--gold); }
.slot-machine {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
}
.slot-lever-wrap { display: flex; align-items: center; }
.slot-lever {
  font-size: 2.4rem;
  cursor: pointer;
  transform-origin: top center;
  transition: transform .3s ease;
  filter: drop-shadow(0 0 6px rgba(248,200,32,.5));
}
.slot-lever.pulled { transform: rotate(30deg) translateY(8px); }
.slot-reels {
  display: flex; gap: 8px;
  background: rgba(0,0,0,.4);
  border-radius: 12px; padding: 10px;
  border: 2px solid var(--gold);
  position: relative;
}
.slot-reel {
  width: 56px; height: 72px;
  background: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900;
  overflow: hidden; position: relative;
}
.slot-reel.spinning span {
  animation: reelSpin .6s linear infinite;
}
@keyframes reelSpin {
  0%   { transform: translateY(0); opacity: 1; }
  50%  { transform: translateY(-20px); opacity: 0; }
  51%  { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.slot-reel.win-reel { background: #fffbe0; box-shadow: 0 0 12px var(--gold); }
.slot-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px; background: rgba(248,200,32,.6);
  top: 50%; transform: translateY(-50%);
  pointer-events: none;
}
.slot-result-text {
  font-weight: 900; font-size: 1.1rem; text-align: center;
  color: white; min-height: 2rem;
  text-shadow: 0 0 10px var(--gold);
}

/* ══════════════════════════════════════════════════════════════
   QUI EST CE POKÉMON ?
   ══════════════════════════════════════════════════════════════ */
.who-card {
  max-width: 300px;
  gap: 12px;
  padding: 24px 20px;
}
.who-subtitle {
  font-size: .78rem; color: var(--text-dim); text-align: center; font-weight: 700;
}
.who-silhouette-wrap {
  width: 140px; height: 140px;
  background: radial-gradient(circle, #e8e0d8, #d0c8b8);
  border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.who-sprite {
  width: 120px; height: 120px;
  object-fit: contain; image-rendering: pixelated;
}
.who-sprite.silhouette {
  filter: brightness(0) saturate(0) opacity(.85);
}
.who-sprite.revealed {
  filter: none;
  animation: revealPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes revealPop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.who-answer-zone { display: flex; flex-direction: column; gap: 8px; }
.who-input {
  border: 2px solid #f0e0d0; border-radius: 12px;
  padding: 10px 14px; font-family: var(--font-main);
  font-size: .9rem; font-weight: 700; outline: none;
  width: 100%; background: #f8f4f0;
  transition: border-color .15s;
}
.who-input:focus { border-color: var(--orange); background: white; }
.who-submit-btn {
  background: linear-gradient(135deg, #5890f8, #3060d0) !important;
  box-shadow: 0 4px 12px rgba(80,120,240,.3) !important;
}
.who-result {
  border-radius: 12px; padding: 10px 14px; text-align: center;
  font-weight: 900; font-size: .92rem;
  animation: cellPop .3s cubic-bezier(.34,1.56,.64,1);
}
.who-result.correct { background: #e8fce0; color: #2a7020; border: 2px solid var(--basic-c); }
.who-result.wrong   { background: #fde0e0; color: #901030; border: 2px solid #e03050; }

/* ══════════════════════════════════════════════════════════════
   DIALOGUE IA
   ══════════════════════════════════════════════════════════════ */
.dialogue-card {
  max-width: 360px;
  max-height: 88vh;
  padding: 20px 16px;
  gap: 10px;
  display: flex; flex-direction: column;
}
.dialogue-title {
  font-weight: 900; font-size: 1.1rem; text-align: center;
  color: var(--text);
}
.dialogue-hint {
  font-size: .75rem; color: var(--text-dim); font-weight: 700; margin-bottom: 6px;
}
.dialogue-pokemon-list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  max-height: 220px; overflow-y: auto;
}
.dialogue-pokemon-cell {
  background: #f8f4f0; border: 2px solid transparent;
  border-radius: 12px; padding: 6px 4px;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  transition: border-color .15s, transform .12s;
}
.dialogue-pokemon-cell:hover { border-color: #5890f8; transform: translateY(-2px); background: #f0f4ff; }
.dialogue-pokemon-cell:active { transform: scale(.93); }
.dialogue-pokemon-cell img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.dialogue-pokemon-cell span { font-size: .55rem; font-weight: 800; text-align: center; color: var(--text); }
.dialogue-chat { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow: hidden; }
.dialogue-selected-header {
  display: flex; align-items: center; gap: 10px;
  background: #f0f4ff; border-radius: 12px; padding: 8px 12px;
}
.dialogue-selected-header img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.dialogue-selected-header strong { font-size: .9rem; }
.dialogue-messages {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 160px; max-height: 240px;
  padding: 4px 2px;
}
.dialogue-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: .82rem; font-weight: 700; line-height: 1.4;
  animation: msgPop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes msgPop {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.dialogue-msg.player {
  background: linear-gradient(135deg, #5890f8, #3060d0);
  color: white; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.dialogue-msg.pokemon {
  background: white; color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.dialogue-msg.pokemon-anim {
  background: linear-gradient(135deg, #f8f0ff, #e8d8ff);
  border: 2px solid #c080ff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.dialogue-typing {
  background: #f0f0f0; border-radius: 16px; padding: 8px 14px;
  align-self: flex-start;
  font-size: .8rem; color: var(--text-dim); font-style: italic;
  animation: typingPulse 1s ease-in-out infinite;
}
@keyframes typingPulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
.dialogue-input-wrap {
  display: flex; gap: 8px; align-items: center;
}
.dialogue-input {
  flex: 1; border: 2px solid #e0d8d0; border-radius: 12px;
  padding: 8px 12px; font-family: var(--font-main);
  font-size: .85rem; font-weight: 700; outline: none;
  background: #f8f4f0; transition: border-color .15s;
}
.dialogue-input:focus { border-color: #5890f8; background: white; }
.dialogue-send-btn {
  background: linear-gradient(135deg, #5890f8, #3060d0);
  color: white; border: none; border-radius: 12px;
  width: 44px; height: 44px; font-size: 1.1rem;
  cursor: pointer; display: grid; place-items: center;
  transition: filter .15s, transform .1s;
  flex-shrink: 0;
}
.dialogue-send-btn:hover  { filter: brightness(1.1); }
.dialogue-send-btn:active { transform: scale(.92); }
.dialogue-back-btn {
  background: none; border: none; color: #5890f8;
  font-family: var(--font-main); font-size: .75rem; font-weight: 800;
  cursor: pointer; padding: 4px 0; text-align: left;
}
.dialogue-back-btn:hover { text-decoration: underline; }

/* Animation spéciales chambre (dialogue) */
.room-pokemon.anim-salto {
  animation: saltoAnim 0.8s cubic-bezier(.34,1.56,.64,1) !important;
}
@keyframes saltoAnim {
  0%   { transform: rotate(0deg) translateY(0); }
  50%  { transform: rotate(360deg) translateY(-40px); }
  100% { transform: rotate(720deg) translateY(0); }
}
.room-pokemon.anim-sleep img {
  filter: saturate(.4) brightness(.8);
}
.room-pokemon.anim-heart::after {
  content: '❤️';
  position: absolute; top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  animation: heartFloat 1.2s ease forwards;
  pointer-events: none;
}
@keyframes heartFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0) scale(.5); }
  30%  { opacity: 1; transform: translateX(-50%) translateY(-15px) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(.8); }
}
.sleep-zzz {
  position: absolute;
  font-size: 1.2rem;
  animation: zzzFloat 2s ease-in-out infinite;
  pointer-events: none; z-index: 10;
}
@keyframes zzzFloat {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  40%  { opacity: 1; transform: translateY(-15px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(.8); }
}

/* ══════════════════════════════════════════════════════════════
   SYSTÈME MÉTÉO
   ══════════════════════════════════════════════════════════════ */

/* Widget météo — au-dessus des stats chambre, en bas à gauche */
.weather-widget {
  position: absolute;
  bottom: 52px; left: 12px;
  background: rgba(255,255,255,.94);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 30;
  cursor: pointer;
  transition: transform .15s, background .15s;
  min-width: 120px;
  user-select: none;
}
.weather-widget:hover  { transform: scale(1.04); background: white; }
.weather-widget:active { transform: scale(.97); }
.weather-icon { font-size: 1.3rem; line-height: 1; }
.weather-info { display: flex; flex-direction: column; gap: 1px; }
.weather-name {
  font-weight: 900; font-size: .72rem;
  color: var(--text); line-height: 1.2;
}
.weather-timer {
  font-size: .58rem; font-weight: 700;
  color: var(--text-dim);
}

/* ─── Particules météo ─── */
.weather-particles {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.weather-particle {
  position: absolute;
  pointer-events: none;
}

/* Pluie */
.particle-rain {
  width: 2px;
  background: rgba(100,160,255,.7);
  border-radius: 2px;
  animation: rainFall linear infinite;
}
@keyframes rainFall {
  from { transform: translateY(-20px) rotate(10deg); opacity: .8; }
  to   { transform: translateY(110vh)  rotate(10deg); opacity: .3; }
}

/* Neige */
.particle-snow {
  color: rgba(220,240,255,.95);
  text-shadow: 0 0 4px rgba(200,220,255,.7);
  animation: snowFall linear infinite;
}
@keyframes snowFall {
  from { transform: translateY(-20px) translateX(0) rotate(0deg);   opacity: 1; }
  to   { transform: translateY(110vh)  translateX(30px) rotate(360deg); opacity: .4; }
}

/* Soleil (rayons) */
.particle-sun {
  color: rgba(255,220,50,.8);
  animation: sunRay ease-in-out infinite alternate;
}
@keyframes sunRay {
  from { opacity: .2; transform: scale(.8) rotate(-10deg); }
  to   { opacity: .7; transform: scale(1.1) rotate(10deg); }
}

/* Orage (éclairs) */
.particle-storm {
  color: rgba(255,240,80,.9);
  animation: stormFlash ease-in-out infinite;
}
@keyframes stormFlash {
  0%,100% { opacity: 0; }
  5%, 10% { opacity: 1; }
  7%       { opacity: .3; }
}

/* Nuit (étoiles) */
.particle-night {
  color: rgba(255,255,210,.9);
  animation: starTwinkle ease-in-out infinite alternate;
}
@keyframes starTwinkle {
  from { opacity: .2; transform: scale(.7); }
  to   { opacity: 1;  transform: scale(1.2); }
}

/* ─── Teinte de fond selon météo ─── */
.room-backdrop.weather-sun     { filter: brightness(1.05) saturate(1.1); }
.room-backdrop.weather-rain    { filter: brightness(.88)  saturate(.8);  }
.room-backdrop.weather-snow    { filter: brightness(.95)  saturate(.55) hue-rotate(180deg); }
.room-backdrop.weather-storm   { filter: brightness(.74)  saturate(.7);  }
.room-backdrop.weather-night   { filter: brightness(.58)  saturate(.5);  }
.room-backdrop.weather-rainbow { filter: brightness(1.08) saturate(1.3); }

/* ─── Overlay Arc-en-ciel ─── */
.rainbow-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 35;
  background: linear-gradient(
    to bottom,
    rgba(255,80,80,.06)   0%,
    rgba(255,160,40,.06) 16%,
    rgba(255,230,40,.06) 32%,
    rgba(80,220,80,.06)  48%,
    rgba(80,160,255,.06) 64%,
    rgba(160,80,255,.06) 80%,
    rgba(255,80,200,.06) 100%
  );
  animation: rainbowPulse 2s ease-in-out infinite;
}
.rainbow-overlay[hidden] { display: none; }
@keyframes rainbowPulse {
  0%,100% { opacity: .6; }
  50%     { opacity: 1; }
}
.rainbow-banner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,.93);
  border-radius: 20px;
  padding: 12px 24px;
  font-weight: 900; font-size: .9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  text-align: center;
  pointer-events: auto;
  white-space: nowrap;
  animation: bannerPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes bannerPop {
  from { transform: translate(-50%,-50%) scale(.5); opacity: 0; }
  to   { transform: translate(-50%,-50%) scale(1);  opacity: 1; }
}
/* ═══════════════════════════════════════════════════════════
   NOUVELLES FONCTIONNALITÉS — Exploration, Arène, Succès,
   Pension, Partenaire
   ═══════════════════════════════════════════════════════════ */

/* --- Boutons chambre (exploration, arène, pension) — rangée sous le HUD --- */
/* Groupe de boutons d'action sous les statistiques (coins/œufs) en haut à droite */
.explore-btn {
  position: absolute;
  top: 62px; right: 100px;
  background: rgba(255,255,255,.94);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 30; transition: transform .15s;
}
.arena-btn {
  position: absolute;
  top: 62px; right: 48px;
  background: rgba(255,255,255,.94);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 30; transition: transform .15s;
}
.explore-btn:hover, .arena-btn:hover { transform: scale(1.1); }

/* --- Écran Succès --- */
.achievements-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Bandeau de stats */
.ach-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(60,30,10,.1);
  flex-shrink: 0;
}
.ach-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ach-stat-num {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}
.ach-stat-label {
  font-size: .58rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ach-stat-unlocked .ach-stat-num { color: #e0a800; }
.ach-stat-claimed  .ach-stat-num { color: #3aaa30; }
.ach-stat-locked   .ach-stat-num { color: var(--text-dim); }
.ach-stat-sep {
  width: 1px; height: 30px;
  background: #e8e0d8;
}

/* Barre de progression globale */
.ach-global-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.ach-global-bar {
  height: 10px;
  background: #e8e0d8;
  border-radius: 8px;
  overflow: hidden;
}
.ach-global-fill {
  height: 100%;
  background: linear-gradient(90deg, #68c050, #f8c820);
  border-radius: 8px;
  transition: width .6s ease;
  min-width: 4px;
}
.ach-global-label {
  font-size: .72rem;
  color: var(--text-dim);
  text-align: right;
  font-weight: 700;
}

/* Filtres */
.ach-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  flex-shrink: 0;
}
.ach-filters::-webkit-scrollbar { display: none; }
.ach-filter-btn {
  flex-shrink: 0;
  background: #fff;
  border: 2px solid #e8e0d8;
  border-radius: 20px;
  color: var(--text-dim);
  font-size: .78rem;
  font-weight: 700;
  padding: 5px 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-main);
  box-shadow: 0 1px 4px rgba(60,30,10,.08);
}
.ach-filter-btn:hover { border-color: #f8c820; color: var(--text); }
.ach-filter-btn.active { border-color: #f8c820; background: #fffbe8; color: #a07000; font-weight: 800; }
.ach-filter-badge {
  background: #e83030;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

/* Liste */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}
.achievement-card {
  background: #fff;
  border-radius: 16px;
  padding: 13px 14px 13px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #f0ece8;
  transition: border-color .2s, opacity .2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(60,30,10,.07);
}
.achievement-card.hidden-filter { display: none; }
.achievement-card.unlocked {
  border-color: #f8c820;
  background: linear-gradient(135deg, #fffbe8, #fff);
}
.achievement-card.claimable {
  border-color: #68c050;
  animation: pulseGreen 1.8s ease infinite;
  background: linear-gradient(135deg, #f0fff0, #fff);
}
@keyframes pulseGreen {
  0%,100% { box-shadow: 0 2px 8px rgba(104,192,80,.15); }
  50%      { box-shadow: 0 4px 18px rgba(104,192,80,.45); }
}
/* Bande colorée selon statut */
.achievement-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: #e8e0d8;
}
.achievement-card.unlocked::before { background: #f8c820; }
.achievement-card.claimable::before { background: #68c050; }
.achievement-icon {
  font-size: 2.1rem;
  min-width: 44px;
  text-align: center;
  filter: grayscale(1) opacity(.35);
  transition: filter .3s;
}
.achievement-card.unlocked .achievement-icon,
.achievement-card.claimable .achievement-icon { filter: none; }
.achievement-info { flex: 1; min-width: 0; }
.achievement-name { font-weight: 800; font-size: .9rem; color: var(--text); }
.achievement-desc { font-size: .76rem; color: var(--text-dim); margin-top: 2px; }
.achievement-reward-tag {
  font-size: .7rem;
  background: #fffbe8;
  border-radius: 8px;
  padding: 2px 8px;
  margin-top: 5px;
  display: inline-block;
  color: #a07000;
  border: 1px solid #f8e880;
  font-weight: 700;
}
.achievement-status {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.achievement-claim-btn {
  background: linear-gradient(135deg, #68c050, #4caf50);
  border: none; border-radius: 20px;
  color: #fff; font-weight: 800; font-size: .78rem;
  padding: 7px 14px; cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(104,192,80,.4);
  font-family: var(--font-main);
  transition: transform .1s, box-shadow .1s;
}
.achievement-claim-btn:hover { transform: scale(1.04); box-shadow: 0 4px 14px rgba(104,192,80,.55); }
.achievement-claim-btn:active { transform: scale(.96); }
.achievement-progress-bar {
  height: 5px;
  background: #f0ece8;
  border-radius: 4px;
  margin-top: 7px;
  overflow: hidden;
}
.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5890f8, #f8c820);
  border-radius: 4px;
  transition: width .5s ease;
  min-width: 4px;
}
.achievement-progress-text {
  font-size: .68rem;
  color: var(--text-dim);
  margin-top: 3px;
  font-weight: 600;
}

/* ─── Breed Picker redesign ─────────────────────────────────── */
/* Override modal-card defaults for the breed picker */
/* Le picker s'ouvre PAR-DESSUS breedModal (z-index 200) */
#breedPickerModal {
  z-index: 400 !important;
}

.breed-picker-card {
  max-width: 440px !important;
  width: calc(100vw - 32px) !important;
  max-height: 86vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 18px 16px 14px !important;
  box-sizing: border-box !important;
}
.breed-picker-card .breed-title {
  text-align: center;
  flex-shrink: 0;
}
.breed-picker-hint {
  font-size: .77rem;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
  line-height: 1.4;
}
.breed-picker-search-wrap {
  display: flex;
  align-items: center;
  background: #f8f4f0;
  border-radius: 12px;
  padding: 8px 12px;
  gap: 7px;
  border: 2px solid #e8e0d8;
  transition: border-color .15s;
  flex-shrink: 0;
}
.breed-picker-search-wrap:focus-within { border-color: #f8c820; }
.breed-picker-search-icon { font-size: .9rem; }
.breed-picker-search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .88rem;
  font-family: var(--font-main);
  font-weight: 600;
}
.breed-picker-search::placeholder { color: var(--text-dim); font-weight: 500; }
.breed-picker-search-clear {
  background: #e8e0d8;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .75rem;
  padding: 2px 6px;
  border-radius: 6px;
}
.breed-picker-search-clear:hover { background: #ddd8d0; }

/* Boutons de tri */
.breed-picker-sorts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  padding-bottom: 2px;
}
.breed-picker-sorts::-webkit-scrollbar { display: none; }
.breed-sort-btn {
  flex-shrink: 0;
  background: #f0ece8;
  border: 2px solid transparent;
  border-radius: 14px;
  color: var(--text-dim);
  font-size: .74rem;
  font-weight: 700;
  padding: 5px 11px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: border-color .12s, color .12s, background .12s;
}
.breed-sort-btn.active { border-color: #f8c820; color: #a07000; background: #fffbe8; }
.breed-sort-btn:hover { border-color: #ccc; color: var(--text); }

.breed-picker-count {
  font-size: .7rem;
  color: var(--text-dim);
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

/* Grille pension redesign */
.breed-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
  align-content: start;
}
.breed-picker-grid::-webkit-scrollbar { width: 4px; }
.breed-picker-grid::-webkit-scrollbar-thumb { background: #e0d8d0; border-radius: 4px; }

.breed-picker-cell {
  background: #f8f4f0;
  border-radius: 12px;
  padding: 10px 6px 8px;
  text-align: center;
  cursor: pointer;
  border: 2px solid #ede8e2;
  transition: border-color .15s, transform .12s, background .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}
.breed-picker-cell:hover {
  border-color: #f8c820;
  background: #fffbe8;
  box-shadow: 0 3px 12px rgba(248,200,32,.3);
  transform: translateY(-2px);
}
.breed-picker-cell:active { transform: scale(.96); }
.breed-picker-cell.incompatible {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(.5);
}
.breed-picker-cell img {
  width: 58px;
  height: 58px;
  image-rendering: pixelated;
  display: block;
}
.breed-picker-cell .bp-name {
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breed-picker-cell .bp-level {
  font-size: .65rem;
  color: var(--text-dim);
  font-weight: 600;
}
.breed-picker-cell .bp-aff {
  font-size: .63rem;
  color: #e060a0;
  font-weight: 600;
}
.breed-picker-cell .bp-shiny-badge {
  position: absolute;
  top: 4px; right: 5px;
  font-size: .68rem;
  line-height: 1;
  color: #f8c820;
}
.breed-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 0;
  color: var(--text-dim);
  font-size: .88rem;
}
.breed-picker-empty span { font-size: 2.4rem; }

/* --- Modal Exploration --- */
.explore-card {
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
}
.explore-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
}
.explore-zones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.explore-zone-card {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .1s;
}
.explore-zone-card:hover { border-color: var(--shiny-c, #f0c000); transform: scale(1.01); }
.explore-zone-name { font-weight: 700; font-size: 1rem; }
.explore-zone-time { font-size: .8rem; color: var(--text-dim); margin: 3px 0; }
.explore-zone-rewards { font-size: .78rem; color: #68c050; }
.explore-zone-bonus { font-size: .75rem; color: var(--text-dim); margin-top: 4px; }

.explore-active-list { display: flex; flex-direction: column; gap: 10px; }
.explore-active-card {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 10px 14px;
  border-left: 4px solid #68c050;
}
.explore-active-header { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.explore-active-timer { font-size: .8rem; color: var(--text-dim); }
.explore-return-btn {
  background: linear-gradient(135deg, #68c050, #4caf50);
  border: none; border-radius: 10px;
  color: #fff; font-weight: 700; font-size: .8rem;
  padding: 5px 12px; cursor: pointer; margin-top: 6px;
}
.explore-active-timer-bar {
  height: 4px;
  background: var(--surface-3, #2a2a3e);
  border-radius: 4px;
  margin: 6px 0;
  overflow: hidden;
}
.explore-active-timer-fill {
  height: 100%;
  background: #68c050;
  border-radius: 4px;
  transition: width 1s linear;
}

/* Exploration pokemon picker */
.explore-pick-card {
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
}
.explore-hint {
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-align: center;
}
.explore-pokemon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.explore-poke-cell {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
  font-size: .65rem;
}
.explore-poke-cell:hover { border-color: var(--shiny-c, #f0c000); }
.explore-poke-cell.selected { border-color: #68c050; background: rgba(104,192,80,.12); }
.explore-poke-cell.disabled { opacity: .4; cursor: not-allowed; }
.explore-poke-cell img { width: 48px; height: 48px; display: block; margin: 0 auto; }

.explore-selected-preview {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 50px;
}
.explore-sel-mini {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  font-size: .65rem;
}
.explore-sel-mini img { width: 36px; height: 36px; display: block; margin: 0 auto; }

/* --- Modal Arène --- */
.arena-card {
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
}
.arena-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}
.arena-hint {
  font-size: .82rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
}
.arena-pick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.arena-selected-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 60px;
}
.arena-sel-cell {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  font-size: .7rem;
  border: 2px solid #68c050;
  min-width: 64px;
}
.arena-sel-cell img { width: 48px; height: 48px; display: block; margin: 0 auto; }
.arena-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 0;
}
.arena-log-entry {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .82rem;
  line-height: 1.4;
}
.arena-log-entry.victory { border-left: 4px solid #68c050; }
.arena-log-entry.defeat  { border-left: 4px solid #e04040; }
.arena-log-entry.draw    { border-left: 4px solid var(--legendary-c); }
.arena-reward {
  background: linear-gradient(135deg, rgba(255,215,0,.1), var(--surface-2));
  border: 2px solid var(--legendary-c);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-top: 10px;
  font-weight: 700;
}

/* --- Modal Pension --- */
.breed-card {
  max-width: 420px;
}
.breed-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-align: center;
}
.breed-hint {
  font-size: .8rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
}
.breed-slots {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.breed-slot {
  flex: 1;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.breed-slot-label {
  font-size: .72rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.breed-heart { font-size: 1.8rem; }
.breed-pick-btn {
  background: var(--surface-3, #2a2a3e);
  border: 2px dashed var(--text-dim);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: .8rem;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.breed-pick-btn:hover { border-color: var(--legendary-c); color: var(--legendary-c); }
.breed-slot-pokemon img { width: 60px; height: 60px; }
.breed-slot-pokemon-name { font-size: .75rem; font-weight: 700; margin-top: 4px; }
.breed-slot-remove {
  background: none; border: none;
  color: var(--text-dim); font-size: .7rem;
  cursor: pointer; margin-top: 4px;
}
.breed-timer-info {
  font-size: .82rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}
.breed-active-info {
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}
.breed-timer-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.breed-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #68c050, var(--legendary-c));
  border-radius: 4px;
  transition: width 1s linear;
}

/* --- Partenaire --- */
.partner-zone {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  text-align: center;
  cursor: pointer;
}
.partner-sprite-wrap {
  position: relative;
  display: inline-block;
}
.partner-sprite {
  width: 130px;
  height: 130px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  animation: partnerFloat 3s ease-in-out infinite;
}
@keyframes partnerFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.partner-sprite-wrap.clicked .partner-sprite {
  animation: partnerBounce .4s ease !important;
}
@keyframes partnerBounce {
  0%   { transform: scale(1) translateY(0); }
  30%  { transform: scale(1.25) translateY(-10px); }
  70%  { transform: scale(.9) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}
.partner-bubble {
  background: rgba(255,255,255,.92);
  color: #333;
  border-radius: 12px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 600;
  max-width: 160px;
  margin: 0 auto 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  animation: bubbleIn .3s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: scale(.7) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.partner-shiny-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,.3) 0%, transparent 70%);
  pointer-events: none;
}
.partner-name-tag {
  font-size: .72rem;
  font-weight: 700;
  color: var(--legendary-c);
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  margin-top: 4px;
}

/* partner pick btn in room */
.partner-btn {
  position: absolute;
  top: 12px; right: 204px;
  background: var(--surface-2);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 30; transition: transform .15s;
}
.partner-btn:hover { transform: scale(1.1); }

/* Breeding picker modal */
.breed-modal-header { margin-bottom: 12px; }


/* Breed room button */
.breed-btn-room {
  position: absolute;
  top: 62px; right: 152px;
  background: rgba(255,255,255,.94);
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 30; transition: transform .15s;
}
.breed-btn-room:hover { transform: scale(1.1); }

/* Breed start btn disabled */
#breedStartBtn:disabled { opacity: .5; cursor: not-allowed; }
#breedCollectBtn:disabled { opacity: .5; cursor: not-allowed; }
/* ══════════════════════════════════════════════════════════════
   FRIENDS / TRADE SYSTEM (Firebase)
   ══════════════════════════════════════════════════════════════ */
#screenFriends { background: var(--cream); }
.friends-body {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Statut connexion */
.friends-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 12px;
  font-size: .78rem; font-weight: 700;
  color: var(--text-dim);
  box-shadow: 0 2px 6px var(--shadow);
}
.friends-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #d8c8b8;
  box-shadow: 0 0 6px #d8c8b8;
  flex-shrink: 0;
}
.friends-status.connected .friends-status-dot {
  background: var(--basic-c);
  box-shadow: 0 0 8px var(--basic-c);
  animation: friendsPulse 2s ease-in-out infinite;
}
.friends-status.connecting .friends-status-dot {
  background: #f8c030;
  box-shadow: 0 0 8px #f8c030;
  animation: friendsPulse 1s ease-in-out infinite;
}
.friends-status.local .friends-status-dot {
  background: #a0a0a0;
  box-shadow: 0 0 8px #a0a0a0;
}
.friends-status.error .friends-status-dot {
  background: #e03050;
}
@keyframes friendsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .7; transform: scale(1.2); }
}

/* Cartes générales */
.friends-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 3px 10px var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.friends-card-title {
  font-weight: 900; font-size: .95rem;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.friends-count-badge {
  background: var(--orange); color: white;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: .7rem; font-weight: 900;
  margin-left: auto;
}

/* Carte ID joueur */
.friends-id-card {
  background: linear-gradient(135deg, #fff8f0, white);
  border: 2px solid var(--orange);
}
.friends-id-label {
  font-size: .72rem; font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.friends-id-row {
  display: flex; align-items: center; gap: 10px;
}
.friends-id-value {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem; font-weight: 900;
  color: var(--orange);
  background: var(--cream);
  padding: 8px 14px;
  border-radius: 10px;
  letter-spacing: .15em;
  flex: 1;
  text-align: center;
  user-select: all;
}
.friends-id-copy {
  background: var(--orange); color: white;
  border: none; border-radius: 10px;
  width: 42px; height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.friends-id-copy:hover  { filter: brightness(1.1); }
.friends-id-copy:active { transform: scale(.92); }
.friends-id-copy.copied {
  background: var(--basic-c);
}
.friends-id-hint {
  font-size: .72rem;
  color: var(--text-dim);
  text-align: center;
}

/* Inputs */
.friends-input {
  flex: 1;
  font-family: var(--font-main);
  font-size: .9rem; font-weight: 700;
  padding: 10px 14px;
  border: 2px solid #e8ddd8;
  border-radius: 12px;
  background: white;
  color: var(--text);
  outline: none;
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: border-color .15s;
}
.friends-input:focus { border-color: var(--orange); }
.friends-add-row {
  display: flex; align-items: center; gap: 8px;
}
.friends-add-btn {
  background: var(--basic-c); color: white;
  border: none; border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-main);
  font-weight: 900; font-size: .82rem;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.friends-add-btn:hover  { filter: brightness(1.1); }
.friends-add-btn:active { transform: scale(.96); }
.friends-add-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Listes */
.friends-empty {
  text-align: center;
  padding: 18px;
  color: var(--text-dim);
  font-size: .82rem;
}
.friends-list, .friends-requests-list {
  display: flex; flex-direction: column; gap: 8px;
}

/* Item d'ami */
.friend-item, .request-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
}
.friend-item .friend-id, .request-item .friend-id {
  font-family: 'Courier New', monospace;
  font-size: 1rem; font-weight: 900;
  color: var(--text);
  letter-spacing: .1em;
  flex: 1;
}
.friend-action-btn {
  background: var(--advanced-c); color: white;
  border: none; border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-weight: 800; font-size: .75rem;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.friend-action-btn.danger { background: #e03050; }
.friend-action-btn.accept { background: var(--basic-c); }
.friend-action-btn:hover  { filter: brightness(1.1); }
.friend-action-btn:active { transform: scale(.94); }

/* ══════════════════════════════════════════════════════════════
   TRADE MODAL
   ══════════════════════════════════════════════════════════════ */
.trade-card {
  max-width: 360px;
  max-height: 88vh;
  overflow-y: auto;
}
.trade-title {
  font-weight: 900; font-size: 1.15rem;
  text-align: center;
  margin-bottom: 4px;
}
.trade-sub {
  text-align: center;
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.trade-status {
  text-align: center;
  font-size: .82rem; font-weight: 800;
  color: var(--orange);
  background: #fff8f0;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  width: 100%;
}
.trade-status.confirmed {
  color: var(--basic-c);
  background: #e8fce0;
}
.trade-status.error {
  color: #e03050;
  background: #ffe0e0;
}

.trade-arena {
  display: flex; align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}
.trade-side {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.trade-side-label {
  font-size: .75rem; font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.trade-side-them .trade-side-label {
  color: var(--advanced-c);
}
.trade-slot {
  width: 100%; aspect-ratio: 1;
  background: #f8f4f0;
  border: 2px dashed #d8c8b8;
  border-radius: 14px;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.trade-slot.filled {
  border-style: solid;
  border-color: var(--orange);
  background: #fff8f0;
}
.trade-slot img {
  width: 80%; height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
}
.trade-pick-btn {
  background: var(--orange); color: white;
  border: none; border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-weight: 800; font-size: .75rem;
  cursor: pointer;
}
.trade-pick-btn:hover { filter: brightness(1.1); }
.trade-empty {
  font-size: .72rem;
  color: var(--text-dim);
  text-align: center;
}
.trade-slot-info {
  position: absolute;
  bottom: 4px; left: 4px; right: 4px;
  background: rgba(0,0,0,.65);
  color: white;
  font-size: .58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-align: center;
  pointer-events: none;
}
.trade-confirm-row {
  font-size: 1.4rem;
  height: 24px;
}
.trade-confirm-mark.ok {
  filter: drop-shadow(0 0 4px var(--basic-c));
}
.trade-arrow {
  align-self: center;
  font-size: 1.6rem;
  color: var(--orange);
  font-weight: 900;
}

.trade-actions {
  display: flex; gap: 8px;
  width: 100%;
}
.trade-action-btn {
  flex: 1;
  padding: 11px 12px;
  border: none; border-radius: 12px;
  font-family: var(--font-main);
  font-weight: 900; font-size: .85rem;
  color: white; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.trade-action-btn.cancel  { background: #e03050; }
.trade-action-btn.confirm { background: var(--basic-c); }
.trade-action-btn:disabled {
  opacity: .4; cursor: not-allowed; filter: grayscale(.4);
}
.trade-action-btn:not(:disabled):hover { filter: brightness(1.1); }
.trade-note {
  font-size: .68rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* Trade picker (choisir Pokémon) */
.trade-picker-card {
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
}
.trade-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}
.trade-picker-cell {
  aspect-ratio: 1;
  background: #f8f4f0;
  border-radius: 10px;
  border: 2px solid transparent;
  display: grid; place-items: center;
  position: relative;
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.trade-picker-cell:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}
.trade-picker-cell:active { transform: scale(.94); }
.trade-picker-cell.shiny { border-color: var(--gold); }
.trade-picker-cell img {
  width: 80%; height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
}
.trade-picker-cell .lvl {
  position: absolute;
  bottom: 2px; left: 4px;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: .55rem; font-weight: 900;
  padding: 1px 4px;
  border-radius: 6px;
}
.trade-picker-cell .star {
  position: absolute;
  top: 2px; right: 4px;
  font-size: .6rem;
  color: var(--gold);
}

/* ══════════════════════════════════════════════════════════════
   FRIENDS — Mode A : carte cream + 2 gros boutons
   ══════════════════════════════════════════════════════════════ */

/* ───── HÉRO : carte ID couleur cream ───── */
.friends-id-hero {
  background: var(--cream, #f8e8d0);
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(160, 110, 60, .15);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.friends-id-hero .friends-id-label {
  font-size: .78rem; font-weight: 900;
  color: #8a6b40;
  text-transform: uppercase;
  letter-spacing: .15em;
}
.friends-id-hero .friends-id-display {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  justify-content: center;
}
.friends-id-hero .friends-id-value {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange, #f07830);
  background: white;
  padding: 14px 22px;
  border-radius: 14px;
  letter-spacing: .25em;
  user-select: all;
  text-align: center;
  flex: 1; max-width: 250px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.06);
}
.friends-id-hero .friends-id-copy {
  background: var(--orange, #f07830);
  color: white;
  border: none; border-radius: 12px;
  width: 50px; height: 50px;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter .15s, transform .1s;
}
.friends-id-hero .friends-id-copy:hover  { filter: brightness(1.1); }
.friends-id-hero .friends-id-copy:active { transform: scale(.92); }
.friends-id-hero .friends-id-copy.copied { background: var(--basic-c, #68c050); }
.friends-id-hero .friends-id-hint {
  font-size: .76rem;
  color: #8a6b40;
  margin: 0;
  font-style: italic;
}

/* ───── 2 gros boutons d'action ───── */
.friends-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.friends-action-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px;
  background: white;
  border: 3px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  font-family: var(--font-main, system-ui);
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.friends-action-btn:hover  {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.friends-action-btn:active { transform: scale(.98); }
.friends-action-btn .fa-icon {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  flex-shrink: 0;
}
.friends-action-btn .fa-label {
  font-weight: 900; font-size: 1rem;
  color: #2a2418;
  flex: 1;
}
.friends-action-btn.add .fa-icon   {
  background: linear-gradient(135deg, #e8f8e0, #c0f0a0);
  color: #4a8030;
}
.friends-action-btn.add:hover      { border-color: #68c050; }
.friends-action-btn.trade .fa-icon {
  background: linear-gradient(135deg, #fff4e0, #ffd8a0);
  color: #c06020;
}
.friends-action-btn.trade:hover    { border-color: var(--orange, #f07830); }
.friends-action-btn[disabled] {
  opacity: .5; cursor: not-allowed;
  filter: grayscale(.3);
}
.friends-action-btn[disabled]:hover { transform: none; border-color: transparent; }

/* ───── Modal Ajouter un ami / Choisir ami pour échange ───── */
.add-friend-card,
.trade-friend-picker-card {
  max-width: 340px;
  text-align: center;
  align-items: center;
  gap: 10px;
}
.add-friend-icon {
  font-size: 3rem;
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--cream, #f8e8d0), white);
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.add-friend-title {
  font-weight: 900; font-size: 1.3rem;
  margin: 4px 0;
}
.add-friend-sub {
  color: var(--text-dim, #8a7a6a);
  font-size: .82rem;
  margin-bottom: 10px;
}
.add-friend-card .friends-input {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: .25em;
  padding: 14px;
  width: 100%;
}
.friends-add-btn.full {
  width: 100%;
  padding: 14px;
  font-size: .95rem;
  border-radius: 14px;
}
.add-friend-tip {
  font-size: .7rem;
  color: var(--text-dim, #8a7a6a);
  font-style: italic;
  margin-top: 4px;
}

/* ───── Liste d'amis dans le modal d'échange ───── */
.trade-friend-picker-list {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
  max-height: 50vh; overflow-y: auto;
  padding: 4px;
}
.trade-friend-picker-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream, #f8e8d0);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .1s;
}
.trade-friend-picker-item:hover  {
  border-color: var(--orange, #f07830);
}
.trade-friend-picker-item:active { transform: scale(.97); }
.trade-friend-picker-item .friend-id {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem; font-weight: 900;
  color: var(--text, #2a2418);
  letter-spacing: .15em;
  flex: 1; text-align: left;
}
.trade-friend-picker-item .arrow {
  font-size: 1.2rem;
  color: var(--orange, #f07830);
}
/* ══════════════════════════════════════════════════════════════
   FRIENDS — NOUVEAU DESIGN (ajout v2.2)
   ══════════════════════════════════════════════════════════════ */

/* ── Icône déco dans la carte ID ── */
.friends-id-hero-icon {
  width: 54px; height: 54px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 2px 8px rgba(160,110,60,.15);
  border: 1.5px solid #e8d4bc;
}

/* ── Ligne de boutons Partager / Copier ── */
.friends-id-share-row {
  display: flex; gap: 8px; width: 100%;
}
.friends-id-share-btn {
  flex: 1;
  background: white;
  border: 1.5px solid #e8d4bc;
  border-radius: 12px;
  padding: 9px;
  font-size: .78rem; font-weight: 800;
  color: var(--orange, #f07830);
  cursor: pointer;
  font-family: var(--font-main, system-ui);
  transition: background .15s, border-color .15s, transform .1s;
}
.friends-id-share-btn:hover  { background: #f5e8d5; border-color: var(--orange, #f07830); }
.friends-id-share-btn:active { transform: scale(.97); }

/* ── Sous-labels des boutons d'action ── */
.fa-texts {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; text-align: left;
}
.fa-sublabel {
  font-size: .73rem;
  color: var(--text-dim, #8a7a6a);
  font-weight: 600;
}

/* ── Badge "🔒 Aucun ami" / "N amis" sur le bouton Échange ── */
.friends-trade-lock {
  background: #f0ece8;
  color: #9a8a7a;
  font-size: .68rem; font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-main, system-ui);
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.friends-trade-lock.unlocked {
  background: #e8f8e0;
  color: #4a8030;
}

/* ── Items de la liste d'amis avec avatar ── */
.friend-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream, #f8e8d0);
  border-radius: 12px;
  padding: 10px 12px;
}
.friend-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f0e0c8;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1.5px solid #e8d0b8;
}
.friend-info    { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.friend-id      { font-family: 'Courier New', monospace; font-size: .9rem; font-weight: 900; color: var(--text, #2a2418); letter-spacing: .08em; }
.friend-status  { font-size: .67rem; color: var(--text-dim, #8a7a6a); }
/* ══════════════════════════════════════════════════════════════
   🔧 PATCH AMIS — Force l'affichage (sans dépendre des variables)
   ══════════════════════════════════════════════════════════════ */
#screenFriends.screen.active {
  display: flex !important;
  flex-direction: column !important;
  background: #d6efff !important;
}
#screenFriends .panel-header {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  flex-shrink: 0;
  z-index: 10;
}
#screenFriends .panel-header .panel-title {
  font-size: 1.2rem !important;
  font-weight: 900 !important;
  margin: 0 !important;
  color: #2a2418 !important;
}
#screenFriends .panel-header .btn-back {
  background: #f8e8d0 !important;
  border: none !important;
  border-radius: 12px !important;
  width: 38px; height: 38px;
  font-size: 1.4rem !important;
  cursor: pointer;
  color: #2a2418 !important;
  font-weight: 900;
}
#screenFriends .fr-body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 18px 16px 90px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  background: #d6efff !important;
}

/* Statut */
#screenFriends .fr-status {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: white !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  font-size: .82rem !important;
  color: #6b5a48 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
#screenFriends .fr-dot {
  width: 12px !important; height: 12px !important;
  border-radius: 50%;
  background: #d8c8b8 !important;
  flex-shrink: 0;
}

/* Carte ID Hero */
#screenFriends .fr-id-card {
  background: linear-gradient(135deg, #f8e8d0 0%, #f0d8b0 100%) !important;
  border-radius: 22px !important;
  padding: 22px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  box-shadow: 0 6px 18px rgba(160, 110, 60, .15);
  border: 3px solid #e8d4ad !important;
}
#screenFriends .fr-id-top {
  display: flex !important;
  align-items: center;
  gap: 14px;
}
#screenFriends .fr-id-pokeball {
  font-size: 2rem !important;
  background: white !important;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: #f07830 !important;
  font-weight: 900;
}
#screenFriends .fr-id-label {
  font-size: .72rem !important;
  font-weight: 900 !important;
  color: #8a6b40 !important;
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 4px;
}
#screenFriends .fr-id-value {
  font-family: 'Courier New', monospace !important;
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #f07830 !important;
  letter-spacing: .25em;
  user-select: all;
}
#screenFriends .fr-id-btns {
  display: flex !important;
  gap: 8px;
}
#screenFriends .fr-id-btn {
  flex: 1;
  background: #f07830 !important;
  color: white !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px !important;
  font-weight: 800 !important;
  font-size: .82rem !important;
  cursor: pointer;
  font-family: inherit;
}
#screenFriends .fr-id-btn:hover  { filter: brightness(1.1); }
#screenFriends .fr-id-btn:active { transform: scale(.96); }
#screenFriends .fr-id-hint {
  font-size: .76rem !important;
  color: #8a6b40 !important;
  font-style: italic;
  margin: 0 !important;
  text-align: center;
}

/* Boutons d'action */
#screenFriends .fr-action-btn {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 16px 18px !important;
  background: white !important;
  border: 3px solid transparent !important;
  border-radius: 18px !important;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  font-family: inherit;
  width: 100%;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
#screenFriends .fr-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
#screenFriends .fr-action-icon {
  font-size: 1.8rem !important;
  width: 56px !important; height: 56px !important;
  display: grid !important; place-items: center;
  border-radius: 14px !important;
  flex-shrink: 0;
}
#screenFriends .fr-action-texts {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
  flex: 1;
}
#screenFriends .fr-action-title {
  font-weight: 900 !important;
  font-size: 1rem !important;
  color: #2a2418 !important;
}
#screenFriends .fr-action-sub {
  font-size: .72rem !important;
  color: #8a7a6a !important;
}
#screenFriends .fr-btn-add .fr-action-icon {
  background: linear-gradient(135deg, #c8f5b0, #9adf78) !important;
  color: #4a8030 !important;
}
#screenFriends .fr-btn-add:hover { border-color: #68c050 !important; }
#screenFriends .fr-btn-trade .fr-action-icon {
  background: linear-gradient(135deg, #ffe0b0, #ffc278) !important;
  color: #c06020 !important;
}
#screenFriends .fr-btn-trade:hover { border-color: #f07830 !important; }
#screenFriends .fr-action-arrow {
  font-size: 1.4rem !important;
  color: #c0b0a0 !important;
  font-weight: 900;
}
#screenFriends .fr-trade-badge {
  font-size: 1.1rem !important;
}

/* Cartes Demandes / Amis */
#screenFriends .fr-card {
  background: white !important;
  border-radius: 16px !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
}
#screenFriends .fr-card-header {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 900 !important;
  font-size: .9rem !important;
  color: #2a2418 !important;
}
#screenFriends .fr-badge {
  background: #f07830 !important;
  color: white !important;
  border-radius: 20px !important;
  padding: 2px 10px !important;
  font-size: .7rem !important;
  font-weight: 900 !important;
  margin-left: auto;
}
#screenFriends .fr-empty {
  text-align: center;
  padding: 14px !important;
  color: #8a7a6a !important;
  font-size: .82rem !important;
  font-style: italic;
}
/* ══════════════════════════════════════════════════════════════
   POP-UP DE MISE À JOUR — Bloque entièrement le jeu
   ══════════════════════════════════════════════════════════════ */
.update-blocker {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 50, .92);
  backdrop-filter: blur(8px);
  z-index: 999999; /* au-dessus de TOUT */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: updateFadeIn .3s ease-out;
}
.update-blocker[hidden] { display: none; }

@keyframes updateFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.update-blocker-card {
  background: linear-gradient(135deg, #fff, #f5f3ff);
  border-radius: 22px;
  padding: 32px 28px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  text-align: center;
  position: relative;
  border: 3px solid #ffd039;
  animation: updateBounce .5s cubic-bezier(.5, 1.7, .5, 1);
}

@keyframes updateBounce {
  0%   { transform: scale(.7); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.update-blocker-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
  animation: updateSpin 2s linear infinite;
  display: inline-block;
}
@keyframes updateSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.update-blocker-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #d89000;
  margin: 0 0 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,.05);
}

.update-blocker-desc {
  font-size: .95rem;
  color: #444;
  line-height: 1.5;
  margin: 0 0 20px;
}
.update-blocker-desc strong {
  color: #d83050;
  font-weight: 800;
}

.update-blocker-versions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 14px;
  background: rgba(0,0,0,.04);
  border-radius: 14px;
}
.update-blocker-version {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
.update-blocker-version-label {
  font-size: .65rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.update-blocker-version-value {
  font-size: 1rem;
  font-weight: 800;
  color: #555;
  font-family: monospace;
}
.update-blocker-version.new .update-blocker-version-value {
  color: #2a9d4a;
  font-size: 1.1rem;
}
.update-blocker-arrow {
  font-size: 1.4rem;
  color: #aaa;
  font-weight: 900;
}

.update-blocker-btn {
  background: linear-gradient(135deg, #ffd039, #ffaa00);
  border: none;
  color: white;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 14px 22px;
  border-radius: 30px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 14px rgba(255, 170, 0, .45);
  transition: transform .12s, filter .15s, box-shadow .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.update-blocker-btn:hover  { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 170, 0, .55); }
.update-blocker-btn:active { transform: translateY(0); }

.update-blocker-hint {
  font-size: .72rem;
  color: #777;
  margin: 14px 0 0;
  line-height: 1.4;
}
.update-blocker-hint kbd {
  display: inline-block;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .68rem;
  font-family: monospace;
  font-weight: 700;
  color: #444;
  margin: 0 2px;
}

@media (max-width: 380px) {
  .update-blocker-card { padding: 24px 20px 20px; }
  .update-blocker-icon { font-size: 3rem; }
  .update-blocker-title { font-size: 1.2rem; }
  .update-blocker-versions { padding: 10px; gap: 8px; }
}

/* ══════════════════════════════════════════════════════════════
   BADGE D'HUMEUR sur les Pokémon de la chambre
   ══════════════════════════════════════════════════════════════ */
.room-mood-badge {
  position: absolute;
  top: -4px; right: -4px;
  font-size: 1rem;
  background: rgba(255, 255, 255, .92);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  pointer-events: none;
  z-index: 5;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   MISSIONS QUOTIDIENNES
   ══════════════════════════════════════════════════════════════ */
.daily-missions-section {
  background: linear-gradient(135deg, #fff5e0, #fffaeb);
  border: 2px solid #ffd039;
  border-radius: 18px;
  padding: 14px 14px 8px;
  margin-bottom: 14px;
  box-shadow: 0 3px 10px rgba(255, 200, 60, .15);
}
.daily-missions-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap; gap: 6px;
}
.daily-missions-title {
  font-size: 1rem; font-weight: 900;
  color: #b07000; margin: 0;
}
.daily-missions-timer-wrap {
  font-size: .72rem; font-weight: 700;
  color: var(--text-dim);
  background: rgba(255,255,255,.7);
  padding: 4px 8px; border-radius: 10px;
}
.daily-missions-list {
  display: flex; flex-direction: column; gap: 8px;
}
.daily-mission-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s;
}
.daily-mission-card.ready {
  border-color: #4a9d4a;
  box-shadow: 0 0 0 2px rgba(74,157,74,.25);
  background: linear-gradient(135deg, #f5fff0, #ffffff);
}
.daily-mission-card.claimed {
  opacity: .55;
  background: #f5f5f5;
}
.dm-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px; text-align: center;
}
.dm-body {
  flex: 1;
  min-width: 0;
}
.dm-title {
  font-size: .85rem; font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.dm-bar {
  height: 6px;
  background: rgba(0,0,0,.08);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 2px;
}
.dm-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #ffd039, #ff8800);
  border-radius: 4px;
  transition: width .3s;
}
.daily-mission-card.ready .dm-bar-fill {
  background: linear-gradient(to right, #4a9d4a, #6dc16d);
}
.dm-progress {
  font-size: .72rem; font-weight: 700;
  color: var(--text-dim);
}
.dm-reward {
  font-size: .68rem; font-weight: 600;
  color: #888;
  margin-top: 3px;
}
.dm-claim-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd039, #ff8800);
  border: none; border-radius: 18px;
  padding: 8px 14px;
  font-size: .8rem; font-weight: 800;
  color: white; cursor: pointer;
  box-shadow: 0 2px 6px rgba(255,140,0,.3);
  transition: transform .12s, filter .15s;
  text-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.dm-claim-btn:hover:not(:disabled)  { filter: brightness(1.1); transform: translateY(-1px); }
.dm-claim-btn:active:not(:disabled) { transform: translateY(0); }
.dm-claim-btn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
}

/* ══════════════════════════════════════════════════════════════
   JEUX CASINO MINIS — STYLE COMMUN
   ══════════════════════════════════════════════════════════════ */
.mini-casino-card {
  max-width: 380px; width: 100%;
  text-align: center;
  padding: 22px 18px 18px;
}
.mini-result {
  margin-top: 14px;
  padding: 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: .95rem;
  min-height: 22px;
}
.mini-result.win   { background: rgba(74,157,74,.15); color: #2a8d3a; }
.mini-result.lose  { background: rgba(224,48,80,.15); color: #c02040; }

/* ─── 1. Attrape-Pokéball ─── */
.catch-game-area {
  margin: 14px 0 16px;
}
.catch-track {
  position: relative;
  width: 100%; height: 44px;
  background: linear-gradient(to right, #ffe5e5, #fff5d8, #d0f5d8, #fff5d8, #ffe5e5);
  border-radius: 22px;
  border: 2px solid #444;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}
.catch-zone {
  position: absolute;
  top: 0; bottom: 0;
  left: 40%; width: 20%;
  background: linear-gradient(135deg, #6dc16d, #4a9d4a);
  box-shadow: 0 0 12px rgba(74,157,74,.6) inset;
}
.catch-cursor {
  position: absolute;
  top: 4px; bottom: 4px;
  width: 6px;
  background: #c02040;
  border-radius: 3px;
  left: 0;
  box-shadow: 0 0 8px rgba(192,32,64,.7);
  transition: none;
}
.catch-attempts, .catch-score {
  margin-top: 8px;
  font-size: .85rem; font-weight: 700;
  color: var(--text-dim);
}

/* ─── 2. Mémoire Pokémon ─── */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.memory-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #6890f0, #4060c0);
  border-radius: 10px;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 1.6rem;
  color: white;
  transition: transform .2s, background .3s;
  position: relative;
  user-select: none;
}
.memory-card::before {
  content: '?';
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.memory-card.flipped {
  background: white;
  border: 2px solid #aaa;
}
.memory-card.flipped::before { content: ''; }
.memory-card.matched {
  background: linear-gradient(135deg, #6dc16d, #4a9d4a) !important;
  cursor: default;
  animation: matchedPulse .4s ease-out;
}
.memory-card.matched::before { content: ''; }
@keyframes matchedPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); box-shadow: 0 0 12px rgba(74,157,74,.6); }
  100% { transform: scale(1); }
}
.memory-card-content {
  font-size: 1.6rem;
  pointer-events: none;
}
.memory-stats {
  display: flex; justify-content: space-around;
  font-size: .8rem; font-weight: 700;
  color: var(--text-dim);
}

/* ─── 3. Course de Pikachu ─── */
.race-track {
  position: relative;
  width: 100%; height: 70px;
  background: linear-gradient(to bottom, #b0e0ff 50%, #88c060 50%);
  border-radius: 14px;
  border: 2px solid #444;
  overflow: hidden;
  margin: 14px 0 8px;
}
.race-line-finish {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  z-index: 2;
}
.race-pikachu {
  position: absolute;
  left: 0; bottom: 8px;
  font-size: 2.2rem;
  transition: left .15s ease-out;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.race-stats {
  display: flex; justify-content: space-around;
  font-size: .85rem; font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.race-click-btn {
  font-size: 1.2rem !important;
  padding: 14px !important;
}

/* ─── 4. Nettoyage d'œuf ─── */
.clean-area {
  position: relative;
  width: 280px; height: 280px;
  margin: 12px auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0e0c0, #d0a880);
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}
.clean-area canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.clean-egg-hint {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 6rem;
  pointer-events: none;
  z-index: 0;
}
.clean-stats {
  display: flex; justify-content: space-around;
  font-size: .85rem; font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ─── 5. Baies tombantes ─── */
.berries-arena {
  position: relative;
  width: 100%; height: 280px;
  background: linear-gradient(to bottom, #c0e8ff 0%, #a0d8a0 100%);
  border-radius: 14px;
  border: 2px solid #444;
  overflow: hidden;
  margin: 12px 0 8px;
}
.berries-basket {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  cursor: grab;
  transition: left .08s linear;
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.falling-berry {
  position: absolute;
  font-size: 1.6rem;
  top: -30px;
  pointer-events: none;
  z-index: 2;
}
.berries-stats {
  display: flex; justify-content: space-around;
  font-size: .85rem; font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════
   LÉGENDAIRE KANTO — Apparition dans la chambre + Modal capture
   ══════════════════════════════════════════════════════════════ */

/* Pokémon légendaire visible dans la chambre */
.room-pokemon.legendary-appearance {
  cursor: pointer;
  z-index: 100;
  filter: drop-shadow(0 0 10px rgba(255, 200, 60, .8));
  animation: legendaryFloat 3s ease-in-out infinite;
}
.room-pokemon.legendary-appearance img {
  filter: brightness(1.2) saturate(1.3);
  animation: legendaryPulse 1.5s ease-in-out infinite;
}
@keyframes legendaryFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes legendaryPulse {
  0%, 100% { filter: brightness(1.2) saturate(1.3) drop-shadow(0 0 4px gold); }
  50%      { filter: brightness(1.4) saturate(1.6) drop-shadow(0 0 16px gold); }
}
.legendary-aura {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,200,60,.4), transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: legendaryAuraPulse 2s ease-in-out infinite;
}
@keyframes legendaryAuraPulse {
  0%, 100% { transform: scale(.9); opacity: .5; }
  50%      { transform: scale(1.2); opacity: .9; }
}
.legendary-label {
  position: absolute;
  bottom: -22px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f8c020, #d89000);
  color: white;
  font-weight: 900;
  font-size: .68rem;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  box-shadow: 0 2px 6px rgba(216,144,0,.5);
  pointer-events: none;
}

/* Modal de capture */
.legendary-card {
  max-width: 400px;
  text-align: center;
  background: linear-gradient(135deg, #fff8e0, #fff);
  border: 3px solid #f8c020;
  box-shadow: 0 0 30px rgba(248,192,32,.4);
}
.legendary-display {
  position: relative;
  width: 200px; height: 200px;
  margin: 16px auto 12px;
  display: grid; place-items: center;
}
.legendary-aura-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,200,60,.5), transparent 70%);
  border-radius: 50%;
  animation: legendaryAuraPulse 2s ease-in-out infinite;
}
.legendary-sprite {
  position: relative;
  width: 160px; height: 160px;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(0 0 8px gold);
  transition: opacity .4s, transform .4s;
}
.legendary-sprite.shaking {
  animation: legendaryShake .15s linear infinite;
}
@keyframes legendaryShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.legendary-sprite.captured {
  opacity: .3;
  transform: scale(.7);
}
.legendary-sprite.escaped {
  opacity: 0;
  transform: scale(.5) translateY(-30px);
}
.legendary-pokeball {
  position: absolute;
  font-size: 3rem;
  z-index: 3;
  pointer-events: none;
  animation: pokeballThrow .8s ease-out;
}
@keyframes pokeballThrow {
  0%   { transform: translate(-200px, 200px) rotate(0); opacity: 0; }
  20%  { opacity: 1; }
  60%  { transform: translate(0, 0) rotate(540deg); }
  100% { transform: translate(0, 0) rotate(720deg); }
}

.legendary-stats {
  background: rgba(0,0,0,.05);
  padding: 12px;
  border-radius: 12px;
  margin: 12px 0;
}
.legendary-stat-row {
  display: flex; justify-content: space-between;
  font-size: .85rem; padding: 3px 0;
}
.legendary-stat-row strong { color: #d89000; font-weight: 900; }

.legendary-throw-btn {
  background: linear-gradient(135deg, #ff5050, #c02020) !important;
  font-size: 1rem !important;
  padding: 14px !important;
  box-shadow: 0 4px 14px rgba(192, 32, 32, .45) !important;
}
.legendary-throw-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.legendary-history {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center;
  margin: 10px 0;
  min-height: 22px;
}
.legendary-history-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .7rem;
}
.legendary-history-dot.miss { background: #e03050; color: white; }
.legendary-history-dot.hit  { background: #4a9d4a; color: white; }
.legendary-history-dot.pending { background: #ddd; color: #999; }

/* Jauge de trace (dans le résumé du Pokédex / écran info) */
.trace-gauge {
  height: 8px;
  background: rgba(0,0,0,.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
}
.trace-gauge-fill {
  height: 100%;
  background: linear-gradient(to right, #a050d0, #d070ff);
  border-radius: 4px;
  transition: width .4s ease-out;
}

/* ══════════════════════════════════════════════════════════════
   ŒUFS VERROUILLÉS (déblocage progressif par génération)
   ══════════════════════════════════════════════════════════════ */
.shop-egg-card.egg-locked {
  position: relative;
  opacity: .55;
  filter: grayscale(.7);
  pointer-events: auto; /* on garde le badge visible/lisible */
}
.shop-egg-card.egg-locked .shop-egg-svg {
  filter: grayscale(1);
}
.shop-egg-card.egg-locked::before {
  content: '🔒';
  position: absolute;
  top: 12px; right: 12px;
  font-size: 1.6rem;
  z-index: 2;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}
.shop-egg-card.egg-locked .btn-open {
  background: #ccc !important;
  color: #888 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
.shop-egg-card.egg-locked .btn-open:hover {
  transform: none !important;
}
.shop-egg-lock-badge {
  background: linear-gradient(135deg, #f8c020, #d89000);
  color: white;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: .72rem;
  margin-top: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  box-shadow: 0 2px 6px rgba(216,144,0,.3);
  line-height: 1.3;
}
.shop-egg-lock-badge strong { font-weight: 900; }
/* ══════════════════════════════════════════════════════════════
   PROFIL JOUEUR + PERSONNALISATION AVATAR
   ══════════════════════════════════════════════════════════════ */

/* Bouton Profil dans l'écran Amis */
.fr-btn-profile {
  background: linear-gradient(135deg, #e3a8ff, #b888ff);
}
.fr-btn-profile .fr-action-icon {
  background: rgba(255,255,255,.25);
}

/* Modal Profil */
.profile-card {
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 14px 14px 12px;
}
.profile-title {
  text-align: center;
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}
.profile-top {
  display: flex;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, #f8f5ff, #fff);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(180,140,220,.3);
  margin-bottom: 10px;
}
.profile-avatar-wrap {
  flex-shrink: 0;
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: #f0e8ff;
  border: 2px solid #b888ff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(180,140,220,.4);
}
.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
}
/* Calque hairColor en mode multiply (pour "teinter" le hair) */
.profile-avatar img[data-cat="hairColor"] { mix-blend-mode: multiply; }
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-info-label {
  font-size: .62rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.profile-info-value {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}
.profile-info-value.mono {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: .82rem;
  color: #6040a0;
}
.profile-customize-btn {
  width: 100%;
  background: linear-gradient(135deg, #b888ff, #8050d0);
  color: white;
  border: none;
  padding: 9px;
  border-radius: 10px;
  font-weight: 800;
  font-size: .85rem;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 3px 8px rgba(128,80,208,.35);
  transition: transform .12s, filter .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.profile-customize-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.profile-customize-btn:active { transform: translateY(0); }
.profile-section-title {
  margin: 0 0 6px;
  font-size: .85rem;
  font-weight: 800;
  color: var(--text);
}
.profile-badges-section {
  background: rgba(0,0,0,.03);
  padding: 10px;
  border-radius: 12px;
}
.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 5px;
  max-height: 160px;          /* hauteur fixe : ~3 rangées visibles */
  overflow-y: auto;            /* scroll vertical si plus de badges */
  padding: 4px;
  /* Scrollbar customisée (Chrome/Edge/Safari) */
  scrollbar-width: thin;
  scrollbar-color: rgba(180,140,220,.5) transparent;
}
.profile-badges-grid::-webkit-scrollbar         { width: 6px; }
.profile-badges-grid::-webkit-scrollbar-track   { background: transparent; }
.profile-badges-grid::-webkit-scrollbar-thumb   {
  background: rgba(180,140,220,.5);
  border-radius: 3px;
}
.profile-badges-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(180,140,220,.8);
}
.profile-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 14px;
  font-style: italic;
  font-size: .85rem;
}

/* Modal Personnalisation */
.avatar-custom-card {
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 14px 14px 12px;
}
.avatar-custom-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 10px;
}
.avatar-custom-preview {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: #f0e8ff;
  border: 2px solid #b888ff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(180,140,220,.4);
}
.avatar-custom-preview img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.avatar-custom-preview img[data-cat="hairColor"] { mix-blend-mode: multiply; }

.avatar-custom-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.avatar-custom-tab {
  background: rgba(0,0,0,.06);
  border: none;
  padding: 5px 7px;
  border-radius: 16px;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.avatar-custom-tab:hover  { background: rgba(180,140,220,.15); }
.avatar-custom-tab.active {
  background: linear-gradient(135deg, #b888ff, #8050d0);
  color: white;
  box-shadow: 0 2px 6px rgba(128,80,208,.3);
}

.avatar-custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  background: rgba(0,0,0,.04);
  padding: 8px;
  border-radius: 10px;
  min-height: 80px;
  margin-bottom: 10px;
  max-height: 180px;
  overflow-y: auto;
}
.avatar-choice {
  background: white;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, transform .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.avatar-choice:hover { transform: translateY(-2px); }
.avatar-choice.selected {
  border-color: #b888ff;
  box-shadow: 0 0 0 2px rgba(180,140,220,.3);
}
.avatar-choice-thumb {
  width: 56px; height: 56px;
  background: #f5f0ff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  overflow: hidden;
}
.avatar-choice-thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.avatar-choice-name {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
}
.avatar-choice.no-image .avatar-choice-thumb::after {
  content: '?';
  color: #aaa;
  font-weight: 900;
  font-size: 1.6rem;
}

.avatar-custom-actions {
  display: flex;
  gap: 8px;
}
.avatar-custom-cancel,
.avatar-custom-save {
  flex: 1;
  padding: 11px;
  border-radius: 22px;
  border: none;
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  transition: filter .15s, transform .12s;
}
.avatar-custom-cancel {
  background: rgba(0,0,0,.08);
  color: var(--text);
}
.avatar-custom-save {
  background: linear-gradient(135deg, #4ec872, #2a9d4a);
  color: white;
  box-shadow: 0 3px 8px rgba(42,157,74,.3);
  text-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.avatar-custom-cancel:hover { background: rgba(0,0,0,.12); }
.avatar-custom-save:hover   { filter: brightness(1.1); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════════
   BADGES (système de Profil — Lot 2)
   ══════════════════════════════════════════════════════════════ */
.profile-badges-grid {
  /* déjà défini avant : grid auto-fill */
}
.badge-cell {
  background: white;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 5px 3px;
  text-align: center;
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 0;
}
.badge-cell:hover {
  transform: translateY(-2px);
}
.badge-cell.unlocked {
  border-color: #ffd039;
  background: linear-gradient(135deg, #fffaeb, #fff5d8);
  box-shadow: 0 2px 8px rgba(255, 200, 60, .35);
}
.badge-cell.locked {
  background: #f0f0f0;
  border-color: #ddd;
  filter: grayscale(.85);
  opacity: .85;
}
.badge-icon {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.1));
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}
.badge-cell.unlocked .badge-icon {
  filter: drop-shadow(0 0 4px rgba(255, 200, 60, .8));
}
.badge-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.badge-name {
  font-size: .58rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  word-wrap: break-word;
  hyphens: auto;
}
.badge-cell.locked .badge-name {
  color: #888;
  font-style: italic;
}
.badge-bar {
  width: 100%;
  height: 3px;
  background: rgba(0,0,0,.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1px;
}
.badge-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #888, #aaa);
  border-radius: 2px;
}
.badge-progress-text {
  font-size: .5rem;
  color: var(--text-dim);
  font-weight: 600;
  font-family: ui-monospace, monospace;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   NOUVELLES MÉTÉOS RARES — Backdrops
   ══════════════════════════════════════════════════════════════ */
.room-backdrop.weather-aurora {
  background: linear-gradient(to bottom, #0a1d3d 0%, #1a3a6e 30%, #2d6e8e 60%, #5a9d9d 100%);
  position: relative;
  overflow: hidden;
}
.room-backdrop.weather-aurora::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(60,255,200,.15), transparent 40%),
    linear-gradient(120deg, rgba(180,80,220,.2), transparent 70%),
    linear-gradient(60deg, transparent 30%, rgba(60,180,255,.15) 70%);
  animation: auroraShift 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes auroraShift {
  0%   { opacity: .6; transform: translateY(0); }
  50%  { opacity: 1;  transform: translateY(-10px); }
  100% { opacity: .7; transform: translateY(0); }
}

.room-backdrop.weather-heatwave {
  background: linear-gradient(to bottom, #ff6b3d 0%, #ffae5a 30%, #ffd690 60%, #ffe5a8 100%);
  position: relative;
}
.room-backdrop.weather-heatwave::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,200,80,.4), transparent 60%);
  animation: heatPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heatPulse {
  0%, 100% { opacity: .6; }
  50%      { opacity: 1; }
}

.room-backdrop.weather-mist {
  background: linear-gradient(to bottom, #c5c0d8 0%, #b8b8d0 50%, #d8d0e0 100%);
  position: relative;
}
.room-backdrop.weather-mist::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(255,255,255,.4), transparent 50%),
              radial-gradient(ellipse at 70% 40%, rgba(220,210,240,.5), transparent 50%);
  animation: mistDrift 15s linear infinite;
  pointer-events: none;
}
@keyframes mistDrift {
  0%   { transform: translateX(-20px); }
  100% { transform: translateX(20px); }
}

.room-backdrop.weather-starfall {
  background: linear-gradient(to bottom, #1a0d4d 0%, #2d1a8a 50%, #4d2dcd 100%);
}
.room-backdrop.weather-starfall::before {
  content: '✨ ⭐ ✨ ⭐ ✨ ⭐ ✨ ⭐';
  position: absolute;
  inset: 0;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 30px;
  color: rgba(255,255,200,.8);
  animation: starfallTwinkle 2s ease-in-out infinite alternate;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
@keyframes starfallTwinkle {
  0%   { opacity: .3; transform: translateY(-10px); }
  100% { opacity: 1;  transform: translateY(10px); }
}

.room-backdrop.weather-distortion {
  background: linear-gradient(135deg, #4a1a6e 0%, #8a4ad1 30%, #b070ff 60%, #d090ff 100%);
  position: relative;
  overflow: hidden;
}
.room-backdrop.weather-distortion::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 30%),
    radial-gradient(circle at 70% 60%, rgba(180,80,220,.4), transparent 40%);
  animation: distortionSwirl 8s linear infinite;
  pointer-events: none;
}
@keyframes distortionSwirl {
  0%   { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1.2); }
}

.room-backdrop.weather-cursed {
  background: linear-gradient(to bottom, #0a0014 0%, #2a0a3a 50%, #1a0a2a 100%);
  position: relative;
}
.room-backdrop.weather-cursed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(180,80,255,.2), transparent 40%);
  animation: cursedPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cursedPulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: .8; }
}

/* ══════════════════════════════════════════════════════════════
   POKÉMON SAUVAGES (Distorsion) — Apparition dans la chambre
   ══════════════════════════════════════════════════════════════ */
.room-pokemon.distortion-spawn {
  cursor: pointer;
  z-index: 95;
  animation: distortionFloat 2.5s ease-in-out infinite;
}
.room-pokemon.distortion-spawn img {
  filter: brightness(1.1) saturate(1.2) drop-shadow(0 0 6px rgba(180,80,255,.7));
  animation: distortionFlicker 1.8s ease-in-out infinite;
}
@keyframes distortionFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes distortionFlicker {
  0%, 100% { opacity: 1; }
  45%, 55% { opacity: 0.6; }
}
.distortion-aura {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,80,255,.5), transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: distortionAuraSwirl 3s ease-in-out infinite;
}
@keyframes distortionAuraSwirl {
  0%, 100% { transform: scale(.9) rotate(0deg); opacity: .5; }
  50%      { transform: scale(1.2) rotate(180deg); opacity: .9; }
}
.distortion-label {
  position: absolute;
  bottom: -22px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #b070ff, #8050d0);
  color: white;
  font-weight: 900;
  font-size: .8rem;
  padding: 3px 12px;
  border-radius: 12px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  box-shadow: 0 2px 6px rgba(128,80,208,.5);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   MODAL CAPTURE DISTORSION (réutilise les classes legendary-* pour cohérence)
   ══════════════════════════════════════════════════════════════ */
.distortion-card {
  max-width: 400px;
  text-align: center;
  background: linear-gradient(135deg, #f5e8ff, #fff);
  border: 3px solid #b070ff;
  box-shadow: 0 0 30px rgba(180,80,255,.4);
}
.distortion-display {
  position: relative;
  width: 200px; height: 200px;
  margin: 16px auto 12px;
  display: grid; place-items: center;
}
.distortion-aura-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(180,80,255,.5), transparent 70%);
  border-radius: 50%;
  animation: distortionAuraSwirl 3s ease-in-out infinite;
}
.distortion-sprite {
  position: relative;
  width: 160px; height: 160px;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(180,80,255,.7));
  transition: opacity .4s, transform .4s;
}
.distortion-sprite.shaking {
  animation: legendaryShake .15s linear infinite;
}
.distortion-sprite.captured {
  opacity: .3;
  transform: scale(.7);
}
.distortion-sprite.escaped {
  opacity: 0;
  transform: scale(.5) translateY(-30px);
}
.distortion-pokeball {
  position: absolute;
  font-size: 3rem;
  z-index: 3;
  pointer-events: none;
  animation: pokeballThrow .8s ease-out;
}
.distortion-stats {
  background: rgba(0,0,0,.05);
  padding: 12px;
  border-radius: 12px;
  margin: 12px 0;
}
.distortion-stat-row {
  display: flex; justify-content: space-between;
  font-size: .85rem; padding: 3px 0;
}
.distortion-stat-row strong { color: #8050d0; font-weight: 900; }
.distortion-throw-btn {
  background: linear-gradient(135deg, #b070ff, #8050d0) !important;
  font-size: 1rem !important;
  padding: 14px !important;
  box-shadow: 0 4px 14px rgba(128, 80, 208, .45) !important;
}
.distortion-throw-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.distortion-history {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
  margin: 10px 0;
  min-height: 22px;
}

/* ══════════════════════════════════════════════════════════════
   MARQUES DE MARQUAGE (Marks system)
   ══════════════════════════════════════════════════════════════ */
/* Barre de filtres dans la boîte */
.mark-filter-bar { display: flex; align-items: center; gap: 5px; padding: 6px 10px 4px; flex-wrap: wrap; }
.mark-filter-label { font-size: .7rem; font-weight: 700; color: var(--text-dim); margin-right: 2px; white-space: nowrap; }
.mark-filter-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ccc;
  background: #f0f0f0; color: #aaa; font-size: 1rem; line-height: 1;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.mark-filter-btn:hover { border-color: #6080e0; color: #6080e0; background: #e8eeff; }
.mark-filter-btn.active { border-color: #3050c0; background: #3050c0; color: #fff; box-shadow: 0 2px 8px rgba(48,80,192,.35); }

/* Icônes sur les cellules de la boîte */
.cell-marks { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 1px; flex-wrap: wrap; }
.cell-mark-icon { font-size: .55rem; color: #3050c0; line-height: 1; }

/* Section marques dans la modal actions */
.actions-marks-section { margin-top: 10px; padding: 8px 12px; background: #f7f7fb; border-radius: 12px; }
.actions-marks-label { display: block; font-size: .65rem; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.actions-marks-row { display: flex; gap: 8px; justify-content: center; }
.mark-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid #ccc;
  background: #f0f0f0; color: #bbb; font-size: 1.1rem; line-height: 1;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.mark-btn:hover { border-color: #6080e0; color: #6080e0; background: #e8eeff; }
.mark-btn.active { border-color: #3050c0; background: #3050c0; color: #fff; box-shadow: 0 2px 8px rgba(48,80,192,.35); }

/* ══════════════════════════════════════════════════════════════
   CAPACITÉ DU SAC
   ══════════════════════════════════════════════════════════════ */
.bag-capacity { padding: 8px 12px 6px; margin-bottom: 6px; }
.bag-cap-bar { height: 7px; background: #e5e5e5; border-radius: 6px; overflow: hidden; margin-bottom: 4px; }
.bag-cap-fill { height: 100%; background: linear-gradient(90deg, #56ab2f, #a8e063); border-radius: 6px; transition: width .4s; width: 0%; }
.bag-capacity.near-full .bag-cap-fill { background: linear-gradient(90deg, #e08830, #f0c040); }
.bag-capacity.full .bag-cap-fill { background: linear-gradient(90deg, #e03020, #ff6050); }
.bag-cap-footer { display: flex; align-items: center; justify-content: space-between; }
.bag-cap-text { font-size: .7rem; font-weight: 700; color: var(--text-dim); }
.bag-blacklist-btn { font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 8px; border: 1.5px solid #e05030; background: #fff4f2; color: #e05030; cursor: pointer; transition: background .15s; }
.bag-blacklist-btn:hover { background: #ffe0da; }

/* item-card blacklistée */
.item-card.blacklisted { opacity: .55; border: 2px solid #e0603080 !important; position: relative; }
.item-card.blacklisted::after { content: '🚫'; position: absolute; top: 2px; right: 3px; font-size: .7rem; }

/* ══════════════════════════════════════════════════════════════
   BLACKLIST MODAL
   ══════════════════════════════════════════════════════════════ */
.blacklist-card { max-width: 420px; width: 95%; max-height: 85vh; display: flex; flex-direction: column; }
.blacklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow-y: auto; max-height: 55vh; padding: 4px 2px; scrollbar-width: thin; scrollbar-color: #e05030 #f0f0f0; }
.blacklist-grid::-webkit-scrollbar { width: 5px; }
.blacklist-grid::-webkit-scrollbar-thumb { background: #e05030; border-radius: 4px; }
.blacklist-cell { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: #f8f8f8; border: 2px solid transparent; cursor: pointer; transition: all .15s; }
.blacklist-cell:hover { background: #fff0ee; border-color: #e05030; }
.blacklist-cell.blacklisted { background: #fff0ee; border-color: #e05030; }
.blacklist-icon { font-size: 1.1rem; flex-shrink: 0; }
.blacklist-name { font-size: .7rem; font-weight: 700; color: var(--text); flex: 1; line-height: 1.2; }
.blacklist-toggle { font-size: .85rem; flex-shrink: 0; }
/* ══════════════════════════════════════════════════════════════
   BULK MARK MODAL
══════════════════════════════════════════════════════════════ */
.bulk-btn.mark { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; }
.bulk-btn.mark:hover { filter: brightness(1.12); }

.bulk-mark-card { max-width: 360px; width: 92%; padding: 22px 18px 18px; }
.bulk-mark-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; text-align: center; }
.bulk-mark-sub { font-size: .78rem; color: #666; text-align: center; margin: 0 0 18px; }
.bulk-mark-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
}
.bulk-mark-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 8px;
  border-radius: 14px;
  border: 3px solid #e0e0e0;
  background: #f8f8f8;
  cursor: pointer;
  font-size: 2rem;
  min-height: 80px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.bulk-mark-choice span { font-size: .75rem; font-weight: 800; color: #444; letter-spacing: .02em; }
.bulk-mark-choice:hover { border-color: #8b5cf6; background: #f3eeff; transform: scale(1.05); box-shadow: 0 4px 14px rgba(139,92,246,.25); }
.bulk-mark-choice:active { transform: scale(.93); }
.bulk-mark-remove {
  width: 100%;
  padding: 13px 0;
  border-radius: 12px;
  border: 2px solid #e05030;
  background: #fff4f2;
  color: #e05030;
  font-size: .85rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.bulk-mark-remove:hover { background: #ffe0da; }