:root {
  --pink: #ff00c8;
  --purple: #7a2bff;
  --yellow: #fff200;
  --cyan: #00ffd5;
  --ink: #1e003c;
  --spring: linear(0, 0.016 0.5%, 0.06 1%, 0.226 2%, 1.116 5.4%, 1.375 6.6%, 1.527 7.7%, 1.565 8.2%, 1.585 8.8%, 1.581 9.3%, 1.559 9.8%, 1.458 10.9%, 0.937 14.3%, 0.784 15.5%, 0.693 16.6%, 0.67 17.1%, 0.657 17.7%, 0.671 18.7%, 0.729 19.8%, 1.042 23.3%, 1.13 24.5%, 1.182 25.6%, 1.201 26.7%, 1.192 27.7%, 1.156 28.8%, 0.977 32.2%, 0.925 33.4%, 0.894 34.5%, 0.882 35.6%, 0.887 36.6%, 0.907 37.7%, 1.045 42.4%, 1.069 44.5%, 1.059 46.3%, 0.979 50.9%, 0.96 53.4%, 0.966 55.3%, 1.013 59.9%, 1.024 62.3%, 0.986 71.2%, 1.008 79.9%, 0.995 88.9%, 1);
  --display: "Bangers", "Impact", "Arial Black", sans-serif;
  --body: "Comic Neue", "Comic Sans MS", "Chalkboard SE", "Comic Sans", cursive, sans-serif;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: clip;
  background:
    radial-gradient(circle at 20% 10%, #ffffff55 0 2px, transparent 3px) 0 0 / 60px 60px,
    radial-gradient(circle at 70% 60%, #fff20088 0 2px, transparent 3px) 0 0 / 90px 90px,
    linear-gradient(160deg, var(--pink) 0%, var(--purple) 55%, #1d7bff 100%) fixed;
  min-block-size: 100dvh;
}

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .03em; margin: 0; text-wrap: balance; }

a { color: inherit; }

.skip {
  position: absolute; inset-inline-start: .5rem; inset-block-start: -4rem;
  background: var(--yellow); padding: .5rem 1rem; border: 3px solid var(--ink); z-index: 10;
}
.skip:focus { inset-block-start: .5rem; }

:focus-visible { outline: 4px dashed var(--yellow); outline-offset: 4px; }

/* ---------- Top bar ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .6rem 1rem;
  background: linear-gradient(90deg, #000 0%, #2a0057 100%);
  border-block-end: 4px ridge var(--yellow);
}
.top ul { display: flex; flex-wrap: wrap; gap: .25rem .4rem; list-style: none; margin: 0; padding: 0; }
.top li + li::before { content: "·"; color: var(--yellow); margin-inline-end: .4rem; }
.top nav a {
  color: var(--cyan); font-weight: 700; text-decoration: underline wavy var(--pink);
  text-underline-offset: 4px;
}
.top nav a:hover { color: var(--yellow); }

.sound {
  font: 700 1rem var(--body); cursor: pointer;
  min-block-size: 2.25rem; padding: .25rem .8rem;
  color: var(--ink); background: linear-gradient(#fff, #c9c9c9);
  border: 3px outset #eee; border-radius: 6px;
}
.sound[aria-pressed="true"] { background: linear-gradient(var(--yellow), #ffb300); border-style: inset; }

/* ---------- Ticker ---------- */
.ticker {
  display: flex; align-items: center;
  background: var(--yellow); color: var(--ink);
  border-block: 3px solid var(--ink);
  font-weight: 700;
}
.ticker-track { flex: 1; overflow: hidden; min-inline-size: 0; }
.ticker-list {
  display: flex; list-style: none; margin: 0; padding: .4rem 0;
  inline-size: max-content;
}
.ticker-list li { padding-inline: 1.5rem; white-space: nowrap; }
.ticker-list li::before { content: "★ "; color: var(--pink); }
.ticker-track.is-running .ticker-list {
  @media (prefers-reduced-motion: no-preference) {
    animation: ticker 30s linear infinite;
  }
}
.ticker-track.is-paused .ticker-list { animation-play-state: paused; }
@keyframes ticker { to { translate: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { overflow-x: auto; }
  .ticker-pause { display: none; }
}
.ticker-pause {
  flex: none; font: 700 .9rem var(--body); cursor: pointer;
  min-block-size: 2.25rem; margin: .2rem .5rem; padding: .2rem .7rem;
  background: var(--ink); color: var(--yellow); border: 2px solid var(--pink); border-radius: 999px;
}

/* ---------- Hero ---------- */
main { max-inline-size: 60rem; margin-inline: auto; padding: 1rem; }

.hero { text-align: center; padding-block: 1.5rem 1rem; }

h1 { line-height: 1; }
.title-site {
  display: block;
  font-size: clamp(3.2rem, 14vw, 7.5rem);
  background: linear-gradient(180deg, #fffbe0 0%, var(--yellow) 45%, #ff8a00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  filter: drop-shadow(5px 5px 0 var(--ink));
  @media (prefers-reduced-motion: no-preference) {
    animation: bob 3s ease-in-out infinite;
  }
}
.title-sub {
  display: block; margin-block-start: .4rem;
  font-size: clamp(1.4rem, 5vw, 2.4rem); color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
}
.title-sub em { color: var(--cyan); font-style: normal; }
@keyframes bob { 50% { translate: 0 -6px; rotate: -1.5deg; } }

.stage {
  position: relative;
  display: grid; justify-items: center;
  margin-block: 1.5rem .5rem;
}
/* Sparkles around the face */
.stage::before, .stage::after {
  content: "✨"; position: absolute; font-size: 2.5rem; pointer-events: none;
}
.stage::before { inset-block-start: 5%; inset-inline-start: 6%; }
.stage::after { inset-block-end: 22%; inset-inline-end: 6%; animation-delay: 1s; }
@media (prefers-reduced-motion: no-preference) {
  .stage::before, .stage::after { animation: twinkle 2.4s ease-in-out infinite; }
}
@keyframes twinkle { 50% { opacity: .25; scale: .7; rotate: 20deg; } }

.face-btn {
  position: relative; z-index: 2;
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.wobble {
  display: block;
  @media (prefers-reduced-motion: no-preference) {
    animation: wobble 2.2s ease-in-out infinite;
  }
}
@keyframes wobble {
  0%, 100% { rotate: -2.5deg; }
  50% { rotate: 2.5deg; }
}
.face-img {
  display: block;
  inline-size: min(72vw, 400px); block-size: auto;
  border-radius: 46% 46% 42% 42% / 50% 50% 40% 40%;
  border: 6px solid #fff;
  box-shadow: 0 0 0 6px var(--pink), 0 0 0 12px var(--yellow), 10px 14px 0 12px var(--ink);
  scale: var(--puff, 1);
  transition: scale .9s var(--spring), opacity .25s;
  user-select: none; -webkit-user-drag: none;
}
@media (prefers-reduced-motion: reduce) {
  .face-img { transition: opacity .25s; }
}
.face-btn.is-popped .face-img { opacity: 0; }

.puff-meter {
  margin: 1.4rem 0 0; font-weight: 700; font-size: 1.2rem; color: #fff;
  text-shadow: 2px 2px 0 var(--ink);
  min-block-size: 1.5em;
}

.counter {
  display: inline-block; margin: 1rem 0 0; padding: .3rem 1rem;
  font-family: "Courier New", monospace; font-weight: 700;
  color: #39ff14; background: #000; border: 3px inset #777;
}
.counter-num { display: inline-block; min-inline-size: 2ch; text-align: end; }

/* ---------- Panels ---------- */
.panel {
  margin-block: 2rem; padding: 1.25rem clamp(1rem, 4vw, 2rem);
  background: linear-gradient(180deg, #fff 0%, #ffe9fb 100%);
  border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  scroll-margin-block-start: 1rem;
}
.panel:nth-of-type(odd) { rotate: -.6deg; }
.panel:nth-of-type(even) { rotate: .6deg; }
.panel h2 {
  font-size: clamp(2rem, 7vw, 3rem); color: var(--pink);
  text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--ink);
}
.panel p { margin-block: .6rem; }

form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-block: 1rem; }
form label { flex-basis: 100%; font-weight: 700; }
input[type="text"] {
  flex: 1 1 14rem; min-inline-size: 0;
  font: 1.1rem var(--body); padding: .6rem .8rem;
  border: 3px inset #bbb; border-radius: 6px; background: #fff; color: var(--ink);
}
.btn {
  font: 1.4rem var(--display); letter-spacing: .05em; cursor: pointer;
  min-block-size: 2.75rem; padding: .3rem 1.2rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--yellow) 0%, #ffae00 100%);
  border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: translate .1s, box-shadow .1s, background-color .2s;
}
.btn:hover { background: linear-gradient(180deg, var(--cyan) 0%, #00b3ff 100%); }
.btn:active { translate: 3px 3px; box-shadow: 1px 1px 0 var(--ink); }

.modes {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 0 0 .4rem; padding: 0; border: 0; min-inline-size: 0;
  accent-color: var(--pink);
}
.modes legend { font-weight: 700; padding: 0; margin-block-end: .4rem; }
.modes label {
  flex-basis: auto; display: inline-flex; align-items: center; gap: .35rem;
  min-block-size: 2.5rem; padding: .2rem .8rem; cursor: pointer;
  font-weight: 700; background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  transition: background-color .15s;
}
.modes label:has(:checked) { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.modes input { margin: 0; inline-size: 1.1rem; block-size: 1.1rem; }
.ifier-out[data-mode="cert"] {
  background: #fffbe6; color: #5a3b00; border: 6px double #b8860b;
  font-family: Georgia, "Times New Roman", serif; font-style: italic; text-align: center;
}
.ifier-out[data-mode="news"] { background: #c00000; color: #fff; text-transform: uppercase; }
.ifier-out[data-mode="shout"] { font-family: var(--display); font-size: 1.7rem; letter-spacing: .04em; }
.ifier-result { display: grid; gap: .6rem; justify-items: start; }
.ifier-out {
  display: block; inline-size: 100%;
  padding: .8rem 1rem; font-size: 1.3rem; font-weight: 700;
  background: #000; color: #39ff14; border: 3px inset #777; border-radius: 6px;
  overflow-wrap: anywhere;
}
.hint { font-size: .95rem; opacity: .8; margin: 0; }

.copy { position: relative; display: inline-flex; align-items: center; gap: .6rem; }
.btn-copy { font-size: 1.15rem; }
.btn-copy[data-copied] { background: linear-gradient(180deg, #8bff7a, #28c840); }
.btn-copy[data-failed] { background: linear-gradient(180deg, #ff9a9a, #ff4040); }
.tip {
  font-weight: 700; color: var(--purple);
  opacity: 0; transition: opacity .2s;
}
.btn-copy:is([data-copied], [data-failed]) + .tip { opacity: 1; }

/* ---------- Oracle ---------- */
.oracle { display: flex; align-items: center; gap: 1rem; margin-block: 1rem .25rem; }
.oracle-face {
  flex: none; inline-size: 96px; block-size: 96px; border-radius: 50%;
  border: 4px solid var(--ink); background: #888;
}
.bubble {
  position: relative; margin: 0; padding: .8rem 1.2rem;
  font: 1.8rem var(--display); letter-spacing: .04em;
  background: #fff; border: 3px solid var(--ink); border-radius: 22px;
  min-inline-size: 6rem;
}
.bubble::before {
  content: ""; position: absolute; inset-inline-start: -14px; inset-block-start: 50%;
  translate: 0 -50%;
  border-block: 10px solid transparent; border-inline-end: 14px solid var(--ink);
}
.bubble.is-yes { background: #c9ffbf; }
.bubble.is-no { background: #ffc9c9; }
.bubble.is-maybe { background: #fff6a8; }

/* ---------- About / contact ---------- */
.facts { padding-inline-start: 1.4rem; }
.facts li::marker { content: "🌀 "; }
.construction {
  display: inline-block; padding: .4rem .8rem; font-weight: 700;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #000 14px 28px);
  color: #fff; text-shadow: 0 0 4px #000, 2px 2px 0 #000;
  border: 3px solid #000;
}

/* ---------- Footer ---------- */
.foot {
  text-align: center; padding: 1.5rem 1rem 2.5rem; color: #fff;
  background: #000; border-block-start: 4px ridge var(--pink);
}
.foot p { margin: .3rem 0; }
.foot .small { font-size: .85rem; opacity: .75; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.badges li {
  inline-size: 88px; block-size: 31px; display: grid; place-items: center;
  font: 700 .72rem/1 "Verdana", sans-serif; text-transform: uppercase;
  border: 2px outset #ccc;
}
.badges li:nth-child(1) { background: linear-gradient(#ff7a00, #c63c00); }
.badges li:nth-child(2) { background: linear-gradient(#00c3ff, #0047c6); }
.badges li:nth-child(3) { background: linear-gradient(#58ff58, #0a8a0a); color: #000; }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti img { position: absolute; inline-size: 44px; block-size: 44px; will-change: transform, opacity; }
