@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f8f8fc;
  --white: #ffffff;
  --ink: #272631;
  --muted: #696675;
  --line: #e4e2ed;
  --line-strong: #d3cede;
  --accent: #6946dc;
  --accent-hover: #5936c6;
  --on-accent: #ffffff;
  --soft: #f0edfb;
  --surface: #faf9fd;
  --lime: #ded4ff;
  --green: var(--accent);
  --halo: #ece7ff80;
  --dot: #d5cfea80;
  --header: #f8f8fce6;
  --ring: #9476ee33;
  --backdrop: #17142166;
  --error-surface: #fff3ed;
  --error-ink: #9a482b;
  --error-line: #f1d5c8;
  --shadow-sm: 0 2px 5px #24203305, 0 8px 24px #24203304;
  --shadow: 0 4px 8px #24203304, 0 18px 50px #3a2b6408;
  --shadow-lg: 0 24px 90px #18122224;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101118;
  --white: #1b1b27;
  --ink: #f2f0fa;
  --muted: #b0abbf;
  --line: #34313f;
  --line-strong: #4b435c;
  --accent: #a78bfa;
  --accent-hover: #bda7ff;
  --on-accent: #191224;
  --soft: #2c253f;
  --surface: #20202c;
  --lime: #4b3a72;
  --halo: #4d2d7e22;
  --dot: #8e77bc26;
  --header: #101118e8;
  --ring: #a78bfa38;
  --backdrop: #06050b99;
  --error-surface: #39251f;
  --error-ink: #f0baa2;
  --error-line: #694638;
  --shadow-sm: 0 2px 6px #00000014, 0 8px 24px #00000014;
  --shadow: 0 4px 8px #00000010, 0 18px 50px #00000024;
  --shadow-lg: 0 24px 90px #00000066;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 50% 0, var(--halo), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size:
    100% 650px,
    24px 24px;
  background-repeat: no-repeat, repeat;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
input:disabled {
  opacity: 0.6;
  cursor: wait;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button,
input {
  touch-action: manipulation;
}
a {
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
button,
a,
input {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--accent);
}
[hidden] {
  display: none !important;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
}
.skip-link:focus {
  top: 12px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 40;
}
.header-inner {
  min-height: 76px;
  max-width: 1280px;
  padding: 0 40px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  width: max-content;
  white-space: nowrap;
}
.brand img {
  width: 36px;
  height: 36px;
}
.brand strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.8px;
  line-height: 1.1;
  font-weight: 800;
}
.brand small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
.brand-period {
  color: var(--accent);
}
.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.main-nav a {
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition:
    color 0.2s,
    background 0.2s;
}
.main-nav a:hover {
  background: var(--white);
  color: var(--ink);
}
.main-nav a.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.nav-dot {
  display: inline-block;
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}
.main-nav a:not(.active) .nav-dot {
  display: none;
}
.header-actions {
  justify-self: end;
  display: flex;
  gap: 5px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  transition:
    background 0.2s,
    color 0.2s;
}
.icon-button:hover {
  background: var(--soft);
  color: var(--accent);
}
.icon-button svg {
  width: 20px;
  height: 20px;
}

.main-content {
  max-width: 1280px;
  padding: 0 40px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 42px 0 30px;
  gap: 14px;
  flex-direction: column;
  text-align: center;
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: var(--accent);
  line-height: 1.6;
  justify-content: center;
}
.eyebrow-divider {
  font-weight: 400;
  color: var(--muted);
  margin: 0 2px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--soft);
  margin-right: 2px;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 58px);
  letter-spacing: -2px;
  font-weight: 400;
  line-height: 1.08;
  margin: 14px 0 0;
}
h1 em {
  font-weight: 400;
  color: var(--accent);
  font-style: normal;
}
.heading-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  padding-bottom: 0;
  min-width: 0;
}
.note-rule {
  display: none;
  width: 27px;
  height: 1px;
  background: var(--soft);
  margin-bottom: 11px;
}
/* Keep the active game ahead of its introduction; other pages retain their
   editorial headings and spacing. */
#game-view .page-heading {
  padding: 24px 0 22px;
  gap: 8px;
}
#game-view h1 {
  font-size: clamp(26px, 3.3vw, 40px);
  line-height: 1.2;
  letter-spacing: -1px;
  margin-top: 8px;
}
html[lang="zh-CN"] #game-view h1 {
  font-size: clamp(26px, 2.9vw, 36px);
  line-height: 1.35;
  letter-spacing: 0;
}
#game-view .heading-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  font-size: 13px;
  line-height: 1.6;
}
#game-view .heading-note br {
  display: none;
}
.play-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.play-card {
  position: relative;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  padding: 26px;
  box-shadow: var(--shadow);
}
.play-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.1px;
}
.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.streak-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.streak-badge strong {
  font-weight: 600;
  color: var(--ink);
}
.attempt-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 16px;
}
.attempt-summary > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.attempt-summary strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -1px;
}
.attempt-summary > span:first-child > span {
  font-size: 12px;
  color: var(--muted);
}
.attempt-fraction {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 3px;
  font-variant-numeric: tabular-nums;
}
.attempt-dots {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
}
.attempt-dots > * {
  height: 6px;
  min-width: 0;
  border-radius: 3px;
  background: var(--lime);
}
.attempt-dots .used,
.attempt-dots .spent,
.attempt-dots [data-used="true"] {
  background: var(--soft);
}
.attempt-dots .hint,
.attempt-dots .penalty {
  background: var(--soft);
}
.attempt-dots .correct,
.attempt-dots .won {
  background: var(--accent);
}
.play-intro {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 16px 0 0;
  max-width: 280px;
}
.guess-form {
  margin-top: 16px;
}
.guess-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 9px;
  color: var(--ink);
}
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  top: 14px;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
#animal-search {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 12px;
  height: 48px;
  padding: 0 12px 0 40px;
  width: 100%;
  color: var(--ink);
  font-size: 14px;
  transition:
    border 0.2s,
    box-shadow 0.2s;
}
#animal-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--white);
}
#animal-search::placeholder,
#guide-search::placeholder {
  color: var(--muted);
}
.input-help {
  margin: 7px 0 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s,
    background 0.15s,
    box-shadow 0.15s;
  background: var(--white);
  border-color: var(--line-strong);
  color: var(--ink);
}
.primary-button {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 2px 3px var(--ring);
}
.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 5px 16px var(--ring);
  transform: translateY(-1px);
}
.primary-button:active:not(:disabled) {
  transform: translateY(0);
}
.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}
.guess-button {
  width: 100%;
  justify-content: space-between;
  padding-left: 17px;
  padding-right: 15px;
}
.secondary-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.secondary-button:hover {
  background: var(--soft);
  border-color: var(--accent);
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  margin: 0;
  list-style: none;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 30;
}
.search-results li,
.search-results [role="option"] {
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.5;
}
.search-results li:hover,
.search-results [aria-selected="true"],
.search-results .active {
  background: var(--soft);
}
.search-results li small,
.search-results [role="option"] small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.search-results .search-empty {
  color: var(--muted);
  cursor: default;
  padding: 13px;
}
.extra-actions {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  gap: 13px;
}
.hint-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  min-height: 44px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.hint-button svg {
  width: 14px;
  height: 14px;
  color: currentColor;
}
.hint-button:hover:not(:disabled) {
  background: var(--lime);
  border-color: var(--accent);
}
.hint-button:disabled {
  border-style: dashed;
  background: transparent;
}
.hint-cost {
  font-size: 12px;
  color: var(--ink);
  margin-left: 3px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.text-button {
  background: none;
  border: 0;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  color: var(--muted);
}
.text-button:hover {
  color: var(--ink);
}
.daily-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.daily-reset svg {
  width: 12px;
  height: 12px;
}
.daily-reset strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35px;
  color: var(--ink);
}
.feedback-card {
  padding: 13px 15px;
  margin-top: 13px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}
.feedback-card.error {
  background: var(--error-surface);
  color: var(--error-ink);
  border-color: var(--error-line);
}
.feedback-card strong {
  font-weight: 600;
}

#game-view .feedback-card {
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}
.feedback-best {
  display: block;
  color: var(--accent);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}
.feedback-next {
  display: block;
  margin: 6px 0 0;
}
.feedback-notice {
  margin: 0 0 10px;
  padding: 7px 10px;
  border-left: 3px solid var(--error-line);
  border-radius: 6px;
  background: var(--error-surface);
  color: var(--error-ink);
  font-size: 12px;
  line-height: 1.6;
}
.feedback-latest {
  display: block;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.feedback-latest > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 600;
}
.feedback-details {
  margin-top: 8px;
}
.feedback-details > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  padding: 5px 0;
}
.feedback-details .reasoning-note {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 6px;
}
.feedback-actions .text-button {
  min-height: 36px;
  padding: 5px 0;
}
.feedback-card [data-action="continue-guess"] {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.tree-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tree-toolbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.tree-toolbar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.tree-toolbar-title > svg {
  color: var(--accent);
  width: 18px;
  height: 18px;
}
.tree-toolbar h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.small-pill {
  font-size: 12px;
  letter-spacing: 0.6px;
  font-weight: 600;
  background: var(--soft);
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--accent);
  white-space: nowrap;
}
.view-toggle {
  display: flex;
  padding: 3px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.view-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.view-toggle svg {
  width: 12px;
  height: 12px;
}
.view-toggle button.active,
.view-toggle button[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.tree-view {
  flex: 1;
  min-height: 300px;
  position: relative;
  overflow: auto;
  background-image: radial-gradient(
    circle at 1px 1px,
    var(--dot) 1px,
    transparent 0
  );
  background-size: 22px 22px;
}
.tree-empty {
  width: 100%;
  position: relative;
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seed-tree {
  width: 100%;
  max-width: 680px;
  height: 190px;
  object-fit: contain;
  object-position: bottom;
  margin-top: 3px;
  animation: grow-in 0.9s ease-out both;
}
.tree-empty-copy {
  text-align: center;
  margin: 0 16px 22px;
  position: relative;
}
.tiny-label {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--accent);
  font-weight: 500;
}
.tree-empty-copy h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.6px;
  margin: 7px 0 5px;
}
.tree-empty-copy p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}
#tree-scroll-hint {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.tree-content {
  padding: 24px;
  min-height: 300px;
}
.tree-content:empty {
  display: none;
}
.tree-content svg {
  width: 100%;
  height: auto;
  min-height: 300px;
  overflow: visible;
}
.tree-edge {
  stroke: var(--line-strong);
  stroke-width: 2;
  fill: none;
}
.tree-edge[stroke-width="3"] {
  stroke: var(--accent);
  stroke-width: 3;
}
.tree-node {
  fill: var(--on-accent);
  stroke: var(--line);
  stroke-width: 1;
}
.tree-node.guess {
  fill: var(--muted);
}
.tree-node.shared {
  fill: var(--muted);
  stroke: var(--line);
}
.tree-node.target,
.tree-node.correct {
  fill: var(--muted);
  stroke: var(--line);
}
.tree-content .tree-svg {
  width: 100%;
  min-width: 520px;
}
.tree-node--shared {
  fill: var(--muted);
  stroke: var(--line);
}
.tree-node--guess {
  fill: var(--on-accent);
  stroke: var(--line);
  cursor: pointer;
}
.tree-node--mystery {
  fill: var(--muted);
  stroke: var(--line);
  stroke-dasharray: 4 4;
}
.tree-node--won {
  fill: var(--muted);
  stroke: var(--line);
}
.tree-node-label,
.tree-branch-label {
  font-family: var(--sans);
  fill: var(--ink);
  stroke: none;
  font-size: 12px;
}
.tree-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  min-height: 43px;
  padding: 10px 15px;
  color: var(--muted);
  font-size: 12px;
}
.tree-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tree-legend i {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  display: inline-block;
}
.legend-guess {
  background: var(--soft);
}
.legend-shared {
  background: var(--accent);
}
.legend-mystery {
  font-weight: 700;
  color: var(--accent);
}
.legend-mystery span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}
.table-view {
  flex: 1;
  min-height: 418px;
  padding: 12px 22px;
  overflow-x: auto;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.history-table th {
  font-size: 12px;
  letter-spacing: 0.35px;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.history-table td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.history-table small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.table-empty {
  text-align: center;
  margin-top: 100px;
  color: var(--muted);
  font-size: 12px;
}
.history-table:has(tbody:not(:empty)) + .table-empty {
  display: none;
}
.table-sort {
  display: flex;
  gap: 5px;
  padding: 5px 0 8px;
}
.table-sort button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}
.table-sort button.active,
.table-sort button[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

.recent-section {
  margin-top: 27px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}
.section-heading h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.section-heading .section-label {
  font-size: 12px;
  color: var(--muted);
}
.history-empty {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 15px 0 0;
}
.empty-line {
  width: 17px;
  height: 1px;
  background: var(--soft);
  flex: 0 0 auto;
}
.recent-guesses {
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-guesses li,
.guess-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 9px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-guesses small {
  color: var(--muted);
  font-size: 12px;
}
.recent-guesses .guess-number {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.recent-guesses .correct {
  background: var(--soft);
  border-color: var(--line);
}
.trail-chip strong {
  font-size: 13px;
  font-weight: 500;
}
.trail-chip small {
  display: block;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.how-section {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 30px;
  margin-top: 48px;
  padding-top: 32px;
  padding-bottom: 48px;
}
.how-heading h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.7px;
  margin: 8px 0;
}
.how-heading h2 > span:last-child {
  color: var(--accent);
}
.how-heading p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0;
}
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 7px;
}
.step-number {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
}
.how-steps h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 10px 0 7px;
}
.how-steps p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

.result-panel {
  margin-top: 25px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.result-photo {
  position: relative;
  min-height: 310px;
  background: var(--soft);
}
.result-photo img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
}
.photo-label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: var(--white);
  color: var(--ink);
  padding: 6px 9px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 1px;
  backdrop-filter: blur(6px);
}
.result-copy {
  padding: 30px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.result-copy .eyebrow svg {
  width: 15px;
  height: 15px;
}
.result-copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 11px 0 1px;
}
.scientific-name {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  margin: 0;
}
.result-summary {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 550px;
}
.result-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-sources a {
  font-size: 12px;
  color: var(--muted);
  text-underline-offset: 3px;
}
.image-attribution {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}
.result-actions button {
  font-size: 12px;
  min-height: 44px;
}

.guide-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 25px;
}
.guide-toolbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.6px;
}
.guide-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.guide-search {
  position: relative;
  width: 290px;
}
.guide-search svg {
  position: absolute;
  left: 13px;
  top: 13px;
  color: var(--muted);
  width: 17px;
  height: 17px;
}
#guide-search {
  width: 100%;
  height: 46px;
  padding: 0 13px 0 40px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 14px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}
.guide-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  min-width: 0;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.guide-card img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  background: var(--soft);
}
.guide-card-body,
.guide-card > div {
  padding: 15px 16px 17px;
}
.guide-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 3px;
}
.guide-card .scientific-name,
.guide-card small {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}
.guide-card p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.guide-card > button {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: inherit;
}
.guide-card .guide-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
}
.guide-card .guide-card-content {
  padding: 15px 16px 17px;
}
.guide-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.info-view {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 76px;
}
.info-view .page-heading {
  padding-bottom: 20px;
}
.info-intro {
  max-width: 690px;
  margin: 0 auto 40px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.55;
  text-align: center;
  color: var(--muted);
}
.info-sections {
  display: grid;
  gap: 30px;
  max-width: 740px;
  margin: 0 auto;
  padding: 28px 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.info-sections > section {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.info-sections h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.3;
}
.info-sections p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.85;
}
.info-sections a,
.script-note a {
  text-underline-offset: 3px;
}
.info-sections a:hover,
.script-note a:hover {
  text-decoration-thickness: 2px;
}
.script-note {
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 27px 0 32px;
  color: var(--muted);
  font-size: 12px;
}
.site-footer > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.site-footer p {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.site-footer p a {
  text-decoration: none;
  color: var(--muted);
}
.site-footer p a:hover {
  text-decoration: underline;
}
.app-dialog {
  width: min(520px, calc(100% - 36px));
  max-height: calc(100dvh - 50px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  color: var(--ink);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.app-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(6px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}
.dialog-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.7px;
}
.dialog-content {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.dialog-content h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin-top: 20px;
}
.dialog-content p:last-child {
  margin-bottom: 0;
}
.dialog-content ul,
.dialog-content ol {
  padding-left: 20px;
}
.dialog-content label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}
.dialog-content input[type="checkbox"] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}
.dialog-content .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.dialog-content .stats-grid strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  color: var(--green);
}
.dialog-content .stats-grid span {
  font-size: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.settings-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.settings-row select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  min-height: 40px;
}
.stat-box {
  padding: 16px 8px;
  border-radius: 14px;
  background: var(--soft);
}
.distribution-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  margin: 7px 0;
  font-size: 12px;
}
.distribution-row > div,
.distribution-bar {
  background: var(--accent);
  color: var(--on-accent);
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
}
.distribution-row meter {
  accent-color: var(--proximity-color, var(--muted));
}
.distribution-row meter::-webkit-meter-optimum-value {
  background: var(--proximity-color, var(--soft));
}
.distribution-row meter::-moz-meter-bar {
  background: var(--proximity-color, var(--soft));
}
.distribution-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}
.distribution-row.histogram-row {
  grid-template-columns: 58px minmax(0, 1fr) auto;
}
.histogram-row meter {
  width: 100%;
  height: 18px;
}
.histogram-row meter::-webkit-meter-bar {
  background: var(--soft);
  border: 0;
  border-radius: 6px;
}
#learning-details {
  border-top: 1px solid var(--line);
  margin: 0 24px 18px;
  overflow-wrap: anywhere;
}
#learning-summary {
  min-height: 44px;
  padding: 13px 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
#learning-details[open] > #learning-summary {
  border-bottom: 1px solid var(--line);
}
.learning-card {
  margin: 0;
  padding-top: 14px;
  overflow-wrap: anywhere;
  display: flow-root;
}
.learning-card h3 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
  margin: 8px 0 14px;
}
.learning-card .animal-detail-image {
  width: 180px;
  height: 165px;
  float: right;
  margin: 0 0 14px 20px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--soft);
}
@media (max-width: 600px) {
  .learning-card .animal-detail-image {
    width: 100%;
    float: none;
    margin: 0 0 14px;
  }
}
.learning-card .animal-details > p:not(.source-note):not(.scientific-name) {
  font-size: 14px;
  line-height: 1.8;
}
.learning-card .source-note {
  font-size: 12px;
  line-height: 1.6;
}
.source-note {
  font-size: 12px;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  line-height: 1.7;
}
.animal-detail-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 11px;
  margin-bottom: 18px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 100;
  max-width: calc(100vw - 30px);
}

@keyframes grow-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1440px) {
  .page-heading {
    padding-top: 48px;
    padding-bottom: 36px;
  }
}
@media (max-width: 1050px) {
  .header-inner,
  .main-content {
    padding-left: 28px;
    padding-right: 28px;
  }
  .header-inner {
    gap: 15px;
  }
  .play-layout {
    grid-template-columns: 325px minmax(0, 1fr);
    gap: 17px;
  }
  .play-card {
    padding: 22px;
  }
  .small-pill {
    display: none;
  }
  .tree-toolbar {
    padding: 0 16px;
  }
  .heading-note {
    min-width: 170px;
  }
  .how-section {
    grid-template-columns: 220px 1fr;
    gap: 22px;
  }
  .how-steps {
    gap: 22px;
  }
  .site-footer {
    margin: 0 28px;
  }
  .guide-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 780px) {
  .header-inner {
    min-height: 76px;
    gap: 10px;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand small {
    font-size: 12px;
  }
  .brand {
    gap: 8px;
  }
  .main-nav a {
    font-size: 12px;
    padding: 8px 12px;
  }
  .header-actions {
    gap: 1px;
  }
  .icon-button {
    width: 36px;
    height: 36px;
  }
  .page-heading {
    padding-top: 32px;
    padding-bottom: 26px;
  }
  .heading-note {
    font-size: 13px;
  }
  h1 {
    font-size: 39px;
  }
  .play-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .play-card {
    padding: 23px;
  }
  .play-intro {
    max-width: none;
  }
  .attempt-summary {
    margin-top: 16px;
  }
  .daily-reset {
    margin-top: 19px;
    padding-top: 14px;
  }
  .tree-view,
  .tree-empty {
    min-height: 300px;
  }
  .tree-toolbar {
    height: 58px;
    padding: 0 20px;
  }
  .small-pill {
    display: inline-block;
  }
  .seed-tree {
    height: 190px;
  }

  .tree-content {
    padding: 18px;
  }
  .table-view {
    min-height: 350px;
  }
  .how-section {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 31px;
  }
  .how-heading p {
    margin-top: 7px;
  }
  .how-heading p br {
    display: none;
  }
  .how-steps {
    padding-top: 0;
    gap: 20px;
  }
  .how-heading h2 {
    font-size: 27px;
  }
  .result-panel {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .result-copy {
    padding: 23px;
  }
  .result-copy h2 {
    font-size: 28px;
  }
  .result-actions {
    gap: 8px;
  }
  .result-actions button {
    width: 100%;
  }
  .guide-card img {
    height: 150px;
  }
  .site-footer {
    align-items: flex-start;
  }
  .site-footer > div {
    display: block;
  }
  .site-footer > div span {
    display: block;
    margin-top: 5px;
  }
  .site-footer p {
    display: block;
    text-align: right;
    line-height: 1.9;
  }
  .site-footer p a {
    display: inline-block;
  }
}
@media (max-width: 680px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 13px 10px;
    padding: 14px 20px 12px;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .brand small {
    font-size: 12px;
  }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
  }
  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 2px;
  }
  .main-nav a {
    font-size: 12px;
    padding: 7px 16px;
  }
}
@media (max-width: 560px) {
  .main-content {
    padding: 0 20px;
  }
  .page-heading {
    padding: 28px 0 24px;
  }
  .eyebrow {
    gap: 7px;
    font-size: 12px;
    letter-spacing: 1.1px;
  }
  h1 {
    font-size: 36px;
    letter-spacing: -1.2px;
    margin-top: 15px;
  }
  .play-card {
    padding: 22px;
    border-radius: 20px;
  }
  .play-card-top .section-label {
    font-size: 12px;
  }
  .streak-badge {
    font-size: 12px;
  }
  .attempt-summary strong {
    font-size: 36px;
  }
  .play-intro {
    font-size: 14px;
  }
  #animal-search {
    height: 48px;
    font-size: 16px;
  }
  .search-icon {
    top: 15px;
  }
  .input-help {
    font-size: 12px;
  }
  .guess-button {
    min-height: 45px;
    font-size: 12px;
  }
  .search-results {
    max-height: 235px;
  }
  .search-results li,
  .search-results [role="option"] {
    padding: 10px;
    font-size: 13px;
    min-height: 44px;
  }
  .hint-button {
    padding: 11px 8px;
  }
  .giveup-button {
    min-height: 28px;
  }
  .tree-panel {
    border-radius: 20px;
  }
  .tree-toolbar {
    padding: 0 14px;
  }
  .tree-toolbar-title {
    gap: 7px;
  }
  .tree-toolbar h2 {
    font-size: 12px;
  }
  .small-pill {
    display: none;
  }
  .view-toggle button {
    padding: 5px 7px;
  }
  .tree-view,
  .tree-empty {
    min-height: 260px;
  }
  .seed-tree {
    height: 150px;
    width: 100%;
    flex-shrink: 0;
  }
  .tree-empty {
    overflow: hidden;
  }
  .tree-empty-copy {
    margin-top: 0;
  }
  .tree-empty-copy h3 {
    font-size: 21px;
  }
  .tree-empty-copy p {
    font-size: 12px;
  }
  .tree-legend {
    gap: 15px;
    font-size: 12px;
  }
  .tree-content {
    padding: 12px;
    overflow: auto;
  }
  .tree-content svg {
    min-width: 400px;
  }
  .table-view {
    padding: 10px 10px;
    min-height: 335px;
  }
  .history-table {
    font-size: 12px;
  }
  .history-table th,
  .history-table td {
    padding-left: 5px;
    padding-right: 5px;
  }
  .history-empty {
    align-items: flex-start;
    font-size: 12px;
    gap: 8px;
    line-height: 1.8;
  }
  .empty-line {
    margin-top: 8px;
  }
  .section-heading .section-label {
    font-size: 12px;
  }
  .how-section {
    padding-top: 23px;
    padding-bottom: 29px;
  }
  .how-steps {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .how-steps article {
    position: relative;
    padding-left: 37px;
  }
  .step-number {
    position: absolute;
    left: 0;
    top: 0;
  }
  .how-steps h3 {
    margin: 1px 0 5px;
    font-size: 12px;
  }
  .how-steps p {
    font-size: 12px;
    max-width: 290px;
  }
  .result-panel {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .result-photo {
    height: 160px;
    min-height: 160px;
  }
  .result-copy {
    padding: 23px;
  }
  .result-copy h2 {
    font-size: 33px;
  }
  .result-summary {
    font-size: 12px;
  }
  .result-actions {
    flex-direction: row;
  }
  .result-actions button {
    flex: 1 1 160px;
    width: auto;
    white-space: nowrap;
  }
  #game-view .page-heading {
    padding: 20px 0 18px;
    gap: 6px;
  }
  #learning-details {
    margin: 0 14px 14px;
  }
  .feedback-actions .text-button {
    min-height: 44px;
  }
  .guide-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 17px;
  }
  .guide-search {
    width: 100%;
  }
  #guide-search {
    font-size: 16px;
  }
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .guide-card img {
    height: 132px;
  }
  .guide-card-body,
  .guide-card > div {
    padding: 11px;
  }
  .guide-card h3 {
    font-size: 12px;
  }
  .guide-card .scientific-name,
  .guide-card small {
    font-size: 12px;
  }
  .site-footer {
    margin: 0 20px;
    padding: 20px 0;
    font-size: 12px;
  }
  .site-footer > div {
    max-width: 150px;
  }
  .site-footer p {
    max-width: 130px;
  }
  .app-dialog {
    padding: 22px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
[data-reduced-motion="true"] *,
[data-reduced-motion="true"] *::before,
[data-reduced-motion="true"] *::after {
  animation: none !important;
  transition: none !important;
}

.tree-node rect {
  fill: var(--white);
  stroke: var(--line-strong);
}
.tree-node text {
  fill: var(--ink);
}
.tree-node text:last-child {
  fill: var(--muted);
}
.tree-node--shared rect {
  fill: var(--soft);
  stroke: var(--accent);
}
.tree-node--mystery rect {
  fill: var(--accent);
  stroke: var(--accent);
}
.tree-node--mystery text,
.tree-node--mystery text:last-child {
  fill: var(--on-accent);
}
.tree-node--won rect {
  fill: var(--lime);
  stroke: var(--accent);
}
.tree-node--won text:last-child {
  fill: var(--ink);
}

/* The live tree uses SVG groups; node borders must not outline the text. */
.tree-node text {
  stroke: none;
  font-family: var(--sans);
}
.tree-node[role="button"] {
  cursor: pointer;
}
.tree-node[role="button"]:hover rect {
  filter: brightness(0.97);
}
.feedback-card > strong,
.feedback-card > span {
  display: block;
}
.feedback-card > strong {
  margin-bottom: 3px;
}
.trail-chip {
  padding: 0 !important;
  overflow: hidden;
}
.trail-chip > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  border: 0;
  padding: 9px 12px;
  background: transparent;
  text-align: left;
}
.trail-chip > button:hover {
  background: var(--soft);
}
.guide-card .guide-card-content {
  display: block;
}
.guide-card-content strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}
#guide-more {
  margin-bottom: 40px;
  margin-top: -15px;
}
.dialog-content .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.distribution-row {
  grid-template-columns: 1fr auto;
}
.distribution-row > strong {
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 5px;
}
.dialog-content textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 15px;
  font: 13px/1.7 var(--sans);
  color: var(--ink);
  background: var(--surface);
}
.image--fallback {
  object-fit: contain !important;
  padding: 30px;
  background: var(--soft);
}
/* Chinese uses native sans-serif forms and its own rhythm rather than Latin
   serif fallbacks and negative tracking, which crowd full-width characters. */
html[lang="zh-CN"] {
  --sans:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: var(--sans);
  line-break: strict;
}
html[lang="zh-CN"] h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}
html[lang="zh-CN"] h1 em {
  font-weight: inherit;
}
html[lang="zh-CN"] :is(h2, h3, .story-link strong) {
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
}
html[lang="zh-CN"] :is(.eyebrow, .section-label) {
  letter-spacing: 0.05em;
}
html[lang="zh-CN"] .heading-note {
  font-size: 14px;
  line-height: 1.8;
}
html[lang="zh-CN"] .info-intro {
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.85;
}
html[lang="zh-CN"] .story-dek {
  font-size: 19px;
  line-height: 1.8;
}
@media (max-width: 560px) {
  .guide-card-content strong {
    font-size: 12px;
  }
  .guide-card .guide-card-content {
    padding: 11px;
  }
  .tree-toolbar-title h2 {
    white-space: nowrap;
  }
}

/* Field notes turn a classification result into a short, shareable discovery. */
.stories-view {
  padding-bottom: 56px;
}
.stories-view .page-heading {
  max-width: 900px;
  margin: 0 auto;
}
#stories-view > .info-intro {
  max-width: 640px;
  margin: 0 auto 28px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
}
.stories-all-link {
  display: inline-flex;
  margin-top: 14px;
}
.field-notes {
  margin: 0 0 60px;
}
.field-notes .section-heading p:not(.eyebrow) {
  color: var(--muted);
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.story-link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.story-link:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.story-link strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.2;
}
.story-link > span:not(.section-label) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.story-link small {
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
}
.story-view {
  max-width: 820px;
  margin: 42px auto 70px;
  padding: 34px 46px 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.story-view h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.13;
  letter-spacing: -1.5px;
  margin: 20px 0;
  font-weight: 400;
}
.story-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.story-breadcrumbs a {
  text-underline-offset: 3px;
}
.story-breadcrumbs [aria-current="page"] {
  color: var(--ink);
}
.story-view .eyebrow {
  margin-top: 22px;
  justify-content: flex-start;
}
.story-evidence-link {
  margin: 8px 0 20px;
  color: var(--accent);
  font-size: 13px;
}
.story-evidence-link a {
  text-underline-offset: 4px;
}
.story-dek {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.5;
  color: var(--muted);
}
.story-takeaway {
  padding: 23px 28px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 0 14px 14px 0;
  font-size: 18px;
  line-height: 1.65;
}
.story-view section {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding-top: 24px;
}
.story-view h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 400;
}
.story-view section p {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.85;
}
.story-animal-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.story-animal-links a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.story-animal-links a:hover {
  border-color: var(--accent);
}
.story-animal-links strong {
  font-size: 14px;
  font-weight: 600;
}
.story-animal-links small {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}
.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px 0;
}
.story-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.story-actions > .text-button {
  min-height: 44px;
  padding: 8px 0;
}
#story-evidence {
  scroll-margin-top: 20px;
}
.story-evidence .source-note {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 14px;
}
.story-related .story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.story-related .story-link {
  padding: 20px;
}
.story-related .story-link strong {
  font-size: 22px;
}
.story-sources {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.story-sources a {
  color: var(--muted);
}
.result-takeaways {
  font-size: 14px;
  line-height: 1.7;
}
.result-takeaways strong {
  font-weight: 600;
}
.result-takeaways a {
  font-size: 12px;
}
.result-stories .story-link {
  padding: 16px;
  margin: 16px 0;
}
.result-stories .story-link strong {
  font-size: 21px;
}
.result-stories .story-link > span:not(.section-label) {
  display: none;
}
.reasoning-note {
  line-height: 1.65;
}
@media (max-width: 900px) {
  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  #stories-view .page-heading {
    padding: 20px 0 14px;
  }
  #stories-view h1 {
    margin-top: 8px;
  }
  #stories-view > .info-intro {
    margin-bottom: 20px;
    font-size: 16px;
  }
  .story-grid,
  .story-related .story-grid,
  .story-animal-links {
    grid-template-columns: 1fr;
  }
  .story-actions > .primary-button,
  .story-actions > .secondary-button {
    flex: 1 1 180px;
    white-space: nowrap;
  }
  .story-link {
    padding: 22px;
  }
  .story-view {
    margin: 35px auto 55px;
  }
  .story-view h1 {
    letter-spacing: -0.7px;
  }
  .story-dek {
    font-size: 22px;
  }
  .story-takeaway {
    padding: 18px 20px;
    font-size: 17px;
  }
  .story-view section p {
    font-size: 16px;
  }
}

@media (max-width: 680px) {
  .brand small {
    display: none;
  }
  .header-inner {
    gap: 10px;
  }
  .header-actions {
    gap: 2px;
  }
  .main-nav {
    width: max-content;
    max-width: 100%;
    justify-self: center;
  }
  .page-heading {
    gap: 12px;
  }
  .heading-note {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 0.35em;
  }
  .heading-note br {
    display: none;
  }
  .how-steps article {
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
  .how-steps article .step-number {
    top: 14px;
  }
  .story-view {
    padding: 24px 22px;
    margin: 28px auto 48px;
    border-radius: 20px;
  }
  .info-sections {
    padding: 24px 22px;
    border-radius: 20px;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .site-footer > div,
  .site-footer p {
    max-width: none;
    text-align: left;
  }
  .site-footer p {
    display: flex;
    gap: 8px;
  }
  .dialog-content .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .header-inner {
    padding-left: 14px;
    padding-right: 14px;
  }
  .brand {
    gap: 6px;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
  .brand strong {
    font-size: 17px;
  }
  .icon-button {
    width: 34px;
    height: 36px;
  }
  .header-actions {
    gap: 0;
  }
  .main-nav a {
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
  }
}
