/* ============================================================
   POPUP "¡Has conseguido más guantes!"  (css/components/glove-autodetect.css)
   ============================================================ */
#gad-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 8, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
#gad-overlay.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }

#gad-modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1.4px, transparent 1.6px) 0 0 / 12px 12px,
    linear-gradient(180deg, #1e2430 0%, #12161f 100%);
  border: 5px solid #08090c;
  border-radius: 22px;
  box-shadow: 0 10px 0 #08090c, 0 30px 80px rgba(0,0,0,.6);
  overflow: hidden;
  transform: translateY(24px) scale(.94) rotate(-1deg);
  transition: transform .45s cubic-bezier(.2,1.5,.4,1);
}
#gad-overlay.open #gad-modal { transform: none; }

/* Cabecera amarilla con franja de peligro, como la del juego */
#gad-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px 22px;
  background: linear-gradient(180deg, #FFE45C, #F0B800);
  border-bottom: 4px solid #08090c;
}
#gad-head::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -12px;
  height: 8px;
  background: repeating-linear-gradient(45deg, #F0B800 0 12px, #111 12px 24px);
  border-bottom: 3px solid #08090c;
}
#gad-burst {
  position: relative;
  flex-shrink: 0;
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(3px 4px 0 #08090c);
  animation: gadBurst 2.4s ease-in-out infinite;
}
#gad-burst::before, #gad-burst::after {
  content: '';
  position: absolute;
  clip-path: polygon(50% 0%, 59% 22%, 79% 7%, 75% 31%, 100% 30%, 82% 48%, 98% 66%, 74% 67%, 80% 92%, 59% 78%, 50% 100%, 41% 78%, 20% 92%, 26% 67%, 2% 66%, 18% 48%, 0% 30%, 25% 31%, 21% 7%, 41% 22%);
}
#gad-burst::before { inset: 0; background: #08090c; }
#gad-burst::after  { inset: 6px; background: #39ff14; }
#gad-burst span {
  position: relative; z-index: 1;
  padding-top: 4px;
  font-family: 'Luckiest Guy', 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: #08090c;
  transform: rotate(-10deg);
}
#gad-burst b { font-weight: 400; }
@keyframes gadBurst { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(5deg) scale(1.06); } }

#gad-title {
  margin: 0;
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  line-height: 1.15;
  color: #08090c;
}
#gad-sub {
  margin: 6px 0 0;
  font-family: 'Fredoka', sans-serif;
  font-size: .92rem;
  color: #3a2c00;
}

/* Lista de guantes */
#gad-list {
  list-style: none;
  margin: 0;
  padding: 30px 22px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  overflow-y: auto;
}
.gad-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(14px) scale(.8) rotate(-4deg);
}
#gad-overlay.open .gad-tile {
  animation: gadTileIn .5s cubic-bezier(.2,1.6,.4,1) forwards;
  animation-delay: calc(.25s + var(--i, 0) * .07s);
}
@keyframes gadTileIn { to { opacity: 1; transform: none; } }
.gad-tile:nth-child(odd)  .gad-tile-img { transform: rotate(-1.2deg); }
.gad-tile:nth-child(even) .gad-tile-img { transform: rotate(1deg); }
.gad-tile-img {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(-45deg, #1e1600 0 10px, #130f00 10px 20px);
  border: 4px solid #08090c;
  border-radius: 14px;
  box-shadow: 0 5px 0 #08090c;
  overflow: hidden;
}
.gad-tile-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.gad-tile-emoji { font-size: 2rem; }
.gad-tile-kind {
  position: absolute;
  left: 6px; bottom: 6px;
  z-index: 2;
  padding: 1px 8px;
  font-family: 'Fredoka One', cursive;
  font-size: .7rem;
  border: 2.5px solid #08090c;
  border-radius: 7px;
  box-shadow: 2px 2px 0 #08090c;
}
.gad-kind-logro { background: #c9a8ff; color: #1a0b2a; }
.gad-kind-robux { background: #39ff14; color: #08090c; }
.gad-tile-name {
  font-family: 'Fredoka One', cursive;
  font-size: .98rem;
  line-height: 1.15;
  color: #fff;
  text-align: center;
  text-shadow: 2px 2px 0 #08090c;
}

#gad-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 3px dashed #232a37;
}
.gad-btn {
  padding: 10px 22px;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: #1a1200;
  cursor: pointer;
  background: linear-gradient(180deg, #FFD700, #C89A00);
  border: 4px solid #08090c;
  border-radius: 13px;
  box-shadow: 0 5px 0 #08090c;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), box-shadow .12s;
}
.gad-btn:hover  { transform: translateY(-2px); box-shadow: 0 7px 0 #08090c; }
.gad-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #08090c; }
.gad-btn-ghost  { color: #d5dae6; background: linear-gradient(180deg, #2b3241, #171c26); }
.gad-btn:focus-visible { outline: 3px solid #FFD700; outline-offset: 3px; }

@media (max-width: 560px) {
  #gad-head { padding: 14px 16px 20px; gap: 12px; }
  #gad-burst { width: 66px; height: 66px; }
  #gad-burst span { font-size: 1.15rem; }
  #gad-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 26px 14px 14px; gap: 12px; }
  #gad-foot { flex-direction: column-reverse; }
  .gad-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #gad-burst, #gad-overlay.open .gad-tile { animation: none; opacity: 1; transform: none; }
  #gad-modal { transition: none; }
}
