/* tools.tbe.gg shared shell — tbe.gg design system (dark-only, single accent #3b9eff,
   Geist / system stack). Kept small + self-contained; every tool includes this one file.
   See DESIGN.md. */
:root {
  color-scheme: dark;
  --bg: #0a0e14;
  --surface: #12151a;
  --surface-2: #0d1117;
  --border: #1e2a3a;
  --text: #e6e8eb;
  --dim: #9aa1a9;
  --faint: #5b626a;
  --accent: #3b9eff;
  --accent-a08: rgb(59 158 255 / 0.08);
  --accent-a18: rgb(59 158 255 / 0.18);
  --radius: 8px;
  --sp: 16px;
  --mono: ui-monospace, "Geist Mono", SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Geist Sans", "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── shared header (matches the tbe.gg-zone chrome) ── */
header.site {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp);
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
header.site .brand { font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-size: 1rem; }
header.site .brand b { color: var(--accent); }
header.site .brand .tool { color: var(--dim); font-weight: 600; }
header.site nav { display: flex; gap: 16px; font-size: 13px; }
header.site nav a { color: var(--dim); white-space: nowrap; }
header.site nav a:hover { color: var(--accent); text-decoration: none; }

main { max-width: 960px; margin: 0 auto; padding: 28px 20px 64px; }
h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
p.lead { color: var(--dim); margin: 0 0 24px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 28px 0 10px; }

/* ── hub tool cards ── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
  display: block; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.tool-card:hover { border-color: var(--accent); background: var(--accent-a08); text-decoration: none; }
.tool-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.tool-card span { color: var(--dim); font-size: 13px; }
.tool-card .game { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 8px; display: block; }

/* ── forms + panels ── */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .panels { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; }
.panel h2 { margin-top: 0; }
label { display: block; font-size: 13px; color: var(--dim); margin: 10px 0 4px; }
input[type=search], input.pal, select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 9px 11px; font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; }

/* ── results ── */
.result-child {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--accent-a18);
  background: var(--accent-a08); border-radius: var(--radius);
}
.result-child .who { font-size: 18px; font-weight: 600; }
.result-child .via { color: var(--dim); font-size: 13px; margin-top: 4px; }
.badge {
  display: inline-block; font: 600 10px/1 var(--mono); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 6px; border-radius: 4px;
  border: 1px solid var(--accent-a18); color: var(--accent); margin-left: 8px;
}
ul.pairs { list-style: none; padding: 0; margin: 12px 0 0; }
ul.pairs li {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
ul.pairs li:last-child { border-bottom: 0; }
ul.pairs .plus { color: var(--faint); }
.count { color: var(--dim); font-size: 13px; }
.empty { color: var(--faint); padding: 12px 0; }
.rank { color: var(--faint); font: 11px/1 var(--mono); }

/* ── item compare ── */
.cmp-count { color: var(--dim); font-size: 13px; margin: 0 0 16px; }
.cmp-hint { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; }
.cmp-hint p { margin: 0 0 8px; }
.cmp-hint p:last-child { margin-bottom: 0; }
.cmp-note { color: var(--faint); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.cmp-empty2 { color: var(--faint); font-size: 13px; margin: 0; }

.cmp-wrap { overflow-x: auto; margin: 0 0 8px; -webkit-overflow-scrolling: touch; }
table.cmp { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 14px; }
table.cmp th, table.cmp td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.cmp tbody th[scope=row] { color: var(--dim); font-weight: 500; white-space: nowrap; }
table.cmp thead th { border-bottom: 1px solid var(--border); }
.cmp-h { position: relative; min-width: 130px; padding-top: 12px; }
.cmp-h.err { color: var(--faint); }
.cmp-sprite { display: block; image-rendering: pixelated; margin-bottom: 4px; }
.cmp-name { display: block; font-weight: 600; color: var(--text); line-height: 1.3; }
a.cmp-name:hover { color: var(--accent); }
.cmp-sub { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.cmp-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2);
  color: var(--dim); font-size: 14px; line-height: 1; cursor: pointer;
}
.cmp-x:hover { border-color: var(--accent); color: var(--accent); }
td.cmp-empty { color: var(--faint); }
/* Bold (not accent) marks the numerically-largest cell in a row. Neutral on purpose:
   stats are free-form, so "largest" is not always "best" (e.g. Use Time, cooldown). */
td.cmp-max { color: var(--text); font-weight: 700; }

.cmp-shared { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 4px 16px; }
.cmp-srow { display: flex; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cmp-srow:last-child { border-bottom: 0; }
.cmp-slabel { color: var(--dim); }
.cmp-sval { color: var(--text); text-align: right; }
.cmp-stations { margin-top: 10px; }

.cmp-craft { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 12px; }
.cmp-cgroup { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; }
.cmp-cgroup h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); font-weight: 600; }
ul.cmp-ings { list-style: none; margin: 0; padding: 0; }
ul.cmp-ings li { padding: 4px 0; font-size: 14px; }
ul.cmp-ings li.uniq { border-left: 2px solid var(--accent); padding-left: 8px; margin-left: -2px; }
h3 { font-size: 13px; }

/* Acquisition ("How to get") cards reuse .cmp-craft / .cmp-cgroup. */
.acq-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.acq-badge {
  display: inline-block; font: 600 11px/1 var(--mono); text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 7px; border-radius: 4px;
  color: var(--accent); border: 1px solid var(--accent-a18); background: var(--accent-a08);
}
.acq-badge.acq-unknown { color: var(--faint); border-color: var(--border); background: none; }
.cmp-cgroup h4 { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); font-weight: 600; }
.acq-note { color: var(--faint); font: 11px/1 var(--mono); }

footer {
  max-width: 960px; margin: 40px auto 24px; padding: 14px 20px 0;
  border-top: 1px solid var(--border); color: var(--faint); font-size: 12px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
footer a { color: var(--faint); }
footer a:hover { color: var(--accent); }
