:root {
  --sky: #93c8f5;
  --grass-top: #d5f4a2;
  --grass-bottom: #8ce99a;
  --ink: #2c1a4a;
  --ink-soft: #3d2460;
  --brown: #5b3d14;
  --border: #3d2a5c;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Trebuchet MS", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--grass-bottom);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* --- Programmatic world background (document-tall, scrolls with page) --- */

#world-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#world-bg > * {
  position: absolute;
  left: 0;
  right: 0;
}

.wb-sky {
  top: 0;
  left: 0;
  right: 0;
}

.wb-white,
.wb-grass,
.wb-cloudsbg,
.wb-groundtop,
.wb-tufts,
.wb-decor,
.wb-sea-fill {
  left: 0;
  right: 0;
}

.wb-sea {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.wb-cloudsbg,
.wb-groundtop {
  height: 0;
  overflow: visible;
}

.wb-cloudsbg img,
.wb-groundtop img {
  position: absolute;
  display: block;
  max-width: none;
}

.wb-tufts,
.wb-decor,
.wb-clouds {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.wb-tufts img,
.wb-decor img,
.wb-clouds img {
  position: absolute;
  max-width: none;
  image-rendering: auto;
}

.wb-sea-line {
  position: absolute;
  height: 2px;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

/* --- Page content --- */

.page {
  position: relative;
  z-index: 1;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(4deg);
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(28px, 6vw, 56px) 20px 48px;
}

.logo {
  width: min(520px, 88vw);
  margin-bottom: 10px;
  filter: drop-shadow(0 10px 0 rgba(44, 26, 74, 0.18));
  animation: logo-float 3.2s ease-in-out infinite;
}

.tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.6vw, 2rem);
  line-height: 1.2;
  color: var(--ink-soft);
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.9);
  max-width: 18ch;
  margin: 4px auto 10px;
}

.lede {
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.45;
  color: var(--brown);
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.85);
  max-width: 34ch;
  margin: 0 auto 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: center;
}

.play-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 500 / 258;
  width: min(240px, 50vw);
  padding: 0 16px;
  border: none;
  background-color: transparent;
  background-image: url("assets/button.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: #2a1848;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.play-button:hover {
  transform: scale(1.05);
}

.play-button:active {
  transform: scale(0.97);
}

.ghost-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-soft);
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  border-bottom: 2.5px solid rgba(61, 42, 92, 0.35);
  padding-bottom: 2px;
  transition:
    color 0.14s ease,
    border-color 0.14s ease;
}

.ghost-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* --- Shared sections --- */

.modes,
.gallery,
.ranks {
  position: relative;
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 24px;
}

.modes h2,
.gallery h2,
.ranks h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.15rem);
  text-align: center;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.section-lede {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 8px auto 28px;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.modes {
  overflow: visible;
}

.section-flower {
  position: absolute;
  width: clamp(56px, 10vw, 88px);
  pointer-events: none;
  filter: drop-shadow(0 4px 0 rgba(44, 26, 74, 0.14));
  z-index: 0;
}

.section-flower.left {
  left: -8px;
  top: 64px;
  transform: rotate(-12deg);
  animation: bob 5s ease-in-out infinite;
}

.section-flower.right {
  right: -8px;
  top: 80px;
  transform: rotate(14deg);
  animation: bob 4.2s ease-in-out infinite;
  animation-delay: 0.8s;
}

.modes h2,
.modes .section-lede,
.mode-list {
  position: relative;
  z-index: 1;
}

.mode-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px 20px;
  text-align: center;
  border: 3.5px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.94) 0%,
    rgba(255, 244, 228, 0.9) 100%
  );
  box-shadow: 0 7px 0 rgba(61, 42, 92, 0.22);
  transition: transform 0.16s ease;
}

.mode:hover {
  transform: translateY(-4px);
}

.mode img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-top: -38px;
  filter: drop-shadow(0 4px 0 rgba(44, 26, 74, 0.15));
}

.mode h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.mode p {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-soft);
}

.mode:nth-child(1) {
  background: linear-gradient(
    180deg,
    rgba(255, 236, 153, 0.95) 0%,
    rgba(255, 248, 220, 0.92) 100%
  );
}

.mode:nth-child(2) {
  background: linear-gradient(
    180deg,
    rgba(186, 231, 248, 0.85) 0%,
    rgba(255, 252, 245, 0.92) 100%
  );
}

.mode:nth-child(3) {
  background: linear-gradient(
    180deg,
    rgba(254, 140, 182, 0.35) 0%,
    rgba(255, 252, 245, 0.92) 100%
  );
}

.gallery-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  border-radius: 24px;
  border: 3.5px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(186, 231, 248, 0.55) 0%,
    rgba(255, 252, 245, 0.9) 100%
  );
  box-shadow: 0 6px 0 rgba(61, 42, 92, 0.18);
  transition: transform 0.16s ease;
}

.gallery-row img:hover {
  transform: scale(1.04) rotate(-2deg);
}

.ranks {
  padding-bottom: 8px;
}

.ranks-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 22px 24px;
  border: 4px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.94) 0%,
    rgba(255, 244, 228, 0.92) 100%
  );
  box-shadow:
    0 8px 0 rgba(61, 42, 92, 0.26),
    0 16px 32px rgba(40, 20, 60, 0.16);
}

.trophy {
  width: 84px;
  height: 84px;
  margin-top: -48px;
  filter: drop-shadow(0 5px 0 rgba(44, 26, 74, 0.18));
  animation: bob 3.6s ease-in-out infinite;
}

.ranks-copy p {
  font-weight: 700;
  max-width: 36ch;
  line-height: 1.45;
  color: var(--ink-soft);
}

.badge-row {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.badge-row img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(44, 26, 74, 0.15));
}

.site-footer {
  position: relative;
  margin-top: 40px;
}

.bottom-art {
  width: min(920px, 100%);
  margin: 0 auto -8px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(40, 20, 60, 0.18));
}

.footer-bar {
  background: linear-gradient(180deg, #6bb85a 0%, #4f9a45 100%);
  border-top: 4px solid #3d2a5c;
  padding: 18px 20px 28px;
  text-align: center;
  color: #fff8e8;
  text-shadow: 0 1px 0 rgba(44, 26, 74, 0.35);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.footer-meta {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.95;
}

@media (max-width: 760px) {
  .section-flower {
    display: none;
  }

  .mode-list {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

  .mode img {
    margin-top: -18px;
  }

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

@media (max-width: 480px) {
  .hero {
    padding-top: 36px;
  }

  .gallery-row img {
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
