:root { --ink: #5B4361; --coral: #F59FAE; --cream: #FFF8EF; --font: "Fredoka", "Avenir Next", system-ui, sans-serif; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  height: 100svh; overflow: hidden; background: linear-gradient(#F8CFDA, #FFE1D4 50%, #FFF2E6);
  color: var(--ink); font-family: var(--font); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  transition: opacity .45s ease;
}
body.leaving { opacity: 0; }

/* the picture, behind everything */
.stage { position: fixed; inset: 0; }
.scene { position: relative; width: 100%; height: 100%; }
.scene > img, .scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* the words and cards, on top. Clicks fall through to Croc and Bun except on the cards. */
.ui {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px 0;
}
.head { text-align: center; margin-top: clamp(4px, 3vh, 40px); }
.head h1 {
  margin: 0; font-weight: 700; font-size: clamp(38px, 11vw, 64px); line-height: 1; color: #fff; letter-spacing: .01em;
  text-shadow: 0 3px 0 #EE8A9C, 0 6px 14px rgba(138, 94, 134, .25);
}
.head .for { margin: 8px 0 0; font-weight: 600; font-size: clamp(16px, 4.4vw, 20px); color: #9A6F98; letter-spacing: .04em; }

.sections {
  flex: 1; width: 100%; max-width: 760px;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: 14px;
  padding: 14px 0;
}
.ground { flex: none; height: clamp(170px, 27vh, 260px); }

/* one paper card */
.card {
  --w: min(170px, calc(50vw - 24px));
  pointer-events: auto; position: relative; width: var(--w);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 10px 10px 14px; border-radius: 22px; background: var(--cream); color: var(--ink); text-decoration: none;
  box-shadow: 0 2px 0 rgba(138, 94, 134, .12), 0 10px 22px -8px rgba(138, 94, 134, .45);
  transform: rotate(var(--r, 0deg)); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
  outline: none;
}
.card::after {   /* a strip of tape on top */
  content: ""; position: absolute; top: -9px; left: 50%; width: 54px; height: 18px; margin-left: -27px;
  background: rgba(255, 255, 255, .7); border-radius: 3px; transform: rotate(calc(var(--r, 0deg) * -2));
  box-shadow: 0 1px 2px rgba(138, 94, 134, .15);
}
.card-art {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1.25; border-radius: 16px; background: var(--t);
  border: 2px dashed color-mix(in srgb, var(--c) 45%, transparent);
}
.card-art svg { width: 66%; height: 78%; overflow: visible; }
.card-title { margin-top: 10px; font-weight: 700; font-size: 20px; line-height: 1.1; }
.card-note { margin-top: 4px; font-weight: 500; font-size: 14px; line-height: 1.25; color: #8C6C8E; min-height: 2.5em; }
.card-go {
  margin-top: 10px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 70%, #5B4361);
}
.card-soon {
  position: absolute; top: 18px; right: -6px; display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 12px;
  box-shadow: 0 4px 10px -3px rgba(138, 94, 134, .45); transform: rotate(6deg);
}
.card-soon svg { color: var(--c); }
@media (hover: hover) {
  .card:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 0 2px 0 rgba(138, 94, 134, .12), 0 18px 28px -10px rgba(138, 94, 134, .5); }
}
.card:focus-visible { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--c); }
.card:active { transform: rotate(0deg) scale(.97); }
.card.chosen { animation: chosen .55s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes chosen { 35% { transform: translateY(-14px) scale(1.06) rotate(2deg); } 100% { transform: translateY(-8px) scale(1.08); } }
.ic-float { animation: float 4.4s ease-in-out infinite; }
.card:nth-child(2n) .ic-float { animation-delay: -2.2s; animation-duration: 5s; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* bigger screens: bigger cards */
@media (min-width: 700px) and (min-height: 640px) {
  .card { --w: 210px; padding: 12px 12px 16px; }
  .sections { gap: 26px; }
  .card-title { font-size: 23px; }
  .card-note { font-size: 15px; }
}
@media (min-width: 1400px) and (min-height: 900px) {
  .card { --w: 250px; }
  .sections { gap: 34px; max-width: 1100px; }
  .card-title { font-size: 26px; }
  .card-note { font-size: 16px; }
  .card-go { width: 46px; height: 46px; }
}
/* short phones (iPhone SE): tighter */
@media (max-height: 640px) {
  .card-art { aspect-ratio: 1.6; }
  .card-note { min-height: 0; }
  .card-go { width: 34px; height: 34px; margin-top: 8px; }
  .ground { height: 150px; }
}

/* the picture's moving bits */
.say { font: 600 16px var(--font); fill: var(--ink); }
.drift { animation: drift 10s ease-in-out infinite alternate; }
.drift.b { animation-duration: 13s; animation-delay: -5s; }
@keyframes drift { to { transform: translateX(20px); } }
.wave { transform-box: fill-box; transform-origin: 90% 95%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 72% { transform: rotate(-20deg); } 84% { transform: rotate(10deg); } }
.who { cursor: pointer; }
.hop { animation: hop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes hop { 40% { transform: translateY(-16px); } }
.bub { opacity: 0; transition: opacity .2s; }
.bub.on { opacity: 1; }
.bub.on > * { animation: pop .35s cubic-bezier(.34, 1.56, .64, 1); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pop { from { transform: scale(.6); } }
.heart { animation: rise 1.2s ease-out forwards; transform-box: fill-box; }
@keyframes rise { to { transform: translateY(-46px) scale(1.4); opacity: 0; } }
.nojs { position: relative; z-index: 3; text-align: center; font-size: 20px; padding-top: 40vh; }
.nojs a { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ic-float, .drift, .wave { animation: none; } body { transition: none; } .card { transition: none; } }


/* locked cards (before Saturday): a little faded, a shake when tapped */
.card.is-locked .card-art, .card.is-locked .card-title, .card.is-locked .card-note { opacity: .55; filter: saturate(.7); }
.card.is-locked .card-go { background: #CDBFD3; box-shadow: 0 3px 0 #B3A2BA; }
.card.is-locked.nope { animation: nope .45s ease; }
@keyframes nope { 20% { transform: translateX(-7px) rotate(var(--r)); } 40% { transform: translateX(7px) rotate(var(--r)); } 60% { transform: translateX(-4px) rotate(var(--r)); } 80% { transform: translateX(4px) rotate(var(--r)); } }
