:root {
  --blue-50: #eaf8ff;
  --blue-100: #d7f0ff;
  --blue-200: #bde7ff;
  --blue-300: #87ceeb;
  --blue-500: #58b7e8;
  --ink: #203d52;
  --muted: #607a8b;
  --line: rgba(88, 183, 232, 0.24);
  --white: #ffffff;
  --gold: #ffd36a;
  --mint: #a7e7c5;
  --rose: #ff9fbc;
  --lavender: #d9d2ff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #f7fdff;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(189, 231, 255, 0.76), transparent 23rem),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.92), transparent 21rem),
    linear-gradient(135deg, #fbfeff 0%, var(--blue-50) 52%, #f4fbff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.54;
  background-image:
    linear-gradient(rgba(88, 183, 232, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 183, 232, 0.05) 1px, transparent 1px);
  background-size: 58px 58px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.module-nav {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 420px);
  padding: 10px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 44px rgba(57, 126, 164, 0.16);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
}

.module-nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  width: 152px;
  min-height: 42px;
  padding: 6px 10px;
  color: #386c8b;
  font-size: 0.9rem;
  font-weight: 850;
  text-align: left;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(88, 183, 232, 0.18);
  border-radius: 8px;
  cursor: pointer;
}

.module-nav-item span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #2f789f;
  font-size: 0.76rem;
  background: var(--blue-100);
  border-radius: 50%;
}

.module-nav-item.is-active {
  color: #17394d;
  background: linear-gradient(135deg, #ffffff, var(--blue-100));
  box-shadow: 0 12px 28px rgba(88, 183, 232, 0.22);
}

.module-nav-item.is-locked {
  display: none;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-right: 180px;
}

.module {
  position: relative;
  min-height: 100vh;
  padding: 72px 0;
}

.is-hidden,
.is-hidden-module {
  display: none !important;
}

.hero-module {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 42px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker,
.modal-kicker {
  color: #397da2;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 18px;
}

h1 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 8.4vw, 7.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

.birthday-line {
  margin-bottom: 18px;
  color: #2e83b1;
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  font-weight: 900;
}

.lead,
.section-heading p,
.countdown-card p,
.finale-copy p {
  color: var(--muted);
  line-height: 1.9;
}

.lead {
  max-width: 650px;
  margin-bottom: 28px;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
}

.hero-actions,
.cake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 20px;
  font-weight: 900;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  color: #17415a;
  background: linear-gradient(135deg, var(--blue-200), #ffffff);
  border: 1px solid rgba(88, 183, 232, 0.36);
  box-shadow: 0 14px 28px rgba(88, 183, 232, 0.2);
}

.secondary-button {
  color: #2b6f94;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.secondary-button:disabled {
  color: #9ab0bc;
  cursor: not-allowed;
  opacity: 0.72;
}

.countdown-card {
  position: relative;
  min-height: 270px;
  padding: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(234, 248, 255, 0.76)),
    radial-gradient(circle at top right, rgba(135, 206, 235, 0.32), transparent 11rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(77, 157, 199, 0.18);
}

.countdown-card strong {
  display: block;
  margin-bottom: 12px;
  color: #2a7aa5;
  font-size: 2.3rem;
  line-height: 1;
}

.countdown-card span {
  display: block;
  margin-bottom: 18px;
  color: #17394d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  font-weight: 700;
}

.portal-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 380px);
  gap: 18px;
  justify-content: center;
  margin-top: -18px;
}

.portal-card {
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 42px rgba(77, 157, 199, 0.12);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 52px rgba(77, 157, 199, 0.18);
}

.portal-card strong {
  font-size: 1.18rem;
}

.portal-card small {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-style: italic;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  color: #2d7da7;
  background: var(--blue-100);
  border-radius: 50%;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading h2,
.finale-copy h2,
.gift-modal h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.gacha-layout {
  display: grid;
  grid-template-columns: minmax(300px, 450px) minmax(240px, 1fr);
  align-items: center;
  gap: 44px;
}

.gacha-machine {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 0.72;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.32), transparent 38%),
    linear-gradient(180deg, #effbff 0 18%, #aee6ff 18% 34%, #7fd1f7 34% 74%, #5fbde9 74% 100%);
  border: 1px solid rgba(88, 183, 232, 0.42);
  border-radius: 28px;
  box-shadow:
    inset 0 20px 34px rgba(255, 255, 255, 0.54),
    inset -22px -28px 44px rgba(50, 135, 181, 0.14),
    0 34px 80px rgba(63, 146, 190, 0.24);
}

.machine-glow {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 22px;
  pointer-events: none;
}

.machine-crown {
  position: absolute;
  top: 18px;
  left: 50%;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.machine-crown span {
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.72);
}

.machine-sign {
  position: absolute;
  top: 54px;
  left: 50%;
  width: 190px;
  padding: 10px 12px;
  color: #2d7da7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  transform: translateX(-50%);
}

.capsule-window {
  position: absolute;
  top: 22%;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 70%;
  min-height: 30%;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.34),
    0 16px 24px rgba(32, 93, 126, 0.1);
  transform: translateX(-50%);
}

.capsule-window::before {
  content: "";
  position: absolute;
  inset: 10px auto auto 16px;
  width: 44%;
  height: 36%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), transparent);
  border-radius: 18px;
  pointer-events: none;
}

.capsule {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--white) 0 45%, var(--rose) 45% 100%);
  border: 0;
  border-radius: 50%;
  box-shadow:
    inset -3px -4px 0 rgba(0, 0, 0, 0.06),
    0 5px 10px rgba(52, 125, 164, 0.14);
  cursor: pointer;
}

.capsule:nth-child(3n) {
  background: linear-gradient(135deg, var(--white) 0 45%, var(--gold) 45% 100%);
}

.capsule:nth-child(4n) {
  background: linear-gradient(135deg, var(--white) 0 45%, var(--mint) 45% 100%);
}

.capsule:nth-child(5n) {
  background: linear-gradient(135deg, var(--white) 0 45%, var(--lavender) 45% 100%);
}

.capsule.is-drawn {
  opacity: 0.28;
  transform: scale(0.86);
}

.coin-slot {
  position: absolute;
  left: 13%;
  top: 62%;
  display: grid;
  place-items: center;
  width: 92px;
  height: 46px;
  background: rgba(255, 255, 255, 0.38);
  border-radius: 999px;
}

.coin-slot span {
  width: 66px;
  height: 12px;
  background: #3d7fa3;
  border-radius: 999px;
}

.gacha-lever {
  position: absolute;
  right: 12%;
  top: 56%;
  width: 70px;
  height: 118px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.gacha-lever span {
  position: absolute;
  left: 31px;
  bottom: 12px;
  width: 10px;
  height: 70px;
  background: #335970;
  border-radius: 8px;
}

.gacha-lever span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -33px;
  width: 46px;
  height: 46px;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 18%, transparent 20%),
    rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(62, 111, 137, 0.2);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(62, 111, 137, 0.16);
  transform: translateX(-50%);
}

.gacha-machine.is-turning .gacha-lever {
  animation: leverPull 0.7s ease;
}

.candy-tray {
  position: absolute;
  left: 50%;
  bottom: 12%;
  display: grid;
  place-items: center;
  width: 136px;
  height: 70px;
  overflow: hidden;
  background: rgba(39, 102, 136, 0.34);
  border-radius: 0 0 44px 44px;
  transform: translateX(-50%);
}

.drawn-capsule {
  width: 38px;
  height: 38px;
  opacity: 0;
  background: linear-gradient(135deg, #fff 0 45%, var(--gold) 45% 100%);
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(38, 102, 136, 0.18);
}

.drawn-capsule.is-visible {
  opacity: 1;
  animation: capsulePop 0.55s ease both;
}

.machine-feet {
  position: absolute;
  right: 50px;
  bottom: 10px;
  left: 50px;
  display: flex;
  justify-content: space-between;
}

.machine-feet span {
  width: 64px;
  height: 18px;
  background: rgba(47, 120, 159, 0.3);
  border-radius: 999px;
}

.gacha-panel {
  padding: 28px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 44px rgba(77, 157, 199, 0.12);
}

.gacha-panel p {
  margin-bottom: 18px;
  color: #2f789f;
  font-size: 1.2rem;
  font-weight: 900;
}

.gacha-panel button + button {
  margin-top: 12px;
}

.cake-stage {
  display: grid;
  place-items: center;
  gap: 26px;
  min-height: 560px;
  padding: 38px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), transparent 19rem),
    rgba(255, 255, 255, 0.48);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(77, 157, 199, 0.12);
}

.birthday-cake {
  position: relative;
  width: min(470px, 88vw);
  height: 390px;
}

.cake-halo {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 360px;
  height: 260px;
  background: radial-gradient(circle, rgba(189, 231, 255, 0.45), transparent 68%);
  transform: translateX(-50%);
}

.cake-layer,
.frosting,
.cake-plate,
.cake-topper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cake-topper {
  bottom: 288px;
  z-index: 4;
  padding: 8px 16px;
  color: #2d7da7;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(88, 183, 232, 0.24);
  border-radius: 999px;
  box-shadow: 0 12px 22px rgba(77, 157, 199, 0.14);
}

.cake-layer {
  width: 310px;
  height: 94px;
  background:
    radial-gradient(circle at 18% 34%, rgba(255, 255, 255, 0.28), transparent 10%),
    linear-gradient(180deg, #aee6ff, #58b7e8);
  border-radius: 14px 14px 28px 28px;
  box-shadow:
    inset -20px -16px 0 rgba(0, 0, 0, 0.05),
    0 16px 26px rgba(77, 157, 199, 0.14);
}

.cake-layer-top {
  bottom: 152px;
  width: 248px;
}

.cake-layer-bottom {
  bottom: 62px;
}

.frosting {
  z-index: 2;
  height: 42px;
  background: #fff8fc;
  border-radius: 22px 22px 10px 10px;
}

.frosting-top {
  bottom: 218px;
  width: 248px;
}

.frosting-middle {
  bottom: 128px;
  width: 310px;
}

.frosting::after {
  content: "";
  position: absolute;
  inset: 24px 0 auto;
  height: 30px;
  background:
    radial-gradient(circle at 14% 0, #fff8fc 0 16px, transparent 17px),
    radial-gradient(circle at 34% 0, #fff8fc 0 19px, transparent 20px),
    radial-gradient(circle at 58% 0, #fff8fc 0 15px, transparent 16px),
    radial-gradient(circle at 80% 0, #fff8fc 0 18px, transparent 19px);
}

.gold-line {
  position: absolute;
  right: 36px;
  bottom: 30px;
  left: 36px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 999px;
}

.pearl {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.pearl-a {
  left: 44px;
  top: 44px;
}

.pearl-b {
  left: 118px;
  top: 58px;
}

.pearl-c {
  right: 46px;
  top: 38px;
}

.pearl-d {
  left: 58px;
  top: 46px;
}

.pearl-e {
  left: 150px;
  top: 60px;
}

.pearl-f {
  right: 62px;
  top: 48px;
}

.cake-plate {
  bottom: 38px;
  width: 382px;
  height: 30px;
  background: linear-gradient(180deg, #ffffff, #d7f0ff);
  border-radius: 50%;
  box-shadow: 0 16px 24px rgba(77, 157, 199, 0.16);
}

.candles {
  position: absolute;
  left: 50%;
  bottom: 260px;
  z-index: 5;
  display: flex;
  gap: 18px;
  transform: translateX(-50%);
}

.candle {
  position: relative;
  width: 14px;
  height: 56px;
  background:
    repeating-linear-gradient(45deg, #ffffff 0 7px, #bde7ff 7px 14px);
  border-radius: 8px;
  box-shadow: 0 8px 12px rgba(77, 157, 199, 0.12);
}

.candle-two,
.candle-four {
  height: 66px;
}

.candle i {
  position: absolute;
  left: 50%;
  top: -30px;
  width: 20px;
  height: 28px;
  opacity: 0;
  background: radial-gradient(circle at 50% 70%, #ffd36a 0 28%, #ff9a45 55%, transparent 62%);
  border-radius: 50% 50% 46% 46%;
  filter: drop-shadow(0 0 14px rgba(255, 179, 77, 0.72));
  transform: translateX(-50%);
}

.birthday-cake.is-lit .candle i {
  opacity: 1;
  animation: flameDance 0.8s ease-in-out infinite;
}

.birthday-cake.is-blown .candle i {
  opacity: 0;
  animation: none;
}

.wish-smoke {
  position: absolute;
  left: 50%;
  bottom: 280px;
  z-index: 6;
  display: none;
  gap: 14px;
  transform: translateX(-50%);
}

.birthday-cake.is-blown .wish-smoke {
  display: flex;
}

.wish-smoke span {
  width: 24px;
  height: 42px;
  opacity: 0;
  border: 2px solid rgba(116, 156, 178, 0.36);
  border-right: 0;
  border-bottom: 0;
  border-radius: 50%;
  animation: smokeRise 1.5s ease forwards;
}

.wish-smoke span:nth-child(2) {
  animation-delay: 0.12s;
}

.wish-smoke span:nth-child(3) {
  animation-delay: 0.24s;
}

.letter-module {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 20%, rgba(88, 183, 232, 0.32), transparent 24rem),
    linear-gradient(180deg, #06111d 0%, #092540 52%, #030910 100%);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(7, 24, 39, 0.24);
}

.letter-module.is-fireworks-fullscreen,
.letter-module:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

#fireworksCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.finale-copy {
  position: relative;
  z-index: 2;
  width: min(780px, calc(100% - 40px));
  padding: clamp(28px, 6vw, 60px);
  text-align: center;
  background: rgba(7, 24, 39, 0.26);
  border: 1px solid rgba(189, 231, 255, 0.26);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.finale-copy .section-kicker,
.finale-copy p {
  color: rgba(255, 255, 255, 0.82);
}

.finale-copy h2 {
  color: #ffffff;
  text-shadow: 0 0 34px rgba(135, 206, 235, 0.72);
}

.fireworks-hint {
  min-height: 28px;
  margin: 22px 0 0;
  font-weight: 900;
}

.gift-modal {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 32px 90px rgba(31, 93, 126, 0.24);
}

.gift-modal::backdrop {
  background: rgba(34, 48, 58, 0.5);
  backdrop-filter: blur(7px);
}

.modal-kicker,
.gift-modal h2,
.gift-modal p:last-child {
  padding-right: 34px;
  padding-left: 34px;
}

.modal-kicker {
  margin: 0;
  padding-top: 34px;
  padding-bottom: 10px;
  background: var(--blue-100);
}

.gift-modal h2 {
  margin: 0;
  padding-top: 8px;
  padding-bottom: 22px;
  background: var(--blue-100);
}

.gift-modal p:last-child {
  margin-bottom: 0;
  padding-top: 24px;
  padding-bottom: 34px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #2b6f94;
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.floating-decor span {
  position: fixed;
  z-index: -1;
  opacity: 0.44;
  pointer-events: none;
}

.heart {
  width: 18px;
  height: 18px;
  background: var(--blue-300);
  transform: rotate(45deg);
  animation: floatUp 10s ease-in-out infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: inherit;
  border-radius: 50%;
}

.heart::before {
  left: -9px;
}

.heart::after {
  top: -9px;
}

.heart-one {
  left: 8%;
  top: 32%;
}

.heart-two {
  right: 12%;
  top: 28%;
  animation-delay: 2s;
}

.heart-three {
  left: 68%;
  bottom: 18%;
  animation-delay: 4s;
}

.spark {
  width: 18px;
  height: 18px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  animation: twinkle 2.8s ease-in-out infinite;
}

.spark-one {
  left: 18%;
  bottom: 24%;
}

.spark-two {
  right: 20%;
  bottom: 34%;
  background: var(--mint);
  animation-delay: 1.1s;
}

@keyframes leverPull {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(18deg);
  }
}

@keyframes capsulePop {
  0% {
    transform: translateY(-36px) scale(0.5);
  }
  70% {
    transform: translateY(0) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes flameDance {
  0%,
  100% {
    transform: translateX(-50%) scale(1) rotate(-2deg);
  }
  50% {
    transform: translateX(-50%) scale(1.12) rotate(3deg);
  }
}

@keyframes smokeRise {
  0% {
    opacity: 0.65;
    transform: translateY(0) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translateY(-62px) scale(1.35);
  }
}

@keyframes floatUp {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  50% {
    transform: translateY(-24px) rotate(45deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.88);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.16);
  }
}

@media (max-width: 920px) {
  main {
    width: min(100% - 24px, 720px);
    padding-right: 0;
  }

  .module-nav {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    transform: none;
  }

  .module-nav-item {
    flex: 0 0 144px;
  }

  .hero-module,
  .gacha-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions,
  .cake-actions {
    justify-content: center;
  }

  .portal-grid {
    grid-template-columns: minmax(240px, 360px);
  }
}

@media (max-width: 620px) {
  .module {
    padding: 54px 0 92px;
  }

  .portal-grid {
    margin-top: 0;
  }

  .capsule-window {
    gap: 7px;
    padding: 12px;
  }

  .gacha-panel {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
