:root {
  --bg: #26104f;
  --fg: #ffffff;
  --muted: #d9c9ff;
  --gold: #ffd23f;
  --line: rgba(255, 255, 255, 0.28);
  --warmth: 0.4;
  /* the party's colours, taken in turn by letters, candles and fireworks */
  --pink: #ff5fa2;
  --orange: #ff8a3d;
  --yellow: #ffd23f;
  --green: #7be08a;
  --blue: #4fc3ff;
  --purple: #a98bff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #5a2196 0%, #2e1260 45%, #150735 100%) fixed;
  color: var(--fg);
  font-family: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the room grows warmer the more candles are lit */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 45% at 50% 55%, rgba(255, 190, 90, 0.3), rgba(255, 95, 162, 0.1) 45%, transparent 75%);
  opacity: var(--warmth);
  transition: opacity 1.6s ease;
}

/* while the candles are lit, the lights in the room go down; the cake and
   the button to blow stay above it, in the candlelight */
.lights {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(8, 2, 22, 0.5);
  opacity: 0;
  transition: opacity 1.6s ease;
}

.lights-down .lights {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  position: relative;
  padding: 12px 16px 4px;
}

/* sound on or off, in the corner; it stays in the light */
.sound {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  cursor: pointer;
  touch-action: manipulation;
}

.sound svg {
  width: 1.35rem;
  height: 1.35rem;
}

.sound[aria-pressed="true"] .off,
.sound[aria-pressed="false"] .waves {
  display: none;
}

.sound[aria-pressed="false"] {
  color: var(--muted);
  opacity: 0.75;
}

.sound:focus {
  outline: none;
}

.sound:focus-visible {
  outline: 1px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 3px;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: 0 16px 3rem;
  text-align: center;
}

/* ---------- the party ---------- */

/* fireworks and confetti, drawn by script.js */
.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* balloons drifting up behind everything */
.balloons {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.balloons span {
  position: absolute;
  left: var(--x);
  bottom: -160px;
  width: calc(54px * var(--s));
  height: calc(66px * var(--s));
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75) 0 7%, transparent 9%), var(--c);
  box-shadow: inset -6px -8px 0 rgba(0, 0, 0, 0.12);
  opacity: 0.85;
  animation: float var(--t) linear var(--d) infinite;
}

/* the knot and the string */
.balloons span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: calc(90px * var(--s));
  background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  border-top: 5px solid var(--c);
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(-4deg); }
  25% { transform: translate(18px, -30vh) rotate(4deg); }
  50% { transform: translate(-14px, -60vh) rotate(-3deg); }
  75% { transform: translate(16px, -90vh) rotate(3deg); }
  100% { transform: translate(0, calc(-100vh - 320px)) rotate(-4deg); }
}

/* ---------- the cake ---------- */

.scene {
  width: 100%;
}

/* the message in big, bouncing letters of every colour */
.message {
  min-height: 1.2em;
  max-width: 60rem;
  margin: 0 auto;
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.message .word,
.wish .word,
.get-started .word {
  display: inline-block;
  white-space: nowrap;
}

.message .ch,
.wish .ch,
.get-started .ch {
  display: inline-block;
  color: var(--c);
  text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.28), 0 0 0.35em color-mix(in srgb, var(--c) 55%, transparent);
  animation: wave 1.6s ease-in-out var(--i) infinite;
}

@keyframes wave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-0.12em) rotate(-4deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(0.05em) rotate(3deg); }
}

/* on the front page, what the site is for, a little smaller */
.message.tagline {
  font-size: clamp(1.8rem, 6.5vw, 3.6rem);
}

.message.placeholder {
  opacity: 0.55;
}

/* the cake fills the page: as wide as the screen allows, or as tall */
.cake-art {
  position: relative;
  z-index: 2;
  /* as big as the screen allows, leaving room under it for the button to
     blow and then "make a wish!" */
  width: min(100%, calc((100vh - 13.5rem) * 400 / 340));
  width: min(100%, calc((100svh - 13.5rem) * 400 / 340));
  aspect-ratio: 400 / 340;
  margin: 0.2rem auto 0;
  /* sizes inside are in units of the cake's own width */
  container-type: inline-size;
}

/* while making a cake, it leaves room on the screen for the form under it */
.making .cake-art {
  width: min(100%, calc((100vh - 25rem) * 400 / 340), 30rem);
  width: min(100%, calc((100svh - 25rem) * 400 / 340), 30rem);
}

.cake-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.candles {
  position: absolute;
  inset: 0;
}

/* a birthday candle: --h is its height in the cake's units (400 across) */
.bday {
  --u: 0.25cqw;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
}

.stick {
  width: calc(var(--h) * 0.16 * var(--u));
  min-width: 3px;
  height: calc(var(--h) * var(--u));
  border-radius: 2px 2px 1px 1px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 35%, rgba(255, 255, 255, 0.35) 55%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(-55deg, var(--c1) 0 calc(var(--h) * 0.1 * var(--u)), var(--c2) calc(var(--h) * 0.1 * var(--u)) calc(var(--h) * 0.2 * var(--u)));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.wick {
  width: max(1px, calc(var(--h) * 0.025 * var(--u)));
  height: calc(var(--h) * 0.13 * var(--u));
  background: linear-gradient(#1a120c, #3b2b1c);
}

.lit .wick {
  background: linear-gradient(#ffb15a 0 25%, #2a1a10 25% 100%);
}

.flame-wrap {
  position: absolute;
  left: 50%;
  bottom: calc(var(--h) * 1.08 * var(--u));
  width: calc(var(--h) * 0.24 * var(--u));
  min-width: 5px;
  height: calc(var(--h) * 0.5 * var(--u));
  min-height: 11px;
  transform: translateX(-50%) scale(0.2, 0);
  transform-origin: 50% 100%;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.3), opacity 0.3s ease;
}

.lit .flame-wrap {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.flame {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50% / 66% 66% 34% 34%;
  background: radial-gradient(ellipse 60% 52% at 50% 74%, #fffdf3 0%, #fff0b5 26%, #ffc75a 52%, #ff8a1c 78%, rgba(255, 110, 10, 0) 100%);
  box-shadow:
    0 0 calc(var(--h) * 0.18 * var(--u) + 4px) calc(var(--h) * 0.04 * var(--u) + 1px) rgba(255, 175, 70, 0.55),
    0 calc(var(--h) * -0.1 * var(--u)) calc(var(--h) * 0.5 * var(--u) + 8px) calc(var(--h) * 0.12 * var(--u)) rgba(255, 120, 30, 0.2);
  transform-origin: 50% 100%;
  animation: flicker var(--d, 1.8s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  20% { transform: scale(0.94, 1.07) skewX(2deg); }
  40% { transform: scale(1.04, 0.96) skewX(-1.5deg); }
  60% { transform: scale(0.96, 1.05) skewX(2.6deg); }
  80% { transform: scale(1.02, 0.98) skewX(-1deg); }
}

/* ---------- blowing the candles out ---------- */

/* big letters over the cake, bobbing, pushed along by the blowing */
.blow-letters {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.5cqw;
  font-size: 17cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(var(--gust, 0) * 7cqw)) skewX(calc(var(--gust, 0) * -14deg)) scale(0.6);
  transition: opacity 0.6s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}

.blow-letters.shown {
  opacity: 1;
  transform: translateX(calc(var(--gust, 0) * 7cqw)) skewX(calc(var(--gust, 0) * -14deg)) scale(1);
}

/* the countdown's numbers, bigger still */
.blow-letters.number {
  font-size: 24cqw;
}

/* each word pops up, letter by letter, and bobs */
.blow-letters span {
  display: inline-block;
  color: var(--c);
  text-shadow: 0 0.8cqw 0 rgba(0, 0, 0, 0.3), 0 0 3cqw rgba(255, 255, 255, 0.35);
  animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.4) backwards, bob 1.1s ease-in-out infinite alternate;
  animation-delay: calc(var(--k) * 0.05s), calc(var(--k) * -0.2s);
}

@keyframes pop {
  from { scale: 0; }
}

@keyframes bob {
  from { transform: translateY(-1.2cqw) rotate(-4deg); }
  to { transform: translateY(1.2cqw) rotate(4deg); }
}

/* in the wind, lit candles shiver and their flames lean and flutter */
.windy .bday.lit {
  animation: shiver 0.09s linear infinite alternate;
}

@keyframes shiver {
  from { translate: calc(var(--gust) * var(--sway) * -1.5 * var(--u)) 0; }
  to { translate: calc(var(--gust) * var(--sway) * 1.5 * var(--u)) 0; }
}

.windy .lit .flame-wrap {
  transform: translateX(-50%) rotate(calc(var(--gust) * var(--lean) * var(--sway) * 34deg)) scale(calc(1 - var(--gust) * 0.15), calc(1 - var(--gust) * var(--sway) * 0.45));
  transition: transform 0.15s ease-out;
}

.windy .lit .flame {
  animation: flutter 0.11s linear infinite alternate;
}

@keyframes flutter {
  from { transform: skewX(calc(var(--gust) * var(--sway) * -18deg)) scaleY(calc(1 - var(--gust) * var(--sway) * 0.25)); }
  to { transform: skewX(calc(var(--gust) * var(--sway) * 18deg)) scaleY(1); }
}

/* a wisp of smoke from a candle just blown out */
.smoke {
  position: absolute;
  left: 50%;
  bottom: calc(var(--h) * 1.1 * var(--u));
  width: calc(var(--h) * 0.2 * var(--u) + 4px);
  height: calc(var(--h) * 0.6 * var(--u) + 10px);
  margin-left: calc((var(--h) * 0.2 * var(--u) + 4px) / -2);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, rgba(215, 200, 180, 0.55), rgba(160, 145, 130, 0) 70%);
  filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
  animation: smoke 2.2s ease-out forwards;
}

@keyframes smoke {
  0% { opacity: 0; transform: translate(0, 4px) scale(0.6, 0.4); }
  15% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--sx), -12cqw) scale(2.6, 1.8) skewX(14deg); }
}

/* the button to press when ready to blow, beckoning */
.go.ready {
  position: relative;
  z-index: 2;
  margin-top: 0.6rem;
  animation: rise 0.6s ease both, beckon 1.3s ease-in-out 0.6s infinite alternate;
}

@keyframes beckon {
  to { scale: 1.06; }
}

.wished {
  margin-top: 0.4rem;
}

.wish {
  margin: 0.2rem 0 0;
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  animation: rise 1s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
}

/* ---------- making a cake ---------- */

.make,
.share,
.add-wish {
  width: 100%;
  max-width: 24rem;
  margin-top: 1.2rem;
}

/* the link and the wishes come up once the candles are out */
.share,
.add-wish {
  animation: rise 0.8s ease 0.6s both;
}

.field,
.go,
.count input {
  font: inherit;
}

.field {
  width: 100%;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  font-size: 1.15rem;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.field:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.25);
}

.count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 1rem;
}

.count-word {
  /* wide enough for "candles", so the rows of steppers line up */
  min-width: 4.2em;
  text-align: right;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--yellow);
}

.count input {
  width: 3.4em;
  padding: 0.15rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font-size: 1.6rem;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.count input::-webkit-outer-spin-button,
.count input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.count input:focus {
  border-bottom-color: rgba(255, 200, 130, 0.7);
}

/* what the number of blows means, under its stepper */
.count-hint {
  margin: 0.5rem auto 0;
  max-width: 22em;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.75;
}

/* a tick box: whether happy birthday plays through the show */
.tick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  margin: 1.1rem auto 0;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.tick input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.tick-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* the check mark */
.tick-box::after {
  content: "";
  width: 0.42rem;
  height: 0.8rem;
  margin-top: -0.15rem;
  border: solid #ffffff;
  border-width: 0 0.2rem 0.2rem 0;
  rotate: 45deg;
  scale: 0;
  transition: scale 0.2s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}

.tick input:checked + .tick-box {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--orange));
}

.tick input:checked + .tick-box::after {
  scale: 1;
}

.tick input:focus-visible + .tick-box {
  outline: 1px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 3px;
}

.step {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.step:hover:not(:disabled) {
  filter: brightness(1.12);
}

.step:disabled {
  opacity: 0.35;
  cursor: default;
}

/* choosing the cake: its name and price between two arrows, a dot for
   each cake, and the cake itself can be swiped left or right */
.making .scene,
.editing .scene {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}

.making .scene.dragging,
.editing .scene.dragging {
  cursor: grabbing;
}

.picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.turn {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #ffffff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  touch-action: manipulation;
}

.turn svg {
  width: 1.4rem;
  height: 1.4rem;
}

.turn:hover {
  filter: brightness(1.12);
}

.turn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.turn:focus {
  outline: none;
}

.turn:focus-visible {
  outline: 1px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 3px;
}

/* wide enough for "red velvet", so the arrows stay put */
.picked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 9.5rem;
  margin: 0;
}

.picked-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.price {
  padding: 0.05rem 0.65rem;
  border-radius: 999px;
  background: var(--yellow);
  color: #3a1a00;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.price.free {
  background: var(--green);
  color: #0f3a17;
}

.pips {
  display: flex;
  justify-content: center;
  margin-top: 0.35rem;
}

/* a dot in the cake's colours, with room round it for a finger */
.pip {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.pip::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.pip[aria-current="true"]::before {
  opacity: 1;
  transform: scale(1.35);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px var(--yellow), 0 0 10px rgba(255, 210, 63, 0.6);
}

.swipe-hint {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.75;
}

/* a little room between choosing the cake and writing the message */
.make .field {
  margin-top: 0.8rem;
}

/* under the link's name, the link it makes, broken anywhere to fit */
.link-hint {
  overflow-wrap: anywhere;
}

[data-cake="vanilla"] { --dot: radial-gradient(circle at 35% 30%, #fffaf0, #f3e3c3); }
[data-cake="chocolate"] { --dot: radial-gradient(circle at 35% 30%, #8a5434, #4a2614); }
[data-cake="colin the caterpillar"] { --dot: radial-gradient(circle at 30% 50%, #fffaf0 0 30%, transparent 32%), radial-gradient(circle at 68% 35%, #ffd23f 0 9%, transparent 10%), radial-gradient(circle at 35% 30%, #a3653c, #4a2513); }
[data-cake="strawberry"] { --dot: radial-gradient(circle at 35% 30%, #fbd3dd, #e392a6); }
[data-cake="lemon"] { --dot: radial-gradient(circle at 35% 30%, #fffbe0, #ecd772); }
[data-cake="red velvet"] { --dot: radial-gradient(circle at 35% 30%, #fffbf5 0 38%, #a3192c 40%); }
[data-cake="funfetti"] { --dot: radial-gradient(circle at 30% 35%, #f5a3b8 0 9%, transparent 10%), radial-gradient(circle at 65% 40%, #8fd3f4 0 9%, transparent 10%), radial-gradient(circle at 45% 68%, #ffd36b 0 9%, transparent 10%), radial-gradient(circle at 35% 30%, #ffffff, #ece0cf); }

.go {
  margin-top: 1.3rem;
  padding: 0.65rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 0 #b83a73, 0 0 26px rgba(255, 95, 162, 0.45);
  transition: box-shadow 0.3s ease, background 0.3s ease;
  touch-action: manipulation;
}

.go:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 0 #b83a73, 0 0 34px rgba(255, 95, 162, 0.65);
}

.go:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b83a73, 0 0 26px rgba(255, 95, 162, 0.45);
}

.go:disabled {
  opacity: 0.6;
  cursor: progress;
}

.go.quiet {
  background: linear-gradient(90deg, var(--blue), var(--purple));
  box-shadow: 0 4px 0 #4b3a9c, 0 0 26px rgba(79, 195, 255, 0.35);
}

.go:focus {
  outline: none;
}

.go:focus-visible,
.step:focus-visible {
  outline: 1px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 3px;
}

.oops,
.note {
  min-height: 1.3em;
  margin: 0.7rem 0 0;
  font-size: 1.05rem;
}

.oops,
.note.bad {
  color: #ffb3c8;
}

/* changes saved */
.oops.good {
  color: var(--green);
}

.note {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- a cake that's been made ---------- */

.share-head {
  margin: 0 0 1.2rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--muted);
}

/* each of the two links, with what it's for */
.link-box + .link-box {
  margin-top: 1.8rem;
}

.link-box .count-hint {
  margin-top: 0.2rem;
}

.share-head:empty {
  display: none;
}

.link {
  margin: 0.5rem 0 0;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.link a {
  color: var(--yellow);
  font-weight: 600;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(255, 210, 63, 0.5);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 10px;
}

.again {
  display: inline-block;
  margin-top: 1.8rem;
  font-weight: 500;
  color: var(--muted);
  text-underline-offset: 0.2em;
}

.again:hover {
  color: var(--fg);
}

.again[hidden] {
  display: none;
}

/* adding a wish: a name and a few words */
.add-wish {
  margin-top: 1.8rem;
}

/* a heading over each part of a cake's edit link */
.section-head {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--yellow);
}

/* the wishes so far, over the box to add one */
.add-wish .read-wishes {
  margin: 0 0 1.4rem;
}

/* test play: back to the form, quietly, under the cake; it stays in the
   light while the lights are down */
.back-to-edit {
  position: relative;
  z-index: 2;
  margin-top: 1.2rem;
  padding: 0.4rem 0.8rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  touch-action: manipulation;
}

.back-to-edit:hover {
  color: var(--fg);
}

/* only while making a cake, not on its edit link */
.editing .make-only {
  display: none;
}

/* what buying the cake gets you, over the buttons */
.purchase-note {
  max-width: 22em;
  margin: 1.4rem auto 0;
  padding: 0.8rem 1.1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: left;
}

.purchase-note p {
  margin: 0;
  color: var(--fg);
  font-weight: 600;
}

.purchase-note ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.purchase-note li + li {
  margin-top: 0.3rem;
}

.purchase-note strong {
  color: var(--yellow);
  font-weight: 600;
}

/* changing the cake: under the wishes, its heading a little apart */
.make .section-head {
  margin-bottom: 0.9rem;
}

.editing .make {
  margin-top: 2.4rem;
}

.add-wish .count-hint {
  margin: 0.2rem auto 0.9rem;
}

.add-wish .field + .field {
  margin-top: 0.7rem;
}

.add-wish .go {
  margin-top: 1rem;
}

/* ---------- reading the wishes ---------- */

/* over the dimmed page: the wishes, one card at a time */
.reader {
  width: min(26rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  overflow: visible;
}

.reader::backdrop {
  background: rgba(14, 4, 36, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.reader[open] .reader-inner {
  animation: rise 0.4s ease both;
}

.reader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.reader-head {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--yellow);
}

.reader-close {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--fg);
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.reader-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.reader-close:focus {
  outline: none;
}

.reader-close:focus-visible {
  outline: 1px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 3px;
}

/* the card can be swiped left or right; up and down is left alone */
.reader-stage {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}

.reader-stage.dragging {
  cursor: grabbing;
}

/* a wish, in the colour of its turn, and who it's from under it */
.wish-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  min-height: 14rem;
  margin: 0;
  padding: 1.6rem 1.4rem;
  border: 3px solid var(--c);
  border-radius: 1.6rem;
  background: rgba(40, 14, 88, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 34px color-mix(in srgb, var(--c) 45%, transparent);
  text-align: center;
  overflow-wrap: anywhere;
}

.wish-card-words {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
}

.wish-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c);
}

.wish-card-name::before {
  content: "\2014\00a0";
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
}

.reader-count {
  min-width: 5.5rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

.turn:disabled {
  opacity: 0.35;
  cursor: default;
}

.reader .swipe-hint {
  margin-top: 0.4rem;
}

/* the site's name is the page's heading */
.brand-head {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

/* the cake, with get started laid over it on the front page: both in the
   one place, one on top of the other */
.stage {
  display: grid;
  place-items: center;
  width: 100%;
}

.stage > * {
  grid-area: 1 / 1;
}

/* the front page: get started, big, over the middle of the cake, beckoning */
.start {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.start[hidden] {
  display: none;
}

.start .oops {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.get-started {
  padding: 0.25em 0.7em 0.35em;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(38, 16, 79, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--fg);
  font: inherit;
  font-size: clamp(2.6rem, 11vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(255, 95, 162, 0.35), inset 0 0 30px rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
  animation: rise 0.8s ease both, beckon 1.3s ease-in-out 0.8s infinite alternate;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.get-started:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(58, 26, 110, 0.7);
}

.get-started:focus {
  outline: none;
}

.get-started:focus-visible {
  outline: 2px dashed rgba(255, 220, 160, 0.8);
  outline-offset: 6px;
}

/* how it works, in a few words, under the cake on the front page */
.how {
  max-width: 30rem;
  margin-top: 1.4rem;
}

.how p {
  margin: 0.4rem 0 0;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--muted);
}

/* star ratings: Trustpilot and Facebook placeholders, on the front page */
.ratings {
  width: 100%;
  max-width: 30rem;
  margin-top: 2.4rem;
}

.sample {
  display: inline-block;
  margin: 0 0 1.3rem;
  padding: 0.25em 0.9em;
  border: 1px dashed var(--line);
  border-radius: 1em;
  font-size: 0.75rem;
  color: var(--muted);
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.rating {
  --star: clamp(15px, 5.6vw, 24px);
  --gap: calc(var(--star) * 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.rating p {
  margin: 0;
}

.rating .score {
  font-size: clamp(1.05rem, 4.6vw, 1.55rem);
  font-weight: 600;
}

.rating .who {
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 600;
  color: var(--colour);
}

.rating .from {
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0.85;
}

.stars {
  position: relative;
  display: block;
  line-height: 0;
}

.stars-back,
.stars-front {
  display: flex;
  gap: var(--gap);
}

.stars-back {
  color: rgba(255, 255, 255, 0.18);
}

/* only as wide as the score: whole stars, then part of the next one */
.stars-front {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: calc(var(--whole) * (var(--star) + var(--gap)) + var(--part) * var(--star));
  color: var(--colour);
}

.stars svg {
  flex: none;
  width: var(--star);
  height: var(--star);
}

.stars path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* a quiet link at the very bottom, easy to miss */
.foot {
  position: relative;
  padding: 2rem 16px 14px;
  text-align: center;
  font-size: 0.72rem;
}

.foot a {
  color: var(--muted);
  opacity: 0.4;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.foot a:hover,
.foot a:focus-visible {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .message .ch,
  .get-started,
  .get-started .ch,
  .balloons span,
  .flame,
  .blow-letters span,
  .go.ready,
  .windy .bday.lit,
  .windy .lit .flame {
    animation: none;
  }

  .smoke {
    display: none;
  }

  .flame-wrap,
  .glow,
  .lights {
    transition: none;
  }
}
