/* compare.css — Knowledges → Enchantment, tab Bandingkan (K3d):
   kolom set, tabel dengan batang & pemenang, ringkasan. */

.ek-compare { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.ek-compare__top {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.ek-compare__top .kit-seg { max-width: 100%; overflow-x: auto; }
.ek-compare__body { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

.ek-ccols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-3); }
.ek-ccol {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); min-width: 0;
}
.ek-ccol.is-off { border-style: dashed; }
.ek-ccol--add {
  align-items: center; justify-content: center; min-height: 120px;
  font: 600 var(--fs-sm) var(--font-body); color: var(--text-secondary);
  border-style: dashed; cursor: pointer;
}
.ek-ccol--add:hover { color: var(--text-primary); border-color: var(--border-strong); }
.ek-ccol--add:focus-visible { outline: var(--focus-outline); }
.ek-ccol__head { display: flex; align-items: center; gap: var(--space-2); }
.ek-ccol__head .item-icon { image-rendering: pixelated; flex: 0 0 auto; }
.ek-ccol__title { flex: 1 1 auto; min-width: 0; font: 700 var(--fs-sm) var(--font-display); color: var(--text-primary); }
.ek-ccol__field { display: flex; flex-direction: column; gap: 4px; }
.ek-ccol__field .select-input { width: 100%; }
.ek-ccol__toggle {
  min-height: 36px; font: 600 var(--fs-sm) var(--font-body); color: var(--text-secondary);
  background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); cursor: pointer;
}
.ek-ccol__toggle.is-on { color: var(--mc-glint-light); background: var(--mc-glint-deep); border-color: var(--mc-glint-edge); }
.ek-ccol__toggle:focus-visible, .ek-ccol__3d:focus-visible { outline: var(--focus-outline); }
.ek-ccol__ench { display: flex; flex-direction: column; gap: 2px; }
.ek-ccol__line { margin: 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.ek-ccol__line strong { color: var(--text-primary); }
.ek-ccol__3d { align-self: flex-start; }

.ek-csummary {
  margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); color: var(--text-primary);
  background: var(--bg-inset); border-left: 3px solid var(--mc-glint-light);
}

.ek-ctable-wrap { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.ek-ctable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ek-ctable th, .ek-ctable td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.ek-ctable tr:first-child th { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.ek-ctable__stat { min-width: 150px; }
.ek-ctable__label { display: block; font-weight: 600; color: var(--text-primary); }
.ek-ctable__note { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
.ek-ctable td { min-width: 110px; }
.ek-ctable__val { display: block; font: 700 var(--fs-sm) var(--font-mono); color: var(--text-secondary); }
.ek-ctable td.is-win .ek-ctable__val { color: var(--status-success); }
.ek-ctable__bar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--bg-inset); overflow: hidden; }
.ek-ctable__fill { display: block; height: 100%; border-radius: 3px; background: var(--border-strong); }
.ek-ctable td.is-win .ek-ctable__fill { background: var(--status-success); }

@media (max-width: 520px) {
  .ek-ccol, .ek-compare__top { padding: var(--space-3); }
  .ek-ctable__stat { min-width: 120px; }
  .ek-ctable td { min-width: 92px; }
}

/* ── kepala kolom berikon & info tambahan ── */
.ek-ctable__head { vertical-align: bottom; }
.ek-ctable__icons { display: flex; gap: 2px; margin-bottom: 4px; }
.ek-ctable__hlabel { display: block; }
.ek-ctable td.ek-ctable__text { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--text-secondary); white-space: normal; }
.ek-ctable td.is-bad .ek-ctable__val { color: var(--status-error); }
.ek-cextra { display: flex; flex-direction: column; gap: var(--space-3); }
.ek-cnotes { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
/* Kolom kedua tabel sejajar: lebar tetap, kolom statistik ±34%. */
.ek-ctable { table-layout: fixed; min-width: 520px; }
.ek-ctable tr:first-child th:first-child { width: 34%; }
.ek-ctable-wrap { overflow-x: auto; }

/* ── HP: tanpa geser ke samping — nama statistik di atas, nilai berdampingan ── */
@media (max-width: 719px) {
  .ek-ctable-wrap { overflow: visible; }
  .ek-ctable, .ek-ctable tbody { display: block; min-width: 0; width: 100%; }
  .ek-ctable tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-3); row-gap: 4px;
    padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle);
  }
  .ek-ctable[data-cols="3"] tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ek-ctable th, .ek-ctable td { display: block; min-width: 0; padding: 0; border: 0; }
  .ek-ctable tr > .ek-ctable__stat { grid-column: 1 / -1; min-width: 0; }
  .ek-ctable tr:first-child th:first-child { display: none; width: auto; }
  .ek-ctable tr:first-child {
    position: sticky; top: 0; z-index: 2; background: var(--bg-surface-2);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  .ek-ctable__hlabel { font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
  .ek-ctable td[data-col]::before {
    content: attr(data-col); display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin-bottom: 2px; border-radius: 999px;
    font: 700 10px var(--font-body); color: var(--text-muted); background: var(--bg-inset);
  }
  .ek-ctable td { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .ek-ctable td[data-col]::before { margin-bottom: 0; flex: 0 0 auto; }
  .ek-ctable__val { font-size: var(--fs-xs); }
  .ek-ctable__bar { flex: 1 0 100%; margin-top: 0; }
}

/* Atur sendiri (CustomEditor.js) */
.ek-ccustom {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); background: var(--bg-inset);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.ek-ccustom__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ek-ccustom__tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 4px 2px;
  font: 600 11px var(--font-body); color: var(--text-secondary); cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.ek-ccustom__tab.is-active { color: var(--mc-glint-light); border-color: var(--mc-glint-light); background: var(--mc-glint-deep); }
.ek-ccustom__tab:focus-visible { outline: var(--focus-outline); }
.ek-ccustom__ench { display: flex; flex-direction: column; gap: var(--space-2); }
.ek-ccustom__ench .ek-cchips { gap: 4px; }
.ek-ccustom__ench .ek-cchip { min-height: 32px; font-size: var(--fs-xs); background: var(--bg-surface); border-radius: var(--radius-sm); }
.ek-ccustom__ench .ek-cchip.is-picked { background: var(--mc-glint-deep); }
.ek-ccustom__ench .ek-picked__row { flex-wrap: wrap; }

/* Radar (CompareRadar.js) */
.ek-radar {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-4); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.ek-radar__svg { width: 100%; max-width: 480px; height: auto; overflow: visible; }
.ek-radar__ring { fill: none; stroke: var(--border-subtle); stroke-width: 1; }
.ek-radar__axis { stroke: var(--border-subtle); stroke-width: 1; }
.ek-radar__label { fill: var(--text-secondary); font: 600 11px var(--font-body); }
.ek-radar__poly { fill-opacity: 0.18; stroke-width: 2; stroke-linejoin: round; }
.ek-radar__dot { stroke: none; }
.ek-radar__poly--1 { fill: var(--mc-glint-light); stroke: var(--mc-glint-light); }
.ek-radar__poly--2 { fill: var(--accent-teal-bright); stroke: var(--accent-teal-bright); }
.ek-radar__poly--3 { fill: var(--accent-copper-bright); stroke: var(--accent-copper-bright); }
.ek-radar__dot.ek-radar__poly--1, .ek-radar__dot.ek-radar__poly--2, .ek-radar__dot.ek-radar__poly--3 { fill-opacity: 1; }
.ek-radar__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); color: var(--text-primary); }
.ek-radar__legend li { display: inline-flex; align-items: center; gap: 6px; }
.ek-radar__swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ek-radar__swatch--1 { background: var(--mc-glint-light); }
.ek-radar__swatch--2 { background: var(--accent-teal-bright); }
.ek-radar__swatch--3 { background: var(--accent-copper-bright); }
.ek-cview { align-self: flex-start; }
.ek-ccol__acts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
