/* =======================
   DRAGON HATCH - Angpao Egg Style
   Dark Fantasy Theme
========================== */

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --fire-orange: #ff6a00;
  --fire-red: #ff2200;
  --fire-yellow: #ffd700;
  --mystic-purple: #6b1d9e;
  --dark-bg: #0a0a12;
}

body {
  background: radial-gradient(ellipse at 50% 20%, #1a1025 0%, #0d0d1a 40%, #050510 100%);
  font-family: "Kanit", "MedievalSharp", "Cinzel Decorative", Georgia, serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 40px;
  color: #e8d5b0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 106, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(107, 29, 158, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L32 28L60 30L32 32L30 60L28 32L0 30L28 28Z' fill='rgba(255,215,0,0.015)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- FLOATING EMBERS --- */
.embers-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1; overflow: hidden;
}
.ember {
  position: absolute;
  width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, #ff6a00, #ff220088, transparent);
  box-shadow: 0 0 6px 2px rgba(255, 106, 0, 0.4);
  animation: emberFloat linear infinite;
  opacity: 0;
}
.ember-1 { left: 10%; bottom: -10px; animation-duration: 8s; width: 3px; height: 3px; }
.ember-2 { left: 25%; bottom: -10px; animation-duration: 6s; animation-delay: 1s; width: 5px; height: 5px; }
.ember-3 { left: 40%; bottom: -10px; animation-duration: 9s; animation-delay: 2s; }
.ember-4 { left: 55%; bottom: -10px; animation-duration: 7s; animation-delay: 0.5s; width: 3px; height: 3px; }
.ember-5 { left: 70%; bottom: -10px; animation-duration: 10s; animation-delay: 3s; width: 6px; height: 6px; }
.ember-6 { left: 85%; bottom: -10px; animation-duration: 6.5s; animation-delay: 1.5s; }
.ember-7 { left: 15%; bottom: -10px; animation-duration: 11s; animation-delay: 4s; width: 3px; height: 3px; }
.ember-8 { left: 60%; bottom: -10px; animation-duration: 8.5s; animation-delay: 2.5s; width: 5px; height: 5px; }

@keyframes emberFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.8; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-100vh) translateX(30px) scale(0); opacity: 0; }
}

/* --- AMBIENT PARTICLES --- */
.ambient-particles { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.ambient-particle {
  position: absolute; border-radius: 50%;
  animation: ambientDrift linear infinite; opacity: 0;
}
@keyframes ambientDrift {
  0% { transform: translateY(0) translateX(0) scale(0); opacity: 0; }
  15% { opacity: 0.7; transform: scale(1); }
  85% { opacity: 0.3; }
  100% { transform: translateY(-60vh) translateX(40px) scale(0); opacity: 0; }
}

/* --- WRAPPER --- */
.wrapper {
  width: 100%; max-width: 500px;
  padding: 20px 16px 30px;
  position: relative; z-index: 10;
}

/* --- HEADER --- */
.header-section { text-align: center; margin-bottom: 8px; padding: 20px 0 10px; }
.header-ornament {
  color: var(--fire-yellow); font-size: 14px;
  letter-spacing: 12px; margin-bottom: 8px;
  opacity: 0.6; animation: ornamentPulse 3s ease-in-out infinite;
}
@keyframes ornamentPulse {
  0%, 100% { opacity: 0.4; letter-spacing: 12px; }
  50% { opacity: 0.8; letter-spacing: 16px; }
}

.title {
  font-family: "Cinzel Decorative", serif;
  font-size: 2.4rem; font-weight: 900;
  background: linear-gradient(135deg, #ff6a00, #ffd700, #ff8c00, #ffd700, #ff6a00);
  background-size: 300% 300%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShimmer 4s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 106, 0, 0.4));
  line-height: 1.2; margin-bottom: 8px;
}
@keyframes titleShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.subtitle {
  font-family: "Kanit", sans-serif; font-size: 0.95rem;
  color: #b89a6a; letter-spacing: 1px; opacity: 0.8;
}

/* --- DRAGON DIVIDER --- */
.dragon-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 12px 0 20px;
}
.wing-line { flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--fire-yellow), transparent); opacity: 0.4; }
.wing-line.left { background: linear-gradient(90deg, transparent, var(--fire-yellow)); }
.wing-line.right { background: linear-gradient(90deg, var(--fire-yellow), transparent); }
.dragon-icon {
  animation: dragonBreath 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.6));
}
@keyframes dragonBreath {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.6)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 20px rgba(255, 106, 0, 0.9)); }
}

/* --- TAP HINT --- */
.tap-hint {
  text-align: center; font-size: 0.95rem; color: #b89a6a;
  padding: 8px; margin-bottom: 16px;
  animation: hintPulse 2s ease-in-out infinite;
}
.tap-hint.hidden { display: none; }
.tap-icon { font-size: 1.2rem; display: inline-block; animation: tapBounce 1s ease-in-out infinite; }
@keyframes tapBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes hintPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* =======================================
   EGGS GRID — Angpao Style
======================================= */
.eggs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 10px;
  margin-bottom: 20px;
}

/* --- EGG CARD (Angpao envelope style) --- */
.egg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: 16px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.egg-card:hover {
  transform: translateY(-6px) scale(1.05);
}

.egg-card:active {
  transform: translateY(-2px) scale(0.98);
}

.egg-card.disabled {
  pointer-events: none;
  opacity: 0.3;
  filter: grayscale(0.6) brightness(0.5);
  transform: scale(0.92);
  transition: all 0.5s ease;
}

.egg-card.selected {
  animation: selectedPulse 1s ease-in-out;
}

@keyframes selectedPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.1); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Egg image container */
.egg-img-wrap {
  position: relative;
  width: 80px;
  height: 100px;
  z-index: 2;
  animation: eggFloat 3s ease-in-out infinite;
}

.egg-card:nth-child(1) .egg-img-wrap { animation-delay: 0s; }
.egg-card:nth-child(2) .egg-img-wrap { animation-delay: 0.5s; }
.egg-card:nth-child(3) .egg-img-wrap { animation-delay: 1s; }
.egg-card:nth-child(4) .egg-img-wrap { animation-delay: 1.5s; }
.egg-card:nth-child(5) .egg-img-wrap { animation-delay: 0.3s; }
.egg-card:nth-child(6) .egg-img-wrap { animation-delay: 0.8s; }

@keyframes eggFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.egg-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 8px rgba(255, 106, 0, 0.2));
  transition: filter 0.3s;
}

.egg-card:hover .egg-img-wrap img {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 16px rgba(255, 215, 0, 0.35))
          brightness(1.1);
}

/* Glow underneath egg */
.egg-glow {
  width: 50px; height: 12px;
  background: radial-gradient(ellipse, rgba(255, 106, 0, 0.35), transparent 70%);
  border-radius: 50%;
  margin-top: -2px;
  z-index: 1;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scaleX(1); }
  50% { opacity: 0.9; transform: scaleX(1.3); }
}

/* Egg number badge — removed */

/* Egg label — removed */

/* =======================================
   HATCH AREA — Egg Cracking Phase
======================================= */
.hatch-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 10px;
  margin-bottom: 20px;
  transition: opacity 0.5s, max-height 0.5s;
}

.hatch-area.hidden {
  display: none;
}

.hatch-egg-container {
  position: relative;
  width: 160px;
  height: 200px;
  cursor: pointer;
  margin-bottom: 12px;
}

.hatch-egg-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 20px rgba(255, 106, 0, 0.3));
  transition: filter 0.2s;
}

/* Idle wobble for hatching egg */
.hatch-egg-container.idle {
  animation: hatchIdle 2s ease-in-out infinite;
}

@keyframes hatchIdle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(1.5deg); }
  75% { transform: rotate(-1.5deg); }
}

/* Shake on tap */
.hatch-egg-container.shaking {
  animation: hatchShake 0.12s ease-in-out infinite alternate;
}

@keyframes hatchShake {
  0% { transform: translateX(-4px) rotate(-3deg); }
  25% { transform: translateX(4px) rotate(3deg); }
  50% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* Intensive shake before hatch */
.hatch-egg-container.intense-shake {
  animation: intenseShake 0.06s ease-in-out infinite alternate;
}

@keyframes intenseShake {
  0% { transform: translateX(-6px) rotate(-5deg) scale(1.05); }
  25% { transform: translateX(6px) rotate(5deg) scale(1.08); }
  50% { transform: translateX(-5px) rotate(-4deg) scale(1.06); }
  75% { transform: translateX(5px) rotate(4deg) scale(1.07); }
  100% { transform: translateX(0) rotate(0) scale(1.1); }
}

/* Egg explode away */
.hatch-egg-container.hatching {
  animation: eggExplode 0.7s ease-out forwards;
}

@keyframes eggExplode {
  0% { transform: scale(1.1); opacity: 1; }
  30% { transform: scale(1.4); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

/* Crack overlay on top of egg */
.crack-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.crack-overlay.visible {
  opacity: 1;
}

/* Energy swirl around egg during hatching */
.energy-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-top-color: var(--fire-orange);
  border-bottom-color: var(--fire-yellow);
  border-radius: 50%;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
}

.energy-ring.active {
  opacity: 0.6;
  animation: energySpin 1.2s linear infinite;
}

.energy-ring.ring2 {
  width: 150px; height: 150px;
  animation-direction: reverse;
  animation-duration: 1.8s;
  border-top-color: var(--fire-yellow);
  border-bottom-color: var(--mystic-purple);
}

@keyframes energySpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fire particles around egg */
.fire-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
}

/* Hatch progress bar */
.hatch-progress {
  width: 120px; height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hatch-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--fire-orange), var(--fire-yellow), #fff);
  border-radius: 4px;
  transition: width 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.7);
}

.hatch-text {
  font-size: 0.9rem;
  color: #b89a6a;
  animation: hintPulse 2s ease-in-out infinite;
}

/* =======================================
   DRAGON REVEAL
======================================= */
.reveal-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  min-height: 260px;
}

.reveal-area.hidden { display: none; }

.dragon-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: dragonRevealAnim 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dragonRevealAnim {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.dragon-reveal img {
  width: 200px; height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px var(--dragon-glow, rgba(255, 106, 0, 0.6)));
  animation: dragonBob 2s ease-in-out infinite;
}

@keyframes dragonBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.dragon-reveal .dragon-name {
  margin-top: 14px;
  font-family: "Kanit", serif;
  font-size: 1.4rem; font-weight: 700;
  text-shadow: 0 0 20px var(--dragon-glow, rgba(255, 106, 0, 0.6));
}

/* Magic ring burst on hatch */
.magic-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  border: 3px solid var(--fire-yellow);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 30;
  pointer-events: none;
  animation: magicRingExpand 0.8s ease-out forwards;
}

@keyframes magicRingExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; border-width: 4px; }
  100% { transform: translate(-50%, -50%) scale(10); opacity: 0; border-width: 1px; }
}

/* =======================================
   EXPLOSION & PARTICLES
======================================= */
.hatch-explosion {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
}

.hatch-particle {
  position: absolute; border-radius: 50%; pointer-events: none;
}

.shell-fragment {
  position: absolute; z-index: 5; pointer-events: none;
  animation: shellFly 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes shellFly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.3); }
}

.screen-flash {
  position: fixed; inset: 0; z-index: 99;
  pointer-events: none;
  animation: screenFlash 0.6s ease-out forwards;
}

@keyframes screenFlash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* =======================================
   INFO SECTION
======================================= */
.info-section {
  background: linear-gradient(135deg, rgba(20, 15, 30, 0.9), rgba(30, 20, 50, 0.8));
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 16px; padding: 20px;
  margin-top: 10px; text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 215, 0, 0.1);
}
.info-header {
  font-family: "Kanit", "Cinzel Decorative", serif;
  font-size: 1.1rem; color: var(--fire-yellow);
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.info-body { font-size: 0.85rem; line-height: 1.8; color: #b89a6a; }
.gold-text { color: var(--fire-yellow); font-weight: bold; text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.info-highlight { color: #e8d5b0; font-weight: bold; }
.info-sub { font-size: 0.8rem; color: #8a7a5a; }

/* =======================================
   POPUP MODAL
======================================= */
.popup { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup.hidden { display: none; }

.popup-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: backdropFadeIn 0.3s ease;
}
@keyframes backdropFadeIn { from { opacity: 0; } to { opacity: 1; } }

.popup-box {
  position: relative;
  background: linear-gradient(160deg, #1a1025 0%, #0d0d1a 50%, #1a0a2e 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 24px; padding: 32px 24px;
  width: 100%; max-width: 380px; text-align: center;
  animation: popupAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 40px rgba(255, 106, 0, 0.2), 0 0 80px rgba(107, 29, 158, 0.1),
              inset 0 1px 0 rgba(255, 215, 0, 0.2);
  overflow: hidden;
}
.popup-box::before {
  content: '';
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.05), transparent, rgba(255, 106, 0, 0.05), transparent);
  animation: popupRotateGlow 6s linear infinite;
  z-index: 0;
}
@keyframes popupRotateGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes popupAppear {
  from { transform: scale(0.5) translateY(40px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.popup-dragon {
  position: relative; z-index: 1;
  margin-bottom: 16px;
  animation: popupDragonFloat 2s ease-in-out infinite;
}
.popup-dragon img {
  width: 160px; height: 160px; object-fit: contain;
  filter: drop-shadow(0 0 30px var(--dragon-glow, rgba(255, 106, 0, 0.6)));
}
@keyframes popupDragonFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.popup-title {
  position: relative; z-index: 1;
  font-family: "Kanit", "Cinzel Decorative", serif;
  font-size: 1.4rem; font-weight: 700; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--fire-orange), var(--fire-yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.popup-rarity {
  position: relative; z-index: 1;
  font-size: 0.85rem; letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 12px; padding: 4px 16px;
  display: inline-block; border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.05);
}
.popup-reward {
  position: relative; z-index: 1;
  font-family: "Kanit", "Cinzel Decorative", serif;
  font-size: 2rem; font-weight: 900;
  color: var(--fire-yellow); margin: 12px 0;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  animation: rewardPulse 1.5s ease-in-out infinite;
}
@keyframes rewardPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  50% { transform: scale(1.05); text-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}
.popup-desc {
  position: relative; z-index: 1;
  font-size: 0.85rem; color: #b89a6a;
  margin-bottom: 20px; line-height: 1.6; font-style: italic;
}
.popup-btn {
  position: relative; z-index: 1;
  background: linear-gradient(135deg, var(--fire-orange), var(--fire-red));
  color: #fff; border: none;
  padding: 14px 40px;
  font-family: "Kanit", "Cinzel Decorative", serif;
  font-size: 1rem; font-weight: 700;
  border-radius: 50px;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 34, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 1px;
}
.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 34, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.popup-btn:active { transform: translateY(0); }

/* =======================================
   CONFETTI & STARS
======================================= */
.confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  width: 100%; height: 100%;
}
.rarity-stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.rarity-star {
  font-size: 1.2rem;
  animation: starPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0; transform: scale(0);
}
.rarity-star:nth-child(1) { animation-delay: 0.1s; }
.rarity-star:nth-child(2) { animation-delay: 0.2s; }
.rarity-star:nth-child(3) { animation-delay: 0.3s; }
.rarity-star:nth-child(4) { animation-delay: 0.4s; }
.rarity-star:nth-child(5) { animation-delay: 0.5s; }
@keyframes starPop {
  0% { opacity: 0; transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.3) rotate(10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Sparkles */
.sparkle {
  position: absolute; width: 4px; height: 4px;
  background: var(--fire-yellow); border-radius: 50%;
  pointer-events: none; z-index: 50;
  animation: sparkleAnim 0.6s ease-out forwards;
}
@keyframes sparkleAnim {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* =======================================
   REWARD TABLE BUTTON
======================================= */
.reward-btn-wrap {
  display: flex; justify-content: center;
  margin: 0 0 10px;
}
.reward-table-btn {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--fire-yellow);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 9px 26px;
  font-family: "Kanit", serif;
  font-size: 0.88rem; font-weight: 600;
  border-radius: 50px;
  cursor: pointer; transition: all 0.25s ease;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.12);
}
.reward-table-btn:hover {
  background: linear-gradient(135deg, #2a1a45, #1e1040);
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}
.reward-table-btn:active { transform: translateY(0); }

/* =======================================
   REWARD TABLE MODAL
======================================= */
.reward-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.reward-modal.hidden { display: none; }

.reward-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  animation: backdropFadeIn 0.25s ease;
}

.reward-modal-box {
  position: relative; z-index: 1;
  background: linear-gradient(160deg, #1a1025 0%, #0d0d1a 60%, #1a0a2e 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  width: 100%; max-width: 420px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: popupAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 50px rgba(255, 106, 0, 0.18), 0 0 100px rgba(107, 29, 158, 0.1);
  overflow: hidden;
}

.reward-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  flex-shrink: 0;
}
.reward-modal-title {
  font-family: "Kanit", "Cinzel Decorative", serif;
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--fire-orange), var(--fire-yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: 1px;
}
.reward-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #aaa; border-radius: 50%;
  width: 32px; height: 32px; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.reward-modal-close:hover { background: rgba(255, 60, 60, 0.2); color: #ff6060; border-color: rgba(255, 60, 60, 0.4); }

.reward-modal-body {
  overflow-y: auto; padding: 12px 14px 18px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}
.reward-modal-body::-webkit-scrollbar { width: 4px; }
.reward-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.3); border-radius: 4px; }

/* Individual reward rows */
.reward-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}
.reward-row:hover { background: rgba(255, 215, 0, 0.05); border-color: rgba(255, 215, 0, 0.15); }
.reward-row.is-loss { opacity: 0.65; }

.reward-row-img {
  width: 48px; height: 48px; object-fit: contain;
  filter: drop-shadow(0 0 6px var(--row-glow, rgba(255,106,0,0.4)));
  flex-shrink: 0;
}
.reward-row-info { flex: 1; min-width: 0; }
.reward-row-name {
  font-family: "Kanit", serif; font-size: 0.9rem; font-weight: 600;
  color: #e8d5b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reward-row-element {
  font-size: 0.72rem; color: #8a7a6a; margin-top: 1px;
}
.reward-row-rarity {
  font-size: 0.7rem; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid; background: rgba(0,0,0,0.2);
  white-space: nowrap; flex-shrink: 0;
}
.reward-row-amount {
  font-family: "Kanit", serif; font-weight: 800;
  font-size: 1rem; text-align: right;
  white-space: nowrap; flex-shrink: 0;
  min-width: 64px;
}
.reward-row.is-loss .reward-row-amount { color: #888; }

/* =======================================
   RESPONSIVE
======================================= */
@media (max-width: 380px) {
  .eggs-grid { gap: 10px; padding: 5px; }
  .egg-img-wrap { width: 65px; height: 85px; }
  .title { font-size: 1.8rem; }
  .hatch-egg-container { width: 130px; height: 165px; }
}
@media (min-width: 600px) {
  .eggs-grid { gap: 24px; }
  .egg-img-wrap { width: 95px; height: 120px; }
  .hatch-egg-container { width: 180px; height: 230px; }
}
