:root {
  --paper: #e8eb9d;
  --ink: #111116;
  --festival-green: #69c77b;
  --thermo-cyan: #bdf7f7;
  --blue: #4aa3ff;
  --lime: #8fc63d;
  --pink: #ec008c;
  --red: #e21b3c;
  --orange: #ff7a1a;
  --yellow: #fff1a8;
  --deep: #99000d;
  --cream: #f4f1c4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html,
body {
  min-height: 100%;
  overflow-y: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(#111116 0.75px, transparent 0.75px);
  background-size: 6px 6px;
  mix-blend-mode: multiply;
  z-index: 30;
}

.background-word {
  position: fixed;
  left: 1.2vw;
  top: 16vh;
  z-index: -1;
  color: var(--festival-green);
  opacity: .55;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(7rem, 19vw, 19rem);
  line-height: .75;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  padding: clamp(12px, 2vw, 28px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 18px;
  align-items: end;
  border-bottom: 5px solid var(--ink);
  padding-bottom: 4px;
  position: relative;
  z-index: 2;
}

.hero-kicker {
  grid-column: 1 / -1;
}

.kicker,
.tiny-label {
  margin: 0 0 8px;
  font-size: .84rem;
  font-weight: 1000;
  letter-spacing: .14em;
}

.title-lockup {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) clamp(440px, 34vw, 570px) minmax(360px, 1fr);
  align-items: center;
}

.title-stack {
  display: grid;
  align-content: center;
  min-width: 0;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(4rem, 7.8vw, 8.2rem);
  line-height: .78;
  letter-spacing: 0;
  text-transform: uppercase;
}

.title-left {
  text-align: right;
  padding-right: clamp(10px, 1.8vw, 26px);
  transform: translateX(clamp(55px, 4vw, 105px));
}

.title-right {
  text-align: left;
  padding-left: clamp(10px, 1.8vw, 26px);
  transform: translateX(clamp(-360px, -20vw, -260px));
}

.title-stack span,
.title-stack em {
  display: block;
  font-style: normal;
  white-space: nowrap;
}

.title-stack em {
  color: var(--red);
  text-shadow: 5px 5px 0 var(--ink);
}

.title-gap {
  min-height: clamp(116px, 13vw, 174px);
}

.hero h1 {
  margin: 0;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(4.4rem, 11vw, 9.4rem);
  line-height: .78;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 span,
.hero h1 em {
  display: block;
  font-style: normal;
}

.hero h1 em {
  color: var(--red);
  text-shadow: 5px 5px 0 var(--ink);
}

.hero-note {
  border: 5px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 12px;
  transform: rotate(1.5deg);
  width: min(360px, 100%);
}

.hero-note strong {
  display: block;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 3.1rem);
  line-height: .9;
}

.hero-note span {
  display: block;
  margin-top: 10px;
  font-weight: 1000;
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(230px, .68fr) clamp(360px, 28vw, 440px) minmax(380px, 1fr);
  gap: clamp(14px, 2vw, 28px);
  align-items: start;
  margin-top: 18px;
}

.counter-panel {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.count {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(4.2rem, 8vw, 7.6rem);
  line-height: .78;
}

.count small {
  display: block;
  color: var(--blue);
  font-size: .28em;
}

.progress-bar {
  height: 20px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--red));
  transition: width .7s cubic-bezier(.2, .9, .2, 1);
}

.button-row,
.emoji-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poster-button,
.register-button {
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--thermo-cyan);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 11px 14px;
  text-decoration: none;
  font-weight: 1000;
  text-transform: uppercase;
  cursor: pointer;
}

.register-button {
  background: var(--red);
}

.instagram-button {
  background: var(--pink);
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
}

.bonfire-card {
  width: min(330px, 88%);
  margin-top: 4px;
  margin-left: clamp(4px, 2vw, 28px);
  pointer-events: none;
  filter: drop-shadow(9px 11px 0 rgba(17, 17, 22, .18));
}

.bonfire-card svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.bonfire-back {
  fill: url(#bonfireDeep);
  stroke: var(--ink);
  stroke-width: 10;
  stroke-linejoin: round;
  opacity: .88;
  animation: bonfire-back 1.45s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.bonfire-outer {
  fill: url(#bonfireOuter);
  stroke: var(--ink);
  stroke-width: 8;
  stroke-linejoin: round;
  animation: bonfire-flicker 1.15s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.bonfire-mid {
  fill: url(#bonfireInner);
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linejoin: round;
  animation: bonfire-mid 1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.bonfire-core {
  fill: rgba(255, 241, 168, .8);
  stroke: rgba(17, 17, 22, .8);
  stroke-width: 5;
  stroke-linejoin: round;
  animation: bonfire-core .72s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.bonfire-tongue {
  fill: url(#bonfireInner);
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linejoin: round;
  animation: bonfire-tongue .92s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.bonfire-tongue.right {
  animation-delay: -.38s;
}

.bonfire-shine {
  fill: none;
  stroke: rgba(255, 255, 255, .85);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 18 26;
  animation: bonfire-shine 1.5s ease-in-out infinite;
}

.bonfire-shine.small {
  stroke-width: 4;
  animation-delay: -.45s;
}

.bonfire-sparks circle {
  fill: #ff8a1f;
  stroke: var(--ink);
  stroke-width: 3.5;
  animation: bonfire-spark 1.25s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bonfire-sparks circle:nth-child(2) {
  fill: #ffcf33;
  animation-delay: -.35s;
}

.bonfire-sparks circle:nth-child(3) {
  fill: #ff4b1f;
  animation-delay: -.7s;
}

.bonfire-sparks circle:nth-child(4) {
  animation-delay: -1s;
}

.thermometer-zone {
  display: grid;
  place-items: center;
  align-self: start;
  position: relative;
  z-index: 4;
  transform: translateY(-264px);
  margin-bottom: -264px;
}

.thermometer {
  width: min(100%, 470px);
  touch-action: none;
  filter: drop-shadow(20px 26px 0 rgba(17, 17, 22, .18));
  cursor: grab;
}

.thermometer:active {
  cursor: grabbing;
}

.heat-label,
.percent-label {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 38px;
  fill: var(--ink);
  paint-order: stroke fill;
  stroke: var(--paper);
  stroke-width: 9px;
}

.percent-label {
  font-size: 36px;
  fill: var(--deep);
  stroke-width: 5px;
}

.thermo-backplate {
  fill: var(--thermo-cyan);
}

.thermo-outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 18;
  stroke-linejoin: round;
}

.thermo-inner {
  fill: none;
  stroke: rgba(17, 17, 22, .18);
  stroke-width: 6;
}

#liquidBody,
#liquidBulb,
#wave {
  transition: d .8s cubic-bezier(.2, .9, .2, 1), fill .6s ease, opacity .4s ease;
}

.liquid-body,
.liquid-bulb {
  filter: drop-shadow(0 0 12px rgba(226, 27, 60, .45));
}

.liquid-bulb {
  transform-box: fill-box;
  transform-origin: center;
  animation: liquid-pulse 2.3s ease-in-out infinite;
  stroke: rgba(150, 13, 45, .45);
  stroke-width: 4;
}

.wave {
  fill: rgba(255, 255, 255, .2);
}

.bubbles circle {
  fill: rgba(255, 255, 255, .78);
  animation: bubble-rise 3s linear infinite;
}

.overflow {
  opacity: 0;
  transform-origin: center;
  transition: opacity .3s ease;
}

.overflow.active {
  opacity: 1;
  animation: boil .55s infinite alternate ease-in-out;
}

.overflow path,
.overflow circle {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 8;
}

.milestones {
  display: grid;
  gap: 9px;
  padding-top: 20px;
}

.milestone {
  --accent: var(--blue);
  position: relative;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 19%, var(--cream));
  box-shadow: 5px 5px 0 var(--ink);
  padding: 9px 96px 9px 12px;
  transform: rotate(-1deg);
}

.milestone:nth-child(even) {
  transform: rotate(1deg);
}

.milestone.unlocked {
  background: var(--accent);
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
}

.milestone .threshold {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: .82;
}

.milestone .threshold span {
  display: block;
  font-size: .35em;
}

.milestone strong {
  display: block;
  margin-top: 6px;
  font-weight: 1000;
}

.milestone p {
  margin: 4px 0 0;
  font-weight: 850;
}

.stamp {
  position: absolute;
  top: 12px;
  right: -16px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  padding: 7px 18px;
  font-weight: 1000;
  transform: rotate(13deg);
}

.reaction-section {
  margin-top: clamp(22px, 4vw, 42px);
  border-top: 5px solid var(--ink);
  padding-top: 16px;
}

.section-heading h2 {
  margin: 0 0 16px;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: .82;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.streak-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.streak-panel div {
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px;
}

.streak-panel span {
  display: block;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: .8;
  color: var(--red);
}

.streak-panel small {
  display: block;
  margin-top: 6px;
  font-weight: 1000;
}

.emoji-picker button {
  width: 54px;
  height: 54px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}

.reaction-message {
  min-height: 1.4em;
  color: var(--deep);
  font-weight: 1000;
}

.emoji-totals span {
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  padding: 6px 10px;
  font-weight: 950;
}

.pinboard {
  position: relative;
  min-height: 190px;
  margin-top: 18px;
  border: 5px solid var(--ink);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(105, 199, 123, .28), rgba(74, 163, 255, .18), rgba(236, 0, 140, .12));
  box-shadow: 9px 9px 0 var(--ink);
  overflow: hidden;
}

.emoji-pin {
  position: absolute;
  font-size: 2.2rem;
  filter: drop-shadow(2px 3px 0 rgba(17, 17, 22, .25));
  animation: stamp-in .28s cubic-bezier(.2, 1.5, .3, 1) both;
}

footer {
  margin-top: 34px;
  text-align: center;
  font-weight: 1000;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  overflow: hidden;
  background: rgba(17, 17, 22, .24);
}

.celebration.active {
  display: grid;
}

.celebration.final {
  background: rgba(153, 0, 13, .72);
}

.celebration-card {
  width: min(980px, 88vw);
  border: 8px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 16px 16px 0 var(--ink);
  padding: clamp(22px, 5vw, 56px);
  text-align: center;
}

.celebration-card span {
  display: block;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(4rem, 13vw, 12rem);
  line-height: .75;
  color: var(--red);
  text-shadow: 5px 5px 0 var(--ink);
}

.celebration-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.4rem, 4vw, 3.8rem);
  line-height: .92;
}

.confetti {
  position: fixed;
  top: -30px;
  width: 13px;
  height: 26px;
  z-index: 41;
  border: 2px solid var(--ink);
  animation: confetti-fall 2.8s ease-in forwards;
  pointer-events: none;
}

@keyframes bubble-rise {
  from { transform: translateY(80px); opacity: 0; }
  30% { opacity: .9; }
  to { transform: translateY(-160px); opacity: 0; }
}

@keyframes boil {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

@keyframes crackle {
  0%, 100% {
    opacity: .35;
    transform: translateY(0) scale(.78) rotate(0deg);
  }
  45% {
    opacity: 1;
    transform: translateY(-8px) scale(1.15) rotate(12deg);
  }
}

@keyframes liquid-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(226, 27, 60, .34));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(226, 27, 60, .5));
  }
}

@keyframes bonfire-back {
  0%, 100% { transform: scaleX(1) translateY(2px); }
  50% { transform: scaleX(1.05) translateY(-5px); }
}

@keyframes bonfire-flicker {
  0%, 100% { transform: scaleX(.98) translateY(0) rotate(-.4deg); }
  50% { transform: scaleX(1.04) translateY(-7px) rotate(.6deg); }
}

@keyframes bonfire-tongue {
  0%, 100% { transform: scale(.96) translateY(2px) rotate(-1deg); }
  50% { transform: scale(1.08) translateY(-5px) rotate(1deg); }
}

@keyframes bonfire-mid {
  0%, 100% { transform: scale(.98) translateY(2px); }
  50% { transform: scale(1.06) translateY(-6px); }
}

@keyframes bonfire-core {
  0%, 100% { transform: scale(.9) translateY(4px); opacity: .58; }
  50% { transform: scale(1.1) translateY(-2px); opacity: .92; }
}

@keyframes bonfire-shine {
  0%, 100% { stroke-dashoffset: 8; opacity: .4; }
  50% { stroke-dashoffset: -18; opacity: .9; }
}

@keyframes bonfire-spark {
  0%, 100% { opacity: .35; transform: translateY(0) scale(.75) rotate(0deg); }
  50% { opacity: 1; transform: translateY(-10px) scale(1.15) rotate(15deg); }
}

@keyframes stamp-in {
  from { transform: scale(0) rotate(0); opacity: 0; }
  to { opacity: 1; }
}

@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1000px) {
  .hero,
  .challenge-layout {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

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

  .title-left,
  .title-right {
    text-align: left;
    padding: 0;
    transform: none;
  }

  .title-gap {
    display: none;
  }

  .hero-note {
    grid-column: 1;
  }

  .thermometer {
    max-width: 350px;
  }

  .thermometer-zone {
    transform: none;
    margin-top: 0;
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .background-word {
    position: absolute;
    top: 138px;
    left: -12px;
    font-size: 32vw;
    opacity: .12;
  }

  .page {
    padding: 12px;
    min-height: auto;
  }

  .hero {
    border-bottom: 4px solid var(--ink);
    padding-bottom: 8px;
    gap: 4px;
  }

  .hero-kicker {
    font-size: .72rem;
    margin-bottom: 2px;
  }

  .title-lockup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .title-left,
  .title-right {
    text-align: left;
    padding: 0;
    transform: none;
    font-size: clamp(4.2rem, 19vw, 6.8rem);
    line-height: .76;
  }

  .title-left {
    display: contents;
  }

  .title-right {
    display: contents;
  }

  .title-left span,
  .title-right span,
  .title-left em,
  .title-right em {
    display: block;
  }

  .title-left span { order: 1; }
  .title-right span { order: 2; color: var(--festival-green); }
  .title-left em { order: 3; }
  .title-right em { order: 4; }

  .title-gap {
    display: none;
  }

  .challenge-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
  }

  .thermometer-zone {
    order: 1;
    width: 100%;
  }

  .thermometer {
    width: min(78vw, 310px);
    max-width: none;
    filter: drop-shadow(12px 15px 0 rgba(17, 17, 22, .16));
    touch-action: pan-y;
  }

  .counter-panel {
    order: 2;
    width: 100%;
    padding-top: 0;
    gap: 10px;
  }

  .tiny-label {
    margin-bottom: 0;
  }

  .count {
    font-size: clamp(4.8rem, 23vw, 7rem);
  }

  .count small {
    font-size: .34em;
  }

  .hero-note {
    width: 100%;
    padding: 10px 12px;
    transform: rotate(-1deg);
  }

  .hero-note strong {
    font-size: clamp(2.3rem, 12vw, 4rem);
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row > * {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .bonfire-card {
    width: min(230px, 70vw);
    margin: 0 auto -8px;
  }

  .milestones {
    order: 3;
    width: 100%;
    padding-top: 4px;
    gap: 10px;
  }

  .milestone {
    transform: none !important;
    padding: 10px 78px 10px 12px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .milestone .threshold {
    font-size: 2.5rem;
  }

  .milestone p {
    font-size: .88rem;
    line-height: 1.15;
  }

  .stamp {
    top: 10px;
    right: -18px;
    transform: rotate(11deg) scale(.86);
  }

  .reaction-section {
    margin-top: 22px;
    padding-top: 14px;
  }

  .section-heading h2 {
    font-size: clamp(3.6rem, 17vw, 5.7rem);
  }

  .emoji-picker button {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .streak-panel {
    grid-template-columns: 1fr;
  }

  .pinboard {
    min-height: 170px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 10px;
  }

  .hero h1 {
    font-size: clamp(4.5rem, 24vw, 7rem);
  }

  .count {
    font-size: clamp(4.6rem, 22vw, 6.4rem);
  }

  .milestone {
    padding-right: 76px;
  }

  .button-row > * {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
