* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #1b1b1f; --bg2: #242427; --card: #2b2b30; --line: #3a3a40;
  --dire: #c23c2a; --radiant: #6daaa4; --gold: #a5894f;
  --text: #e4e2dc; --muted: #8f8d88;
}
body { background: var(--bg); color: var(--text); font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button { font-family: inherit; cursor: pointer; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--bg2); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; }
.logo { color: var(--dire); font-size: 20px; }
.title { font-weight: 700; letter-spacing: 1px; }
.title em { color: var(--gold); font-style: normal; font-size: 12px; }
.tabs { display: flex; gap: 6px; flex: 1; }
.tab { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 8px 16px; font-size: 14px; }
.tab.active { background: var(--dire); border-color: var(--dire); color: #fff; }
.jev-badge { font-size: 12px; color: var(--gold); border: 1px solid var(--gold); padding: 4px 10px; border-radius: 20px; }

.layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; padding: 16px 20px; align-items: start; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

.board { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-height: 70vh; }
.hidden { display: none !important; }

/* CM */
.cm-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; margin-bottom: 14px; }
.team h3 { font-size: 14px; margin-bottom: 8px; letter-spacing: 1px; }
.team.radiant h3, .radiant-t { color: var(--radiant); }
.team.dire h3, .dire-t { color: var(--dire); }
.picks { display: flex; gap: 6px; }
.pick-slot { width: 76px; height: 44px; background: var(--card); border: 1px dashed var(--line); border-radius: 4px; overflow: hidden; position: relative; }
.pick-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-slot .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.bans-label { font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.bans { display: flex; gap: 4px; flex-wrap: wrap; min-height: 26px; }
.bans img { width: 46px; height: 26px; object-fit: cover; border-radius: 3px; filter: grayscale(1) brightness(.55); border: 1px solid var(--dire); }
.cm-status { align-self: center; text-align: center; font-weight: 700; padding: 10px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); min-width: 160px; }
.cm-status.radiant-turn { border-color: var(--radiant); color: var(--radiant); box-shadow: 0 0 12px rgba(109,170,164,.25); }
.cm-status.dire-turn { border-color: var(--dire); color: var(--dire); box-shadow: 0 0 12px rgba(194,60,42,.25); }
.cm-status.done { border-color: var(--gold); color: var(--gold); }

.pool-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pool-bar input, .pool-bar select { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.pool-bar input { flex: 1; min-width: 160px; }
.btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; font-size: 13px; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--dire); border-color: var(--dire); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 6px 10px; }

.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.hero-cell { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-align: center; padding-bottom: 4px; transition: transform .1s, border-color .1s; }
.hero-cell img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.hero-cell .hn { font-size: 11px; padding: 4px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-cell:not(.used):hover { transform: translateY(-2px); border-color: var(--gold); cursor: pointer; }
.hero-cell.used { opacity: .32; filter: grayscale(1); cursor: not-allowed; }
.hero-cell.used.banned { outline: 2px solid var(--dire); }
.hero-cell.used.picked { outline: 2px solid var(--radiant); }

/* OMG */
.omg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.omg-status { font-weight: 700; color: var(--gold); }
.omg-status.radiant-turn { color: var(--radiant); }
.omg-status.dire-turn { color: var(--dire); }
.omg-players { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.player-col { display: flex; flex-direction: column; gap: 8px; }
.player-card { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.player-card.active-turn { border-color: var(--gold); box-shadow: 0 0 10px rgba(165,137,79,.35); }
.player-card .avatar { width: 72px; height: 40px; object-fit: cover; border-radius: 4px; }
.player-card .who { font-size: 12px; width: 74px; }
.player-card .who .mn { color: var(--muted); font-size: 11px; }
.player-card .pskills { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.player-card .pskills img { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line); }
.player-card .pskills img.ult { border-color: var(--gold); }
.player-card .pskills .empty { width: 34px; height: 34px; border-radius: 4px; border: 1px dashed var(--line); }
.player-card .model-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 20px; border: 1px dashed var(--line); border-radius: 4px; flex-shrink: 0; }
.hero-grid.compact { max-height: 240px; }
.hero-cell.disabled { opacity: .45; }
.hero-cell.disabled:hover { transform: none; border-color: var(--line); cursor: not-allowed; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.skill-cell { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.skill-cell img { width: 40px; height: 40px; border-radius: 4px; flex-shrink: 0; }
.skill-cell .sn { font-size: 12px; }
.skill-cell .sh { font-size: 11px; color: var(--muted); }
.skill-cell .sb { font-size: 10px; color: var(--gold); }
.skill-cell.ult-cell img { border: 1px solid var(--gold); }
.skill-cell:not(.used):hover { border-color: var(--gold); cursor: pointer; }
.skill-cell.used { opacity: .3; filter: grayscale(1); cursor: not-allowed; }

/* Jev 面板 */
.jev-panel { background: var(--bg2); border: 1px solid var(--gold); border-radius: 10px; padding: 16px; position: sticky; top: 16px; }
.jev-head h2 { font-size: 17px; color: var(--gold); letter-spacing: 1px; }
.jev-sub { font-size: 11px; color: var(--muted); }
.jev-meta { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 12px; padding: 3px 10px; color: var(--muted); }
.tag.warn { color: var(--gold); border-color: var(--gold); }
.tag.live { color: var(--radiant); border-color: var(--radiant); }

.prob-wrap { margin-bottom: 14px; }
.prob-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.prob-bar { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--radiant) var(--p, 50%), var(--dire) var(--p, 50%)); position: relative; }
.prob-bar::after { content: ""; position: absolute; left: var(--p, 50%); top: -3px; bottom: -3px; width: 2px; background: #fff; }
.conf { font-size: 11px; color: var(--muted); margin-top: 4px; }

.dim { margin-bottom: 8px; }
.dim .dl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.dim .bars { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 8px; }
.dim .bars i { display: block; height: 100%; border-radius: 4px; background: var(--card); overflow: hidden; position: relative; }
.dim .bars i::after { content: ""; position: absolute; inset: 0; width: var(--v, 0%); }
.dim .bars .rb::after { background: var(--radiant); }
.dim .bars .db::after { background: var(--dire); }

.rec { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; }
.rec img { width: 52px; height: 30px; object-fit: cover; border-radius: 3px; }
.rec.skill-rec img { width: 34px; height: 34px; }
.rec .rn { font-size: 12px; flex: 1; }
.rec .rp { font-size: 12px; color: var(--gold); font-weight: 700; }

.section-t { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin: 14px 0 8px; text-transform: uppercase; }
.grade-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.grade-row .pname { width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grade-row .gbar { flex: 1; height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; }
.grade-row .gbar i { display: block; height: 100%; background: var(--gold); }
.grade { font-weight: 800; width: 20px; text-align: center; }
.grade.S { color: #e0b34f; } .grade.A { color: var(--radiant); }
.grade.B { color: #9a9a92; } .grade.C { color: var(--dire); }
.best-worst { display: flex; gap: 8px; font-size: 12px; }
.best-worst span { flex: 1; background: var(--card); border-radius: 6px; padding: 6px 8px; border: 1px solid var(--line); }

.muted { color: var(--muted); font-size: 12px; }
.tiny { font-size: 11px; }
.jev-err { color: var(--dire); font-size: 11px; background: rgba(194,60,42,.12); border: 1px solid var(--dire); border-radius: 6px; padding: 6px 8px; margin-bottom: 10px; word-break: break-all; }
.jev-settings { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.jev-settings summary { cursor: pointer; color: var(--gold); margin-bottom: 8px; }
.jev-settings label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.jev-settings input { width: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 7px 9px; font-size: 12px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
