:root{font-family:system-ui,"PingFang SC",sans-serif;color:#21483f;background:#f8f6ee;font-synthesis:none;--ink:#21483f;--muted:#4c6d63;--paper:#fffcf4;--line:#dce7d8;--water:#d5ebdf}
*{box-sizing:border-box}
body{margin:0;min-width:280px}
:root { --safe-side: max(env(safe-area-inset-left,0px),env(safe-area-inset-right,0px)); }
main{width:min(calc(100% - 28px - var(--safe-side) * 2),680px);margin:0 auto;padding:calc(26px + env(safe-area-inset-top,0px)) 0 calc(40px + env(safe-area-inset-bottom,0px))}
h1,h2,h3,p{margin:0}h1,h2,h3{font-family:"Songti SC","Noto Serif CJK SC",serif}h1{font-size:clamp(1.75rem,5vw,2.55rem)}h2{font-size:1.45rem}h3{font-size:1.18rem}
p{line-height:1.6}.eyebrow{font-size:.8rem;color:var(--muted);font-weight:650;letter-spacing:.08em}
header,.task,.buttons,.shortcuts,.wallet,.game-controls{display:flex;align-items:center;gap:10px}
header,.task,.game-controls{justify-content:space-between}.wallet,.buttons,.shortcuts{flex-wrap:wrap}.wallet{justify-content:flex-end;max-width:65%;font-size:.79rem}.wallet span{background:#eaf0e4;border-radius:24px;padding:5px 9px;white-space:nowrap}
button,input{font:inherit}button{border:1px solid transparent;background:#306757;color:#fffaf0;border-radius:12px;padding:9px 14px;cursor:pointer;min-height:42px;font-weight:650}button.secondary{background:#edf3e7;border-color:#d5e5d6;color:var(--ink)}button:disabled{background:#eeefe7;color:#53695d;border-color:transparent;cursor:default}button:not(:disabled):hover{filter:brightness(.95)}button:focus-visible,input:focus-visible,.stream:focus-visible{outline:3px solid #4f8d78;outline-offset:3px}
nav{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;background:#e9efe2;border-radius:15px;padding:5px;margin:18px 0}nav button{color:var(--muted);background:transparent;padding-inline:4px}nav [aria-current]{background:#fffdf5;color:var(--ink);box-shadow:0 1px 4px #22483613}
.card{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:16px}.card p:not(.eyebrow){color:var(--muted)}.card h2 + p,.card h3 + p{margin-top:4px}.card .buttons,.card > button,.card form{margin-top:12px}.intro{margin:14px 0}.intro p:not(.eyebrow){color:var(--muted);margin-top:6px}.notice{border-radius:12px;padding:9px 12px;background:#fcf0d9;margin-bottom:12px}.stack,.care,.grid{display:grid;gap:12px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.guest .specimen{height:105px;border-radius:12px;background:#edf5e9;overflow:hidden;margin-bottom:10px}.guest >button{width:100%}.task>button{flex-shrink:0;margin-top:0}.shortcuts{margin-top:12px}.fish-list{gap:6px}
.pond{height:290px;border-radius:22px;position:relative;isolation:isolate;display:grid;grid-template-rows:auto 1fr auto;justify-items:center;overflow:hidden;padding:16px;background:radial-gradient(ellipse at 56% 28%,#f5faf0,transparent 64%),linear-gradient(155deg,#e2f0db,#b6dcce);border:1px solid #c9e4d6;margin-bottom:12px}.pond-title,.pond-hint{z-index:1;text-align:center}.pond-title span{font-size:.8rem;color:var(--muted)}.pond-hint{font-size:.85rem}.ripples{position:absolute;z-index:-1;inset:45% -12% -35%;border-radius:48%;background:repeating-radial-gradient(ellipse at 50% 20%,transparent 0 28px,#fff9 30px,#fff0 33px 54px);opacity:.56;transform:scaleY(.73)}.fish-hit{display:grid;place-items:center;width:min(100%,340px);background:transparent;padding:0}.fish-hit:hover{filter:none!important}.care{margin-bottom:12px}.care .buttons{margin-top:0}progress{width:100%;height:10px;accent-color:#4b8b71}
.welcome{text-align:center;padding-top:clamp(25px,10vh,100px)}.welcome section{padding:28px}.welcome p{max-width:390px;margin:auto}.desk,.specimen{display:grid;place-items:center}.desk{height:200px;background:radial-gradient(ellipse at center,#f6e2c6 9%,transparent 72%)}.welcome button{margin-top:18px}
.model{--size:138px;position:relative;display:block;flex:none;width:var(--size);height:calc(var(--size)*.64);isolation:isolate;filter:drop-shadow(0 11px 8px #3e655f30)}.fry{scale:.72}.juvenile{scale:.88}.adult{scale:1.12}.specimen .model{--size:119px}.fish-hit .adult,.reveal .model{--size:163px}.model i{position:absolute;display:block}.model .body{inset:15% 28% 10% 2%;border-radius:55% 51% 49% 59%;background:radial-gradient(ellipse at 35% 79%,#fffae9 0%,transparent 64%),radial-gradient(ellipse at 31% 18%,#fff9 0%,transparent 36%),var(--fish);border:2px solid #fffaf1;overflow:hidden}.model .tail{inset:26% 1% 17% 61%;background:linear-gradient(164deg,#fffaf2 0%,var(--fish) 33%,#fff5df 49%,var(--fish) 52%,#fff3dc 86%);clip-path:polygon(0 48%,97% 0,100% 100%);transform-origin:left center}.model .fin{inset:0 35% 50% 35%;background:linear-gradient(145deg,#fffeea,var(--fish));border-radius:90% 16% 75% 0;transform:rotate(-16deg);border:1px solid #fff9}.model .eye{top:41%;left:24%;width:13%;height:19%;border-radius:12% 15% 75% 58%;background:#302c32;border-top:2px solid #302c32;transform:rotate(-16deg)}.model .cheek{left:18%;top:64%;width:15%;height:10%;border-radius:50%;background:#dc7e776b}.paper .tail{clip-path:polygon(0 50%,68% 0,100% 30%,91% 92%,68% 100%)}.puffer .body{inset:8% 28% 3% 9%;border-radius:50%}.puffer .tail{inset:34% 6% 29% 65%;clip-path:polygon(0 50%,77% 4%,98% 42%,84% 57%,94% 86%)}.puffer .eye{height:9%;transform:rotate(-10deg)}.long .body{inset:32% 22% 13% 1%}.long .tail{inset:30% 1% 20% 65%}.veil .tail{inset:6% 0 3% 54%;border-radius:50% 15% 92% 20%;clip-path:none;transform:rotate(12deg)}.ray .body{inset:12% 18% 8% 4%;border-radius:65% 29% 90% 21%;rotate:-9deg}.ray .tail{inset:40% 0 36% 66%;rotate:20deg}.adult .tail{scale:1.2 1.45}.adult.paper .tail{scale:1.22 1.7}.adult.veil .fin{scale:1.1 1.35}.marks{left:52%;top:25%;width:9%;aspect-ratio:1;border-radius:50%;background:#58487077}.marks.base,.marks:not(.small,.cluster,.odd){display:none}.marks.mark-tail{left:80%;top:35%}.marks.mark-lip{left:6%;top:60%}.marks.cluster{box-shadow:8px 7px 0 -1px #58487078,14px 0 0 -2px #58487078}.marks.odd{width:20%;border-radius:38% 63% 42% 55%}.model .shine{display:none;top:0;right:20%;color:#fff8d3;text-shadow:0 0 4px #ba965f;font-style:normal;font-size:25px}.model.sheen .shine:not(.second,.third){display:block;opacity:.8}.model.brilliant{filter:drop-shadow(0 0 9px #fff2aa) drop-shadow(0 0 12px #ebac7d)}.model.brilliant .shine{display:block;animation:spark 1.1s ease-in-out infinite alternate}.model .second{top:63%;right:0;animation-delay:.3s!important}.model .third{top:25%;left:0;right:auto;animation-delay:.6s!important}
.react{animation:swim .6s ease both}.react.puffer{animation:bob .65s ease both}.react.long{animation:dart .65s ease both}.react.veil{animation:sway .85s ease both}.rare-move{animation:flip .9s ease both}
@keyframes swim{35%{transform:translate(22px,-12px) rotate(-10deg)}75%{transform:translate(-7px,2px)}}@keyframes bob{50%{transform:translateY(-11px) scale(1.08,.95)}}@keyframes dart{30%{transform:translateX(-24px) scale(.85)}65%{transform:translateX(16px)}}@keyframes sway{45%{transform:translateY(-12px) rotate(-16deg)}75%{transform:rotate(8deg)}}@keyframes flip{50%{transform:translateY(-24px) rotate(-22deg) rotateY(180deg);filter:drop-shadow(0 0 20px #fff29a)}100%{transform:rotateY(360deg)}}@keyframes spark{to{transform:scale(.5) rotate(18deg);opacity:.4}}
form{display:flex;gap:5px;align-items:end}form label{min-width:0;font-size:.79rem;color:var(--muted);flex:1}input{display:block;width:100%;min-height:42px;border:1px solid var(--line);border-radius:10px;background:#fffef9;color:var(--ink);padding:5px 8px}form button{padding-inline:8px}
.overlay{position:fixed;inset:0;display:grid;place-items:center;background:#21483f70;padding:14px;z-index:3}.reveal{text-align:center;width:min(100%,440px);box-shadow:0 15px 65px #21483f45}.reveal .specimen{height:165px;margin:12px 0;background:radial-gradient(ellipse,#edf5de,transparent 70%)}.reveal .model{animation:unfold .85s ease both}.reveal .tail{animation:tail-open .8s ease both}.reveal .specimen:after{content:"";position:absolute;width:165px;height:92px;pointer-events:none;background:linear-gradient(108deg,transparent 32%,#fffad5 52%,transparent 56%);opacity:0;animation:sweep .85s .3s ease both}.reveal .traits{font-weight:750;color:var(--ink)}@keyframes unfold{from{opacity:.3;transform:scale(.62) rotateY(125deg)}to{opacity:1;transform:scale(1)}}@keyframes tail-open{from{transform:scale(.45) rotate(-25deg)}}@keyframes sweep{20%{opacity:.8}80%{opacity:0;transform:translateX(55px)}}
.stream{height:clamp(230px,47vh,360px);position:relative;overflow:hidden;border-radius:19px;touch-action:none;cursor:ew-resize;background:repeating-linear-gradient(100deg,transparent 0 52px,#fff5 54px,#fff0 63px 96px),linear-gradient(#e7f4de,#a5d9cf);border:1px solid #badfd2}.net,.drop{position:absolute;transform:translate(-50%,-50%);pointer-events:none}.net{left:50%;top:83%;width:22%;height:16%;border:4px solid white;border-top-width:5px;border-radius:22% 22% 52% 52%;background:repeating-linear-gradient(45deg,#ffffff95 0 1px,transparent 2px 9px),repeating-linear-gradient(-45deg,#ffffff95 0 1px,transparent 2px 9px);box-shadow:0 0 0 2px #3d836b}.drop{color:#477d44;font-size:24px;text-shadow:-1px 0 white,0 1px white,1px 0 white,0 -1px white}.drop.bright{color:#a67824;font-size:31px}.game-controls{margin:10px 0;text-align:center;font-size:.85rem}.game-title{margin-top:22px}
@media(max-width:390px){.grid{gap:8px}.guest{padding:11px}.guest .specimen{height:83px}.wallet{gap:4px}.wallet span{padding:4px 6px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important}}

/* Backwater Bay and the illustrated paper goldfish */
.pond {
  height: clamp(275px, 55vw, 345px);
  padding: 18px 14px 14px;
  background: #cde8db url("assets/backwater-pond.jpg") center / cover;
  container-type: inline-size;
}
.pond .ripples { opacity: .22; }
.pond-title, .pond-hint {
  text-shadow: 0 1px 5px #fffff2, 0 0 14px #fffdf3;
}
.pond .fish-hit {
  width: 100%;
  min-width: 0;
  position: relative;
}
.swim-path, .swim-heading { display: grid; place-items: center; }
.swim-path:has(.paper-fish) {
  animation: paper-patrol 12s linear infinite;
}
.swim-heading:has(.paper-fish) {
  animation: paper-heading 12s ease-in-out infinite;
}
@keyframes paper-patrol {
  0%, 100% { transform: translate(16cqw, 6px); }
  24% { transform: translate(-17cqw, -23px); }
  36% { transform: translate(-18cqw, -12px); }
  66% { transform: translate(17cqw, 15px); }
  79% { transform: translate(19cqw, 18px); }
}
@keyframes paper-heading {
  0%, 25%, 93%, 100% { transform: scaleX(1); }
  36%, 79% { transform: scaleX(-1); }
}
.paper-fish {
  --paper-size: 132px;
  --tail-width: .70;
  --tail-height: .66;
  position: relative;
  display: block;
  isolation: isolate;
  width: var(--paper-size);
  aspect-ratio: 1.65;
}
.paper-fish.fry { scale: .67; --tail-width:.43; --tail-height:.36; }
.paper-fish.juvenile { scale: .94; --tail-width:.86; --tail-height:.81; }
.paper-fish.adult { scale: 1; --tail-width: 1; --tail-height: 1; }
.fish-hit .paper-fish { --paper-size: clamp(132px, 42cqw, 265px); }
.guest .paper-fish { --paper-size: 92px; }
.reveal .paper-fish { --paper-size: clamp(155px, 59vw, 265px); }
.paper-body, .paper-tail {
  position: absolute;
  background: var(--art) center / 100% 100% no-repeat;
}
.paper-body {
  --art: url("assets/paper-body.png");
  inset: 0 auto 0 0;
  width: 59%;
}
.paper-tail {
  --art: url("assets/paper-tail.png");
  width: 52%;
  height: 114%;
  left: 48%;
  top: -7%;
  transform-origin: 1% 62%;
  transform: scale(var(--tail-width), var(--tail-height));
}
.fish-hit .paper-tail { animation: paper-kick 1.22s ease-in-out infinite alternate; }
@keyframes paper-kick {
  from { transform: perspective(175px) rotateY(-23deg) rotate(-5deg) scale(var(--tail-width), var(--tail-height)); }
  to { transform: perspective(175px) rotateY(22deg) rotate(6deg) scale(var(--tail-width), var(--tail-height)); }
}
.paper-mark, .paper-mark-anchor { position: absolute; }
.paper-mark-anchor.back { inset: 34% auto auto 62%; }
.paper-mark-anchor.lip { inset: 71% auto auto 14%; }
.paper-mark { width: calc(var(--paper-size) * .035); aspect-ratio: 1; border-radius: 50%; background: #87505dba; }
.paper-tail > .paper-mark { left: 54%; top: 58%; }
.paper-mark.cluster { box-shadow: .4em .25em 0 -.11em #87505daa, .75em -.15em 0 -.14em #87505dc2; }
.paper-mark.odd { width: calc(var(--paper-size) * .065); border-radius: 48% 62% 54% 38%; }

.paper-body::after, .paper-tail::after {
  content: "";
  position: absolute;
  inset: 0;
  mask: var(--art) center / 100% 100% no-repeat;
  background-size: 240% 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}
.paper-fish.sheen :is(.paper-body,.paper-tail)::after {
  background-image: linear-gradient(115deg, transparent 36%, #fff5cd90 49%, transparent 62%);
  animation: paper-light 4.7s ease-in-out infinite;
}
.paper-fish.brilliant :is(.paper-body,.paper-tail) {
  filter: drop-shadow(0 0 3px #ffffc8) drop-shadow(0 0 10px #fec969c9);
}
.paper-fish.brilliant :is(.paper-body,.paper-tail)::after {
  background-image: linear-gradient(117deg, transparent 24%, #ffd0897a 39%, #fffde6 50%, #fff6b8b0 56%, transparent 72%), radial-gradient(ellipse at 65% 44%, #fff3ac96, #ffc16c42 45%, transparent 70%);
  animation: paper-light 2.6s ease-in-out infinite alternate;
}
.paper-fish.brilliant .paper-tail::after {
  background-image: linear-gradient(117deg, transparent 24%, #ffd0897a 39%, #fffde6 50%, #fff6b8b0 56%, transparent 72%), conic-gradient(from 221deg at 2% 61%, transparent 45deg, #fff8c4 49deg, transparent 53deg, transparent 89deg, #fffbe1e8 92deg, transparent 97deg, transparent 127deg, #fff9c6ca 131deg, transparent 137deg);
  background-size: 240% 100%, 100% 100%;
}
@keyframes paper-light {
  from { background-position: 100% 50%, center; }
  to { background-position: 0% 50%, center; }
}

.reveal:has(.paper-fish) .specimen {
  height: clamp(157px, 52vw, 224px);
  border-radius: 14px;
  background: #d3e9de url("assets/backwater-pond.jpg") center / cover;
}
.reveal .specimen:has(.paper-fish)::after { content: none; }
.reveal .paper-fish { animation: paper-rise 1.35s ease-out both; }
.reveal .paper-tail { animation: paper-unfold 1.45s cubic-bezier(.2,.6,.26,1) both; }
@keyframes paper-rise {
  0% { transform: scale(.76) rotate(8deg); }
  58% { transform: scale(1.045) rotate(-7deg); }
  100% { transform: scale(1); }
}
@keyframes paper-unfold {
  0%, 14% { transform: perspective(190px) rotateY(62deg) rotate(-21deg) scale(.67, .23); }
  52% { transform: perspective(190px) rotateY(-18deg) rotate(-11deg) scale(.96, .75); }
  72% { transform: perspective(190px) rotateY(10deg) rotate(5deg) scale(1.05, 1.12); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .swim-path:has(.paper-fish), .swim-heading:has(.paper-fish),
  .fish-hit .paper-tail, .reveal .paper-fish, .reveal .paper-tail,
  .paper-fish :is(.paper-body,.paper-tail)::after { animation: none; }
  .paper-fish :is(.paper-body,.paper-tail)::after { background-position: center; }
}

/* Tide puzzles */
nav { grid-template-columns: repeat(4,minmax(0,1fr)); }
.welcome-fish,.lead-fish,.tide-guide,.tide-level {
  display: flex; align-items: center; gap: 12px;
}
.welcome-fish { flex-wrap: wrap; }
.welcome-fish .specimen,.lead-fish .specimen,.tide-guide .specimen {
  flex: 0 0 92px; min-height: 72px; border-radius: 12px; background: #e4f2e8;
}
.welcome-fish .specimen .model,.lead-fish .specimen .model { --size: 72px; }
.welcome-fish .paper-fish,.lead-fish .paper-fish { --paper-size: 73px; }
.greeter-select { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 10px; }
.tide-levels { margin-top: 12px; }
.tide-level,.tide-guide { justify-content: space-between; }
.tide-level > button { flex: none; margin: 0; }
.tide-level p,.tide-guide p { font-size: .86rem; }
.tide-guide { padding: 8px; background: #e8f1e6; border-radius: 13px; margin-bottom: 10px; }
.tide-guide .specimen { flex-basis: 54px; min-height: 40px; background: #f5f9ee; }
.tide-guide .model { --size: 47px; }
.tide-guide strong { margin-left: auto; white-space: nowrap; font-size: .83rem; }
.tide-board {
  display: grid;
  position: relative;
  grid-template-columns: repeat(var(--columns),minmax(0,1fr));
  grid-template-rows: repeat(var(--rows),clamp(54px,15vw,83px));
  background: #cde8db url('assets/backwater-pond.jpg') center / cover;
  border-radius: 18px;
  overflow: hidden;
}
.tide-cell {
  margin: 3px; padding: 0; min-height: 0; font-size: 1.7rem; line-height: 1;
  border: 1px solid #fcfff3dd; background: #f1f8ebd9; color: #235a59;
}
.tide-cell:disabled { background: #eff7ead0; border-color: #fcfff3aa; color: #235a59; }
.tide-cell.traced { background: #fff1c4; border-color: #fffcdd; color: #574d28; }
.tide-bank { display: grid; place-items: center; font-size: .73rem; font-weight: 750; }
.tide-bank.inlet,.tide-bank.outlet { margin: 4px; border-radius: 9px; background: #fffaf0d6; }
.tide-bank.outlet { background: #306757; color: #fffaf0; }
.tide-swimmer {
  position: absolute; z-index: 1; pointer-events: none;
  left: calc((var(--col) + .5) * 100% / var(--columns));
  top: calc((var(--row) + .72) * 100% / var(--rows));
  transform: translate(-50%,-50%) scaleX(-1);
  transition: left .16s linear, top .16s linear;
}
.tide-swimmer .model { --size: 49px; }
.tide-controls,.tide-note,.tide-result { margin-top: 12px; }
.tide-result .specimen {
  background: #cde8db url('assets/backwater-pond.jpg') center / cover;
  height: 130px; border-radius: 13px; margin: 12px 0;
}
.tide-result .paper-fish { --paper-size: 160px; }
.tide-result .tide-reward { margin-top: 8px; font-weight: 650; }
@media (prefers-reduced-motion: reduce) { .tide-swimmer { transition: none; } }
.tide-pair { display: flex; align-items: center; gap: 2px; }
.tide-pair .model { --size: 22px; }
.tide-pair .paper-fish { --paper-size: 24px; }

/* Backwater Bay scene and shoreline controls */
.bay-scene {
  --scene-width: 900px;
  min-height: 100svh;
  isolation: isolate;
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}
.bay-scene::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  width: min(100%, var(--scene-width));
  margin-inline: auto;
  background:
    linear-gradient(180deg,#f8f6e8b8 0%,#e7f5e41f 32%,#d1eddb0d 65%,#fcfaefb8 100%),
    #cce7d8 url('assets/backwater-pond.jpg') 50% center / cover no-repeat;
}
.bay-scene > header { padding-inline: 6px; }
.bay-scene > header h1 { font-size: clamp(1.4rem, 6vw, 1.85rem); }
.bay-scene .wallet span { background: #fffdf1a8; }
.bay-scene button { border-radius: 999px; }
.bay-scene button.secondary { background: #fffdf2d9; border-color: #fffdf3; }
.bay-scene button:disabled { background: #f1f2e6cf; }
.bay-scene .card { background: #fffdf3de; border-color: #fffdf4; border-radius: 22px; }
.bay-scene .intro { margin: 25px 4px 14px; }
.bay-scene .fish-hit { border-radius: 40%; }
.bay-scene .tide-cell { border-radius: 12px; }

.tail-home { padding: 22px 8px 0; text-align: center; }
.tail-home-title h2 { font-size: clamp(2.95rem, 12vw, 5rem); line-height: 1.1; }
.tail-home-title p,.tail-instructions { color: #254f46; }
.tail-home-title { text-shadow: 0 1px 18px #fffff0; }
.tail-home-scene {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  height: clamp(205px, 31svh, 323px);
}
.tail-home-scene .paper-fish { --paper-size: clamp(225px, 64vw, 375px); }
.tail-home-scene .specimen { transform: rotate(-9deg) translate(3%, 4%); }
.home-leaf {
  position: absolute;
  z-index: -1;
  display: block;
  width: 105px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 44% 45%,#fdffb35c,transparent 55%),
    conic-gradient(from 71deg, transparent 0deg 29deg, #81a160 30deg, #bad689 125deg, #dbeba1 246deg, #91b575 359deg);
  box-shadow: 0 0 0 1px #f2f9dab2, 0 10px 19px #4e8f6030;
}
.home-leaf-near { left: 6%; bottom: 17%; transform: scaleY(.69) rotate(17deg); }
.home-leaf-far { right: 7%; top: 16%; width: 68px; transform: scaleY(.72) rotate(-24deg); }
.home-leaf-distant { right: 0; top: 1%; width: 34px; opacity: .76; transform: scaleY(.71); }
.home-ripples {
  position: absolute;
  z-index: -1;
  inset: 33% 17% 15%;
  border-radius: 50%;
  border: 1px solid #fbffefb7;
  box-shadow: 0 0 0 13px #f4ffe629, 0 0 0 24px #fbffe92b;
  transform: rotate(-11deg) scaleY(.63);
}
button.tail-start-main {
  width: min(73%, 252px);
  min-height: 61px;
  font-size: 1.25rem;
  background: linear-gradient(148deg,#4e8465,#2b604f 72%);
  border: 2px solid #fff8dd;
  border-radius: 56% 44% 52% 48% / 52% 52% 48% 48%;
  box-shadow: 0 0 0 6px #ffffdb44, 0 6px 19px #32645345;
}
.tail-home-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 380px);
  gap: 14px;
  margin: 24px auto 0;
  padding: 10px 15px;
  border-block: 1px solid #f6fae2b0;
  background: linear-gradient(90deg,transparent,#fffbe199 14% 86%,transparent);
}
.tail-home-stats section,.tail-aftercare,.tail-game-title { display: flex; align-items: center; gap: 8px; }
.tail-home-stats section:first-child { display: block; }
.tail-home-stats h3 { font-size: .94rem; }
.tail-home-stats p { font-size: .82rem; }
.tail-home-stats strong { font-size: 1.2rem; }
.tail-reward-icon { width: 46px; flex-shrink: 0; }
.tail-reward-icon .model { --size: 44px; }
.tail-aftercare { justify-content: space-between; margin-top: 20px; }
.tail-aftercare > button { margin: 0; flex: none; }

.scene-pond .pond {
  border: 0;
  height: clamp(245px, 39svh, 370px);
  padding-top: 28px;
  background: transparent;
  margin: 0;
}
.scene-pond .pond .ripples { opacity: .48; }
.scene-pond .welcome-fish { margin-block: 14px; }

.tail-game { width: min(100% - 28px, 455px); padding-bottom: 22px; --scene-width: 680px; }
.tail-game-title { justify-content: space-between; }
.tail-game-title h1 { font-size: clamp(1.65rem, 8vw, 2.4rem); }
.tail-instructions { margin-top: 3px; }
.tail-hud { display: flex; justify-content: space-between; align-items: center; margin: 7px 0 0; }
.tail-hud strong { font-size: 1.15rem; }
.tail-hud > span { color: #355d50; }
.tail-water { overflow: hidden; margin-inline: -10px; }
.tail-water canvas { display: block; width: 100%; height: auto; cursor: pointer; touch-action: manipulation; }
.tail-feedback { min-height: 1.7em; text-align: center; font-weight: 650; }
.tail-buttons { justify-content: center; margin-top: 4px; }
.tail-buttons > button {
  border-radius: 50% 48% 52% 47%;
  min-width: 108px;
  min-height: 57px;
  border: 2px solid #ffffeadc;
  box-shadow: 0 0 0 5px #fffce146;
}
@media (max-width: 360px) {
  .tail-home-scene { height: 190px; }
  .tail-home-stats { gap: 5px; padding-inline: 6px; }
}

.tail-rider { font-size: .85rem; color: #2b5247; }
.tail-home .tail-rider { margin: -10px 0 10px; }
.tail-daily { text-align: center; font-size: .83rem; margin: 9px 0 0; color: #28564a; }
.tail-picker { margin-block: 14px; }
.tail-picker .buttons { flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 6px; }
.tail-picker button {
  flex: 0 0 auto; display: grid; place-items: center;
  gap: 3px; min-width: 75px; padding: 5px 10px;
}
.tail-picker button[aria-pressed="true"] { background: #e2edce; border-color: #6e9b66; }
.tail-picker .specimen { height: 30px; }
.tail-picker .paper-fish { --paper-size: 42px; }
.tail-picker .model { --size: 40px; }
.tail-water { position: relative; isolation: isolate; }
#tail-swimmer {
  position: absolute;
  top: 73%;
  left: 37%;
  display: grid;
  place-items: center;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: rotate(var(--swim-lean,0rad));
}
.tail-swim-facing {
  display: grid;
  place-items: center;
  width: 0;
  height: 0;
  transform: scaleX(var(--swim-face,1));
}
#tail-swimmer .paper-fish,#tail-swimmer .model { position: absolute; }
#tail-swimmer .paper-tail { animation: paper-kick var(--swim-beat,.6s) ease-in-out infinite alternate; }
#tail-swimmer .model .tail { rotate: -7deg; animation: swim-fin var(--swim-beat,.6s) ease-in-out infinite alternate; }
@keyframes swim-fin { to { rotate: 8deg; } }
.tail-game-actions { display: flex; gap: 6px; }
#tail-swimmer .paper-fish { --paper-size: clamp(39px, 13vw, 61px); }
#tail-swimmer .model { --size: clamp(36px, 12vw, 56px); }
#tail-swimmer.in-flight .paper-fish,#tail-swimmer.in-flight .model { transform: scale(1.14); }
#tail-swimmer.celebrating .paper-fish,#tail-swimmer.celebrating .model { filter: drop-shadow(0 0 7px #fff39b); }

.wake-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
  font-size: .81rem;
  color: #315d50;
}
#wake-hint[data-route="rescue"], #wake-hint[data-route="return"] {
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
  background: #f2ffedbf;
  color: #1d6169;
}
#wake-hint[data-route="return"] { background: #fcf2fbc9; color: #794584; }
#wake-hint[data-route="bubble"] {
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
  background: #eef5ffc9;
  color: #3a5894;
}
#tail-swimmer[hidden] { display: none; }

.bonus-options {
  position: absolute;
  inset: 8% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse,#fffde6,#bde3e4ab 58%,#abe2ee00 75%);
}
.bonus-options[hidden],.tail-buttons > button[hidden] { display: none; }
.bonus-options button {
  position: absolute;
  top: calc(47% + var(--lift,0px));
  left: calc(20% + var(--spot) * 30%);
  transform: translate(-50%,-50%);
  transition: left .25s ease, top .18s ease;
  width: clamp(55px,18vw,77px);
  aspect-ratio: 1;
  padding: 0;
  display: grid;
  place-items: center;
  background: #fffcee;
  border: 2px solid #fffbea;
  color: #335b51;
  box-shadow: 0 5px 16px #34726a38;
}
.bonus-options button b { position: absolute; bottom: 5px; font-size: .82rem; }
.bonus-options button > span { display: block; width: 50%; height: 42%; margin-bottom: 8px; }
.bonus-options[data-game="pearl"] button > span {
  border-radius: 62% 62% 36% 36%;
  background: repeating-conic-gradient(from -77deg at 50% 100%, #dfa58a 0deg 9deg,#fbdcc6 9deg 20deg);
  clip-path: polygon(49% 100%,0 52%,4% 16%,29% 2%,70% 2%,96% 16%,100% 52%);
}
.bonus-options[data-game="pearl"] .marked > span {
  background: radial-gradient(circle at 51% 61%,#fffef8 0 5px,#c9bde8 6px 7px,#d4937e 8px 11px, #edba9e 13px);
}
.bonus-options[data-game="lantern"] button > span {
  border: 1px solid #7a948c;
  border-radius: 27% 27% 36% 36%;
  background: #acbdb3;
}
.bonus-options[data-game="lantern"] .marked {
  background: #fff1a6;
  border-color: #fffce8;
  box-shadow: 0 0 0 6px #fff2a45c,0 0 20px #e9bb67ba;
}
.bonus-options[data-game="lantern"] .marked > span { background: #efaa50; border-color: #b57533; }
@media (prefers-reduced-motion: reduce) { .bonus-options button { transition: none; } }

/* Pair puzzle on the pond surface */
.scene-pair {
  width: min(calc(100% - 28px - var(--safe-side) * 2),444px);
  --scene-width: 544px;
  --school-water-height: clamp(249px,35.5svh,348px);
  padding: calc(clamp(18px,3.15svh,30px) + env(safe-area-inset-top,0px)) 0 calc(14px + env(safe-area-inset-bottom,0px));
  --pond-ink: #203e35;
  --pond-quiet: #3c5e4f;
}
.scene-pair::before {
  background: linear-gradient(180deg,#f8f3e43d,transparent 24%,transparent 61%,#f7f1e1ae 83%,#f8f2e2f2),
    #c5e5da url('assets/pair-watercolor-bank.jpg') center / cover no-repeat;
}
@media (min-width: 600px) {
  .scene-pair::before { mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); }
}
.pair-title {
  position: relative;
  padding: clamp(11px,1.8svh,18px) clamp(8px,3.3vw,18px) 0;
  color: var(--pond-ink);
  text-shadow: 0 1px 8px #fffaecb3;
}
.pair-stage-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.pair-title h2 {
  font-size: clamp(2rem,9.2vw,2.75rem);
  line-height: 1.13;
  letter-spacing: .16em;
  font-weight: 650;
  margin-block: 0 6px;
}
.pair-title .pair-mode {
  color: var(--pond-quiet);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .095em;
}
.pair-title .pair-mode::after { content: ""; width: 19px; border-top: 1px solid #758b6e72; }
.pair-prize-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #234e42;
  font-weight: 450;
  letter-spacing: .02em;
  text-shadow: 0 0 7px #fff5dd;
}
.pair-prize-preview .pair-painted-fish { --painted-size: 28px; }
.pair-water {
  position: relative;
  height: clamp(258px, 38svh, 375px);
  isolation: isolate;
  margin: 6px 0 0;
}
.pair-water::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% 4% 16%;
  border-radius: 47%;
  background: radial-gradient(ellipse,#fffdf137,transparent 66%);
  border-bottom: 1px solid #effde257;
  transform: rotate(-10deg);
}
.pair-pool {
  --size: clamp(62px, 21vw, 115px);
  --drift: 6px;
  position: absolute;
  isolation: isolate;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: calc(var(--size)*1.06);
  padding: 0;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
}
.scene-pair button.pair-pool {
  border: 0;
  border-radius: 35% 45%;
  background: transparent;
  box-shadow: none;
}
.scene-pair button.pair-pool:hover { filter: none; }
.pair-pool[data-pile="0"] { --x: 13%; --y: 31%; --tilt: -12deg; }
.pair-pool[data-pile="1"] { --x: 38%; --y: 17%; --tilt: 9deg; }
.pair-pool[data-pile="2"] { --x: 64%; --y: 34%; --tilt: -6deg; }
.pair-pool[data-pile="3"] { --x: 87%; --y: 16%; --tilt: 12deg; }
.pair-pool[data-pile="4"] { --x: 15%; --y: 76%; --tilt: 5deg; }
.pair-pool[data-pile="5"] { --x: 40%; --y: 62%; --tilt: -9deg; }
.pair-pool[data-pile="6"] { --x: 66%; --y: 84%; --tilt: 9deg; }
.pair-pool[data-pile="7"] { --x: 87%; --y: 63%; --tilt: -10deg; }
.pair-pool:nth-child(even) { --drift: -6px; }

.pair-school {
  position: absolute;
  width: 79%;
  height: 31%;
}
.pair-school[data-school="0"] { top: 3%; left: 4%; --flow-angle: -9deg; }
.pair-school[data-school="1"] { top: 34%; right: 3%; --flow-angle: 12deg; }
.pair-school[data-school="2"] { top: 66%; left: 9%; width: 67%; --flow-angle: -13deg; }
.pair-school .pair-pool { --size: clamp(56px,18vw,90px); }
.pair-school .pair-pool[data-seat="0"] { --x: 17%; --y: 37%; }
.pair-school .pair-pool[data-seat="1"] { --x: 49%; --y: 65%; }
.pair-school .pair-pool[data-seat="2"] { --x: 84%; --y: 42%; }
.pair-school[data-school="1"] .pair-pool[data-seat="1"] { --y: 32%; }
.pair-school[data-school="1"] .pair-pool[data-seat="2"] { --y: 62%; }
.pair-school[data-school="2"] .pair-pool[data-seat="0"] { --x: 26%; --y: 38%; }
.pair-school[data-school="2"] .pair-pool[data-seat="1"] { --x: 75%; --y: 56%; }
.pair-school-current {
  position: absolute;
  inset: 6% 1% 0;
  border-radius: 49% 45% 52% 47%;
  border-bottom: 1.5px solid #f9fff3aa;
  background: radial-gradient(ellipse at 56% 49%,#b8e9d748,#b8e9d720 57%,transparent 73%);
  box-shadow: 0 5px 8px #42968b12;
  transform: rotate(var(--flow-angle));
  pointer-events: none;
}
.pair-school-current::after {
  content: "";
  position: absolute;
  inset: 9% 13% 11%;
  border-radius: 50%;
  border-bottom: 1px solid #eaffe96e;
}
.pair-school-turning .pair-school-current {
  animation: pair-school-sweep .62s ease-out;
}
@keyframes pair-school-sweep {
  0% { transform: rotate(var(--flow-angle)) scale(.86); box-shadow: 0 2px 12px #f1ffef; }
  54% { transform: rotate(calc(var(--flow-angle) + 8deg)) scale(1.04); }
  100% { transform: rotate(var(--flow-angle)) scale(1); }
}
.pair-covered { pointer-events: none; }
.pair-cover-wake {
  width: 74%;
  height: 43%;
  border: 1px solid #e7f5e5b0;
  border-radius: 50%;
  background: radial-gradient(ellipse,#4f8b8770 0%,#5a969139 51%,transparent 73%);
  box-shadow: 0 4px 10px #337b7021;
  transform: rotate(var(--tilt));
}
.pair-cover-wake::before {
  content: "";
  position: absolute;
  inset: 28% 17%;
  border-radius: 50%;
  border-bottom: 1px solid #effde3bd;
}
.pair-cover-wake::after {
  content: "";
  position: absolute;
  inset: 31% 15% 35%;
  background: var(--shadow-tint,#346e765c);
  clip-path: polygon(0 50%,26% 12%,64% 32%,95% 9%,85% 50%,95% 91%,64% 68%,26% 88%);
}

.pair-underwater {
  position: absolute;
  z-index: 0;
  width: 46%;
  height: 28%;
  top: 64%;
  left: 33%;
  pointer-events: none;
}
.pair-underwater::before,.pair-underwater::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.pair-underwater::before {
  inset: 26% 15% 31%;
  background: var(--shadow-tint,#397c8595);
  clip-path: polygon(3% 50%,15% 25%,43% 12%,66% 32%,96% 10%,88% 50%,96% 88%,66% 68%,43% 88%,15% 75%);
  opacity: .7;
  animation: pair-under-current 2.9s ease-in-out infinite alternate;
  animation-delay: var(--pond-phase,0s);
}
.pair-shadow-warm { --shadow-tint: #b877568f; }
.pair-shadow-cool { --shadow-tint: #397c859c; }
.pair-pool:nth-child(even) .pair-underwater { left: 20%; }
.pair-pool:nth-child(even) .pair-underwater::before { animation-delay: calc(var(--pond-phase,0s) - 1.1s); }
.pair-underwater::after {
  inset: 14% 4% 6%;
  border-radius: 50%;
  border-bottom: 1px solid #f5ffe681;
  transform: rotate(var(--tilt));
}
@keyframes pair-under-current {
  from { transform: translate(-5px,2px) scale(.85,.62); opacity: .55; }
  to { transform: translate(6px,-2px) scale(1.1,.87); opacity: .78; }
}
.pair-mouth {
  position: absolute;
  z-index: 0;
  inset: 49% 16% 20%;
  pointer-events: none;
}
.pair-mouth::before,.pair-mouth::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid #f8fff1;
  animation: pair-mouth-wave .66s ease-out both;
}
.pair-mouth::after { animation-delay: .105s; }
@keyframes pair-mouth-wave {
  0% { opacity: .96; transform: scale(.27,.4); }
  40% { opacity: .73; }
  100% { opacity: 0; transform: scale(1.35,1.48); }
}
.pair-specimen,.pair-loiter,.pair-slot { display: grid; place-items: center; }
.pair-specimen {
  position: absolute;
  inset: 24% 0 25%;
  z-index: 1;
  filter: drop-shadow(0 4px 2px #20595135);
}
.pair-painted-fish {
  width: var(--painted-size,clamp(62px,17.5vw,90px));
  aspect-ratio: 4/3;
  display: block;
  background: var(--fish-art) center / contain no-repeat;
  pointer-events: none;
}
[data-fish="paper"] { --fish-art: url('assets/pair-fish/paper.png'); }
[data-fish="amber"] { --fish-art: url('assets/pair-fish/amber.png'); }
[data-fish="rain"] { --fish-art: url('assets/pair-fish/rain.png'); }
[data-fish="puffer"] { --fish-art: url('assets/pair-fish/puffer.png'); }
[data-fish="loach"] { --fish-art: url('assets/pair-fish/loach.png'); }
[data-fish="reed"] { --fish-art: url('assets/pair-fish/reed.png'); }
[data-fish="moon"] { --fish-art: url('assets/pair-fish/moon.png'); }
[data-fish="crescent"] { --fish-art: url('assets/crescent-portrait.png'); }
[data-fish="fan"] { --fish-art: url('assets/pair-fish/fan.png'); }
[data-fish="bell"] { --fish-art: url('assets/pair-fish/bell.png'); }
.pair-loiter {
  animation: pair-loiter 2.9s ease-in-out infinite alternate;
  animation-delay: var(--pond-phase,0s);
}
.pair-pool:nth-child(even) .pair-loiter { animation-delay: calc(var(--pond-phase,0s) - 1.4s); }
@keyframes pair-loiter { to { transform: translate(var(--drift),4px) rotate(4deg); } }
.pair-pool:disabled .pair-specimen { opacity: .57; }
.pair-pool.just-revealed .pair-specimen { animation: pair-emerge .61s .09s both; }
.pair-pool.just-revealed .pair-loiter { animation-delay: .70s; }
@keyframes pair-emerge {
  0% {
    transform: translate(var(--rise-x,11px),69%) rotate(-8deg) scale(.56,.6);
    opacity: .51;
    filter: saturate(.73) blur(.8px);
    animation-timing-function: cubic-bezier(.4,.06,.33,1);
  }
  64% { transform: translate(-2px,-4%) rotate(4deg) scale(1.016); opacity: .99; }
  100% { transform: translate(0,0) scale(1); }
}
.pair-pool:nth-child(even) { --rise-x: -7px; }
@keyframes pair-surface {
  0% { transform: translateY(12px) scale(.68); opacity: 0; }
  58% { transform: translateY(-2px) scale(1.04); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .pair-loiter,.pair-underwater::before,.pair-pool.just-revealed .pair-specimen,
  .pair-mouth::before,.pair-mouth::after,
  .pair-school-turning .pair-school-current { animation: none; }
  .pair-mouth { display: none; }
}

.pair-bay {
  position: relative;
  isolation: isolate;
  z-index: 1;
  margin-block: 5px 0;
  padding: 13px 11px 22px;
  text-align: center;
}
.pair-bay::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -83px -13px -7px;
  background: url('assets/pair-foreground-cove.png') center bottom / 100% 100% no-repeat;
  pointer-events: none;
}
.pair-bay-title { display: flex; gap: 9px; align-items: baseline; justify-content: center; margin-bottom: 7px; text-shadow: 0 0 7px #fffbee; }
.pair-bay-title h3 { font-size: 1.04rem; letter-spacing: .1em; }
.pair-bay-title span { font-size: .77rem; color: #214c42; font-variant-numeric: tabular-nums; }
.pair-slots {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  width: min(91%, 386px);
  gap: clamp(4px,1.4vw,8px);
  margin-inline: auto;
  padding: 0 2px 6px;
}
.pair-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #f5fff1b5;
  border-radius: 53% 47% 50% 49%;
  background: radial-gradient(ellipse at 43% 60%,#e2fff04f,#286a648a);
  box-shadow: inset 0 1px 5px #256a666e,0 2px 0 #e6fff383;
}
.pair-slot:nth-child(2),.pair-slot:nth-child(5) { margin-top: 3px; }
.pair-slot:nth-child(3),.pair-slot:nth-child(4) { margin-top: 6px; }
.pair-slot-filled { background: radial-gradient(ellipse at 44% 70%,#eefff2a8,#65a79abd); }
.pair-slot .pair-painted-fish { --painted-size: 97%; }
.pair-hint {
  min-height: 1.83rem;
  font-size: .82rem;
  font-weight: 450;
  margin-top: 7px;
  color: #163d34;
  text-shadow: 0 0 7px #fffbe7;
}
.pair-result h3 { font-size: clamp(1rem,4vw,1.34rem); }
.pair-result .buttons { justify-content: center; margin-top: 9px; }
.scene-pair .pair-stage-controls :is(.pair-revisit,.pair-sound) {
  min-height: 44px;
  min-width: 44px;
  padding: 4px clamp(6px,2vw,12px);
  font-size: .74rem;
  letter-spacing: .055em;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.scene-pair .pair-stage-controls :is(.pair-revisit,.pair-sound):hover { background: #fbf4dc91; }
.pair-picked .pair-specimen { visibility: hidden; }
.pair-water[aria-busy="true"] .pair-pool { cursor: wait; }
.pair-combo {
  position: absolute;
  right: 5%;
  top: -10px;
  padding: 3px 9px;
  border: 1px solid #fff9e6;
  border-radius: 2rem;
  background: #fff0b7;
  color: #64512b;
  font-size: .78rem;
  font-weight: 740;
  animation: pair-surface .3s ease-out both;
}
.pair-flight-layer {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.pair-flight-fish,.pair-splash {
  position: absolute;
  width: 0;
  height: 0;
  display: grid;
  place-items: center;
}
.pair-flight-fish .pair-painted-fish {
  position: absolute;
  --painted-size: var(--flight-size);
}
.pair-splash::before,.pair-splash::after {
  content: "";
  position: absolute;
  width: 44px;
  height: 29px;
  border: 2px solid #ffffec;
  border-radius: 50%;
}
.pair-splash::after { width: 30px; height: 19px; border-width: 1px; }
.pair-splash.paired::before,.pair-splash.paired::after { border-color: #fff2ab; }
.pair-splash i {
  position: absolute;
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: #fffef0;
  transform: rotate(var(--ray)) translateY(-26px);
}
.pair-splash.paired i { background: #ffed9f; }

.pair-companions {
  position: relative;
  z-index: 1;
  margin: 12px auto 0;
  width: min(100%,450px);
}
.pair-companion,.pair-prize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}
.pair-companion {
  border-top: 1px solid #52765e45;
  padding: 5px 8px;
}
.pair-companion p,.pair-guide-picker,.pair-prize-preview { font-size: .8rem; }
.pair-prize-preview { white-space: nowrap; }
.pair-companion button,.pair-prize button { min-height: 34px; padding: 4px 10px; font-size: .8rem; }
.pair-companion .specimen { width: 44px; height: 30px; }
.pair-companion .model { --size: 44px; }
.pair-companion .paper-fish { --paper-size: 43px; }
.pair-guide-picker { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; }
.pair-guide-picker select {
  font: inherit;
  color: #315f53;
  border: 1px solid #ffffef;
  border-radius: 20px;
  background: #f8fbea;
  padding: 3px 8px;
  max-width: 62%;
}
.pair-peek-mode .pair-pool:enabled .pair-underwater {
  border-radius: 50%;
  background: #5caeb164;
  box-shadow: 0 0 10px #c3ffff;
}
.pair-peek-glimpse {
  position: absolute;
  right: 4%;
  top: 20%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #fefff3;
  background: #edffffdb;
  box-shadow: 0 0 12px #cffcff;
  animation: pair-surface .32s ease-out both;
}
.pair-prize { margin-top: 10px; }
.pair-prize .pair-painted-fish { --painted-size: 44px; }

.pair-flight-body {
  position: absolute;
  display: grid;
  place-items: center;
  width: 0;
  height: 0;
}
.pair-joined-wake {
  position: absolute;
  display: grid;
  place-items: center;
  width: 0;
  height: 0;
  color: #fbfff4;
}
.pair-joined-wake::before,.pair-joined-wake::after {
  content: "";
  position: absolute;
  width: 49px;
  height: 19px;
  border-radius: 50%;
  border-bottom: 2px solid currentColor;
  filter: drop-shadow(0 1px 2px #3e8c8755);
  transform: translate(0,6px) rotate(-8deg);
}
.pair-joined-wake::after {
  width: 36px;
  height: 12px;
  transform: translate(3px,14px) rotate(8deg);
}
.pair-joined-wake.strong { color: #fff5b6; }
.pair-joined-wake.strong::before { filter: drop-shadow(0 0 4px #ffe986); }
.pair-combo.strong {
  background: linear-gradient(110deg,#fffad2,#ffe3a0);
  box-shadow: 0 0 0 3px #f8f5c25c,0 2px 12px #ce9c514f;
}
.scene-pair .pair-water { height: clamp(240px,35svh,360px); }
@media (max-width:350px) { .scene-pair .pair-water { height: 232px; } }
.scene-pair .pair-school-water { height: var(--school-water-height); }
@media (max-height: 700px) and (max-width: 600px) {
  .scene-pair { --school-water-height: clamp(220px,36svh,249px); }
  .pair-bay { padding-bottom: 16px; }
}
.pair-deep-water .pair-pool .pair-peek-glimpse { top: 78%; left: 62%; }

.pair-title h2:focus { outline: none; }

.scene-pair .pair-intro-water { height: clamp(185px,30svh,260px); }
.pair-intro-water .pair-pool[data-pile="0"] { --x: 31%; --y: 57%; --drift: 6px; }
.pair-intro-water .pair-pool[data-pile="1"] { --x: 69%; --y: 45%; --drift: -6px; }
.pair-intro-water .pair-painted-fish { --painted-size: clamp(86px,25vw,124px); }

.pair-pool.just-revealed .pair-underwater {
  animation: pair-shadow-replace .54s .39s ease-out both;
}
@keyframes pair-shadow-replace {
  from { opacity: 0; transform: translate(12px,8px) scale(.74,.55); filter: blur(1.6px); }
  to { opacity: 1; transform: translate(0,0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pair-pool.just-revealed .pair-underwater { animation: none; }
}

.pair-bay-lost .pair-slot {
  border-color: #be795f;
  background: #f6d8be;
}
.pair-loss-overlay {
  background: #183d3a83;
}
.pair-loss {
  width: min(100%, 320px);
  padding: 25px 21px 20px;
  text-align: center;
  border-color: #fff8e7;
  border-radius: 23px;
  box-shadow: 0 15px 48px #13393345;
  animation: pair-loss-in .19s ease-out both;
}
.pair-loss p {
  margin-top: 8px;
  color: #654f3d;
}
.pair-loss .pair-loss-replay {
  width: 100%;
  min-height: 53px;
  border-radius: 999px;
  font-size: 1.15rem;
  background: #236752;
  color: #fffaf0;
  box-shadow: 0 4px 14px #2367524a;
}
@keyframes pair-loss-in {
  from { opacity: .35; transform: translateY(6px) scale(.97); }
}

.pair-splash.paired::before {
  border-color: #fff7b6;
  border-width: 3px;
  box-shadow: 0 0 14px #ffe598a6;
}
.pair-splash.paired::after { border-color: #f7ffeb; }
.pair-splash.paired i {
  width: 5px;
  height: 8px;
  background: linear-gradient(#fffff6,#ffdeb2);
}
.pair-match-pop {
  position: absolute;
  padding: 3px 9px;
  border: 1px solid #fffae7;
  border-radius: 999px;
  background: #fff2b8;
  color: #543c29;
  font-weight: 800;
  font-size: .92rem;
  white-space: nowrap;
  box-shadow: 0 3px 8px #46736647;
}

/* The shared shoreline, from the playable bay to the paper fishbook. */
:root { --bay-water-art: url('assets/clear-water.jpg'); }
.scene-pair,.scene-pond,.scene-dock,.scene-book {
  --scene-width: 590px;
  width: min(calc(100% - 26px - var(--safe-side) * 2),444px);
  color: #183f37;
}
.scene-pair::before,.scene-pond::before,.scene-dock::before,.scene-book::before {
  background: linear-gradient(180deg,#fff9e7a6 0%,#fff9e755 13%,transparent 26% 84%,#fff9e892),
    #92cabe var(--bay-water-art) center / cover no-repeat;
}
@media (min-width: 600px) {
  .scene-pond::before,.scene-dock::before,.scene-book::before { mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); }
}
.scene-pair::after,.scene-pond::after,.scene-dock::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 14% 0 12%;
  width: min(100%,var(--scene-width));
  margin-inline: auto;
  pointer-events: none;
  background:
    radial-gradient(ellipse 14% 2% at 31% 18%,#ffffd64d,transparent),
    radial-gradient(ellipse 20% 4% at 77% 56%,#b8f6ed50,transparent),
    radial-gradient(ellipse 20% 3% at 23% 75%,#fff9c63f,transparent);
  animation: bay-water-light 7s ease-in-out infinite alternate;
}
@keyframes bay-water-light {
  from { opacity: .18; transform: translateY(-6px); }
  to { opacity: .78; transform: translateY(7px); }
}
.scene-pair { --school-water-height: clamp(260px,43svh,410px); }
.scene-pair .pair-intro-water { height: clamp(200px,37svh,335px); }
.pair-title { padding-top: 5px; }
.pair-title h2 { letter-spacing: .08em; font-size: clamp(1.9rem,8.2vw,2.65rem); }
.scene-pair .pair-water::before { content: none; }
.pair-school:not(.pair-school-turning) .pair-school-current {
  background: none;
  opacity: .45;
}
.pair-underwater::after { border-color: #efffe34d; }
.pair-specimen { filter: drop-shadow(0 6px 3px #174b5466) drop-shadow(0 1px 1px #ecfff785); }
@media (min-width: 360px) {
  .pair-school .pair-painted-fish { --painted-size: clamp(68px,19.4vw,98px); }
}
.pair-bay::before {
  inset: -12px -5px -9px;
  border-radius: 48% 52% 34% 42% / 29% 32% 25% 27%;
  background: radial-gradient(ellipse at 50% 32%,#def4e43d,transparent 72%);
}
.pair-slot {
  border: 1px solid #e9fff69c;
  background: radial-gradient(ellipse at 46% 40%,#dfefde16 45%,#a4ead278 89%,#f1fff599);
  box-shadow: inset 0 -2px 0 #ffffdca0,0 2px 4px #163d4b5c;
}
.pair-slot::after {
  content: "";
  position: absolute;
  inset: 17% 10% 18%;
  border-radius: 50%;
  border-top: 1px solid #e1fff48c;
  transform: rotate(-18deg);
  pointer-events: none;
}
.pair-water:empty { height: 80px; }
.scene-pair:has(.pair-result) .pair-water:not(.pair-intro-water) { height: clamp(75px,21svh,190px); }
.pair-result {
  margin: 9px auto 0;
  padding: 14px 12px;
  border-radius: 49% 38% 32% 27% / 14% 12% 18% 13%;
  background: #fffae7d9;
}
.pair-prize { margin-top: 2px; gap: 4px; }
.pair-prize .fish-portrait { --portrait-width: 69px; }

.waterfront-nav {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 2px;
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: env(safe-area-inset-bottom,0px);
  transform: translateX(-50%);
  width: min(calc(100% - 28px - var(--safe-side) * 2),416px);
  margin: 0;
  padding: 5px 0;
  background: linear-gradient(90deg,transparent,#f8f7e5f2 15% 85%,transparent);
  border-radius: 45%;
}
.scene-pair .waterfront-nav {
  position: static;
  transform: none;
  width: 100%;
  grid-template-columns: repeat(3,minmax(0,1fr));
  margin-top: 10px;
}
.waterfront-nav button {
  color: #21493d;
  min-height: 44px;
  font-family: "Songti SC","Noto Serif CJK SC",serif;
  font-size: .93rem;
  letter-spacing: .06em;
}
.waterfront-nav [aria-current] {
  background: #d9f0e3bd;
  box-shadow: inset 0 -2px 0 #ffffe8;
}
.bay-scene > .waterfront-title {
  position: relative;
  display: grid;
  gap: 3px;
  justify-content: center;
  text-align: center;
  padding: 5px 48px;
}
.waterfront-title h1,.waterfront-title p { text-shadow: 0 1px 7px #ffffeb; }
.waterfront-title h1:focus { outline: none; }
.waterfront-title p { font-size: .8rem; font-weight: 650; }
.waterfront-title button {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  min-height: 44px;
  padding: 0 0 4px;
  color: var(--ink);
  background: #fff9e9c9;
  font-size: 1.65rem;
  line-height: 1;
}
button.water-action,button.water-text { min-height: 44px; padding: 7px 16px; border-radius: 53% 47% 43% 48% / 54% 47% 48% 43%; }
button.water-action { color: #fbfff0; background: #245d50; border: 1px solid #effce9; }
button.water-text { color: var(--ink); background: #fff9e8b0; }

.fish-portrait {
  display: block;
  position: relative;
  flex: none;
  width: var(--portrait-width,128px);
  max-width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--fish-art) center / contain no-repeat;
  filter: drop-shadow(0 4px 4px #245a5435);
  pointer-events: none;
}
.portrait-fry { scale: .68; }
.portrait-juvenile { scale: .9; }
.fish-portrait.portrait-adult[data-fish="crescent"] { --fish-art: url('assets/crescent-adult-opal.png'); }
.portrait-lit { filter: drop-shadow(0 0 5px #eafbff) drop-shadow(0 0 13px #acbdf096); }
.portrait-lit::after {
  content: "";
  position: absolute;
  inset: 0;
  mask: var(--fish-art) center / contain no-repeat;
  background: linear-gradient(164deg,transparent 31%,#e1eeff46 42%,#fffdebdf 50%,#c1effb62 57%,transparent 69%)
    center 112% / 100% 240% no-repeat;
  animation: waterfront-fin-light 4s linear infinite;
}
@keyframes waterfront-fin-light {
  0%,8% { background-position:center 112%; }
  56%,100% { background-position:center -12%; }
}

.scene-pond .pond-waterfront {
  display: grid;
  grid-template: 1fr / 1fr;
  height: clamp(224px,48svh,420px);
  padding: 0;
  overflow: hidden;
}
.scene-pond .pond-waterfront .ripples { opacity: .18; }
.pond-watercare {
  padding: 6px 0 8px;
  border-radius: 45%;
  background: radial-gradient(ellipse,#eef9dfb5,transparent 70%);
}
.pond-waterfront .fish-hit { grid-area: 1 / 1; }
.pond-waterfront .fish-hit .paper-fish { --paper-size: clamp(149px,57cqw,255px); }
.pond-waterfront .fish-hit .fish-portrait { --portrait-width: clamp(160px,67cqw,270px); }
.pond-waterfront .swim-path:has(.fish-portrait) { animation: watercolor-patrol 13s ease-in-out infinite alternate; }
@keyframes watercolor-patrol {
  from { transform: translate(12cqw,-14px) rotate(-4deg); }
  to { transform: translate(-12cqw,19px) rotate(4deg); }
}
.pond-waterfront .pond-hint {
  position: absolute;
  z-index: 2;
  bottom: 8%;
  border-radius: 18px;
  padding: 6px 12px;
  background: #fff9e8e8;
  pointer-events: none;
}
.pond-waterfront .pond-neighbor {
  position: absolute;
  top: 4%;
  right: 3%;
  z-index: 2;
  --portrait-width: 96px;
  padding: 0;
  background: transparent;
}
.pond-waterfront .pond-neighbor:nth-of-type(2) { top: auto; bottom: 0; left: 2%; right: auto; }
.pond-watercare,.dock-invite { text-align: center; }
.pond-watercare p,.dock-invite p { font-size: .8rem; text-shadow: 0 1px 5px #fffbe8; }
.pond-watercare button,.dock-invite button { margin-top: 6px; }
.pond-roster { display: flex; gap: 8px; padding: 10px 3px 4px; overflow-x: auto; }
.pond-roster-fish {
  display: grid;
  place-items: center;
  padding: 3px 7px;
  --portrait-width: 57px;
  background: #fcfae67d;
  color: var(--ink);
  font-size: .72rem;
  white-space: nowrap;
}
.pond-roster-fish[aria-pressed="true"] { background: #feffef; }
.pond-extras { margin: 8px 4px 0; }
.pond-extras summary { cursor: pointer; padding: 10px 2px; min-height: 44px; font-size: .85rem; }

.dock-water {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: center;
  isolation: isolate;
  position: relative;
  min-height: clamp(300px,57svh,478px);
  padding: min(10svh,86px) 2% 6px;
}
.dock-water::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: -2%;
  width: 58%;
  height: 45%;
  background: url('assets/pair-shore/dock.png') top right / contain no-repeat;
  pointer-events: none;
}
.dock-guest {
  --portrait-width: clamp(110px,35vw,155px);
  position: relative;
  display: grid;
  justify-items: center;
  padding: 0 4px 5px;
  background: transparent;
  color: var(--ink);
}
.dock-water .dock-guest:disabled { background: none; min-height: 96px; }
.dock-guest:nth-child(even) { margin-top: 21px; }
.dock-tag {
  display: grid;
  justify-items: center;
  padding: 3px 10px;
  border-radius: 57% 46% 50% 45% / 38% 37% 44% 47%;
  background: #fffae6e0;
  font-size: .77rem;
}
.dock-guest[aria-pressed="true"] .dock-tag { box-shadow: 0 0 0 2px #2b7968,0 0 0 4px #f3ffdcbd; }
.dock-invite { min-height: 65px; }

.book-preview-entry { display: flex; justify-content: center; margin-top: 5px; }
.book-preview-entry button { font-size: .83rem; }
.fishbook {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: clamp(6px,2vw,12px);
  margin-top: 13px;
  padding: clamp(13px,4vw,22px);
  border: 2px solid #e8dcb8;
  border-radius: 12px 21px 15px 12px;
  background: linear-gradient(90deg,#d6c29c 0%,#fff9e6 4%,#faf2dc 97%,#e0cca3);
  box-shadow: 0 3px #cdbc90,0 6px #e6d2a5,0 10px 22px #234f3d39;
}
.book-print,.scene-book button.book-print {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  min-height: 82px;
  padding: 4px;
  border: 1px solid #a1b9a789;
  border-radius: 8px 12px 8px 9px;
  color: var(--ink);
  font-size: .86rem;
  background: linear-gradient(140deg,#f6f3d7,#d8eadbb5);
}
.book-print .fish-portrait,.book-print .pair-painted-fish { width: min(100%,106px); }
.scene-book button.book-print[aria-pressed="true"] { outline: 2px solid #317365; outline-offset: 2px; }
.book-unknown { background: #f8f3df; }
.book-unknown .pair-painted-fish { filter: brightness(0) saturate(100%) invert(40%) sepia(15%) saturate(700%) hue-rotate(103deg); opacity: .47; }
.book-specimens { margin-top: 22px; padding: 13px; background: #fff9e8ed; border-radius: 10px; }
.book-fish { display: grid; grid-template-columns: minmax(60px,1fr) minmax(0,2fr); align-items: center; gap: 8px; margin-block: 10px; }
.book-fish p { font-size: .79rem; overflow-wrap: anywhere; }
.book-fish form,.book-fish button { margin-top: 5px; }

.fishcard-overlay {
  z-index: 5;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top,0px)) 15px calc(12px + env(safe-area-inset-bottom,0px));
  background: #153e35b5;
}
.fishcard-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  width: min(100%,590px);
  margin-inline: auto;
  background: linear-gradient(180deg,#102d3bbf,#123f4645 37% 74%,#163a3f98),
    var(--bay-water-art) center / cover no-repeat;
  filter: blur(1.5px);
  pointer-events: none;
}
.fishcard-dialog {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(8px,2svh,18px);
  width: min(100%,365px);
  text-align: center;
  color: #fff9e7;
}
.fishcard-kicker { letter-spacing: .23em; font-size: 1rem; text-shadow: 0 2px 7px #143731; }
.fishcard-stage {
  position: relative;
  isolation: isolate;
  perspective: 900px;
  width: min(76vw,calc(57svh * .72),300px);
  aspect-ratio: .72;
  touch-action: pan-y;
}
.fishcard-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 84% -23% -5%;
  border-radius: 50%;
  border: 1.5px solid #f0ffdfae;
  box-shadow: 0 2px 0 5px #efffde28,0 8px 9px 9px #d8fbe42e;
  animation: fishcard-water 1.5s ease-out both;
}
@keyframes fishcard-water {
  from { scale: .5 .65; opacity: 0; }
  70% { opacity: 1; }
}
.fishcard-tilt,.fishcard-turn {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.fishcard-tilt {
  transform: rotateX(calc(var(--card-y,0) * -12deg)) rotateY(calc(var(--card-x,0) * 15deg));
  transition: transform .2s ease-out;
}
.fishcard-turn {
  transform: rotateY(180deg);
  animation: fishcard-flip 1.16s cubic-bezier(.28,.68,.25,1) both;
}
.fishcard-turn::before,.fishcard-turn::after {
  content: "";
  position: absolute;
  inset: 2% auto 2% -4px;
  width: 8px;
  border-radius: 40%;
  background: linear-gradient(90deg,#1a3b42,#73908a 18%,#ddd2a7 43%,#a6bbb1 54%,#334f51 81%,#112f3b);
  transform: rotateY(90deg);
}
.fishcard-turn::after { inset-inline: auto -4px; }
.fishcard-edges { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.fishcard-edges::before,.fishcard-edges::after {
  content: "";
  position: absolute;
  inset: -4px 3% auto;
  height: 8px;
  border-radius: 35%;
  transform: rotateX(90deg);
  background: linear-gradient(#133543,#537475 24%,#dce3c2 48%,#9a9469 67%,#1a3943);
}
.fishcard-edges::after { inset-block: auto -4px; }
.fishcard-back,.fishcard-front {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  border-radius: 7% / 5%;
  box-shadow: 0 14px 27px #081d2cb0,0 2px 3px #071f29;
}
.fishcard-back {
  transform: translateZ(4px);
  visibility: hidden;
  animation: fishcard-back-face 1.16s steps(1,end) both;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%,#558b7982,transparent 46%),
    repeating-radial-gradient(ellipse at 50% 50%,#83adb012 0 1px,transparent 2px 15px),
    #133746 url('assets/fishcard-moonpool.jpg') 50% 10% / 185% auto;
  background-blend-mode: normal,screen,multiply;
}
.fishcard-back i {
  position: relative;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #b7c2a185;
  box-shadow: 0 0 0 5px #c8d5be20,0 0 0 11px #aed5be30;
}
.fishcard-back i::before,.fishcard-back i::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.fishcard-back i::before {
  inset: 15% 15% 16% 15%;
  border-left: 5px double #d8d7b8;
  border-bottom: 4px double #c2ae78;
  transform: rotate(-24deg);
}
.fishcard-back i::after {
  top: 27%;
  left: 52%;
  width: 18%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 34% 27%,#fffef0,#b1d5c4 52%,#697b78);
  box-shadow: 0 0 8px #c7e4ba75;
}
.fishcard-front {
  transform: rotateY(180deg) translateZ(4px);
  animation: fishcard-front-face 1.16s steps(1,end) both;
  grid-template-rows: minmax(0,1fr) auto;
  align-content: stretch;
  isolation: isolate;
  padding: 9% 5% 11%;
  background: #0d2838;
  color: #faefcb;
}
.fishcard-window {
  position: absolute;
  inset: 6%;
  overflow: hidden;
  border-radius: 5% / 4%;
  background: #102b42;
  box-shadow: inset 0 2px 18px #071a2f;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center,#000 48%,#000b 85%,#0006);
}
.fishcard-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 5px 11px #061a2aab,inset -3px 1px 8px #12283aab,inset 0 -2px 3px #b1e6dc55;
}
.fishcard-depth {
  position: absolute;
  inset: -6%;
  background:
    linear-gradient(180deg,#0b223000 12%,#12264204 49%,#0e263bbb 78%,#071b2eea),
    url('assets/fishcard-moonpool.jpg') center / cover no-repeat;
  translate: calc(var(--card-x,0) * -8px) calc(var(--card-y,0) * -7px);
  animation: fishcard-depth-arrive 1.9s .35s ease-out both;
}
@keyframes fishcard-depth-arrive {
  from { transform: scale(1.02) translate(2%,2%); }
  to { transform: scale(1.24) translate(-2%,-3%); }
}
.fishcard-meteors-far,.fishcard-meteors-near {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fishcard-meteors-far {
  z-index: 1;
  inset-block-end: 16%;
  overflow: hidden;
}
.fishcard-meteors-near {
  z-index: 7;
  inset: 5% -11% 11%;
}
.fishcard-meteor {
  position: absolute;
  left: var(--meteor-x);
  top: var(--meteor-y);
  width: var(--meteor-size,26%);
  height: 2px;
  opacity: 0;
  transform-origin: 100% 50%;
  animation: fishcard-meteor-flight var(--meteor-duration,4.8s) var(--meteor-delay) linear both;
}
.fishcard-meteor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,transparent,#ab9ff84f 38%,#b1e9f9a3 79%,#f6fdff 100%);
  clip-path: polygon(0 50%,100% 0,100% 100%);
}
.fishcard-meteor::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 4px;
  aspect-ratio: 1;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 16%;
  background: #f9ffef;
  box-shadow: 0 0 4px #b8eeff,0 0 10px #86beffb0;
}
.fishcard-meteors-far .fishcard-meteor {
  filter: blur(.45px);
  --meteor-travel: min(92vw,350px);
  --meteor-brightness: .7;
}
.fishcard-meteors-far .fishcard-meteor:nth-child(1) { --meteor-x:4%; --meteor-y:3%; --meteor-delay:.59s; }
.fishcard-meteors-far .fishcard-meteor:nth-child(2) { --meteor-x:29%; --meteor-y:14%; --meteor-delay:.86s; --meteor-size:18%; }
.fishcard-meteors-far .fishcard-meteor:nth-child(3) { --meteor-x:48%; --meteor-y:0%; --meteor-delay:1.09s; --meteor-size:21%; }
.fishcard-meteors-far .fishcard-meteor:nth-child(4) { --meteor-x:-6%; --meteor-y:21%; --meteor-delay:1.61s; --meteor-size:16%; }
.fishcard-meteors-near .fishcard-meteor {
  --meteor-size: 39%;
  --meteor-duration: 5.3s;
  --meteor-travel: min(112vw,448px);
  --meteor-brightness: .92;
  height: 5px;
  animation-timing-function: linear;
  filter: drop-shadow(0 0 6px #81dbff9c);
}
.fishcard-meteors-near .fishcard-meteor::before {
  background: linear-gradient(90deg,transparent,#ae94ff70 28%,#8de2f5c7 61%,#d3fcff 86%,#fffce6);
}
.fishcard-meteors-near .fishcard-meteor::after { width: 8px; box-shadow: 0 0 6px #d1ffff,0 0 14px #8cf0ffcf; }
.fishcard-meteors-near .fishcard-meteor:nth-child(1) { --meteor-x:3%; --meteor-y:0%; --meteor-delay:1.07s; --meteor-size:49%; height: 7px; }
.fishcard-meteors-near .fishcard-meteor:nth-child(1)::after { width: 10px; }
.fishcard-meteors-near .fishcard-meteor:nth-child(2) { --meteor-x:24%; --meteor-y:8%; --meteor-delay:1.39s; --meteor-size:27%; height: 3px; }
.fishcard-meteors-near .fishcard-meteor:nth-child(3) { --meteor-x:14%; --meteor-y:14%; --meteor-delay:1.92s; --meteor-size:32%; height: 4px; }
@keyframes fishcard-meteor-flight {
  0% { opacity:0; transform:translate(-7px,-19px) rotate(53deg) scaleX(.68); }
  6% { opacity:var(--meteor-brightness); }
  16% { opacity:var(--meteor-brightness); }
  25%,100% { opacity:0; transform:translate(calc(var(--meteor-travel) * .55),calc(var(--meteor-travel) * .73)) rotate(53deg) scaleX(1.06); }
}
.fishcard-frame,.fishcard-back::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: -2.7%;
  background: url('assets/fishcard-etched-frame.png') center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 0 #e7e9bba3) drop-shadow(2px 5px 3px #061827c2);
  pointer-events: none;
}
.fishcard-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  mask: url('assets/fishcard-etched-frame.png') center / 100% 100% no-repeat;
  background: linear-gradient(120deg,transparent 36%,#fff8d58c 48%,#f7fdec 51%,#93dfeb67 55%,transparent 67%)
    144% 0 / 245% 100% no-repeat;
  mix-blend-mode: screen;
  animation: fishcard-frame-shine 3.6s .65s ease-in-out infinite;
}
@keyframes fishcard-frame-shine {
  0% { background-position: 144% 0; opacity: 0; }
  18%,38% { opacity: .83; }
  54%,100% { background-position: -57% 0; opacity: 0; }
}
.fishcard-front .fish-portrait {
  --portrait-width: 99%;
  align-self: center;
  z-index: 4;
  translate: calc(var(--card-x,0) * 11px) calc(var(--card-y,0) * 10px);
}
.fishcard-current {
  position: absolute;
  z-index: 1;
  inset: 18% 7% 25%;
  border-radius: 50%;
  border-bottom: 2px solid #c1f9ef9e;
  box-shadow: 0 6px 7px -5px #91dfed,0 10px 12px -9px #d4abffa3;
  transform: rotate(-25deg);
  translate: calc(var(--card-x,0) * 3px) calc(var(--card-y,0) * 3px);
  animation: fishcard-current 1.65s .5s ease-out both;
}
@keyframes fishcard-current {
  from { opacity: 0; transform: translate(-15%,17%) rotate(-8deg) scale(.66,.7); }
  46% { opacity: .95; }
  to { opacity: .26; transform: translate(3%,-4%) rotate(-25deg) scale(1.08); }
}
.fishcard-glass {
  position: absolute;
  inset: -4%;
  z-index: 2;
  background: linear-gradient(114deg,transparent 29%,#98f4f335 42%,#fff0d7a8 49%,#a4ddf443 54%,transparent 67%)
    155% 0 / 246% 100% no-repeat;
  mix-blend-mode: screen;
  translate: calc(var(--card-x,0) * 32px) calc(var(--card-y,0) * 14px);
  animation: fishcard-glass 1.85s .38s ease-out both;
}
.fishcard-tracking .fishcard-glass {
  animation: none;
  opacity: .48;
  background-position: calc(52% + var(--card-x,0) * 33%) 0;
}
@keyframes fishcard-glass {
  from { background-position: 155% 0; opacity: .6; }
  37% { opacity: .48; }
  to { background-position: -62% 0; opacity: .3; }
}
.fishcard-front .portrait-lit { scale: 1.16; filter: drop-shadow(0 2px 5px #10164e) drop-shadow(0 0 9px #bafff272); }
.fishcard-front .portrait-adult {
  scale: 1.24;
  animation: fishcard-dive .78s .49s ease-out both,fishcard-hover 2.7s 1.27s ease-in-out infinite alternate;
}
@keyframes fishcard-dive {
  from { transform: translate(13%,-13%) rotate(-8deg); opacity: .35; }
  to { transform: translate(0,0) rotate(0); opacity: 1; }
}
@keyframes fishcard-hover { to { transform: translate(-3%,2%) rotate(2deg); } }
.fishcard-front .portrait-lit::after { animation-delay: .68s; }
.fishcard-distant-stars {
  position: absolute;
  inset: -7% 2%;
  z-index: 1;
  background:
    radial-gradient(circle at 17% 24%,#dbfcfc 0 1px,transparent 3px),
    radial-gradient(circle at 71% 39%,#bcddff 0 1px,transparent 2px),
    radial-gradient(circle at 86% 20%,#d9f1fb 0 1px,transparent 3px),
    radial-gradient(circle at 37% 59%,#b1e5f5 0 1px,transparent 2px),
    radial-gradient(circle at 78% 68%,#b8e4fc 0 1px,transparent 2px),
    radial-gradient(circle at 9% 59%,#bdf5fa 0 1px,transparent 3px),
    radial-gradient(circle at 31% 75%,#ddf8ff 0 1px,transparent 3px);
  translate: calc(var(--card-x,0) * -5px) calc(var(--card-y,0) * -5px);
  animation: fishcard-distant-rise 4s .55s ease-in-out infinite alternate;
}
@keyframes fishcard-distant-rise {
  from { opacity: .25; transform: translateY(6%) scale(.94); }
  to { opacity: .85; transform: translateY(-7%) scale(1.03); }
}
.fishcard-foreground {
  position: absolute;
  z-index: 5;
  inset: 2% -8% 18%;
  translate: calc(var(--card-x,0) * 19px) calc(var(--card-y,0) * 17px);
  pointer-events: none;
}
.fishcard-near-wake {
  position: absolute;
  inset: 31% -2% 20% 7%;
  border-radius: 50%;
  border-bottom: 3px solid #ddfaffc9;
  box-shadow: 0 7px 11px -7px #8ff2ff,0 11px 11px -10px #dcbbff;
  mask-image: linear-gradient(90deg,transparent 5%,#000 37% 74%,transparent 93%);
  animation: fishcard-near-wave 2s .67s ease-out both;
}
@keyframes fishcard-near-wave {
  from { opacity: 0; transform: translate(11%,10%) rotate(-35deg) scale(.66,.57); }
  36% { opacity: .95; }
  to { opacity: .18; transform: translate(-6%,-6%) rotate(-24deg) scale(1.08,.86); }
}
.fishcard-star,.fishcard-glow-orb {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--star-size,18px);
  aspect-ratio: 1;
  transform-origin: center;
  pointer-events: none;
}
.fishcard-star {
  z-index: 3;
  filter: drop-shadow(0 0 4px #bff0ff) drop-shadow(0 0 8px #b398ff8a);
  animation: fishcard-star-flare var(--period,3.1s) var(--delay,.8s) ease-in-out infinite backwards;
}
.fishcard-star::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0,57% 39%,87% 13%,61% 43%,100% 50%,61% 57%,87% 87%,57% 61%,50% 100%,43% 61%,13% 87%,39% 57%,0 50%,39% 43%,13% 13%,43% 39%);
  background: radial-gradient(circle,#fffce8 19%,#d4f7ff 53%,#b8bff2 83%);
}
.fishcard-star-pearl { --x: 16%; --y: 83%; --star-size: 26px; --delay: .84s; }
.fishcard-star-fin { --x: 39%; --y: 18%; --star-size: 20px; --delay: 1.06s; }
.fishcard-star-tail { --x: 85%; --y: 28%; --star-size: 22px; --delay: 1.26s; }
.fishcard-foreground .fishcard-star:nth-child(2) { --x: 12%; --y: 24%; --star-size: 29px; --delay: 1s; --rise: -22px; }
.fishcard-foreground .fishcard-star:nth-child(3) { --x: 92%; --y: 62%; --star-size: 25px; --delay: 1.16s; --rise: -32px; }
.fishcard-foreground .fishcard-star:nth-child(4) { --x: 23%; --y: 78%; --star-size: 17px; --delay: 1.4s; --rise: -26px; }
@keyframes fishcard-star-flare {
  0%,60%,100% { opacity: 0; transform: translate(-50%,-50%) rotate(-12deg) scale(.26); }
  18% { opacity: .97; transform: translate(-50%,calc(-50% + var(--rise,-1px) * .42)) rotate(10deg) scale(1); }
  46% { opacity: .18; transform: translate(-50%,calc(-50% + var(--rise,-1px))) rotate(22deg) scale(.64); }
}
.fishcard-glow-orb {
  --x: 9%;
  --y: 67%;
  --star-size: 40px;
  border-radius: 50%;
  background: radial-gradient(circle,#d7f7f881,#8dccff35 40%,transparent 68%);
  filter: blur(2px);
  animation: fishcard-orb-drift 3.6s .75s ease-in-out infinite alternate backwards;
}
.fishcard-glow-orb:last-child { --x: 90%; --y: 16%; --star-size: 31px; animation-delay: 1.24s; }
@keyframes fishcard-orb-drift {
  from { opacity: 0; transform: translate(10px,20px) scale(.68); }
  50% { opacity: .54; }
  to { opacity: .18; transform: translate(-15px,-23px) scale(1.05); }
}
.fishcard-caption {
  position: relative;
  z-index: 4;
  max-width: 86%;
  padding-top: .7em;
  text-shadow: 0 2px 4px #081f2f;
}
.fishcard-caption::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg,transparent,#d0b877,transparent);
}
.fishcard-front h2 { font-size: clamp(1.08rem,5.25vw,1.63rem); letter-spacing: .06em; }
.fishcard-front p { color: #d5e5dd; font-size: .73rem; overflow-wrap: anywhere; }
.fishcard-dialog button { color: #193d35; background: #fcf2d9; }
.fishcard-swimmer {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100vw,540px);
  height: 100%;
  transform: translateX(-50%);
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}
.fishcard-actions { position: relative; z-index: 8; display: flex; justify-content: center; gap: 10px; }
.fishcard-actions .swim-replay {
  min-height: 44px;
  border-radius: 999px;
  border-color: #def7e686;
  background: #153e49c7;
  color: #fbf8e6;
}
.swim-replay:disabled { opacity: .55; }
.fishcard-print { display: grid; width: 100%; place-items: center; z-index: 4; transition: opacity .28s ease-in-out; }
.fishcard-swimming .fishcard-print { opacity: var(--fishcard-print-opacity, 0); transition: none; }
.fishcard-swimming .fishcard-window::before {
  content: "";
  position: absolute;
  inset: 18% 8% 38%;
  z-index: 3;
  border-radius: 50%;
  border: 2px solid #d2faffc2;
  box-shadow: 0 0 11px #a8dfff95, inset 0 0 5px #e3d8ff8c;
  animation: fishcard-breaksurface .85s ease-out both;
}
@keyframes fishcard-breaksurface {
  from { opacity: 0; transform: rotate(-19deg) scale(.42,.50); }
  24% { opacity: .83; }
  to { opacity: 0; transform: rotate(-19deg) scale(1.27,1.11); }
}
@keyframes fishcard-flip {
  0% { opacity: 0; transform: translateY(35px) rotateZ(-13deg) rotateY(-32deg) scale(.73); }
  13% { opacity: 1; }
  45% { transform: translateY(-10px) rotateY(90deg); }
  82% { transform: translateY(-6px) rotateZ(2deg) rotateY(192deg); }
  100% { transform: rotateY(180deg); }
}
@keyframes fishcard-back-face {
  from { visibility: visible; }
  45%,to { visibility: hidden; }
}
@keyframes fishcard-front-face {
  from { visibility: hidden; }
  45%,to { visibility: visible; }
}
@media (max-height: 700px) and (max-width: 600px) {
  .scene-pair { --school-water-height: clamp(216px,39svh,260px); }
  .scene-pair .pair-intro-water { height: clamp(166px,33svh,220px); }
}
@media (prefers-reduced-motion: reduce) {
  .fishcard-meteors-far,.fishcard-meteors-near { display: none; }
  .fishcard-swimmer,.fishcard-actions .swim-replay { display: none; }
  .scene-pair::after,.scene-pond::after,.scene-dock::after { animation: none; }
  .fishcard-turn,.fishcard-back,.fishcard-front,.fishcard-depth,.fishcard-current,.fishcard-glass,.fishcard-front .portrait-adult,.fishcard-stage::before,.portrait-lit::after,.pond-waterfront .swim-path:has(.fish-portrait) { animation: none; }
  .fishcard-tilt { transform: none; }
  .fishcard-depth,.fishcard-current,.fishcard-glass,.fishcard-foreground,.fishcard-distant-stars,.fishcard-front .fish-portrait { translate: none; }
  .fishcard-frame::after,.fishcard-distant-stars,.fishcard-star,.fishcard-near-wake,.fishcard-glow-orb { animation: none; }
  .fishcard-star,.fishcard-glow-orb { display: none; }
  .fishcard-near-wake,.fishcard-distant-stars { opacity: .35; }
  .portrait-lit::after { background-position: 53% 0; }
  .fishcard-front .portrait-lit::after { opacity: .55; background-position: 69% 0; }
}


/* The crescent fish has a full-screen collection reveal. */
.moon-reveal.fishcard-overlay {
  background: #07151f;
  padding-inline: max(12px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}
.moon-reveal.fishcard-overlay::before {
  width: min(100%,760px);
  filter: none;
  background:
    linear-gradient(180deg,#0618275e,transparent 22% 55%,#06172135 74%,#061721e3),
    url('assets/moon-reveal.jpg') center / cover no-repeat;
}
@media (min-width: 770px) {
  .moon-reveal.fishcard-overlay::before {
    width: min(58svh,590px);
    mask-image: linear-gradient(90deg,transparent,#000 14% 86%,transparent);
  }
}
.moon-reveal-dialog {
  width: min(100%,58svh,546px);
  min-height: min(760px, calc(100svh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 25px));
  grid-template-rows: minmax(0,1fr) auto auto;
  gap: clamp(10px,2.7svh,24px);
  isolation: isolate;
}
.moon-reveal-dialog::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30svh -30vw;
  background: radial-gradient(ellipse at 50% 43%,#03102699,#010d1bef 70%);
  opacity: 0;
  pointer-events: none;
}
.moon-reveal-playing::before { animation: moon-reveal-exposure 1.75s ease-out both; }
@keyframes moon-reveal-exposure {
  0%,24% { opacity: .77; }
  52% { opacity: .47; }
  100% { opacity: 0; }
}
.moon-reveal-stage {
  width: 100%;
  min-height: clamp(220px,45svh,490px);
  aspect-ratio: auto;
  perspective: none;
}
.moon-reveal-stage::before { content: none; }
.moon-reveal-water,.moon-reveal-fish {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.moon-reveal-water { overflow: visible; }
.moon-reveal-fish { z-index: 2; }
.moon-reveal-playing .moon-reveal-fish { animation: moon-reveal-fish-in 2.62s .88s both; }
.moon-reveal-water::after {
  content: "";
  position: absolute;
  top: 57%;
  left: 48%;
  width: 51%;
  height: 9%;
  border-radius: 50%;
  border-bottom: 1px solid #b1eefe;
  box-shadow: 0 5px 9px -5px #91def7,0 10px 15px -12px #e5ccff;
  -webkit-mask-image: linear-gradient(90deg,transparent,#000 32%,#000 55%,transparent);
  mask-image: linear-gradient(90deg,transparent,#000 32%,#000 55%,transparent);
  opacity: 0;
}
.moon-reveal-playing .moon-reveal-water::after { animation: moon-glide-wake 1.62s 1.28s ease-out both; }
.moon-reveal-fish .fish-portrait { --portrait-width: 93%; scale: 1; filter: drop-shadow(0 0 13px #64c1e25d) drop-shadow(0 19px 30px #09142cab); }
.moon-reveal-fish .portrait-fry { --portrait-width: 66%; }
.moon-reveal-fish .portrait-juvenile { --portrait-width: 79%; }
.moon-reveal-fish .portrait-lit::after { animation-delay: 1.32s; }
.moon-reveal-fish .fishcard-star-pearl { --x: 13%; --y: 62%; --delay: 1.35s; }
.moon-reveal-fish .fishcard-star-fin { --x: 35%; --y: 32%; --delay: 1.55s; }
.moon-reveal-fish .fishcard-star-tail { --x: 75%; --y: 27%; --delay: 1.78s; }
.moon-reveal-dialog:not(.moon-reveal-playing) :is(.fishcard-meteor,.fishcard-star) { animation: none; }
.moon-reveal-dialog .fishcard-meteors-far { inset: 5% -2% 5%; }
.moon-reveal-dialog .fishcard-meteors-near { inset: 2% -15% 20%; }
.moon-reveal-dialog .fishcard-meteor {
  animation-delay:calc(var(--meteor-delay) + .35s);
  animation-duration:var(--meteor-cycle,5.6s);
  animation-iteration-count:infinite;
}
.moon-reveal-dialog .fishcard-meteor:nth-child(2) { --meteor-cycle:6.8s; }
.moon-reveal-dialog .fishcard-meteor:nth-child(3) { --meteor-cycle:7.6s; }
.moon-reveal-fish .fishcard-print { width: 100%; }

.moon-reveal-pearl {
  position: absolute;
  width: clamp(26px,9.8vw,45px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%,#fffbe4 5%,#effaff 21%,#c5def2 41%,#80b9d7 63%,#796fbf 76%,#e3e5ff 91%);
  box-shadow: 0 0 7px #fcffff,0 0 26px #9aedff9e,0 0 60px #88aafb8f;
  opacity: 0;
}
.moon-reveal-playing .moon-reveal-pearl { animation: moon-pearl-rise 1.43s .05s ease-in-out both; }
@keyframes moon-pearl-rise {
  0% { opacity: 0; transform: translateY(68px) scale(.4); }
  27% { opacity: 1; }
  64% { opacity: 1; transform: translateY(3px) scale(1); }
  74% { opacity: 1; transform: translateY(0) scale(1.22); }
  100% { opacity: 0; transform: translateY(-6px) scale(1.6); }
}
.moon-reveal-ring {
  position: absolute;
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #d5fcff;
  opacity: 0;
  background: conic-gradient(from -61deg,transparent 0deg,#bceaff9e 27deg,#fffdf2 48deg,#ad96ff9b 69deg,transparent 116deg 166deg,#88efe983 207deg,#e0dbffcc 257deg,transparent 305deg);
  mask-image: radial-gradient(circle,transparent 65.5%,#000 67.4% 68.7%,transparent 70.4%);
}
.moon-reveal-playing .moon-reveal-ring { animation: moon-ring-break 1.48s .59s cubic-bezier(.13,.55,.27,1) both; }
.moon-reveal-playing .moon-reveal-ring-echo {
  width: 79%;
  filter: blur(.85px);
  animation-delay: .77s;
  animation-duration: 1.58s;
}
@keyframes moon-ring-break {
  0% { opacity: 0; transform: scale(.14) rotate(-38deg); }
  29% { opacity: 1; transform: scale(.89) rotate(-10deg); }
  53% { opacity: .81; transform: scale(1.07) rotate(5deg); }
  100% { opacity: 0; transform: scale(1.45) rotate(23deg); }
}
.moon-reveal-sparks { position: absolute; inset: 0; display: grid; place-items: center; }
.moon-reveal-sparks i {
  position: absolute;
  width: var(--shard,5px);
  aspect-ratio: 1;
  clip-path: polygon(50% 0,68% 34%,100% 50%,65% 65%,50% 100%,35% 65%,0 50%,35% 34%);
  background: #edfcff;
  filter: drop-shadow(0 0 5px #9feeff);
  opacity: 0;
}
.moon-reveal-playing .moon-reveal-sparks i { animation: moon-shard-out 1.31s var(--shard-delay,.91s) ease-out both; }
.moon-reveal-sparks i:nth-child(1) { --shard-x:-31vw; --shard-y:-12svh; --shard:8px; }
.moon-reveal-sparks i:nth-child(2) { --shard-x:23vw; --shard-y:-16svh; --shard-delay:.98s; }
.moon-reveal-sparks i:nth-child(3) { --shard-x:33vw; --shard-y:-5svh; --shard:7px; --shard-delay:.94s; }
.moon-reveal-sparks i:nth-child(4) { --shard-x:-37vw; --shard-y:4svh; --shard-delay:1s; }
.moon-reveal-sparks i:nth-child(5) { --shard-x:-24vw; --shard-y:11svh; --shard:9px; }
.moon-reveal-sparks i:nth-child(6) { --shard-x:29vw; --shard-y:13svh; --shard-delay:1.04s; }
.moon-reveal-sparks i:nth-child(7) { --shard-x:9vw; --shard-y:-21svh; --shard:7px; }
.moon-reveal-sparks i:nth-child(8) { --shard-x:35vw; --shard-y:5svh; --shard-delay:1.14s; }
@keyframes moon-shard-out {
  0% { opacity: 0; transform: translate(0,0) rotate(12deg) scale(.35); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(clamp(-260px,var(--shard-x),260px),var(--shard-y)) rotate(120deg) scale(.58); }
}
@keyframes moon-reveal-fish-in {
  0% { opacity: 0; transform: translate(14%,24px) scale(.83); animation-timing-function: ease-out; }
  26% { opacity: 1; transform: translate(7%,4px) scale(.95); animation-timing-function: cubic-bezier(.2,.6,.36,1); }
  100% { opacity: 1; transform: translate(0,0) scale(1); }
}
@keyframes moon-glide-wake {
  0% { opacity: 0; transform: translate(3%,0) scale(.52,.5); }
  28% { opacity: .72; }
  100% { opacity: 0; transform: translate(0,14px) scale(1.19,1.2); }
}

.moon-reveal-name {
  position: relative;
  z-index: 8;
  color: #f2f2e6;
  text-shadow: 0 3px 14px #020c17,0 0 28px #62d4f052;
}
.moon-reveal-playing .moon-reveal-name { animation: moon-reveal-title-in .86s 2s ease-out both; }
.moon-reveal-name h2 {
  font-size: clamp(1.7rem,7.8vw,2.9rem);
  font-weight: 600;
  letter-spacing: .17em;
  margin-inline-start: .17em;
}
.moon-reveal-name p { color: #bee1e6; font-size: .74rem; letter-spacing: .20em; }
@keyframes moon-reveal-title-in {
  from { opacity: 0; transform: translateY(11px); }
  to { opacity: 1; transform: translateY(0); }
}
.moon-reveal-dialog .fishcard-actions .water-action { background: linear-gradient(115deg,#fffce4,#cbdfdf); box-shadow: 0 1px 13px #86ebf550; }

@media (prefers-reduced-motion: reduce) {
  .moon-reveal-playing::before { animation: none; }
  .moon-reveal-playing :is(.moon-reveal-fish,.moon-reveal-name) { animation: none; }
  .moon-reveal-pearl,.moon-reveal-ring,.moon-reveal-sparks,.moon-reveal-water::after { display: none; }
}

/* Three complete first-growth presentations. */
.fish-portrait[data-fish="crescent"][data-form="veil"] { --fish-art:url('assets/crescent-veil.webp'); }
.fish-portrait[data-fish="crown"] { --fish-art:url('assets/crown-fry.webp'); }
.fish-portrait[data-fish="crown"][data-form="shell"] { --fish-art:url('assets/crown-shell.webp'); }
.fish-portrait[data-fish="crown"][data-form="silk"] { --fish-art:url('assets/crown-silk.webp'); }
.fish-portrait[data-shine="流光"]::after { opacity:.63; animation-duration:4.2s; }
.fish-portrait[data-shine="满辉"]::after { opacity:.92; }
.book-print .paper-fish { --paper-size:94px; }
.book-fish-art .paper-fish,.dock-guest .paper-fish,.pond-roster-fish .paper-fish { --paper-size:88px; }
.pond-neighbor .paper-fish { --paper-size:72px; }
.book-unknown :is(.paper-fish,.fish-portrait) { filter:brightness(0) saturate(100%) invert(59%) sepia(16%) saturate(595%) hue-rotate(97deg); opacity:.64; }
.evolution-mark { position:absolute; width:2.7%; aspect-ratio:1; border-radius:52%; left:36%; top:53%; background:#624e87bb; pointer-events:none; }
.evolution-mark.mark-tail { left:72%; top:32%; }
.evolution-mark.mark-lip { left:12%; top:76%; }
[data-fish="crown"] .evolution-mark.mark-lip { left:22%; top:66%; }
[data-form="veil"] .evolution-mark.mark-lip { left:10%; top:86%; }
.evolution-mark.cluster { box-shadow:.29em -.16em 0 -.035em #724595a6,.53em .12em 0 -.065em #7245958c; }
.evolution-mark.odd { width:4.5%; border-radius:30% 66% 48% 56%; transform:rotate(-28deg); }
.evolution-stage .evolution-mark { z-index:2; }

.paper-kite .paper-tail { --art:none; width:54%; height:129%; top:-16%; }
.paper-kite .paper-tail::after { content:none; }
.paper-wing {
  --art:url('assets/paper-kite-tail.webp');
  position:absolute; inset:0; transform-origin:3% 59%;
  background:var(--art) center / 100% 100% no-repeat;
}
.paper-wing.first-wing { clip-path:inset(0 0 41% 0); }
.paper-wing.second-wing { clip-path:inset(57.8% 0 0 0); }
.paper-wing::after {
  content:""; position:absolute; inset:0; opacity:0;
  mask:var(--art) center / 100% 100% no-repeat;
  background:linear-gradient(125deg,transparent 33%,#fffad6b5 51%,transparent 70%) 100% 50% / 220% 100%;
}
.paper-kite.sheen .paper-wing::after { opacity:.48; animation:paper-light 4s ease-in-out infinite; }
.paper-kite.brilliant .paper-wing::after { opacity:.78; animation:paper-light 2.85s ease-in-out infinite; }
.paper-kite .second-wing::after { animation-delay:.22s!important; }
.evolution-dialog .paper-kite .first-wing { animation:wing-unfold 1.2s .42s cubic-bezier(.21,.54,.28,1) both, wing-paddle 1.42s 1.62s ease-in-out infinite alternate; }
.evolution-dialog .paper-kite .second-wing { animation:wing-unfold-lower 1.1s .57s cubic-bezier(.21,.54,.28,1) both, wing-paddle 1.42s 1.67s ease-in-out infinite alternate-reverse; }
@keyframes wing-paddle { from { transform:rotate(-2deg); } to { transform:rotate(4deg); } }
@keyframes wing-unfold {
  from { transform:rotate(29deg) scaleX(.59); opacity:.56; }
  70% { transform:rotate(-5deg); opacity:1; }
  to { transform:none; }
}
@keyframes wing-unfold-lower {
  from { transform:rotate(-24deg) scaleX(.62); opacity:.53; }
  71% { transform:rotate(5deg); opacity:1; }
  to { transform:none; }
}

.evolution-reveal[data-kind="paper"] { --fx:#ffce83; background:#09332f; }
.evolution-reveal[data-kind="crescent"] { --fx:#c1caff; }
.evolution-reveal[data-kind="crown"] { --fx:#ffe0a1; background:#0b2027; }
.evolution-reveal[data-kind="paper"]::before {
  background:linear-gradient(180deg,#123d366c,#184d4224 32%,#0b362ddc 85%),url('assets/clear-water.jpg') center / cover;
}
.evolution-reveal[data-kind="crown"]::before {
  background:linear-gradient(180deg,#081b2da6,#123f4a12 30% 62%,#071d2bea 86%),url('assets/moon-reveal.jpg') center / cover;
}
.evolution-dialog {
  width:min(100%,490px);
  min-height:0;
  grid-template-rows:none;
  gap:clamp(8px,1.65svh,18px);
}
.evolution-dialog > .evolution-stage { min-height:clamp(175px,45svh,421px); }
.evolution-dialog .fishcard-swimmer { width:100%; z-index:4; }
.evolution-stage .fish-portrait { --portrait-width:min(92%, 430px, 57svh); }
.evolution-dialog .evolution-stage .portrait-fry { --portrait-width:min(49%,230px,29svh); }
.evolution-stage .paper-fish { --paper-size:min(77vw,360px,53svh); }
.evolution-stage .paper-fish.adult .paper-tail {
  animation:paper-unfold 1.25s .43s both, paper-kick 1.48s 1.68s ease-in-out infinite alternate;
}
.evolution-dialog .moon-reveal-fish { animation-duration:2.32s; animation-delay:.54s; }
[data-kind="paper"] .evolution-dialog .moon-reveal-fish { animation-duration:1.46s; animation-delay:.12s; }
.evolution-caption p { color:#eef5eb; font-size:.79rem; letter-spacing:.11em; line-height:1.52; }
.evolution-caption p:last-child { letter-spacing:.045em; }
.evolution-caption h2 { font-size:clamp(1.65rem,6.8vw,2.65rem); letter-spacing:.12em; }
.evolution-dialog .evolution-caption { animation-delay:.87s; }
.evolution-controls { display:grid; justify-items:center; gap:7px; }
.evolution-toggle { display:flex; justify-content:center; flex-wrap:wrap; gap:5px; }
.evolution-toggle button {
  min-height:38px; padding:6px 11px; border-radius:999px;
  background:#0a333edb; color:#e7f4f0; border:1px solid #d8f5f068;
  font-size:clamp(.74rem,3.24vw,.9rem);
}
.evolution-toggle button[aria-pressed="true"] {
  background:#fbf2d9; border-color:#fff8e7; color:#193c36;
  box-shadow:0 0 14px #bce3d24a;
}
.evolution-toggle button:focus-visible,.evolution-choice button:focus-visible {
  outline:2px solid #e3b15d; outline-offset:2px;
}
.evolution-source { font-size:.77rem; color:#f2f4da; line-height:1.33; }
.evolution-foreground,.evolution-stars { position:absolute; inset:0; pointer-events:none; }
.evolution-foreground { z-index:6; }
.evolution-stars i {
  position:absolute;
  left:var(--x); top:var(--y); width:var(--size,13px); height:var(--size,13px);
  color:var(--fx); opacity:0;
  background:radial-gradient(ellipse,#fffeef 0 13%,currentColor 18% 35%,transparent 66%);
  clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%);
}
.evolution-stars i:nth-child(1) { --x:73%; --y:28%; --size:24px; --delay:.98s; }
.evolution-stars i:nth-child(2) { --x:82%; --y:47%; --size:18px; --delay:1.24s; }
.evolution-stars i:nth-child(3) { --x:61%; --y:20%; --size:16px; --delay:1.42s; }
.evolution-stars i:nth-child(4) { --x:82%; --y:63%; --delay:1.68s; }
.evolution-stars i:nth-child(5) { --x:70%; --y:75%; --size:17px; --delay:1.91s; }
.evolution-stars i:nth-child(6) { --x:43%; --y:27%; --delay:1.79s; }
.evolution-stars i:nth-child(7) { --x:85%; --y:26%; --delay:2.01s; }
.evolution-stars i:nth-child(8) { --x:94%; --y:49%; --size:20px; --delay:2.18s; }
.evolution-stars i:nth-child(9) { --x:56%; --y:69%; --delay:2.37s; }
.moon-reveal-playing .evolution-stars i { animation:evolution-star 5.4s var(--delay) ease-out infinite both; }
[data-shimmer="soft"] .evolution-stars i:nth-child(n+3),
[data-shimmer="soft"] .fishcard-meteors-far,
[data-shimmer="flow"] .evolution-stars i:nth-child(n+6) { display:none; }
[data-kind="paper"] .evolution-stars i { --size:11px; }
[data-kind="paper"][data-shimmer="full"] .evolution-stars i { --size:15px; }
[data-kind="paper"] .evolution-stars i:nth-child(n+5) { display:none; }
[data-form="veil"] .evolution-stars i:nth-child(1) { --x:78%; --y:24%; }
[data-form="veil"] .evolution-stars i:nth-child(3) { --x:83%; --y:57%; }
[data-form="veil"] .evolution-stars i:nth-child(5) { --x:89%; --y:77%; }
@keyframes evolution-star {
  0% { opacity:0; transform:scale(.25) translate(0,2px); }
  5% { opacity:1; transform:scale(1.13) translate(0,0); }
  22%,100% { opacity:0; transform:scale(.62) translate(12px,15px); }
}
.evolution-waterline {
  position:absolute; inset:60% -2% 9% 5%;
  border-radius:50%; border-bottom:1px solid var(--fx);
  box-shadow:0 11px 16px -12px var(--fx); opacity:0;
}
.moon-reveal-playing .evolution-waterline { animation:evolution-trail 5.4s 1.32s ease-out infinite both; }
[data-kind="crown"] .evolution-waterline { border-bottom-width:2px; box-shadow:0 8px 12px -4px #d3ebff,0 14px 20px -11px var(--fx); }
[data-kind="paper"] .evolution-waterline { inset:65% 12% 15%; }
[data-kind="crown"][data-form="silk"] .evolution-waterline { rotate:-12deg; inset:45% -12% 21% 23%; }
[data-kind="crown"][data-form="silk"] .evolution-waterline::before,
[data-kind="crown"][data-form="silk"] .evolution-waterline::after {
  content:""; position:absolute; inset:9% 0 -14% 14%; border-radius:50%;
  border-bottom:1px solid #cbe4fac2; box-shadow:0 4px 8px -4px #9bcafe;
}
[data-kind="crown"][data-form="silk"] .evolution-waterline::after { inset:16% -6% -26% 28%; border-bottom-color:#fce8b4b3; }
[data-kind="crown"]:is([data-form="shell"],[data-form="silk"]) .evolution-foreground i {
  position:absolute; width:14px; height:14px; top:var(--cy); left:var(--cx);
  background:radial-gradient(circle,#fff8dc 0 13%,#ffda8c 26%,transparent 70%); opacity:0;
}
[data-kind="crown"][data-form="shell"] { --crown-x:25%; --crown-y:49%; }
[data-kind="crown"][data-form="silk"] { --crown-x:17%; --crown-y:49%; }
[data-kind="crown"] .evolution-foreground i:nth-child(1) { --cx:var(--crown-x); --cy:var(--crown-y); --delay:1.24s; }
[data-kind="crown"] .evolution-foreground i:nth-child(2) { --cx:calc(var(--crown-x) + 4%); --cy:calc(var(--crown-y) - 1%); --delay:1.39s; }
[data-kind="crown"] .evolution-foreground i:nth-child(3) { --cx:calc(var(--crown-x) + 8%); --cy:var(--crown-y); --delay:1.53s; }
.moon-reveal-playing .evolution-foreground i { animation:evolution-crown-light 5.4s var(--delay) ease infinite both; }
@keyframes evolution-crown-light {
  0% { opacity:0; scale:.55; }
  5% { opacity:1; scale:1.65; }
  20%,100% { opacity:0; scale:.8; }
}
@keyframes evolution-trail {
  from { opacity:0; transform:scale(.61,.42); }
  11% { opacity:.81; }
  36%,100% { opacity:0; transform:scale(1.15,1) translateY(13px); }
}

.evolution-choice { z-index:5; padding: max(15px,env(safe-area-inset-top,0px)) 12px max(15px,env(safe-area-inset-bottom,0px)); overflow:auto; }
.evolution-choice-dialog {
  width:min(100%,480px); padding:22px 13px; border-radius:22px; text-align:center;
  background:#f7f2dd url('assets/backwater-pond.jpg') center / cover;
  box-shadow:0 14px 60px #153c3aa0; color:#163e38;
}
.evolution-choice-dialog h2 { font-size:clamp(1.52rem,6vw,2.1rem); margin-block:6px; }
.evolution-choice-dialog p { margin-block:4px 10px; }
.evolution-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.evolution-options button { display:grid; gap:4px; justify-items:center; align-content:start; min-width:0; background:#fff7e3ed; border:1px solid #fffdf2; border-radius:18px; color:#153c34; padding:8px 5px 12px; }
.evolution-options button > span { display:grid; place-items:center; width:100%; min-height:83px; }
.evolution-options .fish-portrait { --portrait-width:96%; max-width:150px; }
.evolution-options .paper-fish { --paper-size:min(34vw,148px); }
.evolution-options small { font-size:.76rem; color:#42655c; }
.fish-poked .fish-portrait { animation:evolution-poke .72s cubic-bezier(.21,.6,.4,1) both; }
@keyframes evolution-poke { 40% { transform:rotate(-4deg) translate(-8px,-4px) scale(1.04); } }
@media (max-height:570px) {
  .evolution-dialog { gap:6px; }
  .evolution-dialog > .evolution-stage { min-height:clamp(132px,36svh,220px); }
  .evolution-stage .fish-portrait { --portrait-width:min(90%,50svh); }
  .evolution-toggle button { min-height:34px; }
  .evolution-dialog .evolution-caption h2 { font-size:1.55rem; }
}
@media (prefers-reduced-motion:reduce) {
  .evolution-dialog :is(.paper-tail,.paper-wing,.fish-portrait,.evolution-caption,.moon-reveal-fish,.fishcard-print),.paper-wing::after { animation:none; }
  .evolution-stars,.evolution-waterline,.evolution-foreground { display:none; }
}

.evolution-reveal .moon-reveal-ring {
  background:conic-gradient(from -60deg,transparent 10deg,#a5cff68f 40deg,var(--fx) 62deg,transparent 114deg 174deg,#b3f5e985 216deg,transparent 293deg);
  mask-image:radial-gradient(circle,transparent 67.3%,#000 68.2% 68.8%,transparent 70%);
}
.evolution-reveal .moon-reveal-ring-echo { display:none; }
.evolution-reveal[data-kind="crown"] .moon-reveal-ring-echo { display:block; }
.evolution-reveal[data-kind="paper"] .moon-reveal-ring {
  align-self:end; width:86%; height:31%; margin-bottom:7%;
  background:none; mask:none; border-bottom:1px solid #ffe7b6c9; box-shadow:0 7px 12px -9px #ffd98a;
}
.evolution-stage .paper-fish.brilliant .paper-body {
  filter:drop-shadow(0 0 3px #ffe5a158);
}
.evolution-stage .paper-fish.brilliant .paper-body::after {
  opacity:.34; background-image:linear-gradient(111deg,transparent 28%,#ffe7b17b 49%,transparent 69%);
}
.evolution-stage .paper-fish.brilliant .paper-tail:not(:has(.paper-wing))::after { opacity:.67; }

/* The illustrated growth baseline is shared by the collection preview and the pond. */
.fish-portrait.portrait-juvenile[data-fish="crescent"] { --fish-art:url('assets/crescent-juvenile.webp'); }
.fish-portrait.portrait-juvenile[data-fish="crown"] { --fish-art:url('assets/crown-juvenile.webp'); }
.book-growth-preview { text-align:center; color:#325a50; }
.book-growth-preview small { color:#426961; font-size:.72rem; }
.book-growth-preview:focus-visible { outline:2px solid #a3783d; outline-offset:2px; }
.evolution-variation { display:flex; flex-wrap:wrap; justify-content:center; column-gap:12px; row-gap:6px; }
.evolution-dialog .evolution-stage .portrait-juvenile { --portrait-width:min(80%,385px,49svh); }
.evolution-reveal:not([data-growth-stage="adult"]) .evolution-stars,
.evolution-reveal:not([data-growth-stage="adult"]) .evolution-foreground,
.evolution-reveal[data-shimmer="soft"] :is(.evolution-stars,.evolution-foreground) { display:none; }
.evolution-reveal:not([data-growth-stage="adult"]) .moon-reveal-ring { display:none; }
.evolution-reveal:not([data-growth-stage="adult"]) .evolution-waterline { inset:67% 15% 15%; box-shadow:0 9px 17px -13px var(--fx); }
.evolution-reveal[data-growth-stage="juvenile"] .moon-reveal-fish { animation-duration:1.7s; animation-delay:.2s; }
.evolution-reveal[data-growth-stage="fry"] .moon-reveal-fish { animation-duration:1.4s; animation-delay:.16s; }
.evolution-reveal:not([data-growth-stage="adult"]) .evolution-caption { animation-delay:.36s; }
.evolution-stage .paper-fish.fry .paper-tail,.evolution-stage .paper-fish.juvenile .paper-tail {
  animation:paper-kick 1.26s .48s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion:reduce) {
  .evolution-stage .paper-fish:is(.fry,.juvenile) .paper-tail { animation:none; }
}

.fish-portrait.portrait-fry[data-fish="crescent"] { --fish-art:url('assets/crescent-fry.webp'); }
.fish-portrait.portrait-fry[data-fish="crown"] { --fish-art:url('assets/crown-fry-bud.webp'); }
.evolution-dialog .fishcard-print { animation:evolution-hover 5.4s 1.1s ease-in-out infinite; }
@keyframes evolution-hover {
  0%,100% { transform:translate(0,0); }
  28% { transform:translate(-2%,5px); }
  68% { transform:translate(2%,-5px); }
}
.evolution-stage .paper-fish :is(.paper-body,.paper-tail,.paper-wing)::after {
  background-size:100% 240%; animation-name:waterfront-fin-light; animation-direction:normal;
}
.evolution-stage .paper-fish.brilliant .paper-body::after {
  background-image:linear-gradient(172deg,transparent 30%,#ffe7b17b 49%,transparent 70%);
}
.evolution-stage .paper-fish.brilliant .paper-tail:not(:has(.paper-wing))::after {
  background-image:linear-gradient(166deg,transparent 29%,#ffa95788 44%,#fffde8 52%,transparent 73%);
}
[data-growth-stage="fry"] .evolution-waterline { inset:68% 26% 18%; }
@media (prefers-reduced-motion:reduce) {
  .evolution-dialog .fishcard-print,.evolution-stage .paper-fish :is(.paper-body,.paper-tail,.paper-wing)::after { animation:none; }
}
