:root {
  --bg: #12151c;
  --card: #1b1f29;
  --card-2: #232834;
  --border: #2e3543;
  --text: #e6ebf2;
  --text-dim: #9aa4b5;
  --accent: #5b8def;
  --accent-hover: #6f9dfa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #1c2740, #2b3f6b);
  color: #fff;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
header h1 { margin: 0 0 4px; font-size: 1.5rem; }
header .sub { margin: 0; color: #c3cee4; font-size: 0.9rem; }

main {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 720px) {
  main { grid-template-columns: 1fr; }
}

.selector,
.detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 8px 0 4px;
  color: var(--text-dim);
}

#search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--card-2);
  color: var(--text);
}
#search::placeholder { color: #6b7688; }

#pokemon-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  font-size: 0.95rem;
  background: var(--card-2);
  color: var(--text);
}
#pokemon-select option { padding: 4px 6px; background: var(--card-2); }

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.poke-image-wrap {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.poke-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
.poke-image-wrap.no-image img { display: none; }
.poke-image-wrap.no-image::after {
  content: "No Image";
  color: #5a6478;
  font-size: 0.75rem;
}
.detail-head-info { min-width: 0; }

.dex-no {
  display: inline-block;
  background: #26324c;
  color: var(--accent-hover);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.detail-head-info h2 { margin: 0 0 6px; font-size: 1.3rem; }

.types { display: flex; gap: 6px; }
.type-badge {
  color: #fff;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.stats { display: grid; gap: 8px; margin-bottom: 20px; }
.stat-row {
  display: grid;
  grid-template-columns: 64px 40px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.stat-label { color: var(--text-dim); }
.stat-value { font-weight: 700; text-align: right; }
.stat-bar-bg {
  background: #2a303c;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.stat-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f9dfa, #5b8def);
}
.stat-total {
  margin-top: 4px;
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

/* 技選択 */
.moves-area { margin-bottom: 20px; }
.moves-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.moves-head h3 { margin: 0; font-size: 1rem; }
.moves-count { color: var(--text-dim); font-size: 0.85rem; }

.moves-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
}
.move-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.move-item:hover { background: #2b3140; }
.move-item.selected { border-color: var(--accent); background: #26324c; }
.move-item.disabled { opacity: 0.4; cursor: not-allowed; }
.move-item input { accent-color: var(--accent); }

.move-main { min-width: 0; }
.move-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.move-sub {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.move-type {
  color: #fff;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.move-cat {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 600;
}
.move-cat.cat-物 { color:#ff8a5c; border-color:#ff8a5c; }
.move-cat.cat-特 { color:#6fb0ff; border-color:#6fb0ff; }
.move-cat.cat-変 { color:#a0e57a; border-color:#a0e57a; }

.moves-empty { color: var(--text-dim); font-size: 0.85rem; }

/* JSON */
.json-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.json-head h3 { margin: 0; font-size: 1rem; }
.json-actions { display: flex; gap: 8px; }
#copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}
#copy-btn:hover { background: var(--accent-hover); }
#download-btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}
#download-btn:hover { background: #2b3140; }

pre {
  background: #0e1117;
  color: #e6edf3;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 8px 0 0;
  border: 1px solid var(--border);
}

.placeholder p { color: var(--text-dim); text-align: center; margin: 20px 0; }

/* タイプ別カラー */
.t-ノーマル   { background:#9099a1; }
.t-ほのお     { background:#ff7b3a; }
.t-みず       { background:#3a97ff; }
.t-でんき     { background:#f2c700; color:#3a3300; }
.t-くさ       { background:#4caf50; }
.t-こおり     { background:#57c6d4; }
.t-かくとう   { background:#d63b3b; }
.t-どく       { background:#9b52c4; }
.t-じめん     { background:#d4a13a; }
.t-ひこう     { background:#8fa9f0; }
.t-エスパー   { background:#ff5f8f; }
.t-むし       { background:#94b12a; }
.t-いわ       { background:#b8a038; }
.t-ゴースト   { background:#5a5aa0; }
.t-ドラゴン   { background:#5b45d6; }
.t-あく       { background:#5a5049; }
.t-はがね     { background:#7f9aa8; }
.t-フェアリー { background:#f08ad0; }
