/* ============================================================
   《摧毁吧！铜墙铁壁》 - 卡通糖果风样式
   竖屏手机优先，桌面端居中显示竖屏画布
   ============================================================ */

/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* ---------------- 设计变量 ---------------- */
:root {
  --c-primary: #FF5A3C;
  --c-accent: #FFB020;
  --c-sky: #87CEEB;
  --c-cream: #FFF8E7;
  --c-text: #3D2C1E;
  --c-green: #4CAF50;
  --c-red: #F44336;
  --c-gold: #FFD700;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-card: 0 8px 24px rgba(61, 44, 30, 0.18);
  --outline: -2px -2px 0 #3D2C1E, 2px -2px 0 #3D2C1E, -2px 2px 0 #3D2C1E, 2px 2px 0 #3D2C1E,
             -2px 0 0 #3D2C1E, 2px 0 0 #3D2C1E, 0 -2px 0 #3D2C1E, 0 2px 0 #3D2C1E;
}

/* ---------------- 基础重置 ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--c-text);
  user-select: none;
  -webkit-user-select: none;
  background: #2B3A4A;
}

button { font-family: inherit; border: none; outline: none; cursor: pointer; }

.hidden { display: none !important; }

/* ---------------- 屏幕系统（竖屏容器） ---------------- */
.screen {
  position: fixed;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: 100%;
  overflow: hidden;
  display: none;
}
.screen.active { display: block; }

#game-canvas {
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}

/* 桌面端：手机框效果 */
@media (min-width: 560px) {
  .screen {
    top: 24px; bottom: 24px;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 8px #1E2937, 0 0 0 10px #3D4F63;
    overflow: hidden;
  }
}

/* ============================================================
   糖果按钮
   ============================================================ */
.btn-candy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #FF7A5C 0%, #FF5A3C 100%);
  color: #fff;
  font-weight: 800;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 5px 0 #C93A20, 0 10px 18px rgba(201, 58, 32, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.btn-candy:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #C93A20, 0 4px 10px rgba(201, 58, 32, 0.3);
}

.btn-xl { width: 78%; height: 58px; font-size: 21px; }
.btn-lg { width: 100%; height: 50px; font-size: 18px; }
.btn-md { height: 44px; padding: 0 22px; font-size: 15px; }

.egg-btn {
  background: linear-gradient(180deg, #FF86B3 0%, #F0437F 100%);
  box-shadow: 0 5px 0 #B92B5E, 0 10px 18px rgba(185, 43, 94, 0.35);
}
.egg-btn:active { box-shadow: 0 1px 0 #B92B5E, 0 4px 10px rgba(185, 43, 94, 0.3); }

.pet-btn {
  background: linear-gradient(180deg, #7ED47E 0%, #43A047 100%);
  box-shadow: 0 5px 0 #2E7D32, 0 10px 18px rgba(46, 125, 50, 0.35);
}
.pet-btn:active { box-shadow: 0 1px 0 #2E7D32, 0 4px 10px rgba(46, 125, 50, 0.3); }

/* ============================================================
   开始界面
   ============================================================ */
.start-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #6EC6F5 0%, #87CEEB 40%, #BDE8FF 75%, #DFF6E8 100%);
  overflow: hidden;
}

.bg-cloud {
  position: absolute;
  width: 120px; height: 40px;
  background: #fff;
  border-radius: 999px;
  opacity: 0.9;
  animation: cloudDrift 26s linear infinite;
}
.bg-cloud::before, .bg-cloud::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.bg-cloud::before { width: 50px; height: 50px; top: -24px; left: 22px; }
.bg-cloud::after { width: 36px; height: 36px; top: -16px; left: 62px; }
.bg-cloud.c1 { top: 8%; left: -60px; animation-duration: 30s; }
.bg-cloud.c2 { top: 18%; left: -140px; animation-duration: 22s; animation-delay: -8s; }
.bg-cloud.c3 { top: 30%; left: -100px; animation-duration: 36s; animation-delay: -16s; }

@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 300px)); }
}

.bg-grass {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, #8ED66F 0%, #6FBF54 100%);
  border-radius: 50% 50% 0 0 / 30px 30px 0 0;
}

.bg-float {
  position: absolute;
  font-size: 34px;
  opacity: 0.55;
  animation: floatY 4.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}
.bg-float.b1 { left: 10%; top: 26%; animation-delay: -0.5s; }
.bg-float.b2 { right: 12%; top: 20%; animation-delay: -1.8s; }
.bg-float.b3 { left: 16%; top: 48%; animation-delay: -3s; }
.bg-float.b4 { right: 16%; top: 44%; animation-delay: -2.2s; }

@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-16px) rotate(8deg); }
}

.start-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  z-index: 2;
}

.start-icon {
  font-size: 62px;
  animation: iconBounce 2.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(201, 58, 32, 0.4));
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.06); }
}

.game-title {
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--c-accent);
  text-shadow: var(--outline), 0 7px 0 rgba(61, 44, 30, 0.28);
  letter-spacing: 2px;
}
.game-title .title-big {
  font-size: 52px;
  color: #fff;
  text-shadow: var(--outline), 0 8px 0 rgba(61, 44, 30, 0.28);
}

.start-badges {
  display: flex;
  gap: 12px;
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(61, 44, 30, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}

.start-progress {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 4px rgba(61, 44, 30, 0.5);
  min-height: 18px;
}

.start-row {
  display: flex;
  gap: 14px;
  width: 78%;
}
.start-row .btn-candy { flex: 1; }

.start-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(61, 44, 30, 0.5);
  letter-spacing: 1px;
}

/* ============================================================
   游戏 HUD
   ============================================================ */
.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 12px 0;
  padding-top: max(12px, env(safe-area-inset-top));
  pointer-events: none;
  z-index: 10;
}

.hud-left, .hud-right {
  display: flex;
  gap: 8px;
  flex-direction: column;
}
.hud-right { align-items: flex-end; }

.currency-item, .level-chip, .wall-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  background: rgba(61, 44, 30, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}
.hud-left { flex-direction: row; }

.level-chip b { font-size: 17px; color: var(--c-gold); }
.wall-chip { font-size: 13px; }

/* ---------------- 墙体血条 ---------------- */
.wall-hp {
  position: absolute;
  top: 76px;
  top: calc(76px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(76%, 320px);
  z-index: 10;
  pointer-events: none;
  animation: hpIn 0.3s ease-out;
}
@keyframes hpIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.wall-hp-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 2px 3px rgba(61, 44, 30, 0.6);
}

.wall-hp-track {
  height: 18px;
  background: rgba(61, 44, 30, 0.75);
  border: 3px solid #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.wall-hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ED47E, #43A047);
  transition: width 0.15s ease-out, background 0.3s;
}
.wall-hp-fill.mid { background: linear-gradient(180deg, #FFD54F, #FFB020); }
.wall-hp-fill.low { background: linear-gradient(180deg, #FF7A5C, #E53935); }

/* ---------------- 飘字 ---------------- */
.float-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}
.float-item {
  position: absolute;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: var(--outline);
  animation: floatUp 1.15s ease-out forwards;
  white-space: nowrap;
}
.float-item.hit { font-size: 17px; color: #FFE0B2; }
.float-item.coin { color: var(--c-gold); }
.float-item.exp { color: #B39DDB; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-85px) scale(1); }
}

/* ---------------- 底部 TNT 状态栏 ---------------- */
.hud-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 14px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
  z-index: 10;
}

.tnt-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(61, 44, 30, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

.tnt-icon {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(158, 158, 158, 0.9));
  transition: filter 0.4s;
}
.tnt-icon.rainbow { animation: hueSpin 3s linear infinite; }
@keyframes hueSpin {
  from { filter: drop-shadow(0 0 10px #FF0000) hue-rotate(0deg); }
  to { filter: drop-shadow(0 0 10px #FF0000) hue-rotate(360deg); }
}

.tnt-info { flex: 1; min-width: 0; }

.tnt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.tnt-level { font-size: 13px; font-weight: 800; color: #fff; }
.tnt-power { font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.tnt-power b { font-size: 13px; color: var(--c-gold); }

.tnt-exp-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.tnt-exp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FFB020, #FF7A5C);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

.pet-boost {
  flex-shrink: 0;
  padding: 5px 10px;
  background: rgba(255, 176, 32, 0.22);
  border: 1.5px solid rgba(255, 199, 95, 0.6);
  border-radius: 999px;
  color: #FFD180;
  font-size: 12px;
  font-weight: 800;
}

.tap-hint {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(61, 44, 30, 0.6);
  animation: hintPulse 1.4s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* ---------------- 侧边按钮 ---------------- */
.side-buttons {
  position: absolute;
  right: 10px;
  top: 150px;
  top: calc(150px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 12;
}
.side-btn {
  width: 52px; height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 2.5px solid var(--c-text);
  border-radius: 16px;
  box-shadow: 0 4px 0 rgba(61, 44, 30, 0.8);
  color: var(--c-text);
  transition: transform 0.08s;
}
.side-btn small { font-size: 9px; font-weight: 800; }
.side-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(61, 44, 30, 0.8); }

/* ---------------- 声音按钮 ---------------- */
.sound-buttons {
  position: absolute;
  left: 10px;
  bottom: 108px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 12;
}
.sound-btn {
  width: 44px; height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(61, 44, 30, 0.66);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  color: #fff;
  font-size: 16px;
  backdrop-filter: blur(4px);
}
.sound-btn small { font-size: 8px; font-weight: 700; }
.sound-btn.off { opacity: 0.45; }
.sound-btn.off span { text-decoration: line-through; }

/* ---------------- TNT 升级特效 ---------------- */
.tnt-levelup {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 30px;
  background: rgba(61, 44, 30, 0.85);
  border: 3px solid var(--c-gold);
  border-radius: 22px;
  z-index: 20;
  pointer-events: none;
  animation: levelupPop 1.8s ease-out forwards;
  box-shadow: 0 0 34px rgba(255, 215, 0, 0.55);
}
.levelup-icon { font-size: 38px; }
.levelup-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--c-gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.levelup-color { font-size: 15px; font-weight: 800; color: #fff; }

@keyframes levelupPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.3); }
  55% { opacity: 1; transform: translateX(-50%) scale(1.12); }
  70% { transform: translateX(-50%) scale(1); }
  85% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-34px); }
}

/* ============================================================
   弹窗系统
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 25, 15, 0.55);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(92%, 400px);
  max-height: 86%;
  overflow-y: auto;
  background: var(--c-cream);
  border: 3px solid var(--c-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 0 6px rgba(255, 255, 255, 0.5);
  padding: 20px;
  animation: cardPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cardPop {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--c-primary);
  text-shadow: 0 2px 0 rgba(61, 44, 30, 0.15);
  margin-bottom: 14px;
}

/* ---------------- 面板头 ---------------- */
.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.panel-header h3 {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
}
.panel-coin {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(255, 176, 32, 0.18);
  border: 2px solid rgba(232, 162, 32, 0.5);
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}
.panel-close {
  width: 32px; height: 32px;
  flex-shrink: 0;
  background: var(--c-red);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  border: 2.5px solid var(--c-text);
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(61, 44, 30, 0.7);
}
.panel-close:active { transform: translateY(2px); box-shadow: none; }

/* ---------------- 通关结算 ---------------- */
.clear-card { text-align: center; overflow: visible; }

.clear-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35) 0%, transparent 65%);
  animation: glowPulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.clear-trophy {
  font-size: 92px;
  line-height: 1.1;
  animation: trophyBounce 1.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(255, 176, 32, 0.6));
}
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
  50% { transform: translateY(-14px) rotate(6deg) scale(1.08); }
}

.clear-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border: 2px solid #EADFC8;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
}
.stat-row b { font-size: 18px; }
.stat-coin { color: #E8A200; }
.stat-exp { color: #7E57C2; }
.stat-trophy { color: var(--c-primary); }

/* ---------------- 砸金蛋面板 ---------------- */
.egg-list {
  display: flex;
  gap: 10px;
}

.egg-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 18px 6px 12px;
  background: #fff;
  border: 2.5px solid #C97B4A;
  border-radius: var(--radius-md);
}
.egg-item.tier-bronze { border-color: #C97B4A; background: linear-gradient(180deg, #FFF6EC, #FFE7D1); }
.egg-item.tier-silver { border-color: #8C99A6; background: linear-gradient(180deg, #F4F8FB, #E2EAF2); }
.egg-item.tier-gold {
  border-color: #E8B93E;
  background: linear-gradient(180deg, #FFF8E1, #FFEFC0);
  animation: goldGlow 1.6s ease-in-out infinite;
}
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 200, 60, 0.4); }
  50% { box-shadow: 0 0 26px rgba(255, 200, 60, 0.85); }
}

.egg-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #C97B4A;
  border: 2px solid var(--c-text);
  border-radius: 999px;
  white-space: nowrap;
}
.tier-silver .egg-badge { background: #8C99A6; }
.tier-gold .egg-badge { background: #E8A200; }

.egg-emoji {
  font-size: 46px;
  line-height: 1.1;
  animation: eggIdle 2s ease-in-out infinite;
}
.tier-gold .egg-emoji { font-size: 54px; }
@keyframes eggIdle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.06); }
}

.egg-boost {
  font-size: 11px;
  font-weight: 800;
  color: #B26A3B;
}
.tier-silver .egg-boost { color: #64748B; }
.tier-gold .egg-boost { color: #C48A00; }

.btn-egg {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-width: 2.5px;
  box-shadow: 0 3px 0 #C93A20;
}
.btn-egg:active { box-shadow: 0 1px 0 #C93A20; }

.egg-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: #9C8A73;
}

/* ---------------- 开蛋结果 ---------------- */
.egg-result-card { text-align: center; min-height: 300px; }

.egg-crack-wrap {
  position: relative;
  padding: 36px 0 20px;
}
.egg-crack {
  font-size: 108px;
  line-height: 1.1;
  animation: eggShake 0.35s ease-in-out infinite;
}
@keyframes eggShake {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}
.hammer {
  position: absolute;
  top: -14px;
  right: 26%;
  font-size: 58px;
  transform-origin: 80% 80%;
  animation: hammerSwing 0.7s ease-in-out infinite;
}
@keyframes hammerSwing {
  0%, 100% { transform: rotate(-52deg); }
  55% { transform: rotate(28deg); }
  70% { transform: rotate(20deg); }
}
.crack-text {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #B26A3B;
}

.egg-reveal { animation: cardPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

.egg-result-pet {
  font-size: 96px;
  line-height: 1.15;
  animation: petReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 12px rgba(61, 44, 30, 0.25));
}
@keyframes petReveal {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0); }
}

.egg-result-name {
  font-size: 22px;
  font-weight: 900;
  margin-top: 4px;
}

.egg-result-rarity {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  border: 2px solid var(--c-text);
  border-radius: 999px;
}
.rarity-common { background: var(--c-green); }
.rarity-rare { background: #2196F3; }
.rarity-legend { background: linear-gradient(180deg, #FFD54F, #E8A200); }

.egg-result-boost {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 900;
  color: #E8532B;
}

.egg-result-dup {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #9C8A73;
  background: #F2EADA;
  border-radius: 999px;
  padding: 5px 12px;
}

#egg-result-close { margin-top: 16px; min-width: 140px; }

/* ---------------- 宠物袋 ---------------- */
.pet-panel-card { padding-bottom: 12px; }

.pet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.pet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  background: #fff;
  border: 2px solid #EADFC8;
  border-radius: 14px;
  position: relative;
}
.pet-card.owned { border-color: #C97B4A; box-shadow: 0 3px 8px rgba(201, 123, 74, 0.25); }
.pet-card.owned.tier-1 { border-color: #8C99A6; box-shadow: 0 3px 8px rgba(140, 153, 166, 0.3); }
.pet-card.owned.tier-2 { border-color: #E8B93E; box-shadow: 0 3px 10px rgba(232, 185, 62, 0.4); }
.pet-card.locked { opacity: 0.5; }
.pet-card.locked .pet-emoji { filter: grayscale(1) brightness(0.6); }

.pet-emoji { font-size: 34px; line-height: 1.15; }
.pet-name {
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pet-card.locked .pet-name { color: #B0A48F; }
.pet-boost-num { font-size: 11px; font-weight: 800; color: #E8532B; }
.pet-card.locked .pet-boost-num { color: #B0A48F; }

.pet-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--c-text);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.pet-total-bar b { font-size: 19px; color: var(--c-gold); }

/* ---------------- 全局提示 ---------------- */
.float-tip {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  padding: 12px 24px;
  background: rgba(61, 44, 30, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  animation: tipIn 0.25s ease-out;
  pointer-events: none;
}
@keyframes tipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------------- 小屏适配 ---------------- */
@media (max-height: 640px) {
  .start-icon { font-size: 48px; }
  .game-title { font-size: 28px; }
  .game-title .title-big { font-size: 42px; }
  .btn-xl { height: 50px; font-size: 18px; }
  .clear-trophy { font-size: 72px; }
  .side-buttons { top: 130px; }
}
