:root {
  --bg: #fbf7f0;
  --bg-2: #f1ebe0;
  --ink: #1b1b1b;
  --muted: #6b6560;
  --red: #d62828;
  --red-dark: #9e1b1b;
  --green: #16a34a;
  --green-dark: #0f7a35;
  --gold: #f5b700;
  --gold-dark: #b98700;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(40, 30, 20, .12);
  --comic: "Comic Sans MS", "Chalkboard SE", "Comic Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  /* sky over a lawn, until the 3D garden is drawn on top */
  background: linear-gradient(180deg, #4b9be8 0%, #d8eefc 46%, #7cbf55 47%, #5c9c3c 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }

.app {
  position: relative; z-index: 0;
  pointer-events: none;            /* drags on empty space reach the 3D garden behind */
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
/* the top bar spans the whole window: fish on the far left, the account on the far right */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100vw; margin-left: calc(50% - 50vw);
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.tokens {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 5px 5px 5px 8px;
  box-shadow: var(--shadow);
  font-size: 15px;
}
.tokens b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tokens.empty b { color: var(--red); }

.coin {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680, var(--gold) 55%, var(--gold-dark));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
  position: relative;
}
.coin::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(120, 80, 0, .35);
}
.coin.small { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 5px; }

/* fish = the in-game currency */
.fish-icon {
  width: 30px; height: 20px; flex: none; display: inline-block;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Cpath d='M30 12 L39 3.5 L37.5 12 L39 20.5 Z' fill='%235aa9e6' stroke='%231d4e7a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3 12 C9 2 25 2 32 12 C25 22 9 22 3 12 Z' fill='%2378bdf0' stroke='%231d4e7a' stroke-width='1.6'/%3E%3Cpath d='M17 7.5 C20 10 20 14 17 16.5' fill='none' stroke='%231d4e7a' stroke-width='1.3' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='10.5' r='1.9' fill='%231d4e7a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.fish-icon.small { width: 18px; height: 12px; vertical-align: -1px; margin-right: 5px; }
.coin.small::after { inset: 3px; border-width: 1px; }

.plus {
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: var(--gold); color: #3b2a00;
  font-size: 22px; font-weight: 800; line-height: 1;
  box-shadow: 0 3px 0 var(--gold-dark);
}
.plus:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-dark); }

.hall-btn {
  display: flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px;
  background: var(--card);
  padding: 9px 14px;
  font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow);
}
.hall-btn svg { width: 20px; height: 20px; color: var(--gold-dark); }

/* ---------- scene ---------- */
.scene { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; }

.sign {
  margin: 14px 0 4px;
  background: var(--red);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--red), 0 10px 18px rgba(120, 0, 0, .25);
  border-radius: 12px;
  padding: 8px 26px;
  font-size: clamp(19px, 6vw, 36px);
  white-space: nowrap;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-2deg);
  position: relative;
}
.sign::before, .sign::after {
  content: ""; position: absolute; top: 50%;
  width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%;
  background: #f3d2d2;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .2);
}
.sign::before { left: 8px; }
.sign::after { right: 8px; }
.sign.flash { animation: sign-flash 1.3s ease; }
.sign.shake { animation: sign-shake .9s ease; }

@keyframes sign-flash {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  20% { transform: rotate(-2deg) scale(1.12); filter: brightness(1.25); }
  40% { transform: rotate(-2deg) scale(1); }
  60% { transform: rotate(-2deg) scale(1.08); filter: brightness(1.2); }
}
@keyframes sign-shake {
  0%, 100% { transform: rotate(-2deg); }
  15% { transform: rotate(-9deg) translateY(-4px); }
  30% { transform: rotate(6deg); }
  45% { transform: rotate(-7deg); }
  60% { transform: rotate(4deg); }
  80% { transform: rotate(-4deg); }
}

/* Fixed height so the cat doesn't resize while the text types; longer lines grow upwards. */
.bubble-wrap {
  width: 100%;
  height: 7.6em;
  flex: none;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 4px 16px;
  font-family: var(--comic);
  font-size: clamp(15px, 4.2vw, 18px);
}
.bubble {
  position: relative;
  max-width: 420px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 10px 16px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .12);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.bubble p { margin: 0; min-height: 1.3em; }
.bubble::after, .bubble::before {
  content: ""; position: absolute; left: 50%;
  border-style: solid; border-color: transparent;
}
.bubble::before { bottom: -17px; margin-left: -11px; border-width: 16px 11px 0; border-top-color: var(--ink); }
.bubble::after { bottom: -11px; margin-left: -7px; border-width: 11px 7px 0; border-top-color: var(--card); }
.bubble { transition: opacity .35s ease, transform .35s ease; }
.bubble.pop { animation: pop .25s ease; }
.bubble.hidden { opacity: 0; transform: translateY(8px) scale(.94); pointer-events: none; }
@keyframes pop { from { transform: scale(.92); } to { transform: scale(1); } }

.stage {
  flex: 1; min-height: 160px;
  width: 100%;
  display: flex; justify-content: center; align-items: flex-end;
  user-select: none;
}
.cat-svg { height: 100%; max-height: 470px; width: auto; max-width: 100%; display: block; overflow: visible; }
.stage { position: relative; }
.app .topbar > *, .app .bubble, .app .actions > *, .app .footer { pointer-events: auto; }
/* the 3D canvas fills the window behind the page; the cat is framed in .stage */
.cat-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; pointer-events: auto; }
.stage.loading::after {
  content: "Waking up the cat…";
  position: absolute; left: 0; right: 0; bottom: 40%;
  text-align: center; color: var(--muted); font-size: 14px;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .4; } }

.hall-btn.reveal { animation: reveal .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes reveal { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- pay button ---------- */
.actions { display: flex; justify-content: center; padding: 10px 0 6px; }
.pay-btn {
  width: min(100%, 360px);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; border-radius: 999px;
  background: var(--green); color: #fff;
  padding: 14px 24px 12px;
  font-size: 23px; font-weight: 800;
  box-shadow: 0 6px 0 var(--green-dark), 0 0 0 4px rgba(255, 255, 255, .95), 0 6px 0 4px rgba(255, 255, 255, .95), 0 16px 26px rgba(0, 0, 0, .25);
  transition: transform .06s, box-shadow .06s;
}
.pay-btn small { font-size: 13px; font-weight: 600; opacity: .9; }
.pay-btn:hover { filter: brightness(1.05); }
.pay-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-dark), 0 0 0 4px rgba(255, 255, 255, .95), 0 1px 0 4px rgba(255, 255, 255, .95), 0 6px 12px rgba(0, 0, 0, .2); }
.pay-btn:focus-visible, .plus:focus-visible, .hall-btn:focus-visible, .btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

.footer {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  min-height: 24px; width: fit-content; margin: 2px auto 0; padding: 3px 12px;
  font-size: 12px; color: #4d4740;
  background: rgba(255, 255, 255, .78); border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.link { background: none; border: 0; padding: 0; color: #4d4740; text-decoration: underline; font-size: 12px; }

/* ---------- flying fish (thrown to the cat) ---------- */
.flying-fish {
  position: fixed; z-index: 50; pointer-events: none;
  width: 40px; height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Cpath d='M30 12 L39 3.5 L37.5 12 L39 20.5 Z' fill='%235aa9e6' stroke='%231d4e7a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3 12 C9 2 25 2 32 12 C25 22 9 22 3 12 Z' fill='%2378bdf0' stroke='%231d4e7a' stroke-width='1.6'/%3E%3Cpath d='M17 7.5 C20 10 20 14 17 16.5' fill='none' stroke='%231d4e7a' stroke-width='1.3' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='10.5' r='1.9' fill='%231d4e7a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.flying-coin {
  position: fixed; z-index: 50; pointer-events: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680, var(--gold) 55%, var(--gold-dark));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* ---------- dialogs ---------- */
.sheet {
  width: min(92vw, 420px);
  border: 0; border-radius: 22px;
  padding: 22px 20px 18px;
  background: var(--card); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.sheet::backdrop { background: rgba(20, 15, 10, .5); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in .55s var(--spring, cubic-bezier(.34, 1.56, .64, 1)) both; }
.sheet[open]::backdrop { animation: fade-in .3s ease both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet h2 { margin: 0 0 6px; font-size: 22px; }
.muted { color: var(--muted); margin: 0 0 14px; font-size: 14px; line-height: 1.4; }
/* Primary button comes first in the HTML (so Enter picks it) but sits on the right. */
.row { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; margin-top: 16px; }

.btn { border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 15px; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.secondary { background: #f1ebe0; color: var(--ink); }
.btn.secondary:hover { background: #e9e1d3; }
.btn.wide { width: 100%; }

.packs { display: grid; gap: 8px; }
.pack {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  border: 2px solid #e6e0d6; border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  position: relative;
}
.pack:has(input:checked) { border-color: var(--green); background: #f0fbf3; }
.pack input { accent-color: var(--green); width: 18px; height: 18px; margin: 0; }
.pack-tokens { font-weight: 700; }
.pack-price { font-weight: 800; }
.pack-badge {
  position: absolute; top: -9px; right: 12px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px;
}

.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; line-height: 1.35; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.demo-note { margin: 12px 0 0; font-size: 12px; color: var(--red-dark); font-weight: 600; }

.text-input {
  width: 100%; font: inherit; font-size: 17px;
  padding: 12px 14px; border-radius: 12px;
  border: 2px solid #e6e0d6;
}
.text-input:focus { outline: none; border-color: var(--ink); }

/* ---------- Hall of Fame ---------- */
.hall { width: min(92vw, 440px); padding: 22px 20px 18px; text-align: center; overflow: hidden; }
.hall[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.hall-head { display: flex; flex-direction: column; align-items: center; }
.hall-badge {
  width: 64px; height: 64px; margin: 0 0 10px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff6d4, #ffe08a 60%, #f5c23a);
  box-shadow: 0 0 0 6px #fff4cc, 0 10px 24px rgba(185, 135, 0, .35);
}
.hall-badge svg { width: 40px; height: 40px; }
.hall[open] .hall-badge { animation: badge-pop .8s var(--spring, ease) .12s both; }
@keyframes badge-pop { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
.hall h2 {
  margin: 0;
  font-family: "Lilita One", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(25px, 7vw, 31px); line-height: 1.1; letter-spacing: .01em;
  text-wrap: balance;
}
.hall h2 sup { font-size: .5em; color: var(--red); margin-left: 1px; }
.hall-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.hall-list {
  list-style: none; margin: 16px -4px 0; padding: 2px 4px 6px; text-align: left;
  display: grid; gap: 7px; align-content: start;
  flex: 1 1 auto; min-height: 112px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.hall-list li {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 14px 8px 8px;
  border: 1.5px solid #ece5d8; border-radius: 14px;
  background: #fff;
}
.hall[open] .hall-list li { animation: row-in .5s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 150ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } }
.hall-list li.me { border-color: var(--gold); background: linear-gradient(90deg, #fff8dc, #fffdf4); box-shadow: 0 4px 14px rgba(245, 183, 0, .18); }
.hall-list li.me.new { animation: row-in .5s cubic-bezier(.16, 1, .3, 1) both, glow 1.6s ease-in-out .7s 2; animation-delay: calc(var(--i, 0) * 45ms + 150ms), .9s; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(245, 183, 0, .35), 0 4px 14px rgba(245, 183, 0, .18); } }
.hall-list li.empty { display: block; text-align: center; color: var(--muted); border-style: dashed; padding: 18px 0; }

.hall-list .rank {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--muted); background: #f4efe6;
}
.hall-list .rank.gold { color: #6b4300; background: radial-gradient(circle at 35% 30%, #fff1b0, #f5b700 70%); box-shadow: inset 0 0 0 1.5px #c99200; }
.hall-list .rank.silver { color: #3c4450; background: radial-gradient(circle at 35% 30%, #ffffff, #c5ccd6 70%); box-shadow: inset 0 0 0 1.5px #9aa3af; }
.hall-list .rank.bronze { color: #5a2f0c; background: radial-gradient(circle at 35% 30%, #ffd9b0, #d08a4a 70%); box-shadow: inset 0 0 0 1.5px #a7652c; }
.hall-list .who { min-width: 0; display: flex; align-items: center; gap: 8px; }
.hall-list .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hall-list .you {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #7a5200; background: #ffe58a; border-radius: 999px; padding: 2px 8px;
}
.hall-list .paid { display: flex; align-items: center; font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hall-list .paid .fish-icon { margin-right: 6px; }

.hall-name-form { flex: none; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #faf6ef; }
.hall-name-form label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hall-name-row { display: flex; gap: 8px; }
.hall-name-row .text-input { flex: 1; min-width: 0; background: #fff; }
.hall-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.hall-foot { flex: none; margin-top: 12px; }
.footnote { margin: 0 0 10px; font-size: 12px; color: var(--muted); }

/* ---------- The End ---------- */
.fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 65; }
.finale {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  overflow: hidden; cursor: pointer;
  background: radial-gradient(ellipse at 50% 42%, rgba(46, 28, 0, .45), rgba(10, 6, 0, .86) 72%);
  -webkit-tap-highlight-color: transparent;
}
.finale-rays {
  position: absolute; left: 50%; top: 44%;
  width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .2) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 22%, transparent 55%);
          mask: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 22%, transparent 55%);
  animation: rays-spin 60s linear infinite;
  pointer-events: none;
}
@keyframes rays-spin { to { rotate: 360deg; } }
.finale-content {
  position: relative; margin-top: -6vh; padding: 0 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.finale-kicker {
  margin: 0;
  font-weight: 800; font-size: clamp(13px, 3.4vw, 17px); line-height: 1;
  letter-spacing: .32em; text-transform: uppercase; padding-left: .32em;
  color: #ffe9a8; text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
.finale-title {
  margin: 0;
  font-family: "Lilita One", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(66px, 19vw, 156px); line-height: 1; letter-spacing: .02em;
  white-space: nowrap;
  filter: drop-shadow(0 5px 0 #8a5300) drop-shadow(0 18px 30px rgba(0, 0, 0, .55));
}
.finale-title span {
  display: inline-block;
  color: transparent;
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%) no-repeat,
    linear-gradient(180deg, #fffbe8 0%, #ffe066 36%, #f5b700 54%, #ffd23f 80%, #fff0a8 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
}
.finale-title .gap { width: .26em; }
.finale-sub {
  margin: 8px 0 0;
  font-family: var(--comic); font-weight: 700; font-size: clamp(16px, 4.4vw, 21px);
  color: var(--ink); background: #fff;
  border: 3px solid var(--ink); border-radius: 999px; padding: 6px 18px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28);
}
.finale-skip {
  position: absolute; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom));
  margin: 0; text-align: center;
  color: rgba(255, 255, 255, .7); font-size: 13px; letter-spacing: .08em;
}

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i {
  position: absolute; top: -20px;
  width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

@media (max-height: 640px) {
  .sign { margin-top: 8px; padding: 6px 22px; font-size: clamp(19px, 6vw, 32px); }
  .bubble-wrap { height: 6.6em; padding-bottom: 12px; }
  .pay-btn { padding: 10px 20px 9px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sign.flash, .sign.shake, .bubble.pop, .sheet[open], .sheet[open]::backdrop, .hall[open] .hall-badge, .hall[open] .hall-list li { animation: none; }
  .finale-rays { animation: none; }
}

/* ---------- start screen ---------- */
.start {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(75, 155, 232, .55) 0%, rgba(216, 238, 252, .55) 55%, rgba(99, 168, 67, .6) 100%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity .7s ease, visibility .7s;
}
.start.out { opacity: 0; visibility: hidden; }
.start-card {
  width: min(100%, 400px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 26px 26px;
  background: rgba(255, 255, 255, .92); border-radius: 28px;
  box-shadow: 0 24px 60px rgba(20, 40, 60, .28);
  text-align: center;
  animation: start-in .7s cubic-bezier(.2, 1.3, .4, 1) both;
}
.start.out .start-card { transform: scale(.92) translateY(10px); transition: transform .6s ease; }
@keyframes start-in { from { opacity: 0; transform: translateY(24px) scale(.94); } }
.start-fish {
  width: 84px; height: 56px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Cpath d='M30 12 L39 3.5 L37.5 12 L39 20.5 Z' fill='%235aa9e6' stroke='%231d4e7a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3 12 C9 2 25 2 32 12 C25 22 9 22 3 12 Z' fill='%2378bdf0' stroke='%231d4e7a' stroke-width='1.6'/%3E%3Cpath d='M17 7.5 C20 10 20 14 17 16.5' fill='none' stroke='%231d4e7a' stroke-width='1.3' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='10.5' r='1.9' fill='%231d4e7a'/%3E%3C/svg%3E") no-repeat center / contain;
  animation: fish-bob 2.4s ease-in-out infinite;
}
@keyframes fish-bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.start-title {
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
  font-family: "Lilita One", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(38px, 11vw, 52px); line-height: .98; letter-spacing: .01em;
  color: #fff;
  background: var(--red); border: 4px solid #fff; border-radius: 16px;
  box-shadow: 0 0 0 4px var(--red), 0 12px 22px rgba(120, 0, 0, .28);
  padding: 10px 26px 12px;
  transform: rotate(-2deg);
}
.start-tag { margin: 4px 0 0; font-family: var(--comic); font-weight: 700; font-size: 16px; color: #4d4740; }
.start-progress {
  width: 100%; height: 12px; margin-top: 6px;
  border-radius: 999px; overflow: hidden;
  background: #e9e4da; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.start-progress span {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, #1fb257 0 10px, #16a34a 10px 20px);
  background-size: 28px 100%;
  animation: bar-slide .8s linear infinite;
}
@keyframes bar-slide { to { background-position: 28px 0; } }
.start-status { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.start-btn {
  width: 100%; margin-top: 4px;
  border: 0; border-radius: 999px;
  padding: 15px 24px;
  font-size: 22px; font-weight: 800; color: #fff;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-dark), 0 14px 24px rgba(15, 122, 53, .3);
  transition: transform .08s, box-shadow .08s, filter .2s, opacity .3s;
}
.start-btn:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.start-btn.ready { animation: start-pulse 1.8s ease-in-out infinite; }
.start-btn:not(:disabled):hover { filter: brightness(1.06); }
.start-btn:not(:disabled):active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-dark), 0 4px 10px rgba(15, 122, 53, .3); animation: none; }
.start-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
@keyframes start-pulse { 50% { transform: scale(1.035); } }

/* during the opening shot the page waits; it slides in as the camera arrives */
.app .topbar, .app .sign, .app .bubble-wrap, .app .actions, .app .footer {
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, 1.3, .4, 1);
}
body.intro .app .topbar { opacity: 0; transform: translateY(-20px); }
body.intro .app .sign { opacity: 0; transform: translateY(-40px) rotate(-2deg) scale(.9); }
body.intro .app .bubble-wrap { opacity: 0; }
body.intro .app .actions, body.intro .app .footer { opacity: 0; transform: translateY(30px); }
body.intro .app * { pointer-events: none !important; }
.app .sign { transition-delay: .15s; }
.app .actions { transition-delay: .3s; }

/* the fish counter gives a little hop when a fish leaves it */
.tokens.bump { animation: tok-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tok-bump { 40% { transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  .start-card, .start-fish, .start-btn.ready, .start-progress span, .tokens.bump { animation: none; }
}

/* with the 3D street the sign hangs on the cat's fence instead of over the page */
body.street .app .sign { display: none; }

/* ---------- the finale film: the page steps aside, only a Skip button stays ---------- */
body.cinematic .app .topbar { opacity: 0; transform: translateY(-20px); }
body.cinematic .app .bubble-wrap { opacity: 0; }
body.cinematic .app .actions, body.cinematic .app .footer { opacity: 0; transform: translateY(30px); }
body.cinematic .app * { pointer-events: none !important; }
.cine-skip {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 66;
  padding: 10px 18px 10px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 15px/1 system-ui, sans-serif; letter-spacing: .02em; color: #fff;
  background: rgba(10, 14, 28, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 6px 20px rgba(0, 0, 0, .25);
  animation: cine-skip-in .5s 1.2s both ease-out;
}
.cine-skip::after { content: ' ›'; font-size: 18px; }
.cine-skip:hover { background: rgba(10, 14, 28, .75); }
.cine-skip[hidden] { display: none; }
@keyframes cine-skip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- a free fish every day: a little note under the fish counter ---------- */
.daily-note {
  position: fixed; z-index: 45; display: inline-flex; align-items: center; gap: 2px;
  padding: 8px 14px 8px 11px; border-radius: 999px; pointer-events: none; white-space: nowrap;
  font-weight: 600; font-size: 14px; color: #1f2a1a; background: #fff;
  box-shadow: 0 8px 22px rgba(20, 30, 40, .18), 0 0 0 2px rgba(255, 255, 255, .9) inset;
}
.daily-note b { color: #1a9a4a; margin-right: 4px; font-size: 15px; }
.daily-note::before {
  content: ''; position: absolute; left: 22px; top: -6px; width: 12px; height: 12px;
  background: #fff; transform: rotate(45deg); border-radius: 2px;
}
