/* =========================================================================
   Стилі гейміфікації: рівень/досвід, трофеї, суші-скарбничка, святкування.
   ========================================================================= */

.player-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 30px;
  padding: 8px 18px;
  color: #86198f;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  padding: 8px 18px;
  color: white;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.pill-icon {
  font-size: 1.3rem;
}

.streak-pill .pill-icon {
  animation: flicker 1.4s infinite ease-in-out;
}

@keyframes flicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.xp-bar-container {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 22px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd166, #ff9ecb);
  border-radius: 20px;
  transition: width 0.6s ease;
}

.xp-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* ---- Trophy case ---- */

.trophy-case {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px;
  max-width: 640px;
  width: 100%;
  margin: 10px auto 24px;
}

.trophy {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 12px 6px;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease;
}

.trophy.unlocked {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.trophy.unlocked:hover {
  transform: translateY(-4px) scale(1.04);
}

.trophy.locked {
  opacity: 0.55;
}

.trophy-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.trophy-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.trophy.unlocked .trophy-name {
  color: #86198f;
  text-shadow: none;
}

/* ---- Collectible reward tracker (🍣 🍕 🍦) ---- */

.collect-tracker {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 480px;
  width: 100%;
  margin: 0 auto 24px;
}

.collect-card {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: center;
  min-width: 100px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, background 0.25s ease;
}

.collect-card.ready {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(217, 70, 239, 0.35);
  animation: collect-glow 1.6s infinite ease-in-out;
}

@keyframes collect-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.collect-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.collect-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.collect-card.ready .collect-name {
  color: #86198f;
  text-shadow: none;
}

.collect-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  margin-top: 2px;
}

.collect-card.ready .collect-count {
  color: #a21caf;
  text-shadow: none;
}

.collect-redeem-btn {
  margin-top: 8px;
  background: linear-gradient(45deg, #d946ef, #ec4899);
  border: none;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
}

.collect-redeem-btn:disabled {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
}

/* ---- Celebration overlay ---- */

.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(76, 29, 96, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100;
  padding: 20px;
}

.celebration-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.celebration-card {
  background: linear-gradient(160deg, #ffffff, #ffe4f3);
  border-radius: 28px;
  padding: 36px 30px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transform: scale(0.85);
  transition: transform 0.3s ease;
}

.celebration-overlay.show .celebration-card {
  transform: scale(1);
}

.celebration-icon {
  font-size: 4rem;
  margin-bottom: 10px;
}

.celebration-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #86198f;
  margin-bottom: 8px;
}

.celebration-text {
  font-size: 1rem;
  color: #6b21a8;
  margin-bottom: 20px;
  line-height: 1.4;
}

.celebration-close {
  background: linear-gradient(45deg, #d946ef, #ec4899);
  border: none;
  color: white;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(217, 70, 239, 0.4);
}

/* ---- Confetti ---- */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}

.confetti-piece {
  position: absolute;
  top: -40px;
  animation: confetti-fall 2.4s ease-in forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0.2;
  }
}

@media (max-width: 480px) {
  .trophy-case {
    grid-template-columns: repeat(3, 1fr);
  }
}
