/* ============ Champions Randbats Explorer ============ */
:root {
  --bg: #0e1116;
  --bg-soft: #151920;
  --panel: #1a1f29;
  --panel-2: #212836;
  --border: #2a3140;
  --text: #e8ecf3;
  --text-dim: #96a0b5;
  --text-faint: #667089;
  --accent: #e5484d;
  --accent-soft: rgba(229, 72, 77, .14);
  --bar-bg: #262d3b;
  --bar-fill: linear-gradient(90deg, #3b82f6, #8b5cf6);
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #7aa2f7; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 17, 22, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-ball {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(to bottom, #e5484d 0 46%, #151820 46% 54%, #f5f6f8 54% 100%);
  position: relative; box-shadow: 0 0 0 2px #151820, 0 4px 14px rgba(229,72,77,.35);
}
.brand-ball::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
  background: #f5f6f8; border: 4px solid #151820;
}
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }

.view-tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tab {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 7px 16px; border-radius: 9px; font-weight: 600; font-size: 14px;
  transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ---------- Layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 20px 24px 60px; }
.view { display: none; }
.view.active { display: block; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.search-wrap { position: relative; flex: 1 1 240px; min-width: 220px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
#search {
  width: 100%; padding: 10px 14px 10px 38px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; outline: none;
  font-size: 14.5px; transition: border-color .15s;
}
#search:focus { border-color: #4c5a75; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 10px; font-size: 13.5px; outline: none; max-width: 170px;
}
.filters select:focus { border-color: #4c5a75; }
.filters select.has-value { border-color: var(--accent); color: #ffb3b5; }
.check-wrap {
  display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
  cursor: pointer; user-select: none;
}
.check-wrap:has(:checked) { border-color: var(--accent); color: #ffb3b5; }
.btn-ghost {
  background: transparent; color: var(--text-dim); border: 1px dashed var(--border);
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.result-count { color: var(--text-faint); font-size: 13px; margin: 8px 2px 14px; }
.no-results { color: var(--text-dim); text-align: center; padding: 60px 0; font-size: 16px; }

/* ---------- Card grid ---------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 14px 12px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  text-align: left; color: inherit; width: 100%;
}
.card:hover { transform: translateY(-3px); border-color: #3d4759; box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.card:focus-visible { outline: 2px solid #7aa2f7; }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-sprite {
  width: 72px; height: 72px; flex: none; image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
}
/* animated ani/ sprites (new Champions Megas) are smooth art, not pixel art */
img.smooth { image-rendering: auto; }
.card-head { min-width: 0; flex: 1; }
.card-name { font-weight: 700; font-size: 15.5px; line-height: 1.25; margin: 2px 0 3px; }
.card-num { color: var(--text-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.card-level {
  position: absolute; top: 10px; right: 12px;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px;
}
.type-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.type-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 2.5px 8px; border-radius: 6px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.card-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.role-chip {
  font-size: 11px; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2.5px 9px; white-space: nowrap;
}
.role-chip b { color: var(--text); font-weight: 600; }

/* ---------- Percentage bars ---------- */
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; align-items: center; margin: 3px 0; }
.bar-label-wrap { position: relative; height: 24px; border-radius: 6px; background: var(--bar-bg); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar-fill); opacity: .35; border-radius: 6px; }
.bar-label {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 9px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-label img { width: 24px; height: 24px; margin: 0 -2px; flex: none; }
.bar-pct { font-size: 12px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.bar-row.clickable .bar-label-wrap { cursor: pointer; }
.bar-row.clickable:hover .bar-label-wrap { outline: 1px solid #4c5a75; }

/* guaranteed (100%) rows get a golden tint */
.bar-fill.full { background: linear-gradient(90deg, #d3a548, #e8c06a); opacity: .38; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 10, .72); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(860px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 26px 28px 30px;
}
.modal-close, .modal-nav {
  position: absolute; z-index: 5;
  background: var(--panel-2); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 10px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
}
.modal-close { top: 14px; right: 14px; font-size: 14px; }
.modal-nav { top: 14px; font-size: 20px; padding-bottom: 3px; }
.modal-nav.prev { right: 92px; }
.modal-nav.next { right: 53px; }
.modal-close:hover, .modal-nav:hover { color: var(--text); border-color: var(--text-faint); }

#modal-content { padding-top: 28px; }
.detail-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.detail-sprite-wrap {
  width: 130px; height: 130px; flex: none; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 62%, var(--panel-2), transparent 72%);
  border-radius: 50%;
}
.detail-sprite { max-width: 120px; max-height: 120px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.detail-title h2 { margin: 0 0 4px; font-size: 26px; }
.detail-title .dexno { color: var(--text-faint); font-weight: 500; font-size: 17px; margin-left: 6px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.level-pill {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  background: var(--accent-soft); border: 1px solid rgba(229,72,77,.4);
  padding: 3px 11px; border-radius: 999px;
}
.detail-links { margin-top: 8px; font-size: 12.5px; }

/* base stats */
.stats-panel { margin: 4px 0 20px; }
.stat-row { display: grid; grid-template-columns: 58px 34px 1fr; gap: 10px; align-items: center; margin: 4px 0; font-size: 13px; }
.stat-name { color: var(--text-dim); font-weight: 600; }
.stat-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stat-bar { height: 9px; border-radius: 5px; background: var(--bar-bg); overflow: hidden; }
.stat-bar > div { height: 100%; border-radius: 5px; }
.bst-line { margin-top: 8px; font-size: 13px; color: var(--text-dim); }
.bst-line b { color: var(--text); }

.section-h {
  font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-faint); margin: 22px 0 8px;
  display: flex; align-items: center; gap: 10px;
}
.section-h::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* role cards */
.role-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin: 12px 0;
}
.role-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.role-head h3 { margin: 0; font-size: 16.5px; }
.role-weight { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.role-weight b { color: #e8c06a; }
.role-weight-bar { height: 5px; border-radius: 3px; background: var(--bar-bg); overflow: hidden; margin: 6px 0 14px; }
.role-weight-bar > div { height: 100%; background: linear-gradient(90deg, #d3a548, #e8c06a); }
.role-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; }
@media (max-width: 640px) { .role-cols { grid-template-columns: 1fr; } }
.mini-h { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-faint); margin: 10px 0 4px; }
.ev-note { margin-top: 10px; font-size: 12.5px; color: #e8c06a; }
.ev-note span { color: var(--text-faint); }

/* ---------- Insights ---------- */
.insight-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sum-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.sum-card .v { font-size: 24px; font-weight: 800; }
.sum-card .k { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .insight-grid { grid-template-columns: 1fr; } }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.panel h2 { margin: 0 0 2px; font-size: 16.5px; }
.panel-sub { margin: 0 0 12px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Buttons & toast ---------- */
.btn-primary {
  background: var(--accent); color: #fff; border: 0;
  border-radius: 10px; padding: 10px 18px; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 4px 14px rgba(229,72,77,.3);
  transition: filter .15s, transform .1s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost.sm { padding: 5px 10px; font-size: 12.5px; border-style: solid; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
a.btn-ghost.sm:hover { text-decoration: none; color: var(--text); }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 300;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 18px; font-size: 13.5px; box-shadow: var(--shadow);
}

/* ---------- Card extras (fav / compare) ---------- */
.fav-btn, .cmp-btn {
  position: absolute; z-index: 3;
  background: var(--panel-2); color: var(--text-faint); border: 1px solid var(--border);
  border-radius: 8px; width: 26px; height: 26px; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, color .12s;
}
.fav-btn { bottom: 10px; right: 12px; }
.cmp-btn { bottom: 10px; right: 44px; }
.card:hover .fav-btn, .card:hover .cmp-btn, .card:focus-within .fav-btn, .card:focus-within .cmp-btn,
.fav-btn.on, .cmp-btn.on { opacity: 1; }
.fav-btn.on { color: #e8c06a; border-color: rgba(232,192,106,.5); }
.cmp-btn.on { color: #7aa2f7; border-color: rgba(122,162,247,.5); }
.fav-btn:hover { color: #e8c06a; }
.cmp-btn:hover { color: #7aa2f7; }

/* ---------- Move dots ---------- */
.move-dot {
  flex: none; width: 15px; height: 15px; border-radius: 4px;
  font-size: 9px; font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.5);
  display: inline-flex; align-items: center; justify-content: center;
}
.dim-note { color: var(--text-faint); font-size: 12.5px; }
.h-note { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Detail extras ---------- */
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stat-row { grid-template-columns: 58px 34px 1fr 44px; }
.stat-calc { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 12.5px; }
.rolled-box {
  background: var(--panel); border: 1px solid rgba(232,192,106,.35); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px;
}
.rolled-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.rolled-box pre { margin: 0; font: 12.5px/1.5 Consolas, monospace; color: var(--text-dim); white-space: pre-wrap; }

.matchup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; }
@media (max-width: 640px) { .matchup-grid { grid-template-columns: 1fr; } }
.matchup-row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0; }
.matchup-badges { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 1px; }
.mult {
  flex: none; width: 44px; text-align: center; font-size: 11px; font-weight: 800;
  border-radius: 6px; padding: 2px 0; font-variant-numeric: tabular-nums;
}
.mult.m4 { background: rgba(229,72,77,.25); color: #ff9a9d; }
.mult.m2 { background: rgba(229,72,77,.14); color: #f28085; }
.mult.m05 { background: rgba(83,155,245,.15); color: #8fb8f5; }
.mult.m025 { background: rgba(83,155,245,.25); color: #a9c8f7; }
.mult.m0 { background: rgba(120,120,135,.22); color: #b8becd; }

.view-note { flex: 1 1 300px; margin: 0; font-size: 12.5px; color: var(--text-faint); }
.inline-item { width: 24px; height: 24px; margin: -4px 0; }

/* ---------- Speed tiers ---------- */
.speed-table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.speed-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.speed-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-faint); padding: 10px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 71px; background: var(--panel); z-index: 2;
}
.speed-table td { padding: 4px 12px; border-bottom: 1px solid rgba(42,49,64,.5); }
.speed-table tbody tr { cursor: pointer; }
.speed-table tbody tr:hover { background: var(--panel-2); }
.speed-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.speed-table .dim { color: var(--text-faint); }
.speed-table .strong { font-weight: 700; }
.row-sprite { width: 40px; height: 40px; image-rendering: pixelated; object-fit: contain; display: block; }
.bar-col { width: 30%; }
.speed-bar { height: 7px; border-radius: 4px; background: var(--bar-bg); overflow: hidden; }
.speed-bar > div { height: 100%; background: linear-gradient(90deg, #ec407a, #f48fb1); border-radius: 4px; }

/* ---------- Compare ---------- */
.compare-tray {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: min(92vw, 900px);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--shadow);
}
.tray-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
#tray-items { display: flex; gap: 8px; flex-wrap: wrap; }
.tray-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 4px;
}
.tray-chip img { width: 30px; height: 30px; image-rendering: pixelated; object-fit: contain; }
.tray-chip button { background: none; border: 0; color: var(--text-faint); font-size: 12px; padding: 0 2px; }
.tray-chip button:hover { color: var(--accent); }
.tray-side { font-size: 12px; margin-left: 4px; }

/* ---------- Damage calc ---------- */
.calc-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; }
.calc-field select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 9px; font-size: 13px; outline: none;
}
.calc-field-label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-faint); }
.calc-field-label.def-side { margin-left: 10px; }

.calc-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 14px; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } #calc-swap { justify-self: center; } }
.calc-side { padding: 14px 16px 16px; }
.calc-side-title { margin: 0 0 10px; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.calc-side-title.atk { color: #f28085; }
.calc-side-title.def { color: #8fb8f5; }
#calc-swap { align-self: center; font-size: 20px; line-height: 1.1; padding: 12px 14px; }
#calc-swap span { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }

.calc-mon-input {
  width: 100%; padding: 9px 12px; margin-bottom: 10px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; outline: none; font-size: 14px;
}
.calc-mon-input:focus { border-color: #4c5a75; }
.calc-mon-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.calc-sprite { width: 72px; height: 72px; flex: none; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.calc-hp-line { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }
.calc-empty { padding: 20px 4px; }

.calc-role-ctl {
  display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px;
  font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px;
}
.calc-role-ctl select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; font-size: 13px; outline: none; width: 100%;
}
.hp-wrap { display: flex; gap: 8px; align-items: center; }
.hp-wrap input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); padding: 0; border: 0; background: transparent; }
.hp-wrap input[type=number] { width: 62px; flex: none; }
.calc-ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.calc-ctl-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.calc-ctl-grid input, .calc-ctl-grid select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; font-size: 13px; outline: none; width: 100%;
}
.boost-row { display: flex; gap: 6px; margin-top: 10px; }
.boost-cell { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: stretch; font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; text-align: center; }
.boost-cell select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 2px; font-size: 12.5px; text-align: center; outline: none;
}
.boost-cell select:not([value="0"]):has(option:checked:not([value="0"])) { border-color: rgba(232,192,106,.55); color: #e8c06a; }

.calc-results-panel { padding: 16px 18px; }
.calc-summary { font-size: 15px; margin-bottom: 12px; }
.calc-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto minmax(80px, 1fr); gap: 12px; align-items: center;
  padding: 7px 4px; border-bottom: 1px solid rgba(42,49,64,.55);
}
.calc-row:last-of-type { border-bottom: 0; }
.calc-row.imm { opacity: .55; }
.calc-row-main { display: flex; align-items: center; gap: 7px; min-width: 0; }
.calc-move { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-bp { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.calc-hasmove {
  font-size: 10.5px; color: var(--text-dim); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 1.5px 7px; white-space: nowrap;
}
.calc-dmg { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.calc-abs { display: block; font-size: 10.5px; font-weight: 400; color: var(--text-faint); }
.calc-ko-cell { min-width: 128px; }
.ko-tag { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2.5px 8px; white-space: nowrap; }
.ko-tag.ohko { background: rgba(229,72,77,.28); color: #ff9a9d; }
.ko-tag.ohko-maybe { background: rgba(229,72,77,.14); color: #f28085; }
.ko-tag.twohko { background: rgba(232,192,106,.16); color: #e8c06a; }
.ko-tag.slow { background: rgba(83,155,245,.13); color: #8fb8f5; }
.calc-bar-cell { min-width: 80px; }
.calc-bar { display: flex; height: 9px; border-radius: 5px; background: var(--bar-bg); overflow: hidden; }
.calc-bar .lo { background: linear-gradient(90deg, #e5484d, #f2777b); }
.calc-bar .hi { background: rgba(229,72,77,.35); }
.calc-note { margin-top: 14px; }
@media (max-width: 720px) {
  .calc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .calc-ko-cell { min-width: 0; }
  .calc-bar-cell { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 30px; }
.site-footer p { max-width: 1280px; margin: 0 auto; padding: 18px 24px; font-size: 12px; color: var(--text-faint); }

@media (max-width: 700px) {
  .header-inner { padding: 12px 16px; }
  main { padding: 14px 14px 50px; }
  .modal-card { padding: 20px 16px 24px; }
  .modal-nav.prev { right: 84px; }
  .modal-nav.next { right: 49px; }
}
