/* ============================================
   鹅腿猎人 - Custom Styles
   ============================================ */

/* Page transitions */
.page {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Image rotation transition */
#question-img, #compare-img-l, #compare-img-r {
  transition: transform 0.4s ease;
}

/* Compare card animations */
#question-card-compare img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

/* Answer option buttons */
.answer-btn {
  transition: all 0.15s ease;
  border: 2px solid #e7e5e4;
  position: relative;
  overflow: hidden;
}

.answer-btn:active {
  transform: scale(0.97);
}

.answer-btn:hover {
  border-color: #FF6B35;
  background-color: #FFF7ED;
}

.answer-btn.correct {
  border-color: #22C55E;
  background-color: #F0FDF4;
  animation: pulse-correct 0.4s ease;
}

.answer-btn.wrong {
  border-color: #EF4444;
  background-color: #FEF2F2;
  animation: shake 0.4s ease;
}

.answer-btn.reveal-correct {
  border-color: #22C55E;
  background-color: #F0FDF4;
}

/* Difficulty badges */
.diff-easy {
  background-color: #dcfce7;
  color: #15803d;
}

.diff-medium {
  background-color: #fef9c3;
  color: #a16207;
}

.diff-hard {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Animations */
@keyframes pulse-correct {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes count-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Result page animations */
.result-animate {
  animation: slide-up 0.5s ease-out forwards;
  opacity: 0;
}

.result-animate-delay-1 { animation-delay: 0.1s; }
.result-animate-delay-2 { animation-delay: 0.2s; }
.result-animate-delay-3 { animation-delay: 0.3s; }
.result-animate-delay-4 { animation-delay: 0.4s; }
.result-animate-delay-5 { animation-delay: 0.5s; }
.result-animate-delay-6 { animation-delay: 0.6s; }

/* Feedback overlay */
.feedback-correct {
  animation: bounce-in 0.3s ease-out forwards;
  color: #22C55E;
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.feedback-wrong {
  animation: bounce-in 0.3s ease-out forwards;
  color: #EF4444;
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

/* Score number animation */
.score-animate {
  animation: count-up 0.6s ease-out forwards;
}

/* Image loading placeholder */
.img-placeholder {
  background: linear-gradient(135deg, #f5f5f4, #e7e5e4);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Poster sharing */
.poster-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.poster-preview img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Touch-friendly buttons */
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent pull-to-refresh during quiz */
#page-quiz {
  overscroll-behavior: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* QR Code styling for poster */
#poster-qr canvas,
#poster-qr img {
  width: 100px !important;
  height: 100px !important;
}
