/* ==============================================
   Drag & Drop Puzzle – 2×2 Layout FIX
   Funktioniert auf Desktop & Mobile (2026)
   ============================================== */

#dragDropGallery {
  width: 100%;
  max-width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
}

#dragDropGallery .image-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 30px 0;
  width: 100%;
}

#dragDropGallery .image-list img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  cursor: grab;
  transition: all 0.2s ease;
}

/* MARKIERUNG BEIM ANTIPPEN / AUSWÄHLEN */
#dragDropGallery .image-list img.selected {
  transform: scale(1.18);
  border: 5px solid #2196F3;
  box-shadow: 0 0 30px rgba(33, 150, 243, 0.9);
  z-index: 20;
  position: relative;
}

#dragDropGallery .image-list img.selected::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 4px solid #2196F3;
  border-radius: 18px;
  animation: pulse 1.8s infinite ease-out;
  pointer-events: none;
}

@keyframes pulse {
  0%   { opacity: 0.7; transform: scale(0.95); }
  50%  { opacity: 1;   transform: scale(1.1); }
  100% { opacity: 0.7; transform: scale(0.95); }
}

/* ── WICHTIG: 2×2 Layout – immer nebeneinander! ── */
#dragDropGallery .container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);     /* ← 2 Spalten, immer! */
  gap: 8px;                                  /* schöner, enger Abstand */
  width: 100%;
  max-width: 300px;                          /* ← verhindert zu große Abstände auf Desktop */
  margin: 30px auto;
  padding: 0 10px;
  justify-content: center;
}

#dragDropGallery .drop-zone {
  aspect-ratio: 1 / 1;                       /* immer quadratisch */
  width: 100%;
  max-width: 140px;
  border: 3px dashed #777;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
  position: relative;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  touch-action: none;
}

#dragDropGallery .drop-zone .label {
  font-size: 30px;
  font-weight: bold;
  color: #aaa;
  user-select: none;
}

#dragDropGallery .drop-zone.filled .label {
  display: none;
}

#dragDropGallery .drop-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

#dragDropGallery .drop-zone.over {
  border-color: #2196F3;
  background-color: #e8f4fd;
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.5);
}

#dragDropGallery .drop-zone.filled {
  border-color: #4CAF50;
  background-color: #f0fdf4;
}

/* CHECK BUTTON */
#dragDropGallery .check-button {
  display: block;
  margin: 40px auto;
  padding: 14px 36px;
  font-size: 19px;
  font-weight: bold;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

#dragDropGallery .check-button:hover:not(:disabled) {
  background-color: #45a049;
  transform: translateY(-2px);
}

#dragDropGallery .check-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
}

/* RESULT ANZEIGE */
#dragDropGallery .result {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  min-height: 34px;
  margin-top: 10px;
}

/* ── Responsive Anpassungen für kleine Bildschirme ── */
@media (max-width: 480px) {
  #dragDropGallery .container {
    max-width: 260px;
    gap: 6px;
  }
  #dragDropGallery .image-list img {
    width: 78px;
    height: 78px;
  }
  #dragDropGallery .drop-zone {
    max-width: 120px;
  }
}

@media (max-width: 380px) {
  #dragDropGallery .container {
    max-width: 220px;
    gap: 4px;
  }
  #dragDropGallery .image-list img {
    width: 70px;
    height: 70px;
  }
  #dragDropGallery .drop-zone {
    max-width: 100px;
  }
}