:root {
  --yellow: #fff200;
  --cyan: #00e5ff;
  --pink: #ff3bd4;
  --green: #35ff5b;
  --black: #080808;
  --paper: #fffbd1;
  --red: #ff2c2c;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--black);
  font-family: "Comic Sans MS", "Comic Sans", "Trebuchet MS", cursive, sans-serif;
  background:
    radial-gradient(circle at 15px 15px, rgba(255, 255, 255, 0.8) 2px, transparent 3px),
    linear-gradient(45deg, #00a6ff 0 25%, #ffec00 25% 50%, #ff4bd8 50% 75%, #39ff14 75%);
  background-size: 32px 32px, 100% 100%;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0 2px,
    transparent 2px 10px
  );
  pointer-events: none;
}

.ticker {
  position: sticky;
  top: 0;
  z-index: 10;
  overflow: hidden;
  border-block: 4px ridge var(--yellow);
  color: var(--yellow);
  background: #000080;
  font: 700 1rem/1.8 "Courier New", monospace;
  white-space: nowrap;
}

.ticker span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  animation: crawl 18s linear infinite;
}

main {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.hero,
.panel {
  border: 7px ridge #f5f5f5;
  box-shadow: 10px 10px 0 #000;
  background: var(--paper);
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 340px);
  gap: 24px;
  align-items: center;
  min-height: 440px;
  padding: clamp(18px, 5vw, 46px);
  background:
    linear-gradient(135deg, rgba(255, 59, 212, 0.23), rgba(0, 229, 255, 0.24)),
    var(--paper);
}

.blink {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 8px;
  color: white;
  background: #d90000;
  font-weight: 700;
  text-transform: uppercase;
  animation: blink 0.8s steps(2, jump-none) infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #ff0055;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.9;
  text-shadow: 5px 5px 0 var(--yellow), 9px 9px 0 var(--cyan), 13px 13px 0 #000;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  color: #000080;
  text-shadow: 3px 3px 0 var(--yellow);
}

h3 {
  margin-bottom: 12px;
  color: #111;
  font-size: 1.25rem;
}

.subtitle {
  max-width: 58ch;
  margin-bottom: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.35;
}

.portrait-wrap {
  margin: 0;
  padding: 14px;
  transform: rotate(3deg);
  border: 4px solid #000;
  background: white;
  text-align: center;
  box-shadow: 8px 8px 0 var(--pink);
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: auto;
  border: 3px inset #888;
}

figcaption {
  margin-top: 8px;
  font-weight: 700;
}

.panel {
  margin-top: 34px;
  padding: clamp(16px, 4vw, 34px);
}

.section-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  color: #000;
  background: var(--green);
  border: 2px solid #000;
  font: 700 0.95rem "Courier New", monospace;
  text-transform: uppercase;
}

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

.graph-card {
  min-height: 280px;
  padding: 16px;
  border: 4px outset #d5d5d5;
  background: #fff;
}

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 150px;
  padding: 12px;
  border: 3px inset #b8b8b8;
  background:
    repeating-linear-gradient(0deg, #eef 0 1px, transparent 1px 25%),
    #f9f9ff;
}

.bars span {
  flex: 1;
  min-width: 14px;
  border: 2px solid #111;
  background: linear-gradient(#fffb00, #ff2c2c);
  animation: grow 900ms ease-out both;
}

.heart-bars span {
  background: linear-gradient(#ffd6ef, #ff35a7);
}

.party-bars span {
  background: linear-gradient(#00ffb7, #0057ff);
}

.graph-card p {
  margin: 12px 0 0;
  line-height: 1.35;
}

.wheel-zone {
  display: grid;
  grid-template-columns: minmax(240px, 0.76fr) minmax(340px, 1.24fr);
  gap: 26px;
  align-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 242, 0, 0.24) 0 12px, rgba(255, 59, 212, 0.2) 12px 24px),
    #fff;
}

.wheel-copy p:not(.section-kicker) {
  font-size: 1.15rem;
  line-height: 1.4;
}

button {
  min-width: 150px;
  min-height: 52px;
  margin: 8px 0 14px;
  border: 4px outset #d1d1d1;
  color: white;
  background: #ff0055;
  font: 900 1.25rem "Courier New", monospace;
  cursor: pointer;
  box-shadow: 5px 5px 0 #000;
}

button:active {
  border-style: inset;
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #000;
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.6);
}

output {
  display: block;
  min-height: 54px;
  padding: 10px;
  border: 3px inset #a0a0a0;
  background: #000;
  color: var(--green);
  font: 700 1rem/1.4 "Courier New", monospace;
}

.wheel-shell {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin-inline: auto;
}

.pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 54px solid #111;
  filter: drop-shadow(3px 3px 0 var(--yellow));
}

.wheel {
  position: absolute;
  inset: 0;
  border: 8px ridge #f6f6f6;
  border-radius: 50%;
  background: conic-gradient(
    #ff0055 0deg 51.42deg,
    #fff200 51.42deg 102.84deg,
    #00e5ff 102.84deg 154.26deg,
    #35ff5b 154.26deg 205.68deg,
    #ff8c00 205.68deg 257.1deg,
    #b300ff 257.1deg 308.52deg,
    #ff5d8f 308.52deg 360deg
  );
  box-shadow: 8px 8px 0 #000;
  transition: transform 4.2s cubic-bezier(0.12, 0.77, 0.08, 1);
}

.wheel::after {
  content: "33";
  position: absolute;
  inset: 39%;
  display: grid;
  place-items: center;
  border: 5px outset #ddd;
  border-radius: 50%;
  color: #ff0055;
  background: white;
  font: 900 clamp(1.7rem, 6vw, 3.2rem) "Courier New", monospace;
}

.slice {
  --angle: calc(var(--i) * 51.428deg + 25.714deg);
  position: absolute;
  top: 50%;
  left: 50%;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-143%) rotate(calc(-1 * var(--angle)));
}

.slice img,
.image-fallback {
  width: 112px;
  height: 112px;
  border: 3px solid #000;
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}

.image-fallback {
  display: grid;
  place-items: center;
  padding: 4px;
  color: #000080;
  font: 900 0.82rem/1 "Courier New", monospace;
  text-align: center;
}

#balloon-field {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.pop-score {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  min-width: 142px;
  padding: 9px 12px;
  border: 4px ridge var(--yellow);
  color: var(--green);
  background: #000080;
  box-shadow: 5px 5px 0 #000;
  font-family: "Courier New", monospace;
  text-align: center;
}

.pop-score span {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pop-score strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.pop-score.bump {
  animation: scoreBump 180ms ease-out;
}

.balloon {
  position: absolute;
  bottom: -130px;
  width: 54px;
  height: 68px;
  border-radius: 50% 50% 48% 48%;
  background: var(--balloon-color);
  box-shadow: inset -10px -14px 0 rgba(0, 0, 0, 0.18), 3px 4px 0 rgba(0, 0, 0, 0.18);
  cursor: crosshair;
  pointer-events: auto;
  animation: floatUp var(--float-speed) linear forwards;
}

.balloon::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 13px;
  width: 12px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -56px;
  width: 2px;
  height: 58px;
  background: #222;
  transform: translateX(-50%);
}

.balloon.popped {
  animation: pop 170ms ease-out forwards;
}

@keyframes crawl {
  to {
    transform: translateX(-100%);
  }
}

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

@keyframes grow {
  from {
    height: 0;
  }
}

@keyframes floatUp {
  to {
    transform: translateY(calc(-100vh - 180px)) rotate(12deg);
  }
}

@keyframes pop {
  to {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes scoreBump {
  50% {
    transform: scale(1.12) rotate(-2deg);
  }
}

@media (max-width: 820px) {
  .hero,
  .wheel-zone,
  .graph-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .portrait-wrap {
    width: min(100%, 320px);
    margin-inline: auto;
  }

  .slice {
    width: 76px;
    height: 76px;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-135%) rotate(calc(-1 * var(--angle)));
  }

  .slice img,
  .image-fallback {
    width: 74px;
    height: 74px;
    font-size: 0.7rem;
  }
}
