:root {
  --bg-1: #44f6ff;
  --bg-2: #ff89d2;
  --bg-3: #fff16f;
  --ink: #20114d;
  --hot-pink: #ff2fa0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden auto;
  font-family: "Permanent Marker", cursive;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 164, 221, 0.75), transparent 16%),
    radial-gradient(circle at 85% 18%, rgba(255, 214, 69, 0.72), transparent 17%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}

body.chaos-mode {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  mix-blend-mode: soft-light;
}

body::after {
  background:
    radial-gradient(circle at center, transparent 55%, rgba(255, 255, 255, 0.24)),
    radial-gradient(circle at 20% 70%, rgba(145, 78, 26, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 30%, rgba(145, 78, 26, 0.18) 0 3px, transparent 4px);
  background-size: auto, 120px 120px, 140px 140px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto 18px;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.6);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helper-copy {
  width: min(100%, 760px);
  margin: 14px auto 0;
  padding: 10px 18px;
  border: 3px dashed #fff4d5;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 242, 173, 0.85), rgba(255, 170, 222, 0.85));
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
}

h1 {
  margin: 0 0 12px;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(1.8rem, 3.6vw, 3.3rem);
  line-height: 1.25;
  color: #fffefb;
  text-shadow:
    3px 3px 0 var(--hot-pink),
    6px 6px 0 rgba(32, 17, 77, 0.2);
}

marquee {
  padding: 8px 10px;
  border: 3px ridge #fff;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(255, 246, 165, 0.8));
  font-size: 1rem;
}

.playground {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(280px, 760px) minmax(120px, 180px);
  gap: 18px;
  align-items: start;
  max-width: 1150px;
  margin: 0 auto;
}

.simulator-panel {
  backdrop-filter: blur(8px);
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 18px 40px rgba(56, 20, 99, 0.25),
    inset 0 0 0 4px rgba(255, 255, 255, 0.28);
}

body.chaos-mode .hero,
body.chaos-mode .sticker-column {
  opacity: 0;
  pointer-events: none;
}

body.chaos-mode .playground {
  display: block;
  max-width: none;
}

body.chaos-mode .simulator-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(101, 235, 255, 0.8));
  border-bottom: 4px solid rgba(255, 255, 255, 0.8);
}

.window-bar p {
  margin: 0 0 0 8px;
  font-size: 0.95rem;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(32, 17, 77, 0.18);
}

.pink { background: #ff55c2; }
.cyan { background: #52f8ff; }
.yellow { background: #ffe25d; }

.scene {
  position: relative;
  min-height: 72vh;
  padding: 26px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.9), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12)),
    radial-gradient(circle at 15% 30%, rgba(113, 64, 22, 0.22) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 64%, rgba(113, 64, 22, 0.22) 0 4px, transparent 5px),
    linear-gradient(180deg, #89f8ff 0%, #ffe98e 100%);
  background-size: auto, auto, 130px 130px, 180px 180px, auto;
}

body.chaos-mode .scene {
  min-height: 100vh;
  padding: 36px 22px 22px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.95), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 15% 30%, rgba(113, 64, 22, 0.32) 0 5px, transparent 6px),
    radial-gradient(circle at 82% 64%, rgba(113, 64, 22, 0.32) 0 6px, transparent 7px),
    linear-gradient(120deg, #ff4eb8 0%, #ffe869 22%, #7dff73 44%, #59efff 68%, #c568ff 100%);
  background-size: auto, auto, 100px 100px, 140px 140px, auto;
  animation: chaos-shake 110ms steps(2, end) infinite;
}

.rainbow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 88%);
  height: 180px;
  border-radius: 220px 220px 0 0;
  border: 14px solid transparent;
  border-bottom: 0;
  opacity: 0.85;
  filter: drop-shadow(0 8px 10px rgba(255, 255, 255, 0.55));
}

.rainbow-top {
  top: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)) padding-box,
    linear-gradient(90deg, #ff5cab, #ff9f50, #fff452, #73ff8d, #5fdcff, #b46dff) border-box;
}

.floating-popup {
  position: absolute;
  top: 44px;
  left: 22px;
  width: min(230px, 42vw);
  padding: 12px 14px 14px;
  border: 4px ridge #fff;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 245, 171, 0.96), rgba(255, 174, 225, 0.92));
  box-shadow: 10px 10px 0 rgba(255, 255, 255, 0.3);
  transform: rotate(-4deg);
  animation: wiggle-popup 3.3s ease-in-out infinite;
}

body.chaos-mode .floating-popup {
  z-index: 3;
  top: 76px;
  left: 40px;
  transform: rotate(-8deg) scale(1.08);
}

.floating-popup p {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.2;
}

.popup-title {
  font-family: "Press Start 2P", cursive;
  font-size: 0.62rem;
}

.speech-bubble {
  position: absolute;
  top: 120px;
  right: 12%;
  max-width: 190px;
  padding: 14px 16px;
  border: 3px solid #fff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 6px 6px 0 rgba(255, 47, 160, 0.24);
  font-size: 1rem;
  transform: rotate(3deg);
}

body.chaos-mode .speech-bubble {
  z-index: 3;
  top: 110px;
  right: 40px;
  transform: rotate(6deg) scale(1.12);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 26px;
  border-width: 16px 14px 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.78) transparent transparent;
}

.unicorn-button {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: min(46vw, 290px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 98, 210, 0.35) 55%, rgba(0, 255, 255, 0.32));
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.46),
    0 24px 40px rgba(53, 21, 83, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

body.chaos-mode .unicorn-button {
  top: 44%;
  width: min(54vw, 360px);
  box-shadow:
    0 0 0 16px rgba(255, 255, 255, 0.5),
    0 32px 80px rgba(53, 21, 83, 0.42);
}

.unicorn-button:hover,
.unicorn-button:focus-visible {
  transform: translate(-50%, -52%) scale(1.04);
  box-shadow:
    0 0 0 12px rgba(255, 255, 255, 0.58),
    0 28px 50px rgba(53, 21, 83, 0.34);
}

.unicorn-button:active {
  transform: translate(-50%, -48%) scale(0.98);
}

.unicorn-face {
  font-size: clamp(7rem, 24vw, 12rem);
  filter: drop-shadow(0 8px 8px rgba(255, 255, 255, 0.9));
}

.status-board,
.marquee-stack {
  width: min(92%, 540px);
}

.scene-dock {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(92%, 560px);
  margin: auto auto 0;
  padding-top: 340px;
  pointer-events: none;
}

body.chaos-mode .scene-dock {
  z-index: 3;
  width: min(92vw, 700px);
  padding-top: 420px;
}

.status-board {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 20px rgba(32, 17, 77, 0.12);
}

.status-board p {
  margin: 0;
  font-size: 1rem;
}

.control-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  pointer-events: auto;
}

.control-button {
  border: 3px outset #fff;
  border-radius: 999px;
  padding: 12px 18px;
  background:
    radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #fffcb7, #ff9dda);
  font-family: "Press Start 2P", cursive;
  font-size: 0.72rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(106, 65, 13, 0.22);
}

.control-button.alt {
  background:
    radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #9bffff, #8ff772);
}

.control-button:hover,
.control-button:focus-visible {
  transform: translateY(-2px) rotate(-1deg);
}

.marquee-stack {
  display: grid;
  gap: 8px;
  margin: 0 auto;
}

body.chaos-mode .marquee-stack marquee {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.78), rgba(255, 102, 214, 0.72), rgba(255, 243, 133, 0.76));
}

.sticker-column {
  display: grid;
  gap: 14px;
  padding-top: 36px;
}

.sticker {
  padding: 12px;
  border: 3px dashed #fff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 25%, rgba(122, 69, 19, 0.18) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 55%, rgba(122, 69, 19, 0.18) 0 10px, transparent 11px),
    rgba(255, 255, 255, 0.72);
  background-size: 70px 70px, 110px 110px, auto;
  text-align: center;
  box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.28);
  transform: rotate(-3deg);
}

.right .sticker:nth-child(odd),
.left .sticker:nth-child(even) {
  transform: rotate(4deg);
}

.cursor-star {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 10;
  font-size: 18px;
  transform: translate(-50%, -50%) scale(0.6);
  animation: cursor-pop 700ms ease-out forwards;
}

.particle {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  transform: translate(var(--start-x), var(--start-y)) rotate(0deg) scale(1);
  animation: fly var(--duration) cubic-bezier(0.16, 0.84, 0.27, 1) forwards;
}

.particle.confetti {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--particle-color);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.85);
}

.particle.sparkle,
.particle.emoji {
  font-size: var(--particle-size);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

.burst-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  left: 0;
  top: 0;
  transform: translate(var(--ring-x), var(--ring-y)) scale(0.2);
  pointer-events: none;
  animation: ring-pop 650ms ease-out forwards;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-repeat: repeat;
  animation: drift 24s linear infinite;
}

.stars-a {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 234, 118, 0.95) 0 1px, transparent 1.7px);
  background-size: 130px 130px, 180px 180px;
  background-position: 0 0, 50px 80px;
}

.stars-b {
  background-image: radial-gradient(circle, rgba(255, 117, 214, 0.9) 0 1px, transparent 1.7px);
  background-size: 200px 200px;
  background-position: 40px 120px;
  animation-duration: 34s;
  opacity: 0.3;
}

.blink {
  animation: blink 1s steps(2, start) infinite;
}

.spin-slow {
  animation: spin 7s linear infinite;
}

.wiggle {
  animation: wiggle 1.8s ease-in-out infinite;
}

@keyframes fly {
  0% {
    transform: translate(var(--start-x), var(--start-y)) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(var(--start-x) + var(--dx)), calc(var(--start-y) + var(--dy))) rotate(var(--spin)) scale(1.15);
    opacity: 0;
  }
}

@keyframes ring-pop {
  from {
    opacity: 0.95;
    transform: translate(var(--ring-x), var(--ring-y)) scale(0.2);
  }
  to {
    opacity: 0;
    transform: translate(var(--ring-x), var(--ring-y)) scale(4.3);
  }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}

@keyframes blink {
  50% { opacity: 0.3; }
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50% { transform: rotate(5deg) scale(1.06); }
}

@keyframes wiggle-popup {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-8px); }
}

@keyframes cursor-pop {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1.4);
  }
}

@keyframes chaos-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3px, -4px) rotate(-0.4deg); }
  50% { transform: translate(-4px, 2px) rotate(0.4deg); }
  75% { transform: translate(4px, 3px) rotate(-0.3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@media (max-width: 920px) {
  .playground {
    grid-template-columns: 1fr;
  }

  .sticker-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
  }

  .right {
    order: 3;
  }

  .scene {
    min-height: 78vh;
  }

  .scene-dock {
    padding-top: 360px;
  }

  body.chaos-mode .scene-dock {
    padding-top: 410px;
  }

  .speech-bubble {
    top: 100px;
    right: 8px;
    max-width: 150px;
    font-size: 0.9rem;
  }

  .floating-popup {
    top: 40px;
    left: 14px;
    width: min(200px, 48vw);
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .hero {
    margin-bottom: 12px;
  }

  .scene {
    min-height: 80vh;
    padding: 18px 12px 20px;
  }

  body.chaos-mode .scene {
    padding: 24px 12px 20px;
  }

  .unicorn-button {
    width: min(64vw, 250px);
    top: 42%;
  }

  .scene-dock {
    width: calc(100% - 8px);
    padding-top: 320px;
  }

  body.chaos-mode .scene-dock {
    width: calc(100% - 8px);
    padding-top: 350px;
  }

  .status-board {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .control-row {
    flex-direction: column;
  }

  .control-button {
    width: 100%;
    font-size: 0.62rem;
  }

  .sticker-column {
    grid-template-columns: 1fr;
  }

  .floating-popup {
    top: 20px;
    left: 10px;
    width: min(170px, 52vw);
    padding: 10px 10px 12px;
  }

  .speech-bubble {
    top: 88px;
  }

  body.chaos-mode .floating-popup {
    left: 12px;
    top: 54px;
  }

  body.chaos-mode .speech-bubble {
    right: 12px;
    top: 118px;
  }
}