/* ─────────────────────────────────────────────────────────
   孩子端 · 首页
   与家长端刻意不同：深色夜空 + 明亮的龙，孩子每天愿意点开
   ───────────────────────────────────────────────────────── */

:root {
  --bg-top:   #1b3a86;
  --bg-mid:   #0d1a46;
  --bg-bot:   #060a1e;
  --text:     #f3ecff;
  --dim:      #a094c9;
  --card:     rgba(255, 255, 255, .055);
  --border:   rgba(255, 255, 255, .1);
  --gold:     #ffc23c;
  --in:       #5ee08a;
  --atk:      #ff7a7a;
  --hp:       #5ee08a;
  --spd:      #6fb8ff;
  --move:     #b08cff;
  --safe-b:   env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  /* 底色兜底：径向渐变的椭圆盖不满整个元素，没有 background-color 会露白 */
  background-color: #060a1e;
  background-image:
    radial-gradient(120% 62% at 50% -8%,
      #2f66d8 0%, #1b3a86 34%, #0d1a46 62%, #060a1e 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  min-height: 100vh;
}

button { font-family: inherit; color: inherit; border: none; background: none; }

/* ── 星空 ────────────────────────────────────────────── */

.sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.stars {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
}

.stars-a {
  background-image:
    radial-gradient(1.6px 1.6px at 20px 34px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 96px 72px,  rgba(255, 255, 255, .7),  transparent),
    radial-gradient(1.3px 1.3px at 148px 18px, rgba(255, 255, 255, .85), transparent),
    radial-gradient(1px 1px at 62px 128px, rgba(200, 210, 255, .55), transparent);
  background-size: 190px 165px;
  animation: twinkle 6s ease-in-out infinite alternate;
}

.stars-b {
  background-image:
    radial-gradient(1px 1px at 40px 20px,  rgba(255, 255, 255, .5), transparent),
    radial-gradient(1.4px 1.4px at 110px 60px, rgba(255, 245, 210, .6), transparent),
    radial-gradient(1px 1px at 170px 110px, rgba(255, 255, 255, .45), transparent);
  background-size: 230px 210px;
  animation: twinkle 9s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  from { opacity: .45; }
  to   { opacity: 1; }
}

/* ── 布局 ────────────────────────────────────────────── */

.wrap {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 18px calc(26px + var(--safe-b));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 顶部 HUD：等级 / 经验条 / 零花钱 / 积分 ─────────── */

.hud { padding: 14px 2px 0; }

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lv-badge {
  flex: none;
  padding: 4px 9px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #40260a;
  background: linear-gradient(180deg, #ffd76a, #f2a015);
  border: 1px solid #ffe7a0;
  box-shadow: 0 2px 0 #a86400, inset 0 1px 0 rgba(255, 255, 255, .65);
}

.exp-track {
  flex: 1;
  min-width: 36px;
  height: 12px;
  border-radius: 999px;
  background: rgba(4, 8, 26, .68);
  border: 1px solid rgba(255, 255, 255, .16);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
}

.exp-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #8ff07c, #37b348);
  box-shadow: 0 0 9px rgba(110, 235, 110, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: width .6s cubic-bezier(.34, 1.2, .64, 1);
}

.hud-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 6px;
  border-radius: 999px;
  background: rgba(4, 8, 26, .66);
  border: 1px solid rgba(255, 255, 255, .13);
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.hud-ico { font-size: 12px; line-height: 1; }

.chip-money b { color: var(--gold); }
.chip-point b { color: #8fd9ff; }

.hud-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-left: 2px;
}

.form-tag {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #eaf4ff;
  text-shadow: 0 0 14px rgba(120, 190, 255, .55);
}

.hud-hint {
  font-size: 11.5px;
  color: var(--dim);
}

/* ── 龙的舞台 + 左右入口 ─────────────────────────────── */

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 292px;
  padding: 4px 0 0;
  margin-top: 2px;
}

.side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 3;
}

.side-left  { left: -14px; }
.side-right { right: -14px; }

.side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 56px;
  padding: 8px 0 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(56, 100, 198, .82), rgba(16, 30, 74, .86));
  border: 1px solid rgba(150, 195, 255, .34);
  box-shadow: 0 3px 0 rgba(4, 10, 32, .65), inset 0 1px 0 rgba(255, 255, 255, .22);
  color: #e2edff;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}

.side-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(4, 10, 32, .65), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.side-icon {
  font-size: 21px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}

.side-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* 放大放在外层：#dragon 的 transform 归 JS 管（按形态调体型） */
.dragon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.46);
  transform-origin: 50% 70%;
}

/* 脚下投影，让它像站在地上而不是飘着 */
.dragon-wrap::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 50%;
  width: 140px;
  height: 24px;
  margin-left: -70px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(3, 8, 26, .66), transparent 72%);
  filter: blur(3px);
  z-index: -1;
}

.halo {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-glow, rgba(94, 224, 138, .35)) 0%, transparent 68%);
  filter: blur(6px);
  transition: background .6s ease;
  animation: halo-pulse 4.5s ease-in-out infinite;
}

@keyframes halo-pulse {
  0%, 100% { opacity: .8;  transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.07); }
}

/* 圣龙光环：16 道窄光，两端用 mask 淡出，否则会变成一圈灰棍子 */
.rays {
  position: absolute;
  width: 268px;
  height: 268px;
  border-radius: 50%;
  opacity: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 216, 120, .62) 0deg 3deg,
    rgba(255, 216, 120, 0) 3deg 22.5deg
  );
  -webkit-mask-image: radial-gradient(circle,
    transparent 26%, #000 40%, #000 64%, transparent 82%);
  mask-image: radial-gradient(circle,
    transparent 26%, #000 40%, #000 64%, transparent 82%);
  filter: blur(2.5px);
  transition: opacity .8s ease;
  animation: spin 30s linear infinite;
}

.rays.show { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

.dragon {
  position: relative;
  width: 216px;
  height: 216px;
  --c:      #5ee08a;
  --c-dark: #2f9e5c;
  --c-belly:#d5fbe0;
  --c-glow: rgba(94, 224, 138, .35);
  transform-origin: 50% 88%;
  animation: breathe 3.6s ease-in-out infinite;
  transition: transform .5s ease;
}

@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.025) translateY(-3px); }
}

.dragon-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-box: view-box;
}

/* ── 身体各部件 ──────────────────────────────────────── */

.body, .head { fill: var(--c); }
.belly       { fill: var(--c-belly); opacity: .85; }
.foot        { fill: var(--c-dark); }

/* 角：加一圈深色描边，否则金色形态上会糊进头部 */
.horn {
  fill: #fff0c4;
  stroke: var(--c-dark);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.horn-line {
  fill: none;
  stroke: #d9b45e;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: .7;
}

.fin         { fill: var(--c-dark); opacity: .9; }

.wing path {
  fill: var(--c-dark);
  opacity: .75;
}

.tail-path {
  fill: none;
  stroke: var(--c);
  stroke-width: 13;
  stroke-linecap: round;
}

.tail-spike { fill: var(--c-dark); }

.eye-white { fill: #ffffff; }
.pupil     { fill: #191430; }
.glint     { fill: #ffffff; opacity: .95; }
.blush     { fill: #ff9db3; opacity: .45; }

.mouth {
  fill: none;
  stroke: #2b2044;
  stroke-width: 2.6;
  stroke-linecap: round;
  opacity: .78;
}

.nostril { fill: #2b2044; opacity: .35; }

/* 动画 */
.eyes {
  transform-box: view-box;
  transform-origin: 100px 74px;
  animation: blink 5.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 91%, 100% { transform: scaleY(1); }
  94%, 96%      { transform: scaleY(.08); }
}

.tail {
  transform-box: view-box;
  transform-origin: 130px 146px;
  animation: wag 3.1s ease-in-out infinite;
}

@keyframes wag {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-9deg); }
}

.wing-left {
  transform-box: view-box;
  transform-origin: 76px 108px;
  animation: flap-l 3.6s ease-in-out infinite;
}

.wing-right {
  transform-box: view-box;
  transform-origin: 124px 108px;
  animation: flap-r 3.6s ease-in-out infinite;
}

@keyframes flap-l {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(-7deg) scale(1.06); }
}

@keyframes flap-r {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(7deg) scale(1.06); }
}

/* 数值变化时龙轻轻弹一下 */
.dragon.bump { animation: bump .6s ease; }

@keyframes bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.08) translateY(-6px); }
  70%  { transform: scale(.97); }
  100% { transform: scale(1); }
}

/* ── 四属性：2x2，点开看「怎么变强」──────────────────── */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(46, 82, 168, .55), rgba(12, 22, 54, .64));
  border: 1px solid rgba(140, 180, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: transform .12s ease;
}

.stat:active { transform: scale(.96); }

/* 右上角一个小问号，暗示「点得动」；孩子不认字也知道能戳 */
.stat::after {
  content: "?";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--dim);
  opacity: .45;
}

.st-ico {
  font-size: 16px;
  line-height: 1;
  filter: saturate(.95);
}

.st-key {
  font-size: 11.5px;
  color: var(--dim);
  letter-spacing: .02em;
}

.st-val {
  margin-left: auto;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color .3s ease;
}

.stat[data-key="atk"]  .st-val { color: var(--atk); }
.stat[data-key="hp"]   .st-val { color: var(--hp); }
.stat[data-key="spd"]  .st-val { color: var(--spd); }
.stat[data-key="move"] .st-val { color: var(--move); }

/* 数值上涨时闪一下。用 filter 而不是改 background：
   这里的底色是渐变，动画里写死 background 会把渐变压平 */
.stat.up { animation: stat-up 1s ease; }

@keyframes stat-up {
  0%   { transform: scale(1);    filter: none; }
  25%  { transform: scale(1.05); filter: brightness(1.7); }
  100% { transform: scale(1);    filter: none; }
}

/* ── 今日成长 ────────────────────────────────────────── */

.today {
  margin-top: 20px;
  padding: 13px 13px 11px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

/* 标题行：左边「今天完成」，右边总数。总数不再是主角，
   主角是下面一张张卡片。 */
.today-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 3px 10px;
}

.today-title {
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: .04em;
}

.today-count {
  font-size: 11.5px;
  color: var(--dim);
}

.today-count b {
  font-size: 19px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

/* ── 任务卡：一条任务一张，形态与成长记录页一致 ─────────
   左边图标、中间标题 + 备注 + 属性变化、右边绿色经验。
   首页不显示具体时间。 */

.today-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tc {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--border);
}

.tc-icon {
  flex: none;
  width: 24px;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.tc-main {
  flex: 1;
  min-width: 0;
}

.tc-title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  color: #f0e9ff;
}

/* 备注单行省略，长备注不撑高卡片 */
.tc-meta {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 属性变化：一条一行，用箭头表示前后 */
.tc-changes {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tc-change {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.tc-change .cl { color: #cfc4ee; margin-right: 5px; }
.tc-change .cf { color: var(--dim); }
.tc-change .ar { margin: 0 4px; opacity: .6; }
.tc-change .ct { color: var(--gold); font-weight: 700; }

.tc-side {
  flex: none;
  text-align: right;
  padding-left: 6px;
}

.tc-value {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--in);
  font-variant-numeric: tabular-nums;
}

.tc-sub {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--dim);
  white-space: nowrap;
}

.today-empty,
.today-rest {
  margin: 2px 3px 4px;
  font-size: 12.5px;
  color: var(--dim);
}

.today-rest { text-align: center; }

/* 入口：用一条细分隔线把它和「今天的记录」分开，避免看起来像又一条记录 */
.today-more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
}

.today-more-link span {
  font-size: 15px;
  line-height: 1;
  opacity: .7;
}

.today-more-link:active { color: var(--text); }

.spacer { flex: 1; min-height: 8px; }

/* ── 主按钮：今天做了什么 ─────────────────────────────── */

.big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: 16px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #4a2a00;
  background: linear-gradient(180deg, #ffd76a 0%, #ffb52e 52%, #f59a12 100%);
  border: 1px solid #ffe9a8;
  box-shadow: 0 5px 0 #a86400, 0 10px 22px rgba(255, 160, 30, .3),
              inset 0 2px 0 rgba(255, 255, 255, .7);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}

.big-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #a86400, 0 4px 12px rgba(255, 160, 30, .26),
              inset 0 2px 0 rgba(255, 255, 255, .7);
}

.big-txt b {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.big-arrow {
  font-size: 20px;
  opacity: .5;
  margin-left: -2px;
}

/* ── Toast ───────────────────────────────────────────── */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-b));
  transform: translate(-50%, 14px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(40, 30, 70, .95);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 40;
  max-width: calc(100vw - 48px);
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── 属性说明抽屉 ────────────────────────────────────── */
/* 点属性卡从底部升上来，比居中弹窗轻，看完一划就走 */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
}

/* 自己设了 display:flex，会盖掉 hidden 的默认隐藏，必须显式补 */
.sheet[hidden] { display: none; }

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 18, .62);
  opacity: 0;
  transition: opacity .22s ease;
}

.sheet.show .sheet-mask { opacity: 1; }

.sheet-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 9px 18px calc(18px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #241c49 0%, #16112f 100%);
  border-top: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .45);
  transform: translateY(102%);
  transition: transform .26s cubic-bezier(.22, .8, .3, 1);
}

.sheet.show .sheet-card { transform: translateY(0); }

.sheet-grip {
  width: 36px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border);
}

.sheet-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: .04em;
}

.sheet-value {
  margin: 1px 0 0;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.sheet-label {
  margin: 18px 0 9px;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: .05em;
}

.sheet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  font-size: 13px;
}

.sl-label {
  color: #e6dcff;
  min-width: 0;
}

.sl-fmt {
  flex: none;
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sheet-tip {
  margin: 13px 2px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
}

.sheet-ok {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 0;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 750;
  color: #20180a;
  background: linear-gradient(180deg, #ffd66b, #f5b32c);
}

.sheet-ok:active { filter: brightness(.94); }

/* ── 奖励弹窗 ────────────────────────────────────────── */

.reward {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 4, 16, .74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.reward.show { opacity: 1; pointer-events: auto; }

.reward-card {
  position: relative;
  width: 100%;
  max-width: 322px;
  padding: 26px 20px 18px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(180deg, #241a4d 0%, #150f31 100%);
  border: 1px solid rgba(255, 216, 120, .22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .04);
  transform: translateY(18px) scale(.94);
  transition: transform .34s cubic-bezier(.34, 1.3, .64, 1);
  overflow: hidden;
}

.reward.show .reward-card { transform: none; }

/* 图标背后的光晕：不用图片，纯渐变 */
.reward-burst {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 200px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 90, .38) 0%, transparent 66%);
  filter: blur(5px);
  animation: burst 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes burst {
  0%, 100% { opacity: .75; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.12); }
}

.reward-icon {
  position: relative;
  font-size: 40px;
  line-height: 1.1;
  margin-bottom: 8px;
  animation: icon-pop .5s cubic-bezier(.34, 1.4, .64, 1) both;
}

@keyframes icon-pop {
  0%   { transform: scale(.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.14) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.reward-title {
  position: relative;
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.35;
  color: #fff6e0;
}

.reward-sub {
  position: relative;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--dim);
}

.reward-sub:empty { display: none; }

.reward-gains {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.gain {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}

.gain-icon { font-size: 13px; line-height: 1; }
.gain-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.gain-label { font-size: 11.5px; color: var(--dim); }

/* 这些容器自己设了 display，会盖掉 hidden 属性的默认隐藏，必须显式补一条 */
.reward-gains[hidden] { display: none; }

/* 升级横幅做成「徽章」而不是按钮：整块金色会和下面的「收下」抢注意力 */
.reward-levelup {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  color: #ffd97a;
  background: rgba(255, 200, 70, .08);
  border: 1px solid rgba(255, 208, 110, .46);
  text-shadow: 0 0 14px rgba(255, 194, 60, .45);
}

.reward-levelup[hidden] { display: none; }

.reward-more {
  position: relative;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--dim);
  border: 1px solid var(--border);
  cursor: pointer;
}

.reward-more[hidden] { display: none; }
.reward-more:active { background: rgba(255, 255, 255, .06); }

.reward-list {
  position: relative;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  max-height: 168px;
  overflow-y: auto;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.reward-list[hidden] { display: none; }

.reward-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, .04);
  margin-bottom: 6px;
}

.reward-list li .li-icon { font-size: 13px; line-height: 1; }

.reward-list li .li-name { color: #e9e0ff; font-weight: 600; }

.reward-list li .li-amt {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reward-list li .li-meta {
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.reward-ok {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 0;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 800;
  color: #3a2400;
  background: linear-gradient(90deg, #ffc23c, #ffdc85);
  box-shadow: 0 6px 18px rgba(255, 194, 60, .28);
  cursor: pointer;
}

.reward-ok:active { transform: scale(.98); }

/* ── 加载态 ─────────────────────────────────────────── */

body.loading .dragon { opacity: 0; }
.dragon { opacity: 1; transition: opacity .5s ease, transform .5s ease; }

@media (prefers-reduced-motion: reduce) {
  .dragon, .eyes, .tail, .wing-left, .wing-right, .halo, .rays, .stars-a, .stars-b,
  .reward-burst, .reward-icon {
    animation: none !important;
  }
}
