/* Catch & Tame Calc — "ranch at night": dark pasture, lasso rope orange, heart pink for odds */
:root {
  --bg: #0f1a14;
  --panel: #16251c;
  --panel-2: #1c2e23;
  --line: #24382b;
  --text: #eef3ea;
  --muted: #9fb3a3;
  --brand: #e0923a;
  --heart: #ff6b9a;
  --gold: #f6c453;
  --r-common: var(--muted);
  --r-rare: #4fa3f7;
  --r-epic: #a970ff;
  --r-legendary: var(--brand);
  --r-mythical: var(--gold);
  --r-secret: var(--text);
  --r-exclusive: #3fd6c6;
  --r-boss: #ff5a4e;
  --r-divine: var(--heart);
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .28);
  --head: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--body); }
a { color: var(--brand); }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; font-weight: 700; margin: 0 0 12px; }
h1 { font-size: 48px; }
h2 { font-size: 28px; margin-top: 48px; }
h3 { font-size: 22px; margin-top: 32px; }
code { font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 700 22px/1 var(--head); }
.brand svg { width: 32px; height: 32px; }
.brand em { font-style: normal; color: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.nav-cta { color: var(--bg); background: var(--brand); }

/* hero */
.hero { max-width: 1240px; margin: 0 auto; padding: 32px 24px 16px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 14px; letter-spacing: .04em; margin: 0 0 8px; }
.lede { color: var(--muted); font-size: 18px; max-width: 70ch; margin: 0 0 16px; }
.codebar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: var(--panel); margin: 0 0 16px; }
.codebar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--r-exclusive); box-shadow: 0 0 0 4px rgba(63, 214, 198, .18); }
.codebar-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.codebar code { color: var(--gold); font-size: 18px; letter-spacing: .06em; }
.codebar-reward { color: var(--muted); font-size: 14px; }
.codebar-more { margin-left: auto; font-weight: 700; font-size: 14px; }
.chip { font: 700 14px/1 var(--body); color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.stats li { display: flex; flex-direction: column; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 120px; }
.stats b { font: 700 22px/1.2 var(--head); color: var(--text); }
.stats span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* tool stage */
.stage { max-width: 1240px; margin: 0 auto; padding: 16px 24px 32px; }
.stage-bar { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 700 14px/1 var(--body); cursor: pointer; }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pill[data-gf-like] svg { fill: none; }
.pill[aria-pressed="true"] { border-color: var(--heart); color: var(--heart); }
.pill[aria-pressed="true"] svg { fill: var(--heart); stroke: var(--heart); }
.pill-msg { color: var(--muted); font-size: 14px; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 24px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--brand); color: var(--text); }
.tile b { font: 700 18px/1.2 var(--head); }
.tile span { color: var(--muted); font-size: 14px; }

/* reading area */
.read { max-width: 1240px; margin: 0 auto; padding: 16px 24px 48px; display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.toc { position: sticky; top: 80px; align-self: start; font-size: 14px; }
.toc p { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--brand); }
.guide { max-width: 760px; }
.guide p, .guide li { max-width: 70ch; }
.guide h2:first-child { margin-top: 0; }
.scroll-x { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data thead th { background: var(--panel-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:nth-child(even) { background: var(--panel); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.rar { font-weight: 700; color: var(--r-common); }
.rar[data-r="rare"] { color: var(--r-rare); }
.rar[data-r="epic"] { color: var(--r-epic); }
.rar[data-r="legendary"] { color: var(--r-legendary); }
.rar[data-r="mythical"] { color: var(--r-mythical); }
.rar[data-r="secret"] { color: var(--r-secret); }
.rar[data-r="exclusive"] { color: var(--r-exclusive); }
.rar[data-r="boss"] { color: var(--r-boss); }
.rar[data-r="divine"] { color: var(--r-divine); }
.qa dt { font: 700 18px/1.3 var(--head); margin-top: 24px; }
.qa dd { margin: 8px 0 0; color: var(--muted); max-width: 70ch; }

/* plain + card pages */
.page { max-width: 820px; margin: 0 auto; padding: 32px 24px 48px; }
.page.wide { max-width: 1240px; }
.crumb { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.crumb a { color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.filters a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; background: var(--panel); }
.filters a:hover { border-color: var(--brand); }
.group-note { color: var(--muted); max-width: 70ch; }
.cards { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.card.is-dim { opacity: .55; border-top-color: var(--line); }
.card-top { display: flex; justify-content: space-between; gap: 8px; margin: 0; }
.card-tag { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card-badge { font-size: 12px; font-weight: 700; color: var(--bg); background: var(--gold); border-radius: 6px; padding: 0 8px; }
.card-name { font: 700 18px/1.25 var(--head); margin: 0; }
.card-big { font: 700 28px/1.1 var(--head); color: var(--gold); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.card-text { color: var(--muted); font-size: 14px; margin: 0; }
.card .chip { align-self: flex-start; margin-top: 8px; }
.tool-head { max-width: 1240px; margin: 0 auto; padding: 32px 24px 8px; }
.nf { max-width: 640px; margin: 0 auto; padding: 64px 24px; text-align: center; }

/* comments */
.talk { max-width: 820px; margin: 0 auto; padding: 0 24px 64px; }
.c-form { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.c-form label { font-size: 14px; color: var(--muted); font-weight: 700; }
.c-form input, .c-form textarea { font: 400 16px/1.5 var(--body); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.c-form textarea { min-height: 96px; }
.c-reply-line { display: none; margin: 0; font-size: 14px; }
.c-form[data-gf-replying] .c-reply-line { display: block; }
.link-b { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; }
.btn { justify-self: start; min-height: 44px; padding: 8px 24px; border: 0; border-radius: 999px; background: var(--brand); color: var(--bg); font: 700 16px/1 var(--body); cursor: pointer; }
.btn:hover { background: var(--gold); }
.c-msg { color: var(--muted); font-size: 14px; }
.c-list[data-gf-empty]::before { content: "No notes yet. Be the first to share a pairing that worked for you."; display: block; color: var(--muted); padding: 16px 0; }
.c-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.c-item[data-gf-owner] { border-left: 3px solid var(--brand); padding-left: 12px; }
.c-head { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 14px; color: var(--muted); }
.c-head b { color: var(--text); }
.c-owner { display: none; color: var(--brand); font-weight: 700; }
[data-gf-owner] > .c-head .c-owner { display: inline; }
.c-text { margin: 4px 0; }
.c-reply { background: none; border: 0; color: var(--muted); cursor: pointer; font: 700 14px/1 var(--body); padding: 4px 0; }
.c-replies { margin-left: 24px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--panel); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 32px 24px; }
.foot-brand { font: 700 18px/1 var(--head); margin: 0 0 8px; }
.foot-note { color: var(--muted); font-size: 14px; max-width: 90ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0; }
.foot-nav a { color: var(--muted); font-size: 14px; }
.foot-copy { color: var(--muted); font-size: 12px; margin: 0; }

/* ===== Breeding calculator workbench (tool: breeding-calculator) ===== */
.bc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; }
.bc-col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: 820px; }
.bc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font: 700 18px/1.2 var(--head); }
.bc-h small { font: 700 12px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bc-search { width: 100%; font: 400 16px/1.4 var(--body); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.bc-search:focus { border-color: var(--brand); outline: none; }
.bc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bc-pills { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.bc-pill { flex: none; font: 700 12px/1 var(--body); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.bc-pill[aria-pressed="true"] { color: var(--bg); background: var(--brand); border-color: var(--brand); }
.bc-pill[data-r][aria-pressed="true"] { background: var(--rc, var(--brand)); border-color: var(--rc, var(--brand)); }
.bc-sort { margin-left: auto; }
.bc-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; overflow-y: auto; min-height: 0; flex: 1; padding: 2px; align-content: start; }
.bc-count { font-size: 12px; color: var(--muted); margin: 0; }
[data-r] { --rc: var(--r-common); }
[data-r="rare"] { --rc: var(--r-rare); }
[data-r="epic"] { --rc: var(--r-epic); }
[data-r="legendary"] { --rc: var(--r-legendary); }
[data-r="mythical"] { --rc: var(--r-mythical); }
[data-r="secret"] { --rc: var(--r-secret); }
[data-r="exclusive"] { --rc: var(--r-exclusive); }
[data-r="boss"] { --rc: var(--r-boss); }
[data-r="divine"] { --rc: var(--r-divine); }
.pet { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-bottom: 3px solid var(--rc); border-radius: 10px; background: var(--panel-2); color: var(--text); cursor: pointer; font: 700 12px/1.2 var(--body); text-align: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pet:hover { border-color: var(--rc); }
.pet[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--rc); }
.pet-art { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.pet-art img { width: 100%; height: 100%; object-fit: contain; }
.pet-art b { font: 700 22px/1 var(--head); color: var(--rc); }
.pet-name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.4em; }
.pet-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; padding: 2px 4px; border-radius: 6px; background: var(--heart); color: var(--bg); font-size: 12px; line-height: 1; }
.pet-badge[hidden] { display: none; }

.pen { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.slot { position: relative; aspect-ratio: 1; min-height: 120px; border: 2px dashed var(--line); border-radius: var(--radius); background:
  repeating-linear-gradient(90deg, transparent 0 22px, rgba(224, 146, 58, .10) 22px 26px), var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--muted); font: 700 14px/1.2 var(--body); padding: 8px; text-align: center; }
.slot.is-full { border-style: solid; border-color: var(--rc); }
.slot-plus { font: 700 36px/1 var(--head); color: var(--brand); }
.slot .pet-art { width: 72px; height: 72px; }
.slot-name { color: var(--text); }
.slot-rar { font-size: 12px; color: var(--rc); }
.heart { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--heart); background: var(--bg); display: grid; place-items: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.heart svg { width: 28px; height: 28px; fill: var(--heart); }
.heart.is-holding { background: var(--heart); }
.heart.is-holding svg { fill: var(--bg); }
.pen-hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

.egg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.egg-empty { color: var(--muted); margin: 0; }
.egg-res { display: flex; align-items: center; gap: 12px; }
.egg-res .pet-art { width: 64px; height: 64px; border: 2px solid var(--rc); }
.egg-name { font: 700 22px/1.2 var(--head); margin: 0; }
.egg-rar { font-size: 12px; font-weight: 700; color: var(--rc); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.egg-big { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.big { padding: 12px; border-radius: 10px; background: var(--bg); }
.big b { display: block; font: 700 36px/1.1 var(--head); color: var(--heart); font-variant-numeric: tabular-nums; }
.big span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.big.alt b { color: var(--text); }
.odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.odds div { padding: 8px; border-radius: 10px; background: var(--bg); text-align: center; }
.odds b { display: block; font: 700 18px/1.2 var(--head); font-variant-numeric: tabular-nums; }
.odds span { font-size: 12px; color: var(--muted); }
.formula { margin: 0; font: 400 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.mates { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }
.mate { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; font: 700 14px/1.2 var(--body); text-align: left; width: 100%; }
.mate:hover { border-color: var(--brand); }
.mate .pct { margin-left: auto; color: var(--heart); font-variant-numeric: tabular-nums; }
.mate .arr { color: var(--muted); }
.mate i { font-style: normal; color: var(--rc); }
.tries { display: flex; gap: 4px; flex-wrap: wrap; }

.route { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.node { border-left: 2px solid var(--line); padding-left: 12px; margin-left: 8px; display: flex; flex-direction: column; gap: 8px; }
.node-head { display: flex; align-items: center; gap: 8px; }
.node-head .pet-art { width: 36px; height: 36px; border: 1px solid var(--rc); }
.node-name { font-weight: 700; }
.node-note { font-size: 12px; color: var(--muted); }
.node-pair { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; cursor: pointer; background: var(--bg); color: var(--text); font: 700 12px/1.2 var(--body); width: 100%; text-align: left; }
.node-pair:hover { border-color: var(--heart); }
.node-pair .pct { margin-left: auto; color: var(--heart); }
.route-sum { padding: 12px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.route-sum b { color: var(--heart); font-family: var(--head); font-size: 22px; }
.book { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; max-height: 340px; }
.bc-tip { position: fixed; z-index: 50; max-width: 240px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.bc-tip b { display: block; font-size: 14px; }
.bc-src { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* ===== Lasso picker (tool: lasso-picker) ===== */
.lp { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lasso { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-top: 3px solid var(--rc); border-radius: 10px; background: var(--panel-2); color: var(--text); cursor: pointer; text-align: left; font: 700 14px/1.2 var(--body); }
.lasso[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--rc); }
.lasso-str { font: 700 28px/1 var(--head); color: var(--gold); font-variant-numeric: tabular-nums; }
.lasso-meta { font-size: 12px; color: var(--muted); }
.lp-side { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 720px; }

@media (max-width: 1180px) {
  .bc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bc-book { grid-column: 1 / -1; }
  .read { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 760px) {
  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .top { position: static; }
  .top-in { padding: 8px 16px; gap: 8px; flex-wrap: wrap; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { flex: none; }
  .hero, .stage, .read, .page, .tool-head, .talk, .foot-in { padding-left: 16px; padding-right: 16px; }
  .codebar-more { margin-left: 0; }
  .bc { grid-template-columns: 1fr; }
  .bc-mid { order: -1; position: sticky; top: 0; z-index: 10; max-height: 46vh; overflow-y: auto; box-shadow: var(--shadow); }
  .bc-pen-col { max-height: 60vh; }
  .slot { min-height: 96px; }
  .slot .pet-art { width: 48px; height: 48px; }
  .big b { font-size: 28px; }
  .bc-grid { grid-template-columns: repeat(2, 1fr); }
  .lp { grid-template-columns: 1fr; }
  .lp-grid { grid-template-columns: repeat(2, 1fr); }
  .stats li { min-width: 0; flex: 1 1 40%; }
}
.mate .pet-art { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.mate .pet-art b { font-size: 14px; }
:root { --r-godly: #ffe08a; }
[data-r="godly"] { --rc: var(--r-godly); }
.rar[data-r="godly"] { color: var(--r-godly); }
.lp-side .mates { max-height: 360px; }
.lp-side span.mate { cursor: default; }
