:root {
  --egg-yellow: #ffd84d;
  --candy-pink: #ff8fb8;
  --mint: #76e4d6;
  --dream-purple: #8a7cff;
  --cream: #fff9f2;
  --cloud: #eaeaf2;
  --ink: #2b2e3a;
  --glass: rgba(255, 255, 255, 0.62);
  --shadow-soft: 0 18px 42px rgba(43, 46, 58, 0.16);
  --hero-1: #8a7cff;
  --hero-2: #76e4d6;
  --hero-3: #ffd84d;
  --hero-4: #ff8fb8;
  --hero-image: url("./assets/gallery-1.png");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #fff2ff, var(--cream) 42%, #f5fff9 100%);
  cursor: none;
}

body.motion-off {
  cursor: auto;
}

body.season-race {
  --hero-1: #6d71ff;
  --hero-2: #54d7ff;
  --hero-3: #a8f0ff;
  --hero-4: #8ac7ff;
}

body.season-fairy {
  --hero-1: #a874ff;
  --hero-2: #ff8fb8;
  --hero-3: #ffd7ef;
  --hero-4: #ffc67d;
}

body.season-scifi {
  --hero-1: #3f5bff;
  --hero-2: #58ffd0;
  --hero-3: #6dd5ff;
  --hero-4: #88a4ff;
}

a {
  color: inherit;
  text-decoration: none;
}

#trail-canvas {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

#custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 22%, var(--egg-yellow) 70%, #ffbf00 100%);
  box-shadow: 0 0 18px rgba(255, 216, 77, 0.9);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
}

#emoji-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  z-index: 120;
  background: linear-gradient(90deg, var(--mint), var(--candy-pink));
}

.easter-egg-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 125;
  background: rgba(43, 46, 58, 0.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.easter-egg-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.top-nav {
  position: sticky;
  top: 14px;
  z-index: 40;
  width: min(1140px, calc(100% - 24px));
  margin: 14px auto;
  padding: 12px 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.top-nav nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-nav nav a {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.top-nav nav a:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: rotate(-2deg);
}

main {
  width: min(1140px, calc(100% - 24px));
  margin: 0 auto 40px;
}

.hero {
  position: relative;
  min-height: 88vh;
  border-radius: 28px;
  overflow: hidden;
  margin-top: 10px;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, var(--hero-1), var(--hero-2), var(--hero-3), var(--hero-4)),
    var(--hero-image);
  background-size: 240% 240%, cover;
  background-position: 50% 50%, center;
  background-blend-mode: soft-light, normal;
  animation: bgFlow 10s ease infinite;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 46%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20, 24, 36, 0.18), rgba(20, 24, 36, 0.38));
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 9vw 8vw;
  max-width: 760px;
}

.hero-float {
  position: absolute;
  z-index: 2;
  width: min(13vw, 140px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 20px 42px rgba(19, 22, 42, 0.3);
  opacity: 0.85;
}

.hero-float-a {
  right: 5%;
  top: 13%;
  transform: rotate(6deg);
}

.hero-float-b {
  right: 12%;
  bottom: 8%;
  transform: rotate(-7deg);
}

.hero-thumbs {
  position: absolute;
  right: 24px;
  bottom: 20px;
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 280px;
  justify-content: flex-end;
}

.hero-autoplay-progress {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

#hero-autoplay-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--egg-yellow), var(--candy-pink));
  transition: width 0.12s linear;
}

.hero-thumb {
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 14px;
  padding: 0;
  width: 74px;
  height: 54px;
  overflow: hidden;
  cursor: pointer;
}

.hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-thumb.is-active {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(118, 228, 214, 0.5);
}

.eyebrow {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  line-height: 1.18;
}

.subtitle {
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero-favorite-tip {
  margin: 10px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.atlas-gallery,
.scene-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.media-card,
.scene-card {
  overflow: hidden;
  padding: 0;
}

.media-card img,
.scene-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.media-card-note,
.scene-card-body {
  padding: 14px 16px 16px;
}

.media-card-note {
  font-weight: 700;
  color: #39415d;
}

.scene-card-body {
  padding: 14px 16px 16px;
}

.scene-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(118, 228, 214, 0.18);
  color: #2d7e74;
  font-size: 12px;
  font-weight: 700;
}

.scene-card-body h3,
.scene-card-body p {
  margin: 0;
}

.scene-card-body p {
  margin-top: 6px;
  color: #5b6176;
}

.section {
  padding: 56px 0 28px;
  margin-top: 18px;
  border-top: 1px solid rgba(138, 124, 255, 0.12);
}

.section:nth-of-type(odd) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  border-radius: 24px;
}

.section-head {
  margin-bottom: 22px;
  padding-left: 6px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}

.section-head p {
  margin: 0;
  color: #4d5162;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.card.with-cover {
  overflow: hidden;
  padding: 0;
}

.card-cover {
  width: 100%;
  height: 155px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 16px 18px 18px;
}

.atlas-gallery,
.scene-gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-card,
.scene-card {
  overflow: hidden;
  padding: 0;
}

.media-card img,
.scene-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.media-card-note,
.scene-card-body {
  padding: 14px 16px 16px;
}

.media-card-note {
  font-weight: 700;
  color: #39415d;
}

.atlas-gallery,
.scene-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.media-card,
.scene-card {
  overflow: hidden;
  padding: 0;
}

.media-card img,
.scene-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.scene-card-body h3 {
  margin: 0 0 8px;
}

.scene-card-body p {
  margin: 0;
  color: #4d5162;
}

.egg-card {
  position: relative;
  overflow: hidden;
}

.egg-card::before {
  content: attr(data-role);
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(138, 124, 255, 0.14);
  color: #5d53c7;
}

.egg-card .avatar {
  font-size: 2rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 216, 77, 0.45), rgba(255, 143, 184, 0.35));
}

.egg-card .rarity {
  margin-bottom: 12px;
}

.rarity {
  margin: 14px 0;
  width: 90px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--dream-purple) calc(var(--value) * 1%), #e7e9f6 0);
  position: relative;
}

.rarity span {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  text-align: center;
  padding: 5px;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.theme-card.cyber {
  background: linear-gradient(145deg, rgba(85, 71, 186, 0.23), rgba(41, 48, 89, 0.3));
}

.theme-card.fairy {
  background: linear-gradient(145deg, rgba(255, 143, 184, 0.24), rgba(118, 228, 214, 0.26));
}

.mini-game {
  margin-top: 16px;
}

.sub-layout {
  margin-top: 16px;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.season-switcher {
  margin-top: 14px;
}

.chip {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.match-output {
  font-weight: 600;
  color: #3b4669;
}

.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip.is-active {
  background: linear-gradient(120deg, var(--mint), #b6fff5);
}

.tabs {
  margin-bottom: 12px;
}

.flip-card {
  perspective: 1000px;
}

.flip-card.is-hidden {
  display: none;
}

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

.flip-inner {
  position: relative;
  min-height: 220px;
  transition: transform 0.65s ease;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-inner,
.flip-card:focus-within .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 20px;
  backface-visibility: hidden;
  box-shadow: var(--shadow-soft);
}

.flip-face.front {
  background: linear-gradient(145deg, rgba(255, 216, 77, 0.35), rgba(138, 124, 255, 0.33));
}

.flip-face.back {
  transform: rotateY(180deg);
  background: rgba(255, 255, 255, 0.88);
}

.section-dark {
  border-radius: 26px;
  padding: 48px 20px 24px;
  background: linear-gradient(135deg, #252040, #3f2f60, #563570);
  color: #fff;
}

.section-dark .section-head p {
  color: rgba(255, 255, 255, 0.84);
}

.calculator {
  display: grid;
  gap: 14px;
  color: #2d3144;
}

.calculator label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input {
  border: 1px solid #ccd1e8;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
}

textarea {
  border: 1px solid #ccd1e8;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  resize: vertical;
}

.result {
  padding: 12px;
  border-radius: 14px;
  background: #f4f7ff;
  border: 1px solid #d8e1ff;
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(120deg, #8a7cff, #ff8fb8);
}

.map-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compare-result {
  margin-top: 12px;
}

.comment-list {
  margin: 12px 0 0;
  padding-left: 16px;
}

.comment-list li {
  margin-bottom: 6px;
  color: #3f465d;
}

.about-card {
  text-align: center;
  padding: 28px;
}

.inspiration-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.3fr 1fr 1fr;
}

.inspire-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-height: 220px;
}

.inspire-card.big {
  min-height: 300px;
}

.inspire-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.inspire-card:hover img {
  transform: scale(1.05);
}

.inspire-note {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 32, 49, 0.72);
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.media-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  justify-content: start;
}

.media-tile {
  border: none;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
}

.media-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.media-tile span {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  color: #39415d;
}

.random-media-btn {
  background: linear-gradient(120deg, rgba(118, 228, 214, 0.95), rgba(255, 143, 184, 0.92));
  color: #1f2742;
}

.media-random-hint {
  margin: 10px 2px 0;
  min-height: 24px;
  color: #66708f;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.media-random-hint.is-flashing {
  transform: translateY(-2px);
  opacity: 1;
}

.media-tile.is-picked {
  animation: mediaPick 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mediaPick {
  0% { transform: scale(1); }
  35% { transform: scale(0.96) rotate(-1deg); }
  100% { transform: scale(1); }
}

.media-preview {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(16, 19, 33, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.media-preview.show {
  display: flex;
}

.media-preview-inner {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 16px 10px;
  position: relative;
}

.media-preview-inner img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 14px;
  background: #f6f7fb;
}

.media-preview-inner p {
  margin: 10px 2px 4px;
  font-weight: 600;
  color: #333c59;
}

.media-preview-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(32, 38, 62, 0.75);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.about-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary {
  color: #2d244f;
  background: linear-gradient(130deg, var(--egg-yellow), var(--candy-pink));
  box-shadow: 0 10px 22px rgba(255, 143, 184, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(116, 126, 158, 0.35);
}

.btn-mini {
  font-size: 12px;
  padding: 8px 11px;
  background: #fff;
}

.footer {
  text-align: center;
  padding: 26px 0 34px;
  color: #616a85;
}

.hover-wiggle {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-wiggle:hover {
  transform: translateY(-5px);
  animation: wiggle 0.45s ease;
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.fall-emoji {
  position: absolute;
  font-size: 24px;
  animation: dropOut 1s ease forwards;
}

@keyframes wiggle {
  0%,
  100% {
    transform: translateY(-5px) rotate(0deg);
  }
  35% {
    transform: translateY(-6px) rotate(-2.5deg);
  }
  65% {
    transform: translateY(-4px) rotate(2.5deg);
  }
}

@keyframes bgFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes dropOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(72px) scale(0.6);
  }
}

@media (max-width: 900px) {
  .top-nav {
    border-radius: 24px;
    position: static;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 72vh;
  }

  .hero-float {
    display: none;
  }

  .inspiration-grid {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  html,
  body {
    cursor: auto;
  }

  #custom-cursor,
  #trail-canvas {
    display: none;
  }

  .section {
    padding-top: 40px;
  }

  .hero-thumbs {
    right: 14px;
    left: 14px;
    justify-content: center;
    max-width: none;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}

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

  html,
  body {
    cursor: auto;
  }

  #custom-cursor,
  #trail-canvas {
    display: none;
  }
}
