:root {
  --twilight: #7b4baf;
  --dash: #5ec8f0;
  --pinkie: #f48fb1;
  --aj: #f6a53c;
  --shy: #f7e27a;
  --rarity: #c9b6f2;
  --ink: #4a2c6a;
  --paper: #fff7fb;
  --card: #ffffff;
  --shadow: 6px 8px 0 rgba(90, 40, 120, 0.18);
}

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

html, body {
  min-height: 100%;
  font-family: "Fredoka", "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #9ad8ff 0%, #c9b6ff 28%, #ffc4e0 62%, #ffe7a3 100%);
  overflow-x: hidden;
}

body { position: relative; }

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

.rainbow-arch {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 140vw;
  height: 70vh;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 120%, transparent 54%, #ff6b9d 55%, #ff6b9d 58%, #ffb347 59%, #ffb347 62%, #ffe66d 63%, #ffe66d 66%, #7ed957 67%, #7ed957 70%, #5ec8f0 71%, #5ec8f0 74%, #9b7bff 75%, #9b7bff 78%, transparent 79%);
  opacity: 0.55;
}

.cloud {
  position: absolute;
  background: #fff;
  border-radius: 50px;
  filter: drop-shadow(0 8px 0 rgba(255, 180, 220, 0.35));
  animation: drift 28s linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud.c1 { width: 180px; height: 54px; top: 8%; left: -10%; animation-duration: 36s; }
.cloud.c1::before { width: 70px; height: 70px; top: -38px; left: 28px; }
.cloud.c1::after { width: 90px; height: 90px; top: -50px; left: 70px; }
.cloud.c2 { width: 140px; height: 44px; top: 18%; left: 40%; animation-duration: 42s; animation-delay: -10s; }
.cloud.c2::before { width: 56px; height: 56px; top: -30px; left: 20px; }
.cloud.c2::after { width: 72px; height: 72px; top: -40px; left: 54px; }
.cloud.c3 { width: 200px; height: 60px; top: 28%; left: 70%; animation-duration: 50s; animation-delay: -20s; }
.cloud.c3::before { width: 80px; height: 80px; top: -44px; left: 30px; }
.cloud.c3::after { width: 96px; height: 96px; top: -54px; left: 80px; }
.cloud.c4 { width: 120px; height: 40px; top: 12%; left: 85%; animation-duration: 32s; animation-delay: -6s; }
.cloud.c4::before { width: 48px; height: 48px; top: -26px; left: 16px; }
.cloud.c4::after { width: 60px; height: 60px; top: -34px; left: 46px; }

.hill {
  position: absolute;
  bottom: -80px;
  border-radius: 50% 50% 0 0;
  opacity: 0.55;
}
.h1 { left: -10%; width: 60%; height: 220px; background: #8fd99a; }
.h2 { left: 30%; width: 55%; height: 260px; background: #7bc47f; }
.h3 { right: -12%; width: 50%; height: 200px; background: #a8e6b0; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(30vw); }
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.hero, .tabs, .stage, .foot {
  position: relative;
  z-index: 2;
}

.hero {
  text-align: center;
  padding: 36px 20px 12px;
}

.hero-badge {
  display: inline-block;
  background: #ff6b9d;
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 1px;
  animation: bounce 1.8s ease-in-out infinite;
  user-select: none;
}
.hero-badge.on {
  background: #7b4baf;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo {
  margin-top: 14px;
  font-size: clamp(36px, 7vw, 72px);
  font-family: "ZCOOL KuaiLe", "Fredoka", sans-serif;
  background: linear-gradient(90deg, #ff6b9d, #ffb347, #ffe66d, #7ed957, #5ec8f0, #9b7bff, #ff6b9d);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 6s linear infinite;
  filter: drop-shadow(3px 4px 0 rgba(255,255,255,0.8));
  letter-spacing: 2px;
}

@keyframes rainbow {
  to { background-position: 200% 0; }
}

.tagline {
  margin-top: 8px;
  font-size: 16px;
  color: #6b3d8a;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.search-box input {
  width: min(420px, 86vw);
  height: 48px;
  border-radius: 999px;
  border: 4px solid #fff;
  padding: 0 18px;
  font: inherit;
  box-shadow: var(--shadow);
  outline: none;
  background: #fffafc;
  color: var(--ink);
}
.search-box input:focus {
  border-color: #c9b6f2;
}

.candy-btn {
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: linear-gradient(#ff8ab8, #ff5e9a);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.candy-btn:active { transform: translate(2px, 3px); box-shadow: 3px 4px 0 rgba(90, 40, 120, 0.18); }
.candy-btn.ghost {
  background: linear-gradient(#b388ff, #7b4baf);
}
.candy-btn.tiny {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 16px 6px;
}

.tab {
  border: 4px solid #fff;
  border-radius: 18px 18px 22px 22px;
  padding: 10px 16px 12px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  min-width: 92px;
  background-size: cover;
  background-position: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.18);
  transform-origin: center bottom;
  transition: transform 0.15s ease;
}
.tab:hover { transform: translateY(-4px) rotate(-1deg); }
.tab.active {
  transform: translateY(-6px) scale(1.06);
  outline: 3px dashed #fff;
  outline-offset: 3px;
}

.stage { padding: 10px 18px 80px; max-width: 1280px; margin: 0 auto; }
.hint { text-align: center; margin: 8px 0 16px; color: #6b3d8a; font-size: 14px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 4px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  animation: popin 0.45s cubic-bezier(.2,1.4,.3,1) both;
}
.card:hover { transform: translateY(-6px) rotate(-0.6deg); }
.card.wide { grid-column: span 2; }
@media (max-width: 700px) { .card.wide { grid-column: span 1; } }

@keyframes popin {
  from { opacity: 0; transform: scale(0.8) translateY(16px); }
}

.thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff, #ffeaf4);
  overflow: hidden;
}
.thumb svg, .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card.landscape .thumb { height: 150px; }
.card.landscape .thumb svg, .card.landscape .thumb img { object-fit: cover; }

.card-body {
  padding: 10px 12px 14px;
  background: linear-gradient(180deg, #fff 0%, #fff5fb 100%);
}
.card-title { font-size: 16px; font-weight: 700; }
.card-tags { margin-top: 4px; font-size: 12px; color: #8a5aaa; }
.heart {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ff8ab8;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(90,40,120,.16);
}
.heart.on { background: #7b4baf; }

.empty { text-align: center; padding: 40px; font-size: 18px; }

.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  border-top: 3px solid #fff;
  font-size: 13px;
}

.modal, .sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(90, 40, 130, 0.35);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden], .sheet[hidden] { display: none; }

.modal-card, .sheet-card {
  width: min(860px, 96vw);
  background: #fffafc;
  border: 5px solid #fff;
  border-radius: 28px;
  box-shadow: 10px 14px 0 rgba(90, 40, 120, 0.22);
  overflow: hidden;
  position: relative;
  animation: popin 0.35s cubic-bezier(.2,1.4,.3,1);
}
.sheet-card { width: min(420px, 94vw); padding: 22px; }
.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ff6b9d;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}
.modal-art {
  height: min(52vh, 420px);
  background:
    radial-gradient(circle at 20% 20%, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 80% 30%, #fff 0 6px, transparent 7px),
    linear-gradient(180deg, #d8f0ff, #ffe4f2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-art svg, .modal-art img { max-width: 100%; max-height: 100%; }
.modal-meta { padding: 16px 20px 22px; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.field { display: block; margin: 12px 0; font-size: 14px; }
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  height: 42px;
  border-radius: 12px;
  border: 3px solid #efd6f3;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}
.sheet-tip { font-size: 13px; color: #8a5aaa; margin: 8px 0 14px; }

.fx-bit {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-confetti {
  width: 10px; height: 16px; border-radius: 2px;
  animation: confetti 900ms ease-out forwards;
}
.fx-star {
  font-size: 22px;
  animation: spark 900ms ease-out forwards;
}
.fx-apple, .fx-cupcake, .fx-balloon {
  animation: fall 1400ms cubic-bezier(.2,.7,.2,1) forwards;
}
.fx-burst {
  animation: burst 700ms ease-out forwards;
}

@keyframes confetti {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; }
}
@keyframes spark {
  0% { transform: scale(0.2) rotate(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: scale(1.4) rotate(120deg) translateY(-40px); opacity: 0; }
}
@keyframes fall {
  0% { transform: translateY(-20px) rotate(0) scale(1); opacity: 1; }
  100% { transform: translateY(70vh) rotate(180deg) scale(0.9); opacity: 0; }
}
@keyframes burst {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
