:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #24292f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-weak: #dbeafe;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  background: #1e293b;
  color: #fff;
  padding: 0.6rem 1rem;
}
header.site .inner {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.2rem;
}
header.site .brand { font-weight: 700; font-size: 1.05rem; color: #fff; }
header.site nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
header.site nav a { color: #cbd5e1; font-size: 0.9rem; }
header.site nav a:hover { color: #fff; text-decoration: none; }

main { max-width: 960px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.35rem; margin: 0.6rem 0 0.4rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 0.5rem; border-left: 4px solid var(--accent); padding-left: 0.5rem; }
.lead { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

table.data {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  background: var(--card);
}
table.data th, table.data td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  text-align: left;
  white-space: nowrap;
}
table.data th { background: #f1f5f9; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

.type-badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}
[data-type="ノーマル"] { background: #9199a1; }
[data-type="ほのお"]   { background: #e8613b; }
[data-type="みず"]     { background: #3a8fdd; }
[data-type="でんき"]   { background: #d8b209; }
[data-type="くさ"]     { background: #4faa3d; }
[data-type="こおり"]   { background: #4bc0b8; }
[data-type="かくとう"] { background: #c44658; }
[data-type="どく"]     { background: #9c4fc4; }
[data-type="じめん"]   { background: #b0793a; }
[data-type="ひこう"]   { background: #7e9ecf; }
[data-type="エスパー"] { background: #e06a8a; }
[data-type="むし"]     { background: #93ab1e; }
[data-type="いわ"]     { background: #a89b62; }
[data-type="ゴースト"] { background: #5f6dbc; }
[data-type="ドラゴン"] { background: #2c6bc0; }
[data-type="あく"]     { background: #5a5462; }
[data-type="はがね"]   { background: #58879a; }
[data-type="フェアリー"] { background: #d982d9; }

.statbar { display: flex; align-items: center; gap: 0.5rem; }
.statbar .bar {
  height: 10px; border-radius: 5px; background: var(--accent);
  min-width: 2px;
}
.statbar .bar.low { background: #f59e0b; }
.statbar .bar.high { background: #16a34a; }

/* 計算機 */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .calc-grid { grid-template-columns: 1fr; } }
.panel h2 { margin-top: 0; }
.field { margin-bottom: 0.6rem; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.15rem; }
.field input[type="text"], .field select, .field input[type="number"] {
  width: 100%; padding: 0.4rem 0.5rem;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 0.95rem; background: #fff;
}
.field-row { display: flex; gap: 0.6rem; }
.field-row .field { flex: 1; }
.ev-note { font-size: 0.75rem; color: var(--muted); }
.ev-note.over { color: #dc2626; font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 0.7rem; font-size: 0.85rem; }
.checks label { display: flex; align-items: center; gap: 0.25rem; }

#result {
  border: 2px solid var(--accent);
  background: var(--accent-weak);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}
#result .headline { font-size: 1.25rem; font-weight: 700; }
#result .ko { font-size: 1.05rem; margin-top: 0.2rem; }
#result .detail { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; word-break: break-all; }
.hpbar { height: 14px; background: #e2e8f0; border-radius: 7px; overflow: hidden; margin-top: 0.5rem; position: relative; }
.hpbar .min, .hpbar .max { position: absolute; left: 0; top: 0; bottom: 0; }
.hpbar .max { background: #fca5a5; }
.hpbar .min { background: #ef4444; }

footer.site {
  max-width: 960px; margin: 2rem auto 0; padding: 1rem;
  font-size: 0.75rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
.poke-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; padding: 0; list-style: none; }
.poke-list li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; }
.crumb { font-size: 0.8rem; color: var(--muted); margin-top: 0.8rem; }
