/* ===================================================
   1. BASE ET LAYOUT GLOBAL PLEIN ÉCRAN
   =================================================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0c0d12;
  color: #fff;
  user-select: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: block; 
}

/* 🎮 Barre de défilement personnalisée (Univers du jeu) */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: #0c0d12;
  border-radius: 4px;
  border: 1px solid #1e293b;
}
::-webkit-scrollbar-thumb {
  background: #242a3e;
  border-radius: 4px;
  border: 1px solid #38bdf8;
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* 🎨 Standardisation Twemoji SVG */
img.emoji {
  height: 1.15em;
  width: 1.15em;
  margin: 0 0.15em 0 0.15em;
  vertical-align: -0.18em;
  display: inline-block;
}

#start-screen {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 16, 0.4);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease-out;
}

.start-card {
  background: #151824;
  border: 2px solid #3b82f6;
  border-radius: 20px;
  padding: 36px;
  width: 460px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 15px 50px rgba(59, 130, 246, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.start-card h1 {
  font-size: 2rem;
  color: #facc15;
  font-weight: 900;
}

.start-card p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.start-controls ul {
  list-style: none;
  color: #cbd5e1;
  font-size: 0.85rem;
  text-align: left;
  display: inline-block;
  margin: 0 auto;
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  line-height: 1.5;
  border: 1px solid #1e293b;
}
.start-controls li b { color: #f8fafc; }

.start-action-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

#player-pseudo-input {
  background: #0c0d12;
  border: 1px solid #2e344d;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

#player-pseudo-input:focus {
  border-color: #3b82f6;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #4a85c8;
  z-index: 1;
}

#canvas-container canvas, #fx-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
}

#speed-fx-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  background: radial-gradient(circle, transparent 35%, rgba(249, 115, 22, 0.25) 75%, rgba(220, 38, 38, 0.65) 100%);
  box-shadow: inset 0 0 120px rgba(249, 115, 22, 0.55), inset 0 0 50px rgba(220, 38, 38, 0.85);
  transition: opacity 0.15s ease-out;
}

#fps-ram-counter {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: bold;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
}

#player-overhead-tag, .player-overhead-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 15;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.tag-pseudo { color: #fff; font-size: 0.95rem; background: rgba(0,0,0,0.6); padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); white-space: nowrap; }
.tag-prestige { color: #e879f9; font-size: 0.75rem; white-space: nowrap; }
.tag-money { color: #facc15; font-size: 0.78rem; white-space: nowrap; }
.tag-combo { color: #fef08a; font-size: 0.72rem; background: rgba(234, 88, 12, 0.75); padding: 1px 6px; border-radius: 4px; margin-top: 2px; white-space: nowrap; }

/* ===================================================
   2. MODALES & OVERLAYS (Voile sombre unifié & flou)
   =================================================== */
#leaderboard-overlay, 
#stats-overlay, 
#achievements-overlay, 
#prestige-modal-overlay, 
#offline-modal-overlay, 
#reward-overlay, 
#settings-overlay, 
#wardrobe-modal-overlay, 
#inventory-modal-overlay,
#dev-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 10, 0.75);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease-out;
  z-index: 150;
}

#offline-modal-overlay, #reward-overlay, #dev-modal-overlay {
  z-index: 10000;
}

.modal-close-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: 1px solid #f87171;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transition: 0.15s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: scale(1.08);
}

.wardrobe-modal-card {
  background: #151824;
  border: 2px solid #a855f7;
  border-radius: 16px;
  width: 940px;
  max-width: 96vw;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 10px 50px rgba(168, 85, 247, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wd-sub { font-size: 0.85rem; color: #cbd5e1; margin: 0; }
.wd-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: stretch; }

/* --- Scène 3D + tenue --- */
.wd-stage { background: #0c0d12; border: 1px solid #2e344d; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wd-canvas-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid #2e344d;
  background: radial-gradient(ellipse at 50% 88%, rgba(168,85,247,0.30), transparent 62%), linear-gradient(#141729, #0c0d12); }
#skin-preview-canvas { width: 100%; height: clamp(190px, 44vh, 340px); display: block; cursor: grab; touch-action: none; }
#skin-preview-canvas:active { cursor: grabbing; }
.wd-hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 0.68rem; color: #94a3b8; pointer-events: none; }
.wd-slots { display: flex; flex-direction: column; gap: 6px; }
.wd-slot { display: flex; align-items: center; gap: 9px; padding: 7px 10px; background: #151824; border: 1px solid #2e344d; border-radius: 10px; cursor: pointer; text-align: left; color: #e2e8f0; font: inherit; transition: border-color 0.15s, background 0.15s; }
.wd-slot:hover { background: #1b2033; }
.wd-slot.active { border-color: #a855f7; }
.wd-slot-ico { font-size: 1.3rem; width: 26px; text-align: center; flex-shrink: 0; }
.wd-slot-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wd-slot-txt small { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.wd-slot-txt b { font-size: 0.82rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-slot-st { font-style: normal; font-size: 0.7rem; font-weight: 800; flex-shrink: 0; padding: 2px 7px; border-radius: 999px; background: #1e293b; color: #94a3b8; }
.wd-slot-st.ok { background: rgba(16,185,129,0.18); color: #34d399; }
.wd-slot-st.try { background: rgba(56,189,248,0.18); color: #38bdf8; }
.wd-slot-st.lock { background: rgba(148,163,184,0.15); color: #94a3b8; }
.wd-actions { display: flex; gap: 8px; }
.wd-actions .wd-btn.main { flex: 1; }
.wd-note { margin: 0; font-size: 0.72rem; color: #94a3b8; text-align: center; }

/* --- Boutons --- */
.wd-btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; color: #fff; transition: transform 0.12s, filter 0.12s, opacity 0.12s; min-height: 40px; }
.wd-btn.main { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 4px 14px rgba(168,85,247,0.35); }
.wd-btn.ok { background: #10b981; }
.wd-btn.ghost { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.wd-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.wd-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wd-btn.ok:disabled { opacity: 1; cursor: default; }

/* --- Collection --- */
.wd-collection { background: #0c0d12; border: 1px solid #2e344d; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wd-tabs { display: flex; gap: 8px; }
.wd-tab { flex: 1; background: #151824; border: 1px solid #2e344d; border-radius: 10px; padding: 9px 10px; color: #cbd5e1; font: inherit; font-weight: 800; font-size: 0.9rem; cursor: pointer; transition: 0.15s; }
.wd-tab:hover { background: #1b2033; }
.wd-tab.active { background: rgba(168,85,247,0.18); border-color: #a855f7; color: #fff; }
.wd-count { font-size: 0.72rem; opacity: 0.75; font-weight: 700; margin-left: 2px; }
.wd-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.8rem; color: #e2e8f0; margin-bottom: 5px; flex-wrap: wrap; }
.wd-next { font-size: 0.72rem; color: #94a3b8; }
.wd-bar { display: block; height: 7px; background: #1e293b; border-radius: 999px; overflow: hidden; }
.wd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a855f7, #38bdf8); border-radius: 999px; transition: width 0.3s; }
.wd-bar.mini { height: 4px; margin-top: 2px; width: 100%; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.wd-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 9px; background: #151824; border: 2px solid #2e344d; border-radius: 12px; cursor: pointer; color: #e2e8f0; font: inherit; text-align: center; transition: transform 0.12s, border-color 0.15s, background 0.15s; }
.wd-card:hover { transform: translateY(-2px); background: #1b2033; }
.wd-card.sel { border-color: #a855f7; box-shadow: 0 0 0 2px rgba(168,85,247,0.25); }
.wd-card.eq::after { content: '✔'; position: absolute; top: 5px; right: 6px; font-size: 0.7rem; font-weight: 900; color: #fff; background: #10b981; border-radius: 999px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.wd-card.lock .wd-swatch { filter: grayscale(0.7); opacity: 0.75; }
.wd-swatch { position: relative; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.45), transparent 45%), var(--fill, #64748b);
  border: 3px solid var(--acc, #94a3b8); box-shadow: 0 0 14px color-mix(in srgb, var(--acc, #94a3b8) 45%, transparent); }
.wd-lock { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 0.8rem; background: #0c0d12; border-radius: 999px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border: 1px solid #334155; }
.wd-fx { position: absolute; left: -4px; top: -4px; font-style: normal; font-size: 0.75rem; }
.wd-name { font-size: 0.78rem; font-weight: 800; line-height: 1.15; min-height: 1.8em; display: flex; align-items: center; }
.wd-state { font-size: 0.68rem; color: #94a3b8; font-weight: 700; }
.wd-card.eq .wd-state { color: #34d399; }
.wd-detail { background: #151824; border: 1px solid #2e344d; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.wd-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #facc15; font-size: 1rem; }
.wd-tag { font-size: 0.68rem; font-weight: 800; color: #38bdf8; background: rgba(56,189,248,0.15); padding: 2px 8px; border-radius: 999px; }
.wd-desc { margin: 0; font-size: 0.8rem; color: #cbd5e1; line-height: 1.35; }
.wd-need { margin: 0; font-size: 0.78rem; color: #fbbf24; font-weight: 700; }
.wd-detail .wd-btn { align-self: flex-start; min-width: 150px; margin-top: 2px; }

@media (max-width: 760px) {
  .wardrobe-modal-card { padding: 14px; gap: 8px; }
  .wd-body { grid-template-columns: 1fr; gap: 12px; }
  #skin-preview-canvas { height: clamp(190px, 34vh, 260px); }
  .wd-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
  .wd-detail .wd-btn { align-self: stretch; }
}

/* =============================================================================
   🏆 CLASSEMENT (TAB) — voir js/leaderboard.js
   ============================================================================= */
.lb2-card {
  background: #151824;
  border: 2px solid #38bdf8;
  border-radius: 20px;
  width: min(980px, 96vw);
  height: min(86vh, 780px);
  height: min(86dvh, 780px);
  padding: 20px 22px 16px;
  box-shadow: 0 20px 60px rgba(56, 189, 248, 0.40);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}
.lb2-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lb2-titlebox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.lb2-title { margin: 0; font-size: 1.5rem; font-weight: 900; color: #38bdf8; letter-spacing: 0.3px; }
.lb2-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; color: #34d399; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.35); padding: 3px 10px; border-radius: 999px; }
.lb2-live i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: lb2-pulse 1.8s infinite; }
.lb2-live.off { color: #f87171; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.35); }
.lb2-live.off i { background: #f87171; animation: none; }
@keyframes lb2-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.55); } 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

.lb2-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #0c0d12; border: 1px solid #242a3e; border-radius: 12px; padding: 4px; }
.lb2-seg-btn { display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 0; border-radius: 9px; padding: 9px 6px; color: #94a3b8; font: inherit; font-weight: 800; font-size: 0.86rem; cursor: pointer; transition: background 0.15s, color 0.15s; min-width: 0; }
.lb2-seg-btn:hover { background: #1b2033; color: #e2e8f0; }
.lb2-seg-btn.on { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 0 14px rgba(59,130,246,0.4); }
.lb2-seg-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb2-hint { font-size: 0.74rem; color: #94a3b8; margin: -2px 2px 0; }

.lb2-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lb2-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.lb2-tabs::-webkit-scrollbar { display: none; }
.lb2-tab { display: inline-flex; align-items: center; gap: 6px; background: #1b1e2c; border: 1px solid #2c334d; border-radius: 999px; padding: 7px 14px; color: #94a3b8; font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; transition: 0.15s; }
.lb2-tab:hover { background: #262c40; color: #fff; }
.lb2-tab.on { background: rgba(250,204,21,0.16); border-color: #facc15; color: #facc15; }
.lb2-search { background: #0c0d12; border: 1px solid #2c334d; border-radius: 999px; padding: 8px 14px; color: #e2e8f0; font: inherit; font-size: 0.85rem; width: 200px; max-width: 100%; outline: none; }
.lb2-search:focus { border-color: #38bdf8; }

.lb2-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0c0d12; border: 1px solid #242a3e; border-radius: 14px; overflow: hidden; }
.lb2-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }

/* --- Podium --- */
.lb2-podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 10px; align-items: end; margin-bottom: 12px; }
.lb2-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 0; border-radius: 14px 14px 0 0; border: 1px solid rgba(255,255,255,0.08); border-bottom: 0; color: #e2e8f0; font: inherit; cursor: pointer; min-width: 0; transition: transform 0.15s, filter 0.15s; }
.lb2-pod:hover { transform: translateY(-3px); filter: brightness(1.12); }
.lb2-pod.p1 { background: linear-gradient(180deg, rgba(250,204,21,0.28), rgba(250,204,21,0.04)); border-color: #facc15; }
.lb2-pod.p2 { background: linear-gradient(180deg, rgba(203,213,225,0.22), rgba(203,213,225,0.03)); border-color: #cbd5e1; }
.lb2-pod.p3 { background: linear-gradient(180deg, rgba(217,119,6,0.26), rgba(217,119,6,0.03)); border-color: #d97706; }
.lb2-pod.me { box-shadow: 0 0 0 2px #38bdf8 inset; }
.lb2-pod-medal { font-size: 1.6rem; line-height: 1; }
.lb2-pod.p1 .lb2-pod-medal { font-size: 2rem; }
.lb2-pod-name { display: flex; align-items: center; gap: 6px; max-width: 100%; font-weight: 900; font-size: 0.95rem; }
.lb2-pod.p1 .lb2-pod-name { font-size: 1.08rem; }
.lb2-pod-val { font-weight: 900; color: #facc15; font-size: 0.95rem; white-space: nowrap; }
.lb2-pod-step { align-self: stretch; margin-top: 6px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border-top: 1px solid rgba(255,255,255,0.1); color: #94a3b8; font-size: 0.8rem; }
.lb2-pod.p1 .lb2-pod-step { height: 46px; } .lb2-pod.p2 .lb2-pod-step { height: 32px; } .lb2-pod.p3 .lb2-pod-step { height: 22px; }

/* --- Avatars --- */
.lb2-av { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; color: #fff; border: 1px solid rgba(255,255,255,0.18); }
.lb2-av.big { position: relative; width: 58px; height: 58px; margin-top: 12px; font-size: 1.5rem; border: 3px solid rgba(255,255,255,0.3); }
.lb2-pod.p1 .lb2-av.big { width: 70px; height: 70px; font-size: 1.8rem; border-color: #facc15; box-shadow: 0 0 20px rgba(250,204,21,0.45); }
.lb2-av-hat { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 34px; height: 7px; border-radius: 3px; background: var(--hc, #6d4a27); border: 1px solid rgba(255,255,255,0.5); }
.lb2-av-hat::before { content: ''; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); width: 20px; height: 9px; border-radius: 4px 4px 0 0; background: var(--hc, #6d4a27); border: 1px solid rgba(255,255,255,0.5); border-bottom: 0; }

/* --- Lignes --- */
.lb2-list { display: flex; flex-direction: column; gap: 5px; }
.lb2-row { display: grid; grid-template-columns: 46px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 7px 12px 7px 8px; color: #e2e8f0; font: inherit; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.lb2-row:hover { background: rgba(56,189,248,0.14); border-color: #38bdf8; }
.lb2-row.me { background: rgba(56,189,248,0.16); border-color: #38bdf8; }
.lb2-row.flash { animation: lb2-flash 1.4s ease-out; }
@keyframes lb2-flash { 0% { background: rgba(250,204,21,0.55); } 100% { background: rgba(56,189,248,0.16); } }
.lb2-rk { font-weight: 900; color: #94a3b8; text-align: center; font-size: 0.9rem; }
.lb2-nm { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lb2-nm-l { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lb2-name-t { font-weight: 800; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb2-you { font-style: normal; font-size: 0.66rem; font-weight: 900; color: #0c0d12; background: #38bdf8; border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
.lb2-on { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 6px #34d399; }
.lb2-clan { flex-shrink: 0; font-size: 0.68rem; font-weight: 900; color: #c4b5fd; background: rgba(139,92,246,0.18); border: 1px solid rgba(139,92,246,0.45); border-radius: 6px; padding: 1px 6px; }
.lb2-trend { flex-shrink: 0; font-size: 0.68rem; font-weight: 900; border-radius: 6px; padding: 1px 5px; animation: lb2-pop 0.4s ease-out; }
.lb2-trend.up { color: #34d399; background: rgba(52,211,153,0.15); }
.lb2-trend.down { color: #f87171; background: rgba(248,113,113,0.15); }
@keyframes lb2-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lb2-gauge { display: block; height: 4px; background: #1e293b; border-radius: 999px; overflow: hidden; }
.lb2-gauge i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #38bdf8); border-radius: 999px; transition: width 0.4s; }
.lb2-row.top1 .lb2-gauge i, .lb2-row.top2 .lb2-gauge i, .lb2-row.top3 .lb2-gauge i { background: linear-gradient(90deg, #f59e0b, #facc15); }
.lb2-val { font-weight: 900; color: #facc15; font-size: 0.92rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb2-foot { text-align: center; color: #64748b; font-size: 0.72rem; padding: 10px 0 2px; }

/* --- Ta position --- */
.lb2-me { display: none; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(59,130,246,0.12)); border: 1px solid #38bdf8; border-radius: 14px; padding: 10px 16px; }
.lb2-me.clickable { cursor: pointer; }
.lb2-me-rank { display: flex; flex-direction: column; align-items: center; min-width: 70px; line-height: 1.1; }
.lb2-me-rank b { font-size: 1.5rem; font-weight: 900; color: #38bdf8; }
.lb2-me-rank small { font-size: 0.68rem; color: #94a3b8; }
.lb2-me-mid { flex: 1; min-width: 0; }
.lb2-me-t { font-weight: 900; font-size: 0.9rem; }
.lb2-me-gap { font-size: 0.78rem; color: #cbd5e1; margin-top: 2px; }
.lb2-me-val { font-weight: 900; color: #facc15; font-size: 1.05rem; white-space: nowrap; }

/* --- États (chargement, vide, erreur) --- */
.lb2-skel { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lb2-skel-row { height: 46px; border-radius: 10px; background: linear-gradient(90deg, #151824 25%, #1e2438 50%, #151824 75%); background-size: 200% 100%; animation: lb2-shimmer 1.3s infinite linear; }
@keyframes lb2-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.lb2-state { margin: auto; text-align: center; padding: 30px 20px; max-width: 420px; }
.lb2-state-ic { font-size: 2.6rem; }
.lb2-state-t { font-weight: 900; font-size: 1.05rem; margin: 6px 0; color: #e2e8f0; }
.lb2-state p { margin: 0 0 14px; color: #94a3b8; font-size: 0.85rem; line-height: 1.4; }
.lb2-state-a { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lb2-btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 800; font-size: 0.85rem; color: #fff; cursor: pointer; background: linear-gradient(135deg, #3b82f6, #1d4ed8); min-height: 40px; }
.lb2-btn.ghost { background: #1e293b; border-color: #334155; color: #cbd5e1; }

/* --- Mobile : feuille plein écran --- */
@media (max-width: 760px) {
  #leaderboard-overlay { padding: 0 !important; align-items: stretch; }
  .lb2-card { width: 100vw; height: 100vh; height: 100dvh; max-width: none; border-radius: 0; border-width: 0; padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .lb2-title { font-size: 1.2rem; }
  .lb2-seg-btn { flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 0.7rem; }
  .lb2-seg-ic { font-size: 1.05rem; }
  .lb2-hint { display: none; }
  .lb2-search { width: 100%; }
  .lb2-podium { gap: 6px; }
  .lb2-pod { padding: 8px 4px 0; }
  .lb2-av.big { width: 46px; height: 46px; font-size: 1.2rem; } .lb2-pod.p1 .lb2-av.big { width: 56px; height: 56px; }
  .lb2-pod-name { font-size: 0.8rem; } .lb2-pod.p1 .lb2-pod-name { font-size: 0.88rem; }
  .lb2-pod-val { font-size: 0.78rem; }
  .lb2-row { grid-template-columns: 38px 30px minmax(0, 1fr) auto; gap: 8px; padding: 7px 8px 7px 4px; }
  .lb2-av { width: 30px; height: 30px; font-size: 0.85rem; }
  .lb2-me { padding: 8px 12px; gap: 10px; }
  .lb2-me-rank { min-width: 56px; } .lb2-me-rank b { font-size: 1.2rem; }
  .lb2-me-val { font-size: 0.9rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .lb2-card { padding-top: 8px; gap: 6px; }
  .lb2-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lb2-live i, .lb2-skel-row, .lb2-trend, .lb2-row.flash { animation: none; }
}

.stats-card {
  background: #151824;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  width: 520px;
  max-width: 92vw;
  max-height: 85vh;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2e344d;
  padding-bottom: 10px;
}

.stats-header h2 {
  font-size: 1.25rem;
  color: #facc15;
  margin: 0;
}

.stats-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.stats-section {
  background: #0c0d12;
  border: 1px solid #242a3e;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-section h4 {
  font-size: 0.85rem;
  color: #60a5fa;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #cbd5e1;
  gap: 12px;
}

#btn-return-cam {
  display: none;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid #38bdf8;
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s, transform 0.2s, left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.session-active #btn-return-cam {
  left: calc(50% - 220px);
}

#btn-return-cam:hover {
  background: #0284c7;
  transform: translateX(-50%) scale(1.04);
}

.screen-shake {
  animation: screenShakeAnim 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenShakeAnim {
  10%, 90% { transform: translate3d(-2px, 1px, 0); }
  20%, 80% { transform: translate3d(3px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 3px, 0); }
  40%, 60% { transform: translate3d(4px, -3px, 0); }
}

/* ===================================================
   3. NOTIFICATIONS & TOASTS (Niveau 30)
   =================================================== */
#toast-container {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 30; 
  width: 100%;
  transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.session-active #toast-container {
  left: calc(50% - 220px);
}

.toast-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.toast {
  position: relative;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 900;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: scale(0.75) translateY(-12px);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  overflow: hidden;
  z-index: 2;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.toast.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.toast.toast-clickable {
  pointer-events: auto;
  cursor: pointer;
}

.toast-red {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 2px solid #fca5a5;
  color: #fff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
}

.toast-cyan {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 2px solid #7dd3fc;
  color: #fff;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.6);
}

.toast-yellow {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  border: 2px solid #fef08a;
  color: #1e1b18;
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.6);
}

.toast-gold {
  background: linear-gradient(135deg, #9333ea, #6b21a8);
  border: 2px solid #f3e8ff;
  color: #fff;
  box-shadow: 0 6px 25px rgba(168, 85, 247, 0.75);
}

/* ===================================================
   4. HUD & INFOBULLES (Niveau 50)
   =================================================== */
#hud {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 10px;
  z-index: 50; 
  flex-wrap: wrap;
  align-items: center;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  pointer-events: none;
}

body.session-active #hud {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hud-card {
  position: relative;
  background: rgba(18, 22, 34, 0.92);
  backdrop-filter: blur(6px);
  padding: 9px 15px;
  border-radius: 12px;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-card:hover {
  z-index: 60;
}

#btn-quick-sell {
  position: relative;
  background: #10b981;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

#btn-quick-sell:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
  z-index: 60;
}

#btn-quick-sell:disabled {
  background: #262b3a;
  color: #5a647d;
  box-shadow: none;
  cursor: not-allowed;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  background: #151824;
  border: 1px solid #2e344d;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.95);
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
}

.hud-card:hover .tooltip,
#btn-quick-sell:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* ===================================================
   5. SIDEBAR & AUTRES ÉLÉMENTS DE NAVIGATION
   =================================================== */
#online-container {
  position: absolute;
  top: 16px;
  right: 460px;
  z-index: 60;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  pointer-events: none;
}
body.session-active #online-container {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#btn-online-toggle {
  background: rgba(18, 22, 34, 0.92);
  border: 1px solid #3b82f6;
  color: #fff;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  transition: 0.15s;
  white-space: nowrap;
}
#btn-online-toggle:hover {
  background: #2563eb;
}

#online-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 8px;
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  flex-direction: column;
}

#minecraft-xp-container {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out, left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.session-active #minecraft-xp-container {
  opacity: 1;
  left: calc(50% - 220px);
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#combo-badge {
  display: none;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.95), rgba(220, 38, 38, 0.95));
  border: 2px solid #fdba74;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
  pointer-events: auto;
  min-width: 160px;
  text-align: center;
}

.combo-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.combo-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

#ui-combo-time { color: #fff; }
#ui-combo-bonus { color: #fef08a; }

#combo-meter-bg {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

#combo-meter-fill {
  width: 100%;
  height: 100%;
  background: #fef08a;
  transition: width 0.1s linear;
}

#xp-level-number {
  font-family: monospace, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: #80ff20;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
}

#xp-bar-bg {
  width: 360px;
  height: 10px;
  background: #111417;
  border: 2px solid #000;
  border-radius: 2px;
  overflow: hidden;
}

#xp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(180deg, #bbf033 0%, #68bf14 100%);
  transition: width 0.12s ease-out;
}

#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  height: 100vh;
  background: rgba(19, 21, 31, 0);
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(36, 42, 62, 0);
  z-index: 60;
  transform: translateX(100%);
  transition: background 0.5s ease-out, border-color 0.5s ease-out, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

body.session-active #sidebar {
  background: rgba(19, 21, 31, 1);
  border-left: 2px solid #242a3e;
  transform: translateX(0);
  pointer-events: auto;
}

#buy-mode-bar, #tabs-nav, #tabs-content {
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.5s ease-out 0.1s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

body.session-active #buy-mode-bar,
body.session-active #tabs-nav,
body.session-active #tabs-content {
  opacity: 1;
  transform: translateY(0);
}

#tab-enchant {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#tab-enchant::-webkit-scrollbar {
  display: none;
}

#buy-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #090a10;
  border-bottom: 1px solid #242a3e;
  gap: 6px;
}

.buy-mode-btn {
  flex: 1;
  background: #1b1e2c;
  border: 1px solid #2c334d;
  color: #94a3b8;
  padding: 4px 0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.15s;
}

.buy-mode-btn:hover { background: #262c40; color: #fff; }
.buy-mode-btn.active { background: #3b82f6; color: #fff; border-color: #60a5fa; }

#tabs-nav {
  display: flex;
  background: #0d0f17;
  border-bottom: 2px solid #242a3e;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #8e9bb0;
  padding: 11px 2px;
  font-size: 0.72rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.15s;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.03); }
.tab-btn.active { color: #facc15; border-bottom-color: #facc15; background: rgba(250, 204, 21, 0.05); }

#tabs-content {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tab-panel.active { display: flex; }

.card {
  position: relative;
  background: #1b1e2c;
  padding: 11px;
  border-radius: 9px;
  border: 1px solid #2c334d;
  transition: opacity 0.2s;
}

.card.locked {
  border-color: #333a4d;
}

.card:hover .card-tooltip {
  display: block;
}

.card-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  width: 100%;
  background: #0f121a;
  border: 1px solid #3b82f6;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,0.95);
  z-index: 70;
  font-weight: normal;
  pointer-events: none;
  opacity: 1 !important;
}

.enchant-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.badge-lock {
  font-size: 0.68rem;
  background: #334155;
  color: #94a3b8;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: bold;
}

.gen-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-inspect-small {
  background: #1e293b;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 3px 8px;
  font-size: 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.15s;
}

.btn-inspect-small:hover {
  background: #0284c7;
  color: #fff;
}

.card-prestige {
  background: #241433;
  border: 1px solid #6b21a8;
}

.info-text {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 3px;
}

.btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  transition: 0.15s;
  font-size: 0.82rem;
}

.btn:hover:not(:disabled) { background: #2563eb; }
.btn:disabled { background: #222634; color: #4e556b; cursor: not-allowed; }

.btn-token { background: #f59e0b; color: #1e1b18; }
.btn-token:hover:not(:disabled) { background: #d97706; }

.btn-prestige { background: #9333ea; color: #fff; }
.btn-prestige:hover:not(:disabled) { background: #7e22ce; }

.btn-crop-select {
  padding: 8px 12px;
  font-size: 0.78rem;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-reset {
  background: transparent;
  border: 1px dashed #ef4444;
  color: #f87171;
  padding: 6px;
  font-size: 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 6px;
  transition: 0.15s;
}

.btn-reset:hover { background: rgba(239, 68, 68, 0.15); }

.modal-card {
  background: #191424;
  border: 2px solid #a855f7;
  border-radius: 16px;
  width: 420px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #e9d5ff;
}

.modal-stats {
  background: #110d1a;
  border: 1px solid #3b205e;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
  text-align: left;
}

.modal-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-cancel {
  background: #333a4d;
  color: #cbd5e1;
}

.btn-cancel:hover { background: #475569; }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.popup-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  pointer-events: none;
  font-size: 13px;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

#tab-mastery .mastery-panel-card {
  background: #151824;
  border: 1px solid #2e344d;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#tab-mastery .mastery-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0c0d12;
  border: 1px solid #242a3e;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

#tab-mastery .mastery-row:hover {
  border-color: #3b82f6;
  background: #11141c;
}

.btn-mastery-action {
  background: #1b1e2c;
  color: #cbd5e1;
  border: 1px solid #2c334d;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-mastery-action:hover:not(:disabled) {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
}

.btn-mastery-danger {
  background: #451a03;
  border-color: #78350f;
  color: #fca5a5;
}

.btn-mastery-danger:hover:not(:disabled) {
  background: #7f1d1d;
  border-color: #f87171;
  color: #fff;
}

.btn-mastery-max {
  background: #064e3b;
  border-color: #065f46;
  color: #6ee7b7;
}

.btn-mastery-max:hover:not(:disabled) {
  background: #047857;
  border-color: #10b981;
  color: #fff;
}

#floating-bonus-menu {
  position: absolute;
  top: 80px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  opacity: 0;
  transform: translateX(-15px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  pointer-events: none;
}

body.session-active #floating-bonus-menu {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.btn-bonus {
  position: relative;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #38bdf8;
  border-radius: 12px;
  color: #fff;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.btn-bonus:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.05);
}

.bonus-tooltip {
  visibility: hidden;
  position: absolute;
  left: 85px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  padding: 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.75rem;
  width: 200px;
  text-align: left;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s, left 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
  line-height: 1.4;
}

.bonus-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  margin-top: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent #38bdf8 transparent transparent;
}

.btn-bonus:hover .bonus-tooltip {
  visibility: visible;
  opacity: 1;
  left: 80px;
}

.settings-card {
  background: #151824;
  border: 2px solid #64748b;
  border-radius: 16px;
  width: 480px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2e344d;
  padding-bottom: 10px;
}

.settings-header h2 {
  font-size: 1.3rem;
  color: #f8fafc;
  margin: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c0d12;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #242a3e;
}

.settings-label {
  font-size: 0.9rem;
  font-weight: bold;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #333a4d;
  border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #38bdf8;
  margin-top: -5px;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.6);
}
input[type=range]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: #333a4d;
  border-radius: 3px;
  border: none;
}
input[type=range]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.6);
}
input[type=range]:focus {
  outline: none;
}

.btn-mute { 
  background: #1e293b; 
  border: 1px solid #475569; 
  color: #fff; 
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 0.85rem; 
  font-weight: bold;
  transition: 0.2s; 
}
.btn-mute:hover { 
  background: #334155; 
  border-color: #94a3b8; 
}

.keys-hint {
  background: #0f121a;
  border: 1px solid #242a3e;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.6;
}
.keys-hint b { color: #38bdf8; }

/* ===================================================
   6. MINI-JEU CULTURE GÉANTE (HUD WIDGET ÉPURÉ)
   =================================================== */
#giant-minigame-overlay {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: none;
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.session-active #giant-minigame-overlay {
  left: calc(50% - 220px);
}

.minigame-widget-card {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid #38bdf8;
  border-radius: 14px;
  padding: 10px 14px;
  width: 440px;
  max-width: 94vw;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popInWidget 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

@keyframes popInWidget {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#minigame-arena {
  position: relative;
  width: 100%;
  height: 180px;
  background: #090b10;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
}

.minigame-target-circle {
  position: absolute;
  width: 38px;
  height: 38px;
  background: radial-gradient(circle, #facc15 0%, #ea580c 100%);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.85);
  animation: popInCircle 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
  user-select: none;
}

@keyframes popInCircle {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===================================================
   7. CLASSEMENTS CULTURES GÉANTES HUD (RÉTRACTABLE)
   =================================================== */
#giant-crops-hud-container {
  position: fixed;
  top: 80px;
  right: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 58;
  pointer-events: none;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.giant-crop-hud-card {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid #a855f7;
  padding: 10px 12px;
  border-radius: 10px;
  width: 220px;
  font-family: monospace;
  color: #fff;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(6px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
  user-select: none;
}

.giant-crop-hud-card:hover {
  border-color: #c084fc;
  box-shadow: 0 6px 24px rgba(192, 132, 252, 0.45);
}

.giant-crop-hud-card.is-collapsed {
  transform: translateX(185px);
  box-shadow: -4px 4px 14px rgba(0, 0, 0, 0.5);
}

.giant-crop-hud-card.is-collapsed:hover {
  transform: translateX(175px);
}

.giant-crop-hud-card .giant-crop-card-content {
  transition: opacity 0.2s ease-out;
}

.giant-crop-hud-card.is-collapsed .giant-crop-card-content {
  opacity: 0.15;
  pointer-events: none;
}

/* ===================================================
   8. NOUVEAU : SYSTÈME D'INVENTAIRE & COFFRES (REBIRTH)
   =================================================== */
.inv-item-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 105px;
  position: relative;
}

.inv-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Raretés */
.rarity-common { border-color: #94a3b8; box-shadow: inset 0 0 10px rgba(148, 163, 184, 0.2); }
.rarity-rare { border-color: #3b82f6; box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.2); }
.rarity-epic { border-color: #a855f7; box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.2); }
.rarity-legendary { border-color: #eab308; box-shadow: inset 0 0 10px rgba(234, 179, 8, 0.2); }
.rarity-mystic { border-color: #ef4444; box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.2); }

.rarity-common:hover { box-shadow: 0 4px 15px rgba(148, 163, 184, 0.5); }
.rarity-rare:hover { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5); }
.rarity-epic:hover { box-shadow: 0 4px 15px rgba(168, 85, 247, 0.5); }
.rarity-legendary:hover { box-shadow: 0 4px 15px rgba(234, 179, 8, 0.5); }
.rarity-mystic:hover { box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5); }

.inv-item-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.inv-item-name {
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.inv-item-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 4px;
}

.inv-item-equipped-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #10b981;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid #059669;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.equipped-slot {
  background: rgba(15, 23, 42, 0.6);
  border: 2px dashed #475569;
  border-radius: 10px;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.65rem;
  color: #64748b;
  transition: all 0.2s ease;
}

.equipped-slot.filled {
  border-style: solid;
  cursor: pointer;
}

.equipped-slot.filled:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* ===================================================
   QUALITÉ GRAPHIQUE RÉDUITE (Moyenne / Basse)
   Le flou d'arrière-plan des cartes du HUD est recalculé à chaque image
   par-dessus la scène 3D : on le coupe quand la qualité est réduite.
   =================================================== */
body.gfx-reduced .hud-card,
body.gfx-reduced .btn-bonus,
body.gfx-reduced .giant-crop-hud-card,
body.gfx-reduced .minigame-widget-card,
body.gfx-reduced #fps-ram-counter,
body.gfx-reduced #online-dropdown,
body.gfx-reduced #giant-crops-hud-container {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ===== Menu Statistiques : bandeau avatar 3D + résumé ===== */
.stats-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  background: linear-gradient(135deg, #10131d 0%, #151a2b 100%);
  border: 1px solid #2e344d;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
#stats-avatar-canvas {
  flex: none;
  width: 150px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid #242a3e;
  background: radial-gradient(ellipse at 50% 85%, #1f2a44 0%, #0c0d12 70%);
  display: block;
}
.stats-hero-info {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stats-hero-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stats-hero-name b {
  font-size: 1.2rem;
  color: #facc15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-hero-badge {
  flex: none;
  font-size: 0.72rem;
  font-weight: 800;
  color: #d8b4fe;
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid #9333ea;
  border-radius: 6px;
  padding: 2px 7px;
}
.stats-hero-gear {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  color: #cbd5e1;
}
.stats-hero-gear b { color: #f1f5f9; }
.stats-hero-acc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stats-acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  background: #0c0d12;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 2px 6px;
}
.stats-acc-none { font-size: 0.72rem; color: #64748b; font-style: italic; }
.stats-hero-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stats-tile {
  background: #0c0d12;
  border: 1px solid #242a3e;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}
.stats-tile span {
  display: block;
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stats-tile b {
  display: block;
  font-size: 0.88rem;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Ouverture de coffre : roulette façon CS ===== */
#chest-animation-box {
  width: min(94vw, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.chest-roulette-title {
  color: #facc15;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chest-roulette {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: #0c0d12;
  border: 2px solid #2e344d;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.7) inset;
}
.chest-roulette::before,
.chest-roulette::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 2;
  pointer-events: none;
}
.chest-roulette::before { left: 0; background: linear-gradient(90deg, #0c0d12, rgba(12, 13, 18, 0)); }
.chest-roulette::after { right: 0; background: linear-gradient(270deg, #0c0d12, rgba(12, 13, 18, 0)); }
.chest-roulette-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: #facc15;
  box-shadow: 0 0 12px #facc15;
  z-index: 3;
}
.chest-roulette-marker::before,
.chest-roulette-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
}
.chest-roulette-marker::before { top: 0; border-top-color: #facc15; }
.chest-roulette-marker::after { bottom: 0; border-bottom-color: #facc15; }
.chest-roulette-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  will-change: transform;
}
.roulette-item {
  flex: none;
  width: 112px;
  height: 126px;
  margin: 0 4px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  border: 2px solid var(--rc);
  background: linear-gradient(180deg, #1e293b 0%, #151a2b 65%, var(--rc-soft) 100%);
  text-align: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
}
.roulette-item .ri-icon { font-size: 2.3rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.roulette-item .ri-mult { font-size: 1rem; font-weight: 900; color: var(--rc); }
.roulette-item .ri-name { font-size: 0.65rem; color: #94a3b8; font-weight: 700; }
.chest-roulette.finished .roulette-item { opacity: 0.35; }
.chest-roulette.finished .roulette-item.winner {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 26px var(--rc);
}

/* ===== Raccourcis rapides (Ordinateur) ===== */
#desktop-nav-bar {
  position: fixed;
  left: 12px;
  bottom: 42px;
  display: none;
  gap: 6px;
  z-index: 800;
}
@media (min-width: 1025px) {
  #desktop-nav-bar { display: flex; }
}
.btn-desktop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.btn-desktop-icon:hover { background: rgba(56, 189, 248, 0.25); transform: translateY(-2px); }
.btn-desktop-icon:active { transform: scale(0.92); }
.btn-desktop-icon.btn-lb { border-color: rgba(250, 204, 21, 0.4); }
.btn-desktop-icon.btn-stats { border-color: rgba(56, 189, 248, 0.4); }
.btn-desktop-icon.btn-wardrobe { border-color: rgba(192, 132, 252, 0.4); }
.btn-desktop-icon.btn-inventory { border-color: rgba(96, 165, 250, 0.4); }
.btn-desktop-icon.btn-achievements { border-color: rgba(250, 204, 21, 0.4); }
.btn-desktop-icon.btn-settings { border-color: rgba(148, 163, 184, 0.4); }


/* ===================================================
   SUCCÈS (touche U)
   =================================================== */
.ach-card { width: 760px; max-width: 95vw; border-color: #facc15; box-shadow: 0 10px 40px rgba(250, 204, 21, 0.25); }
.ach-summary { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: #cbd5e1; }
.ach-summary-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.ach-summary-top b { color: #facc15; }
.ach-bar { height: 8px; background: #0c0d12; border: 1px solid #2a2f45; border-radius: 6px; overflow: hidden; }
.ach-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #facc15); transition: width 0.4s; }
.ach-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-filter {
  background: #0c0d12; color: #94a3b8; border: 1px solid #2a2f45; border-radius: 999px;
  padding: 4px 10px; font-size: 0.74rem; font-weight: 800; cursor: pointer; font-family: inherit;
}
.ach-filter:hover { color: #e2e8f0; border-color: #475569; }
.ach-filter.active { color: #1a1300; background: #facc15; border-color: #facc15; }
.ach-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  overflow-y: auto; padding-right: 4px; min-height: 0; flex: 1;
}
.ach-item {
  --tc: #475569;
  display: flex; gap: 10px; align-items: flex-start; position: relative;
  background: #0f121a; border: 1px solid var(--tc); border-left-width: 4px; border-radius: 10px; padding: 10px;
}
.ach-item.is-locked { filter: grayscale(0.85); opacity: 0.75; }
.ach-item.is-maxed { box-shadow: 0 0 12px color-mix(in srgb, var(--tc) 45%, transparent); }
.ach-icon { font-size: 1.7rem; line-height: 1; flex-shrink: 0; width: 34px; text-align: center; }
.ach-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; padding-right: 22px; }
.ach-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; color: #f1f5f9; }
.ach-tier-pill { font-size: 0.62rem; font-weight: 900; border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; text-transform: uppercase; }
.ach-tier-pill.locked { color: #64748b; }
.ach-pips { display: inline-flex; gap: 3px; }
.ach-pips i { width: 7px; height: 7px; border-radius: 50%; background: #2a2f45; display: inline-block; }
.ach-desc { font-size: 0.74rem; color: #94a3b8; }
.ach-progress { height: 6px; background: #0c0d12; border: 1px solid #2a2f45; border-radius: 4px; overflow: hidden; }
.ach-progress-fill { height: 100%; background: var(--tc); transition: width 0.4s; }
.ach-progress-text { display: flex; justify-content: space-between; font-size: 0.68rem; color: #94a3b8; font-weight: 700; }
.ach-pin {
  position: absolute; top: 6px; right: 6px; background: transparent; border: 1px solid #2a2f45; border-radius: 6px;
  width: 24px; height: 24px; font-size: 0.8rem; cursor: pointer; filter: grayscale(1); opacity: 0.6; padding: 0;
}
.ach-pin:hover:not(:disabled) { opacity: 1; border-color: #facc15; }
.ach-pin.on { filter: none; opacity: 1; background: rgba(250, 204, 21, 0.18); border-color: #facc15; }
.ach-pin:disabled { cursor: not-allowed; opacity: 0.3; }
.stats-ach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-ach-chip {
  --tc: #94a3b8;
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: #e2e8f0;
  background: #0c0d12; border: 1px solid var(--tc); border-radius: 8px; padding: 3px 8px;
}
.stats-ach-chip em { font-style: normal; font-size: 0.62rem; font-weight: 900; color: var(--tc); text-transform: uppercase; }
@media (max-width: 700px) { .ach-grid { grid-template-columns: 1fr; } }


/* ===== Menu Statistiques élargi ===== */
#stats-overlay .stats-card { width: 780px; max-width: 95vw; }
.stats-sections { display: block; column-count: 2; column-gap: 12px; }
.stats-sections > .stats-section { break-inside: avoid; margin-bottom: 12px; }
.stats-sections > .stats-section-wide { column-span: all; }
@media (max-width: 760px) { .stats-sections { column-count: 1; } }

/* ===== Succès : détail dans les stats + surbrillance ===== */
button.stats-ach-chip { cursor: pointer; font-family: inherit; }
button.stats-ach-chip:hover, button.stats-ach-chip.active { background: color-mix(in srgb, var(--tc) 18%, #0c0d12); }
.stats-ach-detail { display: none; margin-top: 8px; background: #0c0d12; border: 1px solid var(--tc, #475569); border-left-width: 4px; border-radius: 10px; padding: 10px 12px; }
.stats-ach-detail.open { display: block; }
.stats-ach-detail-head { display: flex; align-items: center; gap: 10px; }
.stats-ach-detail-head .ach-icon { font-size: 1.6rem; }
.stats-ach-detail-title { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: #f1f5f9; }
.stats-ach-detail-title small { color: #94a3b8; font-size: 0.72rem; }
.stats-ach-tiers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.72rem; color: #64748b; }
.stats-ach-tiers li { display: flex; gap: 8px; align-items: baseline; }
.stats-ach-tiers li b { min-width: 62px; font-size: 0.66rem; text-transform: uppercase; }
.stats-ach-tiers li.done { color: #cbd5e1; }
.stats-ach-tiers li.done::after { content: "✓"; margin-left: auto; color: #4ade80; font-weight: 900; }
.ach-item.ach-flash { animation: achFlash 1.6s ease-out 1; }
@keyframes achFlash {
  0%, 40% { box-shadow: 0 0 0 3px #facc15, 0 0 28px rgba(250, 204, 21, 0.9); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.inv-item-card.inv-flash { animation: achFlash 2s ease-out 1; }

/* ===== Version du jeu ===== */
.game-version-tag { font-size: 0.72rem; font-weight: 800; color: #64748b; letter-spacing: 0.06em; text-align: center; }
.start-card .game-version-tag { margin: -6px 0 10px; }

/* ===== Comptes / écran de connexion ===== */
.auth-tabs { display: flex; gap: 6px; }
.auth-tabs button { flex: 1; padding: 8px 4px; font-size: 0.82rem; border-radius: 8px; border: 1px solid #2e344d; background: #0c0d12; color: #94a3b8; cursor: pointer; }
.auth-tabs button.active { background: #1d4ed8; color: #fff; border-color: #3b82f6; }
.auth-pane { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.auth-pane input[type=text], .auth-pane input[type=password], .auth-pane input[type=email], .auth-pane select {
  background: #0c0d12; border: 1px solid #2e344d; color: #fff; padding: 11px 14px; border-radius: 8px; font-size: 0.95rem; outline: none; text-align: center;
}
.auth-pane input:focus, .auth-pane select:focus { border-color: #3b82f6; }
.auth-row { display: flex; gap: 8px; }
.auth-row input { flex: 1; min-width: 0; }
.auth-dice { background: #0c0d12; border: 1px solid #2e344d; border-radius: 8px; width: 46px; font-size: 1.2rem; cursor: pointer; }
.auth-dice:hover { border-color: #3b82f6; }
.auth-go { background: #3b82f6; justify-content: center; padding: 12px; font-size: 1rem; }
.auth-hint { color: #94a3b8; font-size: 0.78rem; line-height: 1.4; }
.auth-error { color: #f87171; font-size: 0.82rem; min-height: 1em; }
.auth-check { display: flex; gap: 8px; align-items: flex-start; text-align: left; color: #cbd5e1; font-size: 0.8rem; }
.auth-check input { margin-top: 3px; }
.auth-me { color: #e2e8f0; font-size: 1rem; }
.auth-links { color: #64748b; font-size: 0.75rem; }
.auth-links a { color: #94a3b8; }
.auth-dialog { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; }
.auth-dialog > div { background: #151824; border: 2px solid #f59e0b; border-radius: 14px; padding: 24px; max-width: 440px; width: 90vw; color: #e2e8f0; display: flex; flex-direction: column; gap: 12px; }
.auth-dialog button { padding: 10px; border-radius: 8px; border: 0; cursor: pointer; background: #3b82f6; color: #fff; font-size: .95rem; }
.auth-dialog button.alt { background: #334155; }

/* =============================================================================
   ÉCRAN D'ACCUEIL (refonte) : .welcome-*
   ============================================================================= */
#start-screen {
  background:
    radial-gradient(1200px 520px at 50% -8%, rgba(251, 191, 36, 0.20), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(34, 197, 94, 0.16), transparent 60%),
    rgba(8, 11, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px;
  box-sizing: border-box;
}
.welcome-card {
  width: min(94vw, 440px);
  max-height: 94dvh;
  overflow-y: auto;
  box-sizing: border-box;
  background: linear-gradient(180deg, #171d30 0%, #11162a 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  padding: 26px 24px 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(251, 191, 36, 0.08);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}
.welcome-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.welcome-logo {
  width: 62px; height: 62px; border-radius: 18px; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #fbbf24, #f59e0b 55%, #16a34a);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.35);
  margin-bottom: 8px;
}
.welcome-head h1 { margin: 0; font-size: 2rem; letter-spacing: 0.5px; color: #fde68a; line-height: 1.1; }
.welcome-sub { color: #94a3b8; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; }
.welcome-ver { margin-top: 6px !important; }

.welcome-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; background: #0c1020; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.06); }
.welcome-tabs button {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 9px 4px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; transition: background .15s, color .15s;
}
.welcome-tabs button:hover { color: #e2e8f0; }
.welcome-tabs button.active { background: #1e293b; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 8px rgba(0,0,0,.35); }

.welcome-body { display: flex; flex-direction: column; gap: 14px; }
.welcome-pane { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.welcome-label { font-size: 0.78rem; font-weight: 600; color: #94a3b8; margin-top: 4px; }
.welcome-pane input[type=text], .welcome-pane input[type=password], .welcome-pane input[type=email], .welcome-pane select {
  width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px; font: inherit; font-size: 1rem; color: #fff;
  background: #0b0f1e; border: 1px solid #2a3350; border-radius: 12px; outline: none; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.welcome-pane input:focus, .welcome-pane select:focus { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.welcome-row { display: flex; gap: 8px; }
.welcome-row input { flex: 1; min-width: 0; }
.welcome-dice { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid #2a3350; background: #0b0f1e; font-size: 1.25rem; cursor: pointer; transition: transform .15s, border-color .15s; }
.welcome-dice:hover { border-color: #fbbf24; transform: rotate(18deg); }
.welcome-cta {
  margin-top: 8px; height: 50px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-size: 1.05rem; font-weight: 700; color: #052e16;
  background: linear-gradient(180deg, #4ade80, #22c55e); box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35), 0 -2px 0 rgba(0,0,0,.15) inset;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.welcome-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.welcome-cta:active { transform: translateY(1px); }
.welcome-hint { margin: 2px 0 0; color: #7c8aa5; font-size: 0.78rem; line-height: 1.45; }
.welcome-error { color: #fca5a5; font-size: 0.84rem; min-height: 1.1em; }
.welcome-check { display: flex; gap: 9px; align-items: flex-start; font-size: 0.8rem; color: #cbd5e1; line-height: 1.4; margin-top: 2px; }
.welcome-check input { margin-top: 3px; accent-color: #22c55e; }
.welcome-card a { color: #93c5fd; }

.welcome-me { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: #0b0f1e; border: 1px solid #2a3350; }
.welcome-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(145deg, #1e3a2a, #14532d); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.welcome-me-label { font-size: 0.74rem; color: #94a3b8; }
.welcome-me-name { font-size: 1.2rem; font-weight: 700; color: #fff; word-break: break-all; }
.welcome-sync { font-size: 0.8rem; color: #86efac; }
.welcome-links { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 0.75rem; margin-top: 2px; }
.welcome-links a { color: #7c8aa5; }
/* --- Connexion avec Google / Discord --- */
.oauth-block { display: flex; flex-direction: column; gap: 8px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border-radius: 12px; border: 1px solid #2a3350; font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: transform .12s, filter .12s, border-color .12s; }
.oauth-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.oauth-btn:active { transform: translateY(1px); }
.oauth-btn:disabled { opacity: .55; cursor: wait; }
.oauth-google { background: #fff; color: #1f2937; border-color: #dadce0; }
.oauth-discord { background: #5865F2; color: #fff; border-color: #4752c4; }
.oauth-sep { display: flex; align-items: center; gap: 10px; color: #64748b; font-size: 0.74rem; margin-top: 2px; }
.oauth-sep::before, .oauth-sep::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.oauth-done { padding: 10px 12px; border-radius: 12px; background: #0b1f14; border: 1px solid #14532d; color: #86efac; font-size: 0.86rem; }
.oauth-linked { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 0.78rem; color: #94a3b8; }
.oauth-linked a { color: #93c5fd; }
.oauth-linked .ok { color: #86efac; }


.welcome-help { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; }
.welcome-help summary { cursor: pointer; color: #cbd5e1; font-size: 0.88rem; font-weight: 600; list-style: none; }
.welcome-help summary::-webkit-details-marker { display: none; }
.welcome-help summary::after { content: ' ▾'; color: #64748b; }
.welcome-help[open] summary::after { content: ' ▴'; }
.welcome-help ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.welcome-help li { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: #94a3b8; }
.welcome-help kbd { font: inherit; font-size: 0.72rem; font-weight: 700; color: #e2e8f0; background: #0b0f1e; border: 1px solid #2a3350; border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.welcome-foot { display: flex; justify-content: center; gap: 16px; font-size: 0.72rem; flex-wrap: wrap; }
.welcome-foot a { color: #64748b; text-decoration: none; }
.welcome-foot a:hover { color: #93c5fd; text-decoration: underline; }
@media (max-width: 420px) { .welcome-card { padding: 20px 16px 14px; border-radius: 20px; } .welcome-help ul { grid-template-columns: 1fr; } .welcome-tabs button { font-size: 0.74rem; } }

/* Avant le lancement de la partie : aucun bouton / raccourci du jeu n'est visible ni utilisable derrière l'accueil */
body:not(.session-active) #desktop-nav-bar,
body:not(.session-active) #mobile-nav-bar,
body:not(.session-active) #floating-bonus-toggle,
body:not(.session-active) #floating-bonus-menu,
body:not(.session-active) #giant-crop-edge-tab,
body:not(.session-active) #sidebar-edge-tab,
body:not(.session-active) #sidebar-backdrop,
body:not(.session-active) #bonus-backdrop,
body:not(.session-active) #giant-crops-hud-container,
body:not(.session-active) #fps-ram-counter,
body:not(.session-active) #btn-dev-mode,
body:not(.session-active) #btn-return-cam,
body:not(.session-active) #player-overhead-tag,
body:not(.session-active) #online-container {
  visibility: hidden !important;
  pointer-events: none !important;
}
#start-screen #player-pseudo-input { text-align: left; height: 46px; padding: 0 14px; border-radius: 12px; border-color: #2a3350; }
#start-screen #player-pseudo-input:focus { border-color: #fbbf24; }

/* ===== Cadran des bonus pub : se vide pendant le bonus, se REMPLIT pendant la recharge, « pop » quand la pub est prête ===== */
.btn-bonus { --ad-fill: 0; --ad-color: 250, 204, 21; }
.btn-bonus::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(var(--ad-color), 0.55), rgba(var(--ad-color), 0.18));
  transform-origin: bottom center;
  transform: scaleY(var(--ad-fill));
  transition: transform 1s linear;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.btn-bonus > div:not(.bonus-tooltip) { position: relative; z-index: 1; }
.btn-bonus.ad-cooling::before { --ad-color: 56, 189, 248; opacity: 1; }
.btn-bonus.ad-active::before  { --ad-color: 74, 222, 128; opacity: 1; }
.btn-bonus.ad-cooling { border-color: #38bdf8; }
.btn-bonus.ad-active { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.35), 0 4px 12px rgba(0,0,0,.5); }
.btn-bonus.ad-ready { border-color: #facc15; }
.btn-bonus.ad-ready-pop { animation: adReadyPop 1.4s ease-out 1; }
@keyframes adReadyPop {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.9); }
  25%  { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.35); }
  60%  { transform: scale(0.97); box-shadow: 0 0 0 18px rgba(250, 204, 21, 0); }
  100% { transform: scale(1);    box-shadow: 0 4px 12px rgba(0,0,0,.5); }
}
@media (prefers-reduced-motion: reduce) { .btn-bonus::before { transition: none; } .btn-bonus.ad-ready-pop { animation: none; } }

/* =============================================================================
   PARAMÈTRES (refonte) : .stg-*
   ============================================================================= */
.stg-card {
  width: min(860px, 94vw);
  height: min(600px, 88dvh);
  box-sizing: border-box;
  background: linear-gradient(180deg, #171d30 0%, #11162a 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column;
  color: #e2e8f0; overflow: hidden;
}
.stg-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.stg-head h2 { margin: 0; font-size: 1.25rem; color: #f8fafc; }
.stg-head .game-version-tag { margin: 0; }
.stg-head .modal-close-btn { margin-left: auto; }
.stg-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.stg-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-right: 1px solid rgba(255,255,255,.07); background: rgba(8, 11, 22, 0.45); overflow-y: auto; }
.stg-nav button {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: #94a3b8; font: inherit; font-size: 0.92rem; text-align: left; transition: background .15s, color .15s;
}
.stg-nav button span { font-size: 1.15rem; width: 24px; text-align: center; }
.stg-nav button b { font-weight: 600; }
.stg-nav button:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.stg-nav button.active { background: #1e293b; color: #fff; box-shadow: inset 3px 0 0 #fbbf24; }
.stg-content { overflow-y: auto; padding: 18px 22px 24px; min-width: 0; }
.stg-panel[hidden] { display: none; }
.stg-panel { display: flex; flex-direction: column; gap: 10px; animation: stgIn .18s ease-out; }
@keyframes stgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stg-panel h3 { margin: 0 0 6px; font-size: 1.1rem; color: #fde68a; }
.stg-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; background: #0d1224; border: 1px solid #222a44; border-radius: 14px; }
.stg-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stg-text b { font-size: 0.95rem; color: #e2e8f0; }
.stg-text small, .stg-block small { color: #7c8aa5; font-size: 0.78rem; line-height: 1.4; font-weight: 400; }
.stg-status { font-size: 0.72rem; color: #94a3b8; margin-left: 6px; font-weight: 400; }
.stg-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.stg-ctl select, .stg-input {
  background: #0b0f1e; color: #f8fafc; border: 1px solid #2a3350; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; outline: none;
}
.stg-ctl select:focus, .stg-input:focus { border-color: #fbbf24; }
.stg-input { width: 100%; box-sizing: border-box; font-weight: 400; cursor: text; }
.stg-pill { border: 0; border-radius: 999px; padding: 8px 18px; font: inherit; font-size: 0.85rem; font-weight: 700; color: #fff; background: #10b981; cursor: pointer; transition: filter .15s; min-width: 96px; }
.stg-pill:hover { filter: brightness(1.12); }
.stg-note { color: #64748b; font-size: 0.8rem; padding: 4px 4px 0; }
.stg-block { display: flex; flex-direction: column; gap: 8px; padding: 14px 15px; background: #0d1224; border: 1px solid #222a44; border-radius: 14px; }
.stg-block > b { color: #e2e8f0; }
.stg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stg-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid #2a3350; background: #11182f; color: #e2e8f0; font: inherit; font-size: 0.82rem; cursor: pointer; transition: border-color .15s, transform .1s; }
.stg-chip:hover { border-color: #fbbf24; }
.stg-chip:active { transform: scale(.96); }
.stg-keys { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.stg-keys li { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #94a3b8; }
.stg-keys kbd { font: inherit; font-size: 0.72rem; font-weight: 700; color: #e2e8f0; background: #0b0f1e; border: 1px solid #2a3350; border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.stg-legal { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; font-size: 0.82rem; }
.stg-legal a, .stg-account a { color: #93c5fd; }
.stg-btn { align-self: flex-start; padding: 10px 16px; border: 1px solid #334155; border-radius: 12px; background: #1e293b; color: #f1f5f9; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: filter .15s, transform .1s; }
.stg-btn:hover { filter: brightness(1.15); }
.stg-btn:active { transform: scale(.98); }
.stg-btn:disabled { opacity: .5; cursor: default; }
.stg-danger { border-color: rgba(248, 113, 113, 0.45); background: rgba(127, 29, 29, 0.14); }
.stg-danger > b { color: #fca5a5; }
.stg-btn-danger { background: linear-gradient(135deg, #dc2626, #7f1d1d); border-color: #f87171; color: #fff; }
.stg-account { display: flex; flex-direction: column; gap: 10px; }
.stg-me { display: flex; align-items: center; gap: 14px; padding: 14px; background: #0d1224; border: 1px solid #222a44; border-radius: 14px; }
.stg-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(145deg, #1e3a2a, #14532d); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.stg-me-name { font-size: 1.15rem; font-weight: 700; color: #fff; word-break: break-all; }
.stg-me-sub { font-size: 0.78rem; color: #86efac; }
.stg-me-sub.guest { color: #94a3b8; }
.stg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stg-msg { font-size: 0.8rem; color: #94a3b8; min-height: 1em; }

@media (max-width: 680px) {
  .stg-card { width: 96vw; height: 90dvh; border-radius: 16px; }
  .stg-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .stg-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); padding: 8px; gap: 4px; -webkit-overflow-scrolling: touch; }
  .stg-nav button { flex: none; padding: 9px 12px; }
  .stg-nav button.active { box-shadow: inset 0 -3px 0 #fbbf24; }
  .stg-nav button span { width: auto; }
  .stg-content { padding: 14px 14px 22px; }
  .stg-item { flex-direction: column; align-items: stretch; }
  .stg-ctl { justify-content: space-between; }
  .stg-ctl input[type=range] { flex: 1; width: auto; }
  .stg-keys { grid-template-columns: 1fr; }
}

/* =============================================================================
   🎒 INVENTAIRE (I) — V0.97
   ============================================================================= */
.inv2-card { background: #151824; border: 2px solid #3b82f6; border-radius: 16px; width: 940px; max-width: 96vw; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 20px; box-shadow: 0 10px 50px rgba(59,130,246,0.35); display: flex; flex-direction: column; gap: 10px; }
.inv2-sub-top { margin: 0; font-size: 0.85rem; color: #cbd5e1; }
.inv2-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; min-height: 0; }
.inv2-equip, .inv2-bag { background: #0c0d12; border: 1px solid #2e344d; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.inv2-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.9rem; color: #e2e8f0; }
.inv2-sec-h b { font-weight: 900; }
.inv2-muted { color: #64748b; font-size: 0.75rem; font-weight: 700; }
.inv2-mini { white-space: nowrap; background: #1e293b; color: #cbd5e1; border: 1px solid #334155; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.inv2-mini:hover:not(:disabled) { background: #263449; color: #fff; }
.inv2-mini:disabled { opacity: 0.4; cursor: default; }

/* --- Slots équipés --- */
.inv2-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.inv2-slot { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; font: inherit; color: #e2e8f0; min-width: 0; }
.inv2-slot.empty { border: 2px dashed #334155; background: rgba(15,23,42,0.5); color: #475569; }
.inv2-slot-plus { font-size: 1.5rem; font-weight: 300; line-height: 1; }
.inv2-slot-t { font-size: 0.66rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv2-slot.filled { cursor: pointer; border: 2px solid var(--rc, #94a3b8); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc, #94a3b8) 28%, transparent), rgba(15,23,42,0.85) 72%); box-shadow: 0 0 14px color-mix(in srgb, var(--rc, #94a3b8) 35%, transparent); transition: transform 0.12s, box-shadow 0.12s; }
.inv2-slot.filled:hover { transform: translateY(-2px); box-shadow: 0 0 20px color-mix(in srgb, var(--rc) 60%, transparent); }
.inv2-slot-ico { font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7)); }
.inv2-slot-x { font-weight: 900; font-size: 0.82rem; color: var(--rc); }
.inv2-slot-rm { position: absolute; top: 3px; right: 4px; font-style: normal; font-size: 0.6rem; color: #94a3b8; opacity: 0; transition: opacity 0.12s; }
.inv2-slot.filled:hover .inv2-slot-rm { opacity: 1; color: #f87171; }
.inv2-slot.pop { animation: inv2-pop 0.35s ease-out; }
@keyframes inv2-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* --- Bonus actifs --- */
.inv2-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.inv2-total { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 9px; padding: 6px 8px; font-size: 0.72rem; color: #64748b; min-width: 0; }
.inv2-total.on { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.4); color: #cbd5e1; }
.inv2-total-ico { font-size: 1.1rem; }
.inv2-total-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.inv2-total-v { font-weight: 900; font-size: 0.9rem; color: #94a3b8; }
.inv2-total.on .inv2-total-v { color: #4ade80; }
.inv2-note { margin: 0; font-size: 0.68rem; color: #64748b; line-height: 1.3; }

/* --- Filtres --- */
.inv2-filters { display: flex; flex-direction: column; gap: 6px; }
.inv2-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.inv2-chip { background: #1b1e2c; border: 1px solid #2c334d; color: #94a3b8; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; transition: 0.12s; }
.inv2-chip:hover { background: #262c40; color: #fff; }
.inv2-chip.on { background: rgba(59,130,246,0.22); border-color: #3b82f6; color: #fff; }
.inv2-chip.rar { color: var(--rc); border-color: color-mix(in srgb, var(--rc) 45%, #2c334d); }
.inv2-chip.rar.on { background: color-mix(in srgb, var(--rc) 24%, transparent); border-color: var(--rc); color: var(--rc); }
.inv2-sortrow { display: flex; gap: 6px; }
.inv2-sortrow select { flex: 1; min-width: 0; background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 0.78rem; }

/* --- Grille d'objets --- */
.inv2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.inv2-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 6px 8px; border-radius: 12px; border: 2px solid var(--rc, #334155); background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rc, #334155) 22%, transparent), #151824 72%); color: #e2e8f0; font: inherit; text-align: center; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, filter 0.12s; min-width: 0; }
.inv2-item:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,0.45), 0 0 16px color-mix(in srgb, var(--rc, #a855f7) 45%, transparent); }
.inv2-item.full { filter: grayscale(0.55); opacity: 0.8; }
.inv2-mult { position: absolute; top: 5px; right: 6px; font-weight: 900; font-size: 0.8rem; color: var(--rc); }
.inv2-ico { font-size: 2rem; line-height: 1.1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7)); }
.inv2-name { font-size: 0.74rem; font-weight: 900; color: var(--rc, #facc15); line-height: 1.15; }
.inv2-sub { font-size: 0.66rem; color: #94a3b8; }
.inv2-delta { margin-top: 2px; font-size: 0.64rem; font-weight: 800; color: #4ade80; background: rgba(74,222,128,0.1); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.inv2-item.full .inv2-delta { color: #f87171; background: rgba(248,113,113,0.1); }
.inv2-item.chest { --rc: #a855f7; padding-top: 10px; background: radial-gradient(circle at 50% 30%, rgba(250,204,21,0.25), #151824 72%); animation: inv2-glow 2.4s ease-in-out infinite; }
.inv2-item.chest .inv2-name { color: #facc15; }
.inv2-drops { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 0.58rem; font-weight: 800; background: rgba(0,0,0,0.3); padding: 2px 4px; border-radius: 5px; }
.inv2-cta.open { margin-top: 3px; font-size: 0.66rem; font-weight: 900; color: #0c0d12; background: #4ade80; border-radius: 6px; padding: 2px 10px; }
@keyframes inv2-glow { 0%,100% { box-shadow: 0 0 8px rgba(250,204,21,0.25); } 50% { box-shadow: 0 0 18px rgba(250,204,21,0.55); } }
.inv2-item.inv-flash { animation: achFlash 2s ease-out 1; }
.inv2-empty { grid-column: 1 / -1; padding: 28px 16px; text-align: center; color: #64748b; font-size: 0.85rem; line-height: 1.4; }

@media (max-width: 760px) {
  .inv2-card { padding: 14px; gap: 8px; }
  .inv2-body { grid-template-columns: 1fr; gap: 12px; }
  .inv2-slots { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .inv2-slot-t, .inv2-slot-x { font-size: 0.58rem; }
  .inv2-slot-ico { font-size: 1.2rem; }
  .inv2-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .inv2-item.chest, .inv2-slot.pop { animation: none; } }

/* V0.98.0 — session remplacée (même compte ouvert ailleurs) */
#sess-replaced{position:fixed;inset:0;z-index:2147483000;background:rgba(10,14,8,.88);display:flex;align-items:center;justify-content:center;padding:20px}
#sess-replaced .sess-card{background:#1d2417;color:#f1efe4;border:1px solid #3f5232;border-radius:14px;padding:24px;max-width:380px;text-align:center}
#sess-replaced h2{margin:0 0 8px;font-size:18px}
#sess-replaced p{margin:0 0 16px;color:#b9c0a8;font-size:14px}
#sess-replaced button{background:#4c9a3f;color:#fff;border:0;border-radius:10px;padding:10px 18px;font-size:15px;cursor:pointer}

/* V0.98.0 — les notifications passent devant toutes les fenêtres */
#toast-container { position: fixed; z-index: 20000; }

/* V0.98.0 — fiche de statistiques d'un joueur : pseudo copiable + actions */
.stats-copy-name { cursor: copy; border-bottom: 1px dashed currentColor; }
.stats-copy-name:hover { color: #7dd3fc; }
.stats-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; position: relative; }
.stats-act { border: 1px solid rgba(255,255,255,.2); background: rgba(30,41,59,.9); color: #e2e8f0; border-radius: 10px; padding: 6px 10px; font-size: .8rem; cursor: pointer; }
.stats-act:hover { background: rgba(56,189,248,.25); }
.stats-act.danger { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.stats-rep-menu { position: absolute; top: 100%; left: 0; margin-top: 4px; display: flex; flex-direction: column; background: #0f172a; border: 1px solid #334155; border-radius: 10px; overflow: hidden; z-index: 5; }
.stats-rep-menu button { background: none; border: 0; color: #e2e8f0; padding: 8px 14px; text-align: left; cursor: pointer; }
.stats-rep-menu button:hover { background: #1e293b; }

/* V0.98.0 — réglages affichés selon l'appareil (classe body.touch-ui posée par js/touch.js) */
body:not(.touch-ui) [data-device="touch"] { display: none !important; }
body.touch-ui [data-device="desktop"] { display: none !important; }
/* fenêtre ouverte : les commandes tactiles disparaissent (elles bloquaient les clics sur mobile) */
body.has-modal #touch-controls { display: none !important; }

/* --- Récompenses des succès --- */
.ach-rewards { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-bottom: 1px solid rgba(250,204,21,.25); font-size: .8rem; color: #cbd5e1; }
.rw-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rw-pts b { color: #f9a8d4; }
.rw-claim { background: linear-gradient(135deg,#f59e0b,#d97706); color: #1c1917; border: none; border-radius: 8px; padding: 6px 12px; font-weight: 800; cursor: pointer; font-size: .78rem; }
.rw-claim:disabled { filter: grayscale(1); opacity: .45; cursor: default; }
.rw-claim.sm { padding: 3px 9px; font-size: .7rem; }
.rw-stock { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rw-stock small, .rw-title-row small { width: 100%; color: #94a3b8; }
.rw-bonus { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: #0f172a; color: #e2e8f0; border: 1.5px solid var(--bc); border-radius: 10px; padding: 5px 9px; cursor: pointer; font-size: .74rem; text-align: left; }
.rw-bonus b { color: var(--bc); } .rw-bonus em { font-style: normal; color: #94a3b8; font-size: .66rem; }
.rw-title-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rw-title-row select { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 4px 8px; }
.ach-reward { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; font-size: .7rem; color: #94a3b8; }
.ach-reward.ready { color: #fde68a; }
.stats-title-badge { text-align: center; margin: 2px 0 8px; color: #facc15; font-weight: 800; letter-spacing: .5px; }

/* --- Boutique --- */
#shop-overlay { display: none; position: fixed; inset: 0; background: rgba(2,6,23,.82); align-items: center; justify-content: center; z-index: 2600; padding: 10px; box-sizing: border-box; }
.shop-card { width: min(760px, 96vw); height: min(720px, 90dvh); display: flex; flex-direction: column; border-color: #f472b6 !important; overflow: hidden; }
.shop-card .stats-header { gap: 10px; }
.shop-pts { margin-left: auto; margin-right: 8px; color: #f9a8d4; font-weight: 800; font-size: 1.05rem; }
.shop-tabs { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; }
.sh-tab, .sh-chip { background: #0f172a; color: #cbd5e1; border: 1px solid #334155; border-radius: 999px; padding: 6px 12px; font-size: .8rem; cursor: pointer; }
.sh-tab.on, .sh-chip.on { background: #be185d; border-color: #f472b6; color: #fff; }
.shop-body { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; -webkit-overflow-scrolling: touch; }
.sh-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sh-card { background: #111827; border: 1.5px solid #334155; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.sh-card.owned { border-color: #16a34a; }
.sh-sw { width: 62px; height: 62px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; border: 2px solid rgba(255,255,255,.25); text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.sh-sw.plain { background: #1e293b; }
.sh-name { font-weight: 800; font-size: .84rem; color: #f1f5f9; }
.sh-desc { font-size: .7rem; color: #94a3b8; flex: 1; }
.sh-btn { background: #1e293b; color: #e2e8f0; border: 1.5px solid #475569; border-radius: 9px; padding: 6px 10px; font-weight: 800; cursor: pointer; font-size: .78rem; }
.sh-btn.buy { background: linear-gradient(135deg,#ec4899,#be185d); border-color: #f472b6; color: #fff; }
.sh-btn.on { background: #166534; border-color: #4ade80; }
.sh-btn:disabled { opacity: .4; cursor: default; filter: grayscale(.6); }
.sh-daily { width: 100%; box-sizing: border-box; margin-bottom: 10px; background: linear-gradient(135deg,#f59e0b,#d97706); color: #1c1917; border: none; border-radius: 10px; padding: 10px; font-weight: 800; cursor: pointer; }
.sh-daily.done { background: #14532d; color: #bbf7d0; cursor: default; text-align: center; }
.sh-note { font-size: .78rem; color: #94a3b8; margin-bottom: 10px; }
.sh-empty { grid-column: 1 / -1; text-align: center; color: #64748b; padding: 30px 0; }
.sh-ways { display: grid; gap: 10px; }
.sh-way { background: #111827; border: 1.5px solid #334155; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: .82rem; color: #cbd5e1; }
.sh-way.soon { opacity: .7; }
.sh-guest, .rw-guest { background: #3f1d2e; border: 1px solid #be185d; color: #fbcfe8; border-radius: 10px; padding: 8px 10px; font-size: .78rem; margin-bottom: 10px; }
.rw-guest { margin: 2px 0; }
.sh-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: 3px; color: #fde68a; background: #0f172a; border: 1.5px dashed #f59e0b; border-radius: 10px; padding: 8px 14px; user-select: all; }
.sh-row { display: flex; gap: 6px; flex-wrap: wrap; }
.sh-redeem { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.sh-redeem input { flex: 1 1 140px; min-width: 0; background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 8px; padding: 6px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }

/* ---------- Ferme personnelle (js/farm.js) ---------- */
#farm-overlay { display: none; position: fixed; inset: 0; background: rgba(2,6,23,.82); align-items: center; justify-content: center; z-index: 2600; padding: 10px; box-sizing: border-box; }
.farm-card { width: min(900px, 96vw); height: min(780px, 92dvh); display: flex; flex-direction: column; border-color: #4ade80 !important; overflow: hidden; }
.farm-stage { position: relative; flex: 1 1 45%; min-height: 200px; background: #9fd8ff; }
.farm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
.farm-info { flex: 0 1 auto; max-height: 48%; overflow-y: auto; padding: 10px 12px 12px; -webkit-overflow-scrolling: touch; }
.fm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; color: #bbf7d0; }
.fm-title { color: #fde68a; font-size: .8rem; } .fm-meta { margin-left: auto; color: #cbd5e1; font-size: .8rem; }
.fm-note { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: #1e293b; color: #cbd5e1; font-size: .82rem; }
.fm-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.fm-gen { background: #14532d; color: #dcfce7; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; } .fm-gen.off { background: #1e293b; color: #64748b; }
.fm-tro { background: #3b2a0a; color: #fde68a; border-radius: 8px; padding: 3px 8px; font-size: .75rem; } .fm-tro i { opacity: .7; font-style: normal; } .fm-none { color: #94a3b8; font-size: .78rem; }
.fm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; } .fm-likes { margin-left: auto; color: #fda4af; font-weight: 800; }
.fm-gift { background: #be185d !important; } .fm-actions .sh-btn.off { opacity: .5; }
.fm-visit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .fm-visit input { flex: 1 1 140px; min-width: 0; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 7px 10px; }
.fm-hint { margin-top: 8px; color: #64748b; font-size: .7rem; }
.stats-visit-farm { width: 100%; margin: 8px 0 2px; }
body.touch-ui .farm-card, body.compact-ui .farm-card { height: 94dvh; width: 98vw; }

.stats-hero-title { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; padding: 3px 12px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #451a03; background: linear-gradient(90deg, #fde68a, #fbbf24); box-shadow: 0 0 10px rgba(251,191,36,.45); }
.stats-guest-note { margin-top: 10px; font-size: .75rem; color: #94a3b8; }
.stats-act.farm { border-color: rgba(74,222,128,.55); color: #bbf7d0; }
.tag-title { font-size: .68rem; font-weight: 800; color: #451a03; background: linear-gradient(90deg, #fde68a, #fbbf24); border-radius: 999px; padding: 0 8px; margin: 0 auto 2px; width: fit-content; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-none { color: #94a3b8; font-size: .78rem; }

/* Bouton « Passer » de l'ouverture de coffre */
.chest-skip-btn {
  margin-top: 4px; padding: 9px 22px; font-size: 0.95rem; font-weight: 800;
  color: #e2e8f0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; cursor: pointer; letter-spacing: 0.03em;
  transition: background .15s, transform .1s;
}
.chest-skip-btn:hover { background: rgba(255,255,255,0.18); }
.chest-skip-btn:active { transform: scale(0.96); }

/* ===== Notifications : effet « Wow » ===== */
.toast.toast-shine::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: toastShine 0.9s ease-out 0.15s 1 both;
}
@keyframes toastShine { from { left: -60%; } to { left: 140%; } }
.toast.toast-wow.show { animation: toastWowPop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
@keyframes toastWowPop {
  0% { transform: scale(0.6) translateY(-16px) rotate(-3deg); }
  55% { transform: scale(1.14) translateY(0) rotate(1.5deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}
.toast-wow-tag {
  position: absolute; top: -13px; right: -10px; z-index: 3;
  padding: 2px 9px; border-radius: 10px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.04em;
  color: #3b0764; background: linear-gradient(135deg, #fde047, #fb923c);
  border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.45);
  transform: rotate(8deg); pointer-events: none;
  animation: toastWowTag 1.6s ease-out both;
}
@keyframes toastWowTag {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  25% { transform: scale(1.35) rotate(10deg); opacity: 1; }
  40% { transform: scale(1) rotate(8deg); }
  85% { opacity: 1; }
  100% { transform: scale(1) rotate(8deg); opacity: 0; }
}
.toast-spark {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3px 0 0 -3px;
  border-radius: 50%; pointer-events: none; z-index: 3; opacity: 0;
  box-shadow: 0 0 8px currentColor, 0 0 6px rgba(255,255,255,0.9);
  animation: toastSpark 0.9s ease-out both;
}
@keyframes toastSpark {
  0% { transform: translate(0, 0) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .toast.toast-shine::after { animation: none; display: none; }
}

/* Parrainage : liste des filleuls */
.sh-kids { grid-column: 1 / -1; margin-top: 10px; }
.sh-kid { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sh-kid > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sh-kid .ok { color: #4ade80; }
.sh-kid em { font-style: normal; color: #94a3b8; font-size: .75rem; white-space: nowrap; }
.sh-kid-bar { flex: 0 0 90px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.sh-kid-bar i { display: block; height: 100%; background: #38bdf8; }

.fm-err { background: rgba(239,68,68,.15); border: 1px solid #ef4444; color: #fecaca; border-radius: 8px; padding: 6px 10px; }

/* Types de notification manquants (le social envoie 'green') : avant, aucun fond = texte sur fond transparent */
.toast-green {
  background: linear-gradient(135deg, #16a34a, #166534);
  border: 2px solid #86efac;
  color: #fff;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.6);
}
.toast-orange {
  background: linear-gradient(135deg, #f97316, #c2410c);
  border: 2px solid #fdba74;
  color: #fff;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.6);
}
.toast-blue, .toast-purple, .toast-pink, .toast-white {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #94a3b8;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* 🔔 Réglages : groupe de notifications */
.stg-sub { margin: 10px 0 0; font-size: 1rem; color: #fde68a; }
.stg-hint { margin: 0 0 2px; font-size: .78rem; color: #94a3b8; }

/* 🍬 Boutique : aperçu des cosmétiques (dessin SVG + particules de l'effet). Fourche, chapeau, tenue, traînée. */
.sh-sw.sh-forksw { position: relative; width: 84px; height: 84px; overflow: hidden; font-size: 0; box-shadow: inset 0 0 18px rgba(0,0,0,.45); }
.sh-fork-svg { width: 78px; height: 78px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); transition: transform .25s ease; }
.sh-card:hover .sh-fork-svg { transform: rotate(-6deg) scale(1.06); }
.sh-season { font-size: .68rem; font-weight: 800; color: #7dd3fc; background: rgba(14,165,233,.12); border: 1px solid rgba(125,211,252,.35); border-radius: 8px; padding: 2px 7px; }
.sh-p { position: absolute; width: 7px; height: 7px; opacity: 0; pointer-events: none; animation: shDrift 2.1s ease-in infinite; }
.sh-p.p2 { animation-delay: .35s; } .sh-p.p3 { animation-delay: .7s; } .sh-p.p4 { animation-delay: 1.05s; } .sh-p.p5 { animation-delay: 1.4s; } .sh-p.p6 { animation-delay: 1.75s; }
/* point de départ : fourche = bout du manche · chapeau = au-dessus du chapeau · tenue = autour du corps */
.pos-fork .sh-p { left: 22%; top: 76%; } .pos-fork .p2 { left: 17%; top: 70%; } .pos-fork .p3 { left: 26%; top: 80%; } .pos-fork .p4 { left: 20%; top: 66%; } .pos-fork .p5 { left: 30%; top: 72%; } .pos-fork .p6 { left: 14%; top: 78%; }
.pos-hat .sh-p { left: 30%; top: 16%; } .pos-hat .p2 { left: 62%; top: 12%; } .pos-hat .p3 { left: 46%; top: 20%; } .pos-hat .p4 { left: 72%; top: 24%; } .pos-hat .p5 { left: 22%; top: 28%; } .pos-hat .p6 { left: 54%; top: 8%; }
.pos-body .sh-p { left: 12%; top: 40%; } .pos-body .p2 { left: 80%; top: 34%; } .pos-body .p3 { left: 20%; top: 66%; } .pos-body .p4 { left: 72%; top: 62%; } .pos-body .p5 { left: 50%; top: 80%; } .pos-body .p6 { left: 60%; top: 22%; }
@keyframes shDrift { 0% { opacity: 0; transform: translate(0,0) rotate(0) scale(.3); } 12% { opacity: 1; transform: translate(-1px,2px) rotate(40deg) scale(1); } 100% { opacity: 0; transform: translate(-9px,24px) rotate(260deg) scale(.4); } }
@keyframes shFall { 0% { opacity: 0; transform: translate(0,0) rotate(0) scale(.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(8px,34px) rotate(200deg) scale(.7); } }
@keyframes shRise { 0% { opacity: 0; transform: translate(0,6px) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(6px,-26px) scale(.3); } }
@keyframes shTwink { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
/* fourches */
.fx-candy .sh-p { border-radius: 50%; background: #f472b6; box-shadow: inset -1px -1px 0 rgba(0,0,0,.18); }
.fx-candy .p2 { background: #fde68a; } .fx-candy .p3 { background: #86efac; border-radius: 2px; } .fx-candy .p4 { background: #fff; }
.fx-candy .p5 { background: #fb923c; } .fx-candy .p6 { background: #c084fc; border-radius: 2px; }
.fx-neon .sh-p { width: 2px; height: 9px; border-radius: 1px; background: #67e8f9; box-shadow: 0 0 6px 1px #22d3ee; }
.fx-neon .p3, .fx-neon .p6 { background: #fff; }
.fx-obsidian .sh-p { width: 6px; height: 6px; background: #7c3aed; clip-path: polygon(50% 0, 100% 100%, 0 100%); box-shadow: 0 0 6px #4c1d95; }
.fx-obsidian .p2, .fx-obsidian .p5 { background: #312e81; } .fx-obsidian .p3 { background: #a78bfa; }
.fx-emerald .sh-p { width: 6px; height: 6px; background: #34d399; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: 0 0 6px #10b981; }
.fx-emerald .p2, .fx-emerald .p5 { background: #a7f3d0; } .fx-emerald .p3 { background: #fff; }
/* chapeaux */
.fx-seeds .sh-p { width: 4px; height: 7px; border-radius: 50%; background: #111827; animation-name: shFall; animation-duration: 2.4s; }
.fx-seeds .p2, .fx-seeds .p5 { background: #f43f5e; width: 5px; height: 5px; } .fx-seeds .p3 { background: #86efac; width: 5px; height: 5px; }
.fx-crown .sh-p { width: 7px; height: 7px; background: #fde047; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation-name: shTwink; animation-duration: 1.6s; filter: drop-shadow(0 0 3px #facc15); }
.fx-crown .p2, .fx-crown .p5 { background: #fff; } .fx-crown .p3 { background: #c4b5fd; }
.fx-snow .sh-p { width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #bae6fd; animation-name: shFall; animation-duration: 3s; }
.fx-snow .p2, .fx-snow .p5 { width: 4px; height: 4px; background: #e0f2fe; }
/* tenues */
.fx-embers .sh-p { width: 4px; height: 4px; border-radius: 50%; background: #f97316; box-shadow: 0 0 6px 1px #ef4444; animation-name: shRise; animation-duration: 2.2s; }
.fx-embers .p2, .fx-embers .p5 { background: #fde047; box-shadow: 0 0 5px #f97316; } .fx-embers .p3 { background: #ef4444; }
.fx-leaves .sh-p { width: 9px; height: 5px; border-radius: 0 80% 0 80%; background: #16a34a; animation-name: shFall; animation-duration: 3s; }
.fx-leaves .p2, .fx-leaves .p5 { background: #4ade80; } .fx-leaves .p3 { background: #a16207; }
.fx-regal .sh-p { width: 7px; height: 7px; background: #facc15; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation-name: shTwink; animation-duration: 1.8s; filter: drop-shadow(0 0 3px #a855f7); }
.fx-regal .p2, .fx-regal .p5 { background: #a855f7; } .fx-regal .p3 { background: #fff; }
@media (prefers-reduced-motion: reduce) { .sh-p { animation: none; opacity: 0; } .sh-card:hover .sh-fork-svg { transform: none; } }

/* V0.107.11 — boîtes de dialogue du jeu (js/dialog.js) : remplacent confirm / prompt / alert du navigateur */
.gd-overlay { position: fixed; inset: 0; z-index: 30000; background: rgba(2,6,23,.78); display: flex; align-items: center; justify-content: center; padding: 14px; box-sizing: border-box; animation: gdFade .12s ease-out; }
.gd-box { background: #151824; border: 2px solid #f59e0b; border-radius: 14px; padding: 20px 22px; max-width: 460px; width: 100%; color: #e2e8f0; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.6); font-family: inherit; animation: gdPop .14s ease-out; }
.gd-title { font-weight: 800; font-size: 1.05rem; color: #fbbf24; }
.gd-msg { font-size: .95rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.gd-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid #475569; background: #0b1020; color: #f1f5f9; font-size: 1rem; }
.gd-input:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }
.gd-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.gd-btn { flex: 1 1 120px; padding: 11px 14px; border-radius: 9px; border: 0; cursor: pointer; background: #3b82f6; color: #fff; font-size: .95rem; font-weight: 700; }
.gd-btn:hover { filter: brightness(1.12); }
.gd-btn.alt { background: #334155; }
.gd-btn.danger { background: #dc2626; }
.gd-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
@keyframes gdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gdPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* V0.107.12 — filtres du recyclage (boutique) */
.sh-fl { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.sh-fl > span { flex: none; min-width: 52px; padding-top: 7px; font-size: .75rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; }
.sh-fl .sh-chips { margin-bottom: 8px; }
@media (max-width: 480px) { .sh-fl { flex-direction: column; gap: 0; } .sh-fl > span { padding-top: 0; } }
