/* ==========================================================================
   Trees: a field guide site. Plain CSS, no external dependencies.
   ========================================================================== */
:root {
  --forest-900: #12261b;
  --forest-800: #1c3a28;
  --forest-700: #24492f;
  --forest-600: #2f5d3a;
  --moss: #6b8f4e;
  --fern: #8fb36a;
  --sage: #dfe8d2;
  --cream: #f7f3e8;
  --paper: #fffdf7;
  --bark: #6d4c33;
  --bark-light: #a9825b;
  --gold: #d9a521;
  --rust: #b8692a;
  --ink: #1f2a22;
  --muted: #55625a;
  --line: #d9d3c1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 38, 27, .06), 0 6px 22px rgba(18, 38, 27, .09);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; font: 17px/1.65 var(--sans); color: var(--ink); background: var(--cream); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--forest-800); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--forest-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rust); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--forest-900); padding: .5em 1em; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 8px; }
.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18, 38, 27, .96); backdrop-filter: saturate(1.4) blur(8px); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.brand svg { width: 32px; height: 32px; }
.brand:hover { color: var(--fern); }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 10px; padding: .45rem .7rem; font: inherit; font-size: .95rem; cursor: pointer; }
.nav-toggle .bars { display: inline-block; width: 18px; height: 2px; background: currentColor; position: relative; vertical-align: middle; margin-right: .4rem; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
.nav-toggle .bars::before { top: -6px; } .nav-toggle .bars::after { top: 6px; }
#site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .15rem; margin: 0; padding: 0; }
#site-nav a { display: block; color: #e8efe2; text-decoration: none; padding: .45rem .7rem; border-radius: 999px; font-size: .95rem; }
#site-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
#site-nav a[aria-current="page"] { background: var(--fern); color: var(--forest-900); font-weight: 600; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  #site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--forest-900); border-bottom: 1px solid rgba(255,255,255,.1); display: none; }
  #site-nav.is-open { display: block; }
  #site-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  #site-nav a { border-radius: 10px; padding: .7rem .9rem; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, #a9cfa0 0%, #6e9f6a 38%, #2c5a3a 72%, var(--forest-900) 100%); }
.hero-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,38,27,.62) 0%, rgba(18,38,27,.38) 38%, rgba(18,38,27,0) 65%); pointer-events: none; }
.hero .wrap, .hero-leaf { z-index: 1; }
.hero .eyebrow { color: #eaf5dc; }
.hero .wrap { position: relative; padding: clamp(4rem, 10vw, 8rem) 0 clamp(7rem, 14vw, 11rem); }
.hero h1 { color: #fff; max-width: 15ch; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.hero p.lede { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 40ch; color: #f2f7ee; text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero-leaf { position: absolute; right: max(2vw, calc((100vw - var(--max)) / 2)); top: 50%; width: clamp(140px, 24vw, 300px); transform: translateY(-58%) rotate(4deg); filter: drop-shadow(0 18px 30px rgba(0,0,0,.25)); animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translateY(-58%) rotate(1deg); } 50% { transform: translateY(-55%) rotate(7deg); } }
@media (max-width: 760px) { .hero-leaf { opacity: .35; right: -30px; } }
.page-hero { background: linear-gradient(160deg, var(--forest-800), var(--forest-600)); color: #eef4e8; position: relative; overflow: hidden; }
.page-hero .wrap { padding: 3.2rem 0 3rem; position: relative; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3rem); }
.page-hero p { max-width: 62ch; font-size: 1.1rem; margin: 0; }
.page-hero .eyebrow { color: var(--fern); }
.page-hero-leaf { position: absolute; right: 3%; bottom: -30px; width: 170px; opacity: .22; transform: rotate(-18deg); pointer-events: none; }
.eyebrow { display: inline-block; font: 600 .95rem/1.2 var(--sans); letter-spacing: .01em; color: var(--moss); margin-bottom: .8rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: 600 1rem/1 var(--sans); padding: .85rem 1.3rem; border-radius: 999px; border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--forest-900); box-shadow: 0 4px 14px rgba(217,165,33,.35); }
.btn-primary:hover { background: #e9b73a; color: var(--forest-900); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-outline { background: transparent; color: var(--forest-700); border-color: var(--forest-600); }
.btn-outline:hover { background: var(--forest-600); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- sections & cards ---------- */
section.block { padding: clamp(3rem, 7vw, 5rem) 0; }
section.block.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { max-width: 70ch; margin-bottom: 2rem; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 400px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.feature-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(18,38,27,.15); color: inherit; }
.feature-card .fc-leaf { width: 74px; height: 88px; margin-bottom: .6rem; }
.feature-card .fc-more { margin-top: auto; color: var(--forest-600); font-weight: 600; }

/* ---------- news ---------- */
.news-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.news-card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.35rem 1.2rem; box-shadow: var(--shadow); border-top: 5px solid var(--fern); }
.news-card:nth-child(3n+2) { border-top-color: var(--gold); }
.news-card:nth-child(3n) { border-top-color: var(--moss); }
.news-card.is-extra { display: none; }
.news-meta { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .83rem; color: var(--muted); margin-bottom: .55rem; }
.news-meta .src { font-weight: 700; color: var(--forest-600); }
.news-card h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.news-card h3 a { color: var(--forest-800); text-decoration: none; }
.news-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.news-card h3 a:hover { color: var(--rust); }
.news-card p { font-size: .95rem; color: #39453d; margin-bottom: .7rem; }
.news-card .tag { margin-top: auto; align-self: flex-start; font-size: .75rem; font-weight: 700; background: var(--sage); color: var(--forest-700); border-radius: 999px; padding: .25rem .6rem; }
.news-card:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.news-card h3 a:focus-visible { outline: none; }
.news-foot { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1.6rem; }

/* ---------- stats ---------- */
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 1.5rem 0; }
.stat { background: var(--forest-800); color: #eaf2e3; border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.stat b { display: block; font: 700 2rem/1.1 var(--serif); color: var(--fern); margin-bottom: .3rem; }
.stat span { font-size: .92rem; }
.stat a { color: #cfe3bf; }

/* ---------- article / info pages ---------- */
.content { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 3rem; padding: 3rem 0 4rem; align-items: start; }
@media (max-width: 960px) { .content { grid-template-columns: 1fr; } .toc { display: none; } }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 2.4rem; padding-top: .4rem; scroll-margin-top: 80px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.toc { position: sticky; top: 88px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; font-size: .93rem; }
.toc h2 { font-size: 1rem; font-family: var(--sans); color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin: .3rem 0; }
.tree-profile { display: grid; grid-template-columns: 120px 1fr; gap: 1.4rem; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--moss); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin: 1.4rem 0; box-shadow: var(--shadow); }
.tree-profile .tp-art { width: 120px; }
.tree-profile h3 { margin-top: 0; }
.tree-profile .tp-stats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0 .9rem; padding: 0; list-style: none; }
.tree-profile .tp-stats li { background: var(--sage); color: var(--forest-700); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; font-weight: 600; margin: 0; }
@media (max-width: 600px) { .tree-profile { grid-template-columns: 1fr; } .tree-profile .tp-art { width: 90px; } }
.callout { background: #fbf4dc; border: 1px solid #ecd9a0; border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.4rem 0; }
.callout.green { background: #eaf3e1; border-color: #c7dcb4; }
.cite { font-size: .8em; vertical-align: super; line-height: 0; }
.cite a { text-decoration: none; font-weight: 700; }
.sources { font-size: .9rem; border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.2rem; }
.sources h2 { font-size: 1.3rem; }
.sources ol { padding-left: 1.4rem; }
.sources li { margin-bottom: .45rem; word-break: break-word; }
figure.chart { margin: 1.6rem 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem .8rem; box-shadow: var(--shadow); }
figure.chart svg { display: block; width: 100%; height: auto; }
figure.chart figcaption { font-size: .88rem; color: var(--muted); margin-top: .6rem; }
.chart text { font-family: var(--sans); fill: #3c4a40; }
.chart .axis { stroke: #9aa597; stroke-width: 1; }
.chart .grid-line { stroke: #e3dece; stroke-width: 1; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1.2rem 0; background: var(--paper); border-radius: 10px; overflow: hidden; }
table.data th, table.data td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--forest-700); color: #fff; font-weight: 600; }
table.data tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.timeline { list-style: none; padding: 0; margin: 1.5rem 0; border-left: 3px solid var(--fern); }
.timeline li { position: relative; padding: 0 0 1.1rem 1.3rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: .45em; width: 15px; height: 15px; border-radius: 50%; background: var(--paper); border: 3px solid var(--moss); }
.timeline b { color: var(--forest-700); }
.help-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 1.2rem 0; }
.help-grid .card { padding: 1.1rem 1.2rem; }
.help-grid .card h3 { font-size: 1.08rem; }
.icon { width: 1.6rem; height: 1.6rem; display: block; margin-bottom: .4rem; color: var(--moss); }
.icon-inline { width: 1.15rem; height: 1.15rem; display: inline-block; vertical-align: -.2em; margin-right: .35rem; color: var(--moss); }
.initiative { border-left: 6px solid var(--gold); }

/* ---------- footer ---------- */
.site-footer { background: var(--forest-900); color: #c9d6c3; padding: 3rem 0 2rem; font-size: .93rem; }
.site-footer a { color: #e5efdc; }
.site-footer .wrap { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; }
.site-footer h2 { font-size: 1rem; color: #fff; font-family: var(--sans); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .3rem 0; }
.site-footer .fineprint { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.2rem; color: #9fb09a; font-size: .85rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- leaf SVG classes (shared by identifier & game) ---------- */
.leaf-svg { display: block; width: 100%; height: auto; overflow: visible; }
.leaf-svg .lf-blade { fill: var(--leaf); stroke: color-mix(in srgb, var(--leaf) 70%, #1c2a12); stroke-width: 1; stroke-linejoin: round; }
.leaf-svg .lf-vein { fill: none; stroke: var(--vein); stroke-width: 1.1; stroke-linecap: round; opacity: .85; }
.leaf-svg .lf-stem { fill: none; stroke: color-mix(in srgb, var(--leaf) 60%, #5a3b1e); stroke-linecap: round; }
.leaf-svg .lf-twig { fill: none; stroke: var(--bark); stroke-linecap: round; }
.leaf-svg .lf-twig-fill { fill: var(--bark); }
.leaf-svg .lf-needle { fill: none; stroke: var(--leaf); stroke-linecap: round; }
.leaf-svg .lf-sheath { fill: #8a6a4a; }
.leaf-svg .lf-stripe { fill: none; stroke: rgba(255,255,255,.55); stroke-linecap: round; }
.leaf-svg .lf-berry { fill: #6f87b5; stroke: #4d6390; stroke-width: .6; }
@supports not (stroke: color-mix(in srgb, red 50%, blue)) {
  .leaf-svg .lf-blade { stroke: rgba(20, 30, 12, .35); }
  .leaf-svg .lf-stem { stroke: var(--leaf); }
}

/* ---------- identifier ---------- */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; padding: 2.5rem 0 4rem; align-items: start; }
@media (max-width: 960px) { .tool-layout { grid-template-columns: 1fr; } }
.id-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); min-height: 420px; }
.id-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.id-step { font: 700 .95rem/1.2 var(--sans); color: var(--moss); }
.id-toolbar .btns { display: flex; gap: .5rem; }
.id-toolbar .btn { padding: .55rem 1rem; font-size: .9rem; }
.id-question h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.id-question h2:focus { outline: none; }
.id-question .help { color: var(--muted); }
.opt-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.2rem; }
.opt { display: grid; grid-template-columns: 64px 1fr; gap: .8rem; align-items: center; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .8rem; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.opt:hover { border-color: var(--moss); transform: translateY(-2px); box-shadow: var(--shadow); }
.opt-leaf { width: 64px; height: 76px; display: flex; align-items: center; }
.opt-text strong { display: block; font-size: 1.02rem; color: var(--forest-800); }
.opt-text span { display: block; font-size: .88rem; color: var(--muted); line-height: 1.4; margin-top: .15rem; }
.opt-text em { display: inline-block; font-style: normal; font-size: .75rem; font-weight: 700; color: var(--forest-600); background: var(--sage); border-radius: 999px; padding: .1rem .5rem; margin-top: .4rem; }
.opt-skip { grid-template-columns: 1fr; border-style: dashed; background: transparent; }
.id-side { position: sticky; top: 88px; }
.id-side .card { padding: 1.1rem 1.2rem; }
.id-side h2 { font-size: 1.1rem; font-family: var(--sans); }
.id-count { font-weight: 700; color: var(--forest-600); margin-bottom: .6rem; }
.id-candidates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .4rem; max-height: 52vh; overflow: auto; }
@media (max-width: 960px) { .id-side { position: static; } .id-candidates { max-height: none; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); } }
.id-candidates li { text-align: center; font-size: .7rem; line-height: 1.2; color: var(--muted); }
.id-candidates .mini { display: block; width: 46px; height: 55px; margin: 0 auto .2rem; }
.id-trail { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .85rem; }
.id-trail li { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.id-trail span { color: var(--muted); }
.sp-card { display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.sp-card--big { grid-template-columns: 170px 1fr; }
.sp-card .sp-leaf { background: radial-gradient(circle at 50% 45%, #f3f7ec, #e3ecd8); border-radius: 14px; padding: .6rem; }
.sp-card h3 { font-size: 1.5rem; margin: 0; }
.sp-card .sci { color: var(--muted); margin-bottom: .6rem; }
.sp-card .facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .9rem; margin: 0 0 .8rem; }
.sp-card .facts dt { font-weight: 700; color: var(--forest-700); }
.sp-card .facts dd { margin: 0; }
.sp-card .funfact { background: #fbf4dc; border-radius: 10px; padding: .6rem .8rem; font-size: .93rem; margin: 0; }
.sp-grid { display: grid; gap: 1rem; }
@media (max-width: 600px) { .sp-card, .sp-card--big { grid-template-columns: 1fr; } .sp-card .sp-leaf { max-width: 160px; } }
.result-title { color: var(--moss); }
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; text-align: center; }
.gallery figure .leaf-svg { height: 130px; }
.gallery figcaption { font-size: .88rem; font-weight: 600; color: var(--forest-800); margin-top: .4rem; }
.gallery figcaption i { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }

/* ---------- game ---------- */
.game-shell { padding: 2.5rem 0 4rem; }
#game-app { background: radial-gradient(ellipse at 50% 0%, #f9fbf3 0%, #eef3e4 60%, #e1ead3 100%); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(1.2rem, 3vw, 2.2rem); position: relative; overflow: hidden; }
.g-start, .g-over { text-align: center; max-width: 720px; margin: 0 auto; padding: 1rem 0; }
.g-start .g-demo { width: 150px; margin: 0 auto 1rem; animation: demoBrown 6s ease-in-out infinite alternate; }
@keyframes demoBrown { 0% { filter: none; } 100% { filter: sepia(.9) saturate(1.4) hue-rotate(-15deg) brightness(.85); } }
.diff-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 1.6rem 0 1rem; }
.diff { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 1.1rem 1rem; cursor: pointer; font: inherit; color: inherit; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.diff:hover { transform: translateY(-3px); border-color: var(--moss); box-shadow: var(--shadow); }
.diff strong { display: block; font: 700 1.3rem/1.2 var(--serif); color: var(--forest-800); }
.diff span { display: block; font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.diff .best { margin-top: .6rem; font-size: .8rem; color: var(--forest-600); font-weight: 700; }
.g-hud { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.g-hud .chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .85rem; font-size: .9rem; }
.chip b { color: var(--forest-700); }
.g-mode { font-weight: 700; color: var(--moss); font-size: .95rem; }
.g-quit { background: transparent; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; }
.g-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
@media (max-width: 800px) { .g-stage { grid-template-columns: 1fr; gap: 1rem; } }
.g-leaf { position: relative; aspect-ratio: 5 / 6; max-height: 440px; margin: 0 auto; width: 100%; max-width: 380px; display: flex; align-items: center; justify-content: center; }
.g-leaf-inner { width: 86%; transform: rotate(var(--rot, 0deg)) scale(calc(1 - var(--wilt, 0) * .06)); transition: transform .3s linear; filter: drop-shadow(0 10px 18px rgba(30, 40, 20, calc(.12 + var(--wilt, 0) * .1))); }
.g-leaf.is-fallen .g-leaf-inner { animation: fall 1.4s cubic-bezier(.4, .1, .7, 1) forwards; }
.g-leaf.is-correct .g-leaf-inner { animation: pop .45s ease; }
.g-leaf.is-wrong .g-leaf-inner { animation: shake .45s ease; }
@keyframes fall { 0% { transform: rotate(var(--rot)) translate(0, 0); opacity: 1; } 30% { transform: rotate(calc(var(--rot) + 25deg)) translate(18px, 30px); } 60% { transform: rotate(calc(var(--rot) - 15deg)) translate(-14px, 80px); } 100% { transform: rotate(calc(var(--rot) + 40deg)) translate(10px, 150px); opacity: .35; } }
@keyframes pop { 50% { transform: rotate(var(--rot)) scale(1.08); } }
@keyframes shake { 20%, 60% { transform: rotate(var(--rot)) translateX(-8px); } 40%, 80% { transform: rotate(var(--rot)) translateX(8px); } }
.reduce-motion .g-leaf-inner { animation: none !important; }
.g-timer { position: relative; height: 14px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; margin-bottom: .4rem; }
.g-timer-fill { position: absolute; inset: 0; transform-origin: left center; background: var(--moss); border-radius: 999px; }
.g-timer-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.g-timer-text { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--forest-700); }
.g-prompt { font: 700 1.35rem/1.25 var(--serif); color: var(--forest-800); margin-bottom: .8rem; }
.g-choices { display: grid; gap: .6rem; grid-template-columns: 1fr; }
[data-diff="hard"] .g-choices { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { [data-diff="hard"] .g-choices { grid-template-columns: 1fr; } }
.g-choice { display: flex; align-items: center; gap: .7rem; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .8rem 1rem; font: 600 1rem/1.3 var(--sans); color: var(--forest-800); cursor: pointer; transition: border-color .12s, transform .12s, background-color .12s; }
.g-choice:hover:not([disabled]) { border-color: var(--moss); transform: translateX(3px); }
.g-choice kbd { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; border-radius: 6px; background: var(--sage); color: var(--forest-700); font: 700 .8rem var(--sans); }
.g-choice[disabled] { cursor: default; opacity: .65; }
.g-choice.is-answer { background: #e3f1d6; border-color: #5f9a3d; opacity: 1; }
.g-choice.is-answer::after { content: "✓"; margin-left: auto; color: #3f7d34; font-weight: 800; }
.g-choice.is-wrong { background: #f8e3d6; border-color: var(--rust); opacity: 1; }
.g-choice.is-wrong::after { content: "✗"; margin-left: auto; color: var(--rust); font-weight: 800; }
.g-feedback { margin-top: 1rem; border-radius: 14px; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); }
.g-feedback.ok { border-left: 6px solid #5f9a3d; }
.g-feedback.no { border-left: 6px solid var(--rust); }
.g-feedback .fb-head { font: 700 1.2rem/1.3 var(--serif); margin-bottom: .3rem; color: var(--forest-800); }
.g-feedback .fb-mult { font: 700 .8rem var(--sans); background: var(--gold); color: var(--forest-900); border-radius: 999px; padding: .15rem .5rem; vertical-align: middle; }
.g-feedback .fb-fact { font-size: .92rem; color: #3d4a40; }
.g-over-rank { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.g-over-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.4rem 0; }
.g-over-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem .5rem; font-size: .85rem; color: var(--muted); }
.g-over-stats span { display: block; font: 700 1.9rem/1.1 var(--serif); color: var(--forest-700); }
.g-over-best { font-weight: 700; color: var(--forest-600); }
.g-over-review { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; text-align: left; }
.g-over-review li { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .35rem .6rem; font-size: .88rem; }
.g-over-review li.no { border-color: #e9c7b0; background: #fdf4ee; }
.g-over-review .mini { width: 32px; height: 38px; flex: none; }
.g-over-review b { margin-left: auto; font-size: .8rem; color: var(--forest-600); }
.g-over-review li.no b { color: var(--rust); }
.g-over-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.how-to { max-width: 720px; margin: 2.5rem auto 0; }
#game-app[data-paused]::after { content: "Paused"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(247, 243, 232, .85); font: 700 2rem var(--serif); color: var(--forest-700); }

/* ---------- print ---------- */
@media print { .site-header, .site-footer, .hero-leaf, .toc { display: none !important; } body { background: #fff; } .news-card.is-extra { display: flex; } }
.initiative h3, .help-grid .card h3 { margin-top: 0; }
/* keep grid/flex children from forcing horizontal overflow on small screens */
.prose, .content > * { min-width: 0; }
.leaf-svg .lf-needle-fill { fill: var(--leaf); stroke: color-mix(in srgb, var(--leaf) 65%, #10201a); stroke-width: .5; stroke-linejoin: round; }
.leaf-svg .lf-back .lf-needle-fill { fill: color-mix(in srgb, var(--leaf) 78%, #10201a); }
/* Home: two large tool features + a reading list */
.tool-features { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .tool-features { grid-template-columns: 1.15fr 1fr; } }
.tool-feature { display: flex; gap: 1.4rem; align-items: center; padding: 1.8rem; border-radius: calc(var(--radius) + 4px); text-decoration: none; color: #eef4e8; background: linear-gradient(150deg, var(--forest-700), var(--forest-600)); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.tool-feature + .tool-feature { background: linear-gradient(150deg, #7a4a22, var(--rust)); }
.tool-feature:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(18,38,27,.2); color: #fff; }
.tool-feature h3 { color: #fff; font-size: 1.6rem; margin: 0 0 .4rem; }
.tool-feature p { margin: 0 0 1rem; color: rgba(255,255,255,.88); }
.tool-feature .btn { pointer-events: none; background: #fff; color: var(--forest-800); }
.tf-leaf { flex: 0 0 auto; width: 120px; height: 144px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); }
@media (max-width: 480px) { .tool-feature { flex-direction: column; align-items: flex-start; } .tf-leaf { width: 90px; height: 108px; } }
.read-list-wrap { margin-top: 2.6rem; }
.read-list-wrap h2 { margin-bottom: .6rem; }
.read-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.read-list li { border-bottom: 1px solid var(--line); }
.read-list a { display: flex; align-items: center; gap: 1rem; padding: 1rem .25rem; text-decoration: none; color: inherit; }
.read-list a:hover { background: var(--sage); }
.read-list a:hover .rl-arrow { transform: translateX(4px); }
.rl-leaf { flex: 0 0 auto; width: 40px; height: 48px; }
.rl-text { flex: 1 1 auto; min-width: 0; }
.rl-text b { display: block; font-family: var(--serif); font-size: 1.2rem; color: var(--forest-700); }
.rl-text span { color: var(--muted); }
.rl-arrow { flex: 0 0 auto; color: var(--forest-600); font-size: 1.3rem; transition: transform .2s ease; }

/* Cross-section links to the rest of jugami.com (spacing instead of separators) */
.site-footer .jugami-more { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.6rem; row-gap: .5rem; font-size: .85rem; color: #9fb09a; }
.site-footer .jugami-more a { color: #c9d6c3; text-decoration: none; }
.site-footer .jugami-more a:hover, .site-footer .jugami-more a:focus-visible { color: #fff; text-decoration: underline; }
.site-footer .jugami-more a:first-child { color: #e5efdc; font-weight: 700; }
