/* Decouply CSS - Matched to Polmantle/Semantly Style */

/* --- Utility Classes --- */
.hidden {
  display: none !important;
}

/* --- Heart Styling --- */
.heart {
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart:hover {
  transform: scale(1.2);
}

.heart-beat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.heart-lost {
  opacity: 0.3;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25%, 75% { transform: scale(1.2); }
}

/* --- User Word Styling --- */
.userWord {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: #f3f4f6;
  display: inline-block;
  font-size: 0.95rem;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.userWord:hover {
  background: #ede9fe;
  color: #7c3aed;
  transform: translateX(4px);
  border-color: #c4b5fd;
}

/* --- Highlighted Word Styling --- */
.highlighted-word {
  font-weight: 600;
  color: #dc2626;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  display: inline-block;
  cursor: pointer;
  animation: pulse-highlight 2s ease-in-out infinite;
}

.highlighted-word:hover {
  transform: scale(1.05);
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* --- Score Animation --- */
#scoreValue.updated {
  animation: scoreUpdate 0.6s ease;
}

@keyframes scoreUpdate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); color: #6d28d9; }
}

/* --- Difficulty Animation --- */
#difficultyLevel.updated {
  animation: difficultyUpdate 0.6s ease;
}

@keyframes difficultyUpdate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); color: #7c3aed; }
}

/* --- Streak Badge Styling --- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  animation: badge-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  transform: scale(0);
}

@keyframes badge-pop {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.streak-badge:nth-child(1) { animation-delay: 0s; }
.streak-badge:nth-child(2) { animation-delay: 0.05s; }
.streak-badge:nth-child(3) { animation-delay: 0.1s; }
.streak-badge:nth-child(4) { animation-delay: 0.15s; }
.streak-badge:nth-child(5) { animation-delay: 0.2s; }
.streak-badge:nth-child(6) { animation-delay: 0.25s; }
.streak-badge:nth-child(7) { animation-delay: 0.3s; }
.streak-badge:nth-child(8) { animation-delay: 0.35s; }
.streak-badge:nth-child(9) { animation-delay: 0.4s; }
.streak-badge:nth-child(10) { animation-delay: 0.45s; }

/* --- Fireworks Animation --- */
#fireworksContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  overflow: visible;
  pointer-events: none;
}

.firework {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c3aed, transparent);
  opacity: 0;
  animation: firework-animation 1s ease-out forwards;
}

@keyframes firework-animation {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(3) translateY(-100px); opacity: 0; }
}

.firework-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, transparent);
  opacity: 0;
  animation: firework-particle-animation 1.5s ease-out forwards;
}

@keyframes firework-particle-animation {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--translateX), var(--translateY)) scale(0.5); opacity: 0; }
}

/* --- Word Success Animation --- */
.word-success {
  animation: word-success 0.6s ease-out;
}

@keyframes word-success {
  0% { transform: translateY(0); background-color: #f3f4f6; }
  50% { transform: translateY(-6px); background-color: #dcfce7; }
  100% { transform: translateY(0); background-color: #f3f4f6; }
}

/* --- Popup Overlay Transition --- */
.popup-overlay {
  transition: opacity 0.3s ease;
}

.popup-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- Popup Content Styling --- */
.popup-content {
  animation: popup-in 0.3s ease-out;
}

@keyframes popup-in {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Close button hover effect */
.popup-content .close-button:hover {
  background-color: #fee2e2;
}

.popup-content .close-button:hover i {
  color: #dc2626;
}

/* --- How To Play Popup --- */
#howToPlayPopup {
  display: none;
}

#howToPlayPopup:not(.hidden) {
  display: flex;
}

/* --- Dice Button --- */
#rollWordButton {
  transition: all 0.2s ease;
}

#rollWordButton:hover {
  transform: scale(1.05);
  background: #f3f4f6;
}

#rollWordButton:active {
  transform: scale(0.95);
}

/* --- Animations --- */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.28s ease-in-out;
}

/* --- Toast Messages --- */
.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* --- Scroll Styling --- */
#allPreviousWords::-webkit-scrollbar {
  width: 6px;
}

#allPreviousWords::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#allPreviousWords::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#allPreviousWords::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}