/* =================== General Styles =================== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9f9;
  margin: 0;
  padding: 0;
  text-align: center;
  overscroll-behavior: contain;
}

body.dragging {
  overflow: hidden;
  touch-action: none;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding: 20px;
}

h1 {
  font-size: 2.5rem;
  color: #0965f0;
  margin-bottom: 10px;
}

.tip {
  font-size: 1rem;
  color: #666;
  margin-bottom: 20px;
}

/* =================== Word Bank =================== */
.word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 60px;
}

/* =================== Buttons =================== */
#submit-btn,
#try-again-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  margin: 10px 5px;
  transition: transform 0.2s ease;
}

#submit-btn:hover,
#try-again-btn:hover {
  transform: scale(1.05);
}

#feedback-message {
  font-size: 1.2rem;
  margin-top: 20px;
  min-height: 24px;
  color: #333;
}

.back-button {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.music-toggle-absolute {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 200;
}

/* =================== Drop Zones =================== */
.drop-zones {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.drop-zone {
  width: 45%;
  min-width: 300px;
  min-height: 180px;
  background: white;
  border: 4px solid #888;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.drop-zone::before {
  content: attr(data-type);
  font: bold 1.5rem 'Segoe UI', sans-serif;
  color: #555;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 0 10px;
}

.drop-zone.over {
  background-color: #f0f8ff;
  border-color: #00f;
}

/* =================== Draggable Words (Enhanced) =================== */
.draggable-word {
  /* Background & Color */
  background: linear-gradient(145deg, #e0d3c3, #f5e8d6);
  color: #3e322c;
  border: 2px solid #a89c8e;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: grab;
  user-select: none;

  /* Layout & Display */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease;

  /* Subtle shadow for depth */
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Hover effect - lift and glow */
.draggable-word:hover {
  background: linear-gradient(145deg, #d8c9b8, #ede0d0);
  border-color: #8f7f70;
  transform: translateY(-2px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Active drag state (mouse down) */
.draggable-word:active {
  cursor: grabbing;
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Touch dragging (visual during drag) */
.draggable-word.touch-dragging {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.95;
  transform: scale(1.15);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
  border-color: #0056b3;
}

/* Inside Drop Zone - consistent styling */
.drop-zone .draggable-word {
  display: inline-flex !important;
  margin: 6px !important;
  padding: 10px 14px !important;
  font-size: 1.1rem !important;
  transform: none !important;
  max-width: calc(100% - 24px);
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive tweak for small screens */
@media (max-width: 480px) {
  .draggable-word {
    font-size: 1rem;
    padding: 8px 12px;
  }
}

/* =================== Correct / Incorrect =================== */
.correct {
  background-color: #a5d6a7 !important;
  border-color: #2e7d32 !important;
  color: #fff !important;
}

.incorrect {
  background-color: #ef9a9a !important;
  border-color: #c62828 !important;
  color: #fff !important;
}

/* =================== Responsive =================== */
@media (max-width: 768px) {
  .drop-zone {
    width: 100%;
  }
}
