/* ==========================================================================
   游戏化 UI
   ========================================================================== */

/* -------- 顶部：等级 + 金币 -------- */
.gm-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.gm-lv {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 11px 15px;
  box-shadow: 0 2px 12px -4px rgba(22,93,255,.14);
}

.gm-lv__badge {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #165dff, #4080ff);
  padding: 7px 13px;
  border-radius: 11px;
  letter-spacing: -.02em;
  box-shadow: 0 4px 12px -4px rgba(22,93,255,.55);
  font-variant-numeric: tabular-nums;
}

.gm-lv__info { flex: 1; min-width: 0; }

.gm-lv__title {
  font-size: 12px;
  font-weight: 800;
  color: #1d2129;
  margin-bottom: 5px;
}

.gm-lv__bar {
  height: 7px;
  border-radius: 99px;
  background: #eef2f8;
  overflow: hidden;
  margin-bottom: 4px;
}
.gm-lv__bar > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #165dff, #4080ff, #639cff);
  transition: width .7s cubic-bezier(.22,.9,.3,1);
  position: relative;
  overflow: hidden;
}
.gm-lv__bar > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: gmShine 2s ease-in-out infinite;
}
@keyframes gmShine {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(230%); }
}

.gm-lv__xp {
  font-size: 10.5px;
  color: #a0aec0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gm-coins {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 15px;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff8e6, #ffefcc);
  border: 1.5px solid #ffe0a3;
  box-shadow: 0 3px 12px -5px rgba(255,184,77,.5);
}
.gm-coins__icon { font-size: 17px; line-height: 1; }
.gm-coins__num {
  font-size: 16px;
  font-weight: 900;
  color: #d48806;
  font-variant-numeric: tabular-nums;
}

/* -------- 宠物场景 -------- */
.gm-pet {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  margin-bottom: 14px;
  background: linear-gradient(160deg, #e8f0ff 0%, #f4f0ff 50%, #ffeef5 100%);
  border: 1.5px solid #e0e8ff;
  overflow: hidden;
  box-shadow: 0 6px 22px -10px rgba(99,102,241,.32);
}

.gm-pet__scene {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.gm-pet__avatar {
  font-size: 60px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  animation: petIdle 3.2s ease-in-out infinite;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 6px 12px rgba(99,102,241,.25));
}

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

@keyframes petJump {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-22px) scale(1.14) rotate(-8deg); }
  65% { transform: translateY(-8px) scale(.96) rotate(6deg); }
  100% { transform: translateY(0) scale(1); }
}

.gm-pet__shadow {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 11px;
  border-radius: 50%;
  background: rgba(99,102,241,.18);
  filter: blur(5px);
  animation: petShadow 3.2s ease-in-out infinite;
}
@keyframes petShadow {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: .55; }
  50% { transform: translateX(-50%) scaleX(.82); opacity: .35; }
}

.gm-star {
  position: absolute;
  font-size: 13px;
  animation: starTwinkle 2.4s ease-in-out infinite;
  opacity: .85;
}
@keyframes starTwinkle {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.gm-pet__info { flex: 1; min-width: 0; }

.gm-pet__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 850;
  color: #1d2129;
  margin-bottom: 3px;
}

.gm-pet__edit {
  border: 0;
  background: rgba(255,255,255,.7);
  border-radius: 7px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
  transition: all .18s;
}
.gm-pet__edit:hover { background: #fff; transform: scale(1.1); }

.gm-pet__lv {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #6366f1;
  background: rgba(99,102,241,.1);
  padding: 2px 9px;
  border-radius: 99px;
  margin-bottom: 9px;
}

.gm-pet__hunger-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,.75);
  overflow: hidden;
  margin-bottom: 4px;
}
.gm-pet__hunger-bar > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffb44d, #ff9a2e);
  transition: width .6s ease;
}
.gm-pet__hunger-txt {
  font-size: 10.5px;
  color: #7c6f9b;
  font-weight: 700;
}

/* -------- 连击条 -------- */
.gm-streak {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  background: linear-gradient(120deg, #fff2e6, #ffe8e6);
  border: 1.5px solid #ffd6c2;
  box-shadow: 0 4px 16px -8px rgba(255,125,0,.45);
}

.gm-streak__fire {
  font-size: 30px;
  line-height: 1;
  animation: fireFlicker .9s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes fireFlicker {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.12) rotate(4deg); }
}

.gm-streak__body { flex: 1; min-width: 0; }
.gm-streak__num {
  font-size: 15px;
  font-weight: 850;
  color: #d4380d;
}
.gm-streak__desc {
  font-size: 11px;
  color: #b35c44;
  margin-top: 2px;
  font-weight: 600;
}

.gm-streak__badge {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(135deg, #ff7d00, #ff9a2e);
  padding: 6px 12px;
  border-radius: 99px;
  box-shadow: 0 3px 10px -3px rgba(255,125,0,.6);
}

/* -------- 主操作按钮 -------- */
.gm-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: 19px;
  cursor: pointer;
  transition: all .24s cubic-bezier(.22,.9,.3,1);
  text-align: left;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  color: #fff;
}
.gm-action::after {
  content: "";
  position: absolute;
  right: -40px; top: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.24), transparent 68%);
  pointer-events: none;
}
.gm-action:hover { transform: translateY(-2px); }
.gm-action:active { transform: translateY(0) scale(.99); }

.gm-action--blue   { background: linear-gradient(125deg, #165dff, #4080ff 55%, #639cff);
                     box-shadow: 0 10px 28px -12px rgba(22,93,255,.62); }
.gm-action--green  { background: linear-gradient(125deg, #00b42a, #23c343 55%, #4ad96a);
                     box-shadow: 0 10px 28px -12px rgba(0,180,42,.6); }
.gm-action--orange { background: linear-gradient(125deg, #ff7d00, #ff9a2e 55%, #ffb658);
                     box-shadow: 0 10px 28px -12px rgba(255,125,0,.6); }

.gm-action__ico { font-size: 34px; line-height: 1; flex: 0 0 auto; position: relative; }
.gm-action__body { flex: 1; min-width: 0; position: relative; }
.gm-action__title {
  font-size: 17.5px;
  font-weight: 850;
  line-height: 1.3;
}
.gm-action__sub {
  font-size: 12px;
  opacity: .9;
  margin-top: 3px;
}
.gm-action__go {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 15px;
  border-radius: 99px;
  background: rgba(255,255,255,.24);
  white-space: nowrap;
  position: relative;
}

/* -------- 卡片 -------- */
.gm-card {
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: 18px;
  padding: 17px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px -4px rgba(22,93,255,.1);
}

.gm-card__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.gm-card__title {
  font-size: 15px;
  font-weight: 850;
  color: #1d2129;
}
.gm-card__sub {
  font-size: 11px;
  color: #a0aec0;
  font-weight: 600;
}

/* -------- 任务行 -------- */
.gm-task {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px dashed #f0f4fa;
}
.gm-task:last-child { border-bottom: 0; padding-bottom: 0; }
.gm-task.is-claimed { opacity: .5; }

.gm-task__ico {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: #f7faff;
  display: grid;
  place-items: center;
  font-size: 19px;
}

.gm-task__body { flex: 1; min-width: 0; }
.gm-task__name {
  font-size: 12.5px;
  font-weight: 750;
  color: #1d2129;
  margin-bottom: 5px;
}
.gm-task__prog {
  height: 6px;
  border-radius: 99px;
  background: #eef2f8;
  overflow: hidden;
  margin-bottom: 4px;
}
.gm-task__prog > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00b42a, #23c343);
  transition: width .5s ease;
}
.gm-task__meta {
  font-size: 10.5px;
  color: #a0aec0;
  font-weight: 700;
}

.gm-task__claim {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(135deg, #ff7d00, #ff9a2e);
  color: #fff;
  font-size: 11.5px;
  font-weight: 850;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 10px -3px rgba(255,125,0,.6);
  animation: claimPulse 1.6s ease-in-out infinite;
}
@keyframes claimPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.gm-task__claim:hover { filter: brightness(1.08); }

.gm-task__done {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  color: #00b42a;
  background: rgba(0,180,42,.1);
  padding: 4px 11px;
  border-radius: 99px;
}
.gm-task__lock { flex: 0 0 auto; font-size: 15px; opacity: .35; }

/* -------- 快捷四宫格 -------- */
.gm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.gm-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 5px;
  border: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 10px -3px rgba(22,93,255,.12);
  cursor: pointer;
  transition: all .2s cubic-bezier(.22,.9,.3,1);
  font-family: inherit;
}
.gm-mini:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -8px rgba(22,93,255,.3); }
.gm-mini:active { transform: translateY(0) scale(.95); }

.gm-mini__ico { font-size: 24px; line-height: 1; }
.gm-mini__label {
  font-size: 11px;
  font-weight: 750;
  color: #1d2129;
}

/* -------- 奖励动画 -------- */
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(.6); }
  40% { opacity: 1; transform: translate(-50%,-140%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%,-260%) scale(.9); }
}

@keyframes rewardPop {
  0% { transform: scale(.5); opacity: 0; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rewardRise {
  0% { transform: translateY(14px); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-32px); opacity: 0; }
}

@keyframes levelPop {
  0% { transform: scale(.5) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ==========================================================================
   手机端
   ========================================================================== */
@media (max-width: 560px) {
  .gm-top { gap: 9px; margin-bottom: 11px; }
  .gm-lv { padding: 9px 12px; border-radius: 14px; gap: 9px; }
  .gm-lv__badge { font-size: 12px; padding: 6px 11px; border-radius: 9px; }
  .gm-lv__title { font-size: 11px; }
  .gm-lv__xp { font-size: 9.5px; }
  .gm-coins { padding: 9px 12px; border-radius: 13px; gap: 4px; }
  .gm-coins__icon { font-size: 15px; }
  .gm-coins__num { font-size: 14px; }

  .gm-pet { padding: 15px; gap: 13px; border-radius: 19px; margin-bottom: 11px; }
  .gm-pet__scene { width: 78px; height: 78px; }
  .gm-pet__avatar { font-size: 50px; }
  .gm-pet__shadow { width: 44px; height: 9px; }
  .gm-pet__name { font-size: 14.5px; }
  .gm-pet__lv { font-size: 10px; padding: 1px 8px; }

  .gm-streak { padding: 11px 14px; border-radius: 14px; margin-bottom: 11px; gap: 10px; }
  .gm-streak__fire { font-size: 26px; }
  .gm-streak__num { font-size: 13.5px; }
  .gm-streak__desc { font-size: 10.5px; }
  .gm-streak__badge { font-size: 10.5px; padding: 5px 10px; }

  .gm-action { padding: 15px 17px; border-radius: 17px; gap: 12px; margin-bottom: 11px; }
  .gm-action__ico { font-size: 29px; }
  .gm-action__title { font-size: 16px; }
  .gm-action__sub { font-size: 11px; }
  .gm-action__go { font-size: 11.5px; padding: 7px 13px; }

  .gm-card { padding: 14px; border-radius: 16px; margin-bottom: 11px; }
  .gm-card__title { font-size: 14px; }
  .gm-task { gap: 9px; padding: 10px 0; }
  .gm-task__ico { width: 34px; height: 34px; flex: 0 0 34px; font-size: 17px; border-radius: 10px; }
  .gm-task__name { font-size: 12px; }
  .gm-task__meta { font-size: 10px; }
  .gm-task__claim { height: 27px; padding: 0 11px; font-size: 10.5px; }

  .gm-grid { gap: 8px; }
  .gm-mini { padding: 12px 4px; border-radius: 13px; gap: 6px; }
  .gm-mini__ico { font-size: 21px; }
  .gm-mini__label { font-size: 10.5px; }
}

@media (max-width: 360px) {
  .gm-grid { grid-template-columns: repeat(2, 1fr); }
  .gm-action__go { display: none; }
}


/* -------- 顶栏连击徽章 -------- */
.gm-fire {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff2e6, #ffe0cc);
  border: 1.5px solid #ffd0b0;
  font-size: 14px;
  font-weight: 900;
  color: #d4380d;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 12px -5px rgba(255,125,0,.5);
}

@media (max-width: 560px) {
  .gm-fire { padding: 8px 11px; font-size: 13px; border-radius: 12px; }
}
