/* Odd One Out styles */

:root {
  --wood-card-bg: radial-gradient(circle at 50% 30%, #ffffff 0%, #fef3c7 75%, #fde68a 100%);
  --wood-border: #d97706;
}

.odd-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1rem;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Progress Stars Bar */
.progress-bar {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

.prog-star {
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prog-star.completed {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.45));
}

/* Category Explanation Banner */
.category-banner {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border: 3px solid #f59e0b;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  animation: banner-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

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

/* 4 Category Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  width: 100%;
  max-width: 520px;
}

.odd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.5rem;
  background: var(--wood-card-bg);
  border: 3px solid var(--wood-border);
  border-radius: 1.5rem;
  box-shadow: 0 6px 14px rgba(180, 83, 9, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease, opacity 0.3s ease;
  min-height: 135px;
  box-sizing: border-box;
}

.odd-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.26);
}

.odd-card:active {
  transform: translateY(1px) scale(0.97);
}

.odd-card:focus-visible,
.action-pill-btn:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.card-icon {
  font-size: 3.8rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.15));
  transition: transform 0.2s ease;
}

.card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #78350f;
  margin-top: 0.45rem;
  pointer-events: none;
  text-align: center;
}

/* Incorrect tap wobble */
.odd-card.wobble {
  animation: gentle-wobble 0.4s ease-in-out;
  border-color: #3b82f6;
}

@keyframes gentle-wobble {
  0%, 100% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-6px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(3deg); }
}

/* Correct odd card floating away */
.odd-card.odd-fly {
  animation: fly-away 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  pointer-events: none;
}

@keyframes fly-away {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.15) translateY(-20px); opacity: 0.9; }
  100% { transform: scale(0.4) translateY(-140px); opacity: 0; }
}

/* Remaining 3 matching cards celebration */
.odd-card.matched-group {
  border-color: #10b981;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #ecfdf5 75%, #a7f3d0 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
  animation: happy-bounce 0.6s ease-in-out alternate infinite;
  pointer-events: none;
}

@keyframes happy-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* Action Controls Bar */
.action-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  min-height: 48px;
}

.action-pill-btn {
  padding: 0.65rem 1.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pop-btn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-pill-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.action-pill-btn:active {
  transform: translateY(1px) scale(0.98);
}

.again-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

@keyframes pop-btn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Sparks & Confetti */
.sparks-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: burst 0.85s ease-out forwards;
}

@keyframes burst {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.35); opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .cards-grid {
    gap: 0.6rem;
  }
  .odd-card {
    min-height: 110px;
    padding: 0.9rem 0.3rem;
  }
  .card-icon {
    font-size: 3rem;
  }
  .card-name {
    font-size: 0.85rem;
  }
  .category-banner {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-height: 520px) {
  .odd-field {
    padding: 0.25rem 0.5rem 0.5rem;
  }
  .progress-bar {
    margin-bottom: 0.35rem;
    gap: 0.4rem;
  }
  .prog-star {
    font-size: 1.25rem;
  }
  .category-banner {
    padding: 0.25rem 0.6rem;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
  }
  .cards-grid {
    gap: 0.45rem;
  }
  .odd-card {
    min-height: 75px;
    padding: 0.4rem 0.25rem;
    border-radius: 1rem;
  }
  .card-icon {
    font-size: 2.2rem;
  }
  .card-name {
    font-size: 0.8rem;
    margin-top: 0.2rem;
  }
  .action-bar {
    margin-top: 0.4rem;
    min-height: 38px;
  }
  .action-pill-btn {
    padding: 0.4rem 1.2rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .odd-card.matched-group,
  .action-pill-btn,
  .category-banner,
  .odd-card.wobble,
  .prog-star {
    animation: none;
    transition: none;
  }
  .odd-card.odd-fly {
    animation: none;
    opacity: 0;
    pointer-events: none;
  }
}
