:root {
  --bg-1: #fff6d5;
  --bg-2: #ffe08a;
  --text: #3d2b00;
  --card-bg: #ffffff;
  --accent: #ffb703;
  --accent-dark: #e08e00;
  --danger: #e63946;
  --radius: 16px;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 16px 60px;
}

.topbar {
  text-align: center;
  padding: 12px 0 6px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.6);
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 1.05rem;
}

.stats-bar span {
  background: var(--card-bg);
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: var(--shadow);
}

.mute-btn {
  border: none;
  background: var(--card-bg);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  line-height: 1;
}
.mute-btn.muted { opacity: 0.55; }

/* --- Onglets --- */

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.tab-btn {
  border: none;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.tab-btn:hover { transform: translateY(-2px); }

.tab-btn.active {
  background: var(--accent);
  color: #2b1a00;
  box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Accueil / récolte --- */

#tab-accueil { text-align: center; }

.harvest-btn {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 800;
  padding: 22px 30px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffd23f, #ff9f1c);
  color: #3d2200;
  box-shadow: 0 8px 0 var(--accent-dark), var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  width: min(100%, 420px);
}

.harvest-btn:hover { transform: translateY(-2px); }
.harvest-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 var(--accent-dark), var(--shadow);
}
.harvest-btn:disabled { opacity: 0.75; cursor: default; }

.last-banana-zone {
  margin: 26px auto 0;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-hint {
  color: #7a6224;
  font-style: italic;
}

/* --- Carte "héros" de la dernière banane récoltée --- */

.harvest-reveal-card {
  --rarity-color: #9e9e9e;
  --rarity-glow: #c9c9c9;
  position: relative;
  width: min(100%, 320px);
  margin: 0 auto;
  padding: 34px 20px 26px;
  border-radius: 26px;
  border: 4px solid var(--rarity-color);
  background: radial-gradient(circle at 50% 30%, #fffef6, var(--card-bg) 70%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16), 0 0 0 6px rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  text-align: center;
}

.harvest-reveal-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--rarity-glow) 0%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.harvest-reveal-card .banana-icon {
  position: relative;
  margin: 6px auto 14px;
  animation: heroFloat 2.6s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.harvest-reveal-name {
  position: relative;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.35rem;
  margin-top: 4px;
}

.harvest-reveal-rarity-pill {
  position: relative;
  display: inline-block;
  margin-top: 8px;
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--rarity-color);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.harvest-reveal-meta {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #5c4a1a;
}

.harvest-reveal-card.rarity-secrete {
  background: radial-gradient(circle at 50% 30%, #2a2145, #1c1c2b 70%);
  color: white;
}
.harvest-reveal-card.rarity-secrete .harvest-reveal-name,
.harvest-reveal-card.rarity-secrete .harvest-reveal-meta { color: #f0e8ff; }

.harvest-reveal-card.rarity-mythique {
  background: radial-gradient(circle at 50% 25%, #fff0f7, var(--card-bg) 75%);
}

.harvest-reveal-card.pop-in { animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.harvest-reveal-card.glow-pulse {
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), heroGlowPulse 1.6s ease-in-out infinite;
}

@keyframes heroGlowPulse {
  0%, 100% { box-shadow: 0 0 18px 4px var(--rarity-glow), 0 14px 32px rgba(0, 0, 0, 0.16); }
  50% { box-shadow: 0 0 36px 12px var(--rarity-glow), 0 14px 32px rgba(0, 0, 0, 0.16); }
}

/* --- Cartes banane --- */

.banana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.banana-card {
  --rarity-color: #9e9e9e;
  --rarity-glow: #c9c9c9;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 3px solid var(--rarity-color);
  box-shadow: 0 0 0 rgba(0,0,0,0), var(--shadow);
  padding: 14px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.banana-card.locked {
  border-color: #cfcfcf;
  filter: grayscale(1);
  opacity: 0.7;
}

.banana-emoji {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 6px;
}

.banana-emoji.silhouette { filter: brightness(0.15); opacity: 0.5; }

/* --- Icône banane fusionnée (glyphe + accessoires) --- */

.banana-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --icon-size: 2.4rem;
  width: var(--icon-size);
  height: var(--icon-size);
  margin: 0 auto 6px;
}

.banana-icon-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--icon-size);
  line-height: 1;
}

.deco { position: absolute; pointer-events: none; }

.deco-text {
  font-size: calc(var(--icon-size) * 0.4);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Catalogue de formes d'accessoires ---
   Chaque forme a un dégradé + une ombre intégrés, pour éviter tout
   effet de rectangle plat ou de trait brut : `--deco-color-a/-b`
   (définies en inline par bananaIconHTML) pilotent la teinte. */

.deco-band {
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0.18)),
    linear-gradient(180deg, var(--deco-color-a), var(--deco-color-b));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.deco-orb {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(0, 0, 0, 0.15) 75%),
    linear-gradient(180deg, var(--deco-color-a), var(--deco-color-b));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.deco-ring {
  border-radius: 50%;
  border: 2px solid var(--deco-color-a);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 4px rgba(255, 255, 255, 0.4);
}

.deco-peak-up, .deco-peak-down, .deco-peak-out-left, .deco-peak-out-right {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.15)),
    linear-gradient(180deg, var(--deco-color-a), var(--deco-color-b));
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
}

.deco-peak-up { clip-path: polygon(50% 0, 0 100%, 100% 100%); }
.deco-peak-down { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.deco-peak-out-left { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.deco-peak-out-right { clip-path: polygon(0 0, 100% 50%, 0 100%); }

.deco-bubble {
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f2f2f2);
  border: 2px solid #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

@keyframes hueSpin {
  from { filter: saturate(1.6) drop-shadow(0 0 8px #ff9fd0) hue-rotate(0deg); }
  to { filter: saturate(1.6) drop-shadow(0 0 8px #ff9fd0) hue-rotate(360deg); }
}

.anim-rainbow { animation: hueSpin 3s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .anim-rainbow { animation: none; }
}

.banana-name {
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 2.4em;
}

.banana-rarity {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rarity-color);
  text-transform: uppercase;
  margin-top: 2px;
}

.banana-value, .banana-count {
  font-size: 0.85rem;
  margin-top: 2px;
  color: #5c4a1a;
}

.banana-card.pop-in { animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes popIn {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.banana-card.glow-pulse {
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), glowPulse 1.4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px 2px var(--rarity-glow), var(--shadow); }
  50% { box-shadow: 0 0 24px 8px var(--rarity-glow), var(--shadow); }
}

.new-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #ff5da2, #ff9f1c);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 0;
  letter-spacing: 0.03em;
}

/* --- Rareté couleurs de fond légères --- */
.rarity-secrete { background: linear-gradient(135deg, #1c1c2b, #3a2d5c); color: white; }
.rarity-secrete .banana-name, .rarity-secrete .banana-value, .rarity-secrete .banana-count { color: #f0e8ff; }
.rarity-mythique { background: linear-gradient(135deg, #fff0f7, #ffe0f0); }

/* --- Collection / progression --- */

.progress-wrap { margin: 14px 0 20px; }

#progress-label { font-weight: 700; }

.progress-bar {
  height: 16px;
  border-radius: 999px;
  background: #f0e2b6;
  overflow: hidden;
  margin-top: 6px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd23f, #ff5da2);
  transition: width 0.4s ease;
}

.secret-section { margin-top: 30px; }
.secret-hint { font-style: italic; color: #6b5a30; }

/* --- Boutique --- */

.shop-hint { color: #6b5a30; }

.shop-list { display: flex; flex-direction: column; gap: 12px; }

.shop-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.shop-item-name { font-weight: 700; }
.shop-item-level { font-weight: 400; font-size: 0.8rem; color: #7a6224; margin-left: 6px; }
.shop-item-desc { font-size: 0.85rem; color: #5c4a1a; margin-top: 2px; }

/* --- Quêtes quotidiennes --- */

.quests-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.quest-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.quest-item.done { opacity: 0.65; }

.quest-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.quest-item-desc { flex: 1; }
.quest-item-reward { font-weight: 800; color: var(--accent-dark); white-space: nowrap; }

.quest-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #f0e2b6;
  overflow: hidden;
  margin-top: 8px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd23f, #ff5da2);
  transition: width 0.4s ease;
}

.quest-item-count { font-size: 0.78rem; color: #7a6224; margin-top: 4px; }

/* --- Boutons génériques --- */

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  background: var(--accent);
  color: #2b1a00;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.danger { background: var(--danger); color: white; }

.reset-btn { margin-top: 24px; }

/* --- Publicité --- */

.ad-slot {
  border: 2px dashed #d8c383;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  padding: 34px 16px;
  text-align: center;
  margin: 6px 0 20px;
}

.ad-slot-label {
  font-weight: 800;
  color: #7a6224;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.ad-slot-sub {
  font-size: 0.8rem;
  color: #9c874f;
  margin-top: 6px;
}

.watch-ad-btn {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  padding: 14px 20px;
  font-size: 1rem;
}

.ad-quota {
  text-align: center;
  color: #7a6224;
  font-size: 0.85rem;
  margin-top: 10px;
}

.privacy-link {
  text-align: center;
  margin-top: 18px;
}

.privacy-link a {
  color: #b5680b;
  font-size: 0.8rem;
}

.hidden { display: none !important; }

/* --- Mini-jeux : menu --- */

.game-menu { display: flex; flex-direction: column; gap: 14px; }

.game-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--card-bg);
  border: 2px solid #f0dfa8;
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: transform 0.15s ease;
}
.game-card:hover { transform: translateY(-2px); }

.game-card-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.game-card-body { display: flex; flex-direction: column; gap: 3px; }
.game-card-title { font-weight: 800; font-size: 1.05rem; }
.game-card-desc { font-size: 0.85rem; color: #5c4a1a; }
.game-card-best { font-size: 0.8rem; font-weight: 700; color: var(--accent-dark); }

.game-back-btn { margin-bottom: 14px; }

/* --- Mini-jeu : Attrape les bananes --- */

.catch-hud {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.catch-area {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  border: 3px solid var(--accent);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background 0.6s ease;
}

/* Fond de jungle : chaque niveau assombrit un peu plus le décor,
   pour appuyer visuellement la montée en difficulté. */
.catch-area.level-1 { background: linear-gradient(180deg, #dff2c8 0%, #a8d98a 35%, #6fb35a 70%, #4f9646 100%); }
.catch-area.level-2 { background: linear-gradient(180deg, #a8d98a 0%, #5fa64c 40%, #3c7d38 75%, #2c5f2a 100%); }
.catch-area.level-3 { background: linear-gradient(180deg, #3c7d38 0%, #245023 45%, #163116 80%, #0c1f0c 100%); }

.catch-jungle-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.catch-jungle-deco span {
  position: absolute;
  opacity: 0.35;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}


.catch-start-overlay,
.catch-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 246, 213, 0.92);
  text-align: center;
  padding: 20px;
}

.catch-instructions { color: #5c4a1a; max-width: 240px; }

.catch-result-title { font-size: 1.3rem; font-weight: 800; }
.catch-result-line { font-size: 0.95rem; color: #5c4a1a; }
.catch-result-coins { font-size: 1.4rem; font-weight: 800; color: var(--accent-dark); }

.catch-item {
  position: absolute;
  top: -50px;
  cursor: pointer;
  transition: top linear;
  user-select: none;
}

/* --- Mini-jeu : Roue de la fortune --- */

.wheel-wrap {
  position: relative;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  margin: 10px auto 20px;
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  color: var(--accent-dark);
  z-index: 2;
}

.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-dark);
  background: conic-gradient(
    #ffd23f 0deg 60deg,
    #ff9f1c 60deg 120deg,
    #ff5da2 120deg 180deg,
    #9c27b0 180deg 240deg,
    #2196f3 240deg 300deg,
    #4caf50 300deg 360deg
  );
  transition: transform 4s cubic-bezier(0.15, 0.7, 0.2, 1);
  position: relative;
}

.wheel-label-pivot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 38%;
  transform-origin: top center;
}

.wheel-label {
  position: absolute;
  top: 100%;
  left: 0;
  display: inline-block;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

/* --- Statistiques --- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num { font-size: 1.3rem; font-weight: 800; word-break: break-word; }
.stat-label { font-size: 0.85rem; color: #5c4a1a; margin-top: 4px; }

/* --- Succès --- */

.achievements-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.achievements-count {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7a6224;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.achievement-badge.locked { opacity: 0.55; }

.achievement-icon { font-size: 1.7rem; flex-shrink: 0; width: 1.7rem; text-align: center; }
.achievement-info { flex: 1; min-width: 0; }
.achievement-name { font-weight: 800; font-size: 0.95rem; }
.achievement-desc { font-size: 0.8rem; color: #5c4a1a; margin-top: 2px; }
.achievement-reward { font-weight: 800; font-size: 0.85rem; color: var(--accent-dark); white-space: nowrap; }

/* --- Combat : l'Arène des Ananas --- */

.pve-picker { margin: 12px 0; }
.pve-picker-label { font-weight: 700; display: block; margin-bottom: 8px; }

.pve-banana-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pve-banana-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--card-bg);
  border: 2px solid #f0dfa8;
  border-radius: 12px;
  padding: 6px 8px;
  cursor: pointer;
  font-family: inherit;
}

.pve-banana-option.selected {
  border-color: var(--accent-dark);
  background: #fff6d5;
  box-shadow: 0 0 0 2px var(--accent);
}

.pve-banana-stats { font-size: 0.68rem; font-weight: 700; color: #5c4a1a; }

.pve-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px 0;
}

.pve-fighter {
  flex: 1;
  max-width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pve-fighter-empty { color: #7a6224; font-style: italic; font-size: 0.85rem; }
.pve-fighter-name { font-weight: 800; font-size: 0.85rem; margin-top: 6px; }
.pve-fighter-stats { font-size: 0.78rem; color: #5c4a1a; margin-top: 2px; }
.pve-enemy-icon { line-height: 1; }

.pve-vs-mark {
  font-size: 1.6rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.pve-vs-mark.clash { animation: pveClash 0.5s ease; }

@keyframes pveClash {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.6) rotate(-15deg); }
  60% { transform: scale(1.6) rotate(15deg); }
}

.pve-result {
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.pve-result-title { font-size: 1.2rem; font-weight: 800; }
.pve-result-line { font-size: 0.9rem; color: #5c4a1a; margin-top: 4px; }
.pve-result-coins { font-size: 1.2rem; font-weight: 800; color: var(--accent-dark); margin-top: 6px; }

.pve-stage-label { font-weight: 700; margin: 22px 0 8px; }

.pve-stage-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pve-stage-group-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #7a6224;
  margin-bottom: 6px;
}

.pve-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pve-stage-chip {
  position: relative;
  background: var(--card-bg);
  border: 2px solid #f0dfa8;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 1.3rem;
  cursor: pointer;
  font-family: inherit;
}

.pve-stage-chip.selected { border-color: var(--accent-dark); box-shadow: 0 0 0 2px var(--accent); }
.pve-stage-chip.locked { opacity: 0.5; cursor: not-allowed; }
.pve-stage-chip .pve-stage-check { position: absolute; bottom: -4px; right: -4px; font-size: 0.7rem; }

/* --- Overlay épique / mythique --- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay.show { opacity: 1; }
.overlay.hidden { display: none; }

.overlay-content {
  text-align: center;
  color: white;
  transform: scale(0.7);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.overlay.show .overlay-content { transform: scale(1); }

.epic-sparkles { font-size: 1.8rem; animation: spin 2s linear infinite; }
@keyframes spin { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

.epic-title {
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 900;
  margin: 10px 0;
  background: linear-gradient(90deg, #ff5da2, #ffd23f, #6fc3ff, #ff5da2);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 2s linear infinite;
}
@keyframes rainbow { from { background-position: 0% 0; } to { background-position: 300% 0; } }

.epic-emoji { margin: 10px 0; display: flex; justify-content: center; }
.epic-sub { font-weight: 700; max-width: 320px; margin: 0 auto 10px; }
.epic-name { font-size: 1.1rem; font-style: italic; margin-bottom: 16px; }
.epic-close { margin-top: 6px; }

/* --- Bannière légendaire --- */

.rare-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -140%);
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 90;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rare-banner.show { transform: translate(-50%, 0); }
.rare-banner-title { display: block; font-weight: 900; font-size: 1.2rem; }
.rare-banner-name { display: block; font-size: 0.95rem; margin-top: 4px; }

/* --- Confettis --- */

.toast-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -40px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0.9; }
}

/* --- Modal de confirmation --- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
}
.modal.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* --- Responsive --- */

@media (max-width: 480px) {
  .banana-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .stats-bar { font-size: 0.9rem; }
  .tab-btn { padding: 8px 12px; font-size: 0.85rem; }
}
