/* ═══════════════════════════════════════════════════════════════
   SeaStash — design system
   "Your money is an ocean."
   Depth palettes shift as the child levels up: the whole app
   literally gets deeper, calmer and more bioluminescent.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* iOS zooms the whole page on a double-tap. On a kid's app that means a
   fast second tap on any control leaves everything enlarged and, with a
   fixed overlay open, the close button can end up outside the visual
   viewport entirely. 'manipulation' keeps taps and scrolling but drops
   double-tap zoom. Pinch-to-zoom is deliberately left working. */
button, a, .chip, .chip-btn, .foot-link, .age-bub, summary,
input[type="button"], input[type="submit"]{ touch-action: manipulation; }
/* no double-tap-to-zoom anywhere in the app itself */
html, body{ touch-action: manipulation; }
[hidden]{ display: none !important; }

:root{
  /* type */
  --disp: "Fredoka", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;

  /* depth 1 · Rockpool (default) */
  --sea-hi:   #35c7e8;
  --sea-mid:  #128db8;
  --sea-lo:   #075e86;
  --sea-deep: #033a58;
  --glow:     #9ff1ff;
  --sand:     #ffe9b8;
  --coral:    #ff7e67;
  --coral-2:  #ffb25e;
  --leaf:     #57e6a8;
  --ink:      #06283d;
  --card:     rgba(255,255,255,.86);
  --card-brd: rgba(255,255,255,.55);
  --wash:     rgba(230,251,255,.92);
  --txt:      #0b3752;
  --txt-dim:  #4a7a94;
  --btn-add:  linear-gradient(160deg,#37d67f,#0fae62);
  --btn-spd:  linear-gradient(160deg,#ffb25e,#ff7e67);
  --ring:     rgba(159,241,255,.9);
  --shadow:   0 10px 30px -8px rgba(3,40,64,.45);
  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
}

body[data-depth="2"]{ /* Lagoon */
  --sea-hi:#2eb4e4; --sea-mid:#0f7cb4; --sea-lo:#085184; --sea-deep:#03305c;
  --glow:#8be9ff; --coral:#ff7d8a; --coral-2:#ffab5e; --leaf:#4fe0b0;
}
body[data-depth="3"]{ /* Coral Reef */
  --sea-hi:#1f9fd8; --sea-mid:#0d64ad; --sea-lo:#0a3f88; --sea-deep:#062560;
  --glow:#7fdcff; --coral:#ff6fa5; --coral-2:#ffa94d; --leaf:#43dbb9;
}
body[data-depth="4"]{ /* Open Sea */
  --sea-hi:#1786c4; --sea-mid:#0b4f9e; --sea-lo:#092f7e; --sea-deep:#051a55;
  --glow:#74ceff; --coral:#c583ff; --coral-2:#ff8fb1; --leaf:#3bd6c4;
}
body[data-depth="5"]{ /* Twilight */
  --sea-hi:#1268a8; --sea-mid:#0a3c8c; --sea-lo:#0a2270; --sea-deep:#040f45;
  --glow:#6cc0ff; --coral:#b07bff; --coral-2:#ff7bd5; --leaf:#35ccd0;
}
body[data-depth="6"]{ /* Abyss */
  --sea-hi:#0c4d8e; --sea-mid:#082a78; --sea-lo:#081861; --sea-deep:#02071f;
  --glow:#65e8ff; --coral:#9d6bff; --coral-2:#ff6bcb; --leaf:#2fe0d8;
}

html{ -webkit-text-size-adjust:100%; }
body{
  font-family: var(--body);
  color: var(--txt);
  background: var(--sea-deep);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 1.2s ease;
}
body.booting #app, body.booting .onb{ opacity: 0; }

/* ── icon artwork ─────────────────────────────────────────
   Custom SVG icons standing in for stock emoji. Sized in em so
   they inherit the rhythm of whatever text they sit beside.    */
.ico-img{
  width: 1.35em; height: 1.35em;
  object-fit: contain;
  display: inline-block; vertical-align: -0.3em;
  user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 1px 2px rgba(0,20,40,.28));
}
.hist-ico .ico-img{ width: 26px; height: 26px; vertical-align: middle; }
#soundChip .ico-img{ width: 21px; height: 21px; vertical-align: middle; }
.sheet h3 .ico-img{ width: 1.25em; height: 1.25em; }
.gu-section h4 .ico-img{ width: 1.3em; height: 1.3em; }
.acc-kind .ico-img{
  width: 19px; height: 19px; vertical-align: -0.4em;
  /* the vault art is dark — a soft light disc keeps it readable on the blue card */
  background: rgba(255,255,255,.94); border-radius: 50%; padding: 1px;
}
/* big faded artwork watermark in the corner of an account card */
.acc-wave .ico-img.acc-art{
  width: 84px; height: 84px;
  filter: none; vertical-align: baseline;
}
.acc-card .acc-wave:has(.acc-art){ opacity: .3; right: -10px; bottom: -12px; }
.mini-btn .ico-img, .foot-link .ico-img{ width: 1.4em; height: 1.4em; }
/* the book is portrait, so it letterboxes inside a square box —
   a little extra size makes it read the same weight as its neighbours */
.ico-img.ico-guide{ width: 1.62em; height: 1.62em; vertical-align: -0.42em; }
/* the wave is a detailed piece of artwork — at a normal inline size it
   collapses into a smudge, so it runs a little larger than its siblings */
.ico-img.ico-waves{
  width: 1.75em; height: 1.75em;
  vertical-align: -0.52em;
  filter: none;
}

/* ── scene layers ─────────────────────────────────────────── */
#gl, #fx{
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
#fx{ z-index: 2; }
#rays{ position: fixed; inset: -10% -20%; z-index: 1; pointer-events: none; overflow: hidden; opacity:.5; }
#rays i{
  position:absolute; top:-30%; height:160%; width: 18vw; left: 8vw;
  background: linear-gradient(180deg, var(--glow), transparent 70%);
  opacity:.12; transform: rotate(14deg);
  filter: blur(18px);
  animation: raysway 11s ease-in-out infinite alternate;
}
#rays i:nth-child(2){ left: 38vw; width: 10vw; animation-duration: 9s; opacity:.09; }
#rays i:nth-child(3){ left: 64vw; width: 22vw; animation-duration: 14s; opacity:.10; }
@keyframes raysway{ from{ transform: rotate(11deg) translateX(-4vw);} to{ transform: rotate(17deg) translateX(5vw);} }

/* ── layout ───────────────────────────────────────────────── */
#app{
  position: relative; z-index: 3;
  max-width: 560px; margin: 0 auto;
  /* top inset keeps the bar clear of the notch when installed to the home screen */
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
/* wide screens: sheets become centered modals instead of bottom drawers */
@media(min-width: 700px){
  .sheet-wrap{ align-items: center; padding: 30px 20px; }
  .sheet{
    border-radius: 26px;
    max-height: 86dvh;
    transform: translateY(46px) scale(.97);
    opacity: 0;
    transition: transform .32s cubic-bezier(.22,1.2,.36,1), opacity .28s;
  }
  .sheet-wrap.open .sheet{ transform: none; opacity: 1; }
  .sheet::before{ display: none; }
}

/* The ocean stays ONE column at every width. A two-column grid used to open at
   1000px, which caught the iPad — 1032pt in portrait — and it read as two
   unrelated panels rather than one page: the pool no longer sat above the wishes
   it feeds, and the reef lost the sand line running under it. The layout is
   designed as a single scroll and stays that way; #app's 560px cap centres it on
   anything wider. (The 700px rule that turns sheets into centred modals is a
   separate thing and is correct.)
   Do not reintroduce a wide grid without checking a 13-inch iPad in BOTH
   orientations — landscape is 1376pt, so any breakpoint below that catches it too. */

/* ── topbar ───────────────────────────────────────────────── */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 8px 2px 0;
}
.brand{ display:flex; align-items:center; gap:9px; user-select:none; cursor:pointer; }
.brand-drop{ width:34px; height:23px; filter: drop-shadow(0 3px 6px rgba(0,30,60,.4)); animation: bob 3.4s ease-in-out infinite; }
@keyframes bob{ 0%,100%{ transform: translateY(0) rotate(-3deg);} 50%{ transform: translateY(-4px) rotate(3deg);} }
.brand-word{
  font-family: var(--disp); font-weight: 500; font-size: 1.35rem; letter-spacing:.01em;
  color:#eafcff; text-shadow: 0 2px 12px rgba(0,40,80,.5);
}
.brand-word b{ font-weight: 700; color: var(--glow); }
.top-right{ display:flex; gap:8px; }
.chip-btn{
  font-family: var(--disp); font-size:.86rem; font-weight:600;
  border:0; cursor:pointer; color:#eafcff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 7px 12px; border-radius: 999px;
  display:flex; align-items:center; gap:6px;
  transition: transform .15s, background .3s;
}
.chip-btn:active{ transform: scale(.92); }
.streak-chip.hot{ background: linear-gradient(140deg, rgba(255,146,84,.45), rgba(255,94,120,.35)); border-color: rgba(255,180,120,.55); }

/* depth bar — your place in the ocean */
.depth-bar{
  display:flex; align-items:center; gap:10px; width:100%;
  border:1px solid rgba(255,255,255,.22); border-radius:999px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px; cursor:pointer;
  color:#eafcff; font-family:var(--disp); font-weight:600; font-size:.9rem;
  transition: transform .15s;
}
.depth-bar:active{ transform: scale(.98); }
.db-name{ white-space:nowrap; }
.db-track{
  flex:1; height:8px; border-radius:999px; background:rgba(0,20,40,.45); overflow:hidden;
}
.db-track i{
  display:block; height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--leaf), var(--glow));
  box-shadow: 0 0 10px var(--glow);
  transition: width .9s cubic-bezier(.22,1.2,.36,1);
  min-width: 8px;
}
.db-xp{ font-family:var(--body); font-weight:800; font-size:.74rem; opacity:.8; white-space:nowrap; }

/* ── demo banner ──────────────────────────────────────────── */
.demo-banner{
  z-index:3; display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: rgba(255,224,130,.92); color:#5c3d00;
  border-radius: var(--r-sm); padding: 9px 12px; font-size:.9rem; font-weight:700;
  box-shadow: var(--shadow);
}
.demo-banner button{
  border:0; background:#5c3d00; color:#ffe9b8; font-weight:800; font-family:var(--body);
  padding:6px 12px; border-radius:999px; cursor:pointer; white-space:nowrap;
}

/* ── pool card ────────────────────────────────────────────── */
.pool-card{
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255,255,255,.38), rgba(255,255,255,.06) 60%),
    linear-gradient(175deg, color-mix(in srgb, var(--sea-hi) 82%, white 5%), var(--sea-mid) 55%, var(--sea-lo));
  border: 1.5px solid rgba(255,255,255,.35);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.5);
  padding: 22px 20px 20px;
  color: #f2fdff;
}
#poolFx{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.pool-top{ position:relative; text-align:center; }
.pool-label{
  font-family: var(--disp); font-weight:600; font-size: 1.02rem; letter-spacing:.06em;
  text-transform: uppercase; opacity:.85;
}
.pool-balance{
  font-family: var(--disp); font-weight:700;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height:1.12; letter-spacing:.01em;
  text-shadow: 0 3px 18px rgba(0,50,90,.45);
  font-variant-numeric: tabular-nums;
}
.pool-sub{ font-size:.92rem; font-weight:700; opacity:.8; }
.pool-actions{ position:relative; display:flex; gap:12px; margin-top:18px; }
.big-btn{
  flex:1; border:0; cursor:pointer;
  font-family: var(--disp); font-weight:600; font-size:1.12rem; color:#fff;
  padding: 15px 10px; border-radius: 20px;
  display:flex; align-items:center; justify-content:center; gap:9px;
  box-shadow: 0 6px 0 rgba(0,40,60,.25), 0 12px 24px -6px rgba(0,30,60,.35), inset 0 1.5px 0 rgba(255,255,255,.4);
  transition: transform .12s, box-shadow .12s, filter .2s;
  touch-action: manipulation;
}
.big-btn.add{ background: var(--btn-add); }
.big-btn.spend{ background: var(--btn-spd); }
.big-btn:active{ transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,40,60,.25), 0 6px 12px -6px rgba(0,30,60,.35), inset 0 1.5px 0 rgba(255,255,255,.4); }
.big-btn .ico{ font-size:1.25rem; }

/* 3D spinning coin on the Add button */
.coin3d{ width:26px; height:26px; position:relative; transform-style:preserve-3d; animation: coinspin 3.2s linear infinite; }
.coin3d .face{
  position:absolute; inset:0; border-radius:50%;
  display:grid; place-items:center; font-style:normal; font-weight:700; font-size:.9rem;
  background: radial-gradient(circle at 32% 28%, #ffe89b, #f7c437 58%, #cf9718);
  color:#8a5f00; border:2px solid #cf9718;
  backface-visibility:hidden;
}
.coin3d .f2{ transform: rotateY(180deg); }
@keyframes coinspin{ from{ transform: rotateY(0);} to{ transform: rotateY(360deg);} }

/* ── count-your-treasure ──────────────────────────────────── */
.count-btn{
  position:relative; width:100%; margin-top:12px; cursor:pointer;
  border:1.5px dashed rgba(255,255,255,.45); border-radius:16px;
  background:rgba(255,255,255,.14); color:#f2fdff;
  font-family:var(--body); font-weight:800; font-size:.92rem;
  padding:11px 10px; transition: background .2s, transform .12s;
}
.count-btn:active{ transform:scale(.98); background:rgba(255,255,255,.22); }
.count-banner{
  z-index:3; display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: linear-gradient(140deg,#fff0c2,#ffd98a); color:#6b4a00;
  border-radius: var(--r-sm); padding: 10px 12px; font-size:.9rem; font-weight:800;
  box-shadow: var(--shadow);
}
.count-banner .cb-actions{ display:flex; gap:6px; flex-shrink:0; }
.count-banner button{
  border:0; cursor:pointer; background:#6b4a00; color:#ffeec2; font-weight:800;
  font-family:var(--body); padding:6px 12px; border-radius:999px; white-space:nowrap;
}
.count-banner button.ghost{ background:rgba(107,74,0,.15); color:#6b4a00; padding:6px 10px; }
.count-total{
  text-align:center; font-family:var(--disp); font-weight:700;
  font-size: clamp(2.2rem, 9vw, 3rem); color:var(--ink);
  background:#fff; border-radius:var(--r-sm); border:2px solid rgba(30,120,170,.25);
  padding:10px; margin-bottom:12px; font-variant-numeric: tabular-nums;
}
.count-coins{ margin-bottom:10px; }
.count-coins .coin-chip{
  min-width:62px; font-family:var(--disp); font-weight:600; font-size:1rem;
  background: radial-gradient(circle at 32% 28%, #ffe89b, #f7c437 65%, #d9a41c);
  color:#7a5300; border:1.5px solid #d9a41c;
  box-shadow: 0 3px 0 rgba(150,110,10,.35);
}
.count-coins .coin-chip:active{ transform: translateY(2px) scale(.96); box-shadow: 0 1px 0 rgba(150,110,10,.35); }
.count-tools{ display:flex; gap:8px; justify-content:center; margin-bottom:6px; }
.count-verdict{ border-radius:var(--r-sm); padding:16px; text-align:center; margin:6px 0 4px; }
.count-verdict.match{ background:linear-gradient(140deg,#dcf7e8,#c7f0ff); }
.count-verdict.off{ background:linear-gradient(140deg,#fff1e2,#ffe5ec); }
.cv-big{ font-family:var(--disp); font-weight:700; font-size:1.5rem; color:var(--ink); }
.cv-sub{ font-size:.92rem; font-weight:700; color:var(--txt-dim); margin-top:6px; line-height:1.5; }
.count-hints ul{ padding-left:20px; margin:2px 0 4px; }
.count-hints li{ font-size:.92rem; font-weight:700; color:var(--txt); margin:5px 0; }

/* ── quest card ───────────────────────────────────────────── */
.quest-card{
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(9,46,84,.72), rgba(9,64,96,.62));
  border: 1px solid rgba(140,230,255,.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color:#dff6ff; padding: 14px 16px;
  box-shadow: var(--shadow);
}
.quest-head{ display:flex; align-items:center; gap:10px; }
.quest-emoji{ font-size:1.6rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.quest-title{ font-family:var(--disp); font-weight:600; font-size:1rem; }
.quest-name{ font-size:.86rem; opacity:.8; font-weight:700; }
.quest-track{ margin-top:10px; height:14px; border-radius:999px; background:rgba(0,20,40,.5); overflow:hidden; position:relative; }
.quest-fill{
  height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--leaf), var(--glow));
  box-shadow: 0 0 12px var(--glow);
  transition: width .8s cubic-bezier(.22,1.4,.36,1);
  min-width: 6px;
}
.quest-steps{ margin-top:6px; font-size:.8rem; font-weight:800; opacity:.75; display:flex; justify-content:space-between; }
.quest-done{ display:flex; align-items:center; gap:10px; }
.quest-done .big{ font-size:1.7rem; }

/* ── zones ────────────────────────────────────────────────── */
.zone-title{
  display:flex; align-items:baseline; justify-content:space-between; gap:10px;
  font-family: var(--disp); font-weight:600; font-size:1.18rem; color:#eafcff;
  text-shadow: 0 2px 10px rgba(0,40,70,.5);
  margin-bottom: 10px; padding: 0 2px;
}
.zone-title small{ font-size:.82rem; font-weight:700; color: var(--glow); opacity:.9; font-family:var(--body); }
.mini-btn{
  font-family: var(--body); font-weight:800; font-size:.82rem;
  color:#eafcff; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.22);
  padding:6px 12px; border-radius:999px; cursor:pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .12s;
}
.mini-btn:active{ transform: scale(.93); }

/* ── wish cards ───────────────────────────────────────────── */
.wish-grid{ display:grid; gap:14px; }
.wish-card{
  position:relative; overflow:hidden;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1.5px solid var(--card-brd);
  box-shadow: var(--shadow);
  padding: 16px;
  display:grid; grid-template-columns: 100px 1fr; gap: 8px 14px; align-items:center;
}
/* a bubble nursery, not a fish tank — round, glassy, and it belongs
   underwater in a way a rectangular box never did */
.wish-tank{
  position:relative; width:100px; height:100px; border-radius:50%;
  background: linear-gradient(180deg, #e8fbff, #bfeffc);
  border: 2px solid rgba(120,220,255,.5);
  box-shadow: inset 0 -8px 18px -8px rgba(4,80,120,.35),
              0 6px 16px -8px rgba(3,60,100,.5);
  overflow:hidden;
  display:grid; place-items:center;
}
/* the glassy highlight that makes it read as a bubble */
.wish-tank::after{
  content:""; position:absolute; z-index:4; pointer-events:none;
  left:14%; top:8%; width:34%; height:24%;
  background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,0) 70%);
  transform: rotate(-18deg);
}
.tank-fill{
  position:absolute; left:0; right:0; bottom:0; z-index:1;
  background: linear-gradient(180deg, #55cdf0, #1b93cf);
  box-shadow: inset 0 4px 10px -3px rgba(255,255,255,.55), inset 0 -8px 14px -8px rgba(4,60,100,.5);
  color:#55cdf0;
  transition: height 1.1s cubic-bezier(.22,1.2,.36,1);
}
.tank-fill .crest{
  position:absolute; top:-9px; left:0; width:200%; height:10px;
  color: inherit;
}
.wish-tank .creature-holder{ position:relative; z-index:2; width:74%; filter: drop-shadow(0 3px 4px rgba(0,60,90,.25)); }
.wish-tank .pct{
  position:absolute; z-index:5; bottom:4px; left:50%; transform:translateX(-50%);
  font-weight:800; font-size:.74rem; color:#046084;
  background: rgba(255,255,255,.86); padding:1px 8px; border-radius:999px;
  box-shadow:0 1px 3px rgba(4,60,90,.25);
}
.wish-info{ min-width:0; }
.wish-name{ font-family:var(--disp); font-weight:600; font-size:1.12rem; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wish-nums{ font-size:.9rem; font-weight:800; color:var(--txt-dim); margin-top:2px; font-variant-numeric: tabular-nums; }
.wish-nums b{ color:#0b7d4d; }
.wish-stage-line{ font-size:.82rem; font-weight:700; color:#8b6ac2; margin-top:3px; }
.wish-cta{ margin-top:9px; display:flex; gap:8px; }
.feed-btn{
  border:0; cursor:pointer; font-family:var(--disp); font-weight:600; font-size:.95rem;
  color:#fff; background: linear-gradient(150deg,#31bef0,#1a76d0);
  padding: 9px 16px; border-radius: 14px;
  box-shadow: 0 4px 0 rgba(10,60,110,.3), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .12s, box-shadow .12s;
}
.feed-btn:active{ transform: translateY(3px); box-shadow: 0 1px 0 rgba(10,60,110,.3); }
.wish-menu{
  border:0; background:rgba(9,60,90,.08); color:var(--txt-dim); cursor:pointer;
  width:38px; border-radius:12px; font-size:1.1rem; font-weight:900;
}
.add-wish{
  border:2px dashed rgba(255,255,255,.45); border-radius:var(--r-md);
  background: rgba(255,255,255,.1); color:#eafcff;
  font-family:var(--disp); font-weight:600; font-size:1rem;
  padding: 18px; cursor:pointer; width:100%;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .2s, transform .12s;
}
.add-wish:active{ transform: scale(.98); }

/* ── the pet ──────────────────────────────────────────────── */
.wish-tank .creature-holder{ transition: transform .28s cubic-bezier(.22,1.2,.36,1); }
.creature-holder.hop{ animation: pethop .65s cubic-bezier(.28,1.5,.4,1); }
@keyframes pethop{
  0%{ transform: translateY(0) scale(1); }
  30%{ transform: translateY(-14px) scale(1.12) rotate(-7deg); }
  55%{ transform: translateY(2px) scale(.96) rotate(4deg); }
  100%{ transform: translateY(0) scale(1); }
}
.wish-tank.sleepy{ filter: saturate(.75) brightness(.94); }
.wish-forecast{ font-size:.8rem; font-weight:800; color:#0b7d9e; margin-top:3px; }
/* The photo IS the thing being saved for, so it has to be worth having taken.
   At 26px it was a speck beside the title and read as "the picture went nowhere". */
.wish-photo{
  width:52px; height:52px; object-fit:cover; border-radius:11px;
  vertical-align:-16px; margin-right:10px; cursor:pointer;
  border:2px solid #fff; box-shadow:0 3px 10px rgba(3,40,64,.32);
}
@media(max-width:380px){ .wish-photo{ width:42px; height:42px; vertical-align:-13px; } }
.photo-prev{ width:100%; max-height:150px; object-fit:cover; border-radius:var(--r-sm); margin-top:8px; }
.photo-big{ width:100%; border-radius:var(--r-md); display:block; }

/* ── pet expressiveness ───────────────────────────────────
   Eyes that look, moods that show, tickles that giggle.        */
.cr-pupils{ transition: transform .16s ease-out; }
.wish-tank{ touch-action: none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

/* moods */
.wish-tank.excited .creature-holder{ animation: tank-excited 1.1s ease-in-out infinite; }
@keyframes tank-excited{
  0%,100%{ margin-top:0; } 30%{ margin-top:-7px; } 55%{ margin-top:1px; }
}
.wish-tank.hungry .creature-holder{ animation: tank-hungry 2.6s ease-in-out infinite; }
@keyframes tank-hungry{
  0%,100%{ transform: rotate(0); } 25%{ transform: rotate(-4deg); } 75%{ transform: rotate(4deg); }
}
.tank-thought{
  position:absolute; z-index:6; top:4px; right:4px;
  border:0; cursor:pointer; padding:2px 7px; border-radius:12px 12px 12px 3px;
  background:rgba(255,255,255,.92); font-size:.85rem;
  box-shadow:0 2px 8px rgba(4,60,90,.3);
  animation: thought-bob 2.4s ease-in-out infinite;
}
@keyframes thought-bob{
  0%,100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(-4px) scale(1.06); }
}

/* poke tricks */
.creature-holder.duck-hide svg{ animation: duck-hide .85s cubic-bezier(.3,1.4,.4,1); }
@keyframes duck-hide{
  0%{ transform:none; } 30%{ transform: translateY(24%) scaleY(.45); }
  70%{ transform: translateY(24%) scaleY(.45); } 100%{ transform:none; }
}
.creature-holder.puff-up svg{ animation: puff-up .85s cubic-bezier(.3,1.6,.4,1); }
@keyframes puff-up{
  0%,100%{ transform: scale(1); } 40%{ transform: scale(1.35); } 70%{ transform: scale(1.28); }
}
.creature-holder.spin-round svg{ animation: spin-round .72s cubic-bezier(.5,.2,.5,.9); }
@keyframes spin-round{ to{ transform: rotate(360deg); } }
.creature-holder.giggling svg{ animation: giggling .9s ease-in-out; }
@keyframes giggling{
  0%,100%{ transform: rotate(0) scale(1); }
  15%{ transform: rotate(-8deg) scale(1.05,.95); }
  35%{ transform: rotate(8deg) scale(.95,1.05); }
  55%{ transform: rotate(-7deg) scale(1.05,.95); }
  75%{ transform: rotate(6deg) scale(.97,1.03); }
}

/* floating reactions & idle bubbles */
.tank-react{
  position:absolute; z-index:7; left:50%; top:38%; pointer-events:none;
  font-size:1.15rem;
  animation: tank-react 1.05s ease-out forwards;
}
.tank-react.heart{ font-size:.85rem; }
@keyframes tank-react{
  0%{ opacity:0; transform: translate(-50%,0) scale(.4); }
  20%{ opacity:1; transform: translate(-50%,-10px) scale(1.15); }
  100%{ opacity:0; transform: translate(-50%,-44px) scale(1); }
}
.tank-bub{
  position:absolute; z-index:5; bottom:34%; width:7px; height:7px; pointer-events:none;
  border-radius:50%; border:1.5px solid rgba(255,255,255,.95);
  animation: tank-bub 2.2s ease-in forwards;
}
@keyframes tank-bub{
  0%{ opacity:0; transform: translateY(0) scale(.6); }
  20%{ opacity:.95; }
  100%{ opacity:0; transform: translateY(-58px) scale(1.15); }
}
body.perf-low .wish-tank.excited .creature-holder,
body.perf-low .wish-tank.hungry .creature-holder{ animation:none; }
body.perf-low .tank-thought{ animation:none; }

/* ── coin toss: the feeding game ──────────────────────────
   A little physics playground: air above the surface line, water
   below, sand at the bottom. The coin (.toss-proj) is driven by
   JS with transforms only; everything else here is dressing.    */
.toss-stage{
  position:relative; height:250px; border-radius:var(--r-md); overflow:hidden;
  background: linear-gradient(180deg,#e8fbff 0%, #cdf2fe 30%, #8fdcf6 33%, #4fb9e2 60%, #2793c4 100%);
  border:2px solid rgba(60,160,200,.3); margin-bottom:10px;
  touch-action:none;
}
.toss-sea{
  position:absolute; left:0; right:0; bottom:0; top:32%; z-index:5; pointer-events:none;
  background: linear-gradient(180deg, rgba(105,200,235,.35), rgba(20,110,160,.42));
}
.toss-surface{
  position:absolute; left:0; right:0; top:32%; height:3px; z-index:6; pointer-events:none;
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.4) 30%, rgba(255,255,255,.9) 70%, rgba(255,255,255,.5));
  box-shadow:0 1px 6px rgba(255,255,255,.6);
}
.toss-sandbed{
  position:absolute; left:-2%; right:-2%; bottom:0; height:26px; z-index:3;
  background: linear-gradient(180deg,#ffe9b8,#e6c081);
  border-radius:50% 50% 0 0 / 14px 14px 0 0;
}
.toss-pet{
  position:absolute; left:0; top:0; width:92px; height:92px; z-index:4;
  will-change:transform; pointer-events:none;
}
.toss-pet svg{ width:100%; height:100%; }
.toss-pet.chomp svg{ animation: tosschomp .4s cubic-bezier(.3,1.6,.4,1); }
@keyframes tosschomp{
  0%{ transform: scale(1); } 35%{ transform: scale(1.22,.8); }
  65%{ transform: scale(.92,1.1); } 100%{ transform: scale(1); }
}
.toss-pet.grew svg{ animation: tossgrew .8s cubic-bezier(.3,1.5,.4,1); }
@keyframes tossgrew{
  0%{ transform: scale(.7); filter: brightness(1.6); }
  60%{ transform: scale(1.15); }
  100%{ transform: scale(1); filter:none; }
}
.toss-pet.finale svg{ animation: tossloop 1.3s cubic-bezier(.45,.2,.55,.8); }
@keyframes tossloop{
  0%{ transform: rotate(0) translateY(0); }
  50%{ transform: rotate(-180deg) translateY(-34px) scale(1.06); }
  100%{ transform: rotate(-360deg) translateY(0); }
}

.toss-launch{
  position:absolute; left:14px; bottom:8px; z-index:9; width:62px; height:62px;
  cursor:grab; touch-action:none;
}
.toss-launch:active{ cursor:grabbing; }
.toss-launch-coin{
  width:56px; height:56px; border-radius:50%;
  display:grid; place-items:center;
  font-family:var(--body); font-weight:900; font-size:.95rem; color:#7a5300;
  background: radial-gradient(circle at 32% 28%, #ffe89b, #f7c437 62%, #d9a41c);
  border:2.5px solid #d9a41c;
  box-shadow: 0 5px 0 rgba(150,110,10,.4), 0 0 18px rgba(255,220,120,.55), inset 0 2px 0 rgba(255,255,255,.6);
  animation: coinwait 2.2s ease-in-out infinite;
}
@keyframes coinwait{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-5px);} }

.toss-proj{
  position:absolute; left:0; top:0; width:42px; height:42px; z-index:8;
  will-change:transform; pointer-events:none;
}
.toss-proj i{
  display:grid; place-items:center; width:100%; height:100%;
  border-radius:50%; font-style:normal;
  font-family:var(--body); font-weight:900; font-size:.78rem; color:#7a5300;
  background: radial-gradient(circle at 32% 28%, #ffe89b, #f7c437 62%, #d9a41c);
  border:2px solid #d9a41c;
  box-shadow:0 3px 8px rgba(60,40,0,.3);
}
.toss-ring{
  position:absolute; left:0; top:0; width:40px; height:14px; z-index:7; pointer-events:none;
  border:2px solid rgba(255,255,255,.9); border-radius:50%;
  animation: tossring .65s ease-out forwards;
}
@keyframes tossring{
  from{ transform: scale(.4); opacity:.95; }
  to{ transform: scale(2.6); opacity:0; }
}
.toss-drop{
  position:absolute; left:0; top:0; width:7px; height:7px; z-index:7; pointer-events:none;
  border-radius:50%; background:#eafcff;
}
.toss-spark{
  position:absolute; left:0; top:0; width:8px; height:8px; z-index:9; pointer-events:none;
  background: radial-gradient(circle at 35% 30%, #fff3b8, #f7c437);
  border-radius:2px; transform:rotate(20deg);
}
.toss-float{
  position:absolute; left:0; top:0; z-index:10; pointer-events:none;
  font-family:var(--body); font-weight:900; font-size:1rem; color:#fff;
  text-shadow:0 2px 8px rgba(0,60,90,.7);
  animation: tossfloat 1.15s ease-out forwards;
}
@keyframes tossfloat{
  from{ opacity:0; margin-top:0; } 20%{ opacity:1; }
  to{ opacity:0; margin-top:-46px; }
}
.toss-burp{
  position:absolute; left:0; top:0; width:22px; height:22px; z-index:9; pointer-events:none;
  border-radius:50%; border:2px solid rgba(235,252,255,.95);
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,.5), rgba(255,255,255,.05));
  animation: tossburp 1.5s ease-out forwards;
}
.toss-burp::after{
  content:"✨"; position:absolute; inset:0; display:grid; place-items:center; font-size:9px;
}
@keyframes tossburp{
  0%{ opacity:0; transform: translateY(0) scale(.5); }
  15%{ opacity:1; }
  100%{ opacity:0; transform: translateY(-90px) scale(1.25); }
}
.toss-combo{
  position:absolute; left:0; right:0; top:8px; z-index:11; text-align:center; pointer-events:none;
  font-family:var(--disp); font-weight:700; font-size:1.3rem; color:#fff;
  text-shadow:0 0 14px rgba(255,220,110,.9), 0 2px 8px rgba(0,60,90,.6);
  opacity:0; transform: scale(.7);
  transition: opacity .18s, transform .18s;
}
.toss-combo.show{ opacity:1; transform: scale(1); }
.toss-combo.soft{ font-size:.95rem; color:#eafcff; text-shadow:0 2px 8px rgba(0,60,90,.6); }
.toss-left{
  position:absolute; left:0; right:0; bottom:4px; z-index:6; text-align:center; pointer-events:none;
  font-family:var(--body); font-weight:900; font-size:.85rem; color:#04506e;
  font-variant-numeric:tabular-nums;
}
.toss-queue{
  display:flex; gap:6px; justify-content:center; align-items:center;
  min-height:34px; margin-bottom:4px; flex-wrap:wrap;
}
.tq-coin{
  width:30px; height:30px; border-radius:50%; display:grid; place-items:center;
  font-family:var(--body); font-weight:900; font-size:.62rem; color:#7a5300;
  background: radial-gradient(circle at 32% 28%, #ffe89b, #f7c437 62%, #d9a41c);
  border:1.5px solid #d9a41c; opacity:.55;
}
.tq-coin.tq-next{ opacity:1; box-shadow:0 0 10px rgba(255,220,120,.7); }
.tq-done{ font-weight:800; font-size:.85rem; color:var(--txt-dim); }
body.mode-little .toss-launch{ width:76px; height:76px; }
body.mode-little .toss-launch-coin{ width:70px; height:70px; font-size:1.1rem; }

/* ── daily starfish ───────────────────────────────────────── */
.daily-star{
  position:absolute; z-index:8; width:46px; height:46px; padding:0; cursor:pointer;
  border:0; background:none; opacity:.55;
  animation: starpeek 3.5s ease-in-out infinite;
}
.daily-star:hover{ opacity:1; }
@keyframes starpeek{
  0%,100%{ transform: rotate(-8deg) scale(1); opacity:.5; }
  50%{ transform: rotate(8deg) scale(1.06); opacity:.8; }
}
.daily-star.found{ animation: starfound .6s ease forwards; }
@keyframes starfound{
  to{ transform: scale(2.2) rotate(180deg); opacity:0; }
}

/* ── little jobs ──────────────────────────────────────────── */
.job-list{ display:flex; flex-direction:column; gap:9px; }
.job-row{
  display:flex; align-items:center; gap:11px;
  background: rgba(255,255,255,.92); border-radius:var(--r-sm); padding:11px 14px;
  box-shadow: 0 4px 14px -6px rgba(3,40,64,.35);
}
.job-row.claimed{ background: rgba(255,246,224,.94); }
.job-tick{ font-size:1.3rem; }
.job-body{ flex:1; min-width:0; display:flex; flex-direction:column; }
.job-name{ font-weight:800; color:var(--ink); font-size:.95rem; }
.job-sub{ font-size:.74rem; font-weight:700; color:var(--txt-dim); }
.job-amt{ font-family:var(--body); font-weight:900; color:#0b8a52; font-variant-numeric:tabular-nums; }
.job-btn{
  border:0; cursor:pointer; font-family:var(--disp); font-weight:600; font-size:.9rem; color:#fff;
  background: var(--btn-add); padding:9px 14px; border-radius:12px;
  box-shadow:0 3px 0 rgba(5,90,50,.35);
}
.job-btn:active{ transform:translateY(2px); box-shadow:0 1px 0 rgba(5,90,50,.35); }

/* ── the living reef ──────────────────────────────────────
   Sprites are moved by reef.js with transform only (the cheap
   kind). Nothing here animates on a timer except decorative
   flourishes, all of which are switched off in simple mode.
   ═══════════════════════════════════════════════════════════ */
.reef-wrap{ position:relative; }
.reef-scene{
  position:relative; width:100%; height:250px; overflow:hidden;
  border-radius:var(--r-md);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(150,235,255,.28), transparent 60%),
    linear-gradient(180deg, rgba(12,110,165,.45), rgba(3,45,85,.62));
  border:1px solid rgba(255,255,255,.22);
  /* touch-action none: without it iOS claims every touch for page
     scrolling and cancels our taps, holds and drags. The reef is a
     toy, not a scroll surface — scroll from outside it. */
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
}
.reef-sand{
  position:absolute; left:-2%; right:-2%; bottom:0; height:44px; z-index:1;
  background: linear-gradient(180deg,#ffe9b8,#e6c081);
  border-radius:50% 50% 0 0 / 26px 26px 0 0;
  box-shadow: inset 0 6px 12px -6px rgba(255,255,255,.7);
}
/* moving light on the water */
.rf-dapple{
  position:absolute; inset:0; z-index:2; pointer-events:none; opacity:.3;
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(200,250,255,.5), transparent 70%),
    radial-gradient(50% 35% at 70% 5%, rgba(190,245,255,.45), transparent 70%);
  animation: rfdapple 9s ease-in-out infinite alternate;
}
@keyframes rfdapple{
  from{ transform: translateX(-6%) scaleY(1); opacity:.22; }
  to  { transform: translateX(6%) scaleY(1.12); opacity:.38; }
}

/* sunbeams from the surface — the thing that makes the guide video
   feel like water rather than a blue rectangle */
.rf-rays{ position:absolute; inset:-10% -20%; z-index:2; pointer-events:none; overflow:hidden; }
.rf-rays i{
  position:absolute; top:-20%; height:150%; width:16%;
  background: linear-gradient(180deg, rgba(190,245,255,.6), transparent 72%);
  filter: blur(9px); opacity:.3; transform: rotate(12deg);
  animation: rfray 4.5s ease-in-out infinite alternate;
}
.rf-rays i:nth-child(1){ left:12%; }
.rf-rays i:nth-child(2){ left:44%; width:10%; animation-duration:8s; opacity:.12; }
.rf-rays i:nth-child(3){ left:72%; width:19%; animation-duration:14s; opacity:.13; }
@keyframes rfray{
  from{ transform: rotate(9deg) translateX(-3%); }
  to  { transform: rotate(15deg) translateX(4%); }
}
/* far-off fish: scenery, so the water is never empty */
.rf-drifter{
  position:absolute; left:0; top:0; z-index:2; height:7px;
  border-radius:50% 15% 15% 50%;
  background:#dff6ff; pointer-events:none; will-change:transform;
}
.rf-drifter::after{
  content:""; position:absolute; right:-4px; top:1px;
  border-left:5px solid #dff6ff;
  border-top:3px solid transparent; border-bottom:3px solid transparent;
}

.rf-sprite{
  position:absolute; left:0; top:0; z-index:6;
  will-change: transform; cursor:pointer;
  transition: none;
}
/* Creature art carries a ground shadow for the wish tank, where the pet
   really is sitting on a surface. In the reef a swimmer is mid-water, so
   the shadow would just follow it around like a stain — drop it for
   anything that isn't walking on the sand. */
.rf-sprite.rf-swim .cr-shadow{ display:none; }
.rf-sprite .rf-inner{ width:100%; height:100%; transition: transform .18s ease-out; }
/* depth scales about the feet, so a creature swimming closer grows
   towards the viewer instead of sliding off the sand */
.rf-sprite, .rf-decor{ transform-origin: 50% 100%; }
/* standalone creature artwork, drawn as an <img> — contain, because the
   supplied files are portrait and must not be stretched to a square */
svg.rf-art-img{ width:100%; height:100%; display:block; overflow:visible; }
.rf-sprite .rf-art-img, .shop-art .rf-art-img{
  width:100%; height:100%; display:block;
  object-fit: contain; object-position: center bottom;
  -webkit-user-drag: none; user-select: none;
}
.rf-sprite .rf-art-img{ filter: drop-shadow(0 4px 6px rgba(2,30,60,.35)); }

/* Idle life for the drawn creatures. Their fins and tentacles are inside
   an <img>, so no part of them can be animated individually — instead
   each species gets its own whole-body rhythm, which at sprite size
   reads as the creature breathing and finning rather than sliding
   about. Transform-only, so it composites on the GPU and costs nothing
   the engine's own motion doesn't already. */
/* ── making a flat picture look alive ──────────────────────
   The bought-in artwork is a single flat image — measured: five of seven
   files are ONE group containing the whole body, the rest split into
   shading layers, not limbs. So there is no tail or fin to rotate, and
   part-level animation is not available without redrawing the creatures.

   What does work is bending the whole body. A skew whose origin sits at
   the HEAD leaves the head still and swings the far end, which at sprite
   size reads as a tail sweeping — the same trick 2D animators use with a
   bend deformer. `--bend` is the angle; the head end is set per sprite
   from the `faces` flag, since a creature drawn facing left has its head
   on the left. Layered on top: a slow breathing scale, and the tilt the
   engine already applies. All transform-only, so it composites on the
   GPU and costs nothing extra. */
.rf-art-img{ transform-origin: 50% 85%; }
.rf-drawn-left  .rf-art-img{ transform-origin: 12% 55%; }   /* head at the left  */
.rf-drawn-right .rf-art-img{ transform-origin: 88% 55%; }   /* head at the right */
.rf-ground .rf-art-img{ transform-origin: 50% 92%; }        /* pivot on the sand */

@keyframes cr-swim{          /* body flexes, tail end swings */
  0%,100%{ transform: skewY(calc(var(--bend) * -1)) scaleX(1); }
  50%    { transform: skewY(var(--bend)) scaleX(.985); }
}
@keyframes cr-swim-big{      /* the slow heavy ones: bend plus a roll */
  0%,100%{ transform: skewY(calc(var(--bend) * -1)) rotate(-1.2deg); }
  50%    { transform: skewY(var(--bend)) rotate(1.2deg); }
}
@keyframes cr-scuttle{       /* legs can't move, so the shell bustles */
  0%,100%{ transform: skewX(-2.5deg) translateY(0) rotate(-1.5deg); }
  50%    { transform: skewX(2.5deg) translateY(-4%) rotate(1.5deg); }
}
@keyframes cr-pulse{         /* jet propulsion: squash, then drift */
  0%,100%{ transform: scale(1, 1) translateY(0); }
  35%    { transform: scale(1.07, .89) translateY(2%); }
  70%    { transform: scale(.96, 1.06) translateY(-4%); }
}
@keyframes cr-paddle{        /* heavy, unhurried, flippers implied by the roll */
  0%,100%{ transform: rotate(-3.5deg) skewY(1.5deg) scaleY(1); }
  50%    { transform: rotate(3.5deg) skewY(-1.5deg) scaleY(.97); }
}
@keyframes cr-hover{         /* upright: a curl runs down the tail */
  0%,100%{ transform: skewX(-3deg) translateY(0); }
  50%    { transform: skewX(3deg) translateY(-3%); }
}
@keyframes cr-swish{         /* a long tail sweeping through water */
  0%,100%{ transform: skewY(-2.6deg) rotate(-2.5deg); }
  50%    { transform: skewY(2.6deg) rotate(2.5deg); }
}
@keyframes cr-gape{          /* a long wait, then one slow yawn */
  0%,72%,100%{ transform: scaleY(1) scaleX(1); }
  84%{ transform: scaleY(1.05) scaleX(.98); }
}

/* per species: which rhythm, how hard it bends, how fast.
   Small darting fish flex hard and often; big slow animals barely bend. */
.rf-sprite-clownfish  .rf-art-img{ --bend:5.5deg; animation: cr-swim .85s ease-in-out infinite; }
.rf-sprite-tetra      .rf-art-img{ --bend:6deg;   animation: cr-swim .7s  ease-in-out infinite; }
.rf-sprite-angelfish  .rf-art-img{ --bend:4.5deg; animation: cr-swim 1.1s ease-in-out infinite; }
.rf-sprite-angelfish2 .rf-art-img{ --bend:5deg;   animation: cr-swim 1s   ease-in-out infinite; }
.rf-sprite-lanternfish .rf-art-img{ --bend:4deg;  animation: cr-swim 1.3s ease-in-out infinite; }
.rf-sprite-dolphin    .rf-art-img{ --bend:3.2deg; animation: cr-swim-big 1.6s ease-in-out infinite; }
.rf-sprite-narwhal    .rf-art-img{ --bend:2.6deg; animation: cr-swim-big 2.2s ease-in-out infinite; }
.rf-sprite-whale      .rf-art-img{ --bend:2deg;   animation: cr-swim-big 3.2s ease-in-out infinite; }
.rf-sprite-seal       .rf-art-img{ --bend:3.4deg; animation: cr-swim-big 1.5s ease-in-out infinite; }
.rf-sprite-walrus     .rf-art-img{ --bend:2.2deg; animation: cr-swim-big 2.8s ease-in-out infinite; }
.rf-sprite-mermaid    .rf-art-img,
.rf-sprite-mermaid2   .rf-art-img,
.rf-sprite-merman     .rf-art-img{ animation: cr-swish 2.4s ease-in-out infinite; }
.rf-sprite-turtle     .rf-art-img{ animation: cr-paddle 2.6s ease-in-out infinite; }
.rf-sprite-seahorse   .rf-art-img{ animation: cr-hover 1.9s ease-in-out infinite; }
.rf-sprite-octopus    .rf-art-img,
.rf-sprite-kraken     .rf-art-img{ animation: cr-pulse 1.9s ease-in-out infinite; }
.rf-sprite-jellyfish  .rf-art-img{ animation: cr-pulse 2.3s ease-in-out infinite; }
.rf-sprite-crab       .rf-art-img{ animation: cr-scuttle .8s ease-in-out infinite; }
.rf-sprite-lobster    .rf-art-img{ animation: cr-scuttle 1.1s ease-in-out infinite; }
.rf-sprite-shrimp     .rf-art-img{ animation: cr-scuttle .9s ease-in-out infinite; }
.rf-sprite-oyster     .rf-art-img{ animation: cr-gape 5s ease-in-out infinite; }
/* the starfish is drawn inline, so the rhythm goes on its <svg> */
/* Volcano and alien creatures are drawn inline, so their rhythm goes on
   the <svg> rather than on an .rf-art-img. Deliberately slower than the
   shallow reefs — heat and pressure down here, and nothing native to the
   alien reef should move like a fish. */
.rf-sprite-ventcrab   svg{ animation: cr-scuttle 1.4s ease-in-out infinite; transform-origin:50% 92%; }
.rf-sprite-ventshrimp svg{ animation: cr-scuttle 1.1s ease-in-out infinite; transform-origin:50% 92%; }
.rf-sprite-scalyfoot  svg{ animation: cr-paddle  4.2s ease-in-out infinite; transform-origin:50% 92%; }
.rf-sprite-tubeworm   svg{ animation: cr-hover   3.6s ease-in-out infinite; transform-origin:50% 96%; }
.rf-sprite-lavafish   svg{ animation: cr-swim    1.2s ease-in-out infinite; transform-origin:12% 55%; --bend:5deg; }
.rf-sprite-dumbo      svg{ animation: cr-pulse   2.6s ease-in-out infinite; }
.rf-sprite-octodiver  .rf-art-img{ animation: cr-hover 2.7s ease-in-out infinite; transform-origin:50% 45%; }

.rf-sprite-sporecloud svg{ animation: cr-pulse   3.4s ease-in-out infinite; }
.rf-sprite-driftling  svg{ animation: cr-pulse   3s   ease-in-out infinite; }
.rf-sprite-rubydrift  svg{ animation: cr-hover   3.2s ease-in-out infinite; }
.rf-sprite-glowpod    svg{ animation: cr-hover   2.8s ease-in-out infinite; }
.rf-sprite-lantern2   svg{ animation: cr-pulse   2.9s ease-in-out infinite; }
/* the two supplied artworks: symmetrical and front-on, so they get a
   hover rather than a body bend — a skew would shear a face */
.rf-sprite-alienswimmer .rf-art-img{ animation: cr-hover 2.6s ease-in-out infinite; transform-origin:50% 40%; }
.rf-sprite-spaceship    .rf-art-img{ animation: cr-glide-ufo 4.4s ease-in-out infinite; transform-origin:50% 60%; }
@keyframes cr-glide-ufo{   /* banks gently, the way a saucer should */
  0%,100%{ transform: rotate(-3deg) translateY(0); }
  50%    { transform: rotate(3deg) translateY(-4%); }
}
.rf-sprite-jelly2     svg{ animation: cr-pulse   2.4s ease-in-out infinite; }
.rf-sprite-eel        svg{ animation: cr-swish   1.8s ease-in-out infinite; }

/* the volcano and alien props each get one thing they DO, so the newest
   reefs are not the least alive — the whole point of a landmark is that
   something happens at it */
.rf-decor.d-erupt svg{ animation: d-erupt 1.4s ease-out; }
@keyframes d-erupt{
  0%{ transform: scale(1,1); } 25%{ transform: scale(1.05,.94); }
  60%{ transform: scale(.98,1.05); } 100%{ transform: scale(1,1); }
}
.rf-decor.d-flare svg{ animation: d-flare 1.8s ease-in-out; }
@keyframes d-flare{
  0%,100%{ filter:none; }
  50%{ filter: drop-shadow(0 0 12px rgba(255,140,50,.95)) brightness(1.28) saturate(1.2); }
}
.rf-decor.d-signal svg{ animation: d-signal 2.2s ease-in-out; }
@keyframes d-signal{
  0%,100%{ filter:none; }
  35%{ filter: drop-shadow(0 0 14px rgba(160,110,255,.95)) brightness(1.3); }
  65%{ filter: drop-shadow(0 0 6px rgba(234,255,107,.8)) brightness(1.15); }
}
.rf-decor.d-lift svg{ animation: d-lift 2.6s ease-in-out; }
@keyframes d-lift{
  0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-9%); }
}
body.perf-low .rf-decor.d-erupt svg, body.perf-low .rf-decor.d-flare svg,
body.perf-low .rf-decor.d-signal svg, body.perf-low .rf-decor.d-lift svg{ animation:none; }

/* the black smoker keeps puffing */
.d-smoke{ animation: d-smoke 6s ease-in-out infinite; transform-box: fill-box; transform-origin:50% 100%; }
@keyframes d-smoke{
  0%   { transform: translateY(0) scale(1);      opacity:.9; }
  100% { transform: translateY(-14%) scale(1.25); opacity:.25; }
}
body.perf-low .d-smoke{ animation:none; }

.rf-sprite-starfish svg{ animation: cr-scuttle 2.6s ease-in-out infinite; transform-origin:50% 92%; }
.rf-sprite-narwhal  svg{ animation: cr-swim-big 2.2s ease-in-out infinite; transform-origin:88% 55%; --bend:2.6deg; }
body.perf-low .rf-sprite svg{ animation:none; }

body.perf-low .rf-art-img{ animation:none !important; }
.rf-sprite svg{ width:100%; height:100%; display:block;
  filter: drop-shadow(0 4px 6px rgba(2,30,60,.35)); }
.rf-sprite.rf-duck .rf-inner{ transform: translateY(26%) scaleY(.5) !important; }
.rf-sprite.rf-puff .rf-inner{ transform: scale(1.32) !important; }
/* caught in the bubbler's plume — a happy jiggle, not a violent shake */
.rf-sprite.rf-tickled .rf-inner{ animation: rf-tickle .42s ease-in-out infinite; }
@keyframes rf-tickle{
  0%,100%{ transform: rotate(-4deg) translateY(0); }
  50%{ transform: rotate(4deg) translateY(-2px); }
}
body.perf-low .rf-sprite.rf-tickled .rf-inner{ animation:none; }

.rf-food{
  position:absolute; left:0; top:0; width:9px; height:9px; z-index:34;
  margin:-4px 0 0 -4px; border-radius:50%;
  background: radial-gradient(circle at 34% 30%, #ffd98a, #e0913a);
  box-shadow:0 0 6px rgba(255,200,110,.8);
  will-change: transform;
}
.rf-heart{
  position:absolute; left:0; top:0; z-index:55; pointer-events:none;
  color:#ff8fab; font-size:15px; font-weight:900;
  animation: rfheart 1.3s ease-out forwards;
}
@keyframes rfheart{
  0%{ opacity:0; transform: translateY(0) scale(.5); }
  25%{ opacity:1; }
  100%{ opacity:0; transform: translateY(-42px) scale(1.15); }
}
.rf-tag{
  position:absolute; left:0; top:0; z-index:60; cursor:pointer;
  background: rgba(3,40,70,.88); color:#eafcff;
  font-family:var(--body); font-weight:800; font-size:.74rem;
  padding:4px 9px; border-radius:999px; white-space:nowrap;
  border:1px solid rgba(150,235,255,.4);
  animation: rftag .25s ease-out;
}
.rf-tag-i{ opacity:.75; }
@keyframes rftag{ from{ opacity:0; transform: translateY(4px) scale(.9);} }

.rf-decor{
  position:absolute; z-index:3; cursor:grab;
  touch-action:none; will-change: transform;
  animation: rfsway 7s ease-in-out infinite;
}
/* Stone does not sway. Structural props opt out of the drift that suits
   kelp and soft things. This also matters mechanically: the sway
   keyframes animate `transform`, which overrides the inline depth scale
   set on the element — so depth scaling is applied to the inner <svg>
   instead, where the two compose instead of fighting. */
.rf-decor.rf-rigid{ animation: none; }
.rf-decor svg{ width:100%; height:100%; display:block; overflow: visible;
  transform-origin: 50% 100%; }

/* ── decorations that live ────────────────────────────────
   Anything that would move in a current does, each on its own
   timing so the reef never pulses in unison. Transform-only.   */
.d-frond{ transform-origin: 50% 100%; animation: d-sway 4.2s ease-in-out infinite; }
.d-frond.d-f1{ animation-duration: 5.1s; }
.d-frond.d-f2{ animation-duration: 3.8s; animation-delay: -1.4s; }
.d-frond.d-f3{ animation-duration: 6.2s; animation-delay: -2.7s; }
@keyframes d-sway{
  0%,100%{ transform: rotate(-5deg) skewX(2deg); }
  50%{ transform: rotate(5deg) skewX(-2deg); }
}
.d-tent{ transform-origin: 50% 62%; animation: d-tent 2.6s ease-in-out infinite; }
.d-tent.d-t1{ animation-duration: 3.3s; animation-delay: -.8s; }
.d-tent.d-t2{ animation-duration: 2.1s; animation-delay: -1.5s; }
@keyframes d-tent{
  0%,100%{ transform: rotate(-8deg) scaleY(1); }
  50%{ transform: rotate(8deg) scaleY(1.1); }
}
.d-flag{ transform-origin: 50% 100%; animation: d-sway 2.4s ease-in-out infinite; }

/* the shell yawns open now and then, showing a pearl */
.d-lid-shell{ transform-origin: 50% 96%; transition: transform .9s cubic-bezier(.35,1.3,.4,1); }
.rf-decor.d-open .d-lid-shell{ transform: rotate(-17deg) translateX(-3%); }
.d-pearl{ transition: r .7s ease .25s; }
.rf-decor.d-open .d-pearl{ r: 7; }
/* the chest creaks its lid up on its hinge */
.d-lid-chest{ transform-origin: 50% 62%; transition: transform 1s cubic-bezier(.35,1.25,.4,1); }
.rf-decor.d-open .d-lid-chest{ transform: rotate(-40deg) translate(-5%,-4%); }
.d-loot{ opacity:0; transition: opacity .5s ease .35s; }
.rf-decor.d-open .d-loot{ opacity:1; }
/* the wreck slowly rolls onto its other side */
/* Reef Master: the archway keeps a permanent golden shimmer once every
   treasure in every reef has been collected. Deliberately a slow breath
   rather than a hard glow — it should read as an heirloom, not an alert. */
.rf-decor-arch.rf-master svg{ animation: d-master 5.5s ease-in-out infinite; }
@keyframes d-master{
  0%,100%{ filter: drop-shadow(0 0 5px rgba(255,206,110,.55)) saturate(1.06); }
  50%{ filter: drop-shadow(0 0 13px rgba(255,214,120,.9)) saturate(1.16) brightness(1.08); }
}
/* a deliberate light still beats the heirloom shimmer */
.rf-decor.rf-master.d-lit svg{ animation: d-archlit 2.4s ease-in-out; }
body.perf-low .rf-decor-arch.rf-master svg{
  animation:none; filter: drop-shadow(0 0 6px rgba(255,206,110,.7));
}

/* The arch lighting up. The filter goes on the <svg>, not the element:
   the element carries the inline depth haze, and the <svg> carries the
   inline depth scale — animating `filter` on the child leaves both
   alone. The coral clinging to the stone brightens with it. */
.rf-decor-arch svg{ transition: filter .5s ease; }
.rf-decor.d-lit svg{ animation: d-archlit 2.4s ease-in-out; }
@keyframes d-archlit{
  0%,100%{ filter: none; }
  18%{ filter: drop-shadow(0 0 14px rgba(150,240,255,.95)) brightness(1.28) saturate(1.2); }
  55%{ filter: drop-shadow(0 0 22px rgba(150,240,255,.8)) brightness(1.34) saturate(1.25); }
}
body.perf-low .rf-decor.d-lit svg{ animation:none; }
body.perf-low .rf-decor.d-lit{ filter: brightness(1.3) !important; }

/* ── the wreck's treasures ────────────────────────────────
   Deep props are not ornaments: the bell tolls, the cannon recoils,
   the lantern burns and the anchor settles into the sand. */
/* Each behaviour animates the inner art group, never the decoration
   element or its <svg>: the element owns the ambient sway and the <svg>
   owns the depth scale, so animating either would wipe one of them out.
   `transform-box: fill-box` makes percentage origins work inside SVG. */
.d-bell, .d-cannon, .d-anchor, .d-flame{ transform-box: fill-box; }
.d-bell{ transform-origin: 50% 14%; }
.rf-decor.d-ring .d-bell{ animation: d-toll 1.4s cubic-bezier(.36,.07,.3,1); }
@keyframes d-toll{
  0%{ transform: rotate(0deg); }
  12%{ transform: rotate(11deg); }  32%{ transform: rotate(-8deg); }
  52%{ transform: rotate(5deg); }   72%{ transform: rotate(-3deg); }
  100%{ transform: rotate(0deg); }
}
/* the cannon kicks back, then creeps forward again */
.rf-decor.d-fire .d-cannon{ animation: d-recoil .9s cubic-bezier(.2,.9,.3,1); }
@keyframes d-recoil{
  0%{ transform: translateX(0); }
  14%{ transform: translateX(-7%); }
  100%{ transform: translateX(0); }
}
/* the lantern never stops burning */
.d-flame{ transform-origin: 50% 50%; animation: d-burn 2.6s ease-in-out infinite; }
.d-lantern{ filter: drop-shadow(0 0 7px rgba(255,190,90,.75)); }
@keyframes d-burn{
  0%,100%{ opacity:.75; transform: scale(.9); }
  50%{ opacity:1; transform: scale(1.12); }
}
/* the anchor works itself a little deeper into the seabed */
.d-anchor{ transform-origin: 50% 85%; }
.rf-decor.d-settle .d-anchor{ animation: d-settle 1.4s ease-in-out; }
@keyframes d-settle{
  0%,100%{ transform: translateY(0) rotate(0deg); }
  35%{ transform: translateY(3%) rotate(-2.5deg); }
  70%{ transform: translateY(1.5%) rotate(1.5deg); }
}
body.perf-low .d-flame{ animation:none; }
body.perf-low .d-lantern{ filter:none; }

.d-hull{ transform-origin: 50% 90%; transition: transform 2.6s cubic-bezier(.5,.05,.4,1); }
.rf-decor.d-rolled .d-hull{ transform: rotate(8deg) scaleX(-1); }
.d-nozzle{ transition: r .2s; }
.rf-decor.d-pumping .d-nozzle{ r: 8; }

/* the vortex the crystal spins up */
.rf-vortex{
  position:absolute; z-index:6; width:10px; height:10px; margin:-5px 0 0 -5px;
  pointer-events:none; border-radius:50%;
  background: radial-gradient(circle, rgba(225,250,255,.95), rgba(160,235,255,0));
}
.rf-decor.rf-dragging{ cursor:grabbing; animation:none;
  filter: brightness(1.18) saturate(1.05) !important; opacity:1 !important; }
@keyframes rfsway{ 0%,100%{ transform:rotate(-1.6deg);} 50%{ transform:rotate(1.6deg);} }
.rf-decor.rf-glow svg{ filter: drop-shadow(0 0 10px rgba(140,240,255,.85)); animation: rfglow 3.4s ease-in-out infinite; }
@keyframes rfglow{ 0%,100%{ opacity:.85; } 50%{ opacity:1; } }

.rf-bub{
  position:absolute; left:0; top:0; width:8px; height:8px; z-index:4;
  border-radius:50%; border:1.5px solid rgba(225,250,255,.9);
  animation: rfbub 2.5s linear forwards; pointer-events:none;
}
@keyframes rfbub{
  from{ opacity:.9; }
  to{ opacity:0; margin-top:-150px; margin-left:6px; }
}
.rf-schoolfish{
  position:absolute; left:0; top:0; z-index:2; width:11px; height:6px;
  border-radius:50% 20% 20% 50%; background: rgba(190,240,255,.5);
  pointer-events:none;
}
.rf-bigshadow{
  position:absolute; left:0; top:0; z-index:1; width:210px; opacity:.13;
  filter: blur(2px) brightness(0); pointer-events:none;
}
.rf-bigshadow svg{ width:100%; height:auto; display:block; }
.rf-coin{
  position:absolute; left:0; top:0; z-index:50; width:34px; height:34px;
  margin:-17px 0 0 -17px; border-radius:50%; cursor:pointer;
  display:grid; place-items:center; font-size:15px;
  background: radial-gradient(circle at 32% 28%, #fff3b8, #f7c437 62%, #cf9718);
  border:2px solid #d9a41c; box-shadow:0 0 14px rgba(255,210,90,.7);
}
.rf-coin-got{ transition: transform .4s, opacity .4s; transform: scale(2); opacity:0; }
.rf-plus{
  position:absolute; left:0; top:0; z-index:13; pointer-events:none;
  font-family:var(--body); font-weight:900; font-size:.9rem; color:#ffe9b8;
  text-shadow:0 2px 6px rgba(0,20,40,.7);
  animation: rfheart 1.2s ease-out forwards;
}

.reef-shop-btn{
  position:absolute; right:10px; top:10px; z-index:15; cursor:pointer;
  border:1px solid rgba(255,255,255,.35); border-radius:999px;
  background: rgba(4,40,70,.68); color:#eafcff;
  font-family:var(--body); font-weight:800; font-size:.8rem; padding:7px 13px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
body.perf-low .reef-shop-btn{
  backdrop-filter:none; -webkit-backdrop-filter:none; background: rgba(4,40,70,.85);
}


/* simple mode: keep the sim, drop the decoration */
body.perf-low .rf-dapple,
body.perf-low .rf-rays,
body.perf-low .rf-decor{ animation:none; }
body.perf-low .rf-rays{ display:none; }
body.perf-low .rf-sprite svg{ filter:none; }

.shop-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media(min-width:520px){ .shop-grid{ grid-template-columns:repeat(3,1fr); } }
.shop-item{
  cursor:pointer; border:2px solid rgba(30,120,170,.2); border-radius:var(--r-sm);
  background:#fff; padding:10px 6px 8px; display:flex; flex-direction:column; align-items:center; gap:2px;
  transition: transform .12s, border-color .15s;
}
.shop-item:active{ transform:scale(.95); }
.shop-art{ width:56px; height:56px; }
.shop-art svg{ width:100%; height:100%; }
.shop-name{ font-weight:800; font-size:.82rem; color:var(--ink); }
.shop-cost{ font-weight:900; font-size:.78rem; color:#0b6a94; }
/* how far a decoration has been upgraded */
.shop-tier{ font-size:.7rem; letter-spacing:.16em; color:#0b6a94; opacity:.8; }
.shop-blurb{ font-size:.68rem; font-weight:700; color:var(--txt-dim); line-height:1.25; }
.shop-item.treat{ background:linear-gradient(160deg,#fff8e6,#ffeccf); border-color:#f0c98a; }
.treat-ico{ font-size:2.1rem; line-height:1; display:grid; place-items:center; height:56px; }

/* ── reef backdrops ───────────────────────────────────────── */
/* The painted reef, beneath everything. `cover` keeps it filling the
   scene at any width; the art is composed with its interest at the
   edges so cropping the middle costs nothing. */
.rf-art{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background-size: cover; background-position: center bottom;
}
/* the fullscreen reef's living painting — same box, same cropping */
video.rf-art-video{
  width:100%; height:100%; object-fit: cover; object-position: center bottom;
}
/* Depth wash: the reef used to deepen in colour as the child levelled
   up, which a photograph can't do by itself. A tinted veil over the
   painting restores it, driven by the same palette variables. */
.rf-wash{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--sea-hi) 22%, transparent),
    color-mix(in srgb, var(--sea-deep) 30%, transparent));
  mix-blend-mode: multiply; opacity:.34;
}
body[data-depth="1"] .rf-wash, body[data-depth="2"] .rf-wash{ opacity:.14; }
body[data-depth="5"] .rf-wash{ opacity:.42; }
body[data-depth="6"] .rf-wash{ opacity:.5; }
/* the cave and wreck are already dark paintings — don't drown them */
.reef-scene-b .rf-wash, .reef-scene-c .rf-wash{ opacity:.18 !important; }
body.perf-low .rf-wash{ mix-blend-mode: normal; opacity:.22; }

.rf-backdrop{
  position:absolute; inset:0; z-index:0; pointer-events:none;
}
.rf-backdrop{ z-index:1; }
/* The moving light sits over a PAINTING now, not a flat vector wash, and
   the painting already has its own highlights baked in. At the opacities
   tuned for the old backdrop the animation was running but invisible.
   Blending the bright layers as `screen` makes them genuinely brighten
   the artwork as they pass, and the dark caustic `multiply` deepens it —
   which is what reads as moving water rather than a sliding decal. */
.rf-backdrop .rf-drift-fast{ mix-blend-mode: screen; }
.rf-backdrop .rf-drift-slow{ mix-blend-mode: multiply; }
.rf-backdrop .rf-ray{ mix-blend-mode: screen; }
.rf-rays{ mix-blend-mode: screen; }
/* blending is GPU work — the tier that already gave up on WebGL skips it */
body.perf-low .rf-backdrop .rf-drift-fast,
body.perf-low .rf-backdrop .rf-drift-slow,
body.perf-low .rf-backdrop .rf-ray,
body.perf-low .rf-rays{ mix-blend-mode: normal; }
.rf-backdrop svg{ width:100%; height:100%; display:block; }
/* the painted dunes replace the plain sand strip */
.rf-has-backdrop .reef-sand{ display:none; }
/* the painted water owns the colour now — no double-darkening */
.reef-scene.rf-has-backdrop{ background: none; }
/* haze on the far layer sells the distance */

/* Swaying light shafts. These were tuned against a flat vector backdrop
   and were far too timid for a painted one: 9s for one small swing, and
   the caustics taking the best part of a minute to cross, read as a
   still image. Roughly 3x faster and roughly double the travel, which is
   what makes a reef look like it has water moving through it. */
.rf-ray{
  transform-box: fill-box; transform-origin: 50% 0;
  animation: rf-raysway 3.4s ease-in-out infinite alternate;
}
.rf-ray-1{ animation-duration: 4.6s; animation-delay: -1.8s; }
.rf-ray-2{ animation-duration: 5.8s; animation-delay: -3.1s; }
@keyframes rf-raysway{
  from{ transform: rotate(-5.5deg) translateX(-16px); opacity:.5; }
  to{ transform: rotate(5.5deg) translateX(16px); opacity:1; }
}

/* caustic patches drifting over the seabed — light one way, shadow the
   other, so the sand shimmers. The rows are drawn twice, so a 400-unit
   translate wraps seamlessly. */
.rf-drift-slow{ animation: rf-driftL 15s linear infinite; }
.rf-drift-fast{ animation: rf-driftR 9.5s linear infinite; }
@keyframes rf-driftL{ from{ transform: translateX(-400px); } to{ transform: translateX(0); } }
@keyframes rf-driftR{ from{ transform: translateX(0); } to{ transform: translateX(-400px); } }

body.perf-low .rf-ray,
body.perf-low .rf-drift-slow,
body.perf-low .rf-drift-fast{ animation: none; }

body.perf-low .rf-backdrop .d-frond{ animation: none; }

/* ── the wreck reef ───────────────────────────────────────── */
/* every reef after the first sits below the one before it */
.reef-wrap-b, .reef-wrap-c{ margin-top:14px; }
.reef-label-b{
  display:flex; align-items:center; gap:7px; width:100%;
  /* it became a <button> when it gained the fold control, so the browser's
     default grey background and border have to be cleared explicitly */
  background: transparent; border:0; padding:4px 2px; cursor:pointer; text-align:left;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  font-family:var(--disp); font-weight:600; font-size:.9rem; color:#eafcff;
  margin-bottom:5px; opacity:.9;
}
/* folded, it is the only thing standing in for the reef, so it earns a
   little more presence than a bare label */
.reef-shut .reef-label-b{
  background: linear-gradient(180deg, rgba(12,58,92,.55), rgba(6,34,60,.55));
  border:1px solid rgba(140,230,255,.18);
  border-radius: var(--r-sm); padding:9px 12px; margin-bottom:8px; opacity:1;
}
.reef-scene-b{
  background: linear-gradient(180deg, rgba(6,44,74,.6), rgba(2,22,44,.75));
}
/* the cave looks OUT to bright water, so its base tone is lighter than
   the wreck's even though its frame is the darkest of the three */
.reef-scene-c{
  background: linear-gradient(180deg, rgba(22,74,104,.55), rgba(6,32,52,.72));
}
/* the volcano is lit from below by its own lava, so its base tone is
   warm where every other reef is cold */
.reef-scene-d{
  background: linear-gradient(180deg, rgba(14,20,34,.72), rgba(40,18,10,.7));
}
/* and the alien reef is the only violet one */
.reef-scene-e{
  background: linear-gradient(180deg, rgba(38,26,86,.6), rgba(18,10,44,.75));
}
/* the depth wash is a blue veil — over a warm or violet painting it goes
   muddy, so both of the new reefs keep it as light as the dark ones */
.reef-scene-d .rf-wash, .reef-scene-e .rf-wash{ opacity:.14 !important; }

/* folded away: the scene collapses, the label stays as the way back */
.reef-caret{ display:inline-block; transition: transform .22s ease; font-size:.8em; opacity:.75; }
.reef-shut .reef-caret{ transform: rotate(-90deg); }
.reef-shut .reef-scene{ display:none; }
.reef-shut-note{ margin-left:auto; font-size:.72rem; font-weight:700; opacity:.6; }
.reef-label-b:active{ transform: translateY(1px); }
@media (prefers-reduced-motion: reduce){ .reef-caret{ transition:none; } }

.reef-hint{
  margin-top:8px; text-align:center;
  font-size:.78rem; font-weight:700; color:#bfe6f7; opacity:.8;
}
/* something lifted out and being carried between reefs */
.rf-carry{
  position:fixed; z-index:70; pointer-events:none; left:0; top:0;
  filter: drop-shadow(0 10px 16px rgba(0,20,40,.55));
  animation: rf-lift .22s ease-out;
}
.rf-carry svg{ width:100%; height:100%; }
@keyframes rf-lift{ from{ transform: scale(.7); opacity:.4; } }
.reef-scene.rf-droptarget{
  outline:3px dashed rgba(160,240,255,.85); outline-offset:-4px;
  background-image: linear-gradient(rgba(140,230,255,.14), rgba(140,230,255,.14));
}

.unlock-near{ color:#ffd94d; }
.reef-empty-note{ color:#9fe3ff; }

/* the wreck hunt, surfaced on the store button itself */
.store-hunt{
  display:inline-block; margin-left:7px; padding:2px 7px;
  border-radius:999px; background:rgba(255,217,77,.22);
  border:1px solid rgba(255,217,77,.5); color:#ffe9b8;
  font-size:.72rem; font-weight:900; white-space:nowrap;
}

/* buy-everything encouragement */
.unlock-box{
  display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap;
  position:relative; overflow:hidden;
  background:linear-gradient(150deg,#0b3f68,#0a2c50); color:#eafcff;
  border:1.5px solid rgba(140,230,255,.35); border-radius:var(--r-sm);
  padding:13px; margin:6px 0 4px;
}
.unlock-box.ready{
  border-color:#ffd94d; box-shadow:0 0 0 3px rgba(255,217,77,.25);
  animation: unlock-ready 1.8s ease-in-out infinite;
}
@keyframes unlock-ready{
  0%,100%{ box-shadow:0 0 0 3px rgba(255,217,77,.25); }
  50%{ box-shadow:0 0 0 7px rgba(255,217,77,.12); }
}
body.perf-low .unlock-box.ready{ animation:none; }
.unlock-box.done{ background:linear-gradient(150deg,#0a3350,#07223b); }
.unlock-art{ font-size:2.6rem; line-height:1; }

/* The reefs still to come, as greyed-out pictures of the real places.
   Greyscale plus a dimmed brightness reads as "not yours yet" without
   hiding what it is — the child should be able to make out a shipwreck
   and a cave mouth, because that is the whole point of showing them.

   The strip spans the FULL width of the panel with the words underneath.
   Beside the text it was `flex:none` against a `flex:1` column, so four
   locked reefs left the paragraph a narrow tower — and the pictures had
   to stay tiny to fit at all, which defeats the point of showing them. */
.lock-strip{
  display:flex; gap:10px; width:100%;
  align-items:flex-start; justify-content:center; flex-wrap:wrap;
}
.lock-thumb{
  position:relative; margin:0;
  flex:1 1 96px; max-width:150px;   /* grow to fill, but never balloon when only one is left */
}
/* the picture and the "?" card share one shape, so a mixed row lines up */
.lock-thumb img,
.lock-q{
  display:block; width:100%; aspect-ratio: 1200 / 669;
  border-radius:12px; border:1.5px solid rgba(150,200,230,.25);
}
.lock-thumb img{
  object-fit:cover;
  filter: grayscale(1) brightness(.68) contrast(1.15);
}
.lock-q{
  display:grid; place-items:center;
  font-family:var(--disp); font-weight:700; font-size:2rem;
  color:#9fc6de; text-shadow:0 2px 8px rgba(0,0,0,.6);
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(120,175,215,.22), transparent 70%),
    linear-gradient(180deg,#0a2036,#04101d);
}
.lock-pin{
  position:absolute; left:0; right:0; top:0;
  aspect-ratio: 1200 / 669;         /* centre in the picture, not the whole card */
  display:grid; place-items:center;
  font-size:1.5rem; filter: drop-shadow(0 1px 4px rgba(0,0,0,.75));
}
/* the name sits BELOW its picture as plain text — as a bar across the
   bottom it read as part of the artwork rather than a label for it */
.lock-thumb figcaption{
  font-size:.68rem; font-weight:800; text-align:center;
  padding:5px 2px 0; color:#bcd9e8; letter-spacing:.02em;
  line-height:1.25;
}
.unlock-body{ flex:1; min-width:150px; }
/* only the locked-reef panel stacks; the "unlocked" state keeps its big
   emoji beside the words. An adjacent sibling rather than `:has()`,
   which the target iPad mini 4 (Safari 15) doesn't support. */
.lock-strip + .unlock-body{ flex:1 1 100%; }
.unlock-body b{ font-family:var(--disp); font-weight:600; font-size:1rem; }
.unlock-body p{ font-size:.82rem; font-weight:700; opacity:.85; line-height:1.45; margin:3px 0 7px; }
.unlock-track{ height:8px; border-radius:999px; background:rgba(0,20,40,.5); overflow:hidden; }
.unlock-track i{
  display:block; height:100%; border-radius:999px;
  background:linear-gradient(90deg,#57e6a8,#ffd94d);
  transition:width .8s cubic-bezier(.22,1.2,.36,1);
}
.unlock-count{ font-size:.72rem; font-weight:800; opacity:.75; }
.unlock-box .sheet-cta{ margin-top:0; }

/* a permanent-sale flag on a treat */
.shop-flag{
  position:absolute; top:-8px; left:50%; transform:translateX(-50%);
  background:#ff7e67; color:#fff; font-size:.6rem; font-weight:900;
  letter-spacing:.04em; text-transform:uppercase;
  padding:2px 8px; border-radius:999px; white-space:nowrap;
  box-shadow:0 2px 6px rgba(150,40,20,.35);
}
.shop-item{ position:relative; }
.shop-cost s{ opacity:.5; font-weight:700; }
.reef-comfy{ color:#ffc2e0; font-weight:800; }

/* the reef's energy — hungry friends swim very slowly */
.energy-box{
  background:#eafbf1; border:1.5px solid #9fe0bd; border-radius:var(--r-sm);
  padding:11px 13px; margin:4px 0 6px;
}
.energy-box.low{ background:#fff2e6; border-color:#ffbe8a; }
.energy-row{
  display:flex; justify-content:space-between; align-items:center;
  font-weight:800; font-size:.92rem; color:var(--ink);
}
.energy-track{
  height:9px; border-radius:999px; background:rgba(6,60,90,.14);
  overflow:hidden; margin-top:7px;
}
.energy-track i{
  display:block; height:100%; border-radius:999px;
  background:linear-gradient(90deg,#57e6a8,#31bef0);
  transition:width .6s cubic-bezier(.22,1.2,.36,1);
}
.energy-box.low .energy-track i{ background:linear-gradient(90deg,#ffb25e,#ff7e67); }
.reef-hungry{ color:#ffd08a; font-weight:800; }

/* the glow-show treat */
.rf-glowshow{ animation: rf-glowshow 5.2s ease-in-out; }
@keyframes rf-glowshow{
  0%,100%{ filter:none; }
  25%{ filter: brightness(1.25) saturate(1.5) hue-rotate(-12deg); }
  50%{ filter: brightness(1.15) saturate(1.7) hue-rotate(18deg); }
  75%{ filter: brightness(1.3) saturate(1.4) hue-rotate(-6deg); }
}
body.perf-low .rf-glowshow{ animation:none; }

.shop-item.owned{ background:#eafbf1; border-color:#7fd6a6; }
.shop-item.owned .shop-cost{ color:#0b8a52; }
.shop-item.locked{ opacity:.55; }
.card-creature{ width:min(46vw,170px); margin:6px auto 10px; }
.fact-box{ background:#eaf7ff; border-radius:var(--r-sm); padding:12px 14px; }
.fact-box p{ font-weight:700; color:var(--txt); line-height:1.55; font-size:.95rem; }

/* simple mode: hold the drifting still */
body.perf-low .daily-star{ animation: none; }

/* ── reef shelf ───────────────────────────────────────────── */
/* holds the reef scene — a plain block, because everything inside the
   scene is absolutely positioned and would collapse a flex parent */
.reef-shelf{ display:block; }
.reef-shelf::-webkit-scrollbar{ display:none; }

/* ── accounts ─────────────────────────────────────────────── */
.acc-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acc-card{
  position:relative; overflow:hidden; cursor:pointer;
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  border: 1.5px solid rgba(255,255,255,.3);
  box-shadow: var(--shadow);
  color:#fff; text-align:left; font-family:var(--body);
  transition: transform .15s;
  min-height: 108px;
  display:flex; flex-direction:column; justify-content:space-between; gap:6px;
}
.acc-card:active{ transform: scale(.97); }
.acc-card.bank{ background: linear-gradient(150deg,#2b74d8,#123f96); }
.acc-card.grow{ background: linear-gradient(150deg,#12ad78,#04704f); }
.acc-card .acc-kind{ font-size:.72rem; font-weight:900; letter-spacing:.08em; text-transform:uppercase; opacity:.75; display:flex; align-items:center; gap:5px; }
.acc-card .acc-name{ font-family:var(--disp); font-weight:600; font-size:1rem; line-height:1.2; }
.acc-card .acc-bal{ font-family:var(--disp); font-weight:700; font-size:1.4rem; font-variant-numeric: tabular-nums; }
.acc-card .acc-wave{ position:absolute; right:-14px; bottom:-16px; font-size:3.4rem; opacity:.14; transform:rotate(-8deg); }
.acc-empty{
  grid-column: 1/-1; text-align:center; color:#cfeeff; font-weight:700; font-size:.9rem;
  background: rgba(255,255,255,.08); border-radius: var(--r-md); padding: 16px;
  border: 1.5px dashed rgba(255,255,255,.3);
}

/* ── badges ───────────────────────────────────────────────── */
.badge-card{
  display:block; width:100%; text-align:left; cursor:pointer;
  font: inherit; color:#dff6ff; border:1px solid rgba(140,230,255,.28);
  -webkit-user-select:none; user-select:none;   /* a tap opens it, it doesn't select the words */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.badge-card:active{ transform: translateY(2px); }
/* the finished set gets the same gold the archway keeps */
.badge-card-done{
  border-color: rgba(255,214,120,.55);
  box-shadow: var(--shadow), inset 0 0 26px rgba(255,206,110,.16);
}
.badge-card-done .quest-emoji{ animation: badge-trophy 4.5s ease-in-out infinite; }
@keyframes badge-trophy{
  0%,100%{ transform: scale(1) rotate(-3deg); }
  50%{ transform: scale(1.1) rotate(3deg); }
}
body.perf-low .badge-card-done .quest-emoji{ animation:none; }
.badge-card .quest-head{ gap:12px; }
.badge-more{ margin-left:auto; font-size:1.5rem; opacity:.5; line-height:1; }

/* the full set, inside the sheet */
.badge-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.badge-item{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius: var(--r-sm);
  background:#fff; border:1.5px solid rgba(30,120,170,.18);
}
.badge-item.locked{ background:rgba(210,232,242,.5); }
.bi-ico{ font-size:1.5rem; width:30px; text-align:center; flex:none; }
.badge-item.locked .bi-ico{ filter: grayscale(1); opacity:.45; }
.bi-ico .ico-img{ width:26px; height:26px; vertical-align:middle; }
.bi-txt{ flex:1; min-width:0; }
.bi-name{ font-weight:800; font-size:.94rem; color:var(--ink); }
.badge-item.locked .bi-name{ color:var(--txt-dim); }
.bi-how{ font-size:.78rem; font-weight:700; color:var(--txt-dim); line-height:1.35; margin-top:1px; }
.bi-mark{ font-size:1rem; flex:none; opacity:.6; }
.badge-item.got .bi-mark{ color:#1a9c62; opacity:1; font-weight:900; }

.hist-list{ list-style:none; display:flex; flex-direction:column; gap:8px; }
.hist-item{
  display:flex; align-items:center; gap:12px;
  background: rgba(255,255,255,.9);
  border-radius: var(--r-sm); padding: 10px 14px;
  box-shadow: 0 4px 14px -6px rgba(3,40,64,.35);
}
.hist-ico{
  width:38px; height:38px; flex:0 0 38px; border-radius:12px; display:grid; place-items:center;
  font-size:1.15rem; background:#e8f6ff;
}
.hist-item.k-add  .hist-ico{ background:#dcf7e8; }
.hist-item.k-spend .hist-ico{ background:#ffe9df; }
.hist-item.k-fund .hist-ico{ background:#eee6ff; }
.hist-item.k-move .hist-ico{ background:#e2f0ff; }
.hist-item.k-win  .hist-ico{ background:#fff3c9; }
/* a column, so the note owns its own line and can actually ellipsis —
   as inline spans the note and date ran together and broke mid-date */
.hist-body{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.hist-note{
  max-width:100%; font-weight:800; font-size:.92rem; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.hist-when{ font-size:.74rem; font-weight:700; color:var(--txt-dim); }
.hist-amt{ font-family:var(--disp); font-weight:700; font-size:1rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.hist-amt.up{ color:#0b8a52; } .hist-amt.down{ color:#d8543a; } .hist-amt.flat{ color:#4a7a94; }
.hist-empty{ text-align:center; padding:16px; color:#cfeeff; font-weight:700; background:rgba(255,255,255,.08); border-radius:var(--r-sm); border:1.5px dashed rgba(255,255,255,.3); }
.ghost-btn{
  margin-top:10px; width:100%; padding:10px; border-radius:var(--r-sm); cursor:pointer;
  border:1.5px dashed rgba(255,255,255,.4); background:transparent; color:#eafcff; font-weight:800; font-family:var(--body);
}

/* ── small numbers ────────────────────────────────────────
   Fredoka is a rounded display cut: lovely for the big pool
   balance, but under ~1.5rem its counters close up and the
   decimal point and thousands comma all but disappear. Anything
   numeric below that size uses the text face instead, which stays
   crisp and keeps amounts unambiguous — it is money, after all.
   Declared after the component sections so it wins cleanly.     */
.acc-card .acc-bal,
.hist-amt,
.wish-tank .pct,
.count-coins .coin-chip{
  font-family: var(--body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.acc-card .acc-bal{ font-size: 1.45rem; letter-spacing: -.015em; }
.hist-amt{ font-size: 1.02rem; }
.count-coins .coin-chip{ font-weight: 800; }

/* ── footer ───────────────────────────────────────────────── */
.app-foot{ display:flex; justify-content:center; gap:22px; padding: 16px 0 4px; }
.foot-link{
  border:0; background:none; cursor:pointer; text-decoration:none;
  color:#bfe6f7; font-weight:800; font-size:.88rem; font-family:var(--body);
  opacity:.85;
}
.foot-link:hover{ opacity:1; }

/* ── sheets ───────────────────────────────────────────────── */
.sheet-wrap{ position:fixed; inset:0; z-index:20; display:flex; align-items:flex-end; justify-content:center; }
.sheet-shade{ position:absolute; inset:0; background:rgba(2,16,32,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity:0; transition:opacity .25s; }
.sheet-wrap.open .sheet-shade{ opacity:1; }
.sheet{
  position:relative; width:100%; max-width:560px; max-height:88dvh; overflow-y:auto;
  background: var(--wash);
  border-radius: 26px 26px 0 0;
  padding: 14px 20px calc(26px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px rgba(0,20,40,.5);
  transform: translateY(103%);
  transition: transform .38s cubic-bezier(.22,1.2,.36,1);
}
.sheet-wrap.open .sheet{ transform: translateY(0); }
.sheet::before{
  content:""; display:block; width:44px; height:5px; border-radius:99px;
  background:rgba(10,60,90,.2); margin: 0 auto 12px;
}
.sheet h3{
  font-family:var(--disp); font-weight:600; font-size:1.3rem; color:var(--ink);
  display:flex; align-items:center; gap:10px; margin-bottom:4px;
}
.sheet .sub{ font-size:.9rem; font-weight:700; color:var(--txt-dim); margin-bottom:14px; }

/* amount entry */
.amt-row{
  display:flex; align-items:center; gap:8px;
  background:#fff; border-radius: var(--r-sm); border:2px solid rgba(30,120,170,.25);
  padding: 8px 14px; margin-bottom: 10px;
}
.amt-row:focus-within{ border-color:#31bef0; box-shadow:0 0 0 4px rgba(49,190,240,.18); }
.amt-cur{ font-family:var(--disp); font-weight:700; font-size:1.5rem; color:var(--txt-dim); }
.amt-in{
  flex:1; border:0; outline:0; min-width:0; background:transparent;
  font-family:var(--disp); font-weight:700; font-size:2rem; color:var(--ink);
  font-variant-numeric: tabular-nums;
}
.amt-in::placeholder{ color:#b5d3e2; font-weight:600; }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.chip{
  border:0; cursor:pointer; font-family:var(--body); font-weight:800; font-size:.9rem;
  background:#fff; color:#0b6a94; border:1.5px solid rgba(30,120,170,.3);
  padding:8px 14px; border-radius:999px;
  transition: transform .1s, background .15s;
}
.chip:active{ transform:scale(.9); }
.chip.sel{ background:#0e86bd; color:#fff; border-color:#0e86bd; }
.field-label{ font-size:.8rem; font-weight:900; letter-spacing:.05em; text-transform:uppercase; color:var(--txt-dim); margin: 12px 0 6px; }

/* currency picker — € £ $ chips plus a free-typed sign like kr or ¥ */
.cur-pick{ align-items:center; }
.cur-pick .chip{ min-width:52px; font-family:var(--disp); font-size:1.05rem; font-weight:600; }
.cur-pick .cur-other{ width:104px; padding:8px 12px; font-size:.95rem; text-align:center; }
.onb-card .cur-pick{ justify-content:center; margin-bottom:6px; }
.onb-label{ text-align:center; margin-top:18px; }
.onb-note{ font-size:.82rem; font-weight:700; color:var(--txt-dim); line-height:1.5; margin:6px 4px 0; }
.text-in{
  width:100%; border:2px solid rgba(30,120,170,.25); border-radius:var(--r-sm);
  padding:12px 14px; font-family:var(--body); font-weight:700; font-size:1rem; color:var(--ink);
  background:#fff; outline:0;
}
.text-in:focus{ border-color:#31bef0; box-shadow:0 0 0 4px rgba(49,190,240,.18); }
/* a required field the child skipped — a nudge, not a scolding */
.text-in.needs-it{ border-color:#ff8fa3; animation: needs-it .5s ease; }
@keyframes needs-it{
  0%,100%{ transform: translateX(0); }
  25%{ transform: translateX(-6px); } 75%{ transform: translateX(6px); }
}
.sheet-cta{
  width:100%; margin-top:16px; border:0; cursor:pointer;
  font-family:var(--disp); font-weight:600; font-size:1.15rem; color:#fff;
  padding:15px; border-radius:18px;
  background: linear-gradient(150deg,#31bef0,#1a76d0);
  box-shadow: 0 5px 0 rgba(10,60,110,.3), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .12s, box-shadow .12s, opacity .2s;
}
.sheet-cta:disabled{ opacity:.45; }
.sheet-cta:active:not(:disabled){ transform: translateY(3px); box-shadow: 0 2px 0 rgba(10,60,110,.3); }
.sheet-cta.green{ background: var(--btn-add); box-shadow: 0 5px 0 rgba(5,90,50,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.sheet-cta.warm{ background: var(--btn-spd); box-shadow: 0 5px 0 rgba(150,60,20,.3), inset 0 1px 0 rgba(255,255,255,.4); }
.sheet-cta.danger{ background: linear-gradient(150deg,#f2695c,#cc3327); box-shadow: 0 5px 0 rgba(120,20,10,.35); }
.sheet-cancel{
  width:100%; margin-top:10px; border:0; cursor:pointer; background:none;
  font-family:var(--body); font-weight:800; font-size:.95rem; color:var(--txt-dim); padding:8px;
}
.seg{ display:flex; background:#dceef7; border-radius:14px; padding:4px; gap:4px; }
.seg button{
  flex:1; border:0; cursor:pointer; padding:9px 6px; border-radius:11px;
  font-family:var(--body); font-weight:800; font-size:.9rem; color:#33718f; background:transparent;
  transition: background .15s;
}
.seg button.sel{ background:#fff; color:var(--ink); box-shadow:0 2px 8px rgba(10,60,90,.15); }

/* creature picker */
.creature-pick{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:6px; }
.creature-pick button{
  border:2px solid transparent; background:#fff; border-radius:16px; padding:10px 6px 6px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  transition: transform .12s, border-color .15s;
}
.creature-pick button.sel{ border-color:#31bef0; background:#e9f9ff; transform: scale(1.05); }
.creature-pick .creature-holder{ width:52px; }
.creature-pick .cname{ font-size:.68rem; font-weight:800; color:var(--txt-dim); }

/* pin pad */
.pin-dots{ display:flex; justify-content:center; gap:14px; margin: 14px 0 18px; }
.pin-dots i{
  width:16px; height:16px; border-radius:50%; background:#cfe6f2; border:2px solid #9cc6da;
  transition: transform .15s, background .15s;
}
.pin-dots i.on{ background:#0e86bd; border-color:#0e86bd; transform:scale(1.15); }
.pin-dots.err i{ animation: pinshake .4s; background:#f2695c; border-color:#f2695c; }
@keyframes pinshake{ 0%,100%{transform:translateX(0);} 25%{transform:translateX(-7px);} 75%{transform:translateX(7px);} }
.pin-pad{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; max-width:280px; margin:0 auto; }
.pin-pad button{
  border:0; cursor:pointer; background:#fff; border-radius:18px; padding:16px;
  font-family:var(--disp); font-weight:600; font-size:1.5rem; color:var(--ink);
  box-shadow: 0 3px 0 rgba(10,60,90,.12);
  transition: transform .1s;
}
.pin-pad button:active{ transform:scale(.93); }
.pin-pad button.soft{ background:transparent; box-shadow:none; font-size:1.1rem; color:var(--txt-dim); }

/* grown-ups */
.gu-section{ background:#fff; border-radius:var(--r-sm); padding:14px; margin-bottom:12px; }
.gu-section h4{ font-family:var(--disp); font-weight:600; font-size:1rem; color:var(--ink); margin-bottom:8px; display:flex; gap:8px; align-items:center;}
.gu-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; font-size:.92rem; font-weight:700; color:var(--txt); }
.gu-row + .gu-row{ border-top:1px solid #ecf4f8; }
.gu-row > span:last-child:has(.gu-btn){ display:flex; gap:6px; flex-shrink:0; align-items:center; }
.gu-note{ font-size:.8rem; font-weight:600; color:var(--txt-dim); line-height:1.45; }
.gu-btn{
  border:0; cursor:pointer; background:#e8f4fa; color:#0b6a94; font-weight:800; font-family:var(--body);
  font-size:.85rem; padding:8px 14px; border-radius:999px; white-space:nowrap;
}
.gu-btn.warn{ background:#ffe9df; color:#b3411f; }

/* statement */
.stmt-month-row{ display:flex; gap:8px; overflow-x:auto; padding-bottom:8px; margin-bottom:8px; scrollbar-width:none; }
.stmt-month-row::-webkit-scrollbar{ display:none; }
.stmt-table{ width:100%; border-collapse:collapse; font-size:.88rem; }
.stmt-table th{ text-align:left; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; color:var(--txt-dim); padding:6px 8px; }
.stmt-table td{ padding:8px; border-top:1px solid #e3eff5; font-weight:700; color:var(--txt); }
.stmt-table td.num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.stmt-sum{ display:flex; justify-content:space-between; background:#eaf7ff; border-radius:var(--r-sm); padding:10px 14px; font-weight:900; margin-top:10px; }

/* ── who's splashing (multi-child chooser) ────────────────── */
.who{
  position:fixed; inset:0; z-index:16; display:flex; align-items:center; justify-content:center;
  padding: calc(22px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y:auto;
}
.who-inner{ width:100%; max-width:520px; text-align:center; }
.who-title{
  font-family:var(--disp); font-weight:600; font-size:clamp(1.5rem,6vw,2rem); color:#eafcff;
  text-shadow:0 3px 20px rgba(0,40,80,.6); margin-bottom:22px;
}
.who-grid{ display:flex; flex-wrap:wrap; gap:16px; justify-content:center; }
.who-card{
  cursor:pointer; border:1.5px solid rgba(255,255,255,.35); border-radius:24px;
  background:rgba(255,255,255,.14); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  color:#eafcff; padding:18px 14px 14px; width:140px;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  transition:transform .16s, background .2s;
  animation: onbin .5s cubic-bezier(.22,1.2,.36,1) both;
}
.who-card:nth-child(2){ animation-delay:.07s; }
.who-card:nth-child(3){ animation-delay:.14s; }
.who-card:hover{ background:rgba(255,255,255,.24); transform:translateY(-4px); }
.who-card:active{ transform:scale(.96); }
.who-avatar{ width:82px; display:block; animation: swimidle 4.5s ease-in-out infinite; }
@keyframes swimidle{ 0%,100%{ transform: translateY(0) rotate(-2deg);} 50%{ transform: translateY(-6px) rotate(3deg);} }
.who-name{ font-family:var(--disp); font-weight:600; font-size:1.15rem; }
.who-bal{ font-size:.82rem; font-weight:800; opacity:.7; font-variant-numeric:tabular-nums; }

.child-chip .cc-face{ width:20px; height:20px; display:inline-block; vertical-align:-.35em; }
.gu-child{ display:flex; align-items:center; gap:8px; }
.gu-child .gu-face{ width:30px; height:30px; display:inline-block; flex-shrink:0; }
.gu-child em{ font-style:normal; font-size:.78rem; color:var(--txt-dim); font-weight:700; }

/* ── onboarding ───────────────────────────────────────────── */
.onb{
  position:fixed; inset:0; z-index:15; display:flex; align-items:center; justify-content:center;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y:auto;
}
.onb-inner{ width:100%; max-width:430px; }
.onb-card{
  background: var(--wash); border-radius: 30px; padding: 30px 26px;
  box-shadow: 0 30px 80px -20px rgba(0,10,30,.6);
  text-align:center;
  animation: onbin .55s cubic-bezier(.22,1.2,.36,1);
}
@keyframes onbin{ from{ opacity:0; transform: translateY(34px) scale(.96);} to{ opacity:1; transform:none;} }
.onb-card h1{ font-family:var(--disp); font-weight:700; font-size:2rem; color:var(--ink); line-height:1.15; }
.onb-card h2{ font-family:var(--disp); font-weight:600; font-size:1.45rem; color:var(--ink); }
.onb-card .lede{ font-size:1rem; font-weight:700; color:var(--txt-dim); margin:10px 0 18px; line-height:1.5; }
.onb-hero{ width:130px; margin:0 auto 6px; animation: bob 3.4s ease-in-out infinite; }
.onb-steps-dots{ display:flex; justify-content:center; gap:7px; margin-top:20px; }
.onb-steps-dots i{ width:8px; height:8px; border-radius:50%; background:#c4deec; }
.onb-steps-dots i.on{ background:#0e86bd; width:22px; border-radius:99px; }
.age-row{ display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:6px 0 4px; }
.age-bub{
  width:52px; height:52px; border-radius:50%; border:2.5px solid #bcdcec; background:#fff; cursor:pointer;
  font-family:var(--disp); font-weight:700; font-size:1.3rem; color:var(--txt-dim);
  transition: transform .15s, border-color .15s, background .15s;
}
.age-bub.sel{ border-color:#0e86bd; background:#0e86bd; color:#fff; transform:scale(1.12); }

/* ── toasts ───────────────────────────────────────────────── */
.toasts{ position:fixed; left:0; right:0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index:40; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.toast{
  background:rgba(4,32,52,.92); color:#eafcff; font-weight:800; font-size:.92rem;
  padding:11px 20px; border-radius:999px; border:1px solid rgba(140,230,255,.3);
  box-shadow: 0 10px 30px rgba(0,10,30,.5);
  animation: toastin .35s cubic-bezier(.22,1.4,.36,1);
  max-width: 88vw; text-align:center;
}
@keyframes toastin{ from{ opacity:0; transform: translateY(16px) scale(.9);} to{ opacity:1; transform:none;} }
.toast.out{ transition: opacity .4s, transform .4s; opacity:0; transform: translateY(10px); }
.toast.gold{ background: linear-gradient(140deg,#8a5f00,#c79a1a); border-color:#ffe9b8; }

/* ── celebration ──────────────────────────────────────────── */
.celebrate{
  position:fixed; inset:0; z-index:50; overflow:hidden;
  background: radial-gradient(120% 100% at 50% 24%, rgba(12,74,128,.94), rgba(2,10,30,.97));
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: celefade .5s ease;
}
@keyframes celefade{ from{ opacity:0; } to{ opacity:1; } }
#celeFx{ position:absolute; inset:0; width:100%; height:100%; }
.cele-stage{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding: 24px; gap: 6px;
}
.cele-kicker{
  font-family:var(--disp); font-weight:600; font-size:1.1rem; letter-spacing:.22em; text-transform:uppercase;
  color:var(--glow); text-shadow:0 0 18px var(--glow);
  animation: celein .6s .15s both cubic-bezier(.22,1.4,.36,1);
}
.cele-big{
  font-family:var(--disp); font-weight:700; font-size: clamp(2.4rem, 10vw, 4.2rem); color:#fff; line-height:1.05;
  text-shadow: 0 6px 40px rgba(0,80,140,.8);
  animation: celein .6s .3s both cubic-bezier(.22,1.4,.36,1);
}
.cele-creature{ width: min(46vw, 240px); margin: 12px 0; animation: celecreat 1s .45s both cubic-bezier(.22,1.6,.36,1); filter: drop-shadow(0 12px 34px rgba(0,220,255,.35)); }
@keyframes celecreat{ from{ opacity:0; transform: translateY(60px) scale(.4) rotate(-14deg);} to{ opacity:1; transform:none;} }
.cele-sub{ font-weight:800; font-size:1.05rem; color:#d5f4ff; animation: celein .6s .6s both; max-width: 340px; }
@keyframes celein{ from{ opacity:0; transform: translateY(24px);} to{ opacity:1; transform:none;} }
.cele-btn{
  margin-top:20px; border:0; cursor:pointer;
  font-family:var(--disp); font-weight:600; font-size:1.1rem; color:#053a5c;
  background: linear-gradient(160deg,#fff,#bdeeff);
  padding: 14px 34px; border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.15), 0 14px 40px rgba(0,40,80,.5);
  animation: celein .6s .85s both;
}

/* ── little-kid mode (ages 5–7) ───────────────────────────── */
body.mode-little .pool-balance{ font-size: clamp(3rem, 13vw, 4rem); }
body.mode-little .big-btn{ font-size:1.3rem; padding:19px 10px; }
body.mode-little .feed-btn{ font-size:1.1rem; padding:12px 20px; }
body.mode-little #histZone .mini-btn,
body.mode-little #btnMove{ display:none; }
body.mode-little .hist-when{ display:none; }
body.mode-little .zone-title{ font-size:1.3rem; }
body.mode-little .wish-name{ font-size:1.25rem; }

/* ═══════════════════════════════════════════════════════════
   SIMPLE GRAPHICS MODE (older tablets)
   Backdrop blurs are the expensive part: each one forces an
   offscreen pass every frame and they sit over a moving canvas,
   so nothing can be cached. Dropping them — plus the shader —
   is what turns a struggling A8 iPad back into a smooth one.
   The layout, colours and depth levels are untouched.
   ═══════════════════════════════════════════════════════════ */
body.perf-low{
  /* the shader is off, so paint the ocean with a plain gradient
     that still follows the child's depth level */
  background:
    linear-gradient(180deg,
      var(--sea-hi) 0%,
      var(--sea-mid) 38%,
      var(--sea-lo) 68%,
      var(--sea-deep) 100%) fixed;
}
body.perf-low #gl,
body.perf-low #fx,
body.perf-low #rays{ display: none !important; }

/* kill every blur — backdrop and filter alike */
body.perf-low .chip-btn,
body.perf-low .depth-bar,
body.perf-low .quest-card,
body.perf-low .mini-btn,
body.perf-low .add-wish,
body.perf-low .sheet-shade,
body.perf-low .who-card{
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* the translucency read as "frosted" only because of the blur —
   without it, solid-ish fills keep the contrast honest */
body.perf-low .quest-card{ background: rgba(8,52,90,.9); }
body.perf-low .chip-btn,
body.perf-low .depth-bar,
body.perf-low .mini-btn,
body.perf-low .who-card{ background: rgba(7,58,96,.6); }
body.perf-low .add-wish{ background: rgba(7,58,96,.45); }
body.perf-low .sheet-shade{ background: rgba(2,16,32,.72); }

body.perf-low .ico-img,
body.perf-low .brand-drop,
body.perf-low .quest-emoji{ filter: none; }

/* softer shadows: large blur radii are also fill-rate heavy */
body.perf-low .pool-card,
body.perf-low .wish-card,
body.perf-low .acc-card,
body.perf-low .hist-item,
body.perf-low .sheet{ box-shadow: 0 4px 12px rgba(3,40,64,.35); }

/* the pool keeps its gradient but loses the costly inner glow pass */
body.perf-low .pool-card{
  background: linear-gradient(175deg, var(--sea-hi), var(--sea-mid) 55%, var(--sea-lo));
}

/* decorative loops that cost frames for very little */
body.perf-low .coin3d{ animation: none; }
body.perf-low .onb-hero,
body.perf-low .who-avatar{ animation: none; }

/* ── reduced motion ───────────────────────────────────────── */
/* ── reduced motion ───────────────────────────────────────
   "Reduce motion" is about sparing people from large, fast, displacing
   movement — things that slide, zoom, spin or fly across the screen.
   A blanket `*{ animation: .01s }` also killed the reef's slow ambient
   life: the light shafts stopped swaying, the caustics stopped drifting,
   the kelp stopped moving. That turns the calmest part of the app into a
   dead photograph, and it is not what the setting is protecting against.
   So: snap every UI transition, drop the big one-shot flourishes and
   anything that spins or flies, and leave the gentle low-amplitude loops
   running. (Named explicitly rather than via :not(), which needs Safari
   16+ — the iPad mini 4 this app targets is on Safari 15.) */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ transition-duration: .01s !important; }

  /* the big fullscreen light overlay */
  #rays{ display:none; }

  /* celebrations, entrances and toasts: they fly in and scale up */
  .celebrate, .cele-kicker, .cele-big, .cele-sub, .cele-creature,
  .toast, .onb-card, .onb-hero, .who-card, .who-avatar,
  /* spins, hops, shakes and pops */
  .coin3d, .creature-holder.hop, .creature-holder.spin-round svg,
  .creature-holder.puff-up svg, .creature-holder.duck-hide svg,
  .daily-star.found, .pin-dots.err i,
  /* coin-toss flourishes: loops, growth spurts, expanding rings */
  .toss-pet.finale svg, .toss-pet.grew svg, .toss-ring,
  /* drifting scenery that crosses the whole scene */
  .rf-drifter{
    animation: none !important;
  }
}

/* wide screens: put the pool + quest side info in a nicer rhythm */
@media(min-width: 720px){
  .wish-grid{ grid-template-columns: 1fr; }
  .acc-grid{ grid-template-columns: repeat(2, 1fr); }
}

/* birthday: two side-by-side pickers, stacking on a narrow phone */
.bday-row{ display:flex; gap:10px; margin-top:8px; }
.bday-row .text-in{ flex:1; min-width:0; padding:10px 12px; }
@media(max-width:340px){ .bday-row{ flex-direction:column; } }
