/* Nunito (SIL OFL 1.1, see vendor/nunito/OFL.txt) */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap; src: url(vendor/nunito/nunito-latin.woff2) format('woff2'); }
:root {
  --cream: rgba(255, 249, 236, 0.92);
  --wood: #c99b6b;
  --wood-dark: #9b6d43;
  --ink: #5b3a1e;
  --ink-soft: #8a6646;
  --accent: #e35b4f;
  --accent-dark: #b9443a;
  --gold: #f2b53a;
  --shadow: 0 3px 0 rgba(120, 80, 40, 0.22), 0 10px 24px rgba(60, 40, 20, 0.16);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #2b3a5c; color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'PingFang TC', sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.card {
  background: var(--cream);
  border: 2px solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 6px; border: 1.5px solid var(--wood);
  background: #fffdf6; box-shadow: 0 2px 0 var(--wood);
  font: 800 12px/1 'Nunito', sans-serif; color: var(--ink);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px;
  pointer-events: none;
  padding-right: 164px; /* room for the corner buttons */
}
#hud > .card { padding: 6px 14px; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 22px; }
.stat svg { width: 28px; height: 28px; }
.chip {
  background: var(--gold); color: #fff; font-weight: 900; font-size: 15px;
  padding: 2px 9px; border-radius: 999px; box-shadow: 0 2px 0 #c98d1c;
}
.chip.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }

.corner {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 16px;
  /* (above the title, pause and end cards, z-index 10, so sound can be switched there too; under the leaderboard, 20) */
  display: flex; gap: 8px; z-index: 11;
}
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--cream); border: 2px solid var(--wood); border-radius: 12px;
  box-shadow: 0 3px 0 rgba(120, 80, 40, 0.25); color: var(--ink); padding: 0;
}
.icon-btn:hover { background: #fffdf6; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 80, 40, 0.25); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .off { display: none; }
.icon-btn[aria-pressed="false"] { color: var(--ink-soft); opacity: 0.8; }
.icon-btn[aria-pressed="false"] .off { display: inline; }

.hint {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%); padding: 10px 18px; font-size: 16px; font-weight: 800;
  pointer-events: none; text-align: center; max-width: calc(100vw - 32px);
  animation: hintIn 0.35s ease-out;
}
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } }

#popups { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.popup {
  position: absolute; left: 0; top: 0; font-weight: 900; font-size: 22px; white-space: nowrap;
  /* gold with a 3px dark brown outline on every side, so it reads on the pale mint wallpaper (review 2026-12-01) */
  --ol: #4a2810; color: #ffd23f;
  text-shadow: 3px 0 0 var(--ol), -3px 0 0 var(--ol), 0 3px 0 var(--ol), 0 -3px 0 var(--ol), 2px 2px 0 var(--ol), -2px 2px 0 var(--ol), 2px -2px 0 var(--ol), -2px -2px 0 var(--ol), 0 5px 0 var(--ol), 0 0 12px rgba(40, 20, 5, 0.45);
}
.popup.grey { color: #eef0f5; font-size: 16px; text-shadow: 0 2px 0 rgba(40, 40, 60, 0.4); }
.popup.green { color: #e7ffd0; text-shadow: 0 2px 0 rgba(40, 80, 20, 0.5), 0 0 10px rgba(160, 255, 120, 0.6); }

/* ---------- screens ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(255, 240, 210, 0.15), rgba(60, 40, 20, 0.28));
  z-index: 10; animation: fade 0.3s ease-out; overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(460px, 100%); padding: 26px 28px 22px; text-align: center;
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  animation: rise 0.35s cubic-bezier(.2, 1.3, .5, 1);
}
.panel.small { width: min(340px, 100%); }
@keyframes rise { from { transform: translateY(16px) scale(0.97); } }
h1 { margin: 0 0 4px; font-size: 44px; font-weight: 900; letter-spacing: 0.5px; color: var(--ink); }
h1::after { content: ''; display: block; width: 70px; height: 5px; margin: 6px auto 0; border-radius: 4px; background: repeating-linear-gradient(90deg, #e8892c 0 10px, var(--gold) 10px 20px); }
h2 { margin: 0 0 12px; font-size: 26px; font-weight: 900; }
.tag-line { margin: 8px 0 16px; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.how { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; display: grid; gap: 9px; font-weight: 700; font-size: 14.5px; }
.how li { display: flex; align-items: center; gap: 10px; }
.keys { display: inline-flex; gap: 4px; flex: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; margin: 0 4px; }
.dot.gold { background: #ffd86a; box-shadow: 0 0 10px #ffc94a; }
.dot.warm { background: #ffe7a6; box-shadow: 0 0 10px #ffdf8a; border: 1.5px solid #e8c468; }
.dot.red { background: var(--accent); }
.big-btn {
  min-height: 48px; padding: 10px 34px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 4px 0 var(--accent-dark);
}
.big-btn:hover { filter: brightness(1.05); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.big-btn.ghost { background: #fffdf6; color: var(--ink); border: 2px solid var(--wood); box-shadow: 0 4px 0 var(--wood); }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.best { margin: 14px 0 0; color: var(--ink-soft); font-weight: 800; font-size: 14px; min-height: 1em; }
.sub { margin: 14px 0 0; color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.newbest { margin: -4px 0 10px; color: var(--accent); font-weight: 900; font-size: 18px; animation: pop 0.6s ease-out; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.stats div { background: #fffdf6; border: 1.5px solid #ecdcc3; border-radius: 12px; padding: 8px; }
.stats dt { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 900; }
.score { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.score b { font-size: 30px; color: var(--accent); margin-left: 6px; }

@media (max-width: 640px) {
  #hud { left: 10px; right: 10px; padding-right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 52px); gap: 6px; }
  #hud > .card { padding: 4px 10px; min-height: 40px; }
  .corner { right: 10px; }
  .stat { font-size: 19px; }
  h1 { font-size: 36px; }
  .panel { padding: 20px 18px 18px; }
  .how { font-size: 13.5px; }
}

/* ---------- online leaderboard ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.row-btns .big-btn { padding-left: 24px; padding-right: 24px; }
.post { margin: 12px 0 0; padding: 12px 12px 10px; border-radius: 12px; background: rgba(255, 253, 246, 0.8); border: 1.5px dashed var(--wood); }
.post-rank { margin: 0 0 8px; font-weight: 800; font-size: 15px; }
.post-form { display: flex; gap: 8px; justify-content: center; }
.post-form[hidden] { display: none; }
.post-form input {
  flex: 1; min-width: 0; max-width: 180px; min-height: 44px; padding: 6px 12px; border-radius: 12px;
  border: 2px solid var(--wood); background: #fffdf6; color: var(--ink); font-family: inherit; font-weight: 800; font-size: 16px; line-height: 1.2; text-align: center;
}
.post-form input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.mid-btn {
  min-height: 44px; padding: 6px 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-family: inherit; font-weight: 900; font-size: 16px; line-height: 1; box-shadow: 0 3px 0 var(--accent-dark);
}
.mid-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }
.mid-btn:disabled { opacity: 0.6; cursor: default; }
.post-msg { margin: 8px 0 0; min-height: 1.2em; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.post-msg:empty { display: none; }
.post-msg.bad { color: var(--accent-dark); }
.overlay.top { z-index: 20; background: rgba(60, 40, 20, 0.42); }
/* solid, not see-through like the other cards: the end card is right behind it */
.board-panel { display: flex; flex-direction: column; padding-bottom: 20px; background: #fff9ec; }
.board-panel .big-btn { align-self: center; }
.board-panel h2 { margin: 0 0 8px; }
.board-state { margin: 0; min-height: 1.4em; color: var(--ink-soft); font-weight: 700; font-size: 14.5px; }
.board-state:empty { display: none; }
.board-list { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; max-height: min(46dvh, 380px); overflow: auto; overscroll-behavior: contain; border-radius: 10px; }
.board-list:empty { display: none; }
.board-list li { display: grid; grid-template-columns: 36px 30px 1fr auto; gap: 8px; align-items: center; padding: 7px 12px; font-weight: 800; font-size: 15px; border-bottom: 1px dashed rgba(155, 109, 67, 0.35); }
.board-list li:last-child { border-bottom: 0; }
.board-list .rk { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .sc { font-variant-numeric: tabular-nums; }
.board-list li.me { background: rgba(242, 181, 58, 0.28); border-radius: 8px; }
.board-me { margin: 8px 0 0; padding: 7px 12px; border-radius: 8px; background: rgba(242, 181, 58, 0.28); font-weight: 800; font-size: 14.5px; }
.board-account { margin: 14px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.board-account small { font-size: 12.5px; }
/* (a finger-sized target: the link is small text in a line) */
#board-account .plain-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; vertical-align: middle; margin: -12px 0; }
/* Google's sign-in button, light theme, as its branding guide asks */
.g-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 22px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; text-decoration: none; font: 500 14px/20px Roboto, Arial, sans-serif;
}
.g-btn:hover { background: #f6f8fa; }
.g-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.g-btn svg { width: 18px; height: 18px; flex: none; }
.link-btn { min-height: 44px; padding: 2px 8px; border: 0; background: none; cursor: pointer; color: var(--accent-dark); font-family: inherit; font-weight: 800; font-size: 14px; line-height: 1; text-decoration: underline; }
.plain-link { color: var(--ink-soft); font-weight: 800; }
.plain-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.post-who { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.post-who[hidden] { display: none; }
.post-who .or { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 13px; }
.post-who .or::before, .post-who .or::after { content: ''; flex: 1; border-top: 1.5px dashed var(--wood); }
.av { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--wood); object-fit: cover; background: #fffdf6; flex: none; display: block; }
.av.dflt { display: grid; place-items: center; }
.av.dflt svg { width: 22px; height: 22px; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- the link to the other games (2026-11-27, the owner: no game led back to ossgolab.com) ----------
   Under the buttons of the title, pause and end cards: quiet, but a full-size target. Never on the game view. */
.more-games { display: flex; width: max-content; max-width: 100%; align-items: center; justify-content: center; gap: 5px; min-height: 44px; margin: 2px auto -8px; padding: 0 14px; border-radius: 14px;
  color: var(--ink-soft); font-weight: 800; font-size: 14.5px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.more-games b { color: var(--ink); font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--wood); }
.more-games svg { width: 16px; height: 16px; flex: none; transition: transform 0.15s; }
.more-games:hover { background: rgba(155, 109, 67, 0.12); color: var(--ink); }
.more-games:hover svg { transform: translateX(3px); }
.more-games:active { background: rgba(155, 109, 67, 0.22); }
.more-games:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
/* on the title card it is in the row of buttons: under them, or beside them on a short screen (just "More games") */
.row-btns > .more-games { flex: 0 0 100%; margin: -6px 0 -10px; }
@media (max-height: 480px) {
  .more-games { min-height: 44px; margin: 0 auto -8px; font-size: 13.5px; }
  .row-btns > .more-games { flex: 0 1 auto; margin: 0; align-self: center; padding: 0 8px; }
  .row-btns > .more-games .mg-at { display: none; }
  .row-btns > .more-games > span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--wood); }
}
/* a short screen (an upright phone, or a 1024×700 laptop window): the end card with the posting box already fills the screen (measured 2026-11-30: the link would
   make it scroll), so the link is left to the title and pause cards there */
@media (max-height: 720px) { #over .more-games { display: none; } }
@media (prefers-reduced-motion: reduce) { .more-games svg { transition: none; } }

/* a short screen (a phone held sideways): the title, pause and end cards start under the sound buttons in the corner
   (2026-12-01 review: the end card covered them), their bottom + 8px */
@media (max-height: 480px) {
  .overlay:not(.top) { padding-top: calc(max(12px, env(safe-area-inset-top)) + 44px + 8px); padding-bottom: 8px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 44px - 16px); }
}
@media (max-height: 420px) {
  .overlay:not(.top) { padding-top: calc(max(8px, env(safe-area-inset-top)) + 44px + 8px); }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - 44px - 16px); }
  /* (the title card a little tighter, so it fits under them without scrolling) */
  #title .panel { padding-top: 6px; padding-bottom: 6px; width: min(640px, 100%); } #title .how { gap: 2px; }
  /* (the three buttons and "More games" in one row) */
  #title .row-btns { flex-wrap: nowrap; gap: 8px; } #title .row-btns .big-btn { padding-left: 14px; padding-right: 14px; font-size: 17px; }
  #title .ic { width: 24px; height: 24px; }
}
/* a phone held upright: the end card is tall enough to reach the top too, so there as well the cards start under the
   sound buttons (2026-12-01: at 375 × 667 they stood on the end card's heading), and the end card a little tighter */
@media (max-width: 640px) and (min-height: 481px) {
  .overlay:not(.top) { padding-top: calc(max(10px, env(safe-area-inset-top)) + 44px + 8px); padding-bottom: 10px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(10px, env(safe-area-inset-top)) - 44px - 18px); }
}
@media (max-width: 640px) and (min-height: 481px) and (max-height: 760px) {
  .over-card { padding-top: 14px; padding-bottom: 12px; }
  .over-card h2 { margin-bottom: 4px; }
  .over-card .stats { margin-bottom: 6px; } .over-card .stats div { padding: 4px 8px; }
}

/* ---------- Seal Slide ---------- */
/* swiping never scrolls, zooms or goes back a page; the cards' panels and the lists still scroll */
html, body { touch-action: none; overscroll-behavior: none; background: #9fc3e6; }
.panel, .board-list, .book-list { touch-action: pan-y; }
button, a, input { touch-action: manipulation; }
#game { cursor: pointer; }
/* the see-through finger (first pond), drawn over the pond */
#trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#popups { z-index: 2; }
#hud { z-index: 3; }
body[data-card="over"] #hud { visibility: hidden; }
#hud-score { font-variant-numeric: tabular-nums; min-width: 34px; }
.stat b { font-weight: 900; }
/* the HUD: the score; daylight left and the pond; slides against par, the stars it would give, start the pond again */
#hud .hud-score { justify-self: start; }
#hud .hud-day { justify-self: center; gap: 14px; }
#hud .hud-par { justify-self: end; gap: 10px; padding-right: 4px; }
.clock, .pond-n, .slides { display: flex; align-items: center; gap: 5px; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock b, .pond-n b, .slides b { font-weight: 900; }
.slides .lbl { font-size: 15px; font-weight: 800; color: var(--ink-soft); }
.slides .par { font-size: 15px; font-weight: 800; color: var(--ink-soft); margin-left: 2px; }
.slides .par b { color: var(--ink); }
.sun { width: 24px; height: 24px; }
.pond-n svg { width: 24px; height: 24px; }
.pond-n b.pop, .slides b.pop { animation: pop 0.4s ease-out; display: inline-block; }
.hud-day.low .clock b { color: var(--accent-dark); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
.stars-now { color: #e0a024; font-size: 18px; letter-spacing: 1px; line-height: 1; white-space: nowrap; }
.stars-now i { font-style: normal; color: #d9ccb4; }
.icon-btn.small { width: 44px; height: 44px; border-radius: 12px; pointer-events: auto; }
.hud-par .icon-btn.small { width: 40px; height: 40px; box-shadow: 0 2px 0 rgba(120, 80, 40, 0.25); }
.hud-par .icon-btn.small svg { width: 21px; height: 21px; }
.hud-par .icon-btn.small.nudge { animation: nudge 1.1s ease-in-out infinite; border-color: var(--accent); color: var(--accent-dark); }
@keyframes nudge { 50% { transform: scale(1.12) rotate(-20deg); } }
/* (the restart button is 40px drawn, 44px to touch) */
.hud-par .icon-btn.small::after { content: ''; position: absolute; inset: -2px; }
.hud-par .icon-btn.small { position: relative; }

/* floating words over the seal (one at a time) */
.popup.big { font-size: 30px; color: #fff; --ol: #1d3f66; }
.popup.big.gold { color: #ffe27a; --ol: #6b3a00; font-size: 34px; }
.popup.fishname { font-size: 24px; color: #e8f7ff; --ol: #163c60; }
.popup.fishname.new { color: #fff3b0; --ol: #7a3a00; }
.popup.bad { font-size: 26px; color: #ffe0d8; --ol: #7a1a1a; }
.popup.small { font-size: 20px; color: #fffaf0; --ol: #34506e; }

/* the message strip: at the bottom, one line at a time */
.banner, .hint { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); pointer-events: none; text-align: center; z-index: 4; width: max-content; max-width: calc(100vw - 20px); }
.banner {
  padding: 6px 20px; border-radius: 16px; background: rgba(255, 249, 236, 0.96); border: 2px solid var(--gold); box-shadow: var(--shadow);
  animation: bannerIn 0.45s cubic-bezier(.2, 1.4, .5, 1);
}
.banner b { font-size: 19px; font-weight: 900; color: #1f5582; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } }
.hint { font-size: 16px; padding: 7px 16px; font-weight: 800; }

/* how-to-play markers on the title card */
.how li { align-items: center; line-height: 1.35; }
.ic { width: 30px; height: 30px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; }
.ic-swipe { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect x='2' y='9' width='26' height='12' rx='3' fill='%23d9eef8' stroke='%233d7aa6' stroke-width='1.4'/%3E%3Cellipse cx='8' cy='15' rx='4' ry='2.8' fill='%23f4f1ea' stroke='%235b3a1e' stroke-width='1'/%3E%3Cpath d='M14 15h10M20 11.5l4 3.5-4 3.5' fill='none' stroke='%235b3a1e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic-fish { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12' fill='none' stroke='%23f2b53a' stroke-width='3.5'/%3E%3Cpath d='M6 15c3-4 9-5 13-2l4-3v10l-4-3c-4 3-10 2-13-2z' fill='%234f86b8' stroke='%232b4f74' stroke-width='1.2' stroke-linejoin='round'/%3E%3Ccircle cx='10' cy='14.2' r='1.2' fill='%23fff'/%3E%3C/svg%3E"); }
.ic-star { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 3l3.4 7 7.6 1-5.5 5.3 1.3 7.7L15 20.3 8.2 24l1.3-7.7L4 11l7.6-1z' fill='%23f2b53a' stroke='%236b3a00' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.col-btns { display: grid; gap: 10px; }

/* the end card: the kinds of fish that went into the book */
.names { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); line-height: 1.35; }
.stats dt { font-size: 11.5px; }

/* the fish book button on the title and end cards */
.book-btn { display: inline-flex; align-items: center; gap: 6px; }
.book-btn svg { width: 22px; height: 22px; flex: none; }
.book-btn small { font-size: 14px; color: var(--ink-soft); font-weight: 800; }
/* the fish book */
.book-panel { width: min(640px, 100%); }
.book-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: min(60dvh, 520px); overflow: auto; overscroll-behavior: contain; }
.book-list li { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px 7px; border-radius: 12px; background: #fffdf6; border: 1.5px solid #ecdcc3; }
.book-list img { width: 100%; max-width: 130px; height: auto; aspect-ratio: 8 / 5; border-radius: 8px; background: linear-gradient(#e6f4fb, #cfe8f5); }
.book-list b { font-size: 15px; font-weight: 900; line-height: 1.15; text-align: center; }
.book-list small { font-size: 13px; font-weight: 700; color: var(--ink-soft); line-height: 1.2; min-height: 1.2em; }
.book-list .stars { color: #e0a024; font-size: 16px; letter-spacing: 1px; line-height: 1; margin-top: 2px; }
.book-list .stars i { font-style: normal; color: #e3d6bf; }
.book-list li.locked b { color: var(--ink-soft); }
.book-list li.locked img { background: linear-gradient(#d5dde6, #c3ccd8); }
.book-list li.rare { border-color: #e8c468; background: #fff8e2; }
@media (max-width: 560px) { .book-list { grid-template-columns: repeat(3, 1fr); gap: 6px; } }
@media (max-height: 480px) { .book-list { grid-template-columns: repeat(6, 1fr); max-height: calc(100dvh - 150px); } .book-list small { display: none; } .book-panel { width: min(760px, 100%); padding-top: 10px; padding-bottom: 10px; } }

@media (max-width: 640px) {
  /* an upright phone: the score and the day on the first row (the buttons on its right), slides and par on the second */
  #hud { top: max(10px, env(safe-area-inset-top)); left: 8px; right: 8px; padding-right: 0; display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "score day ." "par par par"; gap: 6px; }
  #hud .hud-score { grid-area: score; } #hud .hud-day { grid-area: day; justify-self: start; gap: 8px; } #hud .hud-par { grid-area: par; justify-self: start; }
  #hud > .card { padding: 2px 9px; min-height: 44px; height: 44px; }
  .corner { top: max(10px, env(safe-area-inset-top)); right: 8px; gap: 6px; }
  .stat { font-size: 18px; gap: 4px; } .stat svg { width: 20px; height: 20px; }
  .clock, .pond-n, .slides { font-size: 18px; gap: 3px; } .sun, .pond-n svg { width: 19px; height: 19px; }
  .banner { padding: 5px 14px; } .banner b { font-size: 16px; }
  .hint { font-size: 15px; padding: 6px 12px; }
  .row-btns .big-btn { padding-left: 16px; padding-right: 16px; font-size: 18px; }
  .stats { gap: 6px; margin-bottom: 8px; } .stats div { padding: 5px 8px; } .stats dd { font-size: 21px; }
  .tag-line { margin-bottom: 12px; } .how { margin-bottom: 14px; gap: 8px; }
  .popup.big { font-size: 26px; } .popup.big.gold { font-size: 29px; } .popup.fishname { font-size: 21px; } .popup.bad { font-size: 23px; } .popup.small { font-size: 18px; }
}
/* (a narrow phone: the first row must fit left of the three buttons) */
@media (max-width: 420px) { .stat svg, .sun { display: none !important; } #hud .hud-score, #hud .hud-day { padding: 2px 8px; } }
/* a phone held sideways: a low window; the HUD a column on the left (the messages under it), the buttons a column on the right */
@media (max-height: 420px) {
  #hud { top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: auto; width: 152px; padding-right: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
  #hud > .card { min-height: 0; height: auto; padding: 4px 9px; gap: 6px; border-radius: 12px; justify-content: flex-start; flex-wrap: wrap; }
  #hud .hud-day { gap: 8px; }
  #hud .hud-par { justify-content: space-between; padding: 4px 4px 4px 9px; }
  #hud .stat { font-size: 18px; } #hud .stat svg { width: 18px; height: 18px; display: block; }
  .clock, .pond-n, .slides { font-size: 17px; } .sun, .pond-n svg { width: 18px; height: 18px; display: block !important; }
  .slides .lbl { display: none; }
  .corner { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); flex-direction: column; gap: 6px; }
  .banner, .hint { left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); transform: none; width: 152px; max-width: 152px; text-align: left; }
  @keyframes bannerIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } }
  @keyframes hintIn { from { opacity: 0; transform: translateY(10px); } }
  .banner { padding: 5px 10px; border-radius: 12px; } .banner b { font-size: 15px; line-height: 1.25; display: block; }
  .hint { font-size: 15px; padding: 5px 10px; border-radius: 12px; line-height: 1.3; }
  .panel { padding: 14px 18px 12px; }
  h1 { font-size: 30px; } .tag-line { margin: 4px 0 8px; } .how { gap: 4px; margin-bottom: 8px; font-size: 13px; }
  .over-card { width: min(720px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; padding: 12px 16px; }
  .over-card h2 { font-size: 21px; margin-bottom: 4px; }
  .over-card .newbest { margin: 0 0 6px; font-size: 15px; }
  .over-card .stats { grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 6px; }
  .over-card .stats div { padding: 3px 2px; display: flex; flex-direction: column; justify-content: space-between; } .over-card .stats dd { font-size: 19px; } .over-card .stats dt { font-size: 9.5px; letter-spacing: 0.1px; line-height: 1.15; }
  .over-card .names { font-size: 12.5px; margin-bottom: 4px; }
  .over-card .score { font-size: 16px; } .over-card .score b { font-size: 24px; }
  .over-card .best { margin-top: 4px; font-size: 12.5px; }
  .over-card .post { margin: 0; padding: 8px 10px; }
  .over-card .post-rank { margin-bottom: 3px; font-size: 13.5px; }
  .over-card .post-who { gap: 3px; margin-bottom: 4px; }
  .over-card .row-btns { margin-top: 6px; flex-wrap: nowrap; gap: 6px; }
  .over-card .row-btns .big-btn { padding: 6px 10px; font-size: 16px; flex: 1 1 auto; white-space: nowrap; min-height: 44px; }
  .over-card .book-btn svg { display: none; }
  #title .panel { padding-top: 6px; padding-bottom: 6px; width: min(640px, 100%); } #title .how { gap: 2px; }
  #title .row-btns { flex-wrap: nowrap; gap: 8px; } #title .row-btns .big-btn { padding-left: 14px; padding-right: 14px; font-size: 17px; }
  #title .ic { width: 24px; height: 24px; }
  /* (the cards start right of the HUD column? no: the HUD is hidden behind the cards; they only keep clear of the buttons) */
  .overlay:not(.top) { padding-right: calc(max(8px, env(safe-area-inset-right)) + 44px + 8px); padding-top: 8px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - 16px); }
}
/* (a window wide and tall enough: the four numbers in one row) */
@media (min-width: 421px) and (min-height: 421px) {
  .over-card .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .over-card .stats div { padding: 6px 4px; display: flex; flex-direction: column; justify-content: space-between; }
  .over-card .stats dt { font-size: 10.5px; letter-spacing: 0.3px; line-height: 1.2; }
}
/* a wide window: the title and end cards stand on the right, the bay and the shore on the left */
@media (min-width: 1000px) and (min-height: 600px) {
  #title, #over { justify-items: end; padding-right: 128px; }
}
/* an upright phone: the end card in one screen without scrolling, the four numbers in one row, the three buttons in one row */
@media (max-width: 420px) {
  .over-card h2 { font-size: 21px; margin-bottom: 8px; }
  .panel.over-card { padding-top: 14px; }
  .over-card .stats { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .over-card .stats div { padding: 4px 3px; display: flex; flex-direction: column; justify-content: space-between; }
  .over-card .stats dt { font-size: 10px; letter-spacing: 0.2px; line-height: 1.15; }
  .over-card .stats dd { font-size: 19px; }
  .over-card .names { font-size: 12.5px; line-height: 1.3; margin-bottom: 6px; }
  /* (2026-12-04: at 375 the three were 354px in a 303px row, cut off at both sides: tighter, a little wider than the
     card's padding, and on a still narrower phone the third goes to a second row instead of being cut off) */
  .over-card .row-btns { flex-wrap: wrap; gap: 5px; margin-left: -12px; margin-right: -12px; }
  .over-card .row-btns .big-btn { padding: 8px 6px; font-size: 15px; flex: 1 1 auto; white-space: nowrap; }
  .over-card .book-btn svg { display: none; }
}
