/* === Fusion Animaux — page de jeu (solo.php) === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(251, 191, 36, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(217, 119, 6, 0.06) 0%, transparent 50%),
    linear-gradient(135deg, #1a0f05, #2a1810, #1a0f05);
  color: #f8fafc;
  padding: 16px;
  -webkit-tap-highlight-color: transparent;
}

#fa-app {
  position: relative;
  z-index: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  background: rgba(31, 20, 8, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 24px;
  padding: 20px 18px 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.fa-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.fa-back {
  font-size: 0.85rem;
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
}
.fa-back:hover { color: #fde68a; }
.fa-titre {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fde68a, #fbbf24, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Compteur d'or */
.fa-banque {
  text-align: center;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 14px;
}
.fa-banque-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fde68a;
  opacity: 0.7;
}
.fa-banque-or {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fde68a;
  text-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
  font-variant-numeric: tabular-nums;
}
.fa-banque-or::before {
  content: '🪙';
  font-size: 1.4rem;
  margin-right: 6px;
  vertical-align: middle;
}
.fa-banque-taux {
  font-size: 0.85rem;
  color: #fbbf24;
  margin-top: 2px;
}
.fa-banque-max {
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-top: 4px;
}

/* Chips bonus actifs */
.fa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 0;
}
.fa-chip-bonus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.78rem;
}
.fa-chip-bonus .fa-chip-nom { color: #86efac; font-weight: 700; }
.fa-chip-bonus .fa-chip-time { color: #cbd5e1; opacity: 0.8; }
.fa-chip-coffre {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(217, 119, 6, 0.15));
  border-color: rgba(251, 191, 36, 0.45);
}
.fa-chip-coffre .fa-chip-nom { color: #fde68a; }

/* Grille des slots */
.fa-grille {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px;
  background: rgba(15, 8, 3, 0.5);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 16px;
  margin-bottom: 10px;
  user-select: none;
  touch-action: none;
}
.fa-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px dashed rgba(251, 191, 36, 0.15);
  background: rgba(251, 191, 36, 0.03);
  cursor: default;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  outline: none;
}
.fa-slot:focus { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.6); }
.fa-slot.fa-rempli {
  cursor: grab;
  border-style: solid;
}
.fa-slot.fa-rempli:active { cursor: grabbing; }
.fa-cadre {
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.fa-emoji {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
}
.fa-niveau {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #1a0f05;
  background: rgba(253, 230, 138, 0.95);
  padding: 1px 5px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.fa-ops {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.58rem;
  color: #fde68a;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.fa-slot-survole {
  border-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.12);
}
.fa-slot-drag .fa-cadre { opacity: 0.35; }
.fa-slot-ghost { opacity: 0.92; }
.fa-slot-selectionne {
  border-color: #fde68a !important;
  background: rgba(251, 191, 36, 0.18);
  box-shadow: 0 0 0 2px rgba(253, 230, 138, 0.6);
}

@keyframes fa-fusion-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.fa-anim-fusion .fa-cadre {
  animation: fa-fusion-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fa-anim-fusion::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 12px;
  border: 2px solid #fde68a;
  animation: fa-fusion-halo 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes fa-fusion-halo {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* Barre de spawn */
.fa-spawn {
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
}
.fa-spawn-info {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.fa-spawn-info::before {
  content: '🔥';
}
.fa-spawn-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
}
.fa-spawn-progress {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  border-radius: 3px;
  transition: width 0.2s linear;
}

/* Bouton torche */
.fa-torche-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.fa-btn-torche {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f1408;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.fa-btn-torche:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}
.fa-btn-torche:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: linear-gradient(135deg, #57534e, #44403c);
  color: #d6d3d1;
}
.fa-btn-torche-emoji { font-size: 1.2rem; }
.fa-btn-torche-cout { font-variant-numeric: tabular-nums; }

/* Barre de boutons bas */
.fa-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.fa-btn-action {
  position: relative;
  padding: 10px 6px 8px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  background: rgba(31, 20, 8, 0.5);
  color: #fde68a;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.fa-btn-action:hover {
  transform: translateY(-2px);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.5);
}
.fa-btn-action .fa-icon {
  font-size: 1.6rem;
  line-height: 1;
}

/* Modales */
.fa-modale {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.fa-modale-ouverte {
  opacity: 1;
  pointer-events: auto;
}
.fa-modale-panneau {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: linear-gradient(180deg, #2a1810, #1f1408);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 22px;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
}
.fa-modale-ouverte .fa-modale-panneau { transform: translateY(0); }
@media (min-width: 600px) {
  .fa-modale { align-items: center; }
  .fa-modale-panneau { border-radius: 18px; max-height: 80vh; }
}
.fa-modale-tete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
}
.fa-modale-titre {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fde68a;
}
.fa-modale-fermer {
  background: transparent;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  color: #fde68a;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
body.fa-modale-active { overflow: hidden; }

/* Liste ameliorations */
.fa-amelio {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
}
.fa-amelio-tete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.fa-amelio-titre { font-weight: 700; color: #fde68a; font-size: 0.95rem; }
.fa-amelio-palier { font-size: 0.78rem; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.fa-amelio-desc { font-size: 0.82rem; color: #cbd5e1; opacity: 0.85; margin-bottom: 6px; }
.fa-amelio-effet { font-size: 0.78rem; color: #fbbf24; margin-bottom: 8px; }
.fa-amelio-max { opacity: 0.55; }
.fa-btn, .fa-btn-amelio, .fa-btn-bonus, .fa-btn-daily {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1f1408;
  width: 100%;
  transition: transform 0.18s, opacity 0.18s;
}
.fa-btn:hover:not(:disabled), .fa-btn-amelio:hover:not(:disabled),
.fa-btn-bonus:hover:not(:disabled), .fa-btn-daily:hover:not(:disabled) {
  transform: translateY(-1px);
}
.fa-btn:disabled, .fa-btn-amelio:disabled, .fa-btn-bonus:disabled, .fa-btn-daily:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: linear-gradient(135deg, #57534e, #44403c);
  color: #d6d3d1;
}

/* Liste bonus */
.fa-bonus {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
}
.fa-bonus-actif { border-color: rgba(34, 197, 94, 0.4); }
.fa-bonus-cooldown { opacity: 0.65; }
.fa-bonus-titre { font-weight: 700; color: #fde68a; font-size: 0.95rem; margin-bottom: 3px; }
.fa-bonus-desc { font-size: 0.82rem; color: #cbd5e1; margin-bottom: 8px; }
.fa-bonus-actif-txt { color: #86efac; font-size: 0.82rem; font-weight: 700; }
.fa-bonus-cd-txt { color: #cbd5e1; font-size: 0.82rem; }

/* Daily */
.fa-daily-streak, .fa-daily-prochain {
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.fa-daily-deja {
  color: #cbd5e1;
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}

/* Collection */
.fa-collection-progression {
  text-align: center;
  margin-bottom: 14px;
  color: #fde68a;
  font-weight: 600;
}
.fa-collection-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.fa-coll-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 4px;
  border-radius: 10px;
  text-align: center;
}
.fa-coll-locked { opacity: 0.4; filter: grayscale(0.9); }
.fa-coll-cadre {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 4px;
  border: 2px solid;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fa-coll-emoji { font-size: 1.7rem; }
.fa-coll-niv {
  position: absolute;
  top: -6px; right: -6px;
  background: #fde68a;
  color: #1f1408;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fa-coll-nom {
  font-size: 0.72rem;
  color: #fde68a;
  font-weight: 600;
  line-height: 1.1;
}
.fa-coll-or {
  font-size: 0.66rem;
  color: #cbd5e1;
  opacity: 0.7;
  margin-top: 2px;
}

/* Toast */
.fa-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f1408;
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
  max-width: 90vw;
  text-align: center;
}
.fa-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Toast offline (plus large) */
.fa-toast-offline {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #2a1810, #1f1408);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1800;
  max-width: 90vw;
  width: 360px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.fa-toast-offline.fa-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Coffre */
.fa-coffre-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #1f1408;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 1700;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.5);
}
.fa-coffre-toast.fa-coffre-affiche {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.fa-coffre-emoji { font-size: 2rem; line-height: 1; }
.fa-coffre-txt { font-size: 0.88rem; line-height: 1.3; }
.fa-coffre-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fa-coffre-actions button {
  border: none;
  padding: 6px 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  background: #1f1408;
  color: #fde68a;
}
.fa-coffre-actions button.fa-coffre-passer {
  background: transparent;
  color: #1f1408;
  border: 1px solid #1f1408;
}

/* Lien reset (subtil dans modale collection) */
.fa-reset-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(251, 191, 36, 0.2);
  text-align: center;
}
.fa-reset {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .fa-grille { grid-template-columns: repeat(4, 1fr); }
  .fa-banque-or { font-size: 1.8rem; }
  .fa-actions { gap: 4px; }
  .fa-btn-action { font-size: 0.72rem; padding: 8px 4px 6px; }
  .fa-btn-action .fa-icon { font-size: 1.4rem; }
}
