/* The guide page (friendpond.com/guide, server/guide.js): the game's own look outside the game. The same font,
   frames, buttons, keys and journal tiles as style.css, on one grid: --px is one art pixel in CSS pixels (set by the
   little script in guide/page.html so it is always a whole number of screen pixels, like game.js does). */
@font-face { font-family: 'Monogram'; src: url(assets/fonts/monogram-extended.ttf) format('truetype'); font-display: block; }

:root {
  --ink: #e9efe9;
  --ink-dim: #a9b9b2;
  --ink-dark: #12302a;
  --gold: #f6dc8a;
  --line: #0b1514;
  --bg: #1b2b2c;
  --px: 2px;
  --fs: 32px;
  --fs-big: 48px;
  --fs-huge: 64px;
  --b1: var(--px);
  --b2: calc(var(--px) * 2);
  --b3: calc(var(--px) * 3);
  --b4: calc(var(--px) * 4);
  --u4: calc(var(--px) * 4);
  --u6: calc(var(--px) * 6);
  --u8: calc(var(--px) * 8);
  --wide: min(calc(var(--px) * 480), calc(100vw - 24px));
  --common: #cfd8d3; --uncommon: #86d69a; --rare: #74b8f2; --epic: #c895f2; --legendary: #f4c75c;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html.paged main > section:not(.show) { display: none; }   /* one page at a time (the script in guide/page.html) */
/* switching pages: a quick fade out, then the new one pops in, in a few steps like the game's catch card */
html.paged main > section.show { animation: page-in 0.2s steps(4) both; }
html.paged main.leaving > section.show { opacity: 0; transition: opacity 0.09s steps(2); }
@keyframes page-in { from { opacity: 0; transform: translateY(calc(var(--px) * 6)); } }
@media (prefers-reduced-motion: reduce) { html.paged main > section.show { animation: none; } }
body {
  margin: 0; color: var(--ink);
  font-family: 'Monogram', monospace; font-size: var(--fs); line-height: 1; font-weight: normal;
  font-synthesis: none; -webkit-font-smoothing: none; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeSpeed;
  -webkit-text-size-adjust: 100%;
}
img { image-rendering: pixelated; }
b, strong, h1, h2, h3 { font-weight: normal; }
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; margin: 0; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: var(--px) solid var(--gold); outline-offset: var(--px); }
.dim { color: var(--ink-dim); }
.gold { color: var(--gold); }
.r-common { --rc: var(--common); } .r-uncommon { --rc: var(--uncommon); } .r-rare { --rc: var(--rare); }
.r-epic { --rc: var(--epic); } .r-legendary { --rc: var(--legendary); }
.rc { color: var(--rc); }

/* ---------- the frames (the same pictures as in the game) ---------- */
.card, .pill, .tip {
  border: var(--b3) solid transparent; border-image: url(assets/ui/panel.png) 3 fill / var(--b3);
}
.row {
  border: var(--b3) solid transparent; border-image: url(assets/ui/slot.png) 3 fill / var(--b3);
}
.btn, .tab {
  border-style: solid; border-color: transparent; border-width: var(--b3) var(--b3) var(--b4);
  border-image: url(assets/ui/btn.png) 3 3 4 3 fill / var(--b3) var(--b3) var(--b4);
  color: var(--ink-dark); text-decoration: none; cursor: pointer; background: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--u4);
  height: calc(var(--px) * 25); padding: 0 var(--u8) var(--b1); white-space: nowrap;
}
.tab { border-image-source: url(assets/ui/btn-dark.png); color: var(--ink); height: calc(var(--px) * 23); padding: 0 var(--u6) var(--b1); }
.tab.on { border-image-source: url(assets/ui/btn-on.png); }
.btn.gold { border-image-source: url(assets/ui/btn-gold.png); color: #3a2208; }
.btn:hover, .tab:hover { filter: brightness(1.12); }
.btn:active, .tab:active { transform: translateY(var(--px)); filter: brightness(0.94); }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: calc(var(--px) * 15); height: calc(var(--px) * 23); padding: 0 var(--b3) var(--b1); margin: 0 var(--b1);
  font: inherit; line-height: 1; color: #1c2b29; vertical-align: middle;
  border-style: solid; border-color: transparent; border-width: var(--b3) var(--b3) calc(var(--px) * 4);
  border-image: url(assets/ui/key.png) 3 3 4 3 fill / var(--b3) var(--b3) calc(var(--px) * 4);
}
.field {
  height: calc(var(--px) * 23); padding: 0 var(--u4) var(--b1); min-width: 0;
  border: var(--b3) solid transparent; background: none;
  border-image: url(assets/ui/field.png) 3 fill / var(--b3);
}
.field:focus { border-image-source: url(assets/ui/field-on.png); }
.field::placeholder { color: var(--ink-dim); }
/* an icon from assets/items.png (16x16 art pixels) or assets/fish.png (48x24), at one screen pixel grid */
.ii, .fi { display: inline-block; flex: none; vertical-align: middle; image-rendering: pixelated; background-repeat: no-repeat; }
.ii { width: calc(var(--px) * 16); height: calc(var(--px) * 16);
  background-image: var(--items); background-size: calc(var(--px) * var(--items-w)) calc(var(--px) * 16);
  background-position: calc(var(--px) * var(--x) * -1) 0; }
.fi { width: calc(var(--px) * 48); height: calc(var(--px) * 24);
  background-image: var(--fish); background-size: calc(var(--px) * var(--fish-w)) calc(var(--px) * var(--fish-h));
  background-position: calc(var(--px) * var(--x) * -1) calc(var(--px) * var(--y) * -1); }
.fi.big { width: calc(var(--px) * 96); height: calc(var(--px) * 48);
  background-size: calc(var(--px) * var(--fish-w) * 2) calc(var(--px) * var(--fish-h) * 2);
  background-position: calc(var(--px) * var(--x) * -2) calc(var(--px) * var(--y) * -2); }

/* ---------- the top: the pond by day, the logo, Play ---------- */
.hero { position: relative; overflow: hidden; min-height: calc(var(--px) * 250); display: flex; background: #2f6e48; }
.hero .art {   /* the picture is 640 x 300 art pixels; on a wide screen its sides fade into the forest green */
  position: absolute; left: 50%; top: 0; width: calc(var(--px) * 640); height: calc(var(--px) * 300); transform: translateX(-50%);
  background: var(--hero) 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(10, 20, 22, 0.15), rgba(10, 20, 22, 0.55)); }
.hero .in { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--px) * 12) 12px; }
.logo { width: calc(var(--px) * 158 * var(--lk)); height: calc(var(--px) * 90 * var(--lk)); display: block;
  margin-bottom: calc(var(--px) * -4); position: relative; z-index: 1; filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35)); }
:root { --lk: 1; }
.hero .card { width: min(calc(var(--px) * 260), calc(100vw - 24px)); padding: var(--u8) var(--u8) var(--u6); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--u6); filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35)); }
.hero .card p { text-wrap: balance; }
.hero .btn { padding: 0 calc(var(--px) * 16) var(--b1); }

/* the menu: a column of buttons with an icon each, left of the page (on a phone and narrow windows: two rows of three
   along the top that stay there while you scroll; Play is in the top part and the footer there) */
.layout { width: min(calc(var(--px) * 586), calc(100vw - 24px)); margin: 0 auto; display: grid; grid-template-columns: calc(var(--px) * 96) 1fr;
  gap: var(--u8); align-items: start; padding: var(--u8) 0 calc(var(--px) * 16); }
nav { position: sticky; top: var(--u8); z-index: 10; }
nav .in { display: flex; flex-direction: column; gap: var(--b3); }
nav .tab { justify-content: flex-start; gap: var(--u4); height: calc(var(--px) * 25); padding: 0 var(--u4) var(--b1); }
nav .tab .ii { flex: none; }
nav .play { margin-top: var(--u4); }
@media (max-width: 900px) {
  .layout { display: block; width: auto; padding: 0; }
  nav { top: 0; background: #111e1f; border-bottom: var(--px) solid var(--line); box-shadow: 0 var(--px) 0 rgba(255, 255, 255, 0.04); }
  nav .in { width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--u4) 0; }
  nav .tab { justify-content: center; min-width: 0; height: calc(var(--px) * 23); padding: 0 var(--b2) var(--b1); gap: var(--b3); }
  nav .play { display: none; }
  /* a very narrow phone with big pixels: the words don't fit next to the icons, so just the words (set in the <head>) */
  html.tight-nav nav .tab { padding: 0 var(--b1) var(--b1); }
  html.tight-nav nav .tab .ii { display: none; }
}

/* ---------- the pages ---------- */
main { min-width: 0; display: grid; gap: calc(var(--px) * 12); align-content: start; }
@media (max-width: 900px) { main { width: var(--wide); margin: 0 auto; padding: var(--u8) 0 calc(var(--px) * 16); } }
section.card { padding: var(--u8); filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35)); }
section h2 { font-size: var(--fs-big); color: #d9efe4; margin-bottom: var(--u6); display: flex; align-items: center; gap: var(--u4); }
section h3 { color: var(--gold); margin: var(--u8) 0 var(--u4); }
section p { margin: 0 0 var(--u4); max-width: 46em; }
section p:last-child { margin-bottom: 0; }
/* about: the words, and a quick-facts box beside them (under them on a phone) */
.about { display: grid; grid-template-columns: 1fr calc(var(--px) * 172); gap: var(--u8); align-items: start; }
.about h3 { margin-top: var(--u8); }
.facts { padding: var(--u4); }
.facts img { display: block; width: calc(var(--px) * 160); height: calc(var(--px) * 172); margin: 0 auto var(--u4); }
.facts dl { display: grid; grid-template-columns: auto 1fr; gap: var(--b3) var(--u4); margin: 0; }
.facts dt { color: var(--gold); }
.facts dd { margin: 0; color: var(--ink-dim); }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .facts { justify-self: center; width: 100%; max-width: calc(var(--px) * 220); } }

/* getting started: three steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--b3); }
.steps .row { display: flex; gap: var(--u6); align-items: flex-start; padding: var(--u4) var(--u6); }
.steps .nm { color: var(--gold); margin-bottom: var(--b3); }
.steps p { margin: 0; color: var(--ink-dim); }

/* chat commands: what you type and what it does, next to how it looks in the chat (the game's colours) */
.you { color: #bfe6d6; } .them { color: #f7a9d6; }
.cmds { display: grid; gap: var(--b3); }
details.command { margin: 0; }
.command summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--b3) var(--u8); }
.command .syntax { flex: 1 1 auto; }
.command .slash { color: var(--gold); }
.command .arg { color: var(--ink-dim); }
.command .desc { color: var(--ink-dim); }
.command .chat-demo { margin: 0 var(--u6) var(--u6); }
.chat-demo { display: grid; gap: var(--b3); padding: var(--u4); border: var(--b3) solid transparent; border-image: url(assets/ui/glass.png) 3 fill / var(--b3); }
.chat-demo .typed { height: calc(var(--px) * 22); display: flex; align-items: center; padding: 0 var(--u4) var(--b1);
  border: var(--b3) solid transparent; border-image: url(assets/ui/field-on.png) 3 fill / var(--b3); margin-bottom: var(--b3); }
.chat-demo .who { color: #7f948c; margin-top: var(--b2); }
.chat-demo .ln { justify-self: start; padding: var(--b1) var(--u4) var(--b2); overflow-wrap: anywhere;
  border: var(--b1) solid transparent; border-image: url(assets/ui/line.png) 1 fill / var(--b1); }
.chat-demo .ln div + div { margin-top: var(--b2); }
.chat-demo .ln.cmd { color: #b9d6e4; }
.chat-demo .ln.coins { color: #b4e3a8; }
.chat-demo .ln.pm { color: #f3c6e3; }
.chat-demo .ln.pm b { color: #f7a9d6; }
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--px) * 180)), 1fr)); gap: var(--b3); margin: var(--b3) 0 0; }
.places figure { margin: 0; padding: var(--b3); display: grid; gap: var(--b3); }
.places img { display: block; width: 100%; height: calc(var(--px) * 110); object-fit: cover; image-rendering: pixelated; }
.places figcaption { padding: 0 var(--b3) var(--b2); display: flex; flex-wrap: wrap; gap: var(--u4); }
.places .nm { color: var(--gold); }
.times { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--px) * 100), 1fr)); gap: var(--b3); margin: 0 0 var(--u4); }
.times .row { display: flex; align-items: center; gap: var(--u4); padding: var(--u4); }

/* the valley: the people you meet */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--px) * 130)), 1fr)); gap: var(--b3); }
.people .row { display: grid; grid-template-columns: calc(var(--px) * 32) 1fr; gap: var(--u6); align-items: center; padding: var(--u4) var(--u6); }
.people .row img { width: calc(var(--px) * 32); height: calc(var(--px) * 44); }
.people .row .nm { color: var(--gold); margin-bottom: var(--b3); }
.people .row p { margin: 0; color: var(--ink-dim); }

/* gear: Rods / Bait / Bobbers, then the shop rows */
.subtabs { display: flex; flex-wrap: wrap; gap: var(--b3); margin-bottom: var(--u4); }
.sub > p { margin-bottom: var(--u4); }
.gear { display: grid; gap: var(--b3); }
.gear .row { display: grid; grid-template-columns: calc(var(--px) * 16) 1fr auto; gap: var(--u6); align-items: center; padding: var(--u4) var(--u6); }
.gear .row .nm { margin-bottom: var(--b2); }
.gear .row p { margin: 0; color: var(--ink-dim); }
.gear .row .price { display: flex; align-items: center; gap: var(--b3); white-space: nowrap; }
.gear .row .cost { display: flex; align-items: center; gap: var(--b3); }
/* bobber upgrades: 15% 2,500 • 20% 4,000 • 25% 6,500 */
.ups { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b3) var(--u6); margin-top: var(--b3); }
.ups .up { display: inline-flex; align-items: center; gap: var(--u4); }
.ups .up + .up::before { content: '•'; color: #5d7570; }
.ups .price { color: var(--ink-dim); }
/* rods: what Bites, Control and Luck mean */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--px) * 110)), 1fr)); gap: var(--b3); margin-bottom: var(--u4); }
.legend .row { display: flex; align-items: center; gap: var(--u6); padding: var(--u4) var(--u6); }
.legend .meter { flex: none; }
.legend .nm { color: var(--gold); margin-bottom: var(--b2); }
.legend p { margin: 0; color: var(--ink-dim); }
/* a rod's stats: three 5-box meters, the same as in the game's shop */
.rod-stats { display: flex; flex-wrap: wrap; gap: var(--b3) var(--u6); margin-top: var(--b3); }
.stat { display: inline-flex; align-items: center; gap: var(--b3); color: var(--ink-dim); }
.meter { display: inline-flex; gap: var(--px); padding: var(--px); background: var(--line); }
.meter i { width: calc(var(--px) * 5); height: calc(var(--px) * 5); background: #1d3432; box-shadow: inset 0 var(--px) 0 #27433f; }
.meter i.on { background: var(--m); box-shadow: inset 0 var(--px) 0 var(--m-hi), inset 0 calc(var(--px) * -1) 0 var(--m-lo); }
.meter.bites { --m: #86d69a; --m-hi: #d4f7dd; --m-lo: #5aa66e; }
.meter.control { --m: #74b8f2; --m-hi: #cfe8fd; --m-lo: #4a86c0; }
.meter.luck { --m: #f4c75c; --m-hi: #fff0b8; --m-lo: #c9962f; }

/* ---------- every fish: the journal ---------- */
.fish-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b3); margin-bottom: var(--u4); }
.fish-tools .sp { flex: 1 1 0; }
.fish-tools .field { flex: 1 1 calc(var(--px) * 90); max-width: calc(var(--px) * 140); }
.fish-tools .tab .n { color: var(--ink-dim); }
.fish-tools.searching .tab { opacity: 0.45; }      /* a search looks through every fish */
.journal { display: grid; gap: var(--u4); }
.grid {
  display: grid; gap: var(--b3);
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--px) * 54), 1fr)); grid-auto-rows: calc(var(--px) * 32);
}
.cell {
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; background: none;
  border: var(--b3) solid transparent; border-image: url(assets/ui/tile-common.png) 3 fill / var(--b3);
}
.cell.r-uncommon { border-image-source: url(assets/ui/tile-uncommon.png); }
.cell.r-rare { border-image-source: url(assets/ui/tile-rare.png); }
.cell.r-epic { border-image-source: url(assets/ui/tile-epic.png); }
.cell.r-legendary { border-image-source: url(assets/ui/tile-legendary.png); }
.cell.r-common:hover, .cell.r-common.on { border-image-source: url(assets/ui/tile-common-on.png); }
.cell.r-uncommon:hover, .cell.r-uncommon.on { border-image-source: url(assets/ui/tile-uncommon-on.png); }
.cell.r-rare:hover, .cell.r-rare.on { border-image-source: url(assets/ui/tile-rare-on.png); }
.cell.r-epic:hover, .cell.r-epic.on { border-image-source: url(assets/ui/tile-epic-on.png); }
.cell.r-legendary:hover, .cell.r-legendary.on { border-image-source: url(assets/ui/tile-legendary-on.png); }
.cell .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* for search engines and screen readers */
.none { color: var(--ink-dim); padding: var(--u8) 0; text-align: center; }
.detail { position: sticky; top: var(--u8); z-index: 5; display: grid; align-items: center; gap: var(--b3) var(--u8);
  grid-template-columns: calc(var(--px) * 100) 1fr 1fr; padding: var(--u4) var(--u8); min-height: calc(var(--px) * 76); }
.detail .fi.big { justify-self: center; }
.detail .col { display: grid; gap: var(--b3); align-content: center; }
.detail h3 { font-size: var(--fs-big); color: var(--rc); margin: 0 0 var(--b1); }
.detail .ln { color: var(--ink-dim); }
.detail .ln.rec { color: var(--ink); }
.detail .ln .ii { margin-right: var(--b2); vertical-align: calc(var(--px) * -3); }
.detail .close { display: none; }
@media (max-width: 900px) { .detail { top: calc(var(--px) * 64); } }   /* under the menu's two rows */
@media (max-width: 760px) {   /* a phone: the fish's card pops up over the bottom of the screen when you tap one */
  .detail { position: fixed; z-index: 20; left: 12px; right: 12px; top: auto; bottom: 12px;
    grid-template-columns: 1fr; justify-items: center; text-align: center; padding: var(--u6); }
  .detail:not(.open) { display: none; }
  .detail .close { display: inline-flex; margin-top: var(--u4); }
}
.tip { position: fixed; z-index: 30; pointer-events: none; white-space: nowrap; padding: var(--b1) var(--u4) var(--b2);
  filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35)); }

/* ---------- updates and questions ---------- */
.updates { list-style: none; padding: 0; display: grid; gap: var(--b3); }
.updates details { margin: 0; }
.updates summary { gap: var(--u4); flex-wrap: wrap; }

.tag { padding: 0 var(--u4) var(--b2); border: var(--b3) solid transparent; border-image: url(assets/ui/chip.png) 3 fill / var(--b3); white-space: nowrap; }
.tag.gold { color: #3a2a06; border-image-source: url(assets/ui/chip-gold.png); }
.updates ul { list-style: none; margin: 0; padding: 0 var(--u6) var(--u6) calc(var(--px) * 18); display: grid; gap: var(--b3); }
.updates ul li { padding-left: calc(var(--px) * 10); position: relative; }
.updates ul li::before { content: ''; position: absolute; left: var(--b1); top: calc(var(--px) * 6); width: var(--b3); height: var(--b3); background: #8fe0b0; box-shadow: 0 0 0 var(--px) var(--line); }
details { margin-bottom: var(--b3); }
details summary { list-style: none; cursor: pointer; padding: var(--u4) var(--u6); display: flex; align-items: center; gap: var(--u4); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '›'; color: var(--gold); transition: transform 0.1s steps(2); }
details[open] summary::before { transform: rotate(90deg); }
details .ans { padding: var(--u4) var(--u6) var(--u4) calc(var(--px) * 18); color: var(--ink-dim); }
details .ans p { margin-bottom: var(--u4); }

/* the credits: what, then who */
.credit-list { display: grid; gap: var(--b3); }
.credit-list .row { display: grid; grid-template-columns: calc(var(--px) * 64) 1fr; gap: var(--u6); align-items: center; padding: var(--u4) var(--u6); }
.credit-list .what { color: var(--gold); }
@media (max-width: 560px) { .credit-list .row { grid-template-columns: 1fr; gap: var(--b3); } }

/* ---------- the footer line ---------- */
footer { background: #111e1f; border-top: var(--px) solid var(--line); color: var(--ink-dim); }
footer .in { width: min(calc(var(--px) * 586), calc(100vw - 24px)); margin: 0 auto; padding: var(--u8) 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--u4) var(--u8); }
footer .links { display: flex; gap: var(--u8); }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
@media (max-width: 560px) { footer .in { flex-direction: column; } }
