/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: monospace; font-size: 14px; background: #1c1c1c; color: #eee; min-height: 100vh; }

/* ── Header ── */
.header { border-bottom:2px solid #3d3d3d; margin-bottom:20px; }
.header-inner { display:flex; justify-content:space-between; align-items:center; max-width:860px; margin:0 auto; padding:16px 20px; }
.header h1 { margin:0; color:#eee; font-size:1.25rem; }

/* ── Buttons ── */
.btn { padding:6px 14px; font-family:monospace; font-size:13px; cursor:pointer; border:2px solid #2a2a2a; background:#3d3d3d; color:#eee; transition:all 0.15s; }
.btn:hover { background:#2a2a2a; border-color:#00d9ff; color:#00d9ff; }
.btn.danger { border-color:#ff6b6b; color:#ff6b6b; }
.btn.danger:hover { background:rgba(255,107,107,0.1); }
.btn-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.calc-btn { padding:7px 18px; background:#3d3d3d; border:2px solid #00d9ff; color:#00d9ff; font-family:monospace; font-size:13px; cursor:pointer; transition:all 0.15s; }
.calc-btn:hover { background:rgba(0,217,255,0.1); }

/* ── Layout ── */
main { max-width:860px; margin:0 auto; padding:0 20px 48px; }
.section-divider { border:none; border-top:2px solid #3d3d3d; margin:24px 0 20px; }

/* ── Search ── */
.search-wrap { position:relative; margin-bottom:20px; }
.search-label { display:block; font-weight:bold; margin-bottom:6px; color:#eee; }
#search { width:100%; padding:8px 10px; background:#2a2a2a; border:2px solid #3d3d3d; color:#eee; font-family:monospace; font-size:14px; outline:none; }
#search:focus { border-color:#00d9ff; }
#search::placeholder { color:#555; }

/* ── Autocomplete ── */
.ac-list { position:absolute; top:100%; left:0; right:0; background:#2a2a2a; border:2px solid #3d3d3d; border-top:none; max-height:220px; overflow-y:auto; z-index:200; display:none; }
.ac-list.open { display:block; }
.ac-item { padding:6px 10px; cursor:pointer; display:flex; align-items:center; gap:8px; border-bottom:1px solid #3d3d3d; font-size:13px; color:#eee; }
.ac-item:hover, .ac-item.hi { background:#3d3d3d; }
.ac-item .ac-sub { color:#888; font-size:11px; margin-left:auto; }
.ac-item .ac-alarm { color:#ff6b6b; font-size:11px; }
.ac-item .ac-custom { color:#00d9ff; font-size:11px; font-style:italic; }

/* ── Card ── */
.card { background:#2a2a2a; border:2px solid #3d3d3d; margin-bottom:20px; animation:fadeUp 0.2s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
.card-header { background:#3d3d3d; padding:8px 12px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.card-title { font-weight:bold; font-size:1rem; color:#eee; }
.card-sub { color:#888; font-size:12px; }
.alarm-badge { margin-left:auto; color:#ff6b6b; font-size:11px; border:1px solid #ff6b6b; padding:1px 6px; background:rgba(255,107,107,0.1); }

/* ── Card Body ── */
.card-body { display:flex; }
.sprite-col { flex-shrink:0; width:100px; background:#3d3d3d; border-right:2px solid #3d3d3d; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:8px; gap:4px; }
.sprite-col img { width:80px; height:80px; image-rendering:pixelated; object-fit:contain; }
.no-spr { width:80px; height:80px; display:flex; align-items:center; justify-content:center; color:#555; font-size:10px; border:1px dashed #333; }
.species-label { font-size:10px; color:#00d9ff; font-weight:bold; text-align:center; letter-spacing:0.05em; }
.info-col { flex:1; min-width:0; padding:10px 14px; }
.info-table { width:100%; border-collapse:collapse; margin-bottom:10px; font-size:13px; }
.info-table td { padding:3px 8px 3px 0; vertical-align:top; border-bottom:1px solid #3d3d3d; }
.info-table td:first-child { color:#888; width:72px; white-space:nowrap; }
.speed-both { display:flex; gap:14px; }
.speed-chip { font-size:12px; color:#00d9ff; }
.speed-chip span { color:#888; font-size:11px; }

/* ── Moves ── */
.moves-label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:5px; }
.moves-grid { display:grid; grid-template-columns:1fr 1fr; gap:3px 12px; }
.move-row { display:flex; align-items:center; gap:5px; font-size:12px; color:#eee; }
.cat-pill { font-size:10px; font-weight:bold; padding:1px 4px; flex-shrink:0; letter-spacing:0.03em; }
.cat-ATK { background:rgba(220,70,70,0.25); color:#e07070; border:1px solid rgba(220,70,70,0.5); }
.cat-DEF { background:rgba(70,130,220,0.25); color:#70a8e0; border:1px solid rgba(70,130,220,0.5); }
.cat-SPT { background:rgba(60,200,100,0.2); color:#60c880; border:1px solid rgba(60,200,100,0.4); }
.cat-NA  { background:rgba(80,80,90,0.25); color:#777; border:1px solid rgba(80,80,90,0.4); }

/* ── Probability Bars ── */
.prob-section { border-top:2px solid #3d3d3d; padding:10px 14px; }
.hp-tabs { display:flex; margin-bottom:10px; width:fit-content; }
.hp-tab { padding:5px 14px; font-size:12px; font-family:monospace; background:#3d3d3d; color:#888; border:2px solid #3d3d3d; cursor:pointer; transition:all 0.1s; }
.hp-tab.active { background:#2a2a2a; color:#00d9ff; border-color:#00d9ff; }
.hp-tab.active.low-hp { color:#ff6b6b; border-color:#ff6b6b; }
.prob-cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.prob-group-title { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:6px; }
.bar-row { display:flex; align-items:center; gap:6px; margin-bottom:5px; }
.bar-label { width:56px; text-align:right; color:#888; font-size:11px; flex-shrink:0; }
.bar-track { flex:1; height:12px; background:#141414; border:1px solid #3d3d3d; overflow:hidden; }
.bar-fill { height:100%; transition:width 0.35s ease; }
.bar-fill.atk  { background:#c04040; }
.bar-fill.def  { background:#3070c0; }
.bar-fill.spt  { background:#30a050; }
.bar-fill.ratk { background:#802828; }
.bar-fill.rdef { background:#1a4a8a; }
.bar-fill.rno  { background:#505060; }
.bar-pct { width:38px; font-size:12px; color:#00d9ff; font-variant-numeric:tabular-nums; flex-shrink:0; text-align:right; }

/* ── Custom Set Panel ── */
.custom-panel { background:#2a2a2a; border:2px solid #3d3d3d; margin-bottom:20px; }
.custom-panel-header { background:#3d3d3d; padding:8px 12px; display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; }
.custom-panel-header:hover { background:#484848; }
.custom-panel-title { font-weight:bold; color:#eee; }
.custom-panel-hint { color:#888; font-size:11px; }
.chevron { color:#888; transition:transform 0.2s; font-size:11px; }
.chevron.open { transform:rotate(180deg); }
.custom-panel-body { padding:14px; display:none; }
.custom-panel-body.open { display:block; animation:fadeUp 0.2s ease; }

/* ── Custom Form ── */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 16px; margin-bottom:12px; }
.form-group { display:flex; flex-direction:column; gap:4px; }
.form-group label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.06em; }
.form-input, .form-select { padding:6px 8px; background:#3d3d3d; border:1px solid #2a2a2a; color:#eee; font-family:monospace; font-size:13px; outline:none; width:100%; }
.form-input:focus, .form-select:focus { border-color:#00d9ff; }
.form-input::placeholder { color:#555; }
.moves-row { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.move-input-wrap { position:relative; }
.move-input-wrap label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.06em; display:block; margin-bottom:4px; }
.move-ac { position:absolute; top:100%; left:0; right:0; z-index:300; background:#2a2a2a; border:1px solid #3d3d3d; border-top:none; max-height:160px; overflow-y:auto; display:none; }
.move-ac.open { display:block; }
.move-ac-item { padding:5px 8px; cursor:pointer; font-size:12px; border-bottom:1px solid #3d3d3d; color:#eee; display:flex; align-items:center; gap:6px; }
.move-ac-item:hover, .move-ac-item.hi { background:#3d3d3d; }
.move-ac-cat { font-size:10px; font-weight:bold; padding:1px 3px; flex-shrink:0; }

/* ── Smogon Import ── */
.smogon-section { margin-bottom:12px; }
.smogon-label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:4px; display:block; }
.smogon-or { text-align:center; color:#555; font-size:12px; margin:10px 0; position:relative; }
.smogon-or::before, .smogon-or::after { content:''; position:absolute; top:50%; width:42%; height:1px; background:#3d3d3d; }
.smogon-or::before { left:0; } .smogon-or::after { right:0; }
textarea.smogon-input { width:100%; padding:8px; background:#3d3d3d; border:1px solid #2a2a2a; color:#eee; font-family:monospace; font-size:12px; outline:none; resize:vertical; min-height:120px; }
textarea.smogon-input:focus { border-color:#00d9ff; }
textarea.smogon-input::placeholder { color:#555; }
.parse-error { color:#ff6b6b; font-size:12px; margin-top:6px; min-height:16px; }

/* ── Saved Sets ── */
.saved-section { margin-top:16px; border-top:1px solid #3d3d3d; padding-top:12px; }
.saved-title { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:8px; }
.saved-list { display:flex; flex-wrap:wrap; gap:6px; }
.saved-chip { padding:4px 10px; background:#3d3d3d; border:1px solid #2a2a2a; color:#eee; font-size:12px; cursor:pointer; display:flex; align-items:center; gap:6px; transition:border-color 0.15s; }
.saved-chip:hover { border-color:#00d9ff; color:#00d9ff; }
.saved-chip .del-btn { color:#ff6b6b; font-size:11px; padding:0 2px; cursor:pointer; }
.saved-chip .del-btn:hover { color:#ff4444; }
.no-saved { color:#555; font-size:12px; font-style:italic; }
.custom-result { margin-top:16px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:#1c1c1c; }
::-webkit-scrollbar-thumb { background:#3d3d3d; }

/* ── Responsive ── */
@media (max-width:560px) {
  .prob-cols { grid-template-columns:1fr; }
  .form-grid  { grid-template-columns:1fr; }
  .moves-row  { grid-template-columns:1fr 1fr; }
}
