/* Beyblade X Wiki - Teile-Vergleich (vergleich.js) */
/* Jedes gewählte Teil hat eine feste Farbe und einen Buchstaben (A, B, C), überall auf der Seite gleich */
:root {
  --slot-a: #1768cf; --slot-b: #c42a72; --slot-c: #b45309; --slot-ink: #ffffff;
}
:root[data-theme="dark"] {
  --slot-a: #58a6ff; --slot-b: #f2679c; --slot-c: #ffab52; --slot-ink: #0b0f19;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --slot-a: #58a6ff; --slot-b: #f2679c; --slot-c: #ffab52; --slot-ink: #0b0f19;
  }
}
.s0 { --s: var(--slot-a); }
.s1 { --s: var(--slot-b); }
.s2 { --s: var(--slot-c); }
.cmp-slot {
  flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  font: 700 12.5px/1 var(--font-display); font-style: normal; background: var(--s, var(--text)); color: var(--slot-ink);
}

/* ---------- Auswahl ---------- */
.cmp-filters { flex-direction: column; align-items: stretch; }
.cmp-picks { width: 100%; }
.cmp-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cmp-pick { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; max-width: 420px; }
.cmp-pick select {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--s);
  border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cmp-del {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.cmp-del:hover { color: var(--text); border-color: var(--border-strong); }
.cmp-add { flex: none; }

/* ---------- Spalten ---------- */
.cmp-cols { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 14px; }
.cmp-heads { margin: 16px 0; }
.cmp-head {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-top: 4px solid var(--s); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.cmp-head .stage { width: 100%; max-height: 240px; aspect-ratio: auto; height: clamp(150px, 22vw, 240px); }
.cmp-head .stage img { width: auto; max-width: 84%; height: 84%; }
.cmp-head .stage .cmp-slot { position: absolute; left: 10px; top: 10px; width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.cmp-head-b { padding: 10px 14px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cmp-head h3 { margin: 2px 0 0; font: 700 20px/1.2 var(--font-display); overflow-wrap: anywhere; }
.cmp-head h3 a { text-decoration: none; }
.cmp-head h3 a:hover { text-decoration: underline; }
.cmp-head .meta { padding-top: 4px; }

.cmp-secs { display: grid; gap: 16px; }
.cmp-sec h3 { margin-bottom: 12px; }
.cmp-who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.cmp-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Unterschiede ---------- */
.cmp-diff { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }

/* ---------- Offensiv oder defensiv ---------- */
.lean { display: grid; gap: 12px; }
.lean-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) minmax(0, 190px); align-items: center; gap: 8px 16px; }
.lean-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lean-scale span:first-child { color: var(--atk); }
.lean-scale span:last-child { color: var(--def); }
.lean-ends { margin-bottom: -6px; }
.lean-track {
  position: relative; height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--atk) 55%, var(--surface-2)), var(--surface-2) 50%, color-mix(in srgb, var(--def) 55%, var(--surface-2)));
  border: 1px solid var(--border);
}
.lean-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.lean-track i {
  position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; z-index: 1;
  background: var(--s); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--s), var(--shadow);
}
.lean-lbl { display: flex; flex-direction: column; font-size: 14px; }
.lean-lbl small { font-size: 12px; color: var(--muted); }

/* ---------- Werte ---------- */
.cmp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px 28px; }
.cmp-stat h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cmp-bar { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 34px; align-items: center; gap: 10px; font-size: 13px; margin-top: 5px; }
.cmp-bar .track { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cmp-bar .fill { display: block; height: 100%; border-radius: 999px; background: var(--s); }
.cmp-bar b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.cmp-bar b.best { font-weight: 700; color: var(--text); }

/* ---------- Wofür ---------- */
.cmp-use { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--s); font-size: 14px; }
.cmp-use p { margin: 0; }
.cmp-rec { font-size: 15px; }
.cmp-meta { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.cmp-meta b { white-space: nowrap; }
.cmp-combos { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cmp-combos small { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.cmp-combo { font: 600 12.5px/1.2 var(--font-display); padding: 3px 7px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.cmp-combo:hover { border-color: var(--border-strong); }

/* ---------- Steckbrief ---------- */
.cmp-tbl-wrap { overflow-x: auto; }
.cmp-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.cmp-tbl th, .cmp-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.cmp-tbl thead th { border-bottom: 2px solid var(--s); }
.cmp-tbl thead td { width: 26%; }
.cmp-tbl tbody th { font-size: 12.5px; font-weight: 600; color: var(--muted); overflow-wrap: break-word; hyphens: auto; }
.cmp-tbl tbody tr:last-child th, .cmp-tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------- Detailfenster ---------- */
.cmp-detail { margin: 10px 0 0; }
.cmp-detail .btn svg { flex: none; }

@media (max-width: 720px) {
  .cmp-pick { flex-basis: 100%; max-width: none; }
  .cmp-cols { gap: 8px; }
  .cmp-uses { grid-template-columns: minmax(0, 1fr); }
  .cmp-head .stage { height: 130px; }
  .cmp-heads.n3 .stage { height: 96px; }
  .cmp-head .stage .cmp-slot { left: 6px; top: 6px; width: 24px; height: 24px; font-size: 13px; }
  .cmp-head-b { padding: 8px 10px 12px; }
  .cmp-head h3 { font-size: 16px; }
  .cmp-heads.n3 h3 { font-size: 14px; }
  .cmp-head .alt { display: none; }
  .lean-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lean-row .lean-track { grid-column: 1 / -1; grid-row: 2; }
  .lean-ends { grid-template-columns: minmax(0, 1fr); margin-bottom: -4px; }
  .lean-ends > span:not(.lean-scale) { display: none; }
  .lean-lbl { text-align: right; }
  .cmp-bar { grid-template-columns: minmax(0, 96px) minmax(0, 1fr) 30px; }
  .cmp-diff { font-size: 14px; }
  .cmp-tbl { font-size: 13px; }
  .cmp-tbl th, .cmp-tbl td { padding: 8px 6px; }
  .cmp-tbl thead td { width: 31%; }
}
