/* Quinn's Quest: the pond game. The pond itself is drawn on a canvas (play/pond.js); this file styles what
   sits over it: the picture buttons, the row of food pictures, the choosing cards and the end card, in the
   same field-journal look as the rest of the game (paper, washi tape, stitched badges). Colours come from
   play/style.css where it is loaded, with the same values as fallbacks. Every selector is .pd-* or #pondScreen. */

#pondScreen, .pd {
  --pd-ink: var(--ink, #3a2431); --pd-paper: var(--paper, #fbf3e3);
  --pd-pink: var(--pink, #f07aa0); --pd-pink-d: var(--pink-d, #c8467a); --pd-pink-l: var(--pink-l, #ffc6d8);
  --pd-mint: var(--mint, #8fdcb8); --pd-mint-d: var(--mint-d, #3f9a6e);
  --pd-lilac: var(--lilac, #d4bdf2); --pd-lilac-d: var(--lilac-d, #9672cf);
  --pd-butter: var(--butter, #ffe28f); --pd-butter-d: var(--butter-d, #e2a93a);
  --pd-sky: var(--sky, #a8dcf0); --pd-sky-d: var(--sky-d, #4b93c4); --pd-kraft: var(--kraft, #d9b384); --pd-kraft-d: var(--kraft-d, #a9794a);
  --pd-hand: var(--hand, ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif);
  --pd-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .30 0 0 0 0 .22 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --pd-top: max(12px, env(safe-area-inset-top));
}
.pd { position:fixed; inset:0; z-index:40; overflow:hidden; background:#1c4c47; color:var(--pd-ink); font:20px/1.35 var(--pd-hand);
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; touch-action:none; animation:pd-fade .35s ease both; }
.pd *, .pd *::before, .pd *::after { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
.pd [hidden] { display:none !important; }
.pd.pd-leaving { opacity:0; transition:opacity .25s ease; pointer-events:none; }
@keyframes pd-fade { from { opacity:0; } }
.pd-cv { position:absolute; left:0; top:0; width:100%; height:100%; display:block; image-rendering:pixelated; image-rendering:crisp-edges; touch-action:none; }
.pd-hud { position:absolute; inset:0; z-index:9; pointer-events:none; }
.pd-hud > * { pointer-events:auto; }

/* ------------------------------------------------------------------ */
/* Picture buttons: stitched paper badges, the same family as the game's */
/* ------------------------------------------------------------------ */
.pd-btn { --c:var(--pd-sky); --d:var(--pd-sky-d); --s:78px; position:absolute; z-index:6; width:var(--s); height:var(--s); padding:0; margin:0; border-radius:50%; border:0; cursor:pointer; color:inherit; font:inherit;
  -webkit-appearance:none; appearance:none; touch-action:manipulation;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.55), rgba(255,255,255,0) 46%), var(--pd-tex), var(--c);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.12), inset 0 0 0 3px rgba(255,255,255,.35), 0 6px 0 var(--d), 0 10px 16px rgba(10,30,30,.4);
  display:grid; place-items:center; transition:transform .09s ease, box-shadow .09s ease, filter .2s; }
.pd-btn::before { content:''; position:absolute; inset:7px; border-radius:50%; border:2.5px dashed rgba(255,255,255,.8); pointer-events:none; }
.pd-btn > * { pointer-events:none; }
.pd-btn .pd-ico { display:block; width:56%; height:56%; position:relative; z-index:1; image-rendering:pixelated; filter:drop-shadow(0 2px 0 rgba(58,36,49,.18)); }
.pd-btn:active { transform:translateY(5px) scale(.97); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), inset 0 0 0 3px rgba(255,255,255,.35), 0 1px 0 var(--d), 0 3px 6px rgba(10,30,30,.35); filter:brightness(1.06); }
.pd-btn:focus-visible { outline:4px solid var(--pd-butter); outline-offset:3px; }
.pd-back { --c:#fff1dc; --d:var(--pd-kraft-d); top:var(--pd-top); left:max(12px, env(safe-area-inset-left)); }
.pd-back::before { border-color:rgba(169,121,74,.55); }
.pd-say { --c:var(--pd-mint); --d:var(--pd-mint-d); top:var(--pd-top); right:max(12px, env(safe-area-inset-right)); }
.pd-go { --c:var(--pd-pink); --d:var(--pd-pink-d); --s:104px; position:relative; animation:pd-bob 1.8s ease-in-out infinite; }
.pd-go .pd-ico { width:52%; height:52%; margin-left:7%; }
.pd-again { --c:var(--pd-sky); --d:var(--pd-sky-d); --s:84px; position:relative; }
.pd-go:active { animation:none; }
@keyframes pd-bob { 50% { transform:translateY(-6px); } }

/* washi tape */
.pd-tape { position:absolute; z-index:3; width:42%; max-width:120px; height:22px; top:-11px; left:50%; transform:translateX(-50%) rotate(-3deg); opacity:.93; pointer-events:none;
  -webkit-clip-path:polygon(0 0,3% 18%,0 36%,3% 54%,0 72%,3% 90%,1% 100%,99% 100%,97% 82%,100% 64%,97% 46%,100% 28%,97% 10%,100% 0);
  clip-path:polygon(0 0,3% 18%,0 36%,3% 54%,0 72%,3% 90%,1% 100%,99% 100%,97% 82%,100% 64%,97% 46%,100% 28%,97% 10%,100% 0); }
.pd-t1 { background: repeating-linear-gradient(-45deg, rgba(255,198,216,.92) 0 7px, rgba(240,122,160,.85) 7px 14px); }
.pd-t2 { background: radial-gradient(circle, rgba(255,255,255,.95) 2.5px, transparent 3px) 0 0/12px 12px, rgba(143,220,184,.9); }
.pd-t3 { background: linear-gradient(90deg, rgba(150,114,207,.35) 50%, transparent 0) 0 0/12px 12px, linear-gradient(rgba(150,114,207,.35) 50%, transparent 0) 0 0/12px 12px, rgba(212,189,242,.9); }
.pd-tr { left:auto; right:-14px; top:-6px; width:30%; transform:rotate(38deg); }

/* ------------------------------------------------------------------ */
/* The row of food pictures along the top: fills as she eats, never goes down */
/* ------------------------------------------------------------------ */
.pd-row { --slot:44px; position:absolute; z-index:5; top:calc(var(--pd-top) + 8px); left:50%; transform:translateX(-50%) rotate(-.6deg);
  display:flex; align-items:center; gap:5px; padding:9px 16px; border-radius:10px;
  background: var(--pd-tex), linear-gradient(175deg, #fffaf0, var(--pd-paper));
  box-shadow: 0 3px 0 #e2cca8, 0 10px 18px rgba(10,30,30,.35); pointer-events:none;
  max-width:calc(100vw - 2 * (78px + 24px)); }
.pd-row .pd-tape { top:-12px; left:18%; width:30%; transform:rotate(-4deg); }
.pd-slot { position:relative; flex:0 1 var(--slot); width:var(--slot); min-width:0; aspect-ratio:1/1; border-radius:50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,.9), rgba(255,255,255,0) 50%), #d9eee7;
  box-shadow: inset 0 0 0 2px rgba(63,154,110,.35), inset 0 -3px 0 rgba(0,0,0,.06); }
.pd-slot::after { content:''; position:absolute; inset:28%; border-radius:50%; border:2px dashed rgba(63,154,110,.45); }
.pd-slot img { position:absolute; inset:6%; width:88%; height:88%; image-rendering:pixelated; object-fit:contain; z-index:1; }
.pd-slot img.pd-hint { filter:grayscale(1) brightness(1.5) opacity(.35); }
.pd-slot:has(.pd-hint)::after { display:none; }
.pd-slot.pd-on { background: radial-gradient(circle at 38% 32%, #fff, rgba(255,255,255,0) 55%), var(--pd-butter); box-shadow: inset 0 0 0 2px var(--pd-butter-d), 0 0 10px 2px rgba(255,226,143,.8); }
.pd-slot.pd-on::after { display:none; }
.pd-slot.pd-on img { animation:pd-pop .5s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes pd-pop { 0% { transform:scale(.2) rotate(-40deg); opacity:0; } 60% { transform:scale(1.25) rotate(6deg); opacity:1; } 100% { transform:none; } }

/* ------------------------------------------------------------------ */
/* Choosing who to be: three cards with the animals swimming on them     */
/* ------------------------------------------------------------------ */
.pd-choose { position:absolute; inset:0; z-index:4; display:flex; align-items:center; justify-content:center; padding:calc(var(--pd-top) + 90px) 20px 16vh;
  background: radial-gradient(ellipse at 50% 45%, rgba(10,40,40,0) 30%, rgba(10,40,40,.35)); }
.pd-picks { display:flex; gap:clamp(14px, 3vw, 34px); width:min(980px, 100%); height:100%; max-height:420px; align-items:stretch; justify-content:center; }
.pd-pick { position:relative; flex:1 1 0; min-width:0; max-width:300px; padding:12px 12px 26px; border:0; border-radius:6px; cursor:pointer; font:inherit; color:inherit;
  background: var(--pd-tex), #fffaf0; box-shadow: 0 2px 2px rgba(0,0,0,.18), 0 18px 30px rgba(10,30,30,.45);
  transform:rotate(calc((var(--i) - 1) * 2.4deg)); animation:pd-card-in .6s cubic-bezier(.2,1.3,.4,1) backwards; animation-delay:calc(var(--i) * .12s);
  -webkit-appearance:none; appearance:none; touch-action:manipulation; }
.pd-pick:active { transform:rotate(calc((var(--i) - 1) * 2.4deg)) scale(.96); }
.pd-pick:focus-visible { outline:4px solid var(--pd-butter); outline-offset:4px; }
.pd-pick .pd-tape { top:-12px; }
.pd-tile { position:relative; display:block; width:100%; height:100%; min-height:90px; border-radius:3px; overflow:hidden;
  background: linear-gradient(180deg, #9fe0cf 0, #63b9a8 18%, #3f9184 60%, #2a6d63 100%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.12), inset 0 -10px 18px rgba(10,40,40,.3); }
.pd-tile::before { content:''; position:absolute; inset:0; background:
  repeating-linear-gradient(105deg, rgba(220,255,235,.0) 0 22px, rgba(220,255,235,.13) 22px 34px, rgba(220,255,235,0) 34px 60px); pointer-events:none; }
.pd-tile::after { content:''; position:absolute; left:0; right:0; bottom:0; height:12%; background: linear-gradient(#8f8052, #7a6a42 30%, #3f3222); }
.pd-mini { position:absolute; inset:0; z-index:1; display:block; width:100%; height:100%; image-rendering:pixelated; }
@keyframes pd-card-in { from { transform:translateY(40px) scale(.9) rotate(-6deg); opacity:0; } }

/* ------------------------------------------------------------------ */
/* The end card: who she met, one true fact, the gems, go on or swim again */
/* ------------------------------------------------------------------ */
.pd-end { position:absolute; inset:0; z-index:8; display:flex; align-items:center; justify-content:center; padding:calc(var(--pd-top) + 8px) 18px 14vh;
  background: radial-gradient(ellipse at 50% 45%, rgba(10,40,40,.25), rgba(10,30,30,.6)); animation:pd-fade .4s ease both; }
.pd-card { position:relative; display:grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: 'pic words' 'pic gems' 'pic go';
  gap:12px 24px; width:min(860px, 100%); max-height:100%; padding:22px 24px 22px; border-radius:8px;
  background: var(--pd-tex), linear-gradient(175deg, #fffaf0, var(--pd-paper));
  box-shadow: 0 2px 0 #e9d7b8, 0 4px 0 #f6ead3, 0 6px 0 #e2cca8, 0 24px 44px rgba(10,30,30,.5);
  transform:rotate(-1deg); animation:pd-drop .7s cubic-bezier(.2,1.3,.4,1) backwards; }
@keyframes pd-drop { from { transform:translateY(-50px) rotate(-6deg) scale(.9); opacity:0; } }
.pd-portrait { grid-area:pic; align-self:center; aspect-ratio:5/4; position:relative; min-height:160px; padding:10px 10px 30px; background:#fff; box-shadow: 0 2px 3px rgba(0,0,0,.2), 0 10px 18px rgba(40,20,30,.2); transform:rotate(-2deg); }
.pd-portrait::before { content:''; position:absolute; inset:10px 10px 30px; border-radius:2px;
  background: linear-gradient(180deg, #9fe0cf 0, #63b9a8 18%, #3f9184 60%, #2a6d63 100%); }
.pd-portrait::after { content:''; position:absolute; left:10px; right:10px; bottom:30px; height:10%; background: linear-gradient(#8f8052, #7a6a42 30%, #3f3222); }
.pd-portrait .pd-mini { position:absolute; inset:10px 10px 30px; width:calc(100% - 20px); height:calc(100% - 40px); z-index:1; }
.pd-words { grid-area:words; align-self:end; }
.pd-name { margin:0 0 6px; font-size:28px; line-height:1.15; color:var(--pd-ink); }
.pd-fact { margin:0; font-size:19px; line-height:1.4; color:#5a4652; }
.pd-gems { grid-area:gems; display:flex; flex-wrap:wrap; gap:10px; align-items:center; min-height:20px; }
.pd-gem { position:relative; width:54px; height:48px; }
.pd-gem svg { position:absolute; inset:0; width:100%; height:100%; image-rendering:pixelated; }
.pd-gem-art { animation:pd-gem .55s cubic-bezier(.3,1.7,.5,1) backwards; animation-delay:calc(.7s + var(--i) * .38s); filter:drop-shadow(0 3px 0 rgba(42,42,106,.35)); }
@keyframes pd-gem { 0% { transform:translateY(-60px) scale(.2) rotate(-60deg); opacity:0; } 60% { transform:translateY(4px) scale(1.18) rotate(6deg); opacity:1; } 100% { transform:none; } }
.pd-go-row { grid-area:go; display:flex; align-items:center; justify-content:flex-end; gap:18px; }
.pd-won .pd-portrait { box-shadow: 0 0 0 5px var(--pd-butter), 0 0 26px 8px rgba(255,216,77,.6), 0 10px 18px rgba(40,20,30,.2); }

/* a sheet of every sprite with its name (the review page only) */
.pd-sheet { display:grid; gap:10px; padding:16px; background:#1c4c47; color:#fbf3e3; font:15px/1.3 system-ui, sans-serif; }
.pd-sheet-row { display:flex; align-items:center; gap:16px; }
.pd-sheet-row img { image-rendering:pixelated; background:#3f9184; padding:6px; border-radius:4px; }

/* ------------------------------------------------------------------ */
/* Sizes                                                                 */
/* ------------------------------------------------------------------ */
/* upright: the end card stacks */
@media (orientation:portrait) {
  .pd-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'pic' 'words' 'gems' 'go'; width:min(560px, 100%); }
  .pd-portrait { min-height:0; width:min(100%, calc(30vh * 5 / 4)); justify-self:center; }
  .pd-picks { flex-direction:column; max-height:none; width:min(420px, 100%); }
  .pd-pick { max-width:none; padding:10px 10px 14px; }
  .pd-choose { padding:calc(var(--pd-top) + 96px) 24px 16vh; }
}
@media (max-width:560px) {
  .pd-btn { --s:68px; }
  .pd-row { --slot:30px; gap:3px; padding:7px 10px; max-width:calc(100vw - 2 * (68px + 20px)); top:calc(var(--pd-top) + 6px); }
  .pd-name { font-size:23px; } .pd-fact { font-size:16.5px; }
  .pd-gem { width:44px; height:39px; }
  .pd-go { --s:88px; } .pd-again { --s:72px; }
  .pd-card { padding:16px; gap:10px; }
}
/* short, wide screens (phones sideways) */
@media (max-height:500px) {
  .pd-btn { --s:64px; }
  .pd-btn::before { inset:5px; border-width:2px; }
  .pd-row { --slot:30px; gap:3px; padding:6px 10px; top:max(8px, env(safe-area-inset-top)); }
  .pd-choose { padding:80px 90px 17vh; }
  .pd-picks { max-height:none; }
  .pd-end { padding:10px 90px 12vh; }
  .pd-card { gap:6px 16px; padding:12px 16px; }
  .pd-portrait { min-height:0; padding:6px 6px 18px; }
  .pd-portrait::before { inset:6px 6px 18px; } .pd-portrait::after { left:6px; right:6px; bottom:18px; } .pd-portrait .pd-mini { inset:6px 6px 18px; width:calc(100% - 12px); height:calc(100% - 24px); }
  .pd-name { font-size:20px; margin-bottom:2px; } .pd-fact { font-size:14.5px; line-height:1.3; }
  .pd-gem { width:38px; height:34px; } .pd-gems { gap:6px; }
  .pd-go { --s:76px; } .pd-again { --s:64px; }
}

/* Less motion: decorations hold still; the game plays the same */
.pd.pd-still *, .pd.pd-still *::before, .pd.pd-still *::after { animation:none !important; transition:none !important; }
.pd.pd-still { animation:none; }
@media (prefers-reduced-motion:reduce) {
  .pd *, .pd *::before, .pd *::after { animation:none !important; transition:none !important; }
  .pd { animation:none; }
}

/* ------------------------------------------------------------------ */
/* The other waters: their own water colour on the cards                */
/* ------------------------------------------------------------------ */
.pd-eco-waterhole .pd-tile, .pd-eco-waterhole .pd-portrait::before { background: linear-gradient(180deg, #e9dcae 0, #e9dcae 14%, #8f9550 16%, #6c7136 50%, #4a4b24 100%); }
.pd-eco-waterhole .pd-tile::after, .pd-eco-waterhole .pd-portrait::after { background: linear-gradient(#7a6a40, #5e5032 30%, #2c2414); }
.pd-eco-waterhole .pd-tile::before { background: repeating-linear-gradient(105deg, rgba(255,240,190,0) 0 22px, rgba(255,240,190,.10) 22px 34px, rgba(255,240,190,0) 34px 60px); }
.pd-eco-waterhole { background:#2e2c16; }
.pd-eco-reef .pd-tile, .pd-eco-reef .pd-portrait::before { background: linear-gradient(180deg, #bfe6f6 0, #bfe6f6 9%, #7fd8ec 11%, #46b0da 45%, #2482be 100%); }
.pd-eco-reef .pd-tile::after, .pd-eco-reef .pd-portrait::after { background: linear-gradient(#fff6dc, #e8dab2 30%, #d8c69c); }
.pd-eco-reef .pd-tile::before { background: repeating-linear-gradient(105deg, rgba(255,255,255,0) 0 22px, rgba(255,255,255,.16) 22px 34px, rgba(255,255,255,0) 34px 60px); }
.pd-eco-reef { background:#14508a; }
.pd-eco-river .pd-tile, .pd-eco-river .pd-portrait::before { background: linear-gradient(180deg, #3e6a26 0, #2c5020 15%, #b07a34 17%, #7e5420 50%, #52341a 100%); }
.pd-eco-river .pd-tile::after, .pd-eco-river .pd-portrait::after { background: linear-gradient(#a8602a, #6a3a1a 30%, #28190b); }
.pd-eco-river .pd-tile::before { background: repeating-linear-gradient(105deg, rgba(255,214,140,0) 0 22px, rgba(255,214,140,.12) 22px 34px, rgba(255,214,140,0) 34px 60px); }
.pd-eco-river { background:#2a180a; }
