:root {
  --bg: #14161a;
  --panel: #1c1f25;
  --line: #2c313a;
  --text: #e6e9ef;
  --dim: #98a1b0;
  --accent: #6ea8fe;
  --gain: #6ee7a8;
  --drop: #f08a8a;
  --grind: #d9b45f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px 20px 64px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; }
header { max-width: 1100px; margin: 0 auto 20px; }
.note, .dim, .status { color: var(--dim); font-size: 12px; }
.panel {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hidden { display: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
select, input[type="number"] {
  background: #12141a; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit;
}
input[type="number"] { width: 70px; }
button {
  background: #262b34; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 14px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #10131a; border-color: var(--accent); font-weight: 600; }
.file-label input { display: none; }
.file-label span {
  display: inline-block; padding: 8px 16px; border: 1px dashed var(--line);
  border-radius: 8px; cursor: pointer;
}
.file-label span:hover { border-color: var(--accent); }
.summary { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.summary b { font-variant-numeric: tabular-nums; }

.reco-list { display: grid; gap: 8px; }
.progress { height: 6px; background: #12141a; border-radius: 3px; margin-top: 10px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .12s linear; }

.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.badge.promote { background: #2b3f57; color: #9ecbff; }
.badge.improve { background: #2f3a2f; color: #a8dba8; }

.reco {
  display: grid; grid-template-columns: 34px auto 1fr auto auto; gap: 12px;
  align-items: center; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #191c22; cursor: pointer; text-align: left;
  color: inherit; font: inherit; width: 100%;
}
.reco:hover { border-color: var(--accent); }
.reco.active { border-color: var(--accent); background: #1f2530; }
.reco .rank { color: var(--dim); font-variant-numeric: tabular-nums; }
.reco .gain { color: var(--gain); font-weight: 600; font-variant-numeric: tabular-nums; }
.reco .changes, .reco .score { color: var(--dim); font-variant-numeric: tabular-nums; }

.build-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.build h3 { font-size: 13px; margin: 0 0 8px; color: var(--dim); font-weight: 600; }
.slots { display: grid; gap: 6px; }
.rune {
  border: 1px solid var(--line); border-radius: 8px; background: #191c22;
  padding: 8px 10px; cursor: pointer; width: 100%; text-align: left;
  color: inherit; font: inherit;
}
.rune.changed { border-color: var(--accent); }
.rune.removed { opacity: 0.55; }
.rune-head { display: flex; gap: 8px; align-items: baseline; }
.rune-head .slot { color: var(--dim); width: 22px; }
.rune-head .set { font-weight: 600; }
.rune-head .main { margin-left: auto; font-variant-numeric: tabular-nums; }
.rune-effects { margin: 6px 0 0; padding: 0; list-style: none; display: none; }
.rune.open .rune-effects { display: grid; gap: 2px; }
.rune-effects li { display: flex; gap: 8px; font-size: 12px; color: var(--dim); }
.rune-effects .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.rune-effects .grind { color: var(--grind); }
.build-total { margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--gain); }
.delta-down { color: var(--drop); }

#history table { width: 100%; border-collapse: collapse; font-size: 13px; }
#history th, #history td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
#history th { color: var(--dim); font-weight: 600; }
#history td.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .build-compare { grid-template-columns: 1fr; }
  .reco { grid-template-columns: 28px auto 1fr auto; }
  .reco .changes { display: none; }
}
