/* Thí Kiếm Đài (mô phỏng sát thương, /thi-kiem-dai/). Giao diện chủ game duyệt 19/11 (Emberfall-reports/integ-1911/web-sim/mockup).
   Nạp sau site.css và wiki.css: dùng lại mực, ngọc, vàng của trang. Phần cuối tệp: trạng thái chạy, cổng thử nghiệm kín, hộp chọn món thật. */
body.sim { --a: #3fb987; --a-soft: #0f2a20; --b: #e3b04b; --b-soft: #2a2110; --red: #ff6b5a; --red-soft: #2a1311;
  --q0: #c9c4ba; --q1: #7fc7ff; --q2: #e8c547; --q3: #e08cff; --q4: #ff6b5a; --cuong: #e3c06b; --nhu: #7fd3ac; }

/* ---------- top: title, build tabs, actions ---------- */
.sim-top .wrap { padding-bottom: 0; }
.sim-chips { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.sim-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 12.5px; color: #cfd6d0; background: #10141a;
  border: 1px solid #2c323b; border-radius: 3px; }
.sim-chip i { width: 8px; height: 8px; background: var(--a); flex: none; box-shadow: 0 0 0 2px #0b0c0f, 0 0 0 3px var(--jade-dark); }
.sim-chip.warn i { background: var(--b); box-shadow: 0 0 0 2px #0b0c0f, 0 0 0 3px #6b5a2c; }
.sim-bar { flex: 1 1 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-top: 10px; }
.btabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: -1px; min-width: 0; }
/* .sim-bar and .btabs: min-width 0, else on a phone the scrolling tab row (real build names are long) set the page's width: 497 px at 390 */
.btab { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; background: #0d1014; color: #aab4ad;
  border: 1px solid #262b33; border-bottom: 0; border-radius: 4px 4px 0 0; font: inherit; font-size: 14.5px; cursor: pointer; }
.btab b { font-weight: 600; color: var(--title); }
.btab small { display: block; font-size: 12px; color: var(--muted); }
.btab .dot { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; font: 700 13px var(--serif); color: #06110c; background: var(--a); }
.btab.b .dot { background: var(--b); color: #1c1204; }
.btab[aria-selected="true"] { background: var(--ink); color: var(--text); border-color: var(--jade-dark); box-shadow: inset 0 3px 0 var(--a); }
.btab.b[aria-selected="true"] { border-color: #6b5a2c; box-shadow: inset 0 3px 0 var(--b); }
.btab.add { color: #9fd9bd; border-style: dashed; }
.btab.add:hover { color: #fff; border-color: var(--jade); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
.acts .btn { min-height: 40px; padding: 0 14px; font-size: 14px; gap: 8px; }
.acts .btn svg { flex: none; }
.btn-lock { color: #c9b98a; border-color: #5a4c27; }
.btn-lock small { font-weight: 500; color: #8f8466; font-size: 12px; }

/* ---------- layout: the builder left, the result card right ---------- */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--jade-dark); }
.sim-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sim-side { position: sticky; top: 92px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { padding: 6px 12px; font-size: 13.5px; color: #c2cbc5; text-decoration: none; background: #0f1216; border: 1px solid #262b33; border-radius: 16px; }
.jump a:hover { color: #fff; border-color: var(--jade); }
.jump a.on { color: var(--jade-light); border-color: var(--jade); background: #0f1c17; }

/* a builder section: a card whose head is the <summary> (one tap folds it on a phone) */
.ssec { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.ssec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid transparent; }
.ssec > summary::-webkit-details-marker { display: none; }
.ssec[open] > summary { border-bottom-color: #1f242c; background: #11141a; border-radius: 6px 6px 0 0; }
.ssec > summary .seal-dot { width: 28px; height: 28px; line-height: 28px; font-size: 14px; flex: none; }
.ssec > summary h2 { margin: 0; font: 700 21px/1.2 var(--serif); color: var(--title); }
.ssec > summary p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ssec > summary .sum-r { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); text-align: right; }
.ssec > summary .chev { width: 10px; height: 10px; border-right: 2px solid #7f8a83; border-bottom: 2px solid #7f8a83; transform: rotate(45deg); margin: 0 4px 4px 6px; transition: transform 0.15s; flex: none; }
.ssec[open] > summary .chev { transform: rotate(225deg); margin-bottom: -4px; }
.sbody { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.sub-h { margin: 0 0 -6px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #7f8a83; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sub-h::after { content: ''; flex: 1; height: 1px; background: #1f242c; }

/* ---------- form bits ---------- */
.frow { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; }
.frow.w2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-2); }
.fld > span { display: flex; justify-content: space-between; gap: 8px; }
.fld > span em { font-style: normal; color: var(--muted); font-size: 12px; }
.fld select, .fld input[type="number"], .fld input[type="text"] { width: 100%; min-height: 40px; padding: 0 10px; background: #0a0b0e; border: 1px solid #3a3f48;
  border-radius: 3px; color: #ece7d8; font: inherit; font-size: 14px; }
.fld select:focus, .fld input:focus { outline: 2px solid var(--jade); outline-offset: 1px; border-color: var(--jade); }
.fld input[type="range"] { width: 100%; accent-color: var(--jade); margin: 6px 0 0; }
.fld .val { font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid #343a44; border-radius: 4px; overflow: hidden; }
.seg button { min-height: 38px; padding: 0 12px; background: #0e1115; color: #b9c1bb; border: 0; border-right: 1px solid #262b33; font: inherit; font-size: 13.5px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: #0f1c17; color: var(--jade-light); font-weight: 600; box-shadow: inset 0 -2px 0 var(--jade); }
.seg.wl button { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
.seg.wl button .el { font-size: 12px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--jade); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hint b { color: var(--text-2); font-weight: 600; }
.pill { display: inline-block; padding: 1px 7px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; border-radius: 3px; border: 1px solid #343a44; color: #cfd6d0; background: #12151a; white-space: nowrap; }
.pill.lock { color: #8f8466; border-color: #3d3524; background: #14120b; }
.pill.red { color: #ffb4aa; border-color: #6a2a24; background: #1d1110; }
.pill.gold { color: var(--gold); border-color: #6b5a2c; background: #17140c; }
.pill.jade { color: var(--jade-light); border-color: var(--jade-dark); background: #0f1c17; }

/* mode switch: rules vs free */
.mode { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; background: #0e1115; border: 1px solid #262b33; border-radius: 4px; }
.mode .hint { flex: 1 1 260px; }
.free-banner { display: none; padding: 10px 14px; background: #241a0a; border: 1px solid #6b5a2c; border-left: 3px solid var(--b); border-radius: 3px; font-size: 13.5px; color: #f1dfb0; }
body.free .free-banner { display: block; }

/* the stat sheet */
.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th { text-align: left; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 10px 8px; border-bottom: 1px solid var(--line-2); }
.sheet td { padding: 6px 10px; border-bottom: 1px solid #1c2027; vertical-align: middle; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet td.v { font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.sheet td.v small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.sheet .grp td { padding-top: 14px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); border-bottom-color: #2a2516; }
.src { display: flex; height: 10px; min-width: 120px; border-radius: 2px; overflow: hidden; background: #1a1e25; }
.src i { display: block; height: 100%; }
.s1 { background: #5c6670; } .s2 { background: #8b6fd6; } .s3 { background: #3f9e78; } .s4 { background: #7fd3ac; } .s5 { background: #e3c06b; } .s6 { background: #f08a5d; }
.src-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.src-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.ovr { width: 74px; min-height: 32px; padding: 0 8px; background: #0a0b0e; border: 1px dashed #343a44; border-radius: 3px; color: #ece7d8; font: inherit; font-size: 13.5px; text-align: right; }
.ovr:disabled { color: #5d655f; background: transparent; }
body.free .ovr { border-style: solid; border-color: #6b5a2c; }
body.free .ovr.set { background: #241a0a; color: var(--gold); font-weight: 700; }
body.free tr.over td { background: #17140c; }
.capnote { font-size: 11.5px; color: var(--b); font-weight: 600; }

/* ---------- gear ---------- */
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.slot { display: flex; flex-direction: column; background: #0e1115; border: 1px solid #262b33; border-radius: 5px; min-width: 0; }
.slot:hover { border-color: #3a414b; }
.slot.uq { border-color: #5a2620; box-shadow: inset 0 0 0 1px #2a1311; background: linear-gradient(180deg, #1a0f0e, #0e1115 60%); }
.slot-h { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #1c2027; }
.slot-h .ico { width: 40px; height: 40px; background: #090a0d; border: 1px solid #2c323b; border-radius: 3px; padding: 2px; }
.slot-h b { display: block; font-size: 14.5px; line-height: 1.3; }
.slot-h small { display: block; font-size: 12px; color: var(--muted); }
.qn0 { color: var(--q0); } .qn1 { color: var(--q1); } .qn2 { color: var(--q2); } .qn3 { color: var(--q3); } .qn4 { color: var(--q4); }
.lines { list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #cfd6d0; }
.lines li { position: relative; padding-left: 14px; line-height: 1.45; }
.lines li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; background: var(--nhu); }
.lines li.c::before { background: var(--cuong); }
.lines li.imp { color: #e9e4d4; } .lines li.imp::before { background: #fff; }
.lines li.red { color: #ffb4aa; } .lines li.red::before { background: var(--red); }
.lines li.ta { color: #d9a7ff; } .lines li.ta::before { background: #a35be0; }
.lines li b { font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; }
.slot-f { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px 10px; border-top: 1px solid #1c2027; }
.socks { display: flex; gap: 4px; }
.sock { width: 26px; height: 26px; border: 1px solid #3a404a; background: #08090c; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.sock img { width: 20px; height: 20px; image-rendering: pixelated; }
.sock.empty { border-style: dashed; }
.slot-f .mini { margin-left: auto; display: flex; gap: 6px; }
.mini button, .mini a { min-height: 30px; padding: 0 10px; font: inherit; font-size: 12.5px; color: #cfd6d0; background: #12151a; border: 1px solid #343a44; border-radius: 3px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.mini button:hover, .mini a:hover { border-color: var(--jade); color: #fff; }
.setbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 14px; background: #0e1115; border: 1px solid #262b33; border-radius: 4px; font-size: 13.5px; }
.setbar img { width: 28px; height: 28px; image-rendering: pixelated; }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 14px; height: 6px; background: #2a2f37; }
.pips i.on { background: var(--kim); }
.pips i.x { background: repeating-linear-gradient(45deg, #5a2620 0 3px, #2a1311 3px 6px); }

/* ---------- small cards (pháp bảo, linh thú, buffs) ---------- */
.cards2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.box { background: #0e1115; border: 1px solid #262b33; border-radius: 5px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.box-h { display: flex; align-items: center; gap: 10px; }
.box-h img { width: 40px; height: 40px; image-rendering: pixelated; background: #090a0d; border: 1px solid #2c323b; border-radius: 3px; padding: 2px; }
.box-h b { font-size: 15px; color: var(--title); }
.box-h small { display: block; font-size: 12px; color: var(--muted); }
.box-h .pill { margin-left: auto; }
.out { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #b9c1bb; padding-top: 8px; border-top: 1px dashed #262b33; }
.out b { color: var(--title); font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 8px; background: #1a1e25; border-radius: 4px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--jade); }
.meter.gold i { background: var(--gold); }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 16px; }
.tg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0e1115; border: 1px solid #262b33; border-radius: 4px; font-size: 13.5px; color: var(--text-2); }
.tg img { width: 28px; height: 28px; image-rendering: pixelated; }
.tg b { color: var(--title); font-weight: 600; }
.tg small { display: block; font-size: 12px; color: var(--muted); }
.tg input[type="checkbox"] { margin-left: auto; width: 18px; height: 18px; accent-color: var(--jade); flex: none; }
.tg select { margin-left: auto; min-height: 32px; background: #0a0b0e; border: 1px solid #3a3f48; border-radius: 3px; color: #ece7d8; font: inherit; font-size: 13px; padding: 0 6px; }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.sk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; background: #0e1115; border: 1px solid #262b33; border-radius: 5px; }
.sk .key { grid-row: span 2; position: relative; }
.sk .key img { width: 44px; height: 44px; image-rendering: pixelated; border: 1px solid #3a404a; border-radius: 3px; background: #090a0d; display: block; }
.sk .key kbd { position: absolute; left: -6px; top: -6px; min-width: 20px; padding: 0 4px; font-size: 11px; line-height: 18px; }
.sk b { font-size: 14.5px; color: var(--title); }
.sk .meta { font-size: 12px; color: var(--muted); }
.sk .meta span + span::before { content: ' · '; color: #4a5048; }
.lvl { display: inline-flex; align-items: center; border: 1px solid #343a44; border-radius: 3px; overflow: hidden; }
.lvl button { width: 26px; height: 28px; background: #12151a; color: #cfd6d0; border: 0; font: inherit; cursor: pointer; }
.lvl span { min-width: 46px; text-align: center; font-size: 13px; font-weight: 600; color: var(--title); }
.lvl span em { font-style: normal; color: var(--jade-light); font-size: 11.5px; }
.kh { grid-column: 2 / -1; display: flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.kh img { width: 24px; height: 24px; image-rendering: pixelated; border: 1px solid #3a404a; border-radius: 50%; background: #08090c; padding: 1px; }
.kh img.r { border-color: var(--red); box-shadow: 0 0 0 1px #2a1311, 0 0 6px rgba(255, 107, 90, 0.45); }
.kh .e { width: 24px; height: 24px; border: 1px dashed #3a404a; border-radius: 50%; }
.kh .lock { width: 24px; height: 24px; border: 1px solid #262b33; border-radius: 50%; background: repeating-linear-gradient(45deg, #15181d 0 3px, #0e1115 3px 6px); }
.rot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; counter-reset: r; }
.rot > span { counter-increment: r; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; font-size: 13px; background: #12151a; border: 1px solid #343a44; border-radius: 3px; cursor: grab; }
.rot > span::before { content: counter(r); min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #06110c; background: var(--jade); border-radius: 2px; }
.rot > span img { width: 20px; height: 20px; image-rendering: pixelated; }
.rot .arrow { color: #4a5048; font-size: 14px; font-style: normal; }

/* ---------- target ---------- */
.ttabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ttabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; background: #0e1115; color: #b9c1bb; border: 1px solid #343a44; border-radius: 4px; font: inherit; font-size: 14px; cursor: pointer; }
.ttabs button[aria-selected="true"] { background: #0f1c17; color: var(--jade-light); border-color: var(--jade); font-weight: 600; }
.tpanel { display: none; flex-direction: column; gap: 14px; }
.tpanel.on { display: flex; }
.bosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.boss { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; background: radial-gradient(ellipse at 50% 60%, #1b1f26 0%, #0e1115 70%);
  border: 1px solid #262b33; border-radius: 5px; text-align: center; cursor: pointer; min-width: 0; }
.boss img { height: 74px; width: auto; max-width: 100%; image-rendering: pixelated; object-fit: contain; }
.boss b { font-size: 13.5px; color: var(--title); line-height: 1.3; }
.boss small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.boss.on { border-color: var(--jade); box-shadow: inset 0 0 0 1px var(--jade-dark); }
.boss.on::after { content: 'Đang chọn'; position: absolute; top: 6px; right: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: #06110c; background: var(--jade-light); padding: 1px 5px; }
.boss .pill { position: absolute; top: 6px; left: 6px; }
.dummy-art { width: 74px; height: 74px; }
.pvp-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.pvp-vs .vs { align-self: center; font: 700 22px var(--serif); color: var(--seal); }
.who-card { padding: 12px; border: 1px solid #262b33; border-radius: 5px; background: #0e1115; display: flex; flex-direction: column; gap: 4px; }
.who-card.a { border-top: 3px solid var(--a); } .who-card.b { border-top: 3px solid var(--b); }
.who-card b { color: var(--title); }
.who-card small { color: var(--muted); font-size: 12.5px; }

/* ---------- the result card (right) ---------- */
.rcard { background: linear-gradient(180deg, #121a16, var(--panel) 40%); border: 1px solid var(--jade-dark); border-radius: 6px; box-shadow: inset 0 0 0 1px var(--ink), 0 10px 30px rgba(0, 0, 0, 0.35); overflow: hidden; }
.rcard-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #1f2a25; }
.rcard-h h2 { margin: 0; font: 700 18px var(--serif); color: var(--title); }
.run { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--jade-light); }
.run i { width: 8px; height: 8px; background: var(--jade-light); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.big { padding: 14px 16px 6px; }
.big .lbl { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.big .num { display: flex; align-items: baseline; gap: 10px; font: 700 46px/1.1 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.big .num small { font: 600 14px var(--sans); color: var(--muted); letter-spacing: 0; }
.big .delta { font: 600 13px var(--sans); color: var(--jade-light); }
.dur { display: flex; margin: 6px 16px 0; border: 1px solid #343a44; border-radius: 4px; overflow: hidden; }
.dur button { flex: 1; min-height: 34px; background: #0e1115; color: #b9c1bb; border: 0; border-right: 1px solid #262b33; font: inherit; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dur button:last-child { border-right: 0; }
.dur button[aria-pressed="true"] { background: #0f1c17; color: var(--jade-light); font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 14px 16px; font-size: 13.5px; color: var(--text-2); }
.kv b { color: var(--title); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv .crit { color: #ffcf7a; }
.kv hr { grid-column: 1 / -1; width: 100%; border: 0; border-top: 1px solid #1f242c; margin: 2px 0; }
.mini-bars { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.mb { display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.mb .bar { height: 8px; background: #1a1e25; border-radius: 2px; overflow: hidden; }
.mb .bar i { display: block; height: 100%; }
.mb span:last-child { text-align: right; color: var(--title); font-variant-numeric: tabular-nums; }
.rfoot { padding: 10px 16px 12px; border-top: 1px solid #1f242c; font-size: 12px; color: var(--muted); line-height: 1.5; }
.rfoot .btn { min-height: 36px; font-size: 13.5px; padding: 0 12px; }
.save-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.save-card h3 { margin: 0; font-size: 15px; color: var(--title); }
.linkbox { display: flex; gap: 6px; }
.linkbox input { flex: 1; min-width: 0; min-height: 36px; padding: 0 10px; background: #0a0b0e; border: 1px solid #3a3f48; border-radius: 3px; color: #9fd9bd; font: 12.5px ui-monospace, Consolas, monospace; }
.linkbox .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.saved { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.saved li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; background: #0e1115; border: 1px solid #1f242c; border-radius: 3px; color: var(--text-2); }
.saved li b { color: var(--title); font-weight: 600; }

/* ---------- detailed results ---------- */
.res { padding-top: 8px; padding-bottom: 80px; }
.res-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.res-head h2 { margin: 0; font: 700 30px/1.2 var(--serif); color: var(--title); }
.res-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.rc { grid-column: span 6; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rc.w12 { grid-column: span 12; } .rc.w7 { grid-column: span 7; } .rc.w5 { grid-column: span 5; } .rc.w4 { grid-column: span 4; } .rc.w8 { grid-column: span 8; }
.rc h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--title); }
.rc h3 small { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.legend2 i { display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: 3px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font: 11px var(--sans); fill: #8f9a93; }
.brk { display: flex; flex-direction: column; gap: 7px; }
.brk .row { display: grid; grid-template-columns: 26px minmax(0, 190px) minmax(0, 1fr) 64px 48px; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.brk .row img { width: 24px; height: 24px; image-rendering: pixelated; }
.brk .row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.brk .row .bar { height: 12px; background: #1a1e25; border-radius: 2px; overflow: hidden; }
.brk .row .bar i { display: block; height: 100%; }
.brk .row .d { text-align: right; color: var(--title); font-variant-numeric: tabular-nums; }
.brk .row .p { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.stack { display: flex; height: 22px; border-radius: 3px; overflow: hidden; }
.stack i { display: block; height: 100%; }
.k-chieu { background: #3f9e78; } .k-thuong { background: #7fb8f0; } .k-do { background: #ff6b5a; } .k-pb { background: #e3c06b; } .k-lt { background: #c9a27a; } .k-pu { background: #b48cf0; } .k-dot { background: #f08a5d; }
.wf { display: flex; flex-direction: column; gap: 0; font-size: 13.5px; }
.wf .st { display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #1f242c; align-items: center; }
.wf .st:last-child { border-bottom: 0; }
.wf .st span:first-child { color: var(--text-2); }
.wf .st span:first-child small { display: block; font-size: 11.5px; color: var(--muted); }
.wf .m { text-align: right; color: var(--jade-light); font-weight: 600; font-variant-numeric: tabular-nums; }
.wf .m.neg { color: #f3a99f; }
.wf .r { text-align: right; color: var(--title); font-variant-numeric: tabular-nums; }
.wf .st.tot { border-top: 1px solid var(--line-2); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.wf .st.tot span:first-child { color: var(--gold); font-weight: 600; }
.wf .st.tot .r { color: var(--gold); font: 700 18px var(--serif); }
.hitpair { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hitpair div { padding: 10px; background: #0e1115; border: 1px solid #262b33; border-radius: 4px; text-align: center; }
.hitpair small { display: block; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hitpair b { font: 700 22px var(--serif); color: var(--title); font-variant-numeric: tabular-nums; }
.hitpair .c b { color: #ffcf7a; }
.tbl.mid td { vertical-align: middle; }
.tbl .bport { width: 34px; height: 34px; image-rendering: pixelated; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.tbl td.up { color: var(--jade-light); font-weight: 600; }
.tbl td.dn { color: #f3a99f; font-weight: 600; }
.tbl th.a { color: var(--a); } .tbl th.b { color: var(--b); }
.pvp-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pvp-res div { padding: 12px; border: 1px solid #262b33; border-radius: 5px; background: #0e1115; }
.pvp-res small { display: block; font-size: 12px; color: var(--muted); }
.pvp-res b { font: 700 26px var(--serif); color: var(--title); }
.pvp-res .a { border-top: 3px solid var(--a); } .pvp-res .b { border-top: 3px solid var(--b); }
.log { white-space: pre-line; font: 12.5px/1.65 ui-monospace, Consolas, monospace; color: #b9c1bb; background: #0a0b0e; border: 1px solid #1f242c; border-radius: 4px; padding: 10px 12px; max-height: 210px; overflow: auto; }
.log .c { color: #ffcf7a; } .log .t { color: #6f7a73; }

/* ---------- the item picker (dialog) ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 8, 0.78); padding: 40px 24px; overflow-y: auto; }
.modal.on { display: block; }
.picker { max-width: 1180px; margin: 0 auto; background: #0f1216; border: 2px solid var(--line-2); border-radius: 6px; box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 3px var(--jade-dark), 0 20px 60px rgba(0, 0, 0, 0.6); }
.picker-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #1f242c; }
.picker-h h2 { margin: 0; font: 700 22px var(--serif); color: var(--title); }
.picker-h .x { margin-left: auto; width: 40px; height: 40px; background: transparent; border: 1px solid #343a44; border-radius: 3px; color: #cfd6d0; font-size: 20px; cursor: pointer; }
.picker-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.pk-list { padding: 14px 18px; border-right: 1px solid #1f242c; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pk-edit { padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fgrp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fgrp > small { width: 54px; font-size: 12px; color: var(--muted); }
.fgrp button { min-height: 32px; padding: 0 10px; background: #12151a; border: 1px solid #343a44; border-radius: 16px; color: #cfd6d0; font: inherit; font-size: 13px; cursor: pointer; }
.fgrp button[aria-pressed="true"] { background: #0f1c17; border-color: var(--jade); color: var(--jade-light); font-weight: 600; }
.fgrp button.locked { color: #5d655f; border-style: dashed; cursor: not-allowed; }
.pk-items { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; padding-right: 4px; }
.pk-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid #1f242c; border-radius: 4px; background: #0d1014; cursor: pointer; }
.pk-item:hover { border-color: #3a414b; }
.pk-item.on { border-color: var(--jade); background: #0f1c17; }
.pk-item img { width: 34px; height: 34px; image-rendering: pixelated; }
.pk-item b { display: block; font-size: 14px; }
.pk-item small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-item .pill { justify-self: end; }
.ln { display: grid; grid-template-columns: 22px minmax(0, 1fr) 70px minmax(0, 150px) 64px; gap: 8px; align-items: center; padding: 6px 8px; background: #0d1014; border: 1px solid #1f242c; border-radius: 4px; font-size: 13px; }
.ln .side { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font: 700 11px var(--sans); border-radius: 2px; }
.ln .side.c { background: #2a2310; color: var(--cuong); border: 1px solid #6b5a2c; }
.ln .side.n { background: #0f1c17; color: var(--nhu); border: 1px solid var(--jade-dark); }
.ln .side.t { background: #1e1229; color: #d9a7ff; border: 1px solid #5b3a7a; }
.ln select { width: 100%; min-height: 32px; background: #0a0b0e; border: 1px solid #3a3f48; border-radius: 3px; color: #ece7d8; font: inherit; font-size: 13px; padding: 0 6px; }
.ln input[type="range"] { width: 100%; accent-color: var(--jade); }
.ln .rv { text-align: right; font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; }
.ln .rv small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.ln.empty { border-style: dashed; color: var(--muted); }
.pk-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid #1f242c; }
.prev { padding: 12px 14px; border: 1px solid #5a2620; border-radius: 5px; background: linear-gradient(180deg, #1a0f0e, #0d1014 70%); display: flex; gap: 12px; }
.prev img { width: 56px; height: 56px; image-rendering: pixelated; border: 1px solid #5a2620; border-radius: 3px; background: #090a0d; padding: 3px; }
.prev b { font: 700 18px var(--serif); }
.prev p { margin: 4px 0 0; font-size: 13px; color: #e8c9c3; line-height: 1.5; }
.delta-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; font-size: 13px; background: #0f1c17; border: 1px solid var(--jade-dark); border-radius: 3px; color: var(--jade-light); }

/* ---------- phone ---------- */
.mbar { display: none; }
@media (max-width: 1100px) {
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .sim-side { position: static; order: -1; }
  .save-card { display: none; }
  .res-grid .rc, .res-grid .rc.w7, .res-grid .rc.w5, .res-grid .rc.w4, .res-grid .rc.w8 { grid-column: span 12; }
  .picker-b { grid-template-columns: minmax(0, 1fr); }
  .pk-list { border-right: 0; border-bottom: 1px solid #1f242c; }
  .pk-items { max-height: 300px; }
}
@media (max-width: 760px) {
  .sim-top .wrap { padding-top: 20px; }
  .btab { min-height: 44px; padding: 0 10px; font-size: 13.5px; }
  .btab small { display: none; }
  .btabs { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 16px); margin-right: -16px; scrollbar-width: none; }
  .btab { flex: none; }
  .acts { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .acts .btn-lock { grid-column: 1 / -1; }
  .hm { display: none; }
  .tbl .bport { width: 26px; height: 26px; margin-right: 6px; }
  .tbl.mid td:first-child { white-space: normal; }
  .acts .btn { padding: 0 8px; min-width: 0; }
  .sim-top h1 span { display: block; font-size: 15px !important; }
  body:not(.free) .sheet .oc { display: none; }
  .ovr { width: 60px; }
  .sk { grid-template-columns: auto minmax(0, 1fr); }
  .sk .lvl, .sk > .chk { grid-column: 2; justify-self: start; }
  .acts .btn .t-long { display: none; }
  .sim-layout { padding-top: 16px; gap: 14px; }
  .jump { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .jump a { flex: none; }
  .ssec > summary { padding: 12px 14px; }
  .ssec > summary h2 { font-size: 18px; }
  .ssec > summary .sum-r { display: none; }
  .sbody { padding: 14px; gap: 14px; }
  .frow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .frow.w2 { grid-template-columns: minmax(0, 1fr); }
  .sheet .srccol { display: none; }
  .gear-grid, .cards2, .skills, .toggles { grid-template-columns: minmax(0, 1fr); }
  .bosses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big .num { font-size: 40px; }
  .res-head h2 { font-size: 24px; }
  .brk .row { grid-template-columns: 24px minmax(0, 1fr) 58px 40px; }
  .brk .row .bar { grid-column: 2 / -1; grid-row: 2; }
  .wf .st { grid-template-columns: minmax(0, 1fr) 64px 76px; }
  .hitpair b { font-size: 18px; }
  .modal { padding: 0; }
  .picker { border-radius: 0; border-left: 0; border-right: 0; }
  .ln { grid-template-columns: 22px minmax(0, 1fr) 64px; }
  .ln input[type="range"] { grid-column: 2 / 3; }
  .ln .rv { grid-column: 3; }
  .ln .tier { grid-column: 3; grid-row: 1; }
  .pvp-vs { grid-template-columns: minmax(0, 1fr); }
  .pvp-vs .vs { justify-self: center; }
  .res { padding-bottom: 110px; }
  .mbar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 12, 15, 0.96); border-top: 1px solid var(--jade-dark); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5); }
  .mbar .n { font: 700 24px/1 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
  .mbar small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
  .mbar .btn { margin-left: auto; min-height: 42px; padding: 0 16px; }
  .mbar .d { font-size: 12.5px; color: var(--jade-light); font-weight: 600; }
}

/* ======================================================================================================
   Trang thật (19/11): những gì bản duyệt chưa có — trạng thái chạy, cổng thử nghiệm kín, nút khóa "sắp có",
   bàn phím, hộp chọn món đọc dữ liệu máy chủ.
   ====================================================================================================== */
body.sim { --c: #7fb8f0; --d: #d9a7ff; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 60; padding: 8px 14px; background: var(--jade); color: #06110c; font-weight: 600; }
.skip:focus { left: 8px; }
.h1-sub { font: 500 18px var(--sans); color: var(--muted); }
.sim-chip.mock { color: #d9c7ff; border-color: #4a3a6a; }
.sim-chip.mock i { background: #a983ff; box-shadow: 0 0 0 2px #0b0c0f, 0 0 0 3px #4a3a6a; }
.sim-chip[hidden] { display: none; }

/* keyboard focus everywhere a mouse can click */
body.sim button:focus-visible, body.sim a:focus-visible, body.sim summary:focus-visible, body.sim [tabindex]:focus-visible,
body.sim input[type="checkbox"]:focus-visible, body.sim input[type="range"]:focus-visible {
  outline: 2px solid var(--jade-light); outline-offset: 2px; }
.ssec > summary:focus-visible { outline-offset: -2px; border-radius: 6px; }
.tg select:focus, .ln select:focus, .ln input:focus, .ovr:focus, .linkbox input:focus, .sk .pick select:focus { outline: 2px solid var(--jade); outline-offset: 1px; }

/* build tabs: C, D and a close cross */
.btab.c .dot { background: var(--c); color: #06101c; } .btab.c[aria-selected="true"] { border-color: #2f5a7a; box-shadow: inset 0 3px 0 var(--c); }
.btab.d .dot { background: var(--d); color: #170c22; } .btab.d[aria-selected="true"] { border-color: #5b3a7a; box-shadow: inset 0 3px 0 var(--d); }
.btab .x { margin-left: 4px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; color: #8f9a93; font-size: 15px; }
.btab .x:hover { background: #1a1e25; color: #fff; }
.btab.add:disabled { opacity: 0.45; cursor: not-allowed; }

/* "sắp có": seen but locked (PvP, Nhập nhân vật) */
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.7; }
.btn-lock:disabled:hover { border-color: #5a4c27; color: #c9b98a; }
.soon { display: inline-block; margin-left: 2px; padding: 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: #8f8466; border: 1px solid #3d3524;
  border-radius: 3px; background: #14120b; line-height: 18px; }
.ttabs button[aria-disabled="true"] { color: #6d746f; border-style: dashed; cursor: not-allowed; }
.ttabs button .soon { margin-left: 4px; }
.soon-card { opacity: 0.8; border-style: dashed; }

/* closed test, paused, offline */
.gate { padding-top: 28px; padding-bottom: 80px; }
.gate[hidden] { display: none; }
.gate-box { display: flex; gap: 18px; align-items: flex-start; max-width: 760px; padding: 22px 24px; background: var(--panel); border: 1px solid #6b5a2c;
  border-left: 4px solid var(--b); border-radius: 6px; }
.gate-box h2 { margin: 0 0 6px; font: 700 24px/1.25 var(--serif); color: var(--title); }
.gate-box p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.gate-box b { color: var(--gold); }
.gate-ico { flex: none; width: 44px; height: 44px; border: 2px solid #6b5a2c; border-radius: 50%; position: relative; background: #17140c; }
.gate-ico::before { content: ''; position: absolute; left: 13px; top: 19px; width: 14px; height: 11px; border: 2px solid var(--b); border-radius: 2px; }
.gate-ico::after { content: ''; position: absolute; left: 16px; top: 10px; width: 8px; height: 9px; border: 2px solid var(--b); border-bottom: 0; border-radius: 6px 6px 0 0; }
.gate.paused .gate-box { border-color: var(--jade-dark); border-left-color: var(--jade); }
.gate.paused .gate-ico { border-color: var(--jade-dark); background: #0f1c17; }
.gate.paused .gate-ico::before { left: 12px; top: 11px; width: 6px; height: 18px; border: 0; background: var(--jade-light); border-radius: 1px; }
.gate.paused .gate-ico::after { left: 22px; top: 11px; width: 6px; height: 18px; border: 0; background: var(--jade-light); border-radius: 1px; }
.gate-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gate-acts:empty { display: none; }
.gate-acts .btn { min-height: 40px; font-size: 14px; }
body.gated .sim-layout, body.gated .res, body.gated .mbar, body.gated .sim-bar { display: none !important; }

/* the result card while a run is on its way: the old numbers dimmed */
.rbody, .res-grid { transition: opacity 0.2s; }
.rcard.stale .rbody, .res.stale .res-grid { opacity: 0.45; }
.run.busy { color: var(--gold); } .run.busy i { background: var(--gold); animation-duration: 0.6s; }
.run.err { color: #f3a99f; } .run.err i { background: var(--red); animation: none; }
.run.idle i { animation: none; opacity: 0.5; }
.rerr { margin: 0 16px 12px; padding: 9px 12px; font-size: 13px; line-height: 1.5; color: #f3d3ce; background: #1d1110; border: 1px solid #6a2a24; border-radius: 3px; }
.rerr.paused { color: #cfeedd; background: #0f1c17; border-color: var(--jade-dark); }
.rerr[hidden] { display: none; }
.free-tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 700; color: #1c1204; background: var(--b); border-radius: 2px; letter-spacing: 0.04em; }
.big .delta.dn { color: #f3a99f; }
.big .delta .muted { color: var(--muted); font-weight: 500; }
.loading { margin: 0; color: var(--muted); font-size: 14px; }
.empty-note { margin: 0; padding: 14px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed #262b33; border-radius: 4px; }
.mini-btn { margin-left: 10px; min-height: 28px; padding: 0 10px; font: inherit; font-size: 12.5px; color: #cfd6d0; background: #12151a; border: 1px solid #343a44; border-radius: 3px; cursor: pointer; }
.mini-btn:hover { border-color: var(--jade); color: #fff; }
.mini-btn:disabled { opacity: 0.4; cursor: default; }

/* fields */
.fld .hint { margin: 0; }
.fld.bad input, .fld.bad select { border-color: var(--red); }
.seg button:disabled { color: #5d655f; cursor: not-allowed; background: repeating-linear-gradient(45deg, #101318 0 4px, #0e1115 4px 8px); }
body.free tr.over td.v { color: var(--gold); }

/* gear: a slot head is a button into the picker */
.slot-h { width: 100%; background: none; border: 0; border-bottom: 1px solid #1c2027; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.slot-h:hover b { text-decoration: underline; text-decoration-color: #3a414b; }
.slot.empty { border-style: dashed; }
.slot.empty .slot-h .ico { opacity: 0.35; }
.slot .lines li.dim { color: var(--muted); }
.slot .lines li.dim::before { background: #3a414b; }
.slot .lines li.warn { color: #f3a99f; }
.slot .lines li.warn::before { background: var(--red); }

/* skills: khiếu selects drawn as the round icons of the mockup (a native <select> keeps keyboard and screen readers) */
.kh select { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid #3a404a; border-radius: 50%;
  background: #08090c center / 22px 22px no-repeat; color: transparent; font-size: 13px; cursor: pointer; image-rendering: pixelated; }
.kh select option { color: #ece7d8; background: #0a0b0e; }
.kh select.none { border-style: dashed; }
.kh select.r { border-color: var(--red); box-shadow: 0 0 0 1px #2a1311, 0 0 6px rgba(255, 107, 90, 0.45); }
.kh select:disabled { background-image: repeating-linear-gradient(45deg, #15181d 0 3px, #0e1115 3px 6px) !important; border-color: #262b33; cursor: not-allowed; }
.kh .fx { margin-left: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk .pick { min-width: 0; }
.sk .pick select { max-width: 100%; min-height: 28px; background: #0a0b0e; border: 1px solid #343a44; border-radius: 3px; color: var(--title); font: inherit;
  font-size: 14px; font-weight: 600; padding: 0 4px; }
.sk.off .key img { opacity: 0.55; }
.lvl button:disabled { color: #4a5048; cursor: not-allowed; }
.lvl button:not(:disabled):hover { background: #1a1e25; color: #fff; }
.rot > span { cursor: default; }
.rot .mv { display: inline-flex; gap: 2px; margin-left: 4px; }
.rot .mv button { width: 22px; height: 22px; padding: 0; background: #0e1115; border: 1px solid #2c323b; border-radius: 2px; color: #b9c1bb; font-size: 11px; line-height: 1; cursor: pointer; }
.rot .mv button:disabled { opacity: 0.3; cursor: default; }

/* targets: bosses are buttons */
.boss { font: inherit; color: inherit; }
.boss:hover { border-color: #3a414b; }
.boss.on:hover { border-color: var(--jade); }
.boss[hidden] { display: none; }

/* saved builds */
.saved li { align-items: center; }
.saved li button.load { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 8px; padding: 0; background: none; border: 0; color: inherit; font: inherit;
  text-align: left; cursor: pointer; }
.saved li button.load b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved li button.del { flex: none; width: 24px; height: 24px; padding: 0; background: none; border: 1px solid transparent; border-radius: 3px; color: #7f8a83; cursor: pointer; }
.saved li button.del:hover { border-color: #6a2a24; color: #ffb4aa; }
.saved li.none { color: var(--muted); background: none; border-style: dashed; }

/* toasts */
.sim-toasts { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.sim-toasts .t { padding: 10px 16px; background: #0f1c17; border: 1px solid var(--jade-dark); border-radius: 4px; color: var(--jade-light); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.sim-toasts .t.bad { background: #1d1110; border-color: #6a2a24; color: #ffb4aa; }

/* the picker (real): list items are buttons, empty lines, rune rows */
.modal[hidden] { display: none; }
.pk-item { width: 100%; font: inherit; color: inherit; text-align: left; }
.pk-item .pill.cur { color: #ffb4aa; border-color: #6a2a24; background: #1d1110; }
.pk-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.prev.plain { border-color: #262b33; background: #0d1014; }
.prev.plain img { border-color: #2c323b; }
.prev p { color: #c9cec8; }
.prev.uq p { color: #e8c9c3; }
.ln { grid-template-columns: 22px minmax(0, 1fr) 76px minmax(0, 150px) 64px 22px; }
.ln .side { cursor: pointer; padding: 0; }
.ln.fixed .side { cursor: default; }
.ln .rm { width: 22px; height: 22px; padding: 0; background: none; border: 1px solid #343a44; border-radius: 3px; color: #8f9a93; cursor: pointer; }
.ln .rm:hover { color: #ffb4aa; border-color: #6a2a24; }
.ln .rm:disabled { visibility: hidden; }
.ln .tier-sel { min-height: 30px; }
.add-line { align-self: flex-start; }
.pk-note { margin: 0; font-size: 12.5px; color: #f3a99f; }
.pk-foot .grow { margin-right: auto; }

@media (max-width: 760px) {
  .h1-sub { display: block; font-size: 15px; }
  .gate { padding-top: 18px; }
  .gate-box { flex-direction: column; padding: 18px 16px; }
  .ln { grid-template-columns: 22px minmax(0, 1fr) 64px 22px; }
  .ln .tier-sel { grid-column: 2; grid-row: 2; }
  .ln input[type="range"] { grid-column: 2 / 3; grid-row: 3; }
  .ln .rv { grid-column: 3; grid-row: 2 / 4; }
  .ln .rm { grid-column: 4; grid-row: 1; }
  .ln .tier { grid-column: 3; grid-row: 1; }
  .rc h3 { flex-wrap: wrap; }
  .rc h3 small { margin-left: 0; flex-basis: 100%; order: 2; }
  .sim-toasts { bottom: 86px; }
  .btab .x { display: none; }
}

/* result card extras: what the server clamped or did not simulate, the error box's list */
.adj { margin-top: 4px; font-size: 12.5px; color: var(--text-2); border-top: 1px dashed #262b33; padding-top: 8px; }
.adj > summary { cursor: pointer; color: var(--gold); font-weight: 600; list-style: none; }
.adj > summary::-webkit-details-marker { display: none; }
.adj > summary::before { content: '▸ '; }
.adj[open] > summary::before { content: '▾ '; }
.adj ul { margin: 6px 0 8px; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.adj li span { color: var(--muted); }
.adj li.ign { color: var(--muted); }
.rerr ul { margin: 6px 0 0; padding-left: 18px; }
.res-notes { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.res-notes li::before { content: '· '; color: var(--jade); }
.res-notes:empty { display: none; }
.boss-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.boss-bar .mini-btn { margin-left: 0; }
.boss-bar .hint { margin: 0; }
.wf .st small.meas { display: inline-block; margin-top: 2px; padding: 0 5px; font-size: 10.5px; color: var(--gold); border: 1px solid #6b5a2c; border-radius: 2px; }
.hitpair small.obs { margin-top: 2px; letter-spacing: 0; text-transform: none; }
.brk .row .ico-dot { width: 12px; height: 12px; margin: 0 6px; border-radius: 2px; }
.k-khac { background: #6f7a73; }
.sk .key .ico-empty { display: block; width: 44px; height: 44px; border: 1px dashed #3a404a; border-radius: 3px; background: #090a0d; }
.mon-art { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.fld.span-all { grid-column: 1 / -1; }
.slot-h .ico:not(img) { display: block; flex: none; }
.lines .lg { display: inline-block; margin-left: 4px; padding: 0 4px; font-size: 10.5px; line-height: 15px; color: var(--muted); border: 1px solid #343a44; border-radius: 2px; vertical-align: 1px; }
.sk .pick select { width: 100%; }
.fld > span.val { display: block; }
body.gated .sim-chips .sim-chip:not(.warn) { display: none; }
.fgrp button.uqf { color: var(--red); border-color: #6a2a24; background: #1d1110; }
.fgrp button.uqf[aria-pressed="true"] { color: #ffb4aa; border-color: var(--red); }
.ign-tag { display: inline-block; margin-left: 6px; padding: 0 5px; font: 600 10.5px/16px var(--sans); letter-spacing: 0.02em; color: #c9b98a;
  border: 1px dashed #5a4c27; border-radius: 2px; background: #14120b; vertical-align: 1px; white-space: nowrap; text-transform: none; }
.fld > span .ign-tag { margin-left: auto; }
.kv { grid-template-columns: minmax(0, 1fr) auto; }
.kv > span { min-width: 7em; }
.kv-flags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.kv-flags span { padding: 1px 7px; font-size: 12px; color: #f1dfb0; background: #241a0a; border: 1px solid #6b5a2c; border-radius: 3px; }
.fld.has-ign > span em { display: none; }

/* ---------- vòng 2 (hợp đồng 8fcb66984): pháp bảo đủ, linh thú đủ, giá trị suy ra, Thử DPS ---------- */
.derived { min-height: 40px; display: flex; align-items: center; padding: 0 10px; background: #0d1014; border: 1px dashed #343a44; border-radius: 3px; font-size: 14px; color: var(--text-2); }
.derived b { color: var(--jade-light); font-weight: 600; }
.derived .dim { color: var(--muted); }
.box-wide { grid-column: 1 / -1; }
.box .out:empty { display: none; }
.box-h small b { color: var(--text-2); }
.red-rolls { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: #1a0f0e; border: 1px solid #3a1d1a; border-radius: 3px; }
.rr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 130px); gap: 8px; align-items: center; font-size: 12.5px; color: #e8c9c3; }
.rr input { width: 100%; accent-color: var(--red); }
.rr b { color: #ffb4aa; }
.pk-item { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 0; }
.pk-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 8px; background: none; border: 0;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pk-main img { width: 34px; height: 34px; image-rendering: pixelated; }
.pk-main b { display: block; font-size: 14px; }
.pk-main small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-btn { flex: none; min-height: 26px; padding: 0 8px; font: inherit; font-size: 12px; color: #9fd9bd; background: #0f1c17; border: 1px dashed var(--jade-dark); border-radius: 3px; cursor: pointer; white-space: nowrap; }
.try-btn:hover { border-style: solid; color: #fff; }
.pill.try.up { color: var(--jade-light); border-color: var(--jade-dark); background: #0f1c17; }
.pill.try.dn { color: #f3a99f; border-color: #6a2a24; background: #1d1110; }
.pill.try.busy { color: var(--gold); border-color: #6b5a2c; }
.sock.old { font: 700 11px var(--sans); color: #c9b98a; border-color: #5a4c27; background: #14120b; }
.k-phu { background: #e08cff; }
.wf .st.tone-r .m { color: #f3a99f; }
.wf .st.tone-g .m { color: var(--jade-light); }
.chk.dis { color: var(--muted); cursor: not-allowed; }
.chk.dis .ign-tag { margin-left: 4px; }
.lines li.imp.ta { color: #d9a7ff; }
@media (max-width: 760px) {
  .box-wide { grid-column: auto; }
  .red-rolls { grid-column: 1 / -1; }
  .rr { grid-template-columns: minmax(0, 1fr); }
}
