/* ============================================
 * GAME OVER SCENE
 * Re-extracted from old_style.css
 * Contains all #ojol-gameover-root styles
 * ============================================ */

#ojol-gameover-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  pointer-events: auto;
  z-index: 100;
  background: #020617;
}

#ojol-gameover-root .gameover-scene {
  width: 100%;
  max-width: 720px;
  height: calc(100svh - 0px);
  padding: 24px 20px 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: url('../../backgrounds/game-over-bg.webp') center center / cover no-repeat;
  background-color: #020617;
}

#ojol-gameover-root .dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

#ojol-gameover-root .gameover-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ojol-gameover-root .hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

#ojol-gameover-root .hero-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  animation: gameoverHeroGlowPulse 2s ease-in-out infinite;
}

#ojol-gameover-root .hero-glow.is-new-best {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.4) 0%, transparent 70%);
}

@keyframes gameoverHeroGlowPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.6; }
}

#ojol-gameover-root .hero-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  /* background: rgba(2, 6, 23, 0.95); */
  /* border: 4px solid #22c55e; */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); */
}

#ojol-gameover-root .hero-circle.is-new-best {
  border-color: #facc15;
}

#ojol-gameover-root .hero-circle img {
  width: 90px;
  height: auto;
  animation: gameoverHeroFloat 2s ease-in-out infinite;
}

@keyframes gameoverHeroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

#ojol-gameover-root .title-section {
  text-align: center;
  margin-bottom: 8px;
}

#ojol-gameover-root .gameover-title {
  font-size: 32px;
  font-weight: 800;
  color: #f97316;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
}

#ojol-gameover-root .gameover-title.is-new-best {
  color: #facc15;
}

#ojol-gameover-root .gameover-subtitle {
  font-size: 16px;
  color: #ffffff;
}

#ojol-gameover-root .score-panel {
  width: 100%;
  max-width: 210px;
  background: #ffffff0a;
  border-radius: 20px;
  border: 3px solid #22c55e;
  padding: 24px 20px;
  margin-bottom: 8px;
  position: relative;
  backdrop-filter: blur(3px);
}

#ojol-gameover-root .score-panel.is-new-best {
  border-color: #facc15;
}

#ojol-gameover-root .score-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(34, 197, 94, 0.15), transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}

#ojol-gameover-root .score-panel.is-new-best::before {
  background: radial-gradient(circle at top right, rgba(250, 204, 21, 0.2), transparent 55%);
}

#ojol-gameover-root .new-record-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 0%, #facc15, #f97316);
  color: #000;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  animation: gameoverBadgePulse 1s ease-in-out infinite;
  display: none;
}

#ojol-gameover-root .score-panel.is-new-best .new-record-badge {
  display: block;
}

@keyframes gameoverBadgePulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}

#ojol-gameover-root .score-label {
  text-align: center;
  font-size: 14px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

#ojol-gameover-root .score-value {
  text-align: center;
  font-size: 64px;
  font-weight: 900;
  color: #f98215;
  line-height: 1;
  margin-bottom: 0px;
  animation: gameoverScoreEntrance 0.4s 
  cubic-bezier(0.68, -0.55, 0.27, 1.55);
  text-shadow: 4px 7px 0 rgba(149, 88, 0, 0.95), 0 10px 20px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(255, 255, 255, 0.7), 0 -2px 4px rgba(255, 200, 100, 0.6);
}

#ojol-gameover-root .score-panel.is-new-best .score-value {
  color: #fa9c16;
}

@keyframes gameoverScoreEntrance {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#ojol-gameover-root .score-divider {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: 12px 0;
}

#ojol-gameover-root .best-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  color: #e2e8f0;
}

#ojol-gameover-root .best-score-row .icon {
  font-size: 20px;
}

#ojol-gameover-root .coin-gain {
  text-align: center;
  font-size: 16px;
  color: #fbbf24;
  margin-top: 8px;
}

#ojol-gameover-root .buttons-section {
  width: 100%;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#ojol-gameover-root .btn-row {
  display: flex;
  gap: 12px;
}

#ojol-gameover-root .btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
}

#ojol-gameover-root .btn:active {
  transform: scale(0.96);
}

#ojol-gameover-root .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#ojol-gameover-root .btn-continue {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 0 #1e3a8a, 0 6px 12px rgba(0, 0, 0, 0.3);
}

#ojol-gameover-root .btn-double {
  background: linear-gradient(135deg, #7c2d12, #ea580c);
  color: #fff;
  box-shadow: 0 4px 0 #431407, 0 6px 12px rgba(0, 0, 0, 0.3);
}

#ojol-gameover-root .btn-play {
  background: radial-gradient(circle at 20% 0, #22c55e 0%, #15803d 100%);
  color: #fff;
  font-size: 18px;
  padding: 8px 16px;
  box-shadow: 0 4px 0 #14532d, 0 6px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(34, 197, 94, 0.3);
  animation: gameoverPlayBtnGlow 1.5s ease-in-out infinite;
}

@keyframes gameoverPlayBtnGlow {
  0%, 100% { box-shadow: 0 4px 0 #14532d, 0 6px 12px rgba(0,0,0,0.3), 0 0 15px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 4px 0 #14532d, 0 6px 12px rgba(0,0,0,0.3), 0 0 25px rgba(34,197,94,0.4); }
}

#ojol-gameover-root .btn-share {
  background: radial-gradient(circle at 30% 0%, #facc15, #f97316);
  color: #000000;
  box-shadow: 4px 7px 0 rgba(149, 88, 0, 0.95), 0 9px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#ojol-gameover-root .btn-icon {
  font-size: 18px;
}

#ojol-gameover-root .back-link {
  margin-top: 20px;
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

#ojol-gameover-root .back-link:hover {
  color: #e2e8f0;
}

#ojol-gameover-root .gameover-toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

#ojol-gameover-root .gameover-toast.show {
  opacity: 1;
}

@media (max-height: 720px) {
  #ojol-gameover-root .gameover-scene {
    padding: 16px 16px 20px;
  }
  #ojol-gameover-root .hero-circle {
    width: 100px;
    height: 100px;
  }
  #ojol-gameover-root .hero-circle img {
    width: 75px;
  }
  #ojol-gameover-root .gameover-title {
    font-size: 26px;
  }
  #ojol-gameover-root .score-value {
    font-size: 42px;
  }
  #ojol-gameover-root .score-panel {
    padding: 8px;
  }
}


@media (min-width: 768px) {
  #ojol-gameover-root .gameover-scene { max-width: 540px; }
}


@media (min-width: 1024px) {
  #ojol-gameover-root .gameover-scene { max-width: 640px; }
}