/* ===== Finish Screen ===== */
@import url("https://fonts.googleapis.com/css2?family=Fredoka+One&family=Baloo+2:wght@700;800;900&display=swap");

.finish-overlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
  background: rgba(255, 192, 203, 0.55);
  backdrop-filter: blur(6px);
}

.finish-card{
  width: 100%;
  max-width: 420px;
  border-radius: 26px;
  padding: 18px 16px;
  text-align: center;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
  border: 2px solid rgba(255, 105, 180, 0.35);
  animation: finishPop 260ms ease-out;
}

.finish-title{
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #ff2d8a;
  margin-top: 4px;
}

.finish-title.fun{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 900;
  margin: 12px 0 6px;
  color: #ec4899;
  animation: titleBounce 1.4s ease-in-out infinite;
}

.finish-player{
  margin: 10px 0 18px;
  font-size: 26px;
  font-weight: 900;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fce7f3, #e9d5ff, #fbcfe8);
  background-size: 200% 200%;
  box-shadow:
    0 12px 26px rgba(124,58,237,0.25),
    inset 0 2px 6px rgba(255,255,255,0.9);
  animation: namePop 1.8s ease-in-out infinite;
}

.finish-bonus{
  margin: 6px auto 16px;
  display: inline-block;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 900;
  color: #16a34a;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0, #f0fdf4);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(22,163,74,0.25);
  animation: bonusPop 1.6s ease-in-out infinite;
}

.finish-rewards{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.finish-coins{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7cc, #fde68a, #facc15);
  box-shadow:
    0 10px 26px rgba(250,204,21,0.45),
    inset 0 2px 6px rgba(255,255,255,0.9);
  font-weight: 900;
  font-size: 20px;
  margin-top: 14px;
  position: relative;
  animation: coinWow 1.8s ease-in-out infinite;
}

.finish-coins::after{
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0));
  opacity: 0.7;
  pointer-events: none;
}

.finish-diamonds{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 16px;
  color: #0f766e;
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  box-shadow: 0 8px 18px rgba(13,148,136,0.35);
  animation: diamondPulse 1.6s ease-in-out infinite;
}

/* ===== Finish Buttons ===== */











.finish-btn{
  width: 100%;
  border-radius: 999px;
  padding: 18px 24px;
  font-family: "Baloo 2", system-ui, Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

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

.finish-btn-replay{
  margin-top: 18px;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow:
    0 16px 34px rgba(34,197,94,0.45),
    inset 0 2px 6px rgba(255,255,255,0.9);
}

.finish-btn-replay::before{
  content: "😺";
  font-size: 22px;
}

.finish-btn-home{
  margin-top: 12px;
  background: linear-gradient(135deg, #f9a8d4, #f472b6);
  box-shadow:
    0 14px 28px rgba(236,72,153,0.35),
    inset 0 2px 6px rgba(255,255,255,0.9);
}

.finish-btn-home::before{
  content: "🏠";
  font-size: 20px;
}



/* ===== Finish Mascot ===== */

.dog-run{
  font-size: 64px;
  position: absolute;
  animation: dogRun 2.5s ease-in-out infinite;
  z-index: 3;
}

/* ===== Finish Animations ===== */

@keyframes finishPop{
  from{ transform: scale(0.92); opacity: 0; }
  to{ transform: scale(1); opacity: 1; }
}

@keyframes bonusPop{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.12); }
  100%{ transform: scale(1); }
}

@keyframes coinWow{
  0%{ transform: scale(1) rotate(0deg); }
  30%{ transform: scale(1.12) rotate(-4deg); }
  55%{ transform: scale(0.96) rotate(3deg); }
  75%{ transform: scale(1.05) rotate(-2deg); }
  100%{ transform: scale(1) rotate(0deg); }
}

@keyframes namePop{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.08); }
  100%{ transform: scale(1); }
}

@keyframes diamondPulse{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.12); }
  100%{ transform: scale(1); }
}

@keyframes dogRun{
  0%{ transform: translateX(-120px) rotate(0deg); }
  40%{ transform: translateX(0) rotate(10deg); }
  60%{ transform: translateX(0) rotate(-10deg); }
  100%{ transform: translateX(120px) rotate(0deg); }
}

/* ===== Lose Screen ===== */

.lose-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,210,240,0.65), rgba(60,20,80,0.92) 70%),
    radial-gradient(circle at 15% 80%, rgba(120,220,255,0.18), transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(255,240,160,0.14), transparent 60%);
  backdrop-filter: blur(10px) saturate(1.25);
  z-index:9999;
}

.lose-card{
  position:relative;
  width:min(92vw,420px);
  padding:34px 26px 26px;
  border-radius:36px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.95), rgba(255,235,248,0.92) 45%, rgba(255,255,255,0.98) 100%),
    linear-gradient(180deg, rgba(255,205,235,0.55) 0%, rgba(255,255,255,0.0) 60%);
  box-shadow:
    0 36px 90px rgba(0,0,0,0.5),
    0 0 0 3px rgba(255,140,190,0.28),
    inset 0 1px 0 rgba(255,255,255,0.9);
  text-align:center;
  animation: loseCardIn 0.7s cubic-bezier(.2,1.3,.4,1);
  overflow:hidden;
}

.lose-emoji{
  font-size:56px;
  margin-bottom:10px;
  animation: mascotBounce 1.15s ease-in-out infinite;
}

.lose-title{
  font-size:30px;
  font-weight:900;
  color:#ff2f8a;
  margin-bottom:6px;
}

.lose-subtitle{
  font-size:17px;
  color: rgba(30,20,40,0.9);
  margin-bottom:18px;
}

.lose-actions{
  display:flex;
  gap:12px;
  justify-content:center;
}

/* ===== Lose Animations ===== */

@keyframes loseCardIn{
  0%{ transform:scale(0.62) translateY(46px); opacity:0; }
  100%{ transform:scale(1) translateY(0); opacity:1; }
}

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