:root {
  color-scheme: light;
  --blue: #0057a8;
  --deep-blue: #002f6c;
  --sky: #72d7ff;
  --yellow: #ffd447;
  --orange: #ff8a2a;
  --red: #e63246;
  --green: #0f9f6e;
  --cream: #fff7df;
  --ink: #10233f;
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 80px rgba(0, 38, 92, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 212, 71, 0.68), transparent 24rem),
    radial-gradient(circle at 85% 7%, rgba(255, 255, 255, 0.82), transparent 18rem),
    linear-gradient(180deg, #7addff 0%, #d7f7ff 48%, #eaf8de 49%, #77cf86 100%);
  cursor: crosshair;
}

button,
a {
  font: inherit;
}

.sky,
.spark-layer,
.name-layer,
.cursor-orbit {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.sky {
  z-index: 0;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 4rem;
  right: 9vw;
  width: 9rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, #fff8a9 0 25%, var(--yellow) 28% 64%, #ffb033 68%);
  box-shadow: 0 0 90px rgba(255, 204, 64, 0.86);
  animation: sunPulse 5s ease-in-out infinite;
}

.cloud {
  position: absolute;
  width: 12rem;
  height: 4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  filter: drop-shadow(0 12px 18px rgba(47, 123, 180, 0.16));
  animation: drift linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 1.3rem;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 1.6rem;
  width: 5rem;
  height: 5rem;
}

.cloud::after {
  right: 2.2rem;
  width: 6rem;
  height: 6rem;
}

.cloud-one {
  top: 6rem;
  left: -13rem;
  animation-duration: 48s;
}

.cloud-two {
  top: 14rem;
  left: -18rem;
  transform: scale(0.72);
  animation-duration: 66s;
  animation-delay: -22s;
}

.cloud-three {
  top: 23rem;
  left: -14rem;
  transform: scale(0.54);
  animation-duration: 58s;
  animation-delay: -41s;
}

.balloon {
  position: absolute;
  width: 3rem;
  height: 4rem;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(135deg, var(--red), #ff89a1);
  box-shadow: inset -10px -8px 0 rgba(0, 0, 0, 0.08);
  animation: balloonFloat 12s ease-in-out infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 4.5rem;
  background: rgba(16, 35, 63, 0.35);
}

.balloon-one {
  left: 8vw;
  top: 17vh;
}

.balloon-two {
  right: 16vw;
  top: 29vh;
  background: linear-gradient(135deg, var(--blue), #8be4ff);
  animation-delay: -5s;
}

.stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 212, 71, 0.9) 0 1.5px, transparent 2px);
  background-position: 12% 20%, 80% 14%;
  background-size: 10rem 8rem, 14rem 10rem;
  transition: opacity 500ms ease;
}

body.night-mode .stars {
  opacity: 1;
}

body.night-mode {
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 212, 71, 0.2), transparent 22rem),
    linear-gradient(180deg, #061a46 0%, #113d78 50%, #124a4e 51%, #0f693c 100%);
}

.park {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 3rem);
  gap: clamp(1.5rem, 3vw, 3rem);
}

.hero {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 2rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.48)),
    linear-gradient(90deg, rgba(0, 87, 168, 0.12), rgba(255, 212, 71, 0.22), rgba(230, 50, 70, 0.12));
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
  transform-style: preserve-3d;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: white;
  background: linear-gradient(90deg, var(--blue), var(--green));
  font-family: Fredoka, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(0, 87, 168, 0.25);
}

.eyebrow::before,
.eyebrow::after {
  content: "★";
  color: var(--yellow);
}

h1 {
  margin: 0;
  color: var(--deep-blue);
  font-size: clamp(3.25rem, 10vw, 8.8rem);
  line-height: 0.84;
  letter-spacing: -0.08em;
  text-shadow: 0 0.08em 0 rgba(255, 212, 71, 0.72);
}

.subtitle {
  max-width: 760px;
  margin: 1.4rem auto 0;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  line-height: 1.55;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  perspective: 1200px;
}

.time-card {
  position: relative;
  min-height: clamp(9rem, 17vw, 14rem);
  padding: clamp(1rem, 2vw, 1.4rem);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 1.45rem;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 223, 0.84)),
    repeating-linear-gradient(45deg, rgba(0, 87, 168, 0.1) 0 12px, rgba(255, 212, 71, 0.14) 12px 24px);
  box-shadow: 0 16px 36px rgba(0, 47, 108, 0.18);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.time-card::before {
  content: "";
  position: absolute;
  inset: -65% -20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  transform: rotate(22deg) translateX(-70%);
  animation: shine 4.5s ease-in-out infinite;
}

.time-card:hover {
  box-shadow: 0 24px 48px rgba(0, 47, 108, 0.26);
}

.value,
.label {
  position: relative;
  display: block;
}

.value {
  color: var(--red);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.value.tick {
  animation: numberPop 400ms cubic-bezier(0.2, 1.8, 0.3, 1);
}

.label {
  margin-top: 0.5rem;
  color: var(--deep-blue);
  font-family: Fredoka, Inter, sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 14px 28px rgba(230, 50, 70, 0.24);
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.ghost-button {
  color: var(--deep-blue);
  background: linear-gradient(135deg, white, var(--yellow));
}

.primary-button:hover,
.ghost-button:hover {
  filter: saturate(1.2);
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 20px 38px rgba(0, 47, 108, 0.22);
}

.primary-button:active,
.ghost-button:active {
  transform: translateY(1px) scale(0.98);
}

.ride-area {
  position: relative;
  width: min(1180px, 100%);
  min-height: clamp(22rem, 42vw, 34rem);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.52)),
    radial-gradient(circle at 75% 78%, rgba(0, 87, 168, 0.26), transparent 18rem),
    linear-gradient(180deg, transparent 0 62%, rgba(255, 212, 71, 0.32) 63%, rgba(0, 87, 168, 0.12) 100%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.track-svg {
  position: absolute;
  inset: 9% -2% auto;
  width: 104%;
  height: 76%;
  overflow: visible;
}

.track,
.track-shadow,
.track-rail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-shadow {
  stroke: rgba(0, 35, 85, 0.22);
  stroke-width: 30;
  transform: translateY(18px);
}

.track {
  stroke: var(--deep-blue);
  stroke-dasharray: 14 18;
  stroke-width: 18;
  animation: trackDash 1.1s linear infinite;
}

.track-rail {
  stroke: var(--red);
  stroke-width: 8;
}

.coaster {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  display: flex;
  gap: 0.2rem;
  transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scale(var(--train-scale, 1));
  transform-origin: center;
  filter: drop-shadow(0 14px 12px rgba(0, 47, 108, 0.28));
  transition: filter 180ms ease;
}

.coaster.boost {
  filter: drop-shadow(0 0 20px rgba(255, 212, 71, 0.95)) drop-shadow(0 16px 16px rgba(0, 47, 108, 0.32));
}

.car {
  position: relative;
  width: clamp(2.6rem, 6vw, 4.5rem);
  height: clamp(1.7rem, 3.8vw, 3rem);
  border: 4px solid var(--deep-blue);
  border-radius: 0.55rem 0.55rem 1rem 1rem;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
}

.car::before,
.car::after {
  content: "";
  position: absolute;
  bottom: -0.55rem;
  width: 0.62rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px white;
}

.car::before {
  left: 0.5rem;
}

.car::after {
  right: 0.5rem;
}

.car span {
  position: absolute;
  top: -1.1rem;
  left: 50%;
  width: 1.15rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 1.1rem 0.2rem 0 var(--blue);
  transform: translateX(-50%);
  animation: riders 320ms ease-in-out infinite;
}

.car-two {
  background: linear-gradient(135deg, #53d68e, var(--blue));
}

.car-three {
  background: linear-gradient(135deg, #ffffff, var(--red));
}

.loop {
  position: absolute;
  z-index: 1;
  width: clamp(8rem, 18vw, 15rem);
  aspect-ratio: 1;
  border: 12px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  animation: loopSpin 12s linear infinite;
}

.loop-one {
  left: 14%;
  top: 26%;
}

.loop-two {
  right: 13%;
  top: 16%;
  width: clamp(6rem, 14vw, 11rem);
  animation-direction: reverse;
}

.tower {
  position: absolute;
  bottom: 0;
  width: 8rem;
  height: 62%;
  background:
    linear-gradient(60deg, transparent 45%, rgba(0, 47, 108, 0.34) 46% 54%, transparent 55%),
    linear-gradient(-60deg, transparent 45%, rgba(0, 47, 108, 0.34) 46% 54%, transparent 55%);
  background-size: 2.5rem 3rem;
  opacity: 0.55;
}

.tower-left {
  left: 7%;
}

.tower-right {
  right: 8%;
  height: 72%;
}

.water-splash {
  position: absolute;
  right: 16%;
  bottom: 9%;
  width: 12rem;
  height: 4rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.92), rgba(60, 192, 255, 0.64), transparent 72%);
  animation: splash 1.8s ease-in-out infinite;
}

.speed-meter {
  position: absolute;
  left: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 4;
  width: min(18rem, calc(100% - 2rem));
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 1.2rem;
  background: var(--glass);
  box-shadow: 0 18px 32px rgba(0, 47, 108, 0.18);
  backdrop-filter: blur(12px);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.meter-label,
.meter-value {
  display: block;
  font-weight: 900;
}

.meter-label {
  color: var(--deep-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meter-value {
  margin: 0.25rem 0 0.75rem;
  color: var(--red);
  font-size: 2rem;
}

.meter-bar {
  display: block;
  height: 0.85rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 47, 108, 0.14);
}

.meter-bar span {
  display: block;
  width: 87%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width 220ms ease;
}

.name-layer {
  z-index: 8;
}

.bouncer {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  min-width: 7.2rem;
  padding: 0.75rem 1rem;
  border: 3px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--red));
  box-shadow: 0 15px 34px rgba(0, 47, 108, 0.28);
  font-family: Fredoka, Inter, sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
  user-select: none;
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--rot)) scale(var(--scale, 1));
  pointer-events: auto;
  cursor: grab;
}

.bouncer:nth-child(2n) {
  background: linear-gradient(135deg, var(--green), var(--deep-blue));
}

.bouncer:nth-child(3n) {
  background: linear-gradient(135deg, var(--orange), var(--red));
}

.bouncer.grabbing {
  cursor: grabbing;
  z-index: 9;
  --scale: 1.16;
}

.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: hsl(var(--hue), 95%, 62%);
  box-shadow: 0 0 18px hsl(var(--hue), 95%, 62%);
  transform: translate(-50%, -50%);
  animation: sparkFly var(--duration) ease-out forwards;
}

.cursor-orbit {
  z-index: 10;
  width: 3.3rem;
  height: 3.3rem;
  inset: auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-top-color: var(--red);
  border-right-color: var(--yellow);
  border-radius: 50%;
  translate: -50% -50%;
  opacity: 0;
  mix-blend-mode: screen;
  animation: orbitSpin 900ms linear infinite;
  transition: opacity 180ms ease;
}

body.pointer-active .cursor-orbit {
  opacity: 0.9;
}

noscript {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 1rem;
  max-width: min(34rem, calc(100% - 2rem));
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  color: white;
  background: var(--red);
  transform: translateX(-50%);
}

@keyframes sunPulse {
  50% {
    transform: scale(1.08) rotate(10deg);
  }
}

@keyframes drift {
  to {
    transform: translateX(calc(100vw + 22rem));
  }
}

@keyframes balloonFloat {
  50% {
    transform: translateY(-2.4rem) rotate(5deg);
  }
}

@keyframes shine {
  45%,
  100% {
    transform: rotate(22deg) translateX(90%);
  }
}

@keyframes numberPop {
  50% {
    transform: scale(1.12) rotate(-2deg);
  }
}

@keyframes trackDash {
  to {
    stroke-dashoffset: -32;
  }
}

@keyframes riders {
  50% {
    transform: translateX(-50%) translateY(-0.25rem);
  }
}

@keyframes loopSpin {
  to {
    rotate: 360deg;
  }
}

@keyframes splash {
  50% {
    transform: scale(1.16, 0.72);
    opacity: 0.62;
  }
}

@keyframes sparkFly {
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.1) rotate(540deg);
  }
}

@keyframes orbitSpin {
  to {
    rotate: 360deg;
  }
}

@media (max-width: 760px) {
  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    border-radius: 1.4rem;
  }

  .ride-area {
    min-height: 26rem;
  }

  .bouncer {
    min-width: 5.8rem;
    padding: 0.55rem 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
