/* =========================================================================
 * style.css  —  砸金蛋课堂互动游戏（静态克隆版）
 * 仅补充 Tailwind CDN 未覆盖的自定义视觉：金蛋造型、动画、渐变文字。
 * 其余布局沿用原版 Tailwind 类名（在 index.html 中通过 tailwind.config 配置）。
 * ========================================================================= */

:root {
  --egg-gold-1: #fde047;
  --egg-gold-2: #f59e0b;
  --egg-gold-3: #d97706;
}

/* 原版 ResultCard.tsx 使用的 .gradient-text */
.gradient-text {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* 原版 ResultCard.tsx 使用的 .bounce-in 入场动画 */
@keyframes bounce-in {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
.bounce-in { animation: bounce-in 0.4s ease-out; }

/* 金蛋按钮视觉 */
.golden-egg {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 35% 30%, var(--egg-gold-1) 0%, var(--egg-gold-2) 55%, var(--egg-gold-3) 100%);
  box-shadow: inset -6px -8px 14px rgba(146, 64, 14, 0.45),
              inset 6px 6px 12px rgba(255, 255, 255, 0.55),
              0 8px 18px rgba(217, 119, 6, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff8e1;
  text-shadow: 0 1px 2px rgba(146, 64, 14, 0.6);
}
.golden-egg::before {
  /* 蛋身上的一道高光纹 */
  content: "";
  position: absolute;
  top: 18%;
  left: 22%;
  width: 26%;
  height: 50%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(-18deg);
}
.golden-egg:hover:not(:disabled) { transform: translateY(-4px) scale(1.04); }
.golden-egg:active:not(:disabled) { transform: scale(0.96); }

.golden-egg.is-opened {
  background: radial-gradient(circle at 35% 30%, #fca5a5 0%, #ef4444 60%, #b91c1c 100%);
  cursor: default;
  box-shadow: inset -6px -8px 14px rgba(127, 29, 29, 0.45),
              inset 6px 6px 12px rgba(255, 255, 255, 0.4),
              0 4px 10px rgba(185, 28, 28, 0.3);
}
.golden-egg.is-bonus {
  background: radial-gradient(circle at 35% 30%, #fbcfe8 0%, #ec4899 55%, #be185d 100%);
  box-shadow: inset -6px -8px 14px rgba(157, 23, 77, 0.45),
              inset 6px 6px 12px rgba(255, 255, 255, 0.5),
              0 8px 18px rgba(236, 72, 153, 0.35);
}

/* 砸金蛋时的碎裂动画 */
@keyframes crack {
  0%   { transform: scale(1) rotate(0); }
  40%  { transform: scale(1.15) rotate(-6deg); }
  100% { transform: scale(1) rotate(0); }
}
.golden-egg.cracking { animation: crack 0.35s ease; }

/* 弹窗遮罩 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(41, 37, 36, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 50;
  backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%; max-width: 28rem;
  background: #fff; border-radius: 1rem;
  padding: 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

/* 隐藏类 */
.hidden { display: none !important; }

/* 简洁 toast */
.toast-wrap {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
}
.toast {
  background: #292524; color: #fff; padding: 0.6rem 1rem; border-radius: 0.5rem;
  font-size: 0.9rem; box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  animation: bounce-in 0.3s ease;
}
.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }
