* { box-sizing: border-box; }

:root {
  --mood: #ffb37a;
  --mood-soft: rgba(255, 179, 122, .16);
}

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

body {
  background: #0d0b1e;
  color: #f4f1ff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .6s;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

a { color: #b8a9ff; }

/* ---------------- 顶部 ---------------- */
.hero { text-align: center; padding-top: 8px; }

.clock {
  display: inline-block;
  font-size: .85rem;
  letter-spacing: 2px;
  color: #c9c2ee;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}

.mascot-wrap {
  position: relative;
  width: 190px;
  margin: 26px auto 6px;
}

.speech {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #fff;
  color: #3a3450;
  font-size: .88rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.speech.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.speech::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: none;
}

.mascot {
  position: relative;
  width: 150px;
  height: 132px;
  margin: 0 auto;
  background: linear-gradient(150deg, #ffd9a0, #ff9a7a 55%, #ff7ab8);
  border-radius: 48% 52% 55% 45% / 55% 58% 42% 45%;
  box-shadow: 0 14px 40px rgba(255, 122, 140, .4), inset -8px -10px 30px rgba(180, 60, 120, .35), inset 8px 10px 24px rgba(255, 255, 255, .35);
  cursor: pointer;
  animation: bob 3.2s ease-in-out infinite;
  transition: transform .2s;
}
.mascot:active { transform: scale(.94); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.eye {
  position: absolute;
  top: 46px;
  width: 26px;
  height: 34px;
  background: #fff;
  border-radius: 50%;
  overflow: hidden;
}
.eye.left { left: 34px; }
.eye.right { right: 34px; }
.pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 15px;
  margin: -7px 0 0 -6px;
  background: #2b2440;
  border-radius: 50%;
  transition: transform .12s ease-out;
}
.pupil::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
}
.mascot.blink .eye { transform: scaleY(.12); }
.eye { transition: transform .1s; }

.mouth {
  position: absolute;
  left: 50%;
  top: 84px;
  width: 34px;
  height: 18px;
  margin-left: -17px;
  border: 3px solid transparent;
  border-bottom-color: #5b2a3a;
  border-radius: 0 0 40px 40px;
}
.mouth.flat { top: 90px; height: 3px; border-bottom-color: #5b2a3a; border-radius: 3px; background: #5b2a3a; }
.mouth.o {
  top: 86px;
  width: 16px;
  height: 18px;
  margin-left: -8px;
  border: 3px solid #5b2a3a;
  border-radius: 50%;
  background: #7a3048;
}
.mouth.sleepy { top: 90px; height: 3px; border: none; border-top: 3px solid #5b2a3a; border-radius: 50%; }

.blush {
  position: absolute;
  top: 82px;
  width: 22px;
  height: 12px;
  background: rgba(255, 120, 140, .55);
  border-radius: 50%;
  filter: blur(2px);
}
.blush.left { left: 14px; }
.blush.right { right: 14px; }

.hero h1 {
  margin: 10px 0 0;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #ffd9a0, #ff9a7a, #ff7ab8, #b8a9ff, #7fe0c3);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientSlide 7s ease infinite;
}
@keyframes gradientSlide {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.subtitle {
  margin: 10px 0 0;
  color: #cfc8f2;
  font-size: 1rem;
  line-height: 1.7;
}
.hint { margin: 12px 0 0; color: #8d86b8; font-size: .85rem; }

/* ---------------- 卡片 ---------------- */
.card {
  background: rgba(24, 20, 48, .62);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.card h2 { margin: 0 0 4px; font-size: 1.2rem; letter-spacing: 1px; }
.card-desc { margin: 0 0 16px; color: #a49cd0; font-size: .9rem; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, #ff9a7a, #ff7ab8 55%, #b8a9ff);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 122, 160, .4);
}
.btn.ghost {
  background: rgba(255, 255, 255, .08);
  color: #e6e2ff;
  border: 1px solid rgba(255, 255, 255, .18);
}

.tiny { margin: 10px 0 0; color: #7d76a8; font-size: .78rem; }

/* ---------------- 运势 ---------------- */
.fortune {
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, .22);
  border-radius: 16px;
  padding: 20px 14px;
  margin-bottom: 16px;
  background: var(--mood-soft);
  transition: background .6s;
}
.fortune-big {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--mood);
  text-shadow: 0 0 30px var(--mood-soft);
  transition: color .6s;
}
.fortune.flip { animation: flipIn .5s ease; }
@keyframes flipIn {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: rotateY(0); opacity: 1; }
}
.fortune-text { margin: 10px 0 4px; font-size: 1rem; }
.fortune-do { margin: 4px 0 0; color: #a49cd0; font-size: .88rem; }

/* ---------------- 抓星星 ---------------- */
.game {
  position: relative;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 24, 66, .9), rgba(14, 11, 34, .9));
  border: 1px solid rgba(255, 255, 255, .14);
  margin-bottom: 14px;
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #cfc8f2;
  line-height: 1.8;
  pointer-events: none;
}
.game-big { font-size: 3.4rem; margin: 0; color: #ffd76b; text-shadow: 0 0 26px rgba(255, 215, 107, .8); animation: bob 2s ease-in-out infinite; }
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: .88rem;
  color: #d9d4f5;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent);
  pointer-events: none;
  z-index: 2;
}
.game-hud b { color: #ffd76b; }
.game-star {
  position: absolute;
  top: -40px;
  cursor: pointer;
  color: #ffd76b;
  text-shadow: 0 0 14px rgba(255, 215, 107, .9);
  animation: starFall linear forwards;
  user-select: none;
  z-index: 1;
}
@keyframes starFall {
  to { transform: translateY(380px) rotate(160deg); }
}
.game-star.caught { animation: starPop .25s ease-out forwards; }
@keyframes starPop {
  to { transform: scale(2.2) rotate(80deg); opacity: 0; }
}
.game-result { color: #ffd76b; font-weight: 700; font-size: .95rem; }

/* ---------------- 许愿池 ---------------- */
.pool {
  position: relative;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 40, 66, .85), rgba(10, 20, 44, .9));
  border: 1px solid rgba(127, 224, 195, .25);
  margin-bottom: 14px;
}
.pool::after {
  content: "✦ 把愿望扔进来，它会飘走 ✦";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200, 220, 255, .4);
  font-size: .85rem;
  pointer-events: none;
}
.wish-bubble {
  position: absolute;
  max-width: 72%;
  background: rgba(127, 224, 195, .16);
  border: 1px solid rgba(127, 224, 195, .45);
  color: #dff7ee;
  font-size: .85rem;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: wishFloat linear forwards;
  z-index: 1;
}
@keyframes wishFloat {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(-190px); opacity: 0; }
}
.wish-form { display: flex; gap: 8px; }
.wish-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: .95rem;
  outline: none;
}
.wish-form input::placeholder { color: #8d86b8; }
.wish-form input:focus { border-color: #7fe0c3; }

/* ---------------- 心情灯 ---------------- */
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.mood {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: #e6e2ff;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s, transform .15s, border-color .2s;
}
.mood:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .14); }
.mood.active { background: var(--mood-soft); border-color: var(--mood); color: #fff; font-weight: 700; }
.mood-msg { margin: 14px 0 0; color: #cfc8f2; font-size: .95rem; line-height: 1.6; }

.site-footer {
  text-align: center;
  color: #7d76a8;
  font-size: .8rem;
  line-height: 1.8;
}

/* ---------------- 两侧插画 ---------------- */
.shuffle-btn { margin-top: 14px; }

.rails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.rails::-webkit-scrollbar { display: none; }
.rail {
  position: relative;
  flex: none;
  width: 160px;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.rail img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: opacity .28s;
}
.rail img.fade { opacity: 0; }
.rail-swap {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(10, 8, 28, .6);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s;
}
.rail-swap:hover { background: rgba(255, 255, 255, .28); transform: rotate(120deg); }

@media (min-width: 1180px) {
  .rails { display: block; overflow: visible; padding: 0; }
  .rail {
    position: fixed;
    top: 50%;
    width: 208px;
    z-index: 1;
    transform: translateY(-50%);
  }
  .rail-left { left: 30px; }
  .rail-right { right: 30px; }
  .rail img { height: 300px; }
}

@media (max-width: 480px) {
  .app { padding: 20px 14px 36px; }
  .hero h1 { font-size: 2.4rem; }
  .card { padding: 16px; }
  .game { height: 280px; }
}
