/* Fonts are served from this site (public/fonts), so no third party sees players' visits. */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 600; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }

/* Layout: a naturalist's painted field journal. One phone-width column on paper; a watercolor scene for
   each puzzle sits behind the header, and the board, hand and notes are specimen cards on the page.
   Single light look by choice: the journal has one art direction, set explicitly so it reads on any host theme. */
:root {
  color-scheme: light;
  --paper: #f4ead2;          /* journal page */
  --card: #fbf6ea;           /* specimen cards, notes */
  --ink: #2f3a2c;            /* line work + text */
  --ink-soft: #5b4a36;       /* labels */
  --ink-faint: rgba(47, 58, 44, 0.45);
  --rust: #b5593a;           /* predator, stamps, accents */
  --reach: #3b6e91;          /* squares a tile affects */
  --sage: 138, 163, 123;     /* prey wash (rgb) */
  --rust-w: 196, 104, 70;    /* predator wash (rgb) */
  --ochre: 201, 150, 82;     /* ground wash (rgb) */
  --hab: 222, 182, 120;      /* habitat / label wash (rgb) */
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); scrollbar-gutter: stable; }
/* while a sheet is open the page behind it stays put; only the sheet scrolls */
html.sheet-open, html.sheet-open body { overflow: hidden; }
body {
  margin: 0; min-height: 100%; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 34% at 50% 100%, rgba(var(--ochre), 0.26), rgba(var(--ochre), 0) 70%), var(--paper);
}
body[data-scene="reef"] { background: radial-gradient(120% 34% at 50% 100%, rgba(106, 174, 179, 0.24), rgba(106, 174, 179, 0) 70%), var(--paper); }
body[data-scene="night"] { background: radial-gradient(120% 34% at 50% 100%, rgba(79, 106, 90, 0.24), rgba(79, 106, 90, 0) 70%), var(--paper); }
body[data-scene="ice"] { background: radial-gradient(120% 34% at 50% 100%, rgba(140, 178, 200, 0.24), rgba(140, 178, 200, 0) 70%), var(--paper); }
body[data-scene="pond"] { background: radial-gradient(120% 34% at 50% 100%, rgba(120, 170, 150, 0.24), rgba(120, 170, 150, 0) 70%), var(--paper); }
body[data-scene="jungle"] { background: radial-gradient(120% 34% at 50% 100%, rgba(95, 138, 82, 0.26), rgba(95, 138, 82, 0) 70%), var(--paper); }
body[data-scene="outback"] { background: radial-gradient(120% 34% at 50% 100%, rgba(200, 105, 63, 0.24), rgba(200, 105, 63, 0) 70%), var(--paper); }
body[data-scene="meadow"] { background: radial-gradient(120% 34% at 50% 100%, rgba(140, 170, 100, 0.26), rgba(140, 170, 100, 0) 70%), var(--paper); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(85% 70% at 50% 42%, rgba(176, 138, 82, 0) 60%, rgba(176, 138, 82, 0.18) 100%); }
.scene { position: absolute; left: 0; right: 0; top: 0; height: 280px; z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%); }
.scene svg { width: 100%; height: 100%; display: block; }

.app {
  position: relative; z-index: 1; max-width: 440px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ---------- header ---------- */
.top { width: 100%; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: rgba(251, 246, 234, 0.72);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 22px; padding: 0;
}
.icon-btn svg { width: 20px; height: 20px; }
.logo { margin: 0; justify-self: center; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 52px; line-height: 1; letter-spacing: 0.01em; }
.dayline { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -6px; }
.plate { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a4f33; }
.stamp-tag { font-family: var(--mono); font-weight: 600; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust); border: 1.5px solid var(--rust); padding: 2px 7px; transform: rotate(-2deg); }

/* ---------- score label ---------- */
.scorebar {
  width: min(100%, 320px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: linear-gradient(180deg, rgba(var(--hab), 0.4), rgba(var(--hab), 0.2)), #f8f0dc;
  border: 1.3px solid var(--ink); border-radius: 3px; transform: rotate(-0.6deg); box-shadow: 2px 3px 0 rgba(47, 58, 44, 0.14);
}
.stat { display: flex; flex-direction: column; align-items: center; padding: 7px 4px 8px; min-width: 0; }
.stat + .stat { border-left: 1px solid rgba(47, 58, 44, 0.3); }
.stat .lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a4f33; }
.stat .num { font-weight: 600; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.stat .num.perfect { font-style: italic; color: var(--rust); }
.stat .num.bump { animation: bump .3s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.restore { margin-top: 2px; border: 0; background: none; padding: 0; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.restore:disabled { opacity: 0; cursor: default; }

/* ---------- board ---------- */
.board-wrap { width: 100%; display: flex; justify-content: center; margin-top: 18px; }
.board { width: min(100%, 380px); display: grid; gap: 8px; padding: 2px; }
.board.mini { width: min(100%, 270px); gap: 5px; }
.cell {
  aspect-ratio: 1; padding: 4px; min-width: 0; position: relative; display: grid; place-items: center;
  border: 1px solid rgba(47, 58, 44, 0.45); border-radius: 6px;
  background: radial-gradient(ellipse at 50% 55%, rgba(var(--ochre), 0.34) 0%, rgba(var(--ochre), 0.12) 72%, rgba(var(--ochre), 0.05) 100%);
}
body[data-scene="reef"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(226, 196, 138, 0.42) 0%, rgba(226, 196, 138, 0.16) 72%, rgba(226, 196, 138, 0.06) 100%); }
body[data-scene="night"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(127, 154, 108, 0.32) 0%, rgba(127, 154, 108, 0.12) 72%, rgba(127, 154, 108, 0.05) 100%); }
body[data-scene="ice"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(206, 220, 228, 0.6) 0%, rgba(206, 220, 228, 0.25) 72%, rgba(206, 220, 228, 0.1) 100%); }
body[data-scene="pond"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(150, 180, 120, 0.34) 0%, rgba(150, 180, 120, 0.13) 72%, rgba(150, 180, 120, 0.05) 100%); }
body[data-scene="jungle"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(126, 168, 98, 0.34) 0%, rgba(126, 168, 98, 0.13) 72%, rgba(126, 168, 98, 0.05) 100%); }
body[data-scene="outback"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(214, 128, 82, 0.36) 0%, rgba(214, 128, 82, 0.14) 72%, rgba(214, 128, 82, 0.05) 100%); }
body[data-scene="meadow"] .cell { background: radial-gradient(ellipse at 50% 55%, rgba(169, 192, 138, 0.38) 0%, rgba(169, 192, 138, 0.14) 72%, rgba(169, 192, 138, 0.05) 100%); }
.cell.rock { cursor: default; }
.cell.rock svg { width: 62%; height: 62%; }
.cell.target::before { content: ''; position: absolute; inset: 5px; border: 1.5px dashed rgba(47, 58, 44, 0.5); border-radius: 4px; pointer-events: none; }
.board .cell.preview { background: radial-gradient(ellipse at 50% 55%, rgba(var(--sage), 0.55), rgba(var(--sage), 0.22)); }
.cell.reach::after, .cell.reach-rock::after { content: ''; position: absolute; inset: 3px; border: 2px dashed var(--reach); border-radius: 4px; pointer-events: none; }
.board .cell.reach { background: radial-gradient(ellipse at 50% 55%, rgba(59, 110, 145, 0.16), rgba(59, 110, 145, 0.05)); }
.cell.reach-rock::after { opacity: .4; }
.cell.src .tile, .cell .tile.sel { box-shadow: 0 0 0 2px var(--rust), 2px 2px 0 rgba(47, 58, 44, 0.16); }
.board.mini .cell { padding: 2px; border-radius: 4px; }

/* ---------- specimen cards ---------- */
.tile {
  width: 100%; height: 100%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: 3px 2px; background: var(--card); border: 1.2px solid var(--ink); border-radius: 4px; box-shadow: 2px 2px 0 rgba(47, 58, 44, 0.16);
  transition: transform .14s ease, box-shadow .14s ease;
}
.tile.k-prey { background: linear-gradient(180deg, rgba(var(--sage), 0.42), rgba(var(--sage), 0.18)), var(--card); }
.tile.k-pred { background: linear-gradient(180deg, rgba(var(--rust-w), 0.4), rgba(var(--rust-w), 0.17)), var(--card); }
.tile .art { width: 60%; max-height: 58%; flex: none; overflow: visible; }
.tile .nm { font-style: italic; font-weight: 600; font-size: 13px; line-height: 1.05; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .lat { font-family: var(--mono); font-size: 7.5px; line-height: 1.5; color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .pts {
  position: absolute; top: -9px; left: -9px; z-index: 2; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px;
  background: var(--card); border: 1.2px solid var(--ink); display: grid; place-items: center;
  font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums lining-nums;
}
/* habitats painted into the ground, not on cards */
.tile.hab { background: none; border: 0; box-shadow: none; }
.tile.hab .art { width: 82%; max-height: 74%; }
.tile.hab .nm { font-size: 12px; }
.hab-tag { position: absolute; right: 0; top: 0; z-index: 2; font-family: var(--mono); font-size: 9.5px; line-height: 1; padding: 2px 5px; background: #f8f0dc; border: 1px solid var(--ink); }
.tile.water { background: radial-gradient(ellipse at 50% 35%, rgba(150, 196, 206, 0.55), rgba(84, 146, 166, 0.85)); border-width: 1.4px; border-radius: 22px; box-shadow: none; }
.tile.water .art { width: 80%; }
.tile.water .hab-tag { left: 50%; right: auto; top: -10px; transform: translateX(-50%); }
.tile.water .nm { color: #f8f0dc; }
.tile.hedge { background: radial-gradient(ellipse at 50% 40%, rgba(126, 168, 98, 0.5), rgba(95, 138, 82, 0.8)); border-width: 1.4px; border-radius: 14px; box-shadow: none; }
.tile.hedge .art { width: 84%; max-height: 70%; }
.tile.hedge .hab-tag { left: 50%; right: auto; top: -10px; transform: translateX(-50%); }
.tile.hedge .nm { color: #f8f0dc; }
.border-piece.horiz .tile { flex-direction: row; gap: 6px; }
.border-piece.horiz .tile .art { width: auto; height: 70%; max-height: 70%; flex: none; }
.tile.vert .nm { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 14px; max-height: none; margin-top: 6px; }
.border-piece { border: none; background: none; padding: 0; min-width: 0; min-height: 0; display: block; cursor: help; }
.border-piece.hov .tile, .cell.fixedcell.hov .tile { box-shadow: 0 0 0 2px var(--rust); }
.cell.fixedcell { cursor: help; }

/* eaten: faded drawing, rust stamp */
.tile.eaten .art { filter: grayscale(1); opacity: .35; }
.tile.eaten .nm { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .7; }
.eaten-tag {
  position: absolute; left: 50%; top: 42%; z-index: 2; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--mono); font-weight: 600; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--rust); border: 1.5px solid var(--rust); padding: 1px 5px; background: rgba(251, 246, 234, 0.85); white-space: nowrap;
}
.board.mini .tile .nm, .board.mini .tile .lat, .board.mini .hab-tag { display: none; }
.board.mini .tile .art { width: 72%; max-height: 72%; }
.board.mini .eaten-tag { font-size: 7.5px; padding: 0 3px; }

/* hover lift */
@media (hover: hover) {
  .cell[data-cell]:hover .tile { transform: translateY(-4px) rotate(-1deg); box-shadow: 3px 6px 0 rgba(47, 58, 44, 0.2); }
  .border-piece:hover .tile, .cell.fixedcell:hover .tile.hab { transform: translateY(-3px); }
  .hand .slot:hover .tile.tile { transform: translateY(-12px) rotate(0deg) scale(1.05); box-shadow: 3px 8px 0 rgba(47, 58, 44, 0.2); }
  .hand .slot:hover { z-index: 3; }
  body.is-dragging .cell[data-cell]:hover .tile, body.is-dragging .hand .slot:hover .tile { transform: none; box-shadow: 2px 2px 0 rgba(47, 58, 44, 0.16); }
}

/* drag and drop */
.hand .slot, .cell[data-cell] { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hand .slot { cursor: grab; }
.cell[data-cell]:has(.tile) { cursor: grab; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.tile.dragging { opacity: .25; transform: none !important; }
.ghost { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; will-change: transform; }
.ghost .tile { box-shadow: 5px 10px 0 rgba(47, 58, 44, 0.18), 0 14px 26px rgba(47, 58, 44, 0.22); transition: none; }
.ghost .tile .lat { display: none; }

/* ---------- survey (the one daily submit) ---------- */
.survey {
  width: min(100%, 260px); margin-top: 4px; padding: 8px 12px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1.5px solid var(--ink); border-radius: 6px; color: #1f2a1d; box-shadow: 2px 3px 0 rgba(47, 58, 44, 0.2);
  background: linear-gradient(180deg, rgba(var(--sage), 0.72), rgba(118, 145, 104, 0.78)), var(--paper);
}
.survey b { font-style: italic; font-weight: 600; font-size: 27px; line-height: 1; }
.survey small { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.survey:disabled { background: rgba(251, 246, 234, 0.6); border-style: dashed; color: var(--ink-soft); box-shadow: none; cursor: default; }
/* the field-guide button sits left of Survey; an empty third column keeps Survey centred under the board */
.actions { width: 100%; margin-top: 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.actions .survey { margin-top: 0; width: 260px; max-width: calc(100vw - 172px); }
.guide-btn {
  justify-self: end; width: 60px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); box-shadow: 2px 3px 0 rgba(47, 58, 44, 0.2); transition: transform .14s ease;
}
.guide-btn svg { width: 25px; height: 25px; }
.guide-btn small { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
@media (hover: hover) { .guide-btn:hover { transform: translateY(-2px); } }
.sheet p.sheet-sub { margin-top: -8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a4f33; }

/* ---------- hand: specimens waiting to be placed ---------- */
.hand { width: 100%; display: flex; justify-content: center; flex-wrap: nowrap; min-height: 92px; padding-top: 12px; }
.hand .slot { flex: 0 1 68px; min-width: 0; height: 82px; border: none; background: none; padding: 0; position: relative; }
.hand .slot + .slot { margin-left: -4px; }
.hand .slot .tile .art { width: 72%; max-height: 62%; }
.hand .slot .tile .nm { font-size: clamp(10px, 3vw, 12px); white-space: normal; line-height: 1; max-height: 2.1em; }
.hand .slot .tile .lat { display: none; }
.hand .slot .tile .nm.long, .step-art .demo .tile .nm.long { font-size: clamp(8.5px, 2.4vw, 10.5px); letter-spacing: -0.02em; }
.hand .slot::before { content: ''; position: absolute; left: 50%; top: -4px; z-index: 2; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--rust); border: 1.1px solid var(--ink); }
.hand .slot:nth-child(odd) .tile { transform: rotate(-3deg); }
.hand .slot:nth-child(even) .tile { transform: rotate(2.5deg) translateY(3px); }
.hand .slot.sel { z-index: 2; }
.hand .slot.sel .tile { transform: translateY(-10px) rotate(0deg); box-shadow: 0 0 0 2px var(--rust), 2px 4px 0 rgba(47, 58, 44, 0.18); }
.hand-done { align-self: center; color: var(--ink-soft); font-style: italic; font-size: 16px; text-align: center; }
.hand-tools { min-height: 20px; display: flex; justify-content: center; gap: 18px; }
.clear { color: var(--ink-soft); background: none; border: none; text-decoration: underline; text-underline-offset: 2px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px; }
.hint { margin: 0; font-style: italic; font-size: 15px; color: var(--ink-soft); text-align: center; text-wrap: balance; }
.foot-link { margin-top: 2px; border: 0; background: none; padding: 4px; font-style: italic; font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(181, 89, 58, 0.6); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
@media (hover: hover) { .foot-link:hover { color: var(--rust); } }
.foot-mini { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sheet p.next-up { margin: -4px 0 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust); }
.next-up .big-btn { letter-spacing: 0; text-transform: none; font-family: var(--serif); }
.prose { display: flex; flex-direction: column; gap: 10px; }
.prose p { font-size: 17px; }
.prose a { color: var(--ink); text-decoration-color: var(--rust); text-underline-offset: 2px; }
.foot-note { margin: 0; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); opacity: .8; text-align: center; }

/* ---------- note card on hover ---------- */
.tip {
  position: fixed; z-index: 20; pointer-events: none; width: min(276px, calc(100vw - 16px));
  background: var(--card); border: 1.3px solid var(--ink); border-radius: 4px; box-shadow: 3px 4px 0 rgba(47, 58, 44, 0.18);
  padding: 10px 12px 11px; display: flex; flex-direction: column; gap: 5px; animation: pop .12s ease-out;
}
.tip::after { content: ''; position: absolute; left: var(--cx, 50%); bottom: -7px; width: 11px; height: 11px; background: var(--card); border-right: 1.3px solid var(--ink); border-bottom: 1.3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.tip.below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(225deg); }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
.tip .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tip .kind { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a4f33; }
.sw { width: 11px; height: 11px; border: 1px solid var(--ink); display: inline-block; flex: none; }
.sw.k-prey { background: rgba(var(--sage), 0.7); } .sw.k-pred { background: rgba(var(--rust-w), 0.7); } .sw.k-habitat { background: rgba(var(--hab), 0.8); }
.pts-note { font-weight: 600; font-size: 17px; }
.tip .nm { font-style: italic; font-weight: 600; font-size: 21px; line-height: 1.05; }
.tip .lat { font-family: var(--mono); font-size: 9px; color: var(--ink-soft); margin-top: -3px; }
.tip .body { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid rgba(47, 58, 44, 0.3); padding-top: 7px; margin-top: 2px; }
.tip .rule { font-weight: 600; font-size: 17px; line-height: 1.2; }
.tip .reach { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: #6a4f33; }
.tip .reach svg { width: 32px; height: 32px; }
.tip .hunt { font-style: italic; font-size: 15px; line-height: 1.25; color: var(--rust); padding-left: 8px; border-left: 2px solid var(--rust); }
.tip .note { font-family: var(--mono); font-size: 9.5px; line-height: 1.45; color: var(--ink-soft); }

/* ---------- sheets: how to play, results, puzzles ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10; background: rgba(47, 42, 30, 0.42); display: flex; align-items: flex-end; justify-content: center;
  padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  overscroll-behavior: contain;
}
.sheet {
  width: min(100%, 440px); max-height: 92%; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink);
  border: 1.3px solid var(--ink); border-bottom: none; border-radius: 4px 4px 0 0;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease-out;
}
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-bottom: 1.3px solid var(--ink); border-radius: 4px; box-shadow: 4px 6px 0 rgba(47, 58, 44, 0.2); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { margin: 0; font-style: italic; font-weight: 600; font-size: 30px; line-height: 1.05; text-align: center; text-wrap: balance; }
.sheet p { margin: 0; line-height: 1.4; font-size: 18px; }
.center { text-align: center; }
.big-btn {
  border: 1.3px solid var(--ink); border-radius: 4px; padding: 8px 18px; font-style: italic; font-weight: 600; font-size: 21px;
  background: linear-gradient(180deg, rgba(var(--sage), 0.65), rgba(118, 145, 104, 0.7)), var(--paper); box-shadow: 2px 3px 0 rgba(47, 58, 44, 0.18);
}
.big-btn.plain { background: var(--card); }
a.big-btn { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
/* What's coming: a numbered field-journal list */
.roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.roadmap li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid rgba(47, 58, 44, 0.25); }
.roadmap li:last-child { border-bottom: 1px solid rgba(47, 58, 44, 0.25); }
.roadmap .no { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rust); }
.roadmap b { font-style: italic; font-weight: 600; font-size: 20px; line-height: 1.15; }
.roadmap li p { margin: 2px 0 0; font-size: 16px; line-height: 1.35; color: var(--ink-soft); }
.sheet p.form-note { margin-top: -6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--ink-soft); }
.big-btn:disabled { opacity: .4; cursor: default; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.small-btn { border: 1.2px solid var(--ink); background: var(--card); border-radius: 3px; padding: 4px 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

.grade-box { display: flex; align-items: center; justify-content: center; gap: 18px; }
.grade {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; transform: rotate(-8deg); flex: none;
  border: 2.5px solid var(--rust); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--rust);
  color: var(--rust); font-weight: 600; font-size: 40px; line-height: 1;
}
.score-line { font-weight: 600; font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.score-line small { display: block; margin-top: 4px; font-style: italic; font-weight: 500; font-size: 17px; color: var(--ink-soft); }
.ladder { display: flex; justify-content: center; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.ladder span { padding-bottom: 2px; border-bottom: 1.5px solid transparent; }
.ladder span.on { color: var(--rust); font-weight: 600; border-bottom-color: var(--rust); }
.seg { display: flex; justify-content: center; }
.seg button { border: 1.2px solid var(--ink); background: var(--card); padding: 5px 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.seg button + button { border-left: 0; }
.seg button[aria-pressed="true"] { background: rgba(var(--sage), 0.55); }
.share { display: flex; gap: 8px; align-items: center; }
.share input { flex: 1; min-width: 0; border: 1.2px solid var(--ink); border-radius: 3px; padding: 8px 10px; background: var(--card); font-family: var(--mono); font-size: 13px; color: var(--ink); }
/* score breakdown: one small ledger card per animal, in board order */
.ledger { display: flex; flex-direction: column; gap: 8px; }
.ledger h3 { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #6a4f33; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lcard { background: var(--card); border: 1px solid rgba(47, 58, 44, 0.55); border-left: 4px solid rgba(var(--sage), 0.95); border-radius: 3px; padding: 6px 9px 6px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lcard.k-pred { border-left-color: rgba(var(--rust-w), 0.95); }
.lcard.is-eaten { background: rgba(251, 246, 234, 0.6); }
.lname { font-style: italic; font-weight: 600; font-size: 17px; line-height: 1.15; margin-bottom: 2px; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.6em; gap: 6px; align-items: baseline; font-family: var(--mono); font-size: 10px; line-height: 1.5; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lrow span:first-child { overflow-wrap: break-word; }
.lrow b { text-align: right; font-weight: 600; color: var(--ink); }
.lrow.struck span:first-child, .lrow.struck b { text-decoration: line-through; opacity: .6; }
.lrow.eaten span:first-child, .lrow.eaten b { color: var(--rust); }
.lrow.ltotal { margin-top: 3px; padding-top: 3px; border-top: 1px solid rgba(47, 58, 44, 0.3); color: var(--ink); font-weight: 600; font-size: 10.5px; }
.ledger-sum { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; border-top: 1.3px solid var(--ink); font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a4f33; }
.ledger-sum b { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.facts { display: flex; flex-direction: column; gap: 0; }
.facts h3 { margin: 0 0 4px; font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #6a4f33; }
.fact { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid rgba(47, 58, 44, 0.25); }
.fact .face { width: 54px; height: 60px; }
.fact .face .tile .lat, .fact .face .tile .nm { display: none; }
.fact .face .tile .art { width: 82%; max-height: 82%; }
.fact > div > b { font-style: italic; font-weight: 600; font-size: 19px; line-height: 1.1; }
.fact .flat { font-family: var(--mono); font-size: 9px; color: var(--ink-soft); }
.fact p { font-size: 16px; line-height: 1.35; }
.fact .calc { font-family: var(--mono); font-size: 10px; line-height: 1.5; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.fact .calc b { font-weight: 600; font-size: 11px; color: var(--ink); }
.fact > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.chip + .chip::before { content: '·'; margin-right: 1px; }
.chip .sw { width: 9px; height: 9px; }

.step-art { display: flex; justify-content: center; gap: 12px; min-height: 96px; align-items: center; }
.step-art .demo { width: 78px; height: 90px; }
.step-art .demo .tile .lat { display: none; }
.step-art .demo .tile .nm { font-size: 12px; }
.step-art svg.reach-big { width: 72px; height: 72px; }
.step-art .reach-demo { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.step-art .reach-demo + .reach-demo { margin-left: 40px; }
.step-art .reach-demo figcaption { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #6a4f33; }
.dots { display: flex; justify-content: center; gap: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink); display: block; }
.dots i.on { background: var(--rust); border-color: var(--rust); }
.past { display: flex; flex-direction: column; }
.past button { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left; border: 0; border-bottom: 1px dotted var(--ink); background: none; padding: 10px 4px; }
.past button[aria-current="true"] { background: rgba(var(--sage), 0.28); }
.past .t { font-style: italic; font-weight: 600; font-size: 19px; }
.past .d { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- ambient life in the painted scenes ---------- */
.zk-drift { animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(34px); } }
.zk-bubbles { animation: bubble 7s linear infinite; transform-box: fill-box; }
.zk-late { animation-delay: -3.5s; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
.zk-snow { animation: snow 9s linear infinite; }
@keyframes snow { 0% { transform: translate(0, -20px); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(14px, 110px); opacity: 0; } }
.zk-flies circle { animation: blink 3.2s ease-in-out infinite; }
.zk-flies circle:nth-child(2) { animation-delay: -1s; } .zk-flies circle:nth-child(3) { animation-delay: -2.1s; } .zk-flies circle:nth-child(4) { animation-delay: -0.5s; }
@keyframes blink { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
