:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.82);
  --card-bg: rgba(255, 255, 255, 0.18);
  --card-border: rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    #ff5f6d 0%,
    #ffc371 28%,
    #ff9a9e 55%,
    #fad0c4 78%,
    #a18cd1 100%
  );
  animation: gradientMove 10s ease-in-out infinite alternate;
}

@keyframes gradientMove {
  0% { filter: hue-rotate(0deg) saturate(1.1); }
  100% { filter: hue-rotate(18deg) saturate(1.25); }
}

.bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-a {
  width: 180px;
  height: 180px;
  top: 8%;
  left: -40px;
  background: radial-gradient(circle, #fff59d, #ff80ab);
}

.orb-b {
  width: 220px;
  height: 220px;
  top: 42%;
  right: -60px;
  background: radial-gradient(circle, #80deea, #7c4dff);
  animation-delay: 1.2s;
}

.orb-c {
  width: 140px;
  height: 140px;
  bottom: 10%;
  left: 18%;
  background: radial-gradient(circle, #b9f6ca, #ffd54f);
  animation-delay: 2s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.08); }
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.85;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  from {
    transform: translateY(105vh) rotate(0deg) scale(0.4);
    opacity: 0;
  }
  12% { opacity: 1; }
  to {
    transform: translateY(-12vh) rotate(360deg) scale(1);
    opacity: 0;
  }
}

.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding:
    max(10px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hero {
  position: relative;
  width: 100%;
  max-width: 320px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: min(42vh, 360px);
  padding-top: 8px;
}

.mascot-spotlight {
  position: absolute;
  bottom: 18%;
  left: 50%;
  width: min(260px, 72vw);
  height: min(260px, 72vw);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}

.mascot-video-wrap,
.loading-video-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 16px 28px rgba(90, 40, 60, 0.22));
}

.loading-video-wrap {
  filter: drop-shadow(0 10px 20px rgba(80, 40, 20, 0.18));
  margin-bottom: 20px;
}

.mascot-video-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.mascot-canvas {
  position: relative;
  display: block;
  width: min(240px, 58vw);
  height: auto;
  aspect-ratio: 1;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  opacity: 0;
  animation: mascotEnter 0.75s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s forwards;
}

.loading-canvas {
  display: block;
  width: min(220px, 55vw);
  height: auto;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  animation: mascotEnter 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) 0.05s forwards;
}

.mascot-ground {
  position: relative;
  z-index: 1;
  width: min(140px, 36vw);
  height: 14px;
  margin-top: -8px;
  border-radius: 50%;
  background: rgba(80, 40, 20, 0.18);
  filter: blur(4px);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.35s forwards;
}

.copy-block {
  width: 100%;
  max-width: min(360px, 92vw);
  flex-shrink: 0;
  margin-top: 4px;
  margin-bottom: 14px;
}

@keyframes mascotEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.greeting {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  text-shadow: 0 4px 18px rgba(120, 40, 120, 0.25);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.45s forwards;
}

.intro {
  margin-top: 6px;
  font-size: clamp(13px, 3.6vw, 15px);
  color: var(--muted);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.65s forwards;
}

.refresh-btn {
  flex-shrink: 0;
  margin-top: 16px;
  margin-bottom: 2px;
  padding: 12px 28px;
  min-height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: fadeUp 0.8s ease 1.4s forwards;
  transition: transform 0.2s ease, background 0.2s ease;
}

.refresh-btn:active {
  transform: scale(0.96);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.card {
  width: 100%;
  max-width: min(360px, 92vw);
  flex-shrink: 0;
  margin-top: 0;
  padding: 22px 20px 24px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  backdrop-filter: blur(14px);
  box-shadow:
    0 18px 50px rgba(180, 60, 120, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  opacity: 0;
  animation: cardIn 0.9s ease 0.85s forwards;
}

.blessing {
  font-size: clamp(17px, 4.8vw, 20px);
  line-height: 1.75;
  min-height: 3.2em;
  text-align: center;
}

.blessing.typing::after {
  content: "|";
  margin-left: 2px;
  animation: blink 0.75s step-end infinite;
}

.sparkles {
  margin-top: 24px;
  display: flex;
  gap: 18px;
  font-size: 22px;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.4s forwards;
}

.sparkles span:nth-child(2) {
  animation: twinkle 1.6s ease infinite;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.loading, .error {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ff5f6d, #ffc371, #a18cd1);
  z-index: 10;
}

.loading p {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.35s forwards;
}

.error p {
  color: #ffffff;
  font-size: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-height: 700px) {
  .hero {
    min-height: min(36vh, 280px);
  }
  .mascot-canvas {
    width: min(200px, 50vw);
  }
  .copy-block {
    margin-bottom: 10px;
  }
  .card {
    padding: 18px 16px 20px;
  }
  .refresh-btn {
    margin-top: 12px;
  }
}

@media (max-width: 360px) {
  .stage {
    padding-left: 12px;
    padding-right: 12px;
  }
}
