.sets-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); 
  justify-content: center;
  gap: 24px 14px; 
  align-items: start; 
}
.set-tile { 
  display: flex; 
  flex-direction: column;
  align-items: center;
  gap: 8px; 
  width: 100%; 
  height: 100%;
  padding: 4px; 
  color: var(--navy); 
  background: transparent; 
  text-align: center; 
}
.set-tile h2 { 
  margin: 0; 
  color: var(--navy); 
  font-size: clamp(.8rem, 3.5vw, 1rem); 
  line-height: 1.1; 
  font-weight: 950;
  text-shadow: none; 
  flex-grow: 1;
  display: flex;
  align-items: center;
}
.set-medal { 
  display: grid; 
  place-items: center; 
  width: 100%; 
  max-width: 140px;
  aspect-ratio: 1; 
  border-radius: 999px; 
  border: 5px solid #f6a13b; 
  background: #f9b14c; 
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.18), 0 5px 0 rgba(21,25,53,.18); 
  overflow: hidden; 
}
.set-medal img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }

.accent-green .set-medal { border-color: #70c947; background: #8ee365; }
.accent-blue .set-medal { border-color: #66b7f0; background: #93d5ff; }
.accent-purple .set-medal { border-color: #7856db; background: #9b7cff; }
.accent-pink .set-medal { border-color: #ea4d90; background: #ff7fb1; }
.accent-yellow .set-medal { border-color: #f2be28; background: #ffdc55; }
.accent-orange .set-medal { border-color: #eb9230; background: #ffa748; }

.set-progress { 
  margin-top: auto; 
  position: relative; 
  width: 90%; 
  height: 20px; 
  overflow: hidden; 
  border-radius: 999px; 
  background: #1e2949; 
  border: 3px solid #132040; 
}
.set-progress.detail { width: min(58vw, 280px); height: 28px; border-width: 4px; }
.set-progress-fill { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.15) 0 14px, transparent 14px 28px), linear-gradient(180deg, #67f5ef, #1fc9d0); }
.set-progress strong { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; color: white; font-size: .8rem; text-shadow: 0 1px 0 #06102a; }

/* REQ 1: MODAL FIXE ET SANS SCROLL GLOBAL */
.content-area.set-only { 
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 15, 37, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  margin: 0;
}

.set-detail { 
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px; 
  padding: 14px; 
  border-radius: 30px; 
  background: var(--purple); 
  border: 6px solid var(--navy); 
  box-shadow: var(--shadow); 
  overflow: hidden;
}

.set-detail-header { 
  flex: 0 0 auto;
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px; 
  padding: 12px 16px; 
  border-radius: 24px; 
  background: var(--cream); 
  border: 4px solid rgba(23,35,69,.2); 
}

.set-header-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.set-header-info img { 
  width: 64px; 
  height: 64px; 
  border-radius: 999px; 
  object-fit: cover; 
  border: 4px solid #f0a23f; 
}

.set-header-text {
  display: grid;
  gap: 4px;
  text-align: left;
}

.set-header-text h2 { 
  margin: 0; 
  font-size: clamp(1.2rem, 4vw, 1.8rem); 
  line-height: 1; 
  text-shadow: 0 3px 0 #071026, 2px 0 0 #071026, -2px 0 0 #071026; 
  color: var(--yellow);
}

.nav-set-btn { 
  display: grid; 
  place-items: center;
  width: 44px; 
  height: 44px; 
  flex: 0 0 auto;
  border-radius: 999px; 
  color: white; 
  background: var(--navy); 
  font-size: 1.8rem; 
  font-weight: 950; 
  line-height: 1; 
  padding-bottom: 4px;
  border: 3px solid rgba(255,255,255,0.2); 
  transition: transform 0.1s;
}
.nav-set-btn:active { transform: scale(0.9); }

/* CONTENU DE LA GRILLE : Flex-shrink avec scroll automatique en cas d'écran minuscule */
.set-detail .cards-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

/* FOOTER TOUJOURS VISIBLE */
.set-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 2px dashed rgba(255, 255, 255, 0.2);
}

.close-set-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.1rem;
}

.needs-activation {
  position: relative;
  animation: highlight-pulse 1.5s infinite;
}

.needs-activation::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" stroke="%23172345" stroke-width="1.5"><path d="M10.493 2.132a1 1 0 0 1 1.488-.138l.063.076 5.86 8.204a1 1 0 0 1-.68 1.564l-.116.008-2.6.001 2.378 5.549a1 1 0 0 1-1.748.88l-.067-.13-2.34-5.46-2.52 3.033a1 1 0 0 1-1.637-.442l-.028-.112L8.5 2.5a1 1 0 0 1 1.993-.368z"/></svg>');
  z-index: 20;
  animation: cursor-click 1s infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  pointer-events: none;
}

@keyframes cursor-click {
  0% { transform: scale(1) translate(0, 0); }
  25% { transform: scale(0.85) translate(-4px, -4px); }
  50% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1) translate(0, 0); }
}

@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(113, 231, 228, 0.7); border-radius: 15px; }
  70% { box-shadow: 0 0 0 10px rgba(113, 231, 228, 0); border-radius: 15px; }
  100% { box-shadow: 0 0 0 0 rgba(113, 231, 228, 0); border-radius: 15px; }
}

@media (max-width: 700px) {
  .sets-grid { gap: 16px 8px; }
  .set-medal { border-width: 4px; }
  .set-progress { height: 18px; border-width: 2px; }
  .set-detail { padding: 8px; }
  
  .set-header-info img { width: 48px; height: 48px; border-width: 3px; }
  .nav-set-btn { width: 38px; height: 38px; font-size: 1.5rem; }
  
  .set-detail { border-width: 5px; border-radius: 24px; }
  .set-detail-header { border-width: 3px; border-radius: 19px; }
}

@media (max-width: 420px) {
  .sets-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .set-tile h2 { font-size: .78rem; }
}
.set-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #f7d76e, #ed9f42);
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 950;
}

