/* ============================================================
   adventure.css — 整屏冒险场景 + 胜利结算升级
   自包含：只给冒险地图/庆祝弹窗做糖果风视觉，不改全站主题。
   （原依赖 theme-candy.css 的糖果色变量，现内联于此，无需换肤）
   ============================================================ */
:root {
  --candy-gold-hi: #FFD54F;  --candy-gold-lo: #FFA000;  --candy-gold-edge: #C87800;
  --candy-red-hi: #FF7A59;   --candy-red-lo: #F04E3E;   --candy-red-edge: #B33224;
  --candy-green-hi: #8BE06A; --candy-green-lo: #4FAE30; --candy-green-edge: #37831E;
}

/* ---------- 场景容器 ---------- */
.adv-scene {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 28px;
  border: 4px solid #fff;
  overflow: hidden;
  background: linear-gradient(180deg, #6BC8FF 0%, #9FDFFF 42%, #C9F0FF 55%);
  box-shadow: 0 8px 0 rgba(46, 125, 180, 0.22), 0 18px 26px -14px rgba(0, 60, 120, 0.35);
}

/* 太阳与云 */
.adv-sun {
  position: absolute; top: 26px; right: 26px;
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #FFF6C8, #FFD84D 70%, #FFB300);
  box-shadow: 0 0 34px 10px rgba(255, 216, 77, 0.55);
}
.adv-cloud {
  position: absolute; height: 34px; width: 96px;
  animation: adv-cloudmove 10s ease-in-out infinite;
}
.adv-cloud::before, .adv-cloud::after {
  content: ''; position: absolute; bottom: 0; background: #fff; border-radius: 50%;
}
.adv-cloud::before { left: 0; width: 40px; height: 26px; }
.adv-cloud::after { left: 24px; width: 52px; height: 36px; }
@keyframes adv-cloudmove { 0%,100% { transform: translateX(0) } 50% { transform: translateX(20px) } }

/* 山丘（三层大椭圆） */
.adv-hill { position: absolute; border-radius: 50%; }
.adv-hill.h1 { width: 150%; height: 320px; left: -25%; background: linear-gradient(180deg, #9ADB6E, #6FC148); }
.adv-hill.h2 { width: 140%; height: 340px; left: -45%; background: linear-gradient(180deg, #7FCB57, #55A836); }
.adv-hill.h3 { width: 145%; height: 360px; right: -50%; background: linear-gradient(180deg, #6FBF4A, #4E9C31); }

/* 顶部进度胶囊 */
.adv-banner {
  position: absolute; z-index: 20; top: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95); border: 3px solid #fff; border-radius: 999px;
  padding: 7px 18px; font-family: var(--font-cute); font-size: 16px; color: #2E7DB4;
  box-shadow: 0 5px 0 rgba(27, 119, 188, 0.25); white-space: nowrap;
}

/* ---------- 关卡节点 ---------- */
.adv-node { position: absolute; z-index: 10; transform: translate(-50%, -50%); text-align: center; }
.adv-stone {
  width: 54px; height: 54px; margin: 0 auto;
  border-radius: 18px; border: 4px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.adv-node.done .adv-stone {
  background: linear-gradient(180deg, var(--candy-green-hi), var(--candy-green-lo));
  box-shadow: 0 6px 0 var(--candy-green-edge), 0 12px 18px -8px rgba(30, 100, 20, 0.6);
  color: #fff;
}
.adv-node.current .adv-stone {
  width: 66px; height: 66px; border-radius: 22px; font-size: 31px;
  background: linear-gradient(180deg, var(--candy-gold-hi), var(--candy-gold-lo));
  box-shadow: 0 8px 0 var(--candy-gold-edge), 0 16px 24px -8px rgba(200, 120, 0, 0.6);
  animation: adv-glowpulse 2.2s infinite;
}
.adv-node.upcoming .adv-stone {
  background: linear-gradient(180deg, #C9BCAE, #A08F7E);
  box-shadow: 0 6px 0 #7A6B5B;
  opacity: .95;
}
.adv-stone:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.3) !important; }
@keyframes adv-glowpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,194,61,.55), 0 8px 0 var(--candy-gold-edge); }
  50% { box-shadow: 0 0 0 16px rgba(255,194,61,0), 0 8px 0 var(--candy-gold-edge); }
}

/* 节点标签 */
.adv-label {
  margin-top: 8px; display: inline-block;
  background: #fff; border-radius: 11px; padding: 3px 10px;
  font-size: 12px; font-weight: 900; color: #4E7A2E;
  box-shadow: 0 3px 8px -4px rgba(0, 0, 0, 0.3); white-space: nowrap;
}
.adv-node.upcoming .adv-label { color: #8A7266; background: rgba(255, 255, 255, 0.9); }

/* 当前节点的去打卡按钮 */
.adv-go {
  margin-top: 9px; display: inline-block; cursor: pointer;
  background: linear-gradient(180deg, var(--candy-red-hi), var(--candy-red-lo));
  border: 3px solid #fff; border-radius: 999px; padding: 7px 18px;
  font-family: var(--font-cute); font-size: 15px; color: #fff;
  box-shadow: 0 5px 0 var(--candy-red-edge), 0 10px 16px -6px rgba(240, 78, 62, 0.6);
  transition: transform .08s, box-shadow .08s;
}
.adv-go:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--candy-red-edge); }

/* 站在当前关卡上的宠物（复用你的 .mascot 精灵图） */
.adv-pet {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 2px);
  animation: adv-jump 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes adv-jump {
  0%,100% { transform: translateX(-50%) translateY(0) }
  40% { transform: translateX(-50%) translateY(-14px) }
  55% { transform: translateX(-50%) translateY(-14px) }
  90% { transform: translateX(-50%) translateY(0) }
}

/* 终点宝箱 */
.adv-chest { position: absolute; z-index: 10; transform: translate(-50%, -50%); text-align: center; }
.adv-chest .box { font-size: 40px; filter: drop-shadow(0 5px 5px rgba(30, 80, 20, 0.4)); }
.adv-chest .lbl {
  display: inline-block; background: rgba(255,255,255,.92); border-radius: 10px;
  padding: 2px 9px; font-size: 11px; font-weight: 900; color: #7A5210;
}

/* ready：全部任务完成，宝箱可开 —— 金光 + 蹦跳吸引点击 */
.adv-chest.ready .box {
  cursor: pointer;
  animation: adv-chest-bounce 1.3s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 213, 79, 0.95)) drop-shadow(0 5px 5px rgba(30, 80, 20, 0.4));
}
.adv-chest.ready .lbl {
  cursor: pointer;
  background: linear-gradient(180deg, var(--candy-gold-hi), var(--candy-gold-lo));
  border: 2px solid #fff; color: #7A4A00; font-size: 12px;
  box-shadow: 0 4px 0 var(--candy-gold-edge);
}
@keyframes adv-chest-bounce {
  0%, 100% { transform: translateY(0) scale(1) }
  30% { transform: translateY(-10px) scale(1.06) }
  50% { transform: translateY(0) scale(1) }
  65% { transform: translateY(-4px) }
  80% { transform: translateY(0) }
}

/* opened：宝箱位置常驻展示今日开出的奖品 */
.adv-chest.opened .box { animation: adv-prize-glow 2s ease-in-out infinite; }
@keyframes adv-prize-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.6)) drop-shadow(0 5px 5px rgba(30, 80, 20, 0.4)) }
  50% { filter: drop-shadow(0 0 16px rgba(255, 213, 79, 0.95)) drop-shadow(0 5px 5px rgba(30, 80, 20, 0.4)) }
}

/* ============================================================
   开箱揭晓弹窗（复用 .celebration/.celeb-content 结算视觉）
   阶段一 opening：宝箱摇晃蓄力；阶段二 done：奖品弹出
   ============================================================ */
.chest-shake { font-size: 96px; margin: 26px 0 18px; animation: chest-shake .6s ease-in-out infinite; }
@keyframes chest-shake {
  0%, 100% { transform: rotate(0) }
  20% { transform: rotate(-9deg) scale(1.05) }
  40% { transform: rotate(9deg) scale(1.05) }
  60% { transform: rotate(-6deg) }
  80% { transform: rotate(6deg) }
}
.chest-prize-icon {
  font-size: 84px; margin: 8px 0 2px; line-height: 1.2;
  filter: drop-shadow(0 6px 10px rgba(120, 40, 0, 0.4));
  animation: celeb-star-pop .55s cubic-bezier(.34, 1.56, .64, 1) both;
}
.chest-opening-hint { font-size: 14px; color: #FFE8D6; font-weight: 700; }

/* ============================================================
   胜利结算升级（配合 theme-candy.css 的 .celeb 覆盖使用）
   在 celeb-box 里 celeb-icon 之前插入：
   <div class="celeb-stars"><span>⭐</span><span>⭐</span><span>⭐</span></div>
   ============================================================ */
.celeb-stars { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 78px; margin-bottom: 4px; }
.celeb-stars span { font-size: 46px; filter: drop-shadow(0 5px 4px rgba(150, 60, 0, 0.45)); animation: celeb-star-pop .5s ease-out both; }
.celeb-stars span:nth-child(1) { animation-delay: .1s; }
.celeb-stars span:nth-child(2) { font-size: 64px; animation-delay: .35s; }
.celeb-stars span:nth-child(3) { animation-delay: .6s; }
@keyframes celeb-star-pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 彩带：在 celeb-box 里插入 <div class="celeb-confetti"></div>（绝对定位铺满） */
.celeb-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.celeb-confetti::before, .celeb-confetti::after {
  content: ''; position: absolute; top: -20px; width: 10px; height: 15px; border-radius: 2px;
  animation: celeb-fall 2.8s linear infinite;
}
.celeb-confetti::before { left: 18%; background: #FFD84D; }
.celeb-confetti::after { left: 74%; background: #8BE06A; animation-delay: 1.2s; animation-duration: 3.2s; }
@keyframes celeb-fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(560px) rotate(320deg); opacity: 0; }
}

/* ============================================================
   星星小精灵（.star-face）—— 纯 CSS 角色，子元素按百分比定位，
   任意尺寸自适应；由父容器设定 width/height。来自参考稿「小星灵」。
   ============================================================ */
.star-face { position: relative; width: 100%; height: 100%; }
.star-face .sf-body {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #FFF0BE, #FFC23D 68%, #F5A623);
  box-shadow: inset -4px -5px 9px rgba(200,120,0,.4), inset 3px 3px 7px rgba(255,255,255,.85), 0 7px 14px -5px rgba(240,160,20,.6);
}
.star-face .sf-hi { position: absolute; top: 15%; left: 18%; width: 31%; height: 20%; background: rgba(255,255,255,.75); border-radius: 50%; filter: blur(1px); }
.star-face .sf-eye { position: absolute; top: 40%; width: 13%; height: 19%; background: #3D2A20; border-radius: 50%; }
.star-face .sf-eye-l { left: 26%; }
.star-face .sf-eye-r { right: 26%; }
.star-face .sf-cheek { position: absolute; top: 61%; width: 15%; height: 9%; background: #FF9BB0; border-radius: 50%; }
.star-face .sf-cheek-l { left: 22%; }
.star-face .sf-cheek-r { right: 22%; }
.star-face .sf-spark { position: absolute; top: -14%; right: -4%; font-size: 12px; line-height: 1; animation: adv-sparkle 1.6s infinite; }
@keyframes adv-sparkle { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.35); opacity: .4 } }
.adv-star .sf-spark { font-size: 12px; }
.celeb-star .sf-spark { font-size: 16px; }

/* 冒险地图当前关卡上跳动的星星（替换原宠物精灵） */
.adv-pet.adv-star { width: 54px; height: 54px; }

/* ============================================================
   胜利结算升级 —— 打卡庆祝（参考稿「胜利结算」）
   ============================================================ */
.celebration .celeb-content {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 300px; max-width: 90vw;
  padding: 34px 22px 26px;
  border-radius: 34px;
  background: linear-gradient(180deg, #FF9E3D 0%, #FF7A3D 50%, #F04E6E 100%);
  border: 5px solid #fff;
  box-shadow: 0 24px 50px -18px rgba(120,30,20,.6);
  overflow: hidden;
}
.celeb-rays {
  position: absolute; top: 50%; left: 50%; width: 560px; height: 560px;
  margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,255,255,.20) 0 9deg, transparent 9deg 18deg);
  animation: adv-spinslow 22s linear infinite;
}
@keyframes adv-spinslow { to { transform: rotate(360deg); } }
.celeb-content > *:not(.celeb-rays):not(.celeb-confetti) { position: relative; z-index: 2; }
.celeb-banner-cn {
  margin: 6px auto 8px; display: inline-block;
  background: linear-gradient(180deg, #FFD54F, #FFA000);
  border: 5px solid #fff; border-radius: 24px; padding: 8px 28px;
  font-family: var(--font-cute); font-size: 26px; color: #7A4A00;
  box-shadow: 0 8px 0 #C87800, 0 18px 26px -10px rgba(120,50,0,.5);
  animation: celeb-star-pop .6s ease-out both .2s;
}
.celeb-subtext { font-size: 13px; color: #FFE8D6; font-weight: 700; margin-bottom: 10px; text-align: center; }
.celeb-star { width: 96px; height: 96px; margin: 6px auto 14px; flex-shrink: 0; align-self: center; animation: celeb-jump 1.6s ease-in-out infinite; }
/* 结算星星专用跳跃：不带 translateX（adv-jump 的 -50% 是给地图上 left:50% 定位的宠物回正用的，
   放在 flex 居中的结算弹窗里会把星星整体左移半个身位） */
@keyframes celeb-jump {
  0%,100% { transform: translateY(0) }
  40% { transform: translateY(-14px) }
  55% { transform: translateY(-14px) }
  90% { transform: translateY(0) }
}
.celeb-stars { align-self: center; }
.celeb-rewards { display: flex; justify-content: center; gap: 11px; }
.celeb-chip {
  background: #fff; border: 4px solid #fff; border-radius: 19px;
  padding: 9px 15px; text-align: center; box-shadow: 0 6px 0 rgba(150,50,30,.3);
}
.celeb-chip .ic { font-size: 24px; }
.celeb-chip .tx { font-family: var(--font-cute); font-size: 15px; }
